@elliemae/ds-form-date-range-picker 3.37.2 → 3.38.0-rc.1
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/ControlledDateRangePicker.js +2 -2
- package/dist/cjs/ControlledDateRangePicker.js.map +2 -2
- package/dist/cjs/config/useControlledDateRangePicker.js.map +1 -1
- package/dist/cjs/config/useGetPropsWithDefault.js +2 -2
- package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/cjs/config/useRangePickerLogic.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/ControlledDateRangeContent.js.map +1 -1
- package/dist/cjs/{propTypes.js → react-desc-prop-types.js} +9 -7
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-date-range-picker-valid.js +181 -0
- package/dist/cjs/typescript-testing/typescript-date-range-picker-valid.js.map +7 -0
- package/dist/esm/ControlledDateRangePicker.js +2 -2
- package/dist/esm/ControlledDateRangePicker.js.map +2 -2
- package/dist/esm/config/useControlledDateRangePicker.js.map +1 -1
- package/dist/esm/config/useGetPropsWithDefault.js +1 -1
- package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
- package/dist/esm/config/useRangePickerLogic.js.map +1 -1
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/index.js +15 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/ControlledDateRangeContent.js.map +1 -1
- package/dist/esm/{propTypes.js → react-desc-prop-types.js} +6 -4
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-date-range-picker-valid.js +158 -0
- package/dist/esm/typescript-testing/typescript-date-range-picker-valid.js.map +7 -0
- package/dist/types/ControlledDateRangePicker.d.ts +1 -1
- package/dist/types/config/useControlledDateRangePicker.d.ts +1 -1
- package/dist/types/config/useGetPropsWithDefault.d.ts +1 -1
- package/dist/types/config/useRangePickerLogic.d.ts +1 -1
- package/dist/types/config/useValidateProps.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/{propTypes.d.ts → react-desc-prop-types.d.ts} +8 -4
- package/dist/types/tests/date-range-picker.axe.test.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-date-range-picker-valid.d.ts +1 -0
- package/package.json +7 -7
- package/dist/cjs/propTypes.js.map +0 -7
- package/dist/esm/propTypes.js.map +0 -7
|
@@ -37,7 +37,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_useControlledDateRangePicker = require("./config/useControlledDateRangePicker.js");
|
|
39
39
|
var import_ControlledDateRangeContent = require("./parts/ControlledDateRangeContent.js");
|
|
40
|
-
var
|
|
40
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
41
41
|
var import_ControlledDateRangePickerCTX = require("./ControlledDateRangePickerCTX.js");
|
|
42
42
|
var import_theming = require("./exported-related/theming.js");
|
|
43
43
|
const DSControlledDateRangePicker = (props) => {
|
|
@@ -46,5 +46,5 @@ const DSControlledDateRangePicker = (props) => {
|
|
|
46
46
|
};
|
|
47
47
|
DSControlledDateRangePicker.displayName = import_theming.DSControlledDateRangePickerName;
|
|
48
48
|
const DSControlledDateRangePickerWithSchema = (0, import_ds_props_helpers.describe)(DSControlledDateRangePicker);
|
|
49
|
-
DSControlledDateRangePickerWithSchema.propTypes =
|
|
49
|
+
DSControlledDateRangePickerWithSchema.propTypes = import_react_desc_prop_types.DSControlledDateRangePickerPropTypesWithSchema;
|
|
50
50
|
//# sourceMappingURL=ControlledDateRangePicker.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ControlledDateRangePicker.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker.js';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAZN,8BAAyB;AACzB,0CAA6C;AAC7C,wCAA2C;AAC3C,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker.js';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent.js';\nimport { DSControlledDateRangePickerPropTypesWithSchema } from './react-desc-prop-types.js';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX.js';\nimport type { DSControlledDateRangePickerT } from './react-desc-prop-types.js';\nimport { DSControlledDateRangePickerName } from './exported-related/theming.js';\n\nconst DSControlledDateRangePicker = (props: DSControlledDateRangePickerT.Props): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\n\nDSControlledDateRangePicker.displayName = DSControlledDateRangePickerName;\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = DSControlledDateRangePickerPropTypesWithSchema;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAZN,8BAAyB;AACzB,0CAA6C;AAC7C,wCAA2C;AAC3C,mCAA+D;AAC/D,0CAAiD;AAEjD,qBAAgD;AAEhD,MAAM,8BAA8B,CAAC,UAA2D;AAC9F,QAAM,UAAM,kEAA6B,KAAK;AAC9C,SACE,4CAAC,qEAAiC,UAAjC,EAA0C,OAAO,KAChD,sDAAC,gEAA2B,GAC9B;AAEJ;AAEA,4BAA4B,cAAc;AAC1C,MAAM,4CAAwC,kCAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useControlledDateRangePicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useRangePickerLogic } from './useRangePickerLogic.js';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useRangePickerLogic } from './useRangePickerLogic.js';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\ninterface RangePickerLogicT {\n latestChangedDate: string;\n\n onCalendarOpen: () => void;\n onCalendarClose: () => void;\n\n handleFromDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n handleToDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n\n handlePickerDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n handlePickerMonthDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n handlePickerDayDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n handlePickerYearDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n\n getIsStartRangeDay: (day: string) => boolean;\n getIsDayInRange: (day: string) => boolean;\n getIsEndRangeDay: (day: string) => boolean;\n}\n\nexport interface ControlledDateRangePickerContextT {\n props: DSControlledDateRangePickerT.InternalProps;\n instanceUID: string;\n rangePickerLogic: RangePickerLogicT;\n withInputs: boolean;\n withIcon: boolean;\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n xstyledAttrs: Record<string, unknown>;\n globalAttrs: Record<string, unknown>;\n}\n\nexport const useControlledDateRangePicker = (\n props: DSControlledDateRangePickerT.Props,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [\n propsWithDefaults,\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAwB;AACxB,iBAAoB;AACpB,8BAA2D;AAC3D,oCAAuD;AACvD,8BAAiC;AACjC,iCAAoC;AACpC,4CAAmD;AAkC5C,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,gDAAiB,KAAK;AACtB,QAAM,kBAAc,sBAAQ,UAAM,gBAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,wBAAoB,sEAAuC,KAAK;AAEtE,QAAM,mBAAe,4CAAmB,iBAAiB;AAEzD,QAAM,kBAAc,gDAAuB,iBAAiB;AAE5D,QAAM,EAAE,KAAK,IAAI;AAEjB,QAAM,aACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,WACJ,SAAS,yEAAmC,QAAQ,SAAS,yEAAmC;AAClG,QAAM,mBAAmB,SAAS,yEAAmC;AACrE,QAAM,eAAe,SAAS,yEAAmC;AAEjE,QAAM,uBAAmB,gDAAoB,iBAAiB;AAE9D,QAAM,UAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO,EAAE,GAAG,kBAAkB;AAAA,MAC9B;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,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,6 +33,6 @@ __export(useGetPropsWithDefault_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(useGetPropsWithDefault_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
-
var
|
|
37
|
-
const useGetDateRangePickerWithDefaultsProps = (props) => (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props,
|
|
36
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
37
|
+
const useGetDateRangePickerWithDefaultsProps = (props) => (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
38
38
|
//# sourceMappingURL=useGetPropsWithDefault.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetPropsWithDefault.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { defaultProps, type DSControlledDateRangePickerT } from '../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAC7C,
|
|
4
|
+
"sourcesContent": ["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { defaultProps, type DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n// we have to merge the \"default\" nested default values with what the user gives us...\nexport const useGetDateRangePickerWithDefaultsProps = (\n props: DSControlledDateRangePickerT.Props,\n): DSControlledDateRangePickerT.InternalProps => useMemoMergePropsWithDefault(props, defaultProps);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAC7C,mCAAgE;AAEzD,MAAM,yCAAyC,CACpD,cAC+C,sDAA6B,OAAO,yCAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useRangePickerLogic.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { useCallback, useState, useMemo, useEffect } from 'react';\nimport { getDayFromDateString } from '@elliemae/ds-form-date-time-picker';\nimport type { ControlledDateRangePickerContextT } from './useControlledDateRangePicker.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { useCallback, useState, useMemo, useEffect } from 'react';\nimport { getDayFromDateString } from '@elliemae/ds-form-date-time-picker';\nimport type { ControlledDateRangePickerContextT } from './useControlledDateRangePicker.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\nexport const useRangePickerLogic = ({\n fromDate,\n onFromDateChange,\n onMonthFromChange,\n onDayFromChange,\n onYearFromChange,\n toDate,\n onMonthToChange,\n onDayToChange,\n onYearToChange,\n onToDateChange,\n}: DSControlledDateRangePickerT.InternalProps): ControlledDateRangePickerContextT['rangePickerLogic'] => {\n // the implementation is based on controlled-date-time-picker that is not meant to \"understand\"\n // the \"from\" - \"to\" logic on click, we are \"overloading\" the \"from\" - \"to\" logic here\n // we track wheter we are going to set the \"from\" OR \"to\" controlled date based on this toggle\n const [calendarChangeIsFrom, setCalendarChangeIsFrom] = useState(true);\n const [latestChangedDate, setLatestChangedDate] = useState(fromDate);\n useEffect(() => {\n setLatestChangedDate(fromDate);\n }, [fromDate]);\n useEffect(() => {\n setLatestChangedDate(toDate);\n }, [toDate]);\n\n const getChangedDayStringValues = useCallback(\n (changedDay: string) => {\n // based on wheter we are handling a \"from\"/\"to\" change, we calculate some values\n const dateFromString = calendarChangeIsFrom ? changedDay : fromDate;\n const dateFrom = getDayFromDateString(dateFromString);\n const dateToString = calendarChangeIsFrom ? toDate : changedDay;\n const dateTo = getDayFromDateString(dateToString);\n // we force the \"from\" to ALWAYS be before the \"to\" date\n const isToBeforeFrom = !!dateTo && !!dateFrom && dateTo?.getTime() < dateFrom?.getTime();\n const newDateFromString = isToBeforeFrom ? dateToString : dateFromString;\n const forcingFromDatePick = isToBeforeFrom ? !calendarChangeIsFrom : false;\n const newDateToString = isToBeforeFrom ? dateFromString : dateToString;\n const forcingToDatePick = isToBeforeFrom ? calendarChangeIsFrom : false;\n\n // next change should be based on\n // the force pick next interactions\n // toggle between from/to if we didn't force any pick\n let nextToggleStateIsFrom = !calendarChangeIsFrom;\n if (forcingFromDatePick) nextToggleStateIsFrom = false;\n if (forcingToDatePick) nextToggleStateIsFrom = true;\n\n return {\n newDateFromString,\n forcingFromDatePick,\n newDateToString,\n forcingToDatePick,\n isToBeforeFrom,\n nextToggleStateIsFrom,\n currentClickCountAsFrom: !nextToggleStateIsFrom,\n };\n },\n [fromDate, calendarChangeIsFrom, toDate],\n );\n const handlePickerMonthDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerMonthDateChange'] =\n useCallback(\n (newMonth, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onMonthFromChange(newMonth, e, metaInfo);\n else onMonthToChange(newMonth, e, metaInfo);\n },\n [getChangedDayStringValues, onMonthFromChange, onMonthToChange],\n );\n const handlePickerDayDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerDayDateChange'] =\n useCallback(\n (newDay, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onDayFromChange(newDay, e, metaInfo);\n else onDayToChange(newDay, e, metaInfo);\n },\n [getChangedDayStringValues, onDayFromChange, onDayToChange],\n );\n const handlePickerYearDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerYearDateChange'] =\n useCallback(\n (newYear, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onYearFromChange(newYear, e, metaInfo);\n else onYearToChange(newYear, e, metaInfo);\n },\n [getChangedDayStringValues, onYearFromChange, onYearToChange],\n );\n\n // every time the calendar opens/closes, we assume first click is \"from\"\n const onCalendarOpen: ControlledDateRangePickerContextT['rangePickerLogic']['onCalendarOpen'] = useCallback(() => {\n setCalendarChangeIsFrom(true);\n }, []);\n const onCalendarClose: ControlledDateRangePickerContextT['rangePickerLogic']['onCalendarClose'] = useCallback(() => {\n setCalendarChangeIsFrom(true);\n }, []);\n const handlePickerDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerDateChange'] =\n useCallback(\n (changedDay, metaInfo) => {\n const { newDateFromString, newDateToString, nextToggleStateIsFrom, isToBeforeFrom } =\n getChangedDayStringValues(changedDay);\n\n // every \"change\" on the picker range we calculate it as a new \"onChange\" for both values\n // and we pass over the correct \"new\" from/to value\n onFromDateChange(newDateFromString, { ...metaInfo, automaticSwitchedDates: isToBeforeFrom });\n onToDateChange(newDateToString, { ...metaInfo, automaticSwitchedDates: isToBeforeFrom });\n\n // and we notify what the next change type should be\n setCalendarChangeIsFrom(nextToggleStateIsFrom);\n },\n [getChangedDayStringValues, onFromDateChange, onToDateChange],\n );\n\n const getIsStartRangeDay: ControlledDateRangePickerContextT['rangePickerLogic']['getIsStartRangeDay'] = useCallback(\n (dayString) => dayString === fromDate,\n [fromDate],\n );\n const getIsDayInRange: ControlledDateRangePickerContextT['rangePickerLogic']['getIsDayInRange'] = useCallback(\n (dayString) => {\n const dayFrom = getDayFromDateString(fromDate);\n const dayTo = getDayFromDateString(toDate);\n if (!dayFrom || !dayTo || !dayString) return false;\n const newDayTime = getDayFromDateString(dayString)?.getTime();\n return !!newDayTime && newDayTime <= dayTo.getTime() && newDayTime >= dayFrom.getTime();\n },\n [fromDate, toDate],\n );\n const getIsEndRangeDay: ControlledDateRangePickerContextT['rangePickerLogic']['getIsEndRangeDay'] = useCallback(\n (dayString) => dayString === toDate,\n [toDate],\n );\n\n const getIsToBeforeFrom = useCallback((fromString: string, toString: string) => {\n const dateFrom = getDayFromDateString(fromString);\n const dateTo = getDayFromDateString(toString);\n return !!dateTo && !!dateFrom && dateTo?.getTime() < dateFrom?.getTime();\n }, []);\n const handleFromDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handleFromDateChange'] =\n useCallback(\n (newVal, metaInfo) => {\n const isIncorrectOrder = getIsToBeforeFrom(newVal, toDate);\n onFromDateChange(newVal, { ...metaInfo, rangeDateChangeType: 'from', isIncorrectOrder });\n },\n [getIsToBeforeFrom, onFromDateChange, toDate],\n );\n const handleToDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handleToDateChange'] = useCallback(\n (newVal, metaInfo) => {\n const isIncorrectOrder = getIsToBeforeFrom(fromDate, newVal);\n onToDateChange(newVal, { ...metaInfo, rangeDateChangeType: 'to', isIncorrectOrder });\n },\n [fromDate, getIsToBeforeFrom, onToDateChange],\n );\n\n return useMemo(\n () => ({\n latestChangedDate,\n onCalendarOpen,\n onCalendarClose,\n handleFromDateChange,\n handleToDateChange,\n handlePickerDateChange,\n handlePickerMonthDateChange,\n handlePickerDayDateChange,\n handlePickerYearDateChange,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n }),\n [\n latestChangedDate,\n onCalendarOpen,\n onCalendarClose,\n handleFromDateChange,\n handleToDateChange,\n handlePickerDateChange,\n handlePickerMonthDateChange,\n handlePickerDayDateChange,\n handlePickerYearDateChange,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA0D;AAC1D,sCAAqC;AAI9B,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyG;AAIvG,QAAM,CAAC,sBAAsB,uBAAuB,QAAI,uBAAS,IAAI;AACrE,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAS,QAAQ;AACnE,8BAAU,MAAM;AACd,yBAAqB,QAAQ;AAAA,EAC/B,GAAG,CAAC,QAAQ,CAAC;AACb,8BAAU,MAAM;AACd,yBAAqB,MAAM;AAAA,EAC7B,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,gCAA4B;AAAA,IAChC,CAAC,eAAuB;AAEtB,YAAM,iBAAiB,uBAAuB,aAAa;AAC3D,YAAM,eAAW,sDAAqB,cAAc;AACpD,YAAM,eAAe,uBAAuB,SAAS;AACrD,YAAM,aAAS,sDAAqB,YAAY;AAEhD,YAAM,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAAC,YAAY,QAAQ,QAAQ,IAAI,UAAU,QAAQ;AACvF,YAAM,oBAAoB,iBAAiB,eAAe;AAC1D,YAAM,sBAAsB,iBAAiB,CAAC,uBAAuB;AACrE,YAAM,kBAAkB,iBAAiB,iBAAiB;AAC1D,YAAM,oBAAoB,iBAAiB,uBAAuB;AAKlE,UAAI,wBAAwB,CAAC;AAC7B,UAAI,oBAAqB,yBAAwB;AACjD,UAAI,kBAAmB,yBAAwB;AAE/C,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;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AACF,QAAM,yBAAkG;AAAA,IACtG,CAAC,QAAQ,aAAa;AACpB,YAAM,mBAAmB,kBAAkB,UAAU,MAAM;AAC3D,qBAAe,QAAQ,EAAE,GAAG,UAAU,qBAAqB,MAAM,iBAAiB,CAAC;AAAA,IACrF;AAAA,IACA,CAAC,UAAU,mBAAmB,cAAc;AAAA,EAC9C;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,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,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;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 @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\nexport const useValidateProps = (props: DSControlledDateRangePickerT.Props): void => {};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIhB,MAAM,mBAAmB,CAAC,UAAoD;AAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,7 +33,13 @@ __export(src_exports, {
|
|
|
33
33
|
DSControlledDateRangePicker: () => import_ControlledDateRangePicker.DSControlledDateRangePicker,
|
|
34
34
|
DSControlledDateRangePickerName: () => import_theming.DSControlledDateRangePickerName,
|
|
35
35
|
DSControlledDateRangePickerSlots: () => import_theming.DSControlledDateRangePickerSlots,
|
|
36
|
-
DSControlledDateRangePickerWithSchema: () => import_ControlledDateRangePicker.DSControlledDateRangePickerWithSchema
|
|
36
|
+
DSControlledDateRangePickerWithSchema: () => import_ControlledDateRangePicker.DSControlledDateRangePickerWithSchema,
|
|
37
|
+
getDateStringFromDay: () => import_ds_form_date_time_picker.getDateStringFromDay,
|
|
38
|
+
getDateValuesFromDate: () => import_ds_form_date_time_picker.getDateValuesFromDate,
|
|
39
|
+
getDayFromDateString: () => import_ds_form_date_time_picker.getDayFromDateString,
|
|
40
|
+
getValidationDateStringMetaInfo: () => import_ds_form_date_time_picker.getValidationDateStringMetaInfo,
|
|
41
|
+
getValidationDateTimeStringMetaInfo: () => import_ds_form_date_time_picker.getValidationDateTimeStringMetaInfo,
|
|
42
|
+
getValidationTimeStringMetaInfo: () => import_ds_form_date_time_picker.getValidationTimeStringMetaInfo
|
|
37
43
|
});
|
|
38
44
|
module.exports = __toCommonJS(src_exports);
|
|
39
45
|
var React = __toESM(require("react"));
|
|
@@ -41,4 +47,5 @@ var import_ControlledDateRangePicker = require("./ControlledDateRangePicker.js")
|
|
|
41
47
|
var import_theming = require("./exported-related/theming.js");
|
|
42
48
|
var import_ControlledDateRangePickerDatatestid = require("./ControlledDateRangePickerDatatestid.js");
|
|
43
49
|
var import_ControlledDateRangePickerTypes = require("./ControlledDateRangePickerTypes.js");
|
|
50
|
+
var import_ds_form_date_time_picker = require("@elliemae/ds-form-date-time-picker");
|
|
44
51
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } from './ControlledDateRangePicker.js';\nexport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from './exported-related/theming.js';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid.js';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes.js';\nexport { type DSControlledDateRangePickerT } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uCAAmF;AACnF,qBAAkF;AAClF,iDAAoD;AACpD,4CAAmD;",
|
|
4
|
+
"sourcesContent": ["export { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } from './ControlledDateRangePicker.js';\nexport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from './exported-related/theming.js';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid.js';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes.js';\nexport {\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n getValidationDateStringMetaInfo,\n getValidationDateTimeStringMetaInfo,\n getValidationTimeStringMetaInfo,\n} from '@elliemae/ds-form-date-time-picker';\nexport { type DSControlledDateRangePickerT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uCAAmF;AACnF,qBAAkF;AAClF,iDAAoD;AACpD,4CAAmD;AACnD,sCAOO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/ControlledDateRangeContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX.js';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate.js';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate.js';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar.js';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid.js';\nimport { gridMap } from '../utils/utils.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX.js';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate.js';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate.js';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar.js';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid.js';\nimport { gridMap } from '../utils/utils.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\nimport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from '../exported-related/theming.js';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: DSControlledDateRangePickerT.ControlledDateRangeType;\n}\n\nconst StyledWrapper = styled('div', {\n name: DSControlledDateRangePickerName,\n slot: DSControlledDateRangePickerSlots.CONTAINER,\n})<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n ${xStyledCommonProps}\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n xstyledAttrs,\n globalAttrs,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqDf;AArDR,mBAAkC;AAClC,uBAA2C;AAC3C,0CAAiD;AACjD,yCAA4C;AAC5C,uCAA0C;AAC1C,yCAA4C;AAC5C,iDAAoD;AACpD,mBAAwB;AAExB,qBAAkF;AAQlF,MAAM,oBAAgB,yBAAO,OAAO;AAAA,EAClC,MAAM;AAAA,EACN,MAAM,gDAAiC;AACzC,CAAC;AAAA;AAAA,2BAE0B,CAAC,EAAE,KAAK,MAAM,qBAAQ,IAAI,CAAC;AAAA;AAAA,IAElD,CAAC,EAAE,kBAAkB,aAAa,MAAO,oBAAoB,eAAe,KAAK,eAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjG,mCAAkB;AAAA;AAGf,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE,KAAK;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,oEAAgC;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAa,+EAAoC;AAAA,MACjD;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,qBACC,4EACE;AAAA,sDAAC,kEAA4B;AAAA,UAC7B,4CAAC,8DAA0B;AAAA,WAC7B,IACE;AAAA,QACH,YAAY,mBAAmB,4CAAC,kEAA4B,IAAK;AAAA;AAAA;AAAA,EACpE;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSControlledDateRangePickerPropTypes: () => DSControlledDateRangePickerPropTypes,
|
|
32
|
+
DSControlledDateRangePickerPropTypesWithSchema: () => DSControlledDateRangePickerPropTypesWithSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
33
34
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
36
|
var React = __toESM(require("react"));
|
|
36
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
38
|
const noop = () => {
|
|
@@ -56,7 +57,7 @@ const defaultProps = {
|
|
|
56
57
|
isClearable: false,
|
|
57
58
|
autoFocus: false
|
|
58
59
|
};
|
|
59
|
-
const
|
|
60
|
+
const DSControlledDateRangePickerPropTypes = {
|
|
60
61
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
61
62
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
62
63
|
type: import_ds_props_helpers.PropTypes.oneOf([
|
|
@@ -97,4 +98,5 @@ const propTypes = {
|
|
|
97
98
|
'"from" month input html node reference'
|
|
98
99
|
)
|
|
99
100
|
};
|
|
100
|
-
|
|
101
|
+
const DSControlledDateRangePickerPropTypesWithSchema = DSControlledDateRangePickerPropTypes;
|
|
102
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap, GlobalAttributesT, DSPropTypesSchema, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { type DSControlledDateTimePickerT } from '@elliemae/ds-form-date-time-picker';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\nconst defaultReturnFalse = (): boolean => false;\n\nexport declare namespace DSControlledDateRangePickerT {\n export interface RangePickerMetaInfoT extends DSControlledDateTimePickerT.InternalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n }\n\n export type RangeOnDateChange = (val: string, metaInfo: RangePickerMetaInfoT) => void;\n\n export type AppOnInputChange = DSControlledDateTimePickerT.AppOnInputChange;\n\n export type ControlledDateRangeType =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n type: ControlledDateRangeType;\n fromDate: string;\n onFromDateChange: RangeOnDateChange;\n onMonthFromChange: AppOnInputChange;\n onDayFromChange: AppOnInputChange;\n onYearFromChange: AppOnInputChange;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: RangeOnDateChange;\n onMonthToChange: AppOnInputChange;\n onDayToChange: AppOnInputChange;\n onYearToChange: AppOnInputChange;\n\n isClearable: boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsOutOfRangeDay: (day: string) => boolean;\n autoFocus: boolean;\n }\n\n export interface OptionalProps {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n OptionalProps,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n OptionalProps,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSControlledDateRangePickerT.DefaultProps = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\n\nexport const DSControlledDateRangePickerPropTypes: DSPropTypesSchema<DSControlledDateRangePickerT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ])\n .description('Type of date range form control to use')\n .defaultValue('full-date-range'),\n fromDate: PropTypes.string.description(`strictly formatted string representing user's selected \"from\" date`)\n .isRequired,\n onFromDateChange: PropTypes.func\n .description('function to react to \"from\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthFromChange: PropTypes.func\n .description('function to react to \"from\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayFromChange: PropTypes.func\n .description('function to react to \"from\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearFromChange: PropTypes.func\n .description('function to react to \"from\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n toDate: PropTypes.string.description(`strictly formatted string representing user's selected \"to\" date`).isRequired,\n onToDateChange: PropTypes.func\n .description('function to react to \"to\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthToChange: PropTypes.func\n .description('function to react to \"to\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayToChange: PropTypes.func\n .description('function to react to \"to\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearToChange: PropTypes.func\n .description('function to react to \"to\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n getIsDisabledDay: PropTypes.func\n .description('function used to mark day as \"disable\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n getIsOutOfRangeDay: PropTypes.func\n .description('function used to mark day as \"out of range\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n pickerFooterMsg: PropTypes.string.description(''),\n hasError: PropTypes.bool\n .description('boolean indicating wheter the selected range is to be marked as wrong')\n .defaultValue(false),\n isClearable: PropTypes.bool\n .description('boolean to optionally activate \"clearable\" icons in the inputs')\n .defaultValue(false),\n autoFocus: PropTypes.bool\n .description('boolean to auto-focus the \"from\" date month on render as per html auto-focus propriety')\n .defaultValue(false),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'strictly formatted string representing the starting month to be displayed when calendar context menu is invoked without any selected dates',\n ),\n onCalendarOpenFocusedDay: PropTypes.string.description(\n 'strictly formatted string representing the day to be focused when calendar context menu is invoked without any selected dates',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n '\"from\" month input html node reference',\n ),\n};\n\nexport const DSControlledDateRangePickerPropTypesWithSchema =\n DSControlledDateRangePickerPropTypes as unknown as ValidationMap<DSControlledDateRangePickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAuE;AAMvE,MAAM,OAAO,MAAY;AAAC;AAE1B,MAAM,qBAAqB,MAAe;AAmEnC,MAAM,eAA0D;AAAA,EACrE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AACb;AAEO,MAAM,uCAA8F;AAAA,EACzG,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,wCAAwC,EACpD,aAAa,iBAAiB;AAAA,EACjC,UAAU,kCAAU,OAAO,YAAY,oEAAoE,EACxG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AAwF,EACpG,aAAa,KAAK;AAAA,EACrB,0BAA0B,kCAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,kCAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AACF;AAEO,MAAM,iDACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = __toESM(require("react"));
|
|
27
|
+
var import__ = require("../index.js");
|
|
28
|
+
const ref = import_react.default.createRef();
|
|
29
|
+
const noop = () => {
|
|
30
|
+
};
|
|
31
|
+
const defaultReturnFalse = () => false;
|
|
32
|
+
const testOptionalProps = {
|
|
33
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
34
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
innerRef: ref
|
|
37
|
+
};
|
|
38
|
+
const testPartialDefaults = {
|
|
39
|
+
type: "full-date-range",
|
|
40
|
+
fromDate: "",
|
|
41
|
+
onMonthFromChange: noop,
|
|
42
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
43
|
+
hasError: false,
|
|
44
|
+
isClearable: false
|
|
45
|
+
};
|
|
46
|
+
const testProps = {
|
|
47
|
+
...testOptionalProps,
|
|
48
|
+
...testPartialDefaults
|
|
49
|
+
};
|
|
50
|
+
const testPropsAsSyntax = {
|
|
51
|
+
...testOptionalProps,
|
|
52
|
+
...testPartialDefaults
|
|
53
|
+
};
|
|
54
|
+
const testCompleteDefaults = {
|
|
55
|
+
type: "full-date-range",
|
|
56
|
+
fromDate: "",
|
|
57
|
+
onFromDateChange: noop,
|
|
58
|
+
onMonthFromChange: noop,
|
|
59
|
+
onDayFromChange: noop,
|
|
60
|
+
onYearFromChange: noop,
|
|
61
|
+
pickerFooterMsg: "",
|
|
62
|
+
toDate: "",
|
|
63
|
+
onToDateChange: noop,
|
|
64
|
+
onMonthToChange: noop,
|
|
65
|
+
onDayToChange: noop,
|
|
66
|
+
onYearToChange: noop,
|
|
67
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
68
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
69
|
+
hasError: false,
|
|
70
|
+
isClearable: false,
|
|
71
|
+
autoFocus: false
|
|
72
|
+
};
|
|
73
|
+
const testInternalProps = {
|
|
74
|
+
...testOptionalProps,
|
|
75
|
+
...testCompleteDefaults
|
|
76
|
+
};
|
|
77
|
+
const testInternalPropsAsSyntax = {
|
|
78
|
+
...testOptionalProps,
|
|
79
|
+
...testCompleteDefaults
|
|
80
|
+
};
|
|
81
|
+
const testExplicitDefinition = {
|
|
82
|
+
type: "full-date-range",
|
|
83
|
+
fromDate: "",
|
|
84
|
+
onFromDateChange: noop,
|
|
85
|
+
onMonthFromChange: noop,
|
|
86
|
+
onDayFromChange: noop,
|
|
87
|
+
onYearFromChange: noop,
|
|
88
|
+
pickerFooterMsg: "",
|
|
89
|
+
toDate: "",
|
|
90
|
+
onToDateChange: noop,
|
|
91
|
+
onMonthToChange: noop,
|
|
92
|
+
onDayToChange: noop,
|
|
93
|
+
onYearToChange: noop,
|
|
94
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
95
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
96
|
+
hasError: false,
|
|
97
|
+
isClearable: false,
|
|
98
|
+
autoFocus: false,
|
|
99
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
100
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
101
|
+
tabIndex: 0,
|
|
102
|
+
innerRef: ref
|
|
103
|
+
};
|
|
104
|
+
const testInferedTypeCompatibility = {
|
|
105
|
+
type: "full-date-range",
|
|
106
|
+
fromDate: "",
|
|
107
|
+
onFromDateChange: noop,
|
|
108
|
+
onMonthFromChange: noop,
|
|
109
|
+
onDayFromChange: noop,
|
|
110
|
+
onYearFromChange: noop,
|
|
111
|
+
pickerFooterMsg: "",
|
|
112
|
+
toDate: "",
|
|
113
|
+
onToDateChange: noop,
|
|
114
|
+
onMonthToChange: noop,
|
|
115
|
+
onDayToChange: noop,
|
|
116
|
+
onYearToChange: noop,
|
|
117
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
118
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
119
|
+
hasError: false,
|
|
120
|
+
isClearable: false,
|
|
121
|
+
autoFocus: false,
|
|
122
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
123
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
124
|
+
tabIndex: 0,
|
|
125
|
+
innerRef: ref
|
|
126
|
+
};
|
|
127
|
+
const testDefinitionAsConst = {
|
|
128
|
+
type: "full-date-range",
|
|
129
|
+
fromDate: "",
|
|
130
|
+
onFromDateChange: noop,
|
|
131
|
+
onMonthFromChange: noop,
|
|
132
|
+
onDayFromChange: noop,
|
|
133
|
+
onYearFromChange: noop,
|
|
134
|
+
pickerFooterMsg: "",
|
|
135
|
+
toDate: "",
|
|
136
|
+
onToDateChange: noop,
|
|
137
|
+
onMonthToChange: noop,
|
|
138
|
+
onDayToChange: noop,
|
|
139
|
+
onYearToChange: noop,
|
|
140
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
141
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
142
|
+
hasError: false,
|
|
143
|
+
isClearable: false,
|
|
144
|
+
autoFocus: false,
|
|
145
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
146
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
147
|
+
tabIndex: 0,
|
|
148
|
+
innerRef: ref
|
|
149
|
+
};
|
|
150
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSControlledDateRangePicker, { ...testExplicitDefinition }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSControlledDateRangePicker, { ...testInferedTypeCompatibility }),
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSControlledDateRangePicker, { ...testDefinitionAsConst }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
|
+
import__.DSControlledDateRangePicker,
|
|
156
|
+
{
|
|
157
|
+
type: "full-date-range",
|
|
158
|
+
fromDate: "",
|
|
159
|
+
onFromDateChange: noop,
|
|
160
|
+
onMonthFromChange: noop,
|
|
161
|
+
onDayFromChange: noop,
|
|
162
|
+
onYearFromChange: noop,
|
|
163
|
+
pickerFooterMsg: "",
|
|
164
|
+
toDate: "",
|
|
165
|
+
onToDateChange: noop,
|
|
166
|
+
onMonthToChange: noop,
|
|
167
|
+
onDayToChange: noop,
|
|
168
|
+
onYearToChange: noop,
|
|
169
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
170
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
171
|
+
hasError: false,
|
|
172
|
+
isClearable: false,
|
|
173
|
+
autoFocus: false,
|
|
174
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
175
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
176
|
+
tabIndex: 0,
|
|
177
|
+
innerRef: ref
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
] });
|
|
181
|
+
//# sourceMappingURL=typescript-date-range-picker-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-date-range-picker-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSControlledDateRangePicker } from '../index.js';\nimport type { DSControlledDateRangePickerT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSControlledDateRangePickerT.Props;\ntype ComponentPropsInternals = DSControlledDateRangePickerT.InternalProps;\ntype ComponentPropsDefaultProps = DSControlledDateRangePickerT.DefaultProps;\ntype ComponentPropsOptionalProps = DSControlledDateRangePickerT.OptionalProps;\n\nconst ref = React.createRef() as React.MutableRefObject<HTMLInputElement>;\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n type: 'full-date-range',\n fromDate: '',\n onMonthFromChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n\n hasError: false,\n isClearable: false,\n};\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSControlledDateRangePicker {...testExplicitDefinition} />\n <DSControlledDateRangePicker {...testInferedTypeCompatibility} />\n <DSControlledDateRangePicker {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSControlledDateRangePicker\n type=\"full-date-range\"\n fromDate=\"\"\n onFromDateChange={noop}\n onMonthFromChange={noop}\n onDayFromChange={noop}\n onYearFromChange={noop}\n pickerFooterMsg=\"\"\n toDate=\"\"\n onToDateChange={noop}\n onMonthToChange={noop}\n onDayToChange={noop}\n onYearToChange={noop}\n getIsDisabledDay={defaultReturnFalse}\n getIsOutOfRangeDay={defaultReturnFalse}\n hasError={false}\n isClearable={false}\n autoFocus={false}\n emptyPickerStartingMonth=\"12/__/2000\"\n onCalendarOpenFocusedDay=\"12/27/2000\"\n tabIndex={0}\n innerRef={ref}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACkJrB;AAjJF,mBAAkB;AAClB,eAA4C;AAS5C,MAAM,MAAM,aAAAA,QAAM,UAAU;AAC5B,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAE1C,MAAM,oBAAiD;AAAA,EACrD,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,UAAU;AACZ;AAIA,MAAM,sBAA2D;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAElB,UAAU;AAAA,EACV,aAAa;AACf;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AACb;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;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EACb,WAAW;AAAA,EACX,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,wCAA6B,GAAG,wBAAwB;AAAA,EACzD,4CAAC,wCAA6B,GAAG,8BAA8B;AAAA,EAC/D,4CAAC,wCAA6B,GAAG,uBAAuB;AAAA,EAExD;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAS;AAAA,MACT,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,kBAAkB;AAAA,MAClB,iBAAgB;AAAA,MAChB,QAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MACjB,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,oBAAoB;AAAA,MACpB,UAAU;AAAA,MACV,aAAa;AAAA,MACb,WAAW;AAAA,MACX,0BAAyB;AAAA,MACzB,0BAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA;AAAA,EACZ;AAAA,GACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { useControlledDateRangePicker } from "./config/useControlledDateRangePicker.js";
|
|
5
5
|
import { ControlledDateRangeContent } from "./parts/ControlledDateRangeContent.js";
|
|
6
|
-
import {
|
|
6
|
+
import { DSControlledDateRangePickerPropTypesWithSchema } from "./react-desc-prop-types.js";
|
|
7
7
|
import { ControlledDateRangePickerContext } from "./ControlledDateRangePickerCTX.js";
|
|
8
8
|
import { DSControlledDateRangePickerName } from "./exported-related/theming.js";
|
|
9
9
|
const DSControlledDateRangePicker = (props) => {
|
|
@@ -12,7 +12,7 @@ const DSControlledDateRangePicker = (props) => {
|
|
|
12
12
|
};
|
|
13
13
|
DSControlledDateRangePicker.displayName = DSControlledDateRangePickerName;
|
|
14
14
|
const DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);
|
|
15
|
-
DSControlledDateRangePickerWithSchema.propTypes =
|
|
15
|
+
DSControlledDateRangePickerWithSchema.propTypes = DSControlledDateRangePickerPropTypesWithSchema;
|
|
16
16
|
export {
|
|
17
17
|
DSControlledDateRangePicker,
|
|
18
18
|
DSControlledDateRangePickerWithSchema
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ControlledDateRangePicker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker.js';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACcjB;AAZN,SAAS,gBAAgB;AACzB,SAAS,oCAAoC;AAC7C,SAAS,kCAAkC;AAC3C,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useControlledDateRangePicker } from './config/useControlledDateRangePicker.js';\nimport { ControlledDateRangeContent } from './parts/ControlledDateRangeContent.js';\nimport { DSControlledDateRangePickerPropTypesWithSchema } from './react-desc-prop-types.js';\nimport { ControlledDateRangePickerContext } from './ControlledDateRangePickerCTX.js';\nimport type { DSControlledDateRangePickerT } from './react-desc-prop-types.js';\nimport { DSControlledDateRangePickerName } from './exported-related/theming.js';\n\nconst DSControlledDateRangePicker = (props: DSControlledDateRangePickerT.Props): JSX.Element => {\n const ctx = useControlledDateRangePicker(props);\n return (\n <ControlledDateRangePickerContext.Provider value={ctx}>\n <ControlledDateRangeContent />\n </ControlledDateRangePickerContext.Provider>\n );\n};\n\nDSControlledDateRangePicker.displayName = DSControlledDateRangePickerName;\nconst DSControlledDateRangePickerWithSchema = describe(DSControlledDateRangePicker);\nDSControlledDateRangePickerWithSchema.propTypes = DSControlledDateRangePickerPropTypesWithSchema;\n\nexport { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACcjB;AAZN,SAAS,gBAAgB;AACzB,SAAS,oCAAoC;AAC7C,SAAS,kCAAkC;AAC3C,SAAS,sDAAsD;AAC/D,SAAS,wCAAwC;AAEjD,SAAS,uCAAuC;AAEhD,MAAM,8BAA8B,CAAC,UAA2D;AAC9F,QAAM,MAAM,6BAA6B,KAAK;AAC9C,SACE,oBAAC,iCAAiC,UAAjC,EAA0C,OAAO,KAChD,8BAAC,8BAA2B,GAC9B;AAEJ;AAEA,4BAA4B,cAAc;AAC1C,MAAM,wCAAwC,SAAS,2BAA2B;AAClF,sCAAsC,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useControlledDateRangePicker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useRangePickerLogic } from './useRangePickerLogic.js';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDateRangePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useRangePickerLogic } from './useRangePickerLogic.js';\nimport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from '../ControlledDateRangePickerTypes.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\ninterface RangePickerLogicT {\n latestChangedDate: string;\n\n onCalendarOpen: () => void;\n onCalendarClose: () => void;\n\n handleFromDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n handleToDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n\n handlePickerDateChange: DSControlledDateRangePickerT.RangeOnDateChange;\n handlePickerMonthDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n handlePickerDayDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n handlePickerYearDateChange: DSControlledDateRangePickerT.AppOnInputChange;\n\n getIsStartRangeDay: (day: string) => boolean;\n getIsDayInRange: (day: string) => boolean;\n getIsEndRangeDay: (day: string) => boolean;\n}\n\nexport interface ControlledDateRangePickerContextT {\n props: DSControlledDateRangePickerT.InternalProps;\n instanceUID: string;\n rangePickerLogic: RangePickerLogicT;\n withInputs: boolean;\n withIcon: boolean;\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n xstyledAttrs: Record<string, unknown>;\n globalAttrs: Record<string, unknown>;\n}\n\nexport const useControlledDateRangePicker = (\n props: DSControlledDateRangePickerT.Props,\n): ControlledDateRangePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n const instanceUID = useMemo(() => uid(6), []);\n const propsWithDefaults = useGetDateRangePickerWithDefaultsProps(props);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { type } = propsWithDefaults;\n\n const withInputs =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.INPUTS;\n const withIcon =\n type === CONTROLLED_DATE_RANGE_PICKER_TYPES.FULL || type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n const isControllerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.CONTROLLER_ONLY;\n const isPickerOnly = type === CONTROLLED_DATE_RANGE_PICKER_TYPES.PICKER;\n\n const rangePickerLogic = useRangePickerLogic(propsWithDefaults);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n }),\n [\n propsWithDefaults,\n xstyledAttrs,\n globalAttrs,\n instanceUID,\n rangePickerLogic,\n withInputs,\n withIcon,\n isControllerOnly,\n isPickerOnly,\n ],\n );\n\n return ctx;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,eAAe;AACxB,SAAS,WAAW;AACpB,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,8CAA8C;AACvD,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,0CAA0C;AAkC5C,MAAM,+BAA+B,CAC1C,UACsC;AAEtC,mBAAiB,KAAK;AACtB,QAAM,cAAc,QAAQ,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAM,oBAAoB,uCAAuC,KAAK;AAEtE,QAAM,eAAe,mBAAmB,iBAAiB;AAEzD,QAAM,cAAc,uBAAuB,iBAAiB;AAE5D,QAAM,EAAE,KAAK,IAAI;AAEjB,QAAM,aACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,WACJ,SAAS,mCAAmC,QAAQ,SAAS,mCAAmC;AAClG,QAAM,mBAAmB,SAAS,mCAAmC;AACrE,QAAM,eAAe,SAAS,mCAAmC;AAEjE,QAAM,mBAAmB,oBAAoB,iBAAiB;AAE9D,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO,EAAE,GAAG,kBAAkB;AAAA,MAC9B;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,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { defaultProps } from "../
|
|
3
|
+
import { defaultProps } from "../react-desc-prop-types.js";
|
|
4
4
|
const useGetDateRangePickerWithDefaultsProps = (props) => useMemoMergePropsWithDefault(props, defaultProps);
|
|
5
5
|
export {
|
|
6
6
|
useGetDateRangePickerWithDefaultsProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGetPropsWithDefault.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { defaultProps, type DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { defaultProps, type DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n// we have to merge the \"default\" nested default values with what the user gives us...\nexport const useGetDateRangePickerWithDefaultsProps = (\n props: DSControlledDateRangePickerT.Props,\n): DSControlledDateRangePickerT.InternalProps => useMemoMergePropsWithDefault(props, defaultProps);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,oBAAuD;AAEzD,MAAM,yCAAyC,CACpD,UAC+C,6BAA6B,OAAO,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useRangePickerLogic.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { useCallback, useState, useMemo, useEffect } from 'react';\nimport { getDayFromDateString } from '@elliemae/ds-form-date-time-picker';\nimport type { ControlledDateRangePickerContextT } from './useControlledDateRangePicker.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { useCallback, useState, useMemo, useEffect } from 'react';\nimport { getDayFromDateString } from '@elliemae/ds-form-date-time-picker';\nimport type { ControlledDateRangePickerContextT } from './useControlledDateRangePicker.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\nexport const useRangePickerLogic = ({\n fromDate,\n onFromDateChange,\n onMonthFromChange,\n onDayFromChange,\n onYearFromChange,\n toDate,\n onMonthToChange,\n onDayToChange,\n onYearToChange,\n onToDateChange,\n}: DSControlledDateRangePickerT.InternalProps): ControlledDateRangePickerContextT['rangePickerLogic'] => {\n // the implementation is based on controlled-date-time-picker that is not meant to \"understand\"\n // the \"from\" - \"to\" logic on click, we are \"overloading\" the \"from\" - \"to\" logic here\n // we track wheter we are going to set the \"from\" OR \"to\" controlled date based on this toggle\n const [calendarChangeIsFrom, setCalendarChangeIsFrom] = useState(true);\n const [latestChangedDate, setLatestChangedDate] = useState(fromDate);\n useEffect(() => {\n setLatestChangedDate(fromDate);\n }, [fromDate]);\n useEffect(() => {\n setLatestChangedDate(toDate);\n }, [toDate]);\n\n const getChangedDayStringValues = useCallback(\n (changedDay: string) => {\n // based on wheter we are handling a \"from\"/\"to\" change, we calculate some values\n const dateFromString = calendarChangeIsFrom ? changedDay : fromDate;\n const dateFrom = getDayFromDateString(dateFromString);\n const dateToString = calendarChangeIsFrom ? toDate : changedDay;\n const dateTo = getDayFromDateString(dateToString);\n // we force the \"from\" to ALWAYS be before the \"to\" date\n const isToBeforeFrom = !!dateTo && !!dateFrom && dateTo?.getTime() < dateFrom?.getTime();\n const newDateFromString = isToBeforeFrom ? dateToString : dateFromString;\n const forcingFromDatePick = isToBeforeFrom ? !calendarChangeIsFrom : false;\n const newDateToString = isToBeforeFrom ? dateFromString : dateToString;\n const forcingToDatePick = isToBeforeFrom ? calendarChangeIsFrom : false;\n\n // next change should be based on\n // the force pick next interactions\n // toggle between from/to if we didn't force any pick\n let nextToggleStateIsFrom = !calendarChangeIsFrom;\n if (forcingFromDatePick) nextToggleStateIsFrom = false;\n if (forcingToDatePick) nextToggleStateIsFrom = true;\n\n return {\n newDateFromString,\n forcingFromDatePick,\n newDateToString,\n forcingToDatePick,\n isToBeforeFrom,\n nextToggleStateIsFrom,\n currentClickCountAsFrom: !nextToggleStateIsFrom,\n };\n },\n [fromDate, calendarChangeIsFrom, toDate],\n );\n const handlePickerMonthDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerMonthDateChange'] =\n useCallback(\n (newMonth, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onMonthFromChange(newMonth, e, metaInfo);\n else onMonthToChange(newMonth, e, metaInfo);\n },\n [getChangedDayStringValues, onMonthFromChange, onMonthToChange],\n );\n const handlePickerDayDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerDayDateChange'] =\n useCallback(\n (newDay, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onDayFromChange(newDay, e, metaInfo);\n else onDayToChange(newDay, e, metaInfo);\n },\n [getChangedDayStringValues, onDayFromChange, onDayToChange],\n );\n const handlePickerYearDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerYearDateChange'] =\n useCallback(\n (newYear, e, metaInfo) => {\n const { newDateString = '' } = metaInfo;\n const { currentClickCountAsFrom } = getChangedDayStringValues(newDateString);\n if (currentClickCountAsFrom) onYearFromChange(newYear, e, metaInfo);\n else onYearToChange(newYear, e, metaInfo);\n },\n [getChangedDayStringValues, onYearFromChange, onYearToChange],\n );\n\n // every time the calendar opens/closes, we assume first click is \"from\"\n const onCalendarOpen: ControlledDateRangePickerContextT['rangePickerLogic']['onCalendarOpen'] = useCallback(() => {\n setCalendarChangeIsFrom(true);\n }, []);\n const onCalendarClose: ControlledDateRangePickerContextT['rangePickerLogic']['onCalendarClose'] = useCallback(() => {\n setCalendarChangeIsFrom(true);\n }, []);\n const handlePickerDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handlePickerDateChange'] =\n useCallback(\n (changedDay, metaInfo) => {\n const { newDateFromString, newDateToString, nextToggleStateIsFrom, isToBeforeFrom } =\n getChangedDayStringValues(changedDay);\n\n // every \"change\" on the picker range we calculate it as a new \"onChange\" for both values\n // and we pass over the correct \"new\" from/to value\n onFromDateChange(newDateFromString, { ...metaInfo, automaticSwitchedDates: isToBeforeFrom });\n onToDateChange(newDateToString, { ...metaInfo, automaticSwitchedDates: isToBeforeFrom });\n\n // and we notify what the next change type should be\n setCalendarChangeIsFrom(nextToggleStateIsFrom);\n },\n [getChangedDayStringValues, onFromDateChange, onToDateChange],\n );\n\n const getIsStartRangeDay: ControlledDateRangePickerContextT['rangePickerLogic']['getIsStartRangeDay'] = useCallback(\n (dayString) => dayString === fromDate,\n [fromDate],\n );\n const getIsDayInRange: ControlledDateRangePickerContextT['rangePickerLogic']['getIsDayInRange'] = useCallback(\n (dayString) => {\n const dayFrom = getDayFromDateString(fromDate);\n const dayTo = getDayFromDateString(toDate);\n if (!dayFrom || !dayTo || !dayString) return false;\n const newDayTime = getDayFromDateString(dayString)?.getTime();\n return !!newDayTime && newDayTime <= dayTo.getTime() && newDayTime >= dayFrom.getTime();\n },\n [fromDate, toDate],\n );\n const getIsEndRangeDay: ControlledDateRangePickerContextT['rangePickerLogic']['getIsEndRangeDay'] = useCallback(\n (dayString) => dayString === toDate,\n [toDate],\n );\n\n const getIsToBeforeFrom = useCallback((fromString: string, toString: string) => {\n const dateFrom = getDayFromDateString(fromString);\n const dateTo = getDayFromDateString(toString);\n return !!dateTo && !!dateFrom && dateTo?.getTime() < dateFrom?.getTime();\n }, []);\n const handleFromDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handleFromDateChange'] =\n useCallback(\n (newVal, metaInfo) => {\n const isIncorrectOrder = getIsToBeforeFrom(newVal, toDate);\n onFromDateChange(newVal, { ...metaInfo, rangeDateChangeType: 'from', isIncorrectOrder });\n },\n [getIsToBeforeFrom, onFromDateChange, toDate],\n );\n const handleToDateChange: ControlledDateRangePickerContextT['rangePickerLogic']['handleToDateChange'] = useCallback(\n (newVal, metaInfo) => {\n const isIncorrectOrder = getIsToBeforeFrom(fromDate, newVal);\n onToDateChange(newVal, { ...metaInfo, rangeDateChangeType: 'to', isIncorrectOrder });\n },\n [fromDate, getIsToBeforeFrom, onToDateChange],\n );\n\n return useMemo(\n () => ({\n latestChangedDate,\n onCalendarOpen,\n onCalendarClose,\n handleFromDateChange,\n handleToDateChange,\n handlePickerDateChange,\n handlePickerMonthDateChange,\n handlePickerDayDateChange,\n handlePickerYearDateChange,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n }),\n [\n latestChangedDate,\n onCalendarOpen,\n onCalendarClose,\n handleFromDateChange,\n handleToDateChange,\n handlePickerDateChange,\n handlePickerMonthDateChange,\n handlePickerDayDateChange,\n handlePickerYearDateChange,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n ],\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,aAAa,UAAU,SAAS,iBAAiB;AAC1D,SAAS,4BAA4B;AAI9B,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyG;AAIvG,QAAM,CAAC,sBAAsB,uBAAuB,IAAI,SAAS,IAAI;AACrE,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAS,QAAQ;AACnE,YAAU,MAAM;AACd,yBAAqB,QAAQ;AAAA,EAC/B,GAAG,CAAC,QAAQ,CAAC;AACb,YAAU,MAAM;AACd,yBAAqB,MAAM;AAAA,EAC7B,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,4BAA4B;AAAA,IAChC,CAAC,eAAuB;AAEtB,YAAM,iBAAiB,uBAAuB,aAAa;AAC3D,YAAM,WAAW,qBAAqB,cAAc;AACpD,YAAM,eAAe,uBAAuB,SAAS;AACrD,YAAM,SAAS,qBAAqB,YAAY;AAEhD,YAAM,iBAAiB,CAAC,CAAC,UAAU,CAAC,CAAC,YAAY,QAAQ,QAAQ,IAAI,UAAU,QAAQ;AACvF,YAAM,oBAAoB,iBAAiB,eAAe;AAC1D,YAAM,sBAAsB,iBAAiB,CAAC,uBAAuB;AACrE,YAAM,kBAAkB,iBAAiB,iBAAiB;AAC1D,YAAM,oBAAoB,iBAAiB,uBAAuB;AAKlE,UAAI,wBAAwB,CAAC;AAC7B,UAAI,oBAAqB,yBAAwB;AACjD,UAAI,kBAAmB,yBAAwB;AAE/C,aAAO;AA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IACA,CAAC,mBAAmB,kBAAkB,MAAM;AAAA,EAC9C;AACF,QAAM,qBAAkG;AAAA,IACtG,CAAC,QAAQ,aAAa;AACpB,YAAM,mBAAmB,kBAAkB,UAAU,MAAM;AAC3D,qBAAe,QAAQ,EAAE,GAAG,UAAU,qBAAqB,MAAM,iBAAiB,CAAC;AAAA,IACrF;AAAA,IACA,CAAC,UAAU,mBAAmB,cAAc;AAAA,EAC9C;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;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,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,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\n\nexport const useValidateProps = (props: DSControlledDateRangePickerT.Props): void => {};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACIhB,MAAM,mBAAmB,CAAC,UAAoD;AAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -3,12 +3,26 @@ import { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } fr
|
|
|
3
3
|
import { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from "./exported-related/theming.js";
|
|
4
4
|
import { ControlledDateRangePickerDatatestid } from "./ControlledDateRangePickerDatatestid.js";
|
|
5
5
|
import { CONTROLLED_DATE_RANGE_PICKER_TYPES } from "./ControlledDateRangePickerTypes.js";
|
|
6
|
+
import {
|
|
7
|
+
getDateStringFromDay,
|
|
8
|
+
getDateValuesFromDate,
|
|
9
|
+
getDayFromDateString,
|
|
10
|
+
getValidationDateStringMetaInfo,
|
|
11
|
+
getValidationDateTimeStringMetaInfo,
|
|
12
|
+
getValidationTimeStringMetaInfo
|
|
13
|
+
} from "@elliemae/ds-form-date-time-picker";
|
|
6
14
|
export {
|
|
7
15
|
CONTROLLED_DATE_RANGE_PICKER_TYPES,
|
|
8
16
|
ControlledDateRangePickerDatatestid,
|
|
9
17
|
DSControlledDateRangePicker,
|
|
10
18
|
DSControlledDateRangePickerName,
|
|
11
19
|
DSControlledDateRangePickerSlots,
|
|
12
|
-
DSControlledDateRangePickerWithSchema
|
|
20
|
+
DSControlledDateRangePickerWithSchema,
|
|
21
|
+
getDateStringFromDay,
|
|
22
|
+
getDateValuesFromDate,
|
|
23
|
+
getDayFromDateString,
|
|
24
|
+
getValidationDateStringMetaInfo,
|
|
25
|
+
getValidationDateTimeStringMetaInfo,
|
|
26
|
+
getValidationTimeStringMetaInfo
|
|
13
27
|
};
|
|
14
28
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } from './ControlledDateRangePicker.js';\nexport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from './exported-related/theming.js';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid.js';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes.js';\nexport { type DSControlledDateRangePickerT } from './
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uCAAuC,mCAAmC;AACnF,SAAS,iCAAiC,wCAAwC;AAClF,SAAS,2CAA2C;AACpD,SAAS,0CAA0C;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } from './ControlledDateRangePicker.js';\nexport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from './exported-related/theming.js';\nexport { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid.js';\nexport { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes.js';\nexport {\n getDateStringFromDay,\n getDateValuesFromDate,\n getDayFromDateString,\n getValidationDateStringMetaInfo,\n getValidationDateTimeStringMetaInfo,\n getValidationTimeStringMetaInfo,\n} from '@elliemae/ds-form-date-time-picker';\nexport { type DSControlledDateRangePickerT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uCAAuC,mCAAmC;AACnF,SAAS,iCAAiC,wCAAwC;AAClF,SAAS,2CAA2C;AACpD,SAAS,0CAA0C;AACnD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledDateRangeContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX.js';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate.js';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate.js';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar.js';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid.js';\nimport { gridMap } from '../utils/utils.js';\nimport type { DSControlledDateRangePickerT } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { ControlledDateRangePickerContext } from '../ControlledDateRangePickerCTX.js';\nimport { ControlledDateRangeFromDate } from './ControlledDateRangeFromDate.js';\nimport { ControlledDateRangeToDate } from './ControlledDateRangeToDate.js';\nimport { ControlledDateRangeCalendar } from './ControlledDateRangeCalendar.js';\nimport { ControlledDateRangePickerDatatestid } from '../ControlledDateRangePickerDatatestid.js';\nimport { gridMap } from '../utils/utils.js';\nimport type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';\nimport { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from '../exported-related/theming.js';\n\ninterface StyledWrapperT {\n isControllerOnly: boolean;\n isPickerOnly: boolean;\n type: DSControlledDateRangePickerT.ControlledDateRangeType;\n}\n\nconst StyledWrapper = styled('div', {\n name: DSControlledDateRangePickerName,\n slot: DSControlledDateRangePickerSlots.CONTAINER,\n})<StyledWrapperT>`\n display: grid;\n grid-template-columns: ${({ type }) => gridMap[type]};\n grid-template-rows: auto;\n ${({ isControllerOnly, isPickerOnly }) => (isControllerOnly || isPickerOnly ? '' : 'gap: 0px 8px;')}\n grid-auto-flow: row;\n grid-template-areas: '. .';\n justify-content: center;\n align-items: center;\n ${xStyledCommonProps}\n`;\n\nexport const ControlledDateRangeContent = (): JSX.Element => {\n const {\n props: { type },\n withIcon,\n withInputs,\n isControllerOnly,\n isPickerOnly,\n xstyledAttrs,\n globalAttrs,\n } = useContext(ControlledDateRangePickerContext);\n\n return (\n <StyledWrapper\n isControllerOnly={isControllerOnly}\n isPickerOnly={isPickerOnly}\n data-testid={ControlledDateRangePickerDatatestid.WRAPPER}\n type={type}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {withInputs ? (\n <>\n <ControlledDateRangeFromDate />\n <ControlledDateRangeToDate />\n </>\n ) : null}\n {withIcon || isControllerOnly ? <ControlledDateRangeCalendar /> : null}\n </StyledWrapper>\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqDf,mBACE,KADF;AArDR,SAAgB,kBAAkB;AAClC,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,wCAAwC;AACjD,SAAS,mCAAmC;AAC5C,SAAS,iCAAiC;AAC1C,SAAS,mCAAmC;AAC5C,SAAS,2CAA2C;AACpD,SAAS,eAAe;AAExB,SAAS,iCAAiC,wCAAwC;AAQlF,MAAM,gBAAgB,OAAO,OAAO;AAAA,EAClC,MAAM;AAAA,EACN,MAAM,iCAAiC;AACzC,CAAC;AAAA;AAAA,2BAE0B,CAAC,EAAE,KAAK,MAAM,QAAQ,IAAI,CAAC;AAAA;AAAA,IAElD,CAAC,EAAE,kBAAkB,aAAa,MAAO,oBAAoB,eAAe,KAAK,eAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjG,kBAAkB;AAAA;AAGf,MAAM,6BAA6B,MAAmB;AAC3D,QAAM;AAAA,IACJ,OAAO,EAAE,KAAK;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,gCAAgC;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAa,oCAAoC;AAAA,MACjD;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,qBACC,iCACE;AAAA,8BAAC,+BAA4B;AAAA,UAC7B,oBAAC,6BAA0B;AAAA,WAC7B,IACE;AAAA,QACH,YAAY,mBAAmB,oBAAC,+BAA4B,IAAK;AAAA;AAAA;AAAA,EACpE;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ const defaultProps = {
|
|
|
22
22
|
isClearable: false,
|
|
23
23
|
autoFocus: false
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const DSControlledDateRangePickerPropTypes = {
|
|
26
26
|
...globalAttributesPropTypes,
|
|
27
27
|
...xstyledPropTypes,
|
|
28
28
|
type: PropTypes.oneOf([
|
|
@@ -63,8 +63,10 @@ const propTypes = {
|
|
|
63
63
|
'"from" month input html node reference'
|
|
64
64
|
)
|
|
65
65
|
};
|
|
66
|
+
const DSControlledDateRangePickerPropTypesWithSchema = DSControlledDateRangePickerPropTypes;
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
DSControlledDateRangePickerPropTypes,
|
|
69
|
+
DSControlledDateRangePickerPropTypesWithSchema,
|
|
70
|
+
defaultProps
|
|
69
71
|
};
|
|
70
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap, GlobalAttributesT, DSPropTypesSchema, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { type DSControlledDateTimePickerT } from '@elliemae/ds-form-date-time-picker';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\nconst defaultReturnFalse = (): boolean => false;\n\nexport declare namespace DSControlledDateRangePickerT {\n export interface RangePickerMetaInfoT extends DSControlledDateTimePickerT.InternalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n }\n\n export type RangeOnDateChange = (val: string, metaInfo: RangePickerMetaInfoT) => void;\n\n export type AppOnInputChange = DSControlledDateTimePickerT.AppOnInputChange;\n\n export type ControlledDateRangeType =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n type: ControlledDateRangeType;\n fromDate: string;\n onFromDateChange: RangeOnDateChange;\n onMonthFromChange: AppOnInputChange;\n onDayFromChange: AppOnInputChange;\n onYearFromChange: AppOnInputChange;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: RangeOnDateChange;\n onMonthToChange: AppOnInputChange;\n onDayToChange: AppOnInputChange;\n onYearToChange: AppOnInputChange;\n\n isClearable: boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsOutOfRangeDay: (day: string) => boolean;\n autoFocus: boolean;\n }\n\n export interface OptionalProps {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n OptionalProps,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n OptionalProps,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSControlledDateRangePickerT.DefaultProps = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\n\nexport const DSControlledDateRangePickerPropTypes: DSPropTypesSchema<DSControlledDateRangePickerT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ])\n .description('Type of date range form control to use')\n .defaultValue('full-date-range'),\n fromDate: PropTypes.string.description(`strictly formatted string representing user's selected \"from\" date`)\n .isRequired,\n onFromDateChange: PropTypes.func\n .description('function to react to \"from\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthFromChange: PropTypes.func\n .description('function to react to \"from\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayFromChange: PropTypes.func\n .description('function to react to \"from\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearFromChange: PropTypes.func\n .description('function to react to \"from\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n toDate: PropTypes.string.description(`strictly formatted string representing user's selected \"to\" date`).isRequired,\n onToDateChange: PropTypes.func\n .description('function to react to \"to\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthToChange: PropTypes.func\n .description('function to react to \"to\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayToChange: PropTypes.func\n .description('function to react to \"to\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearToChange: PropTypes.func\n .description('function to react to \"to\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n getIsDisabledDay: PropTypes.func\n .description('function used to mark day as \"disable\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n getIsOutOfRangeDay: PropTypes.func\n .description('function used to mark day as \"out of range\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n pickerFooterMsg: PropTypes.string.description(''),\n hasError: PropTypes.bool\n .description('boolean indicating wheter the selected range is to be marked as wrong')\n .defaultValue(false),\n isClearable: PropTypes.bool\n .description('boolean to optionally activate \"clearable\" icons in the inputs')\n .defaultValue(false),\n autoFocus: PropTypes.bool\n .description('boolean to auto-focus the \"from\" date month on render as per html auto-focus propriety')\n .defaultValue(false),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'strictly formatted string representing the starting month to be displayed when calendar context menu is invoked without any selected dates',\n ),\n onCalendarOpenFocusedDay: PropTypes.string.description(\n 'strictly formatted string representing the day to be focused when calendar context menu is invoked without any selected dates',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n '\"from\" month input html node reference',\n ),\n};\n\nexport const DSControlledDateRangePickerPropTypesWithSchema =\n DSControlledDateRangePickerPropTypes as unknown as ValidationMap<DSControlledDateRangePickerT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,2BAA2B,wBAAwB;AAMvE,MAAM,OAAO,MAAY;AAAC;AAE1B,MAAM,qBAAqB,MAAe;AAmEnC,MAAM,eAA0D;AAAA,EACrE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBA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AA,EACvG,gBAAgB,UAAU,KACvB,YAAY,yCAAyC,EACrD,aAAa,MAAM;AAAA,EAAC,CAAC,EACrB,UAAU,0FAA0F;AAAA,EACvG,kBAAkB,UAAU,KACzB,YAAY,wCAAwC,EACpD,aAAa,MAAM,KAAK,EACxB,UAAU,+BAA+B;AAAA,EAC5C,oBAAoB,UAAU,KAC3B,YAAY,6CAA6C,EACzD,aAAa,MAAM,KAAK,EACxB,UAAU,+BAA+B;AAAA,EAC5C,iBAAiB,UAAU,OAAO,YAAY,EAAE;AAAA,EAChD,UAAU,UAAU,KACjB,YAAY,uEAAuE,EACnF,aAAa,KAAK;AAAA,EACrB,aAAa,UAAU,KACpB,YAAY,gEAAgE,EAC5E,aAAa,KAAK;AAAA,EACrB,WAAW,UAAU,KAClB,YAAY,wFAAwF,EACpG,aAAa,KAAK;AAAA,EACrB,0BAA0B,UAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,UAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AACF;AAEO,MAAM,iDACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
4
|
+
import { DSControlledDateRangePicker } from "../index.js";
|
|
5
|
+
const ref = React2.createRef();
|
|
6
|
+
const noop = () => {
|
|
7
|
+
};
|
|
8
|
+
const defaultReturnFalse = () => false;
|
|
9
|
+
const testOptionalProps = {
|
|
10
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
11
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
12
|
+
tabIndex: 0,
|
|
13
|
+
innerRef: ref
|
|
14
|
+
};
|
|
15
|
+
const testPartialDefaults = {
|
|
16
|
+
type: "full-date-range",
|
|
17
|
+
fromDate: "",
|
|
18
|
+
onMonthFromChange: noop,
|
|
19
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
20
|
+
hasError: false,
|
|
21
|
+
isClearable: false
|
|
22
|
+
};
|
|
23
|
+
const testProps = {
|
|
24
|
+
...testOptionalProps,
|
|
25
|
+
...testPartialDefaults
|
|
26
|
+
};
|
|
27
|
+
const testPropsAsSyntax = {
|
|
28
|
+
...testOptionalProps,
|
|
29
|
+
...testPartialDefaults
|
|
30
|
+
};
|
|
31
|
+
const testCompleteDefaults = {
|
|
32
|
+
type: "full-date-range",
|
|
33
|
+
fromDate: "",
|
|
34
|
+
onFromDateChange: noop,
|
|
35
|
+
onMonthFromChange: noop,
|
|
36
|
+
onDayFromChange: noop,
|
|
37
|
+
onYearFromChange: noop,
|
|
38
|
+
pickerFooterMsg: "",
|
|
39
|
+
toDate: "",
|
|
40
|
+
onToDateChange: noop,
|
|
41
|
+
onMonthToChange: noop,
|
|
42
|
+
onDayToChange: noop,
|
|
43
|
+
onYearToChange: noop,
|
|
44
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
45
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
46
|
+
hasError: false,
|
|
47
|
+
isClearable: false,
|
|
48
|
+
autoFocus: false
|
|
49
|
+
};
|
|
50
|
+
const testInternalProps = {
|
|
51
|
+
...testOptionalProps,
|
|
52
|
+
...testCompleteDefaults
|
|
53
|
+
};
|
|
54
|
+
const testInternalPropsAsSyntax = {
|
|
55
|
+
...testOptionalProps,
|
|
56
|
+
...testCompleteDefaults
|
|
57
|
+
};
|
|
58
|
+
const testExplicitDefinition = {
|
|
59
|
+
type: "full-date-range",
|
|
60
|
+
fromDate: "",
|
|
61
|
+
onFromDateChange: noop,
|
|
62
|
+
onMonthFromChange: noop,
|
|
63
|
+
onDayFromChange: noop,
|
|
64
|
+
onYearFromChange: noop,
|
|
65
|
+
pickerFooterMsg: "",
|
|
66
|
+
toDate: "",
|
|
67
|
+
onToDateChange: noop,
|
|
68
|
+
onMonthToChange: noop,
|
|
69
|
+
onDayToChange: noop,
|
|
70
|
+
onYearToChange: noop,
|
|
71
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
72
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
73
|
+
hasError: false,
|
|
74
|
+
isClearable: false,
|
|
75
|
+
autoFocus: false,
|
|
76
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
77
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
78
|
+
tabIndex: 0,
|
|
79
|
+
innerRef: ref
|
|
80
|
+
};
|
|
81
|
+
const testInferedTypeCompatibility = {
|
|
82
|
+
type: "full-date-range",
|
|
83
|
+
fromDate: "",
|
|
84
|
+
onFromDateChange: noop,
|
|
85
|
+
onMonthFromChange: noop,
|
|
86
|
+
onDayFromChange: noop,
|
|
87
|
+
onYearFromChange: noop,
|
|
88
|
+
pickerFooterMsg: "",
|
|
89
|
+
toDate: "",
|
|
90
|
+
onToDateChange: noop,
|
|
91
|
+
onMonthToChange: noop,
|
|
92
|
+
onDayToChange: noop,
|
|
93
|
+
onYearToChange: noop,
|
|
94
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
95
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
96
|
+
hasError: false,
|
|
97
|
+
isClearable: false,
|
|
98
|
+
autoFocus: false,
|
|
99
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
100
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
101
|
+
tabIndex: 0,
|
|
102
|
+
innerRef: ref
|
|
103
|
+
};
|
|
104
|
+
const testDefinitionAsConst = {
|
|
105
|
+
type: "full-date-range",
|
|
106
|
+
fromDate: "",
|
|
107
|
+
onFromDateChange: noop,
|
|
108
|
+
onMonthFromChange: noop,
|
|
109
|
+
onDayFromChange: noop,
|
|
110
|
+
onYearFromChange: noop,
|
|
111
|
+
pickerFooterMsg: "",
|
|
112
|
+
toDate: "",
|
|
113
|
+
onToDateChange: noop,
|
|
114
|
+
onMonthToChange: noop,
|
|
115
|
+
onDayToChange: noop,
|
|
116
|
+
onYearToChange: noop,
|
|
117
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
118
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
119
|
+
hasError: false,
|
|
120
|
+
isClearable: false,
|
|
121
|
+
autoFocus: false,
|
|
122
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
123
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
124
|
+
tabIndex: 0,
|
|
125
|
+
innerRef: ref
|
|
126
|
+
};
|
|
127
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(DSControlledDateRangePicker, { ...testExplicitDefinition }),
|
|
129
|
+
/* @__PURE__ */ jsx(DSControlledDateRangePicker, { ...testInferedTypeCompatibility }),
|
|
130
|
+
/* @__PURE__ */ jsx(DSControlledDateRangePicker, { ...testDefinitionAsConst }),
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
DSControlledDateRangePicker,
|
|
133
|
+
{
|
|
134
|
+
type: "full-date-range",
|
|
135
|
+
fromDate: "",
|
|
136
|
+
onFromDateChange: noop,
|
|
137
|
+
onMonthFromChange: noop,
|
|
138
|
+
onDayFromChange: noop,
|
|
139
|
+
onYearFromChange: noop,
|
|
140
|
+
pickerFooterMsg: "",
|
|
141
|
+
toDate: "",
|
|
142
|
+
onToDateChange: noop,
|
|
143
|
+
onMonthToChange: noop,
|
|
144
|
+
onDayToChange: noop,
|
|
145
|
+
onYearToChange: noop,
|
|
146
|
+
getIsDisabledDay: defaultReturnFalse,
|
|
147
|
+
getIsOutOfRangeDay: defaultReturnFalse,
|
|
148
|
+
hasError: false,
|
|
149
|
+
isClearable: false,
|
|
150
|
+
autoFocus: false,
|
|
151
|
+
emptyPickerStartingMonth: "12/__/2000",
|
|
152
|
+
onCalendarOpenFocusedDay: "12/27/2000",
|
|
153
|
+
tabIndex: 0,
|
|
154
|
+
innerRef: ref
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] });
|
|
158
|
+
//# sourceMappingURL=typescript-date-range-picker-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-date-range-picker-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSControlledDateRangePicker } from '../index.js';\nimport type { DSControlledDateRangePickerT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSControlledDateRangePickerT.Props;\ntype ComponentPropsInternals = DSControlledDateRangePickerT.InternalProps;\ntype ComponentPropsDefaultProps = DSControlledDateRangePickerT.DefaultProps;\ntype ComponentPropsOptionalProps = DSControlledDateRangePickerT.OptionalProps;\n\nconst ref = React.createRef() as React.MutableRefObject<HTMLInputElement>;\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n type: 'full-date-range',\n fromDate: '',\n onMonthFromChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n\n hasError: false,\n isClearable: false,\n};\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n emptyPickerStartingMonth: '12/__/2000',\n onCalendarOpenFocusedDay: '12/27/2000',\n tabIndex: 0,\n innerRef: ref,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSControlledDateRangePicker {...testExplicitDefinition} />\n <DSControlledDateRangePicker {...testInferedTypeCompatibility} />\n <DSControlledDateRangePicker {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSControlledDateRangePicker\n type=\"full-date-range\"\n fromDate=\"\"\n onFromDateChange={noop}\n onMonthFromChange={noop}\n onDayFromChange={noop}\n onYearFromChange={noop}\n pickerFooterMsg=\"\"\n toDate=\"\"\n onToDateChange={noop}\n onMonthToChange={noop}\n onDayToChange={noop}\n onYearToChange={noop}\n getIsDisabledDay={defaultReturnFalse}\n getIsOutOfRangeDay={defaultReturnFalse}\n hasError={false}\n isClearable={false}\n autoFocus={false}\n emptyPickerStartingMonth=\"12/__/2000\"\n onCalendarOpenFocusedDay=\"12/27/2000\"\n tabIndex={0}\n innerRef={ref}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkJrB,mBAEE,KAFF;AAjJF,OAAOA,YAAW;AAClB,SAAS,mCAAmC;AAS5C,MAAM,MAAMA,OAAM,UAAU;AAC5B,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAE1C,MAAM,oBAAiD;AAAA,EACrD,0BAA0B;A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e;AAAA,MACf,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,oBAAoB;AAAA,MACpB,UAAU;AAAA,MACV,aAAa;AAAA,MACb,WAAW;AAAA,MACX,0BAAyB;AAAA,MACzB,0BAAyB;AAAA,MACzB,UAAU;AAAA,MACV,UAAU;AAAA;AAAA,EACZ;AAAA,GACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DSControlledDateRangePickerT } from './
|
|
1
|
+
import type { DSControlledDateRangePickerT } from './react-desc-prop-types.js';
|
|
2
2
|
declare const DSControlledDateRangePicker: {
|
|
3
3
|
(props: DSControlledDateRangePickerT.Props): JSX.Element;
|
|
4
4
|
displayName: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type DSControlledDateRangePickerT } from '../
|
|
1
|
+
import { type DSControlledDateRangePickerT } from '../react-desc-prop-types.js';
|
|
2
2
|
export declare const useGetDateRangePickerWithDefaultsProps: (props: DSControlledDateRangePickerT.Props) => DSControlledDateRangePickerT.InternalProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ControlledDateRangePickerContextT } from './useControlledDateRangePicker.js';
|
|
2
|
-
import type { DSControlledDateRangePickerT } from '../
|
|
2
|
+
import type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';
|
|
3
3
|
export declare const useRangePickerLogic: ({ fromDate, onFromDateChange, onMonthFromChange, onDayFromChange, onYearFromChange, toDate, onMonthToChange, onDayToChange, onYearToChange, onToDateChange, }: DSControlledDateRangePickerT.InternalProps) => ControlledDateRangePickerContextT['rangePickerLogic'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DSControlledDateRangePickerT } from '../
|
|
1
|
+
import type { DSControlledDateRangePickerT } from '../react-desc-prop-types.js';
|
|
2
2
|
export declare const useValidateProps: (props: DSControlledDateRangePickerT.Props) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { DSControlledDateRangePickerWithSchema, DSControlledDateRangePicker } fr
|
|
|
2
2
|
export { DSControlledDateRangePickerName, DSControlledDateRangePickerSlots } from './exported-related/theming.js';
|
|
3
3
|
export { ControlledDateRangePickerDatatestid } from './ControlledDateRangePickerDatatestid.js';
|
|
4
4
|
export { CONTROLLED_DATE_RANGE_PICKER_TYPES } from './ControlledDateRangePickerTypes.js';
|
|
5
|
-
export {
|
|
5
|
+
export { getDateStringFromDay, getDateValuesFromDate, getDayFromDateString, getValidationDateStringMetaInfo, getValidationDateTimeStringMetaInfo, getValidationTimeStringMetaInfo, } from '@elliemae/ds-form-date-time-picker';
|
|
6
|
+
export { type DSControlledDateRangePickerT } from './react-desc-prop-types.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ValidationMap, GlobalAttributesT, DSPropTypesSchema, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
2
3
|
import { type DSControlledDateTimePickerT } from '@elliemae/ds-form-date-time-picker';
|
|
3
4
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
4
5
|
export declare namespace DSControlledDateRangePickerT {
|
|
@@ -10,6 +11,8 @@ export declare namespace DSControlledDateRangePickerT {
|
|
|
10
11
|
type RangeOnDateChange = (val: string, metaInfo: RangePickerMetaInfoT) => void;
|
|
11
12
|
type AppOnInputChange = DSControlledDateTimePickerT.AppOnInputChange;
|
|
12
13
|
type ControlledDateRangeType = 'full-date-range' | 'date-range-picker-controller-only' | 'date-range-picker' | 'date-range-inputs';
|
|
14
|
+
interface RequiredProps {
|
|
15
|
+
}
|
|
13
16
|
interface DefaultProps {
|
|
14
17
|
type: ControlledDateRangeType;
|
|
15
18
|
fromDate: string;
|
|
@@ -35,10 +38,11 @@ export declare namespace DSControlledDateRangePickerT {
|
|
|
35
38
|
innerRef?: React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null> | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);
|
|
36
39
|
tabIndex?: TypescriptHelpersT.WCAGTabIndex;
|
|
37
40
|
}
|
|
38
|
-
interface Props extends Partial<DefaultProps>, OptionalProps {
|
|
41
|
+
interface Props extends Partial<DefaultProps>, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>, OptionalProps, XstyledProps, RequiredProps {
|
|
39
42
|
}
|
|
40
|
-
interface InternalProps extends DefaultProps, OptionalProps {
|
|
43
|
+
interface InternalProps extends DefaultProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>, OptionalProps, XstyledProps, RequiredProps {
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
export declare const defaultProps: DSControlledDateRangePickerT.DefaultProps;
|
|
44
|
-
export declare const
|
|
47
|
+
export declare const DSControlledDateRangePickerPropTypes: DSPropTypesSchema<DSControlledDateRangePickerT.Props>;
|
|
48
|
+
export declare const DSControlledDateRangePickerPropTypesWithSchema: ValidationMap<DSControlledDateRangePickerT.Props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-date-range-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.38.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Date Range Picker",
|
|
6
6
|
"files": [
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"styled-components": "~5.3.9",
|
|
40
40
|
"uid": "~2.0.1",
|
|
41
|
-
"@elliemae/ds-form-date-time-picker": "3.
|
|
42
|
-
"@elliemae/ds-props-helpers": "3.
|
|
43
|
-
"@elliemae/ds-system": "3.
|
|
44
|
-
"@elliemae/ds-typescript-helpers": "3.
|
|
41
|
+
"@elliemae/ds-form-date-time-picker": "3.38.0-rc.1",
|
|
42
|
+
"@elliemae/ds-props-helpers": "3.38.0-rc.1",
|
|
43
|
+
"@elliemae/ds-system": "3.38.0-rc.1",
|
|
44
|
+
"@elliemae/ds-typescript-helpers": "3.38.0-rc.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@elliemae/pui-cli": "9.0.0-next.50",
|
|
48
48
|
"@elliemae/pui-theme": "~2.9.3",
|
|
49
49
|
"styled-components": "~5.3.9",
|
|
50
50
|
"styled-system": "~5.1.5",
|
|
51
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
51
|
+
"@elliemae/ds-monorepo-devops": "3.38.0-rc.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@elliemae/pui-theme": "~2.9.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|
|
62
|
-
"typeSafety":
|
|
62
|
+
"typeSafety": true
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/propTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSControlledDateTimePickerT } from '@elliemae/ds-form-date-time-picker';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\nexport declare namespace DSControlledDateRangePickerT {\n export interface RangePickerMetaInfoT extends DSControlledDateTimePickerT.InternalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n }\n export type RangeOnDateChange = (val: string, metaInfo: RangePickerMetaInfoT) => void;\n export type AppOnInputChange = DSControlledDateTimePickerT.AppOnInputChange;\n export type ControlledDateRangeType =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n export interface DefaultProps {\n type: ControlledDateRangeType;\n fromDate: string;\n onFromDateChange: RangeOnDateChange;\n onMonthFromChange: AppOnInputChange;\n onDayFromChange: AppOnInputChange;\n onYearFromChange: AppOnInputChange;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: RangeOnDateChange;\n onMonthToChange: AppOnInputChange;\n onDayToChange: AppOnInputChange;\n onYearToChange: AppOnInputChange;\n\n isClearable: boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsOutOfRangeDay: (day: string) => boolean;\n autoFocus: boolean;\n }\n\n export interface OptionalProps {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps {}\n}\n\nexport const defaultProps: DSControlledDateRangePickerT.DefaultProps = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ])\n .description('Type of date range form control to use')\n .defaultValue('full-date-range'),\n fromDate: PropTypes.string.description(`strictly formatted string representing user's selected \"from\" date`)\n .isRequired,\n onFromDateChange: PropTypes.func\n .description('function to react to \"from\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthFromChange: PropTypes.func\n .description('function to react to \"from\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayFromChange: PropTypes.func\n .description('function to react to \"from\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearFromChange: PropTypes.func\n .description('function to react to \"from\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n toDate: PropTypes.string.description(`strictly formatted string representing user's selected \"to\" date`).isRequired,\n onToDateChange: PropTypes.func\n .description('function to react to \"to\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthToChange: PropTypes.func\n .description('function to react to \"to\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayToChange: PropTypes.func\n .description('function to react to \"to\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearToChange: PropTypes.func\n .description('function to react to \"to\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n getIsDisabledDay: PropTypes.func\n .description('function used to mark day as \"disable\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n getIsOutOfRangeDay: PropTypes.func\n .description('function used to mark day as \"out of range\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n pickerFooterMsg: PropTypes.string.description(''),\n hasError: PropTypes.bool\n .description('boolean indicating wheter the selected range is to be marked as wrong')\n .defaultValue(false),\n isClearable: PropTypes.bool\n .description('boolean to optionally activate \"clearable\" icons in the inputs')\n .defaultValue(false),\n autoFocus: PropTypes.bool\n .description('boolean to auto-focus the \"from\" date month on render as per html auto-focus propriety')\n .defaultValue(false),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'strictly formatted string representing the starting month to be displayed when calendar context menu is invoked without any selected dates',\n ),\n onCalendarOpenFocusedDay: PropTypes.string.description(\n 'strictly formatted string representing the day to be focused when calendar context menu is invoked without any selected dates',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n '\"from\" month input html node reference',\n ),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAuE;AAKvE,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAkDnC,MAAM,eAA0D;AAAA,EACrE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AACb;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,MAAM;AAAA,IACpB;AAAA,IAC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uEAAuE,EACnF,aAAa,KAAK;AAAA,EACrB,aAAa,kCAAU,KACpB,YAAY,gEAAgE,EAC5E,aAAa,KAAK;AAAA,EACrB,WAAW,kCAAU,KAClB,YAAY,wFAAwF,EACpG,aAAa,KAAK;AAAA,EACrB,0BAA0B,kCAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,0BAA0B,kCAAU,OAAO;AAAA,IACzC;AAAA,EACF;AAAA,EACA,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSControlledDateTimePickerT } from '@elliemae/ds-form-date-time-picker';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\nconst defaultReturnFalse = (): boolean => false;\nexport declare namespace DSControlledDateRangePickerT {\n export interface RangePickerMetaInfoT extends DSControlledDateTimePickerT.InternalInputsChangeMetaInfo {\n rangeDateChangeType?: 'from' | 'to';\n automaticSwitchedDates?: boolean;\n isIncorrectOrder?: boolean;\n }\n export type RangeOnDateChange = (val: string, metaInfo: RangePickerMetaInfoT) => void;\n export type AppOnInputChange = DSControlledDateTimePickerT.AppOnInputChange;\n export type ControlledDateRangeType =\n | 'full-date-range'\n | 'date-range-picker-controller-only'\n | 'date-range-picker'\n | 'date-range-inputs';\n export interface DefaultProps {\n type: ControlledDateRangeType;\n fromDate: string;\n onFromDateChange: RangeOnDateChange;\n onMonthFromChange: AppOnInputChange;\n onDayFromChange: AppOnInputChange;\n onYearFromChange: AppOnInputChange;\n hasError: boolean;\n pickerFooterMsg: string;\n\n toDate: string;\n onToDateChange: RangeOnDateChange;\n onMonthToChange: AppOnInputChange;\n onDayToChange: AppOnInputChange;\n onYearToChange: AppOnInputChange;\n\n isClearable: boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsOutOfRangeDay: (day: string) => boolean;\n autoFocus: boolean;\n }\n\n export interface OptionalProps {\n emptyPickerStartingMonth?: string;\n onCalendarOpenFocusedDay?: string;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n tabIndex?: TypescriptHelpersT.WCAGTabIndex;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps {}\n}\n\nexport const defaultProps: DSControlledDateRangePickerT.DefaultProps = {\n type: 'full-date-range',\n fromDate: '',\n onFromDateChange: noop,\n onMonthFromChange: noop,\n onDayFromChange: noop,\n onYearFromChange: noop,\n pickerFooterMsg: '',\n toDate: '',\n onToDateChange: noop,\n onMonthToChange: noop,\n onDayToChange: noop,\n onYearToChange: noop,\n getIsDisabledDay: defaultReturnFalse,\n getIsOutOfRangeDay: defaultReturnFalse,\n hasError: false,\n isClearable: false,\n autoFocus: false,\n};\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n type: PropTypes.oneOf([\n 'full-date-range',\n 'date-range-picker-controller-only',\n 'date-range-picker',\n 'date-range-inputs',\n ])\n .description('Type of date range form control to use')\n .defaultValue('full-date-range'),\n fromDate: PropTypes.string.description(`strictly formatted string representing user's selected \"from\" date`)\n .isRequired,\n onFromDateChange: PropTypes.func\n .description('function to react to \"from\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthFromChange: PropTypes.func\n .description('function to react to \"from\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayFromChange: PropTypes.func\n .description('function to react to \"from\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearFromChange: PropTypes.func\n .description('function to react to \"from\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n toDate: PropTypes.string.description(`strictly formatted string representing user's selected \"to\" date`).isRequired,\n onToDateChange: PropTypes.func\n .description('function to react to \"to\" date changing')\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )').isRequired,\n onMonthToChange: PropTypes.func\n .description('function to react to \"to\" month changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onDayToChange: PropTypes.func\n .description('function to react to \"to\" day changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n onYearToChange: PropTypes.func\n .description('function to react to \"to\" year changing')\n .defaultValue(() => {})\n .signature('(( newVal: string, e: React.SyntheticEvent, metaInfo: Record<string,unknown> ) => void )'),\n getIsDisabledDay: PropTypes.func\n .description('function used to mark day as \"disable\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n getIsOutOfRangeDay: PropTypes.func\n .description('function used to mark day as \"out of range\"')\n .defaultValue(() => false)\n .signature('(( day: string ) => boolean )'),\n pickerFooterMsg: PropTypes.string.description(''),\n hasError: PropTypes.bool\n .description('boolean indicating wheter the selected range is to be marked as wrong')\n .defaultValue(false),\n isClearable: PropTypes.bool\n .description('boolean to optionally activate \"clearable\" icons in the inputs')\n .defaultValue(false),\n autoFocus: PropTypes.bool\n .description('boolean to auto-focus the \"from\" date month on render as per html auto-focus propriety')\n .defaultValue(false),\n emptyPickerStartingMonth: PropTypes.string.description(\n 'strictly formatted string representing the starting month to be displayed when calendar context menu is invoked without any selected dates',\n ),\n onCalendarOpenFocusedDay: PropTypes.string.description(\n 'strictly formatted string representing the day to be focused when calendar context menu is invoked without any selected dates',\n ),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n '\"from\" month input html node reference',\n ),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,2BAA2B,wBAAwB;AAKvE,MAAM,OAAO,MAAY;AAAC;AAC1B,MAAM,qBAAqB,MAAe;AAkDnC,MAAM,eAA0D;AAAA,EACrE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AACb;AAEO,MAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,wCAAwC,EACpD,aAAa,iBAAiB;AAAA,EACjC,UAAU,UAAU,OAAO,YAAY,oEAAoE,EACxG;AAAA,EACH,kBAAkB,UAAU,KACzB,YAAY,2CAA2C,EACvD,UAAU,0FAA0F,EAAE;AAAA,EACzG,mBAAmB,UAAU,KAC1B,YAAY,4CAA4C,EACxD,aAAa,MAAM;AAAA,EAAC,CAAC,EACrB,UAAU,0FAA0F;AAAA,EACvG,iBAAiB,UAAU,KACxB,YAAY,0CAA0C,EACtD,aAAa,MAAM;AAAA,EAAC,C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