@elliemae/ds-form-date-time-picker 3.53.0-alpha.1 → 3.53.0-alpha.2
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/cjs/ControlledDateTimePicker.js +4 -4
- package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useChangeHandlers.js +19 -19
- package/dist/cjs/config/useChangeHandlers.js.map +2 -2
- package/dist/cjs/config/useGetFlags.js +1 -1
- package/dist/cjs/config/useGetFlags.js.map +2 -2
- package/dist/cjs/config/useGetReferences.js.map +2 -2
- package/dist/cjs/config/useRelevantValueFromProps.js +21 -15
- package/dist/cjs/config/useRelevantValueFromProps.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/{ControlledDateTimePickerTypes.js.map → constants/ControlledDateTimePickerTypes.js.map} +1 -1
- package/dist/cjs/constants/index.js +239 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +11 -13
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/parts/ClearButton/ClearButton.js +5 -5
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +6 -6
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js +3 -3
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +5 -5
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +9 -9
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +5 -6
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +13 -13
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +17 -17
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +8 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +5 -5
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +4 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +6 -7
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +11 -9
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +13 -10
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +15 -12
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +12 -9
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +20 -16
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +5 -5
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +7 -8
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Styleds.js +19 -19
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +3 -4
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +84 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/ControlledDateTimePicker.js +3 -3
- package/dist/esm/ControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useChangeHandlers.js +19 -19
- package/dist/esm/config/useChangeHandlers.js.map +2 -2
- package/dist/esm/config/useGetFlags.js +2 -2
- package/dist/esm/config/useGetFlags.js.map +2 -2
- package/dist/esm/config/useGetReferences.js.map +2 -2
- package/dist/esm/config/useRelevantValueFromProps.js +22 -16
- package/dist/esm/config/useRelevantValueFromProps.js.map +2 -2
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/{ControlledDateTimePickerTypes.js.map → constants/ControlledDateTimePickerTypes.js.map} +1 -1
- package/dist/esm/constants/index.js +209 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +16 -14
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/ClearButton/ClearButton.js +4 -4
- package/dist/esm/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js +5 -5
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +1 -1
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +1 -1
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +6 -6
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +7 -7
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +3 -6
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +8 -2
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +4 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +5 -5
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +5 -6
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +12 -9
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +13 -10
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +11 -8
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +8 -7
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +4 -4
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -8
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Styleds.js +3 -6
- package/dist/esm/parts/Styleds.js.map +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +1 -1
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +1 -1
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +1 -1
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +5 -5
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +61 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/types/ControlledDateTimePicker.d.ts +1 -2
- package/dist/types/ControlledDateTimePickerCTX.d.ts +0 -1
- package/dist/types/config/useFocusTracker.d.ts +0 -1
- package/dist/types/config/useGetFlags.d.ts +0 -1
- package/dist/types/config/useGetReferences.d.ts +3 -4
- package/dist/types/config/useRelevantValueFromProps.d.ts +2 -5
- package/dist/types/constants/index.d.ts +274 -0
- package/dist/types/index.d.ts +6 -8
- package/dist/types/parts/ClearButton/ClearButton.d.ts +0 -1
- package/dist/types/parts/ClearButton/useClearButton.d.ts +0 -1
- package/dist/types/parts/ControlledDateTimePickerContent.d.ts +0 -1
- package/dist/types/parts/DateInputs/DDInput.d.ts +2 -2
- package/dist/types/parts/DateInputs/DateInputs.d.ts +0 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +2 -2
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +2 -2
- package/dist/types/parts/Pickers/Calendar/Calendar.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarContent.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarContext.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarHead.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarMonthDays.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarWrapper.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/Day.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +4 -5
- package/dist/types/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/useKeyboardHandlers.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/Styleds.d.ts +4 -5
- package/dist/types/parts/Pickers/PickersIcons.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/HoursList.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/MeridiemList.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/MinutesList.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/Styleds.d.ts +6 -8
- package/dist/types/parts/Pickers/TimeWheel/TimeWheel.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelContext.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +0 -1
- package/dist/types/parts/Styleds.d.ts +1 -2
- package/dist/types/parts/TimeInputs/HHInput.d.ts +2 -2
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +2 -2
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +2 -2
- package/dist/types/parts/TimeInputs/TimeInputs.d.ts +0 -1
- package/dist/types/react-desc-prop-types.d.ts +36 -8
- package/dist/types/typescript-testing/slot-props.d.ts +1 -0
- package/package.json +14 -13
- package/dist/cjs/ControlledDateTimePickerDatatestid.js +0 -148
- package/dist/cjs/ControlledDateTimePickerDatatestid.js.map +0 -7
- package/dist/cjs/ControlledDateTimePickerDefinitions.js +0 -112
- package/dist/cjs/ControlledDateTimePickerDefinitions.js.map +0 -7
- package/dist/cjs/tests/custom-props/customProps.js +0 -237
- package/dist/cjs/tests/custom-props/customProps.js.map +0 -7
- package/dist/esm/ControlledDateTimePickerDatatestid.js +0 -118
- package/dist/esm/ControlledDateTimePickerDatatestid.js.map +0 -7
- package/dist/esm/ControlledDateTimePickerDefinitions.js +0 -82
- package/dist/esm/ControlledDateTimePickerDefinitions.js.map +0 -7
- package/dist/esm/tests/custom-props/customProps.js +0 -207
- package/dist/esm/tests/custom-props/customProps.js.map +0 -7
- package/dist/types/ControlledDateTimePickerDatatestid.d.ts +0 -112
- package/dist/types/ControlledDateTimePickerDefinitions.d.ts +0 -75
- /package/dist/cjs/{ControlledDateTimePickerTypes.js → constants/ControlledDateTimePickerTypes.js} +0 -0
- /package/dist/esm/{ControlledDateTimePickerTypes.js → constants/ControlledDateTimePickerTypes.js} +0 -0
- /package/dist/types/{ControlledDateTimePickerTypes.d.ts → constants/ControlledDateTimePickerTypes.d.ts} +0 -0
|
@@ -35,16 +35,16 @@ module.exports = __toCommonJS(ControlledDateTimePicker_exports);
|
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
-
var import_ControlledDateTimePickerDefinitions = require("./ControlledDateTimePickerDefinitions.js");
|
|
39
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
38
|
var import_useControlledDateTimePicker = require("./config/useControlledDateTimePicker.js");
|
|
41
|
-
var
|
|
39
|
+
var import_constants = require("./constants/index.js");
|
|
42
40
|
var import_ControlledDateTimePickerCTX = require("./ControlledDateTimePickerCTX.js");
|
|
41
|
+
var import_ControlledDateTimePickerContent = require("./parts/ControlledDateTimePickerContent.js");
|
|
42
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
43
43
|
const DSControlledDateTimePicker = (props) => {
|
|
44
44
|
const ctx = (0, import_useControlledDateTimePicker.useControlledDateTimePicker)(props);
|
|
45
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ControlledDateTimePickerContent.ControlledDateTimePickerContent, {}) });
|
|
46
46
|
};
|
|
47
|
-
DSControlledDateTimePicker.displayName =
|
|
47
|
+
DSControlledDateTimePicker.displayName = import_constants.DSControlledDateTimePickerName;
|
|
48
48
|
const DSControlledDateTimePickerWithSchema = (0, import_ds_props_helpers.describe)(DSControlledDateTimePicker);
|
|
49
49
|
DSControlledDateTimePickerWithSchema.propTypes = import_react_desc_prop_types.propTypes;
|
|
50
50
|
//# sourceMappingURL=ControlledDateTimePicker.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ControlledDateTimePicker.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useControlledDateTimePicker } from './config/useControlledDateTimePicker.js';\nimport { DSControlledDateTimePickerName } from './constants/index.js';\nimport { ControlledDateTimePickerContext } from './ControlledDateTimePickerCTX.js';\nimport { ControlledDateTimePickerContent } from './parts/ControlledDateTimePickerContent.js';\nimport type { DSControlledDateTimePickerT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\n\nconst DSControlledDateTimePicker = (props: DSControlledDateTimePickerT.Props): JSX.Element => {\n const ctx = useControlledDateTimePicker(props);\n return (\n <ControlledDateTimePickerContext.Provider value={ctx}>\n <ControlledDateTimePickerContent />\n </ControlledDateTimePickerContext.Provider>\n );\n};\n\nDSControlledDateTimePicker.displayName = DSControlledDateTimePickerName;\nconst DSControlledDateTimePickerWithSchema = describe(DSControlledDateTimePicker);\nDSControlledDateTimePickerWithSchema.propTypes = propTypes;\n\nexport { DSControlledDateTimePicker, DSControlledDateTimePickerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADajB;AAZN,8BAAyB;AACzB,yCAA4C;AAC5C,uBAA+C;AAC/C,yCAAgD;AAChD,6CAAgD;AAEhD,mCAA0B;AAE1B,MAAM,6BAA6B,CAAC,UAA0D;AAC5F,QAAM,UAAM,gEAA4B,KAAK;AAC7C,SACE,4CAAC,mEAAgC,UAAhC,EAAyC,OAAO,KAC/C,sDAAC,0EAAgC,GACnC;AAEJ;AAEA,2BAA2B,cAAc;AACzC,MAAM,2CAAuC,kCAAS,0BAA0B;AAChF,qCAAqC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,7 +38,7 @@ var import_timeHelpers = require("../utils/timeHelpers.js");
|
|
|
38
38
|
var import_stringHelpers = require("../utils/stringHelpers.js");
|
|
39
39
|
var import_constants = require("../utils/constants.js");
|
|
40
40
|
const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnType, focusTrackers }) => {
|
|
41
|
-
const {
|
|
41
|
+
const { tempDateStringRef, tempTimeStringRef } = relevantValues;
|
|
42
42
|
const {
|
|
43
43
|
getIsDisabledDay,
|
|
44
44
|
getIsOutOfRangeDay,
|
|
@@ -60,34 +60,34 @@ const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnTyp
|
|
|
60
60
|
const { trackFocusFirstSegment } = focusTrackers;
|
|
61
61
|
const getDateMetaInfo = (0, import_react.useCallback)(
|
|
62
62
|
(newDateString = null, metaInfo = {}) => {
|
|
63
|
-
const finalDateString = newDateString ||
|
|
63
|
+
const finalDateString = newDateString || tempDateStringRef.current;
|
|
64
64
|
const finalMetaInfo = {
|
|
65
65
|
...metaInfo,
|
|
66
66
|
...(0, import_dateHelpers.getValidationDateStringMetaInfo)(finalDateString, getIsOutOfRangeDay, getIsDisabledDay)
|
|
67
67
|
};
|
|
68
68
|
return finalMetaInfo;
|
|
69
69
|
},
|
|
70
|
-
[
|
|
70
|
+
[tempDateStringRef, getIsDisabledDay, getIsOutOfRangeDay]
|
|
71
71
|
);
|
|
72
72
|
const getTimeMetaInfo = (0, import_react.useCallback)(
|
|
73
73
|
(newTimeString = null, metaInfo = {}) => {
|
|
74
|
-
const finalTimeString = newTimeString ||
|
|
74
|
+
const finalTimeString = newTimeString || tempTimeStringRef.current;
|
|
75
75
|
const finalMetaInfo = {
|
|
76
76
|
...metaInfo,
|
|
77
77
|
...(0, import_timeHelpers.getValidationTimeStringMetaInfo)(finalTimeString, getIsDisabledTime)
|
|
78
78
|
};
|
|
79
79
|
return finalMetaInfo;
|
|
80
80
|
},
|
|
81
|
-
[
|
|
81
|
+
[tempTimeStringRef, getIsDisabledTime]
|
|
82
82
|
);
|
|
83
83
|
const handleChangeComposedDateTimeString = (0, import_react.useCallback)(
|
|
84
84
|
(newDateString, newTimeString, metaInfo) => {
|
|
85
85
|
const appDateString = (0, import_stringHelpers.isEmptyDateStringMask)(newDateString) ? "" : newDateString;
|
|
86
86
|
const appTimeString = (0, import_stringHelpers.isEmptyTimeStringMask)(newTimeString) ? "" : newTimeString;
|
|
87
87
|
appOnDateChange(appDateString, metaInfo);
|
|
88
|
-
|
|
88
|
+
tempDateStringRef.current = newDateString;
|
|
89
89
|
appOnTimeChange(appTimeString, metaInfo);
|
|
90
|
-
|
|
90
|
+
tempTimeStringRef.current = newTimeString;
|
|
91
91
|
const newDateTimeString = `${newDateString} ${newTimeString}`;
|
|
92
92
|
const newMetaInfo = {
|
|
93
93
|
...metaInfo,
|
|
@@ -102,9 +102,9 @@ const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnTyp
|
|
|
102
102
|
},
|
|
103
103
|
[
|
|
104
104
|
appOnDateChange,
|
|
105
|
-
|
|
105
|
+
tempDateStringRef,
|
|
106
106
|
appOnTimeChange,
|
|
107
|
-
|
|
107
|
+
tempTimeStringRef,
|
|
108
108
|
getTimeMetaInfo,
|
|
109
109
|
getDateMetaInfo,
|
|
110
110
|
appOnDateTimeChange
|
|
@@ -114,39 +114,39 @@ const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnTyp
|
|
|
114
114
|
(newDateString, metaInfo) => {
|
|
115
115
|
const appDateString = (0, import_stringHelpers.isEmptyDateStringMask)(newDateString) ? "" : newDateString;
|
|
116
116
|
appOnDateChange(appDateString, metaInfo);
|
|
117
|
-
|
|
118
|
-
const newDateTimeString = `${newDateString} ${
|
|
117
|
+
tempDateStringRef.current = newDateString;
|
|
118
|
+
const newDateTimeString = `${newDateString} ${tempTimeStringRef.current}`;
|
|
119
119
|
const newMetaInfo = {
|
|
120
120
|
...metaInfo,
|
|
121
|
-
...getTimeMetaInfo(
|
|
121
|
+
...getTimeMetaInfo(tempTimeStringRef.current, metaInfo),
|
|
122
122
|
...getDateMetaInfo(newDateString, metaInfo),
|
|
123
123
|
newDateString,
|
|
124
|
-
newTimeString:
|
|
124
|
+
newTimeString: tempTimeStringRef.current,
|
|
125
125
|
newDateTimeString
|
|
126
126
|
};
|
|
127
127
|
const appDateTimeString = (0, import_stringHelpers.isEmptyDateTimeStringMask)(newDateTimeString) ? "" : newDateTimeString;
|
|
128
128
|
appOnDateTimeChange(appDateTimeString, newMetaInfo);
|
|
129
129
|
},
|
|
130
|
-
[appOnDateChange,
|
|
130
|
+
[appOnDateChange, tempDateStringRef, tempTimeStringRef, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange]
|
|
131
131
|
);
|
|
132
132
|
const handleChangeComposedTimeString = (0, import_react.useCallback)(
|
|
133
133
|
(newTimeString, metaInfo) => {
|
|
134
134
|
const appTimeString = (0, import_stringHelpers.isEmptyTimeStringMask)(newTimeString) ? "" : newTimeString;
|
|
135
135
|
appOnTimeChange(appTimeString, metaInfo);
|
|
136
|
-
|
|
137
|
-
const newDateTimeString = `${
|
|
136
|
+
tempTimeStringRef.current = newTimeString;
|
|
137
|
+
const newDateTimeString = `${tempDateStringRef.current} ${newTimeString}`;
|
|
138
138
|
const newMetaInfo = {
|
|
139
139
|
...metaInfo,
|
|
140
140
|
...getTimeMetaInfo(newTimeString, metaInfo),
|
|
141
|
-
...getDateMetaInfo(
|
|
141
|
+
...getDateMetaInfo(tempDateStringRef.current, metaInfo),
|
|
142
142
|
newDateTimeString,
|
|
143
|
-
newDateString:
|
|
143
|
+
newDateString: tempDateStringRef.current,
|
|
144
144
|
newTimeString
|
|
145
145
|
};
|
|
146
146
|
const appDateTimeString = (0, import_stringHelpers.isEmptyDateTimeStringMask)(newDateTimeString) ? "" : newDateTimeString;
|
|
147
147
|
appOnDateTimeChange(appDateTimeString, newMetaInfo);
|
|
148
148
|
},
|
|
149
|
-
[appOnTimeChange,
|
|
149
|
+
[appOnTimeChange, tempTimeStringRef, tempDateStringRef, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange]
|
|
150
150
|
);
|
|
151
151
|
const handleChangeMonth = (0, import_react.useCallback)(
|
|
152
152
|
(newMonth, e, metaInfo = import_constants.defaultMetaInfo) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useChangeHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo } from 'react';\nimport type { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport type { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport type { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useFocusTracker } from './useFocusTracker.js';\nimport { getValidationDateStringMetaInfo } from '../utils/dateHelpers.js';\nimport { getValidationTimeStringMetaInfo } from '../utils/timeHelpers.js';\nimport {\n isEmptyDateStringMask,\n isEmptyTimeStringMask,\n isEmptyDateTimeStringMask,\n getFormattedDateString,\n getFormattedTimeString,\n} from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\nimport { defaultMetaInfo } from '../utils/constants.js';\ninterface Config {\n relevantValues: ReturnType<typeof useRelevantValueFromProps>;\n destructuredValues: ReturnType<typeof useGetDestructuredValues>;\n propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;\n DOMRefs: ReturnType<typeof useGetReferences>;\n focusTrackers: ReturnType<typeof useFocusTracker>;\n}\n\nexport const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnType, focusTrackers }: Config) => {\n const { tempDateString, setTempDateString, tempTimeString, setTimeString } = relevantValues;\n const {\n getIsDisabledDay,\n getIsOutOfRangeDay,\n appOnDateChange,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledTime,\n appOnTimeChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n appOnDateTimeChange,\n isDateTime,\n isDate,\n isTime,\n } = propsBasedOnType;\n const { month, day, year, hours, minutes, meridiem } = destructuredValues;\n const { trackFocusFirstSegment } = focusTrackers;\n\n const getDateMetaInfo = useCallback(\n (\n newDateString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalDateString = newDateString || tempDateString;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(finalDateString, getIsOutOfRangeDay, getIsDisabledDay),\n };\n return finalMetaInfo;\n },\n [tempDateString, getIsDisabledDay, getIsOutOfRangeDay],\n );\n\n const getTimeMetaInfo = useCallback(\n (\n newTimeString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalTimeString = newTimeString || tempTimeString;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(finalTimeString, getIsDisabledTime),\n };\n return finalMetaInfo;\n },\n [tempTimeString, getIsDisabledTime],\n );\n\n const handleChangeComposedDateTimeString = useCallback(\n (\n newDateString: string,\n newTimeString: string,\n metaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo,\n ): void => {\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTempDateString(newDateString);\n\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTimeString(newTimeString);\n\n const newDateTimeString = `${newDateString} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [\n appOnDateChange,\n setTempDateString,\n appOnTimeChange,\n setTimeString,\n getTimeMetaInfo,\n getDateMetaInfo,\n appOnDateTimeChange,\n ],\n );\n const handleChangeComposedDateString = useCallback(\n (newDateString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n // if we receive an \"empty\" mask, we comunicate empty string to the app\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTempDateString(newDateString);\n const newDateTimeString = `${newDateString} ${tempTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(tempTimeString, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString: tempTimeString,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnDateChange, setTempDateString, tempTimeString, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n const handleChangeComposedTimeString = useCallback(\n (newTimeString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n\n setTimeString(newTimeString);\n const newDateTimeString = `${tempDateString} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(tempDateString, metaInfo),\n newDateTimeString,\n newDateString: tempDateString,\n newTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnTimeChange, setTimeString, tempDateString, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n\n const handleChangeMonth: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMonth, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [day, year, getIsOutOfRangeDay, getIsDisabledDay, appOnMonthChange, handleChangeComposedDateString],\n );\n const handleChangeDay: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newDay, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, year, getIsOutOfRangeDay, getIsDisabledDay, appOnDayChange, handleChangeComposedDateString],\n );\n const handleChangeYear: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newYear, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, day, getIsOutOfRangeDay, getIsDisabledDay, appOnYearChange, handleChangeComposedDateString],\n );\n\n const handleChangeHours: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newHours, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours: newHours,\n minutes,\n // seconds,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnHourChange(newHours, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [minutes, meridiem, getIsDisabledTime, appOnHourChange, handleChangeComposedTimeString],\n );\n const handleChangeMinutes: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMinutes, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes: newMinutes,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMinuteChange(newMinutes, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, meridiem, getIsDisabledTime, appOnMinuteChange, handleChangeComposedTimeString],\n );\n const handleChangeMeridiem: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMeridiem, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes,\n meridiem: newMeridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMeridiemChange(newMeridiem, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, minutes, getIsDisabledTime, appOnMeridiemChange, handleChangeComposedTimeString],\n );\n\n const handleClearAll: DSControlledDateTimePickerInternalsT.OnDSBtnClick = useCallback(\n (e) => {\n const metaInfo = {\n isAutomaticFillTrigger: false,\n isClearButtonAction: true,\n newDateString: '',\n newTimeString: '',\n newDateTimeString: '',\n };\n appOnMonthChange('', e, metaInfo);\n appOnDayChange('', e, metaInfo);\n appOnYearChange('', e, metaInfo);\n appOnHourChange('', e, metaInfo);\n appOnMinuteChange('', e, metaInfo);\n appOnMeridiemChange('', e, metaInfo);\n if (isDateTime) handleChangeComposedDateTimeString('__/__/____', '__:__ __', metaInfo);\n if (isDate) handleChangeComposedDateString('__/__/____', metaInfo);\n if (isTime) handleChangeComposedTimeString('__:__ __', metaInfo);\n trackFocusFirstSegment();\n },\n [\n appOnDayChange,\n appOnHourChange,\n appOnMeridiemChange,\n appOnMinuteChange,\n appOnMonthChange,\n appOnYearChange,\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n isDate,\n isDateTime,\n isTime,\n trackFocusFirstSegment,\n ],\n );\n\n return useMemo(\n () => ({\n handleChangeComposedDateTimeString,\n handleChangeComposedDateString,\n handleChangeComposedTimeString,\n handleChangeMonth,\n handleChangeDay,\n handleChangeYear,\n handleChangeHours,\n handleChangeMinutes,\n handleChangeMeridiem,\n handleClearAll,\n }),\n [\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n handleChangeDay,\n handleChangeHours,\n handleChangeMeridiem,\n handleChangeMinutes,\n handleChangeMonth,\n handleChangeYear,\n handleClearAll,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAqC;AAMrC,yBAAgD;AAChD,yBAAgD;AAChD,2BAMO;AAGP,uBAAgC;AASzB,MAAM,oBAAoB,CAAC,EAAE,gBAAgB,oBAAoB,kBAAkB,cAAc,MAAc;AACpH,QAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo } from 'react';\nimport type { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport type { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport type { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useFocusTracker } from './useFocusTracker.js';\nimport { getValidationDateStringMetaInfo } from '../utils/dateHelpers.js';\nimport { getValidationTimeStringMetaInfo } from '../utils/timeHelpers.js';\nimport {\n isEmptyDateStringMask,\n isEmptyTimeStringMask,\n isEmptyDateTimeStringMask,\n getFormattedDateString,\n getFormattedTimeString,\n} from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\nimport { defaultMetaInfo } from '../utils/constants.js';\ninterface Config {\n relevantValues: ReturnType<typeof useRelevantValueFromProps>;\n destructuredValues: ReturnType<typeof useGetDestructuredValues>;\n propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;\n DOMRefs: ReturnType<typeof useGetReferences>;\n focusTrackers: ReturnType<typeof useFocusTracker>;\n}\n\nexport const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnType, focusTrackers }: Config) => {\n const { tempDateStringRef, tempTimeStringRef } = relevantValues;\n const {\n getIsDisabledDay,\n getIsOutOfRangeDay,\n appOnDateChange,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledTime,\n appOnTimeChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n appOnDateTimeChange,\n isDateTime,\n isDate,\n isTime,\n } = propsBasedOnType;\n const { month, day, year, hours, minutes, meridiem } = destructuredValues;\n const { trackFocusFirstSegment } = focusTrackers;\n\n const getDateMetaInfo = useCallback(\n (\n newDateString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalDateString = newDateString || tempDateStringRef.current;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(finalDateString, getIsOutOfRangeDay, getIsDisabledDay),\n };\n return finalMetaInfo;\n },\n [tempDateStringRef, getIsDisabledDay, getIsOutOfRangeDay],\n );\n\n const getTimeMetaInfo = useCallback(\n (\n newTimeString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalTimeString = newTimeString || tempTimeStringRef.current;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(finalTimeString, getIsDisabledTime),\n };\n return finalMetaInfo;\n },\n [tempTimeStringRef, getIsDisabledTime],\n );\n\n const handleChangeComposedDateTimeString = useCallback(\n (\n newDateString: string,\n newTimeString: string,\n metaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo,\n ): void => {\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n tempDateStringRef.current = newDateString; // use ref to avoid re-render\n\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n tempTimeStringRef.current = newTimeString;\n\n const newDateTimeString = `${newDateString} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [\n appOnDateChange,\n tempDateStringRef,\n appOnTimeChange,\n tempTimeStringRef,\n getTimeMetaInfo,\n getDateMetaInfo,\n appOnDateTimeChange,\n ],\n );\n const handleChangeComposedDateString = useCallback(\n (newDateString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n // if we receive an \"empty\" mask, we comunicate empty string to the app\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n tempDateStringRef.current = newDateString;\n const newDateTimeString = `${newDateString} ${tempTimeStringRef.current}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(tempTimeStringRef.current, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString: tempTimeStringRef.current,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnDateChange, tempDateStringRef, tempTimeStringRef, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n const handleChangeComposedTimeString = useCallback(\n (newTimeString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n\n tempTimeStringRef.current = newTimeString;\n const newDateTimeString = `${tempDateStringRef.current} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(tempDateStringRef.current, metaInfo),\n newDateTimeString,\n newDateString: tempDateStringRef.current,\n newTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnTimeChange, tempTimeStringRef, tempDateStringRef, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n\n const handleChangeMonth: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMonth, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [day, year, getIsOutOfRangeDay, getIsDisabledDay, appOnMonthChange, handleChangeComposedDateString],\n );\n const handleChangeDay: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newDay, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, year, getIsOutOfRangeDay, getIsDisabledDay, appOnDayChange, handleChangeComposedDateString],\n );\n const handleChangeYear: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newYear, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, day, getIsOutOfRangeDay, getIsDisabledDay, appOnYearChange, handleChangeComposedDateString],\n );\n\n const handleChangeHours: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newHours, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours: newHours,\n minutes,\n // seconds,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnHourChange(newHours, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [minutes, meridiem, getIsDisabledTime, appOnHourChange, handleChangeComposedTimeString],\n );\n const handleChangeMinutes: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMinutes, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes: newMinutes,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMinuteChange(newMinutes, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, meridiem, getIsDisabledTime, appOnMinuteChange, handleChangeComposedTimeString],\n );\n const handleChangeMeridiem: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMeridiem, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes,\n meridiem: newMeridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMeridiemChange(newMeridiem, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, minutes, getIsDisabledTime, appOnMeridiemChange, handleChangeComposedTimeString],\n );\n\n const handleClearAll: DSControlledDateTimePickerInternalsT.OnDSBtnClick = useCallback(\n (e) => {\n const metaInfo = {\n isAutomaticFillTrigger: false,\n isClearButtonAction: true,\n newDateString: '',\n newTimeString: '',\n newDateTimeString: '',\n };\n appOnMonthChange('', e, metaInfo);\n appOnDayChange('', e, metaInfo);\n appOnYearChange('', e, metaInfo);\n appOnHourChange('', e, metaInfo);\n appOnMinuteChange('', e, metaInfo);\n appOnMeridiemChange('', e, metaInfo);\n if (isDateTime) handleChangeComposedDateTimeString('__/__/____', '__:__ __', metaInfo);\n if (isDate) handleChangeComposedDateString('__/__/____', metaInfo);\n if (isTime) handleChangeComposedTimeString('__:__ __', metaInfo);\n trackFocusFirstSegment();\n },\n [\n appOnDayChange,\n appOnHourChange,\n appOnMeridiemChange,\n appOnMinuteChange,\n appOnMonthChange,\n appOnYearChange,\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n isDate,\n isDateTime,\n isTime,\n trackFocusFirstSegment,\n ],\n );\n\n return useMemo(\n () => ({\n handleChangeComposedDateTimeString,\n handleChangeComposedDateString,\n handleChangeComposedTimeString,\n handleChangeMonth,\n handleChangeDay,\n handleChangeYear,\n handleChangeHours,\n handleChangeMinutes,\n handleChangeMeridiem,\n handleClearAll,\n }),\n [\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n handleChangeDay,\n handleChangeHours,\n handleChangeMeridiem,\n handleChangeMinutes,\n handleChangeMonth,\n handleChangeYear,\n handleClearAll,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAqC;AAMrC,yBAAgD;AAChD,yBAAgD;AAChD,2BAMO;AAGP,uBAAgC;AASzB,MAAM,oBAAoB,CAAC,EAAE,gBAAgB,oBAAoB,kBAAkB,cAAc,MAAc;AACpH,QAAM,EAAE,mBAAmB,kBAAkB,IAAI;AACjD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAC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L,YAAM,WAAW;AAAA,QACf,wBAAwB;AAAA,QACxB,qBAAqB;AAAA,QACrB,eAAe;AAAA,QACf,eAAe;AAAA,QACf,mBAAmB;AAAA,MACrB;AACA,uBAAiB,IAAI,GAAG,QAAQ;AAChC,qBAAe,IAAI,GAAG,QAAQ;AAC9B,sBAAgB,IAAI,GAAG,QAAQ;AAC/B,sBAAgB,IAAI,GAAG,QAAQ;AAC/B,wBAAkB,IAAI,GAAG,QAAQ;AACjC,0BAAoB,IAAI,GAAG,QAAQ;AACnC,UAAI,WAAY,oCAAmC,cAAc,YAAY,QAAQ;AACrF,UAAI,OAAQ,gCAA+B,cAAc,QAAQ;AACjE,UAAI,OAAQ,gCAA+B,YAAY,QAAQ;AAC/D,6BAAuB;AAAA,IACzB;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ __export(useGetFlags_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useGetFlags_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_ControlledDateTimePickerTypes = require("../ControlledDateTimePickerTypes.js");
|
|
36
|
+
var import_ControlledDateTimePickerTypes = require("../constants/ControlledDateTimePickerTypes.js");
|
|
37
37
|
var import_typeGuards = require("../utils/typeGuards.js");
|
|
38
38
|
const getDateTimeFlags = (props) => {
|
|
39
39
|
const { type, isClearable, dateTime, autoFocus, innerRef } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetFlags.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { CONTROLLED_DATE_TIME_PICKER_TYPES } from '../ControlledDateTimePickerTypes.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAwB;AACxB,2CAAkD;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { CONTROLLED_DATE_TIME_PICKER_TYPES } from '../constants/ControlledDateTimePickerTypes.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport { getIsDate, getIsDateTime } from '../utils/typeGuards.js';\n\nconst getDateTimeFlags = (props: DSControlledDateTimePickerT.InternalDateTimePickerProps) => {\n const { type, isClearable, dateTime, autoFocus, innerRef } = props;\n const constants = {\n hideDatePicker: true,\n hideTimePicker: true,\n isDateSelector: false,\n isTimeSelector: false,\n isDateTimeSelector: true,\n isWithDateInputsOnly: false,\n isWithTimeInputsOnly: false,\n autoFocusHourInput: false,\n autoFocusHourTimeWheel: false,\n };\n const withAnyInputs =\n type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.FULL ||\n type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.INPUTS;\n const hideDateTimePicker =\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.FULL &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.PICKER &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.CONTROLLER_ONLY;\n const isControllerOnly = type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE_TIME.CONTROLLER_ONLY;\n const withAnyPicker = !hideDateTimePicker;\n const withClearBtn = withAnyInputs && isClearable && dateTime !== '' && dateTime !== '__/__/____ __:__ __';\n const shouldPreserveClearableSpace = isClearable && withAnyInputs;\n const finalFlags = {\n hideDate: !withAnyInputs,\n hideTime: !withAnyInputs,\n hideDateTimePicker,\n isControllerOnly,\n isWithTimeWheelToo: !hideDateTimePicker,\n isWithCalendarToo: !hideDateTimePicker,\n withAnyInputs,\n withAnyPicker,\n withClearBtn,\n isWithDateInputs: withAnyInputs,\n isWithTimeInputs: withAnyInputs,\n autoFocusMonthInput: withAnyInputs && autoFocus,\n autoFocusPrevMonthArrow: isControllerOnly && autoFocus,\n innerRefMonthInput: withAnyInputs ? innerRef : undefined,\n innerRefPrevMonthArrow: isControllerOnly ? innerRef : undefined,\n shouldPreserveClearableSpace,\n withAnyRightController: withAnyPicker || withClearBtn || shouldPreserveClearableSpace,\n ...constants,\n };\n return finalFlags;\n};\nconst getDateFlags = (props: DSControlledDateTimePickerT.InternalDatePickerProps) => {\n const { type, isClearable, date, autoFocus, innerRef } = props;\n\n const constants = {\n isDateSelector: true,\n hideTime: true,\n hideDateTimePicker: true,\n hideTimePicker: true,\n isTimeSelector: false,\n isDateTimeSelector: false,\n isWithCalendarToo: false,\n isWithTimeWheelToo: false,\n isWithTimeInputs: false,\n isWithTimeInputsOnly: false,\n autoFocusHourTimeWheel: false,\n autoFocusHourInput: false,\n };\n\n const withAnyInputs =\n type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.FULL || type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.INPUTS;\n const hideDatePicker =\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.FULL &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.PICKER &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.CONTROLLER_ONLY;\n const isControllerOnly = type === CONTROLLED_DATE_TIME_PICKER_TYPES.DATE.CONTROLLER_ONLY;\n\n const withAnyPicker = !hideDatePicker;\n const withClearBtn = withAnyInputs && isClearable && date !== '' && date !== '__/__/____';\n const shouldPreserveClearableSpace = isClearable && withAnyInputs;\n\n const finalFlags = {\n hideDate: !withAnyInputs,\n hideDatePicker,\n isControllerOnly,\n withAnyInputs,\n withAnyPicker,\n withClearBtn,\n isWithDateInputs: withAnyInputs,\n isWithDateInputsOnly: withAnyInputs,\n autoFocusMonthInput: withAnyInputs && autoFocus,\n autoFocusPrevMonthArrow: isControllerOnly && autoFocus,\n innerRefMonthInput: withAnyInputs ? innerRef : undefined,\n innerRefPrevMonthArrow: isControllerOnly ? innerRef : undefined,\n shouldPreserveClearableSpace,\n withAnyRightController: withAnyPicker || withClearBtn || shouldPreserveClearableSpace,\n ...constants,\n };\n return finalFlags;\n};\nconst getTimeFlags = (props: DSControlledDateTimePickerT.InternalTimePickerProps) => {\n const { type, isClearable, time, autoFocus, innerRef } = props;\n const constants = {\n hideDate: true,\n hideDateTimePicker: true,\n hideDatePicker: true,\n isDateSelector: false,\n isDateTimeSelector: false,\n isWithDateInputs: false,\n isWithDateInputsOnly: false,\n isTimeSelector: true,\n isWithTimeWheelToo: false,\n isWithCalendarToo: false,\n autoFocusMonthInput: false,\n autoFocusPrevMonthArrow: false,\n innerRefMonthInput: undefined,\n innerRefPrevMonthArrow: undefined,\n };\n const withAnyInputs =\n type === CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.FULL || type === CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.INPUTS;\n const hideTimePicker =\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.FULL &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.PICKER &&\n type !== CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.CONTROLLER_ONLY;\n const isControllerOnly = type === CONTROLLED_DATE_TIME_PICKER_TYPES.TIME.CONTROLLER_ONLY;\n const withClearBtn = withAnyInputs && isClearable && time !== '' && time !== '__:__ __';\n const shouldPreserveClearableSpace = isClearable && withAnyInputs;\n const withAnyPicker = !hideTimePicker;\n const finalFlags = {\n hideTime: !withAnyInputs,\n hideTimePicker,\n isControllerOnly,\n withAnyInputs,\n withAnyPicker,\n withClearBtn,\n isWithTimeInputs: withAnyInputs,\n isWithTimeInputsOnly: withAnyInputs,\n autoFocusHourInput: withAnyInputs && autoFocus,\n autoFocusHourTimeWheel: isControllerOnly && autoFocus,\n innerRefHourInput: withAnyInputs ? innerRef : undefined,\n innerRefHourTimeWheel: isControllerOnly ? innerRef : undefined,\n shouldPreserveClearableSpace,\n withAnyRightController: withAnyPicker || withClearBtn || shouldPreserveClearableSpace,\n ...constants,\n };\n return finalFlags;\n};\n\nexport const useGetFlags = (props: DSControlledDateTimePickerT.InternalProps) =>\n useMemo(() => {\n if (getIsDateTime(props)) {\n return getDateTimeFlags(props);\n }\n if (getIsDate(props)) {\n return getDateFlags(props);\n }\n return getTimeFlags(props);\n }, [props]);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAwB;AACxB,2CAAkD;AAElD,wBAAyC;AAEzC,MAAM,mBAAmB,CAAC,UAAmE;AAC3F,QAAM,EAAE,MAAM,aAAa,UAAU,WAAW,SAAS,IAAI;AAC7D,QAAM,YAAY;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,IACtB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,EAC1B;AACA,QAAM,gBACJ,SAAS,uEAAkC,U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AAU,CAAC;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB,sBAAsB;AAAA,IACtB,oBAAoB,iBAAiB;AAAA,IACrC,wBAAwB,oBAAoB;AAAA,IAC5C,mBAAmB,gBAAgB,WAAW;AAAA,IAC9C,uBAAuB,mBAAmB,WAAW;AAAA,IACrD;AAAA,IACA,wBAAwB,iBAAiB,gBAAgB;AAAA,IACzD,GAAG;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,cAAc,CAAC,cAC1B,sBAAQ,MAAM;AACZ,UAAI,iCAAc,KAAK,GAAG;AACxB,WAAO,iBAAiB,KAAK;AAAA,EAC/B;AACA,UAAI,6BAAU,KAAK,GAAG;AACpB,WAAO,aAAa,KAAK;AAAA,EAC3B;AACA,SAAO,aAAa,KAAK;AAC3B,GAAG,CAAC,KAAK,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetReferences.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useRef, useMemo, useState } from 'react';\nimport type { useGetFlags } from './useGetFlags.js';\ntype FirstSegment =\n | 'month-input'\n | 'hour-input'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\ntype LastSegment =\n | 'year-input'\n | 'meridiem-input'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\nexport const useGetReferences = ({\n isWithDateInputs,\n isWithTimeInputs,\n isDateSelector,\n isTimeSelector,\n isDateTimeSelector,\n withAnyPicker,\n withClearBtn,\n}: ReturnType<typeof useGetFlags>) => {\n // those 2 states are needed for focus tracking\n const [firstSegment, setFirstSegment] = useState<FirstSegment>('');\n const [lastSegment, setLastSegment] = useState<LastSegment>('');\n // refs are used for \"auto-advance\" feature\n const monthInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const dayInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const yearInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const hourInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const minutesInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const meridiemInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const clearButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const pickerButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n\n const prevYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const calendarDaysWrapperRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n\n const prevHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currHourBtnRef = useRef<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA0C;AAiBnC,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AAEpC,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAuB,EAAE;AACjE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAsB,EAAE;AAE9D,QAAM,oBAAgB,qBAAyB,IAAI;AACnD,QAAM,kBAAc,qBAAyB,IAAI;AACjD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,sBAAkB,qBAAyB,IAAI;AACrD,QAAM,uBAAmB,qBAAyB,IAAI;AACtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,sBAAkB,qBAA0B,IAAI;AAEtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,sBAAkB,qBAA0B,IAAI;AACtD,QAAM,sBAAkB,qBAA0B,IAAI;AACtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,6BAAyB,qBAAuB,IAAI;AAE1D,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,qBAAiB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useRef, useMemo, useState } from 'react';\nimport type { useGetFlags } from './useGetFlags.js';\ntype FirstSegment =\n | 'month-input'\n | 'hour-input'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\ntype LastSegment =\n | 'year-input'\n | 'meridiem-input'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\nexport const useGetReferences = ({\n isWithDateInputs,\n isWithTimeInputs,\n isDateSelector,\n isTimeSelector,\n isDateTimeSelector,\n withAnyPicker,\n withClearBtn,\n}: ReturnType<typeof useGetFlags>) => {\n // those 2 states are needed for focus tracking\n const [firstSegment, setFirstSegment] = useState<FirstSegment>('');\n const [lastSegment, setLastSegment] = useState<LastSegment>('');\n // refs are used for \"auto-advance\" feature\n const monthInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const dayInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const yearInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const hourInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const minutesInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const meridiemInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const clearButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const pickerButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n\n const prevYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const calendarDaysWrapperRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n\n const prevHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currHourBtnRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n const nextHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMinutesBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currMinutesBtnRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n const nextMinutesBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMeridiemBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currMeridiemBtnRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n const nextMeridiemBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n\n let firstSegmentRef = useRef<HTMLInputElement | HTMLButtonElement>(null) as React.MutableRefObject<\n HTMLInputElement | HTMLButtonElement\n >;\n if (isWithDateInputs) {\n firstSegmentRef = monthInputRef;\n if (firstSegment !== 'month-input') setFirstSegment('month-input');\n } else if (isWithTimeInputs) {\n firstSegmentRef = hourInputRef;\n if (firstSegment !== 'hour-input') setFirstSegment('hour-input');\n } else if (withAnyPicker) {\n firstSegmentRef = pickerButtonRef;\n if (isDateSelector && firstSegment !== 'date-picker-icon') setFirstSegment('date-picker-icon');\n if (isTimeSelector && firstSegment !== 'time-picker-icon') setFirstSegment('time-picker-icon');\n if (isDateTimeSelector && firstSegment !== 'datetime-picker-icon') setFirstSegment('datetime-picker-icon');\n }\n\n let lastSegmentRef = useRef<HTMLInputElement | HTMLButtonElement>(null) as React.MutableRefObject<\n HTMLInputElement | HTMLButtonElement\n >;\n if (withAnyPicker) {\n lastSegmentRef = pickerButtonRef;\n if (isDateSelector && lastSegment !== 'date-picker-icon') setLastSegment('date-picker-icon');\n if (isTimeSelector && lastSegment !== 'time-picker-icon') setLastSegment('time-picker-icon');\n if (isDateTimeSelector && lastSegment !== 'datetime-picker-icon') setLastSegment('datetime-picker-icon');\n } else if (withClearBtn) {\n lastSegmentRef = clearButtonRef;\n if (lastSegment !== 'clear-btn') setLastSegment('clear-btn');\n } else if (isWithTimeInputs) {\n lastSegmentRef = meridiemInputRef;\n if (lastSegment !== 'meridiem-input') setLastSegment('meridiem-input');\n } else if (isWithDateInputs) {\n lastSegmentRef = yearInputRef;\n if (lastSegment !== 'year-input') setLastSegment('year-input');\n }\n\n return useMemo(\n () => ({\n monthInputRef,\n dayInputRef,\n yearInputRef,\n hourInputRef,\n minutesInputRef,\n meridiemInputRef,\n clearButtonRef,\n pickerButtonRef,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n calendarDaysWrapperRef,\n prevHourBtnRef,\n currHourBtnRef,\n nextHourBtnRef,\n prevMinutesBtnRef,\n currMinutesBtnRef,\n nextMinutesBtnRef,\n prevMeridiemBtnRef,\n currMeridiemBtnRef,\n nextMeridiemBtnRef,\n firstSegmentRef,\n lastSegmentRef,\n firstSegment,\n lastSegment,\n }),\n [firstSegment, lastSegment],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA0C;AAiBnC,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AAEpC,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAuB,EAAE;AACjE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAsB,EAAE;AAE9D,QAAM,oBAAgB,qBAAyB,IAAI;AACnD,QAAM,kBAAc,qBAAyB,IAAI;AACjD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,sBAAkB,qBAAyB,IAAI;AACrD,QAAM,uBAAmB,qBAAyB,IAAI;AACtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,sBAAkB,qBAA0B,IAAI;AAEtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,sBAAkB,qBAA0B,IAAI;AACtD,QAAM,sBAAkB,qBAA0B,IAAI;AACtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,6BAAyB,qBAAuB,IAAI;AAE1D,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,qBAAiB,qBAAuB,IAAI;AAClD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,wBAAoB,qBAA0B,IAAI;AACxD,QAAM,wBAAoB,qBAAuB,IAAI;AACrD,QAAM,wBAAoB,qBAA0B,IAAI;AACxD,QAAM,yBAAqB,qBAA0B,IAAI;AACzD,QAA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AAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW;AAAA,EAC5B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,28 +36,34 @@ var import_react = require("react");
|
|
|
36
36
|
var import_typeGuards = require("../utils/typeGuards.js");
|
|
37
37
|
var import_stringHelpers = require("../utils/stringHelpers.js");
|
|
38
38
|
const useRelevantValueFromProps = (props) => {
|
|
39
|
+
const isDateTime = (0, import_typeGuards.getIsDateTime)(props);
|
|
40
|
+
const isDate = (0, import_typeGuards.getIsDate)(props);
|
|
41
|
+
const isTime = (0, import_typeGuards.getIsTime)(props);
|
|
42
|
+
const { dateTime } = props;
|
|
43
|
+
const time = isTime ? props.time : "";
|
|
44
|
+
const date = isDate ? props.date : "";
|
|
45
|
+
const tempDateStringRef = (0, import_react.useRef)("__/__/____");
|
|
39
46
|
const dateStringFromProps = (0, import_react.useMemo)(() => {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
if (isDateTime)
|
|
48
|
+
tempDateStringRef.current = dateTime !== "" && dateTime !== void 0 ? (0, import_stringHelpers.dateTimeToDate)(dateTime) : "__/__/____";
|
|
49
|
+
if (isDate) tempDateStringRef.current = date !== "" ? date : "__/__/____";
|
|
50
|
+
return tempDateStringRef.current;
|
|
51
|
+
}, [isDate, isDateTime, date, dateTime]);
|
|
52
|
+
const tempTimeStringRef = (0, import_react.useRef)("__:__ __");
|
|
44
53
|
const timeStringFromProps = (0, import_react.useMemo)(() => {
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const [tempTimeString, setTimeString] = (0, import_react.useState)(timeStringFromProps);
|
|
54
|
+
if (isDateTime)
|
|
55
|
+
tempTimeStringRef.current = dateTime !== "" && dateTime !== void 0 ? (0, import_stringHelpers.dateTimeToTime)(dateTime) : "__:__ __";
|
|
56
|
+
if (isTime) tempTimeStringRef.current = time !== "" ? time : "__:__ __";
|
|
57
|
+
return tempTimeStringRef.current;
|
|
58
|
+
}, [isDateTime, isTime, time, dateTime]);
|
|
51
59
|
return (0, import_react.useMemo)(
|
|
52
60
|
() => ({
|
|
53
61
|
dateStringFromProps,
|
|
54
62
|
timeStringFromProps,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
tempTimeString,
|
|
58
|
-
setTimeString
|
|
63
|
+
tempDateStringRef,
|
|
64
|
+
tempTimeStringRef
|
|
59
65
|
}),
|
|
60
|
-
[dateStringFromProps,
|
|
66
|
+
[dateStringFromProps, timeStringFromProps]
|
|
61
67
|
);
|
|
62
68
|
};
|
|
63
69
|
//# sourceMappingURL=useRelevantValueFromProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useRelevantValueFromProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { useMemo, useRef } from 'react';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nimport { dateTimeToTime, dateTimeToDate } from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\nexport const useRelevantValueFromProps = (props: DSControlledDateTimePickerT.InternalProps) => {\n const isDateTime = getIsDateTime(props);\n const isDate = getIsDate(props);\n const isTime = getIsTime(props);\n const { dateTime } = props;\n // why not destructuring? because destructuring will not trigger typescript safeguards infers.\n // this is safer and more explicit anyway, when things are undefined we default to '' which is later used in ternaries as a single check\n const time = isTime ? props.time : '';\n const date = isDate ? props.date : '';\n\n const tempDateStringRef = useRef('__/__/____');\n const dateStringFromProps = useMemo(() => {\n if (isDateTime)\n tempDateStringRef.current = dateTime !== '' && dateTime !== undefined ? dateTimeToDate(dateTime) : '__/__/____';\n if (isDate) tempDateStringRef.current = date !== '' ? date : '__/__/____';\n // the ref is storing a primitive value, which means that even if we return the .current, it will trigger shallow comparisons\n // don't do the same with non primitive values, instead do a {...ref.current} or [...ref.current] to ensure a new reference is created on memo run\n // which in turns would trigger sideEffects as expected on ref change.\n // note: side-effects doesn't run on non primitive useRef().current changes.\n return tempDateStringRef.current;\n }, [isDate, isDateTime, date, dateTime]);\n\n const tempTimeStringRef = useRef('__:__ __');\n const timeStringFromProps = useMemo(() => {\n if (isDateTime)\n tempTimeStringRef.current = dateTime !== '' && dateTime !== undefined ? dateTimeToTime(dateTime) : '__:__ __';\n if (isTime) tempTimeStringRef.current = time !== '' ? time : '__:__ __';\n // the ref is storing a primitive value, which means that even if we return the .current, it will trigger shallow comparisons\n // don't do the same with non primitive values, instead do a {...ref.current} or [...ref.current] to ensure a new reference is created on memo run\n // which in turns would trigger sideEffects as expected on ref change.\n // note: side-effects doesn't run on non primitive useRef().current changes.\n return tempTimeStringRef.current;\n }, [isDateTime, isTime, time, dateTime]);\n\n return useMemo(\n () => ({\n dateStringFromProps,\n timeStringFromProps,\n tempDateStringRef,\n tempTimeStringRef,\n }),\n [dateStringFromProps, timeStringFromProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAgC;AAChC,wBAAoD;AACpD,2BAA+C;AAGxC,MAAM,4BAA4B,CAAC,UAAqD;AAC7F,QAAM,iBAAa,iCAAc,KAAK;AACtC,QAAM,aAAS,6BAAU,KAAK;AAC9B,QAAM,aAAS,6BAAU,KAAK;AAC9B,QAAM,EAAE,SAAS,IAAI;AAGrB,QAAM,OAAO,SAAS,MAAM,OAAO;AACnC,QAAM,OAAO,SAAS,MAAM,OAAO;AAEnC,QAAM,wBAAoB,qBAAO,YAAY;AAC7C,QAAM,0BAAsB,sBAAQ,MAAM;AACxC,QAAI;AACF,wBAAkB,UAAU,aAAa,MAAM,aAAa,aAAY,qCAAe,QAAQ,IAAI;AACrG,QAAI,OAAQ,mBAAkB,UAAU,SAAS,KAAK,OAAO;AAK7D,WAAO,kBAAkB;AAAA,EAC3B,GAAG,CAAC,QAAQ,YAAY,MAAM,QAAQ,CAAC;AAEvC,QAAM,wBAAoB,qBAAO,UAAU;AAC3C,QAAM,0BAAsB,sBAAQ,MAAM;AACxC,QAAI;AACF,wBAAkB,UAAU,aAAa,MAAM,aAAa,aAAY,qCAAe,QAAQ,IAAI;AACrG,QAAI,OAAQ,mBAAkB,UAAU,SAAS,KAAK,OAAO;AAK7D,WAAO,kBAAkB;AAAA,EAC3B,GAAG,CAAC,YAAY,QAAQ,MAAM,QAAQ,CAAC;AAEvC,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,qBAAqB,mBAAmB;AAAA,EAC3C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useValidateProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport {\n dateTimeToDate,\n isValidDateString,\n dateTimeToTime,\n isValidTimeString,\n deconstructValuesFromDateString,\n} from '../utils/stringHelpers.js';\nimport { convertToPositiveNumberIfPossible } from '../utils/numberHelpers.js';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nconst PREPEND = `ControlledDateTimePicker:\n Invalid configuration detected::\n \n `;\nconst NOT_A_DEFECT = '';\n// '\\n\\n\\t\\tThis is not a defect, please check\\n\\n\\t\\thttps://qa.dimsum.
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport {\n dateTimeToDate,\n isValidDateString,\n dateTimeToTime,\n isValidTimeString,\n deconstructValuesFromDateString,\n} from '../utils/stringHelpers.js';\nimport { convertToPositiveNumberIfPossible } from '../utils/numberHelpers.js';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nconst PREPEND = `ControlledDateTimePicker:\n Invalid configuration detected::\n \n `;\nconst NOT_A_DEFECT = '';\n// '\\n\\n\\t\\tThis is not a defect, please check\\n\\n\\t\\thttps://qa.dimsum.d1.ice.com/?path=/story/components-desktop-components-d-controlledform-date-time-picker--basic\\n\\n\\t\\tfor instructions on how to use the component correctly\\n\\n';\nconst INLINE_RECEIVED_PREPEND = `\n\n Received:`;\nconst throwInvalidDateTimeError = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"dateTime\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidDaterror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"date\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidTimerror = (invalidValue: string) => {\n throw new Error(\n `${PREPEND}the \"time\" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledDateError = (date: string, onDateChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date selector while providing a non-string \"date\" or providing a non-function to \"onDateChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n date: ${date}(${typeof date})\n onDateChange: (${typeof onDateChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwUncontrolledTimeError = (time: string, onTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a time selector while providing a non-string \"time\" or providing a non-function to \"onTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n time: ${time}(${typeof time})\n onTimeChange: (${typeof onTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\n\nconst throwUncontrolledDateTimeError = (dateTime: string, onDateTimeChange: unknown) => {\n throw new Error(\n `${PREPEND}you are trying to use a date-time selector while providing a non-string \"dateTime\" or providing a non-function to \"onDateTimeChange\"\n the full-controlled pattern must be used\\n\\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations\n\n Received:\n dateTime: ${dateTime}(${typeof dateTime})\n onDateTimeChange: (${typeof onDateTimeChange})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidEmptyPickerStartingMonthError = (emptyPickerStartingMonth: string) => {\n throw new Error(\n `${PREPEND}the provided emptyPickerStartingMonth props is invalid. please provide a string with the format mm/__/yyyy, (mm 01~12, yyyy 0001~9999) \n\n Received:\n ${emptyPickerStartingMonth}(${typeof emptyPickerStartingMonth})\n ${NOT_A_DEFECT}`,\n );\n};\nconst throwInvalidOnCalendarOpenFocusedDayError = (onCalendarOpenFocusedDay: string) => {\n throw new Error(\n `${PREPEND}the provided onCalendarOpenFocusedDay props is invalid. please provide a string with the format mm/dd/yyyy, (mm 01~12, dd 01~31, yyyy 0001~9999) \n\n Received:\n ${onCalendarOpenFocusedDay}(${typeof onCalendarOpenFocusedDay})\n ${NOT_A_DEFECT}`,\n );\n};\nexport const useValidateProps = (props: DSControlledDateTimePickerT.Props): void => {\n // validate date-related props\n if (getIsDateTime(props) || getIsDate(props)) {\n const { emptyPickerStartingMonth, onCalendarOpenFocusedDay } = props;\n\n // validate generic use-cases\n if (emptyPickerStartingMonth) {\n const { month: stringMonthVal, year: stringYearVal } = deconstructValuesFromDateString(emptyPickerStartingMonth);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || yearNum <= 0 || yearNum > 9999)\n throwInvalidEmptyPickerStartingMonthError(emptyPickerStartingMonth);\n }\n if (onCalendarOpenFocusedDay) {\n const {\n month: stringMonthVal,\n day: stringDayVal,\n year: stringYearVal,\n } = deconstructValuesFromDateString(onCalendarOpenFocusedDay);\n const monthNum = convertToPositiveNumberIfPossible(stringMonthVal);\n const dayNum = convertToPositiveNumberIfPossible(stringDayVal);\n const yearNum = convertToPositiveNumberIfPossible(stringYearVal);\n if (monthNum <= 0 || monthNum >= 13 || dayNum <= 0 || dayNum > 31 || yearNum <= 0 || yearNum > 9999)\n throwInvalidOnCalendarOpenFocusedDayError(onCalendarOpenFocusedDay);\n }\n }\n // validate full datetime cases\n if (getIsDateTime(props)) {\n const { dateTime, onDateTimeChange } = props;\n if (typeof dateTime !== 'string' || typeof onDateTimeChange !== 'function')\n throwUncontrolledDateTimeError(dateTime, onDateTimeChange);\n else if (!isValidDateString(dateTimeToDate(dateTime)) || !isValidTimeString(dateTimeToTime(dateTime)))\n throwInvalidDateTimeError(dateTimeToTime(dateTime));\n }\n\n // validate date-only cases\n if (getIsDate(props)) {\n const { date, onDateChange } = props;\n if (typeof date !== 'string' || typeof onDateChange !== 'function') throwUncontrolledDateError(date, onDateChange);\n else if (!isValidDateString(date)) throwInvalidDaterror(date);\n }\n\n // validate time-only cases\n\n if (getIsTime(props)) {\n const { time, onTimeChange } = props;\n if (typeof time !== 'string' || typeof onTimeChange !== 'function') throwUncontrolledTimeError(time, onTimeChange);\n else if (!isValidTimeString(time)) throwInvalidTimerror(time);\n }\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB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AClG,oCAA0B,qCAAe,QAAQ,CAAC;AAAA,EACtD;AAGA,UAAI,6BAAU,KAAK,GAAG;AACpB,UAAM,EAAE,MAAM,aAAa,IAAI;AAC/B,QAAI,OAAO,SAAS,YAAY,OAAO,iBAAiB,WAAY,4BAA2B,MAAM,YAAY;AAAA,aACxG,KAAC,wCAAkB,IAAI,EAAG,sBAAqB,IAAI;AAAA,EAC9D;AAIA,UAAI,6BAAU,KAAK,GAAG;AACpB,UAAM,EAAE,MAAM,aAAa,IAAI;AAC/B,QAAI,OAAO,SAAS,YAAY,OAAO,iBAAiB,WAAY,4BAA2B,MAAM,YAAY;AAAA,aACxG,KAAC,wCAAkB,IAAI,EAAG,sBAAqB,IAAI;AAAA,EAC9D;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../src/constants/ControlledDateTimePickerTypes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const CONTROLLED_DATE_TIME_PICKER_TYPES = {\n DATE_TIME: {\n FULL: 'full-date-time',\n CONTROLLER_ONLY: 'date-time-picker-controller-only',\n PICKER: 'date-time-picker',\n INPUTS: 'date-time-inputs',\n },\n DATE: {\n FULL: 'full-date',\n CONTROLLER_ONLY: 'date-picker-controller-only',\n PICKER: 'date-picker',\n INPUTS: 'date-inputs',\n },\n TIME: {\n FULL: 'full-time',\n CONTROLLER_ONLY: 'time-picker-controller-only',\n PICKER: 'time-picker',\n INPUTS: 'time-inputs',\n },\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oCAAoC;AAAA,EAC/C,WAAW;AAAA,IACT,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;",
|
|
6
6
|
"names": []
|