@torq-north/react-tools 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -701,9 +701,9 @@ var CheckboxFormField = function (_a) {
|
|
|
701
701
|
|
|
702
702
|
var DateFormField = function (_a) {
|
|
703
703
|
var _b;
|
|
704
|
-
var name = _a.name, label = _a.label, required = _a.required, icon = _a.icon, showSpace = _a.showSpace, slotProps = _a.slotProps, disabled = _a.disabled, helperText = _a.helperText, format = _a.format, _c = _a.validators, validators = _c === void 0 ? [] : _c;
|
|
705
|
-
var
|
|
706
|
-
? composeValidators.apply(void 0, __spreadArray(__spreadArray([], validators, false), [isRequired], false)) : composeValidators.apply(void 0, validators) }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.field)), input =
|
|
704
|
+
var name = _a.name, label = _a.label, required = _a.required, icon = _a.icon, showSpace = _a.showSpace, slotProps = _a.slotProps, disabled = _a.disabled, helperText = _a.helperText, format = _a.format, _c = _a.validators, validators = _c === void 0 ? [] : _c, _d = _a.formatAsDate, formatAsDate = _d === void 0 ? false : _d;
|
|
705
|
+
var _e = useField(name, __assign({ format: format, validate: required
|
|
706
|
+
? composeValidators.apply(void 0, __spreadArray(__spreadArray([], validators, false), [isRequired], false)) : composeValidators.apply(void 0, validators) }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.field)), input = _e.input, meta = _e.meta;
|
|
707
707
|
var datePickerProps = deepmerge({
|
|
708
708
|
label: label,
|
|
709
709
|
disabled: disabled,
|
|
@@ -720,7 +720,9 @@ var DateFormField = function (_a) {
|
|
|
720
720
|
},
|
|
721
721
|
},
|
|
722
722
|
}, (_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.datePicker) !== null && _b !== void 0 ? _b : {});
|
|
723
|
-
return (jsx(FieldWrapper, { icon: icon, showSpace: showSpace, children: jsx(DatePicker, __assign({ value: input.value ? dayjs(input.value) : null, onChange: function (value) {
|
|
723
|
+
return (jsx(FieldWrapper, { icon: icon, showSpace: showSpace, children: jsx(DatePicker, __assign({ value: input.value ? dayjs(input.value) : null, onChange: function (value) {
|
|
724
|
+
return input.onChange(formatAsDate ? value === null || value === void 0 ? void 0 : value.format("YYYY-MM-DD") : value === null || value === void 0 ? void 0 : value.toJSON());
|
|
725
|
+
} }, datePickerProps)) }));
|
|
724
726
|
};
|
|
725
727
|
|
|
726
728
|
var DateTimeFormField = function (_a) {
|