@dartech/arsenal-ui 1.4.58 → 1.4.59
Sign up to get free protection for your applications and to get access to all the features.
package/index.js
CHANGED
@@ -2685,6 +2685,7 @@ const ControlDate = _a => {
|
|
2685
2685
|
required,
|
2686
2686
|
label,
|
2687
2687
|
placeholder,
|
2688
|
+
defaultValue,
|
2688
2689
|
format: format$1 = DATE_DEFAULT_FORMAT,
|
2689
2690
|
hideErrorMessage = false,
|
2690
2691
|
textFieldProps = {},
|
@@ -2692,7 +2693,7 @@ const ControlDate = _a => {
|
|
2692
2693
|
validate,
|
2693
2694
|
validateErrorText
|
2694
2695
|
} = _a,
|
2695
|
-
datePickerProps = __rest(_a, ["control", "name", "required", "label", "placeholder", "format", "hideErrorMessage", "textFieldProps", "requiredErrorText", "validate", "validateErrorText"]);
|
2696
|
+
datePickerProps = __rest(_a, ["control", "name", "required", "label", "placeholder", "defaultValue", "format", "hideErrorMessage", "textFieldProps", "requiredErrorText", "validate", "validateErrorText"]);
|
2696
2697
|
const [localFormat, setLocalFormat] = useState(DATE_DEFAULT_FORMAT);
|
2697
2698
|
const defaultValidate = val => {
|
2698
2699
|
if (val === '' || isMatch(val, localFormat)) {
|
@@ -2708,6 +2709,7 @@ const ControlDate = _a => {
|
|
2708
2709
|
} = useController({
|
2709
2710
|
control,
|
2710
2711
|
name,
|
2712
|
+
defaultValue,
|
2711
2713
|
rules: {
|
2712
2714
|
required: required ? requiredErrorText || DEFAULT_REQUIRED_ERROR_TEXT : false,
|
2713
2715
|
validate: validate ? validate : defaultValidate
|
@@ -2769,6 +2771,8 @@ const ControlDateTime = _a => {
|
|
2769
2771
|
name,
|
2770
2772
|
required,
|
2771
2773
|
label,
|
2774
|
+
placeholder,
|
2775
|
+
defaultValue,
|
2772
2776
|
format: format$1 = DATE_TIME_DEFAULT_FORMAT,
|
2773
2777
|
hideErrorMessage = false,
|
2774
2778
|
textFieldProps,
|
@@ -2776,7 +2780,7 @@ const ControlDateTime = _a => {
|
|
2776
2780
|
validate,
|
2777
2781
|
validateErrorText
|
2778
2782
|
} = _a,
|
2779
|
-
dateTimePickerProps = __rest(_a, ["control", "name", "required", "label", "format", "hideErrorMessage", "textFieldProps", "requiredErrorText", "validate", "validateErrorText"]);
|
2783
|
+
dateTimePickerProps = __rest(_a, ["control", "name", "required", "label", "placeholder", "defaultValue", "format", "hideErrorMessage", "textFieldProps", "requiredErrorText", "validate", "validateErrorText"]);
|
2780
2784
|
const [localFormat, setLocalFormat] = useState();
|
2781
2785
|
const defaultValidate = val => {
|
2782
2786
|
if (val === '' || isMatch(val, localFormat)) {
|
@@ -2792,6 +2796,7 @@ const ControlDateTime = _a => {
|
|
2792
2796
|
} = useController({
|
2793
2797
|
control,
|
2794
2798
|
name,
|
2799
|
+
defaultValue,
|
2795
2800
|
rules: {
|
2796
2801
|
required: required ? requiredErrorText || DEFAULT_REQUIRED_ERROR_TEXT : false,
|
2797
2802
|
validate: validate ? validate : defaultValidate
|
@@ -2825,7 +2830,7 @@ const ControlDateTime = _a => {
|
|
2825
2830
|
OpenPickerIcon: DateIconComponent
|
2826
2831
|
}
|
2827
2832
|
}, dateTimePickerProps, {
|
2828
|
-
renderInput:
|
2833
|
+
renderInput: props => jsx(TextField, Object.assign({}, props, {
|
2829
2834
|
fullWidth: true,
|
2830
2835
|
size: "small",
|
2831
2836
|
sx: {
|
@@ -2833,6 +2838,9 @@ const ControlDateTime = _a => {
|
|
2833
2838
|
color: '#D6331F'
|
2834
2839
|
}
|
2835
2840
|
},
|
2841
|
+
inputProps: Object.assign(Object.assign({}, props.inputProps), {
|
2842
|
+
placeholder: placeholder
|
2843
|
+
}),
|
2836
2844
|
variant: "outlined",
|
2837
2845
|
name: name,
|
2838
2846
|
error: !!error,
|
@@ -2854,12 +2862,14 @@ const ControlTime = _a => {
|
|
2854
2862
|
format: format$1 = TIME_DEFAULT_FORMAT,
|
2855
2863
|
hideErrorMessage = false,
|
2856
2864
|
requiredErrorText = '',
|
2857
|
-
placeholder
|
2865
|
+
placeholder,
|
2866
|
+
defaultValue
|
2858
2867
|
} = _a,
|
2859
|
-
timePickerProps = __rest(_a, ["control", "name", "required", "label", "textFieldProps", "format", "hideErrorMessage", "requiredErrorText", "placeholder"]);
|
2868
|
+
timePickerProps = __rest(_a, ["control", "name", "required", "label", "textFieldProps", "format", "hideErrorMessage", "requiredErrorText", "placeholder", "defaultValue"]);
|
2860
2869
|
const _b = useController({
|
2861
2870
|
control,
|
2862
2871
|
name,
|
2872
|
+
defaultValue,
|
2863
2873
|
rules: {
|
2864
2874
|
required: required ? requiredErrorText || DEFAULT_REQUIRED_ERROR_TEXT : false,
|
2865
2875
|
validate: val => {
|
package/package.json
CHANGED
@@ -20,6 +20,7 @@ type ControlDateProps = Partial<DatePickerProps<unknown, unknown>> & {
|
|
20
20
|
requiredErrorText?: string;
|
21
21
|
validate?: Validate<any, any>;
|
22
22
|
validateErrorText?: string;
|
23
|
+
defaultValue?: string;
|
23
24
|
};
|
24
|
-
export declare const ControlDate: ({ control, name, required, label, placeholder, format, hideErrorMessage, textFieldProps, requiredErrorText, validate, validateErrorText, ...datePickerProps }: ControlDateProps) => JSX.Element;
|
25
|
+
export declare const ControlDate: ({ control, name, required, label, placeholder, defaultValue, format, hideErrorMessage, textFieldProps, requiredErrorText, validate, validateErrorText, ...datePickerProps }: ControlDateProps) => JSX.Element;
|
25
26
|
export default ControlDate;
|
@@ -13,12 +13,14 @@ type dateTimePickerProps = Partial<DateTimePickerProps<unknown, unknown>> & {
|
|
13
13
|
required?: boolean;
|
14
14
|
name: string;
|
15
15
|
label?: ReactNode;
|
16
|
+
placeholder?: string;
|
16
17
|
format?: string;
|
17
18
|
hideErrorMessage?: boolean;
|
18
19
|
textFieldProps?: TextFieldProps;
|
19
20
|
requiredErrorText?: string;
|
20
21
|
validate?: Validate<any, any>;
|
21
22
|
validateErrorText?: string;
|
23
|
+
defaultValue?: string;
|
22
24
|
};
|
23
|
-
export declare const ControlDateTime: ({ control, name, required, label, format, hideErrorMessage, textFieldProps, requiredErrorText, validate, validateErrorText, ...dateTimePickerProps }: dateTimePickerProps) => JSX.Element;
|
25
|
+
export declare const ControlDateTime: ({ control, name, required, label, placeholder, defaultValue, format, hideErrorMessage, textFieldProps, requiredErrorText, validate, validateErrorText, ...dateTimePickerProps }: dateTimePickerProps) => JSX.Element;
|
24
26
|
export default ControlDateTime;
|
@@ -18,6 +18,7 @@ type Props = Partial<TimePickerProps<unknown, unknown>> & {
|
|
18
18
|
format?: string;
|
19
19
|
hideErrorMessage?: boolean;
|
20
20
|
requiredErrorText?: string;
|
21
|
+
defaultValue?: string;
|
21
22
|
};
|
22
|
-
export declare const ControlTime: ({ control, name, required, label, textFieldProps, format, hideErrorMessage, requiredErrorText, placeholder, ...timePickerProps }: Props) => JSX.Element;
|
23
|
+
export declare const ControlTime: ({ control, name, required, label, textFieldProps, format, hideErrorMessage, requiredErrorText, placeholder, defaultValue, ...timePickerProps }: Props) => JSX.Element;
|
23
24
|
export default ControlTime;
|