|
1 | 1 | import React, { useEffect, useRef, useState, useImperativeHandle, useCallback, DOMAttributes } from 'react';
|
2 |
| -// import PropTypes from 'prop-types'; |
3 |
| -// import {type} from 'jb-date-input'; |
4 | 2 | import 'jb-date-input';
|
5 | 3 | // eslint-disable-next-line no-duplicate-imports
|
6 | 4 | import { JBDateInputWebComponent, JBDateInputInputTypes, JBDateInputValidationItem, JBDDateInputInboxElementWebComponent,JBDateInputValueObject } from 'jb-date-input';
|
@@ -50,6 +48,7 @@ export type JBDateInputProps = {
|
50 | 48 | required?: boolean,
|
51 | 49 | calendarDefaultDateView?:{ year:number, month: number, dateType:JBDateInputInputTypes},
|
52 | 50 | usePersianNumber?: boolean,
|
| 51 | + placeholder:string | null | undefined, |
53 | 52 | children?:any,
|
54 | 53 | }
|
55 | 54 |
|
@@ -125,6 +124,11 @@ export const JBDateInput = React.forwardRef((props: JBDateInputProps, ref) => {
|
125 | 124 | element.current.value = props.value;
|
126 | 125 | }
|
127 | 126 | }, [props.value]);
|
| 127 | + useEffect(() => { |
| 128 | + if (element.current && props.placeholder !== undefined) { |
| 129 | + element.current.placeholder = props.placeholder; |
| 130 | + } |
| 131 | + }, [props.placeholder]); |
128 | 132 | useEffect(() => {
|
129 | 133 | if (element.current) {
|
130 | 134 | if(typeof props.style == "string"){
|
@@ -168,24 +172,3 @@ export const JBDateInput = React.forwardRef((props: JBDateInputProps, ref) => {
|
168 | 172 | );
|
169 | 173 | });
|
170 | 174 | JBDateInput.displayName = "JBDateInput";
|
171 |
| -// JBDateInput.propTypes = { |
172 |
| -// label: PropTypes.string, |
173 |
| -// name:PropTypes.string, |
174 |
| -// className:PropTypes.string, |
175 |
| -// min: PropTypes.string, |
176 |
| -// max: PropTypes.string, |
177 |
| -// format: PropTypes.string, |
178 |
| -// onKeyup: PropTypes.func, |
179 |
| -// onChange: PropTypes.func, |
180 |
| -// onSelect: PropTypes.func, |
181 |
| -// valueType: PropTypes.oneOf(['GREGORIAN', 'JALALI', 'TIME_STAMP']), |
182 |
| -// inputType: PropTypes.oneOf(['GREGORIAN', 'JALALI']), |
183 |
| -// direction: PropTypes.oneOf(['ltr', 'rtl']), |
184 |
| -// value: PropTypes.string, |
185 |
| -// validationList: PropTypes.array, |
186 |
| -// required: PropTypes.bool, |
187 |
| -// calendarDefaultDateView: PropTypes.shape({ year: PropTypes.number.isRequired, month: PropTypes.number.isRequired, dateType: PropTypes.oneOf<JBDateInputInputTypes>([JBDateInputInputTypes.gregorian, JBDateInputInputTypes.jalali]).isRequired }), |
188 |
| -// // calendarDefaultDateView: PropTypes.object, |
189 |
| -// usePersianNumber: PropTypes.bool, |
190 |
| -// // children:PropTypes.element |
191 |
| -// }; |
0 commit comments