@elliemae/ds-date-picker 3.16.0-rc.4 → 3.16.0-rc.6
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/DSDatePicker.js +10 -6
- package/dist/cjs/DSDatePicker.js.map +2 -2
- package/dist/cjs/components/DSDatePickerImpl.js +6 -2
- package/dist/cjs/components/DSDatePickerImpl.js.map +2 -2
- package/dist/cjs/components/DatePickerController/DatePickerController.js +16 -5
- package/dist/cjs/components/DatePickerController/DatePickerController.js.map +2 -2
- package/dist/cjs/components/DatePickerDay/DatePickerDay.js +4 -0
- package/dist/cjs/components/DatePickerDay/DatePickerDay.js.map +1 -1
- package/dist/cjs/components/DatePickerDropdown.js +5 -1
- package/dist/cjs/components/DatePickerDropdown.js.map +2 -2
- package/dist/cjs/components/DatePickerHeader/DatePickerHeader.js +4 -0
- package/dist/cjs/components/DatePickerHeader/DatePickerHeader.js.map +1 -1
- package/dist/cjs/components/DatePickerNavigation/DatePickerNavigation.js +4 -0
- package/dist/cjs/components/DatePickerNavigation/DatePickerNavigation.js.map +1 -1
- package/dist/cjs/components/DatePickerPicker/DatePickerPicker.js +4 -0
- package/dist/cjs/components/DatePickerPicker/DatePickerPicker.js.map +1 -1
- package/dist/cjs/components/DatePickerRange/DatePickerRange.js +7 -3
- package/dist/cjs/components/DatePickerRange/DatePickerRange.js.map +2 -2
- package/dist/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +4 -0
- package/dist/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js.map +1 -1
- package/dist/cjs/components/DatePickerRenderMonth/DatePickerRenderMonth.js +4 -0
- package/dist/cjs/components/DatePickerRenderMonth/DatePickerRenderMonth.js.map +1 -1
- package/dist/cjs/components/DatePickerSingleDate/DatePickerSingleDate.js +7 -3
- package/dist/cjs/components/DatePickerSingleDate/DatePickerSingleDate.js.map +2 -2
- package/dist/cjs/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js +6 -2
- package/dist/cjs/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js.map +2 -2
- package/dist/cjs/components/index.js +14 -10
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/defaultPhrases.js +4 -0
- package/dist/cjs/defaultPhrases.js.map +1 -1
- package/dist/cjs/index.js +7 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/esm/DSDatePicker.js +6 -6
- package/dist/esm/DSDatePicker.js.map +1 -1
- package/dist/esm/components/DSDatePickerImpl.js +2 -2
- package/dist/esm/components/DSDatePickerImpl.js.map +1 -1
- package/dist/esm/components/DatePickerController/DatePickerController.js +12 -5
- package/dist/esm/components/DatePickerController/DatePickerController.js.map +2 -2
- package/dist/esm/components/DatePickerDropdown.js +1 -1
- package/dist/esm/components/DatePickerDropdown.js.map +1 -1
- package/dist/esm/components/DatePickerPicker/DatePickerPicker.js.map +1 -1
- package/dist/esm/components/DatePickerRange/DatePickerRange.js +3 -3
- package/dist/esm/components/DatePickerRange/DatePickerRange.js.map +1 -1
- package/dist/esm/components/DatePickerSingleDate/DatePickerSingleDate.js +3 -3
- package/dist/esm/components/DatePickerSingleDate/DatePickerSingleDate.js.map +2 -2
- package/dist/esm/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js +2 -2
- package/dist/esm/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js.map +1 -1
- package/dist/esm/components/index.js +10 -10
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/package.json +16 -16
- package/dist/types/components/DSDatePickerImpl.d.ts +0 -21
- package/dist/types/components/DatePickerController/DatePickerController.d.ts +0 -80
- package/dist/types/components/DatePickerDay/DatePickerDay.d.ts +0 -13
- package/dist/types/components/DatePickerDropdown.d.ts +0 -27
- package/dist/types/components/DatePickerHeader/DatePickerHeader.d.ts +0 -15
- package/dist/types/components/DatePickerNavigation/DatePickerNavigation.d.ts +0 -19
- package/dist/types/components/DatePickerPicker/DatePickerPicker.d.ts +0 -43
- package/dist/types/components/DatePickerRange/DatePickerRange.d.ts +0 -9
- package/dist/types/components/DatePickerRangeHeader/DatePickerRangeHeader.d.ts +0 -23
- package/dist/types/components/DatePickerRangeHeader/tests/DatePickerRangeHeader.test.d.ts +0 -1
- package/dist/types/components/DatePickerRenderMonth/DatePickerRenderMonth.d.ts +0 -4
- package/dist/types/components/DatePickerSingleDate/DatePickerSingleDate.d.ts +0 -11
- package/dist/types/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.d.ts +0 -16
- package/dist/types/components/index.d.ts +0 -10
- package/dist/types/components/tests/DatePickerHeader.test.d.ts +0 -1
- package/dist/types/components/tests/DatePickerRange.test.d.ts +0 -1
- package/dist/types/components/tests/DatePickerRangeHeader.test.d.ts +0 -1
- package/dist/types/components/tests/DatePickerSelectedDate.test.d.ts +0 -1
- package/dist/types/components/tests/DatePickerSingleDate.test.d.ts +0 -1
- package/dist/types/components/tests/SingleRangeDateSwitcher.test.d.ts +0 -1
- package/dist/types/defaultPhrases.d.ts +0 -225
- package/dist/types/index.d.ts +0 -3
package/dist/cjs/DSDatePicker.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -45,14 +49,14 @@ var React = __toESM(require("react"));
|
|
|
45
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
50
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
47
51
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
48
|
-
var import_initialize = require("react-dates/initialize");
|
|
52
|
+
var import_initialize = require("react-dates/initialize.js");
|
|
49
53
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
50
54
|
var import_moment = __toESM(require("moment"));
|
|
51
|
-
var import_defaultPhrases = require("./defaultPhrases");
|
|
52
|
-
var import_components = require("./components");
|
|
53
|
-
var import_DSDatePickerImpl = require("./components/DSDatePickerImpl");
|
|
54
|
-
var import_DatePickerController = require("./components/DatePickerController/DatePickerController");
|
|
55
|
-
var import_DatePickerPicker = require("./components/DatePickerPicker/DatePickerPicker");
|
|
55
|
+
var import_defaultPhrases = require("./defaultPhrases.js");
|
|
56
|
+
var import_components = require("./components/index.js");
|
|
57
|
+
var import_DSDatePickerImpl = require("./components/DSDatePickerImpl.js");
|
|
58
|
+
var import_DatePickerController = require("./components/DatePickerController/DatePickerController.js");
|
|
59
|
+
var import_DatePickerPicker = require("./components/DatePickerPicker/DatePickerPicker.js");
|
|
56
60
|
const DSDatePicker = ({
|
|
57
61
|
containerProps = {},
|
|
58
62
|
id = "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDatePicker.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport 'react-dates/initialize';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport moment from 'moment';\nimport { SingleDatePickerPhrases } from './defaultPhrases';\nimport {\n DatePickerNavigation,\n DatePickerDay,\n DatePickerPicker,\n DatePickerDropdown,\n DatePickerSingleDate,\n DatePickerHeader,\n DatePickerRange,\n DatePickerRangeHeader,\n SingleRangeDateSwitcher,\n renderMonthElement,\n} from './components';\nimport { DSDatePickerImpl } from './components/DSDatePickerImpl';\nimport { DSDatePickerController } from './components/DatePickerController/DatePickerController';\nimport { PickerPropsTypes, Picker } from './components/DatePickerPicker/DatePickerPicker';\n\ninterface DSDatePickerPropsType {\n containerProps: {};\n id: string;\n appendToBody: boolean;\n className: string;\n date: any;\n value: any;\n placeholder: string;\n disabled: boolean;\n required: boolean;\n readOnly: boolean;\n hasError: boolean;\n screenReaderInputMessage: boolean;\n enableOutsideDays: boolean;\n initialVisibleMonth: moment.Moment;\n firstDayOfWeek: number;\n keepOpenOnDateSelect: boolean;\n hideKeyboardShortcutsPanel: boolean;\n onChange: () => void;\n onDateChange: undefined | (() => void);\n onPrevMonthClick: () => void;\n onNextMonthClick: () => void;\n onClose: () => void;\n onFocus: () => void;\n onBlur: () => void;\n phrases: SingleDatePickerPhrases;\n displayFormat: boolean;\n displayFormatDay: boolean;\n transitionDuration: number;\n verticalSpacing: number;\n isDayBlocked: () => boolean;\n isOutsideRange: () => boolean;\n isDayHighlighted: () => boolean;\n numberOfMonths: number;\n openDirection: boolean;\n tabIndex: boolean;\n zIndex: boolean;\n pickerProps: {};\n calendarProps: {};\n autoClear: boolean;\n focusCurrentDate: boolean;\n}\ntype DSDatePickerType = React.ComponentType<DSDatePickerPropsType>;\n\nconst DSDatePicker: DSDatePickerType = ({\n containerProps = {},\n id = '',\n appendToBody = true,\n className = '',\n date,\n value,\n placeholder = '',\n disabled = false,\n required = false,\n readOnly = false,\n hasError = false,\n screenReaderInputMessage = 'Select date',\n enableOutsideDays = true,\n initialVisibleMonth = moment(),\n firstDayOfWeek = 0,\n keepOpenOnDateSelect = false,\n hideKeyboardShortcutsPanel = true,\n onChange = () => null,\n onDateChange = undefined,\n onPrevMonthClick = () => null,\n onNextMonthClick = () => null,\n onClose = () => null,\n onFocus = () => null,\n onBlur = () => null,\n phrases = SingleDatePickerPhrases,\n displayFormat = 'L',\n displayFormatDay = 'D',\n transitionDuration = 0,\n verticalSpacing = 0,\n isDayBlocked = () => false,\n isOutsideRange = () => false,\n isDayHighlighted = () => false,\n numberOfMonths = 1,\n openDirection = 'down',\n tabIndex = '',\n zIndex = 1,\n pickerProps = {},\n calendarProps = {},\n autoClear = false,\n focusCurrentDate = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-picker', version: '3.x Date: 2023 Q1' });\n\n const { cssClassName } = convertPropToCssClassName('datepicker', className, {\n hasError,\n readOnly,\n disabled,\n id,\n });\n const safeDate = date || value;\n return (\n <div className={cssClassName} {...containerProps} style={{ minWidth: '140px' }}>\n <DSDatePickerImpl\n appendToBody={appendToBody}\n autoClear={autoClear}\n date={safeDate}\n disabled={disabled}\n displayFormat={displayFormat}\n displayFormatDay={displayFormatDay}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n initialVisibleMonth={() => (initialVisibleMonth ? moment(initialVisibleMonth) : moment(safeDate))}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange === true || isOutsideRange === false ? () => isOutsideRange : isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n numberOfMonths={numberOfMonths}\n onBlur={onBlur}\n onClose={onClose}\n onChange={onChange}\n onDateChange={(...args) => {\n if (onDateChange) onDateChange(...args);\n }}\n onFocus={onFocus}\n onNextMonthClick={onNextMonthClick}\n onPrevMonthClick={onPrevMonthClick}\n openDirection={openDirection}\n phrases={phrases}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n screenReaderInputMessage={screenReaderInputMessage}\n transitionDuration={transitionDuration}\n value={safeDate}\n verticalSpacing={verticalSpacing}\n tabIndex={tabIndex}\n zIndex={zIndex}\n pickerProps={pickerProps}\n calendarProps={calendarProps}\n focusCurrentDate={focusCurrentDate}\n />\n </div>\n );\n};\n\nconst datePickerProps = {\n containerProps: PropTypes.shape({}).description('Set of Properties attached to the main container'),\n id: PropTypes.string.description('components id'),\n appendToBody: PropTypes.bool.description('append component to body or not').defaultValue(true),\n className: PropTypes.string.description('html class attribute'),\n date: PropTypes.instanceOf(Date, moment).description('selected date').defaultValue(undefined),\n value: PropTypes.instanceOf(Date, moment).description('value'),\n placeholder: PropTypes.string.description('input placeholder value'),\n autoClear: PropTypes.bool\n .description('autoclears the input onblur if the date is not completely set')\n .defaultValue(false),\n disabled: PropTypes.bool.description('disable component or not').defaultValue(false),\n required: PropTypes.bool.description('value is required or not').defaultValue(false),\n readOnly: PropTypes.bool.description('is read only or not').defaultValue(false),\n hasError: PropTypes.bool.description('set error state').defaultValue(false),\n screenReaderInputMessage: PropTypes.string\n .description('message to anounce by screen reader')\n .defaultValue('select date'),\n enableOutsideDays: PropTypes.bool.description('enable days oustide month or not').defaultValue(true),\n initialVisibleMonth: PropTypes.instanceOf(Date, moment).description('initial month to display'),\n firstDayOfWeek: PropTypes.number.description('first day of week').defaultValue(0),\n keepOpenOnDateSelect: PropTypes.bool.description('keep picker open when a date is selected').defaultValue(false),\n hideKeyboardShortcutsPanel: PropTypes.bool.description('hide keyabord shortcut panel or not').defaultValue(true),\n onChange: PropTypes.func.description(\n `\n function executed when input changes. This could trigger with invalid dates. It returns a string and a moment\n if the date is valid.\n `,\n ),\n onDateChange: PropTypes.func.description(\n 'function executed when date changes. This doesnt trigger with invalid dates. It returns a moment object',\n ),\n onPrevMonthClick: PropTypes.func.description('function executed when clicking on prev month button'),\n onNextMonthClick: PropTypes.func.description('function executed when clicking on next month button'),\n onBlur: PropTypes.func.description('function executed when component loses focus'),\n onClose: PropTypes.func.description('function executed when component closes'),\n onFocus: PropTypes.func.description('function executed when component gains focus'),\n phrases: PropTypes.shape({\n calendarLabel: PropTypes.string,\n closeDatePicker: PropTypes.string,\n clearDates: PropTypes.string,\n focusStartDate: PropTypes.string,\n jumpToPrevMonth: PropTypes.string,\n jumpToNextMonth: PropTypes.string,\n keyboardShortcuts: PropTypes.string,\n showKeyboardShortcutsPanel: PropTypes.string,\n hideKeyboardShortcutsPanel: PropTypes.string,\n openThisPanel: PropTypes.string,\n enterKey: PropTypes.string,\n leftArrowRightArrow: PropTypes.string,\n upArrowDownArrow: PropTypes.string,\n pageUpPageDown: PropTypes.string,\n homeEnd: PropTypes.string,\n escape: PropTypes.string,\n questionMark: PropTypes.string,\n selectFocusedDate: PropTypes.string,\n moveFocusByOneDay: PropTypes.string,\n moveFocusByOneWeek: PropTypes.string,\n moveFocusByOneMonth: PropTypes.string,\n moveFocustoStartAndEndOfWeek: PropTypes.string,\n returnFocusToInput: PropTypes.string,\n keyboardNavigationInstructions: PropTypes.string,\n chooseAvailableStartDate: PropTypes.func,\n chooseAvailableEndDate: PropTypes.func,\n dateIsUnavailable: PropTypes.func,\n dateIsSelected: PropTypes.func,\n })\n .description('react-dates phrases')\n .defaultValue(SingleDatePickerPhrases),\n displayFormat: PropTypes.string.description('display format').defaultValue('L'),\n displayFormatDay: PropTypes.string.description('display format day').defaultValue('D'),\n transitionDuration: PropTypes.number.description('transition duration').defaultValue(0),\n verticalSpacing: PropTypes.number.description('vertical spacing'),\n isDayBlocked: PropTypes.func.description('function that returns each day and disables desired dates'),\n isOutsideRange: PropTypes.func.description('function that returns each day and disables outisde range dates'),\n isDayHighlighted: PropTypes.func.description('function that returns each day and higlights desired dates'),\n numberOfMonths: PropTypes.number.description('amount of months'),\n openDirection: PropTypes.string.description('open direction of the popup').defaultValue('down'),\n tabIndex: PropTypes.number.description('overrides tab index of the element'),\n zIndex: PropTypes.string.description('overrides z-index of the element'),\n pickerProps: PropTypes.shape(PickerPropsTypes).description('props to be passed to the picker container'),\n calendarProps: PropTypes.shape({ tabIndex: PropTypes.number }).description(\n 'props to be passes to the calendar container',\n ),\n focusCurrentDate: PropTypes.bool.description('Wheter to focus current date on calendar').defaultValue(false),\n};\n\nDSDatePicker.propTypes = datePickerProps;\nDSDatePicker.displayName = 'DSDatePicker';\nconst DatePickerWithSchema = describe(DSDatePicker);\nDatePickerWithSchema.propTypes = datePickerProps;\n\nexport {\n DatePickerNavigation,\n DatePickerDay,\n DatePickerPicker,\n DSDatePickerController,\n DatePickerDropdown,\n DatePickerSingleDate,\n DatePickerHeader,\n DatePickerRange,\n DatePickerRangeHeader,\n SingleRangeDateSwitcher,\n Picker,\n renderMonthElement,\n DatePickerWithSchema,\n};\n\nexport { DSDatePicker };\nexport default DSDatePicker;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport 'react-dates/initialize.js';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport moment from 'moment';\nimport { SingleDatePickerPhrases } from './defaultPhrases.js';\nimport {\n DatePickerNavigation,\n DatePickerDay,\n DatePickerPicker,\n DatePickerDropdown,\n DatePickerSingleDate,\n DatePickerHeader,\n DatePickerRange,\n DatePickerRangeHeader,\n SingleRangeDateSwitcher,\n renderMonthElement,\n} from './components/index.js';\nimport { DSDatePickerImpl } from './components/DSDatePickerImpl.js';\nimport { DSDatePickerController } from './components/DatePickerController/DatePickerController.js';\nimport { PickerPropsTypes, Picker } from './components/DatePickerPicker/DatePickerPicker.js';\n\ninterface DSDatePickerPropsType {\n containerProps: {};\n id: string;\n appendToBody: boolean;\n className: string;\n date: any;\n value: any;\n placeholder: string;\n disabled: boolean;\n required: boolean;\n readOnly: boolean;\n hasError: boolean;\n screenReaderInputMessage: boolean;\n enableOutsideDays: boolean;\n initialVisibleMonth: moment.Moment;\n firstDayOfWeek: number;\n keepOpenOnDateSelect: boolean;\n hideKeyboardShortcutsPanel: boolean;\n onChange: () => void;\n onDateChange: undefined | (() => void);\n onPrevMonthClick: () => void;\n onNextMonthClick: () => void;\n onClose: () => void;\n onFocus: () => void;\n onBlur: () => void;\n phrases: SingleDatePickerPhrases;\n displayFormat: boolean;\n displayFormatDay: boolean;\n transitionDuration: number;\n verticalSpacing: number;\n isDayBlocked: () => boolean;\n isOutsideRange: () => boolean;\n isDayHighlighted: () => boolean;\n numberOfMonths: number;\n openDirection: boolean;\n tabIndex: boolean;\n zIndex: boolean;\n pickerProps: {};\n calendarProps: {};\n autoClear: boolean;\n focusCurrentDate: boolean;\n}\ntype DSDatePickerType = React.ComponentType<DSDatePickerPropsType>;\n\nconst DSDatePicker: DSDatePickerType = ({\n containerProps = {},\n id = '',\n appendToBody = true,\n className = '',\n date,\n value,\n placeholder = '',\n disabled = false,\n required = false,\n readOnly = false,\n hasError = false,\n screenReaderInputMessage = 'Select date',\n enableOutsideDays = true,\n initialVisibleMonth = moment(),\n firstDayOfWeek = 0,\n keepOpenOnDateSelect = false,\n hideKeyboardShortcutsPanel = true,\n onChange = () => null,\n onDateChange = undefined,\n onPrevMonthClick = () => null,\n onNextMonthClick = () => null,\n onClose = () => null,\n onFocus = () => null,\n onBlur = () => null,\n phrases = SingleDatePickerPhrases,\n displayFormat = 'L',\n displayFormatDay = 'D',\n transitionDuration = 0,\n verticalSpacing = 0,\n isDayBlocked = () => false,\n isOutsideRange = () => false,\n isDayHighlighted = () => false,\n numberOfMonths = 1,\n openDirection = 'down',\n tabIndex = '',\n zIndex = 1,\n pickerProps = {},\n calendarProps = {},\n autoClear = false,\n focusCurrentDate = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-picker', version: '3.x Date: 2023 Q1' });\n\n const { cssClassName } = convertPropToCssClassName('datepicker', className, {\n hasError,\n readOnly,\n disabled,\n id,\n });\n const safeDate = date || value;\n return (\n <div className={cssClassName} {...containerProps} style={{ minWidth: '140px' }}>\n <DSDatePickerImpl\n appendToBody={appendToBody}\n autoClear={autoClear}\n date={safeDate}\n disabled={disabled}\n displayFormat={displayFormat}\n displayFormatDay={displayFormatDay}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n initialVisibleMonth={() => (initialVisibleMonth ? moment(initialVisibleMonth) : moment(safeDate))}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange === true || isOutsideRange === false ? () => isOutsideRange : isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n numberOfMonths={numberOfMonths}\n onBlur={onBlur}\n onClose={onClose}\n onChange={onChange}\n onDateChange={(...args) => {\n if (onDateChange) onDateChange(...args);\n }}\n onFocus={onFocus}\n onNextMonthClick={onNextMonthClick}\n onPrevMonthClick={onPrevMonthClick}\n openDirection={openDirection}\n phrases={phrases}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n screenReaderInputMessage={screenReaderInputMessage}\n transitionDuration={transitionDuration}\n value={safeDate}\n verticalSpacing={verticalSpacing}\n tabIndex={tabIndex}\n zIndex={zIndex}\n pickerProps={pickerProps}\n calendarProps={calendarProps}\n focusCurrentDate={focusCurrentDate}\n />\n </div>\n );\n};\n\nconst datePickerProps = {\n containerProps: PropTypes.shape({}).description('Set of Properties attached to the main container'),\n id: PropTypes.string.description('components id'),\n appendToBody: PropTypes.bool.description('append component to body or not').defaultValue(true),\n className: PropTypes.string.description('html class attribute'),\n date: PropTypes.instanceOf(Date, moment).description('selected date').defaultValue(undefined),\n value: PropTypes.instanceOf(Date, moment).description('value'),\n placeholder: PropTypes.string.description('input placeholder value'),\n autoClear: PropTypes.bool\n .description('autoclears the input onblur if the date is not completely set')\n .defaultValue(false),\n disabled: PropTypes.bool.description('disable component or not').defaultValue(false),\n required: PropTypes.bool.description('value is required or not').defaultValue(false),\n readOnly: PropTypes.bool.description('is read only or not').defaultValue(false),\n hasError: PropTypes.bool.description('set error state').defaultValue(false),\n screenReaderInputMessage: PropTypes.string\n .description('message to anounce by screen reader')\n .defaultValue('select date'),\n enableOutsideDays: PropTypes.bool.description('enable days oustide month or not').defaultValue(true),\n initialVisibleMonth: PropTypes.instanceOf(Date, moment).description('initial month to display'),\n firstDayOfWeek: PropTypes.number.description('first day of week').defaultValue(0),\n keepOpenOnDateSelect: PropTypes.bool.description('keep picker open when a date is selected').defaultValue(false),\n hideKeyboardShortcutsPanel: PropTypes.bool.description('hide keyabord shortcut panel or not').defaultValue(true),\n onChange: PropTypes.func.description(\n `\n function executed when input changes. This could trigger with invalid dates. It returns a string and a moment\n if the date is valid.\n `,\n ),\n onDateChange: PropTypes.func.description(\n 'function executed when date changes. This doesnt trigger with invalid dates. It returns a moment object',\n ),\n onPrevMonthClick: PropTypes.func.description('function executed when clicking on prev month button'),\n onNextMonthClick: PropTypes.func.description('function executed when clicking on next month button'),\n onBlur: PropTypes.func.description('function executed when component loses focus'),\n onClose: PropTypes.func.description('function executed when component closes'),\n onFocus: PropTypes.func.description('function executed when component gains focus'),\n phrases: PropTypes.shape({\n calendarLabel: PropTypes.string,\n closeDatePicker: PropTypes.string,\n clearDates: PropTypes.string,\n focusStartDate: PropTypes.string,\n jumpToPrevMonth: PropTypes.string,\n jumpToNextMonth: PropTypes.string,\n keyboardShortcuts: PropTypes.string,\n showKeyboardShortcutsPanel: PropTypes.string,\n hideKeyboardShortcutsPanel: PropTypes.string,\n openThisPanel: PropTypes.string,\n enterKey: PropTypes.string,\n leftArrowRightArrow: PropTypes.string,\n upArrowDownArrow: PropTypes.string,\n pageUpPageDown: PropTypes.string,\n homeEnd: PropTypes.string,\n escape: PropTypes.string,\n questionMark: PropTypes.string,\n selectFocusedDate: PropTypes.string,\n moveFocusByOneDay: PropTypes.string,\n moveFocusByOneWeek: PropTypes.string,\n moveFocusByOneMonth: PropTypes.string,\n moveFocustoStartAndEndOfWeek: PropTypes.string,\n returnFocusToInput: PropTypes.string,\n keyboardNavigationInstructions: PropTypes.string,\n chooseAvailableStartDate: PropTypes.func,\n chooseAvailableEndDate: PropTypes.func,\n dateIsUnavailable: PropTypes.func,\n dateIsSelected: PropTypes.func,\n })\n .description('react-dates phrases')\n .defaultValue(SingleDatePickerPhrases),\n displayFormat: PropTypes.string.description('display format').defaultValue('L'),\n displayFormatDay: PropTypes.string.description('display format day').defaultValue('D'),\n transitionDuration: PropTypes.number.description('transition duration').defaultValue(0),\n verticalSpacing: PropTypes.number.description('vertical spacing'),\n isDayBlocked: PropTypes.func.description('function that returns each day and disables desired dates'),\n isOutsideRange: PropTypes.func.description('function that returns each day and disables outisde range dates'),\n isDayHighlighted: PropTypes.func.description('function that returns each day and higlights desired dates'),\n numberOfMonths: PropTypes.number.description('amount of months'),\n openDirection: PropTypes.string.description('open direction of the popup').defaultValue('down'),\n tabIndex: PropTypes.number.description('overrides tab index of the element'),\n zIndex: PropTypes.string.description('overrides z-index of the element'),\n pickerProps: PropTypes.shape(PickerPropsTypes).description('props to be passed to the picker container'),\n calendarProps: PropTypes.shape({ tabIndex: PropTypes.number }).description(\n 'props to be passes to the calendar container',\n ),\n focusCurrentDate: PropTypes.bool.description('Wheter to focus current date on calendar').defaultValue(false),\n};\n\nDSDatePicker.propTypes = datePickerProps;\nDSDatePicker.displayName = 'DSDatePicker';\nconst DatePickerWithSchema = describe(DSDatePicker);\nDatePickerWithSchema.propTypes = datePickerProps;\n\nexport {\n DatePickerNavigation,\n DatePickerDay,\n DatePickerPicker,\n DSDatePickerController,\n DatePickerDropdown,\n DatePickerSingleDate,\n DatePickerHeader,\n DatePickerRange,\n DatePickerRangeHeader,\n SingleRangeDateSwitcher,\n Picker,\n renderMonthElement,\n DatePickerWithSchema,\n};\n\nexport { DSDatePicker };\nexport default DSDatePicker;\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;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyHjB;AAvHN,0BAAsC;AACtC,8BAAoC;AAC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AAM,wCAAgB,EAAE,YAAY,4CAA4C;AAAA,EACvG,eAAe,kCAAU,MAAM,EAAE,UAAU,kCAAU,OAAO,CAAC,EAAE;AAAA,IAC7D;AAAA,EACF;AAAA,EACA,kBAAkB,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAC7G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,2BAAuB,kCAAS,YAAY;AAClD,qBAAqB,YAAY;AAmBjC,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["moment"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -33,8 +37,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
33
37
|
var import_react = __toESM(require("react"));
|
|
34
38
|
var import_moment = __toESM(require("moment"));
|
|
35
39
|
var import_ds_form = require("@elliemae/ds-form");
|
|
36
|
-
var import_DatePickerController = require("./DatePickerController/DatePickerController");
|
|
37
|
-
var import_DatePickerDropdown = require("./DatePickerDropdown");
|
|
40
|
+
var import_DatePickerController = require("./DatePickerController/DatePickerController.js");
|
|
41
|
+
var import_DatePickerDropdown = require("./DatePickerDropdown.js");
|
|
38
42
|
const FORMAT = "MMDDYYYY";
|
|
39
43
|
class DSDatePickerImpl extends import_react.default.Component {
|
|
40
44
|
constructor(props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DSDatePickerImpl.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable react/state-in-constructor */\n/* eslint-disable no-restricted-globals */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport moment from 'moment';\nimport { DSInputGroup, DSDateInputV2 } from '@elliemae/ds-form';\nimport { DSDatePickerController } from './DatePickerController/DatePickerController';\nimport { DatePickerDropdown } from './DatePickerDropdown';\n\nconst FORMAT = 'MMDDYYYY';\nexport default class DSDatePickerImpl extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n pickerRef: React.createRef(),\n dataInput: '',\n selectedDate: null,\n inputFocused: false,\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { dataInput: prevVal, selectedDate: prevDate } = prevState || {};\n const { value: nextVal, date: nextDate } = nextProps;\n\n const isPrevValMoment = prevVal instanceof moment;\n const isPrevDateMoment = prevDate instanceof moment;\n const prevValAsString = isPrevValMoment ? prevVal.format(FORMAT) : prevVal;\n\n // if users wants to clear, we use '==' to catch both undefined AND null\n if (nextVal == null && nextDate == null) {\n return {\n dataInput: '',\n selectedDate: null,\n };\n }\n\n // when val is an incomplete state, we don't want to mess with the state\n // it's incomplete when length is not the full mmddyyyy (length === 8)\n if (prevValAsString?.length < 8) {\n return null;\n }\n\n const prevDateAsString = isPrevDateMoment ? prevDate.format(FORMAT) : prevDate;\n\n const isNextValMoment = nextVal instanceof moment;\n const isNextDateMoment = nextDate instanceof moment;\n const nextValAsString = isNextValMoment ? nextVal.format(FORMAT) : nextVal;\n const nextValAsMoment = isNextValMoment ? nextVal : moment(nextVal);\n const nextDateAsString = isNextDateMoment ? nextDate.format(FORMAT) : nextDate;\n const nextDateAsMoment = isNextDateMoment ? nextDate : moment(nextDate);\n\n const hasValChanged = nextValAsString !== prevValAsString;\n const hasDateChanged = nextDateAsString !== prevDateAsString;\n\n const newState = {};\n let skipStateChange = true;\n\n // value has priority over date, if both date and value change we take date\n // as such, order of condition is meaningful\n if (hasDateChanged) {\n skipStateChange = false;\n newState.dataInput = nextDateAsString;\n newState.selectedDate = nextDateAsMoment;\n }\n\n if (hasValChanged) {\n skipStateChange = false;\n newState.dataInput = nextValAsString;\n newState.selectedDate = nextValAsMoment;\n }\n\n if (skipStateChange) return null;\n return newState;\n }\n\n onClickPicker = () => {\n this.setState({ inputFocused: true });\n };\n\n getSafeValue = () => {\n const { value, date, defaultValue } = this.props;\n const { selectedDate } = this.state;\n if (value) {\n return moment(value, FORMAT, true);\n }\n if (date) {\n return moment(date, FORMAT, true);\n }\n if (defaultValue) {\n return moment(defaultValue, FORMAT, true);\n }\n if (selectedDate) {\n return selectedDate;\n }\n return null;\n };\n\n getSafeInputValue = () => {\n const safeValue = this.getSafeValue();\n if (safeValue && safeValue.isValid()) {\n return safeValue.format(FORMAT);\n }\n const { dataInput } = this.state;\n return dataInput;\n };\n\n isControlled = () => {\n const { value, date } = this.props;\n return Boolean(value) || Boolean(date);\n };\n\n handleDateChange = (date, event) => {\n const { readOnly, onDateChange, keepOpenOnDateSelect, onChange, onBlur } = this.props;\n\n if (!readOnly) {\n if (!this.isControlled()) {\n this.setState({ dataInput: date.format(FORMAT), selectedDate: date });\n }\n onChange(date.format(FORMAT), date);\n onDateChange(date);\n if (!keepOpenOnDateSelect || event.key === 'Enter') {\n this.setState({ inputFocused: false });\n onBlur(date.format(FORMAT), date);\n }\n }\n };\n\n handleInputChange = (dataInput, newDate) => {\n const { onChange } = this.props;\n const newState = {\n dataInput,\n selectedDate: newDate,\n };\n this.setState(() => newState);\n onChange(dataInput, newDate);\n };\n\n handleChange = (newDate) => {\n if (!newDate) return;\n const { onDateChange } = this.props;\n const momentValue = moment(newDate, FORMAT, true);\n if (!momentValue.isValid()) return;\n this.setState({ selectedDate: momentValue });\n\n onDateChange(momentValue);\n };\n\n handleFocus = ({ focused }) => {\n this.setState({ inputFocused: focused });\n };\n\n handleCalendarClose = () => {\n const { onClose } = this.props;\n\n this.setState({ inputFocused: false });\n this.handleOnBlur();\n onClose();\n };\n\n handleClickEscape = () => {\n const { onClose } = this.props;\n\n this.setState({ inputFocused: false });\n this.handleOnBlur();\n onClose();\n };\n\n handleOnBlur = () => {\n setTimeout(() => {\n const { onBlur, autoClear } = this.props;\n const { dataInput, selectedDate } = this.state;\n\n if (moment(selectedDate, FORMAT, true).isValid()) {\n onBlur(dataInput, selectedDate);\n } else {\n if (autoClear) {\n this.setState({ dataInput: undefined });\n }\n onBlur(dataInput, null);\n }\n });\n };\n\n handleInputFocus = (dataInput) => {\n const { onFocus } = this.props;\n onFocus(dataInput);\n };\n\n render() {\n const { inputFocused } = this.state;\n const {\n disabled,\n numberOfMonths,\n readOnly,\n enableOutsideDays,\n transitionDuration,\n firstDayOfWeek,\n keepOpenOnDateSelect,\n hideKeyboardShortcutsPanel,\n onPrevMonthClick,\n onNextMonthClick,\n onClose,\n phrases,\n placeholder,\n displayFormatDay,\n isDayBlocked,\n isOutsideRange,\n isDayHighlighted,\n tabIndex,\n zIndex,\n pickerProps,\n calendarProps,\n focusCurrentDate,\n } = this.props;\n const safedate = this.getSafeValue();\n const safeInputValue = this.getSafeInputValue();\n const hasSelectedDate = !!safedate;\n return (\n <DSInputGroup\n rightAddon={\n <DatePickerDropdown\n pickerRef={this.state.pickerRef}\n disabled={disabled}\n isOpen={inputFocused}\n menu={\n <div\n style={{ minHeight: '310px', zIndex: 1 }}\n className={hasSelectedDate ? 'has-selected-date' : 'without-selected-date'}\n data-testid=\"date-picker-portal-wrapper\"\n >\n <DSDatePickerController\n date={safedate}\n displayFormatDay={displayFormatDay}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n numberOfMonths={numberOfMonths}\n onClickEscape={this.handleClickEscape}\n onClose={(...args) => {\n if (this.state.pickerRef.current) this.state.pickerRef.current.focus();\n onClose(...args);\n this.setState({ inputFocused: false });\n }}\n onDateChange={this.handleDateChange}\n onFocusChange={this.handleFocus}\n onNextMonthClick={onNextMonthClick}\n onOutsideClick={this.handleCalendarClose}\n onPrevMonthClick={onPrevMonthClick}\n phrases={phrases}\n transitionDuration={transitionDuration}\n calendarProps={calendarProps}\n focusCurrentDate={focusCurrentDate}\n />\n </div>\n }\n onClick={this.onClickPicker}\n readOnly={readOnly}\n zIndex={zIndex}\n pickerProps={pickerProps}\n />\n }\n >\n <DSDateInputV2\n data-testid=\"datepicker-input\"\n aria-label={placeholder || 'Date Picker Input'}\n disabled={disabled}\n onBlur={this.handleOnBlur}\n onChange={this.handleInputChange}\n onDateChange={this.handleChange}\n onFocus={this.handleInputFocus}\n placeholder={placeholder}\n tabIndex={tabIndex}\n value={safeInputValue}\n />\n </DSInputGroup>\n );\n }\n}\n\nexport { DSDatePickerImpl };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable react/state-in-constructor */\n/* eslint-disable no-restricted-globals */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport moment from 'moment';\nimport { DSInputGroup, DSDateInputV2 } from '@elliemae/ds-form';\nimport { DSDatePickerController } from './DatePickerController/DatePickerController.js';\nimport { DatePickerDropdown } from './DatePickerDropdown.js';\n\nconst FORMAT = 'MMDDYYYY';\nexport default class DSDatePickerImpl extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n pickerRef: React.createRef(),\n dataInput: '',\n selectedDate: null,\n inputFocused: false,\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { dataInput: prevVal, selectedDate: prevDate } = prevState || {};\n const { value: nextVal, date: nextDate } = nextProps;\n\n const isPrevValMoment = prevVal instanceof moment;\n const isPrevDateMoment = prevDate instanceof moment;\n const prevValAsString = isPrevValMoment ? prevVal.format(FORMAT) : prevVal;\n\n // if users wants to clear, we use '==' to catch both undefined AND null\n if (nextVal == null && nextDate == null) {\n return {\n dataInput: '',\n selectedDate: null,\n };\n }\n\n // when val is an incomplete state, we don't want to mess with the state\n // it's incomplete when length is not the full mmddyyyy (length === 8)\n if (prevValAsString?.length < 8) {\n return null;\n }\n\n const prevDateAsString = isPrevDateMoment ? prevDate.format(FORMAT) : prevDate;\n\n const isNextValMoment = nextVal instanceof moment;\n const isNextDateMoment = nextDate instanceof moment;\n const nextValAsString = isNextValMoment ? nextVal.format(FORMAT) : nextVal;\n const nextValAsMoment = isNextValMoment ? nextVal : moment(nextVal);\n const nextDateAsString = isNextDateMoment ? nextDate.format(FORMAT) : nextDate;\n const nextDateAsMoment = isNextDateMoment ? nextDate : moment(nextDate);\n\n const hasValChanged = nextValAsString !== prevValAsString;\n const hasDateChanged = nextDateAsString !== prevDateAsString;\n\n const newState = {};\n let skipStateChange = true;\n\n // value has priority over date, if both date and value change we take date\n // as such, order of condition is meaningful\n if (hasDateChanged) {\n skipStateChange = false;\n newState.dataInput = nextDateAsString;\n newState.selectedDate = nextDateAsMoment;\n }\n\n if (hasValChanged) {\n skipStateChange = false;\n newState.dataInput = nextValAsString;\n newState.selectedDate = nextValAsMoment;\n }\n\n if (skipStateChange) return null;\n return newState;\n }\n\n onClickPicker = () => {\n this.setState({ inputFocused: true });\n };\n\n getSafeValue = () => {\n const { value, date, defaultValue } = this.props;\n const { selectedDate } = this.state;\n if (value) {\n return moment(value, FORMAT, true);\n }\n if (date) {\n return moment(date, FORMAT, true);\n }\n if (defaultValue) {\n return moment(defaultValue, FORMAT, true);\n }\n if (selectedDate) {\n return selectedDate;\n }\n return null;\n };\n\n getSafeInputValue = () => {\n const safeValue = this.getSafeValue();\n if (safeValue && safeValue.isValid()) {\n return safeValue.format(FORMAT);\n }\n const { dataInput } = this.state;\n return dataInput;\n };\n\n isControlled = () => {\n const { value, date } = this.props;\n return Boolean(value) || Boolean(date);\n };\n\n handleDateChange = (date, event) => {\n const { readOnly, onDateChange, keepOpenOnDateSelect, onChange, onBlur } = this.props;\n\n if (!readOnly) {\n if (!this.isControlled()) {\n this.setState({ dataInput: date.format(FORMAT), selectedDate: date });\n }\n onChange(date.format(FORMAT), date);\n onDateChange(date);\n if (!keepOpenOnDateSelect || event.key === 'Enter') {\n this.setState({ inputFocused: false });\n onBlur(date.format(FORMAT), date);\n }\n }\n };\n\n handleInputChange = (dataInput, newDate) => {\n const { onChange } = this.props;\n const newState = {\n dataInput,\n selectedDate: newDate,\n };\n this.setState(() => newState);\n onChange(dataInput, newDate);\n };\n\n handleChange = (newDate) => {\n if (!newDate) return;\n const { onDateChange } = this.props;\n const momentValue = moment(newDate, FORMAT, true);\n if (!momentValue.isValid()) return;\n this.setState({ selectedDate: momentValue });\n\n onDateChange(momentValue);\n };\n\n handleFocus = ({ focused }) => {\n this.setState({ inputFocused: focused });\n };\n\n handleCalendarClose = () => {\n const { onClose } = this.props;\n\n this.setState({ inputFocused: false });\n this.handleOnBlur();\n onClose();\n };\n\n handleClickEscape = () => {\n const { onClose } = this.props;\n\n this.setState({ inputFocused: false });\n this.handleOnBlur();\n onClose();\n };\n\n handleOnBlur = () => {\n setTimeout(() => {\n const { onBlur, autoClear } = this.props;\n const { dataInput, selectedDate } = this.state;\n\n if (moment(selectedDate, FORMAT, true).isValid()) {\n onBlur(dataInput, selectedDate);\n } else {\n if (autoClear) {\n this.setState({ dataInput: undefined });\n }\n onBlur(dataInput, null);\n }\n });\n };\n\n handleInputFocus = (dataInput) => {\n const { onFocus } = this.props;\n onFocus(dataInput);\n };\n\n render() {\n const { inputFocused } = this.state;\n const {\n disabled,\n numberOfMonths,\n readOnly,\n enableOutsideDays,\n transitionDuration,\n firstDayOfWeek,\n keepOpenOnDateSelect,\n hideKeyboardShortcutsPanel,\n onPrevMonthClick,\n onNextMonthClick,\n onClose,\n phrases,\n placeholder,\n displayFormatDay,\n isDayBlocked,\n isOutsideRange,\n isDayHighlighted,\n tabIndex,\n zIndex,\n pickerProps,\n calendarProps,\n focusCurrentDate,\n } = this.props;\n const safedate = this.getSafeValue();\n const safeInputValue = this.getSafeInputValue();\n const hasSelectedDate = !!safedate;\n return (\n <DSInputGroup\n rightAddon={\n <DatePickerDropdown\n pickerRef={this.state.pickerRef}\n disabled={disabled}\n isOpen={inputFocused}\n menu={\n <div\n style={{ minHeight: '310px', zIndex: 1 }}\n className={hasSelectedDate ? 'has-selected-date' : 'without-selected-date'}\n data-testid=\"date-picker-portal-wrapper\"\n >\n <DSDatePickerController\n date={safedate}\n displayFormatDay={displayFormatDay}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n numberOfMonths={numberOfMonths}\n onClickEscape={this.handleClickEscape}\n onClose={(...args) => {\n if (this.state.pickerRef.current) this.state.pickerRef.current.focus();\n onClose(...args);\n this.setState({ inputFocused: false });\n }}\n onDateChange={this.handleDateChange}\n onFocusChange={this.handleFocus}\n onNextMonthClick={onNextMonthClick}\n onOutsideClick={this.handleCalendarClose}\n onPrevMonthClick={onPrevMonthClick}\n phrases={phrases}\n transitionDuration={transitionDuration}\n calendarProps={calendarProps}\n focusCurrentDate={focusCurrentDate}\n />\n </div>\n }\n onClick={this.onClickPicker}\n readOnly={readOnly}\n zIndex={zIndex}\n pickerProps={pickerProps}\n />\n }\n >\n <DSDateInputV2\n data-testid=\"datepicker-input\"\n aria-label={placeholder || 'Date Picker Input'}\n disabled={disabled}\n onBlur={this.handleOnBlur}\n onChange={this.handleInputChange}\n onDateChange={this.handleChange}\n onFocus={this.handleInputFocus}\n placeholder={placeholder}\n tabIndex={tabIndex}\n value={safeInputValue}\n />\n </DSInputGroup>\n );\n }\n}\n\nexport { DSDatePickerImpl };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2OP;AApOhB,mBAAkB;AAClB,oBAAmB;AACnB,qBAA4C;AAC5C,kCAAuC;AACvC,gCAAmC;AAEnC,MAAM,SAAS;AACf,MAAO,yBAAuC,aAAAA,QAAM,UAAU;AAAA,EAC5D,YAAY,OAAO;AACjB,UAAM,KAAK;AAgEb,yBAAgB,MAAM;AACpB,WAAK,SAAS,EAAE,cAAc,KAAK,CAAC;AAAA,IACtC;AAEA,wBAAe,MAAM;AACnB,YAAM,EAAE,OAAO,MAAM,aAAa,IAAI,KAAK;AAC3C,YAAM,EAAE,aAAa,IAAI,KAAK;AAC9B,UAAI,OAAO;AACT,mBAAO,cAAAC,SAAO,OAAO,QAAQ,IAAI;AAAA,MACnC;AACA,UAAI,MAAM;AACR,mBAAO,cAAAA,SAAO,MAAM,QAAQ,IAAI;AAAA,MAClC;AACA,UAAI,cAAc;AAChB,mBAAO,cAAAA,SAAO,cAAc,QAAQ,IAAI;AAAA,MAC1C;AACA,UAAI,cAAc;AAChB,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAEA,6BAAoB,MAAM;AACxB,YAAM,YAAY,KAAK,aAAa;AACpC,UAAI,aAAa,UAAU,QAAQ,GAAG;AACpC,eAAO,UAAU,OAAO,MAAM;AAAA,MAChC;AACA,YAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,aAAO;AAAA,IACT;AAEA,wBAAe,MAAM;AACnB,YAAM,EAAE,OAAO,KAAK,IAAI,KAAK;AAC7B,aAAO,QAAQ,KA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BAAsB;AAAA,gBACnD,eAAY;AAAA,gBAEZ;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAM;AAAA,oBACN;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA,eAAe,KAAK;AAAA,oBACpB,SAAS,IAAI,SAAS;AACpB,0BAAI,KAAK,MAAM,UAAU;AAAS,6BAAK,MAAM,UAAU,QAAQ,MAAM;AACrE,8BAAQ,GAAG,IAAI;AACf,2BAAK,SAAS,EAAE,cAAc,MAAM,CAAC;AAAA,oBACvC;AAAA,oBACA,cAAc,KAAK;AAAA,oBACnB,eAAe,KAAK;AAAA,oBACpB;AAAA,oBACA,gBAAgB,KAAK;AAAA,oBACrB;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,YAEF,SAAS,KAAK;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,cAAY,eAAe;AAAA,YAC3B;AAAA,YACA,QAAQ,KAAK;AAAA,YACb,UAAU,KAAK;AAAA,YACf,cAAc,KAAK;AAAA,YACnB,SAAS,KAAK;AAAA,YACd;AAAA,YACA;AAAA,YACA,OAAO;AAAA;AAAA,QACT;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React", "moment"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -34,14 +38,14 @@ var import_react = __toESM(require("react"));
|
|
|
34
38
|
var import_lodash = require("lodash");
|
|
35
39
|
var import_prop_types = __toESM(require("prop-types"));
|
|
36
40
|
var import_moment = __toESM(require("moment"));
|
|
37
|
-
var import_initialize = require("react-dates/initialize");
|
|
41
|
+
var import_initialize = require("react-dates/initialize.js");
|
|
38
42
|
var import_react_dates = require("react-dates");
|
|
39
43
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
40
44
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
41
|
-
var import_defaultPhrases = require("../../defaultPhrases");
|
|
42
|
-
var import_DatePickerRenderMonth = require("../DatePickerRenderMonth/DatePickerRenderMonth");
|
|
43
|
-
var import_DatePickerNavigation = require("../DatePickerNavigation/DatePickerNavigation");
|
|
44
|
-
var import_DatePickerDay = require("../DatePickerDay/DatePickerDay");
|
|
45
|
+
var import_defaultPhrases = require("../../defaultPhrases.js");
|
|
46
|
+
var import_DatePickerRenderMonth = require("../DatePickerRenderMonth/DatePickerRenderMonth.js");
|
|
47
|
+
var import_DatePickerNavigation = require("../DatePickerNavigation/DatePickerNavigation.js");
|
|
48
|
+
var import_DatePickerDay = require("../DatePickerDay/DatePickerDay.js");
|
|
45
49
|
const { classNameElement, classNameBlock } = (0, import_ds_classnames.convertPropToCssClassName)("datepicker-range");
|
|
46
50
|
const focusElementOnOpen = (0, import_lodash.debounce)((datePickerDom, firstFocusableItemDom, focusCurrentDate) => {
|
|
47
51
|
if (datePickerDom) {
|
|
@@ -229,6 +233,7 @@ class DSDatePickerController extends import_react.default.Component {
|
|
|
229
233
|
) });
|
|
230
234
|
}
|
|
231
235
|
}
|
|
236
|
+
// eslint-disable-next-line react/static-property-placement
|
|
232
237
|
DSDatePickerController.defaultProps = {
|
|
233
238
|
date: "",
|
|
234
239
|
value: "",
|
|
@@ -244,8 +249,10 @@ DSDatePickerController.defaultProps = {
|
|
|
244
249
|
onClickEscape: () => null,
|
|
245
250
|
onDateChange: () => null,
|
|
246
251
|
phrases: import_defaultPhrases.SingleDatePickerPhrases,
|
|
252
|
+
// displayFormat: 'L',
|
|
247
253
|
displayFormatDay: "D",
|
|
248
254
|
transitionDuration: 0,
|
|
255
|
+
// verticalSpacing: 0,
|
|
249
256
|
isDayBlocked: () => false,
|
|
250
257
|
isOutsideRange: () => false,
|
|
251
258
|
isDayHighlighted: () => false,
|
|
@@ -266,8 +273,10 @@ DSDatePickerController.propTypes = {
|
|
|
266
273
|
onChange: import_prop_types.default.func,
|
|
267
274
|
onDateChange: import_prop_types.default.func,
|
|
268
275
|
phrases: import_defaultPhrases.SingleDatePickerPhrases,
|
|
276
|
+
// displayFormat: PropTypes.string,
|
|
269
277
|
displayFormatDay: import_prop_types.default.string,
|
|
270
278
|
transitionDuration: import_prop_types.default.number,
|
|
279
|
+
// verticalSpacing: PropTypes.number,
|
|
271
280
|
isDayBlocked: import_prop_types.default.func,
|
|
272
281
|
isOutsideRange: import_prop_types.default.func,
|
|
273
282
|
isDayHighlighted: import_prop_types.default.func,
|
|
@@ -317,8 +326,10 @@ DSDatePickerController.defaultProps = {
|
|
|
317
326
|
dateIsUnavailable: import_prop_types.default.func,
|
|
318
327
|
dateIsSelected: import_prop_types.default.func
|
|
319
328
|
}),
|
|
329
|
+
// displayFormat: 'L',
|
|
320
330
|
displayFormatDay: "D",
|
|
321
331
|
transitionDuration: 0,
|
|
332
|
+
// verticalSpacing: 0,
|
|
322
333
|
isDayBlocked: () => false,
|
|
323
334
|
isOutsideRange: () => false,
|
|
324
335
|
isDayHighlighted: () => false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerController/DatePickerController.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport 'react-dates/initialize';\nimport { DayPickerSingleDateController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { SingleDatePickerPhrases } from '../../defaultPhrases';\nimport { renderMonthElement } from '../DatePickerRenderMonth/DatePickerRenderMonth';\nimport { DatePickerNavigation } from '../DatePickerNavigation/DatePickerNavigation';\nimport { DatePickerDay } from '../DatePickerDay/DatePickerDay';\n\ninterface DSDatePickerControllerStateType {\n selectedDate: any;\n firstFocusableItem: React.RefObject<HTMLElement>;\n datePicker: React.RefObject<HTMLElement>;\n}\n\nconst { classNameElement, classNameBlock } = convertPropToCssClassName('datepicker-range');\n\nconst focusElementOnOpen = debounce((datePickerDom, firstFocusableItemDom, focusCurrentDate) => {\n if (datePickerDom) {\n const currentDay = Array.from(datePickerDom?.getElementsByClassName('CalendarDay__today')).filter(\n (el) => !el.className.includes('CalendarDay__outside'),\n )[0];\n const [calendarDaySelected] = datePickerDom?.getElementsByClassName('CalendarDay__selected');\n if (calendarDaySelected) {\n calendarDaySelected?.focus?.();\n } else if (focusCurrentDate && !calendarDaySelected) currentDay.focus();\n else {\n const navButton = firstFocusableItemDom?.closest('.DayPickerNavigation_button>div');\n navButton?.focus?.();\n }\n }\n}, 100);\n\nexport default class DSDatePickerController extends React.Component<any, DSDatePickerControllerStateType> {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = {\n date: '',\n value: '',\n enableOutsideDays: false,\n initialVisibleMonth: moment(),\n firstDayOfWeek: 0,\n keepOpenOnDateSelect: true,\n hideKeyboardShortcutsPanel: true,\n onPrevMonthClick: () => null,\n onNextMonthClick: () => null,\n onClose: () => null,\n onChange: () => null,\n onClickEscape: () => null,\n onDateChange: () => null,\n phrases: SingleDatePickerPhrases,\n // displayFormat: 'L',\n displayFormatDay: 'D',\n transitionDuration: 0,\n // verticalSpacing: 0,\n isDayBlocked: () => false,\n isOutsideRange: () => false,\n isDayHighlighted: () => false,\n numberOfMonths: 1,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n selectedDate: null,\n firstFocusableItem: React.createRef(),\n datePicker: React.createRef(),\n };\n }\n\n componentDidMount() {\n const { datePicker, firstFocusableItem } = this.state;\n datePicker.current.addEventListener('mouseup', this.handleMouseUp, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n setTimeout(() => {\n focusElementOnOpen(datePicker?.current, firstFocusableItem?.current, this.props.focusCurrentDate);\n }, 400);\n }\n\n componentWillUnmount() {\n const { datePicker } = this.state;\n datePicker.current.removeEventListener('mouseup', this.handleMouseUp, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n }\n\n handleMouseUp = () => {\n const focusedElement = document.activeElement;\n\n focusedElement?.blur?.();\n };\n\n handleKeyDown = (event) => {\n const [firstDay, ...restOfDays] = document\n .getElementsByClassName('CalendarMonthGrid_month__horizontal')[1]\n .getElementsByClassName('CalendarDay');\n const [lastDay] = restOfDays.slice(-1);\n const { onClickEscape } = this.props;\n\n switch (event.key) {\n case 'Home':\n firstDay.focus();\n break;\n case 'End':\n lastDay.focus();\n break;\n case 'Escape':\n onClickEscape();\n break;\n default:\n break;\n }\n };\n\n getSafeValue = () => {\n const { value, date, defaultValue } = this.props;\n const { selectedDate } = this.state;\n\n if (value) return moment(value);\n if (date) return moment(date);\n if (defaultValue) return moment(defaultValue);\n if (selectedDate) return moment(selectedDate);\n\n return null;\n };\n\n isControlled = () => {\n const { value, date } = this.props;\n return Boolean(value) || Boolean(date);\n };\n\n handleDateChange = (date) => {\n const { readOnly, onDateChange, onChange } = this.props;\n if (!readOnly) {\n if (!this.isControlled()) {\n this.setState({ selectedDate: date });\n }\n onDateChange(date);\n onChange(date);\n }\n };\n\n handleChange = (dataInput) => {\n const { onDateChange, onChange } = this.props;\n const momentvalue = moment(dataInput.target.value);\n this.setState({ selectedDate: momentvalue });\n onDateChange(momentvalue);\n onChange(momentvalue);\n };\n\n handleNavClick = (date, nav) => {\n const [prev, next] = document.getElementsByClassName('DayPickerNavigation_button');\n const { onPrevMonthClick, onNextMonthClick } = this.props;\n\n if (nav === 'prev') {\n prev?.focus?.();\n onPrevMonthClick(date);\n } else {\n next?.focus?.();\n onNextMonthClick(date);\n }\n };\n\n insideBlur = (event) => {\n const { datePicker } = this.state;\n if (!datePicker.current.contains(event.currentTarget)) {\n this.props.onClose();\n }\n };\n\n render() {\n const {\n numberOfMonths,\n enableOutsideDays,\n transitionDuration,\n initialVisibleMonth,\n firstDayOfWeek,\n keepOpenOnDateSelect,\n hideKeyboardShortcutsPanel,\n onClose,\n phrases,\n displayFormatDay,\n isDayBlocked,\n isOutsideRange,\n isDayHighlighted,\n onOutsideClick,\n key,\n calendarProps,\n } = this.props;\n const { datePicker, firstFocusableItem } = this.state;\n\n const safedate = this.getSafeValue();\n const safeinitialMonth = safedate && safedate.isValid() ? () => safedate : () => initialVisibleMonth;\n\n return (\n <div>\n <div\n onBlur={this.insideBlur}\n ref={datePicker}\n className={classNameBlock('wrapper-day-picker-single-date-controller')}\n data-testid=\"calendar-wrapper\"\n {...calendarProps}\n >\n <DayPickerSingleDateController\n key={key}\n date={safedate}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n focused\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n initialVisibleMonth={safeinitialMonth}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n navNext={<DatePickerNavigation className={classNameElement('navigation-next')} />}\n navPrev={\n <DatePickerNavigation\n className={classNameElement('navigation-prev')}\n icon={ChevronLeft}\n innerRef={firstFocusableItem}\n />\n }\n renderMonthElement={renderMonthElement}\n numberOfMonths={numberOfMonths}\n onClose={onClose}\n onDateChange={this.handleDateChange}\n onNextMonthClick={this.handleNavClick('next')}\n onOutsideClick={onOutsideClick}\n onPrevMonthClick={this.handleNavClick('prev')}\n phrases={phrases}\n renderDayContents={(date) => (\n <DatePickerDay className={classNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n transitionDuration={transitionDuration}\n onTab={(e) => {\n if (e.target.classList.contains('CalendarDay')) {\n e.preventDefault();\n onClose();\n }\n }}\n />\n </div>\n </div>\n );\n }\n}\n\nDSDatePickerController.propTypes = {\n date: PropTypes.instanceOf(Date, moment),\n value: PropTypes.oneOf([PropTypes.instanceOf(Date), PropTypes.instanceOf(moment)]),\n enableOutsideDays: PropTypes.bool,\n initialVisibleMonth: PropTypes.instanceOf(Date, moment),\n firstDayOfWeek: PropTypes.number,\n keepOpenOnDateSelect: PropTypes.bool,\n hideKeyboardShortcutsPanel: PropTypes.bool,\n onPrevMonthClick: PropTypes.func,\n onNextMonthClick: PropTypes.func,\n onClose: PropTypes.func,\n onClickEscape: PropTypes.func,\n onChange: PropTypes.func,\n onDateChange: PropTypes.func,\n phrases: SingleDatePickerPhrases,\n // displayFormat: PropTypes.string,\n displayFormatDay: PropTypes.string,\n transitionDuration: PropTypes.number,\n // verticalSpacing: PropTypes.number,\n isDayBlocked: PropTypes.func,\n isOutsideRange: PropTypes.func,\n isDayHighlighted: PropTypes.func,\n numberOfMonths: PropTypes.number,\n};\n\nDSDatePickerController.defaultProps = {\n date: '',\n value: '',\n enableOutsideDays: false,\n initialVisibleMonth: moment(),\n firstDayOfWeek: 0,\n keepOpenOnDateSelect: true,\n hideKeyboardShortcutsPanel: true,\n onPrevMonthClick: () => null,\n onNextMonthClick: () => null,\n onClose: () => null,\n onClickEscape: () => null,\n onChange: () => null,\n onDateChange: () => null,\n phrases: PropTypes.shape({\n calendarLabel: PropTypes.string,\n closeDatePicker: PropTypes.string,\n clearDates: PropTypes.string,\n focusStartDate: PropTypes.string,\n jumpToPrevMonth: PropTypes.string,\n jumpToNextMonth: PropTypes.string,\n keyboardShortcuts: PropTypes.string,\n showKeyboardShortcutsPanel: PropTypes.string,\n hideKeyboardShortcutsPanel: PropTypes.string,\n openThisPanel: PropTypes.string,\n enterKey: PropTypes.string,\n leftArrowRightArrow: PropTypes.string,\n upArrowDownArrow: PropTypes.string,\n pageUpPageDown: PropTypes.string,\n homeEnd: PropTypes.string,\n escape: PropTypes.string,\n questionMark: PropTypes.string,\n selectFocusedDate: PropTypes.string,\n moveFocusByOneDay: PropTypes.string,\n moveFocusByOneWeek: PropTypes.string,\n moveFocusByOneMonth: PropTypes.string,\n moveFocustoStartAndEndOfWeek: PropTypes.string,\n returnFocusToInput: PropTypes.string,\n keyboardNavigationInstructions: PropTypes.string,\n chooseAvailableStartDate: PropTypes.func,\n chooseAvailableEndDate: PropTypes.func,\n dateIsUnavailable: PropTypes.func,\n dateIsSelected: PropTypes.func,\n }),\n // displayFormat: 'L',\n displayFormatDay: 'D',\n transitionDuration: 0,\n // verticalSpacing: 0,\n isDayBlocked: () => false,\n isOutsideRange: () => false,\n isDayHighlighted: () => false,\n numberOfMonths: 1,\n};\n\nexport { DSDatePickerController };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { debounce } from 'lodash';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport 'react-dates/initialize.js';\nimport { DayPickerSingleDateController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { SingleDatePickerPhrases } from '../../defaultPhrases.js';\nimport { renderMonthElement } from '../DatePickerRenderMonth/DatePickerRenderMonth.js';\nimport { DatePickerNavigation } from '../DatePickerNavigation/DatePickerNavigation.js';\nimport { DatePickerDay } from '../DatePickerDay/DatePickerDay.js';\n\ninterface DSDatePickerControllerStateType {\n selectedDate: any;\n firstFocusableItem: React.RefObject<HTMLElement>;\n datePicker: React.RefObject<HTMLElement>;\n}\n\nconst { classNameElement, classNameBlock } = convertPropToCssClassName('datepicker-range');\n\nconst focusElementOnOpen = debounce((datePickerDom, firstFocusableItemDom, focusCurrentDate) => {\n if (datePickerDom) {\n const currentDay = Array.from(datePickerDom?.getElementsByClassName('CalendarDay__today')).filter(\n (el) => !el.className.includes('CalendarDay__outside'),\n )[0];\n const [calendarDaySelected] = datePickerDom?.getElementsByClassName('CalendarDay__selected');\n if (calendarDaySelected) {\n calendarDaySelected?.focus?.();\n } else if (focusCurrentDate && !calendarDaySelected) currentDay.focus();\n else {\n const navButton = firstFocusableItemDom?.closest('.DayPickerNavigation_button>div');\n navButton?.focus?.();\n }\n }\n}, 100);\n\nexport default class DSDatePickerController extends React.Component<any, DSDatePickerControllerStateType> {\n // eslint-disable-next-line react/static-property-placement\n static defaultProps = {\n date: '',\n value: '',\n enableOutsideDays: false,\n initialVisibleMonth: moment(),\n firstDayOfWeek: 0,\n keepOpenOnDateSelect: true,\n hideKeyboardShortcutsPanel: true,\n onPrevMonthClick: () => null,\n onNextMonthClick: () => null,\n onClose: () => null,\n onChange: () => null,\n onClickEscape: () => null,\n onDateChange: () => null,\n phrases: SingleDatePickerPhrases,\n // displayFormat: 'L',\n displayFormatDay: 'D',\n transitionDuration: 0,\n // verticalSpacing: 0,\n isDayBlocked: () => false,\n isOutsideRange: () => false,\n isDayHighlighted: () => false,\n numberOfMonths: 1,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n selectedDate: null,\n firstFocusableItem: React.createRef(),\n datePicker: React.createRef(),\n };\n }\n\n componentDidMount() {\n const { datePicker, firstFocusableItem } = this.state;\n datePicker.current.addEventListener('mouseup', this.handleMouseUp, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n setTimeout(() => {\n focusElementOnOpen(datePicker?.current, firstFocusableItem?.current, this.props.focusCurrentDate);\n }, 400);\n }\n\n componentWillUnmount() {\n const { datePicker } = this.state;\n datePicker.current.removeEventListener('mouseup', this.handleMouseUp, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n }\n\n handleMouseUp = () => {\n const focusedElement = document.activeElement;\n\n focusedElement?.blur?.();\n };\n\n handleKeyDown = (event) => {\n const [firstDay, ...restOfDays] = document\n .getElementsByClassName('CalendarMonthGrid_month__horizontal')[1]\n .getElementsByClassName('CalendarDay');\n const [lastDay] = restOfDays.slice(-1);\n const { onClickEscape } = this.props;\n\n switch (event.key) {\n case 'Home':\n firstDay.focus();\n break;\n case 'End':\n lastDay.focus();\n break;\n case 'Escape':\n onClickEscape();\n break;\n default:\n break;\n }\n };\n\n getSafeValue = () => {\n const { value, date, defaultValue } = this.props;\n const { selectedDate } = this.state;\n\n if (value) return moment(value);\n if (date) return moment(date);\n if (defaultValue) return moment(defaultValue);\n if (selectedDate) return moment(selectedDate);\n\n return null;\n };\n\n isControlled = () => {\n const { value, date } = this.props;\n return Boolean(value) || Boolean(date);\n };\n\n handleDateChange = (date) => {\n const { readOnly, onDateChange, onChange } = this.props;\n if (!readOnly) {\n if (!this.isControlled()) {\n this.setState({ selectedDate: date });\n }\n onDateChange(date);\n onChange(date);\n }\n };\n\n handleChange = (dataInput) => {\n const { onDateChange, onChange } = this.props;\n const momentvalue = moment(dataInput.target.value);\n this.setState({ selectedDate: momentvalue });\n onDateChange(momentvalue);\n onChange(momentvalue);\n };\n\n handleNavClick = (date, nav) => {\n const [prev, next] = document.getElementsByClassName('DayPickerNavigation_button');\n const { onPrevMonthClick, onNextMonthClick } = this.props;\n\n if (nav === 'prev') {\n prev?.focus?.();\n onPrevMonthClick(date);\n } else {\n next?.focus?.();\n onNextMonthClick(date);\n }\n };\n\n insideBlur = (event) => {\n const { datePicker } = this.state;\n if (!datePicker.current.contains(event.currentTarget)) {\n this.props.onClose();\n }\n };\n\n render() {\n const {\n numberOfMonths,\n enableOutsideDays,\n transitionDuration,\n initialVisibleMonth,\n firstDayOfWeek,\n keepOpenOnDateSelect,\n hideKeyboardShortcutsPanel,\n onClose,\n phrases,\n displayFormatDay,\n isDayBlocked,\n isOutsideRange,\n isDayHighlighted,\n onOutsideClick,\n key,\n calendarProps,\n } = this.props;\n const { datePicker, firstFocusableItem } = this.state;\n\n const safedate = this.getSafeValue();\n const safeinitialMonth = safedate && safedate.isValid() ? () => safedate : () => initialVisibleMonth;\n\n return (\n <div>\n <div\n onBlur={this.insideBlur}\n ref={datePicker}\n className={classNameBlock('wrapper-day-picker-single-date-controller')}\n data-testid=\"calendar-wrapper\"\n {...calendarProps}\n >\n <DayPickerSingleDateController\n key={key}\n date={safedate}\n enableOutsideDays={enableOutsideDays}\n firstDayOfWeek={firstDayOfWeek}\n focused\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n initialVisibleMonth={safeinitialMonth}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange}\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n navNext={<DatePickerNavigation className={classNameElement('navigation-next')} />}\n navPrev={\n <DatePickerNavigation\n className={classNameElement('navigation-prev')}\n icon={ChevronLeft}\n innerRef={firstFocusableItem}\n />\n }\n renderMonthElement={renderMonthElement}\n numberOfMonths={numberOfMonths}\n onClose={onClose}\n onDateChange={this.handleDateChange}\n onNextMonthClick={this.handleNavClick('next')}\n onOutsideClick={onOutsideClick}\n onPrevMonthClick={this.handleNavClick('prev')}\n phrases={phrases}\n renderDayContents={(date) => (\n <DatePickerDay className={classNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n transitionDuration={transitionDuration}\n onTab={(e) => {\n if (e.target.classList.contains('CalendarDay')) {\n e.preventDefault();\n onClose();\n }\n }}\n />\n </div>\n </div>\n );\n }\n}\n\nDSDatePickerController.propTypes = {\n date: PropTypes.instanceOf(Date, moment),\n value: PropTypes.oneOf([PropTypes.instanceOf(Date), PropTypes.instanceOf(moment)]),\n enableOutsideDays: PropTypes.bool,\n initialVisibleMonth: PropTypes.instanceOf(Date, moment),\n firstDayOfWeek: PropTypes.number,\n keepOpenOnDateSelect: PropTypes.bool,\n hideKeyboardShortcutsPanel: PropTypes.bool,\n onPrevMonthClick: PropTypes.func,\n onNextMonthClick: PropTypes.func,\n onClose: PropTypes.func,\n onClickEscape: PropTypes.func,\n onChange: PropTypes.func,\n onDateChange: PropTypes.func,\n phrases: SingleDatePickerPhrases,\n // displayFormat: PropTypes.string,\n displayFormatDay: PropTypes.string,\n transitionDuration: PropTypes.number,\n // verticalSpacing: PropTypes.number,\n isDayBlocked: PropTypes.func,\n isOutsideRange: PropTypes.func,\n isDayHighlighted: PropTypes.func,\n numberOfMonths: PropTypes.number,\n};\n\nDSDatePickerController.defaultProps = {\n date: '',\n value: '',\n enableOutsideDays: false,\n initialVisibleMonth: moment(),\n firstDayOfWeek: 0,\n keepOpenOnDateSelect: true,\n hideKeyboardShortcutsPanel: true,\n onPrevMonthClick: () => null,\n onNextMonthClick: () => null,\n onClose: () => null,\n onClickEscape: () => null,\n onChange: () => null,\n onDateChange: () => null,\n phrases: PropTypes.shape({\n calendarLabel: PropTypes.string,\n closeDatePicker: PropTypes.string,\n clearDates: PropTypes.string,\n focusStartDate: PropTypes.string,\n jumpToPrevMonth: PropTypes.string,\n jumpToNextMonth: PropTypes.string,\n keyboardShortcuts: PropTypes.string,\n showKeyboardShortcutsPanel: PropTypes.string,\n hideKeyboardShortcutsPanel: PropTypes.string,\n openThisPanel: PropTypes.string,\n enterKey: PropTypes.string,\n leftArrowRightArrow: PropTypes.string,\n upArrowDownArrow: PropTypes.string,\n pageUpPageDown: PropTypes.string,\n homeEnd: PropTypes.string,\n escape: PropTypes.string,\n questionMark: PropTypes.string,\n selectFocusedDate: PropTypes.string,\n moveFocusByOneDay: PropTypes.string,\n moveFocusByOneWeek: PropTypes.string,\n moveFocusByOneMonth: PropTypes.string,\n moveFocustoStartAndEndOfWeek: PropTypes.string,\n returnFocusToInput: PropTypes.string,\n keyboardNavigationInstructions: PropTypes.string,\n chooseAvailableStartDate: PropTypes.func,\n chooseAvailableEndDate: PropTypes.func,\n dateIsUnavailable: PropTypes.func,\n dateIsSelected: PropTypes.func,\n }),\n // displayFormat: 'L',\n displayFormatDay: 'D',\n transitionDuration: 0,\n // verticalSpacing: 0,\n isDayBlocked: () => false,\n isOutsideRange: () => false,\n isDayHighlighted: () => false,\n numberOfMonths: 1,\n};\n\nexport { DSDatePickerController };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2NF;AAzNrB,mBAAkB;AAClB,oBAAyB;AACzB,wBAAsB;AACtB,oBAAmB;AACnB,wBAAO;AACP,yBAA8C;AAC9C,2BAA0C;AAC1C,sBAA4B;AAC5B,4BAAwC;AACxC,mCAAmC;AACnC,kCAAqC;AACrC,2BAA8B;AAQ9B,MAAM,EAAE,kBAAkB,eAAe,QAAI,gDAA0B,kBAAkB;AAEzF,MAAM,yBAAqB,wBAAS,CAAC,eAAe,uBAAuB,qBAAqB;AAC9F,MAAI,eAAe;AACjB,UAAM,aAAa,MAAM,KAAK,eAAe,uBAAuB,oBAAoB,CAAC,EAAE;AAAA,MACzF,CAAC,OAAO,CAAC,GAAG,UAAU,SAAS,sBAAsB;AAAA,IACvD,EAAE,CAAC;AACH,UAAM,CAAC,mBAAmB,IAAI,eAAe,uBAAuB,uBAAuB;AAC3F,QAAI,qBAAqB;AACvB,2BAAqB,QAAQ;AAAA,IAC/B,WAAW,oBAAoB,CAAC;AAAqB,iBAAW,MAAM;AAAA,SACjE;AACH,YAAM,YAAY,uBAAuB,QAAQ,iCAAiC;AAClF,iBAAW,QAAQ;AAAA,IACrB;AAAA,EACF;AACF,GAAG,GAAG;AAEN,MAAO,+BAA6C,aAAAA,QAAM,UAAgD;AAAA,EA2BxG,YAAY,OAAO;AACjB,UAAM,KAAK;AAuBb,yBAAgB,MAA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AqB,kBAAAA,QAAU;AAAA,IAC/B,8BAA8B,kBAAAA,QAAU;AAAA,IACxC,oBAAoB,kBAAAA,QAAU;AAAA,IAC9B,gCAAgC,kBAAAA,QAAU;AAAA,IAC1C,0BAA0B,kBAAAA,QAAU;AAAA,IACpC,wBAAwB,kBAAAA,QAAU;AAAA,IAClC,mBAAmB,kBAAAA,QAAU;AAAA,IAC7B,gBAAgB,kBAAAA,QAAU;AAAA,EAC5B,CAAC;AAAA;AAAA,EAED,kBAAkB;AAAA,EAClB,oBAAoB;AAAA;AAAA,EAEpB,cAAc,MAAM;AAAA,EACpB,gBAAgB,MAAM;AAAA,EACtB,kBAAkB,MAAM;AAAA,EACxB,gBAAgB;AAClB;",
|
|
6
6
|
"names": ["React", "moment", "PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerDay/DatePickerDay.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Day = ({ className = 'date-picker-content-day', date = '' }) => (\n <div className={className} data-testid={`datepicker-day-${date}`}>\n <div className={`${className}-half`} data-testid=\"datepicker-day\">\n {date}\n </div>\n </div>\n);\nDay.propTypes = {\n className: PropTypes.string,\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nexport { Day as DatePickerDay };\nexport default Day;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKnB;AAJJ,wBAAsB;AAEtB,MAAM,MAAM,CAAC,EAAE,YAAY,2BAA2B,OAAO,GAAG,MAC9D,4CAAC,SAAI,WAAsB,eAAa,kBAAkB,QACxD,sDAAC,SAAI,WAAW,GAAG,kBAAkB,eAAY,kBAC9C,gBACH,GACF;AAEF,IAAI,YAAY;AAAA,EACd,WAAW,kBAAAA,QAAU;AAAA,EACrB,MAAM,kBAAAA,QAAU,UAAU,CAAC,kBAAAA,QAAU,QAAQ,kBAAAA,QAAU,MAAM,CAAC;AAChE;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": ["PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -33,7 +37,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
33
37
|
var import_prop_types = __toESM(require("prop-types"));
|
|
34
38
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
35
39
|
var import_ds_popper = require("@elliemae/ds-popper");
|
|
36
|
-
var import_DatePickerPicker = require("./DatePickerPicker/DatePickerPicker");
|
|
40
|
+
var import_DatePickerPicker = require("./DatePickerPicker/DatePickerPicker.js");
|
|
37
41
|
const { classNameElement } = (0, import_ds_classnames.convertPropToCssClassName)("datepicker-range");
|
|
38
42
|
const noop = () => null;
|
|
39
43
|
const DatePickerDropdown = ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DatePickerDropdown.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSPopper } from '@elliemae/ds-popper';\nimport { DatePickerPicker, PickerPropsTypes } from './DatePickerPicker/DatePickerPicker';\nconst { classNameElement } = convertPropToCssClassName('datepicker-range');\n\nconst noop = () => null;\nconst DatePickerDropdown = ({\n disabled = false,\n readOnly,\n onClick = noop,\n isOpen,\n menu,\n zIndex = 1,\n pickerProps,\n pickerRef,\n}) => (\n <DSPopper\n contentComponent={menu}\n isOpen={isOpen}\n modifiers={{\n preventOverflow: {\n enabled: true,\n padding: 0,\n boundariesElement: 'window',\n },\n }}\n showArrow={false}\n triggerComponent={\n <div>\n <DatePickerPicker\n innerRef={pickerRef}\n {...pickerProps}\n className={classNameElement('picker')}\n disabled={disabled}\n onClick={onClick}\n readOnly={readOnly}\n />\n </div>\n }\n zIndex={zIndex}\n />\n);\n\nDatePickerDropdown.propTypes = {\n pickerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n isOpen: PropTypes.bool,\n menu: PropTypes.element,\n zIndex: PropTypes.number,\n pickerProps: PropTypes.shape(PickerPropsTypes),\n};\n\nexport { DatePickerDropdown };\nexport default DatePickerDropdown;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSPopper } from '@elliemae/ds-popper';\nimport { DatePickerPicker, PickerPropsTypes } from './DatePickerPicker/DatePickerPicker.js';\nconst { classNameElement } = convertPropToCssClassName('datepicker-range');\n\nconst noop = () => null;\nconst DatePickerDropdown = ({\n disabled = false,\n readOnly,\n onClick = noop,\n isOpen,\n menu,\n zIndex = 1,\n pickerProps,\n pickerRef,\n}) => (\n <DSPopper\n contentComponent={menu}\n isOpen={isOpen}\n modifiers={{\n preventOverflow: {\n enabled: true,\n padding: 0,\n boundariesElement: 'window',\n },\n }}\n showArrow={false}\n triggerComponent={\n <div>\n <DatePickerPicker\n innerRef={pickerRef}\n {...pickerProps}\n className={classNameElement('picker')}\n disabled={disabled}\n onClick={onClick}\n readOnly={readOnly}\n />\n </div>\n }\n zIndex={zIndex}\n />\n);\n\nDatePickerDropdown.propTypes = {\n pickerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool,\n onClick: PropTypes.func,\n isOpen: PropTypes.bool,\n menu: PropTypes.element,\n zIndex: PropTypes.number,\n pickerProps: PropTypes.shape(PickerPropsTypes),\n};\n\nexport { DatePickerDropdown };\nexport default DatePickerDropdown;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+Bf;AA9BR,wBAAsB;AACtB,2BAA0C;AAC1C,uBAAyB;AACzB,8BAAmD;AACnD,MAAM,EAAE,iBAAiB,QAAI,gDAA0B,kBAAkB;AAEzE,MAAM,OAAO,MAAM;AACnB,MAAM,qBAAqB,CAAC;AAAA,EAC1B,WAAW;AAAA,EACX;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,kBAAkB;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB;AAAA,QACf,SAAS;AAAA,QACT,SAAS;AAAA,QACT,mBAAmB;AAAA,MACrB;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX,kBACE,4CAAC,SACC;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACT,GAAG;AAAA,QACJ,WAAW,iBAAiB,QAAQ;AAAA,QACpC;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF,GACF;AAAA,IAEF;AAAA;AACF;AAGF,mBAAmB,YAAY;AAAA,EAC7B,WAAW,kBAAAA,QAAU,UAAU,CAAC,kBAAAA,QAAU,MAAM,kBAAAA,QAAU,MAAM,EAAE,SAAS,kBAAAA,QAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC5F,UAAU,kBAAAA,QAAU;AAAA,EACpB,UAAU,kBAAAA,QAAU;AAAA,EACpB,SAAS,kBAAAA,QAAU;AAAA,EACnB,QAAQ,kBAAAA,QAAU;AAAA,EAClB,MAAM,kBAAAA,QAAU;AAAA,EAChB,QAAQ,kBAAAA,QAAU;AAAA,EAClB,aAAa,kBAAAA,QAAU,MAAM,wCAAgB;AAC/C;AAGA,IAAO,6BAAQ;",
|
|
6
6
|
"names": ["PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerHeader/DatePickerHeader.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-console */\nimport React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport { DSDateInputV2, DSInputGroup } from '@elliemae/ds-form';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst DATE_FORMAT = 'MMDDYYYY';\nconst blockname = 'date-picker-header';\nconst Header = aggregatedClasses('div')(blockname);\n\nconst isFn = (variable) => typeof variable === 'function';\n\nconst DatePickerHeader = ({ onInputChange = () => null, selectedDate, updateKeyDate }) => {\n const [value, setValue] = useState(isFn(selectedDate?.format) ? selectedDate.format(DATE_FORMAT) : '');\n\n useEffect(() => {\n if (isFn(selectedDate?.format)) {\n setValue(selectedDate?.format(DATE_FORMAT));\n }\n }, [selectedDate]);\n\n const handleOnChange = (newDate) => {\n setValue(newDate);\n };\n\n const handleOnKeyDown = (e) => {\n if (e.key === 'Enter' && value.length === DATE_FORMAT.length) {\n const momentValue = moment(value, DATE_FORMAT);\n onInputChange(momentValue);\n updateKeyDate(momentValue);\n }\n };\n\n return (\n <Header>\n <DSInputGroup>\n <DSDateInputV2\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n value={value}\n containerProps={{ 'data-testid': 'start-date' }}\n />\n </DSInputGroup>\n </Header>\n );\n};\n\nDatePickerHeader.propTypes = {\n onInputChange: PropTypes.func,\n selectedDate: PropTypes.any,\n updateKeyDate: PropTypes.any,\n};\n\nexport { DatePickerHeader };\nexport default DatePickerHeader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
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ment", "PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerNavigation/DatePickerNavigation.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { ChevronRight } from '@elliemae/ds-icons';\nimport { DSIconColors, DSIconSizes } from '@elliemae/ds-icon';\nimport { iconSizes, iconColors } from '@elliemae/ds-shared';\n\nconst Navigation = ({\n className = 'date-picker-navigation',\n icon: Icon = ChevronRight,\n color = DSIconColors.NEUTRAL,\n size = DSIconSizes.S,\n innerRef,\n}) => (\n <div tabIndex={0} data-testid=\"date-picker-nav\">\n <Icon className={className} color={color} innerRef={innerRef} size={size} />\n </div>\n);\nNavigation.propTypes = {\n className: 'date-picker-navigation',\n icon: PropTypes.element,\n color: PropTypes.oneOf(iconColors),\n size: PropTypes.oneOf(iconSizes),\n innerRef: PropTypes.any,\n};\n\nexport { Navigation as DatePickerNavigation };\nexport default Navigation;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcnB;AAbJ,wBAAsB;AACtB,sBAA6B;AAC7B,qBAA0C;AAC1C,uBAAsC;AAEtC,MAAM,aAAa,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,MAAM,OAAO;AAAA,EACb,QAAQ,4BAAa;AAAA,EACrB,OAAO,2BAAY;AAAA,EACnB;AACF,MACE,4CAAC,SAAI,UAAU,GAAG,eAAY,mBAC5B,sDAAC,QAAK,WAAsB,OAAc,UAAoB,MAAY,GAC5E;AAEF,WAAW,YAAY;AAAA,EACrB,WAAW;AAAA,EACX,MAAM,kBAAAA,QAAU;AAAA,EAChB,OAAO,kBAAAA,QAAU,MAAM,2BAAU;AAAA,EACjC,MAAM,kBAAAA,QAAU,MAAM,0BAAS;AAAA,EAC/B,UAAU,kBAAAA,QAAU;AACtB;AAGA,IAAO,+BAAQ;",
|
|
6
6
|
"names": ["PropTypes"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerPicker/DatePickerPicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSIconColors, DSIconSizes } from '@elliemae/ds-icon';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { DSButton, buttonTypes } from '@elliemae/ds-button';\nimport { iconSizes } from '@elliemae/ds-shared';\n\nexport const Picker = ({\n className = 'date-picker-icon',\n disabled = false,\n icon = <DatePicker />,\n size = DSIconSizes.M,\n buttonActionType = 'secondary',\n onClick = () => null,\n onBlur = () => null,\n readOnly = false,\n tabIndex = 0,\n innerRef,\n ...rest\n}) => (\n <DSButton\n innerRef={innerRef}\n aria-label={rest['aria-label'] || 'Date Picker Button'}\n buttonType={buttonActionType}\n className={className}\n color={!disabled ? DSIconColors.PRIMARY : DSIconColors.NEUTRAL}\n disabled={disabled}\n icon={icon}\n onBlur={onBlur}\n onClick={onClick}\n readOnly={readOnly}\n size={size}\n tabIndex={tabIndex}\n data-testid=\"btn-date-picker\"\n />\n);\n\nexport const PickerPropsTypes = {\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n icon: PropTypes.element,\n size: PropTypes.oneOf(iconSizes),\n buttonActionType: PropTypes.oneOf(buttonTypes),\n onClick: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n readOnly: PropTypes.bool,\n tabIndex: PropTypes.number,\n};\n\nPicker.propTypes = PickerPropsTypes;\n\nexport { Picker as DatePickerPicker };\nexport default Picker;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUd;AATT,8BAA0B;AAC1B,qBAA0C;AAC1C,sBAA2B;AAC3B,uBAAsC;AACtC,uBAA0B;AAEnB,MAAM,SAAS,CAAC;AAAA,EACrB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO,4CAAC,8BAAW;AAAA,EACnB,OAAO,2BAAY;AAAA,EACnB,mBAAmB;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,cAAY,KAAK,YAAY,KAAK;AAAA,IAClC,YAAY;AAAA,IACZ;AAAA,IACA,OAAO,CAAC,WAAW,4BAAa,UAAU,4BAAa;AAAA,IACvD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAY;AAAA;AACd;AAGK,MAAM,mBAAmB;AAAA,EAC9B,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3F,WAAW,kCAAU;AAAA,EACrB,UAAU,kCAAU;AAAA,EACpB,MAAM,kCAAU;AAAA,EAChB,MAAM,kCAAU,MAAM,0BAAS;AAAA,EAC/B,kBAAkB,kCAAU,MAAM,4BAAW;AAAA,EAC7C,SAAS,kCAAU;AAAA,EACnB,SAAS,kCAAU;AAAA,EACnB,QAAQ,kCAAU;AAAA,EAClB,UAAU,kCAAU;AAAA,EACpB,UAAU,kCAAU;AACtB;AAEA,OAAO,YAAY;AAGnB,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -35,9 +39,9 @@ var import_react_dates = require("react-dates");
|
|
|
35
39
|
var import_moment = __toESM(require("moment"));
|
|
36
40
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
37
41
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
|
-
var import_DatePickerDay = require("../DatePickerDay/DatePickerDay");
|
|
39
|
-
var import_DatePickerNavigation = require("../DatePickerNavigation/DatePickerNavigation");
|
|
40
|
-
var import_DatePickerRangeHeader = require("../DatePickerRangeHeader/DatePickerRangeHeader");
|
|
42
|
+
var import_DatePickerDay = require("../DatePickerDay/DatePickerDay.js");
|
|
43
|
+
var import_DatePickerNavigation = require("../DatePickerNavigation/DatePickerNavigation.js");
|
|
44
|
+
var import_DatePickerRangeHeader = require("../DatePickerRangeHeader/DatePickerRangeHeader.js");
|
|
41
45
|
const blockname = "date-range";
|
|
42
46
|
const Wrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockname, "wrapper");
|
|
43
47
|
const { classNameElement, classNameBlock } = (0, import_ds_classnames.convertPropToCssClassName)("datepicker");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerRange/DatePickerRange.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable consistent-return */\nimport React, { useState, useRef } from 'react';\nimport { DayPickerRangeController } from 'react-dates';\nimport moment from 'moment';\nimport { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { DatePickerDay } from '../DatePickerDay/DatePickerDay';\nimport { DatePickerNavigation } from '../DatePickerNavigation/DatePickerNavigation';\nimport { DatePickerRangeHeader } from '../DatePickerRangeHeader/DatePickerRangeHeader';\n\nconst blockname = 'date-range';\nconst Wrapper = aggregatedClasses('div')(blockname, 'wrapper');\n\nconst { classNameElement, classNameBlock } = convertPropToCssClassName('datepicker');\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst DatePickerRangeDate = ({ dateStart, dateEnd, displayFormatDay = 'D', showHeader = true, otherProps }) => {\n const [selectedDateStart, setSelectedDateStart] = useState(dateStart);\n const [selectedDateEnd, setSelectedDateEnd] = useState(dateEnd);\n const [focusedInput, setFocusedInput] = useState(START_DATE);\n const datePickerRef = useRef();\n\n const handleFocusChange = () => {\n setFocusedInput(focusedInput === START_DATE ? END_DATE : START_DATE);\n };\n\n const handleDatesChange = ({ startDate, endDate }) => {\n setSelectedDateStart(startDate);\n setSelectedDateEnd(endDate);\n };\n\n const handleStartInputChange = (newDate) => {\n setSelectedDateStart(newDate);\n };\n\n const handleEndInputChange = (newDate) => {\n setSelectedDateEnd(newDate);\n };\n\n const getSafeDateStartValue = () => {\n if (selectedDateStart) {\n return moment(selectedDateStart);\n }\n };\n\n const getSafeDateEndValue = () => {\n if (selectedDateEnd) {\n return moment(selectedDateEnd);\n }\n };\n\n const safeStartDate = getSafeDateStartValue();\n const safeEndDate = getSafeDateEndValue();\n\n return (\n <Wrapper>\n {showHeader && (\n <DatePickerRangeHeader\n onEndInputChange={handleEndInputChange}\n onStartInputChange={handleStartInputChange}\n selectedEndDate={safeEndDate}\n selectedStartDate={safeStartDate}\n />\n )}\n <div ref={datePickerRef} className={classNameBlock('wrapper-day-picker-single-date-controller')}>\n <DayPickerRangeController\n {...otherProps}\n enableOutsideDays\n endDate={safeEndDate}\n focused\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={classNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={classNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={handleDatesChange}\n onFocusChange={handleFocusChange}\n renderDayContents={(date) => (\n <DatePickerDay className={classNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={safeStartDate}\n />\n </div>\n </Wrapper>\n );\n};\n\nexport { DatePickerRangeDate };\nexport default DatePickerRangeDate;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable consistent-return */\nimport React, { useState, useRef } from 'react';\nimport { DayPickerRangeController } from 'react-dates';\nimport moment from 'moment';\nimport { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { DatePickerDay } from '../DatePickerDay/DatePickerDay.js';\nimport { DatePickerNavigation } from '../DatePickerNavigation/DatePickerNavigation.js';\nimport { DatePickerRangeHeader } from '../DatePickerRangeHeader/DatePickerRangeHeader.js';\n\nconst blockname = 'date-range';\nconst Wrapper = aggregatedClasses('div')(blockname, 'wrapper');\n\nconst { classNameElement, classNameBlock } = convertPropToCssClassName('datepicker');\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst DatePickerRangeDate = ({ dateStart, dateEnd, displayFormatDay = 'D', showHeader = true, otherProps }) => {\n const [selectedDateStart, setSelectedDateStart] = useState(dateStart);\n const [selectedDateEnd, setSelectedDateEnd] = useState(dateEnd);\n const [focusedInput, setFocusedInput] = useState(START_DATE);\n const datePickerRef = useRef();\n\n const handleFocusChange = () => {\n setFocusedInput(focusedInput === START_DATE ? END_DATE : START_DATE);\n };\n\n const handleDatesChange = ({ startDate, endDate }) => {\n setSelectedDateStart(startDate);\n setSelectedDateEnd(endDate);\n };\n\n const handleStartInputChange = (newDate) => {\n setSelectedDateStart(newDate);\n };\n\n const handleEndInputChange = (newDate) => {\n setSelectedDateEnd(newDate);\n };\n\n const getSafeDateStartValue = () => {\n if (selectedDateStart) {\n return moment(selectedDateStart);\n }\n };\n\n const getSafeDateEndValue = () => {\n if (selectedDateEnd) {\n return moment(selectedDateEnd);\n }\n };\n\n const safeStartDate = getSafeDateStartValue();\n const safeEndDate = getSafeDateEndValue();\n\n return (\n <Wrapper>\n {showHeader && (\n <DatePickerRangeHeader\n onEndInputChange={handleEndInputChange}\n onStartInputChange={handleStartInputChange}\n selectedEndDate={safeEndDate}\n selectedStartDate={safeStartDate}\n />\n )}\n <div ref={datePickerRef} className={classNameBlock('wrapper-day-picker-single-date-controller')}>\n <DayPickerRangeController\n {...otherProps}\n enableOutsideDays\n endDate={safeEndDate}\n focused\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={classNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={classNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={handleDatesChange}\n onFocusChange={handleFocusChange}\n renderDayContents={(date) => (\n <DatePickerDay className={classNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={safeStartDate}\n />\n </div>\n </Wrapper>\n );\n};\n\nexport { DatePickerRangeDate };\nexport default DatePickerRangeDate;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0DnB;AAxDJ,mBAAwC;AACxC,yBAAyC;AACzC,oBAAmB;AACnB,2BAA6D;AAC7D,sBAA4B;AAC5B,2BAA8B;AAC9B,kCAAqC;AACrC,mCAAsC;AAEtC,MAAM,YAAY;AAClB,MAAM,cAAU,wCAAkB,KAAK,EAAE,WAAW,SAAS;AAE7D,MAAM,EAAE,kBAAkB,eAAe,QAAI,gDAA0B,YAAY;AAEnF,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAM,sBAAsB,CAAC,EAAE,WAAW,SAAS,mBAAmB,KAAK,aAAa,MAAM,WAAW,MAAM;AAC7G,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAS,SAAS;AACpE,QAAM,CAAC,iBAAiB,kBAAkB,QAAI,uBAAS,OAAO;AAC9D,QAAM,CAAC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