@elliemae/ds-date-picker 3.1.0-next.0 → 3.1.0-next.3
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 +70 -70
- package/dist/cjs/DSDatePicker.js.map +2 -2
- package/dist/cjs/components/DatePickerPicker/DatePickerPicker.js +12 -12
- package/dist/cjs/components/DatePickerPicker/DatePickerPicker.js.map +2 -2
- package/dist/esm/DSDatePicker.js +1 -1
- package/dist/esm/DSDatePicker.js.map +1 -1
- package/dist/esm/components/DatePickerPicker/DatePickerPicker.js +1 -1
- package/dist/esm/components/DatePickerPicker/DatePickerPicker.js.map +1 -1
- package/package.json +21 -19
package/dist/cjs/DSDatePicker.js
CHANGED
|
@@ -56,7 +56,7 @@ __export(DSDatePicker_exports, {
|
|
|
56
56
|
module.exports = __toCommonJS(DSDatePicker_exports);
|
|
57
57
|
var React = __toESM(require("react"));
|
|
58
58
|
var import_react = __toESM(require("react"));
|
|
59
|
-
var
|
|
59
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
60
60
|
var import_initialize = require("react-dates/initialize");
|
|
61
61
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
62
62
|
var import_moment = __toESM(require("moment"));
|
|
@@ -161,82 +161,82 @@ const DSDatePicker = ({
|
|
|
161
161
|
}));
|
|
162
162
|
};
|
|
163
163
|
const datePickerProps = {
|
|
164
|
-
containerProps:
|
|
165
|
-
id:
|
|
166
|
-
appendToBody:
|
|
167
|
-
className:
|
|
168
|
-
date:
|
|
169
|
-
value:
|
|
170
|
-
placeholder:
|
|
171
|
-
autoClear:
|
|
172
|
-
disabled:
|
|
173
|
-
required:
|
|
174
|
-
readOnly:
|
|
175
|
-
hasError:
|
|
176
|
-
screenReaderInputMessage:
|
|
177
|
-
enableOutsideDays:
|
|
178
|
-
initialVisibleMonth:
|
|
179
|
-
firstDayOfWeek:
|
|
180
|
-
keepOpenOnDateSelect:
|
|
181
|
-
hideKeyboardShortcutsPanel:
|
|
182
|
-
onChange:
|
|
164
|
+
containerProps: import_ds_utilities.PropTypes.shape({}).description("Set of Properties attached to the main container"),
|
|
165
|
+
id: import_ds_utilities.PropTypes.string.description("components id"),
|
|
166
|
+
appendToBody: import_ds_utilities.PropTypes.bool.description("append component to body or not").defaultValue(true),
|
|
167
|
+
className: import_ds_utilities.PropTypes.string.description("html class attribute"),
|
|
168
|
+
date: import_ds_utilities.PropTypes.instanceOf(Date, import_moment.default).description("selected date").defaultValue(void 0),
|
|
169
|
+
value: import_ds_utilities.PropTypes.instanceOf(Date, import_moment.default).description("value"),
|
|
170
|
+
placeholder: import_ds_utilities.PropTypes.string.description("input placeholder value"),
|
|
171
|
+
autoClear: import_ds_utilities.PropTypes.bool.description("autoclears the input onblur if the date is not completely set").defaultValue(false),
|
|
172
|
+
disabled: import_ds_utilities.PropTypes.bool.description("disable component or not").defaultValue(false),
|
|
173
|
+
required: import_ds_utilities.PropTypes.bool.description("value is required or not").defaultValue(false),
|
|
174
|
+
readOnly: import_ds_utilities.PropTypes.bool.description("is read only or not").defaultValue(false),
|
|
175
|
+
hasError: import_ds_utilities.PropTypes.bool.description("set error state").defaultValue(false),
|
|
176
|
+
screenReaderInputMessage: import_ds_utilities.PropTypes.string.description("message to anounce by screen reader").defaultValue("select date"),
|
|
177
|
+
enableOutsideDays: import_ds_utilities.PropTypes.bool.description("enable days oustide month or not").defaultValue(true),
|
|
178
|
+
initialVisibleMonth: import_ds_utilities.PropTypes.instanceOf(Date, import_moment.default).description("initial month to display"),
|
|
179
|
+
firstDayOfWeek: import_ds_utilities.PropTypes.number.description("first day of week").defaultValue(0),
|
|
180
|
+
keepOpenOnDateSelect: import_ds_utilities.PropTypes.bool.description("keep picker open when a date is selected").defaultValue(false),
|
|
181
|
+
hideKeyboardShortcutsPanel: import_ds_utilities.PropTypes.bool.description("hide keyabord shortcut panel or not").defaultValue(true),
|
|
182
|
+
onChange: import_ds_utilities.PropTypes.func.description(`
|
|
183
183
|
function executed when input changes. This could trigger with invalid dates. It returns a string and a moment
|
|
184
184
|
if the date is valid.
|
|
185
185
|
`),
|
|
186
|
-
onDateChange:
|
|
187
|
-
onPrevMonthClick:
|
|
188
|
-
onNextMonthClick:
|
|
189
|
-
onBlur:
|
|
190
|
-
onClose:
|
|
191
|
-
onFocus:
|
|
192
|
-
phrases:
|
|
193
|
-
calendarLabel:
|
|
194
|
-
closeDatePicker:
|
|
195
|
-
clearDates:
|
|
196
|
-
focusStartDate:
|
|
197
|
-
jumpToPrevMonth:
|
|
198
|
-
jumpToNextMonth:
|
|
199
|
-
keyboardShortcuts:
|
|
200
|
-
showKeyboardShortcutsPanel:
|
|
201
|
-
hideKeyboardShortcutsPanel:
|
|
202
|
-
openThisPanel:
|
|
203
|
-
enterKey:
|
|
204
|
-
leftArrowRightArrow:
|
|
205
|
-
upArrowDownArrow:
|
|
206
|
-
pageUpPageDown:
|
|
207
|
-
homeEnd:
|
|
208
|
-
escape:
|
|
209
|
-
questionMark:
|
|
210
|
-
selectFocusedDate:
|
|
211
|
-
moveFocusByOneDay:
|
|
212
|
-
moveFocusByOneWeek:
|
|
213
|
-
moveFocusByOneMonth:
|
|
214
|
-
moveFocustoStartAndEndOfWeek:
|
|
215
|
-
returnFocusToInput:
|
|
216
|
-
keyboardNavigationInstructions:
|
|
217
|
-
chooseAvailableStartDate:
|
|
218
|
-
chooseAvailableEndDate:
|
|
219
|
-
dateIsUnavailable:
|
|
220
|
-
dateIsSelected:
|
|
186
|
+
onDateChange: import_ds_utilities.PropTypes.func.description("function executed when date changes. This doesnt trigger with invalid dates. It returns a moment object"),
|
|
187
|
+
onPrevMonthClick: import_ds_utilities.PropTypes.func.description("function executed when clicking on prev month button"),
|
|
188
|
+
onNextMonthClick: import_ds_utilities.PropTypes.func.description("function executed when clicking on next month button"),
|
|
189
|
+
onBlur: import_ds_utilities.PropTypes.func.description("function executed when component loses focus"),
|
|
190
|
+
onClose: import_ds_utilities.PropTypes.func.description("function executed when component closes"),
|
|
191
|
+
onFocus: import_ds_utilities.PropTypes.func.description("function executed when component gains focus"),
|
|
192
|
+
phrases: import_ds_utilities.PropTypes.shape({
|
|
193
|
+
calendarLabel: import_ds_utilities.PropTypes.string,
|
|
194
|
+
closeDatePicker: import_ds_utilities.PropTypes.string,
|
|
195
|
+
clearDates: import_ds_utilities.PropTypes.string,
|
|
196
|
+
focusStartDate: import_ds_utilities.PropTypes.string,
|
|
197
|
+
jumpToPrevMonth: import_ds_utilities.PropTypes.string,
|
|
198
|
+
jumpToNextMonth: import_ds_utilities.PropTypes.string,
|
|
199
|
+
keyboardShortcuts: import_ds_utilities.PropTypes.string,
|
|
200
|
+
showKeyboardShortcutsPanel: import_ds_utilities.PropTypes.string,
|
|
201
|
+
hideKeyboardShortcutsPanel: import_ds_utilities.PropTypes.string,
|
|
202
|
+
openThisPanel: import_ds_utilities.PropTypes.string,
|
|
203
|
+
enterKey: import_ds_utilities.PropTypes.string,
|
|
204
|
+
leftArrowRightArrow: import_ds_utilities.PropTypes.string,
|
|
205
|
+
upArrowDownArrow: import_ds_utilities.PropTypes.string,
|
|
206
|
+
pageUpPageDown: import_ds_utilities.PropTypes.string,
|
|
207
|
+
homeEnd: import_ds_utilities.PropTypes.string,
|
|
208
|
+
escape: import_ds_utilities.PropTypes.string,
|
|
209
|
+
questionMark: import_ds_utilities.PropTypes.string,
|
|
210
|
+
selectFocusedDate: import_ds_utilities.PropTypes.string,
|
|
211
|
+
moveFocusByOneDay: import_ds_utilities.PropTypes.string,
|
|
212
|
+
moveFocusByOneWeek: import_ds_utilities.PropTypes.string,
|
|
213
|
+
moveFocusByOneMonth: import_ds_utilities.PropTypes.string,
|
|
214
|
+
moveFocustoStartAndEndOfWeek: import_ds_utilities.PropTypes.string,
|
|
215
|
+
returnFocusToInput: import_ds_utilities.PropTypes.string,
|
|
216
|
+
keyboardNavigationInstructions: import_ds_utilities.PropTypes.string,
|
|
217
|
+
chooseAvailableStartDate: import_ds_utilities.PropTypes.func,
|
|
218
|
+
chooseAvailableEndDate: import_ds_utilities.PropTypes.func,
|
|
219
|
+
dateIsUnavailable: import_ds_utilities.PropTypes.func,
|
|
220
|
+
dateIsSelected: import_ds_utilities.PropTypes.func
|
|
221
221
|
}).description("react-dates phrases").defaultValue(import_defaultPhrases.SingleDatePickerPhrases),
|
|
222
|
-
displayFormat:
|
|
223
|
-
displayFormatDay:
|
|
224
|
-
transitionDuration:
|
|
225
|
-
verticalSpacing:
|
|
226
|
-
isDayBlocked:
|
|
227
|
-
isOutsideRange:
|
|
228
|
-
isDayHighlighted:
|
|
229
|
-
numberOfMonths:
|
|
230
|
-
openDirection:
|
|
231
|
-
tabIndex:
|
|
232
|
-
zIndex:
|
|
233
|
-
pickerProps:
|
|
234
|
-
calendarProps:
|
|
235
|
-
focusCurrentDate:
|
|
222
|
+
displayFormat: import_ds_utilities.PropTypes.string.description("display format").defaultValue("L"),
|
|
223
|
+
displayFormatDay: import_ds_utilities.PropTypes.string.description("display format day").defaultValue("D"),
|
|
224
|
+
transitionDuration: import_ds_utilities.PropTypes.number.description("transition duration").defaultValue(0),
|
|
225
|
+
verticalSpacing: import_ds_utilities.PropTypes.number.description("vertical spacing"),
|
|
226
|
+
isDayBlocked: import_ds_utilities.PropTypes.func.description("function that returns each day and disables desired dates"),
|
|
227
|
+
isOutsideRange: import_ds_utilities.PropTypes.func.description("function that returns each day and disables outisde range dates"),
|
|
228
|
+
isDayHighlighted: import_ds_utilities.PropTypes.func.description("function that returns each day and higlights desired dates"),
|
|
229
|
+
numberOfMonths: import_ds_utilities.PropTypes.number.description("amount of months"),
|
|
230
|
+
openDirection: import_ds_utilities.PropTypes.string.description("open direction of the popup").defaultValue("down"),
|
|
231
|
+
tabIndex: import_ds_utilities.PropTypes.number.description("overrides tab index of the element"),
|
|
232
|
+
zIndex: import_ds_utilities.PropTypes.string.description("overrides z-index of the element"),
|
|
233
|
+
pickerProps: import_ds_utilities.PropTypes.shape(import_DatePickerPicker.PickerPropsTypes).description("props to be passed to the picker container"),
|
|
234
|
+
calendarProps: import_ds_utilities.PropTypes.shape({ tabIndex: import_ds_utilities.PropTypes.number }).description("props to be passes to the calendar container"),
|
|
235
|
+
focusCurrentDate: import_ds_utilities.PropTypes.bool.description("Wheter to focus current date on calendar").defaultValue(false)
|
|
236
236
|
};
|
|
237
237
|
DSDatePicker.propTypes = datePickerProps;
|
|
238
238
|
DSDatePicker.displayName = "DSDatePicker";
|
|
239
|
-
const DatePickerWithSchema = (0,
|
|
239
|
+
const DatePickerWithSchema = (0, import_ds_utilities.describe)(DSDatePicker);
|
|
240
240
|
DatePickerWithSchema.propTypes = datePickerProps;
|
|
241
241
|
var DSDatePicker_default = DSDatePicker;
|
|
242
242
|
//# sourceMappingURL=DSDatePicker.js.map
|
|
@@ -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 { PropTypes, describe } from 'react-desc';\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 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;ADCvB,mBAAkB;AAClB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\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 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;ADCvB,mBAAkB;AAClB,0BAAoC;AACpC,wBAAO;AACP,2BAA0C;AAC1C,oBAAmB;AACnB,4BAAwC;AACxC,wBAWO;AACP,8BAAiC;AACjC,kCAAuC;AACvC,8BAAyC;AA8CzC,MAAM,eAAiC,CAAC;AAAA,EACtC,iBAAiB,CAAC;AAAA,EAClB,KAAK;AAAA,EACL,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX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__toESM(require("react"));
|
|
44
44
|
var import_react = __toESM(require("react"));
|
|
45
|
-
var
|
|
45
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
46
46
|
var import_ds_icon = require("@elliemae/ds-icon");
|
|
47
47
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
48
48
|
var import_ds_button = require("@elliemae/ds-button");
|
|
@@ -88,17 +88,17 @@ const Picker = (_a) => {
|
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
90
|
const PickerPropsTypes = {
|
|
91
|
-
innerRef:
|
|
92
|
-
className:
|
|
93
|
-
disabled:
|
|
94
|
-
icon:
|
|
95
|
-
size:
|
|
96
|
-
buttonActionType:
|
|
97
|
-
onClick:
|
|
98
|
-
onFocus:
|
|
99
|
-
onBlur:
|
|
100
|
-
readOnly:
|
|
101
|
-
tabIndex:
|
|
91
|
+
innerRef: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.func, import_ds_utilities.PropTypes.shape({ current: import_ds_utilities.PropTypes.any })]),
|
|
92
|
+
className: import_ds_utilities.PropTypes.string,
|
|
93
|
+
disabled: import_ds_utilities.PropTypes.bool,
|
|
94
|
+
icon: import_ds_utilities.PropTypes.element,
|
|
95
|
+
size: import_ds_utilities.PropTypes.oneOf(import_ds_shared.iconSizes),
|
|
96
|
+
buttonActionType: import_ds_utilities.PropTypes.oneOf(import_ds_button.buttonTypes),
|
|
97
|
+
onClick: import_ds_utilities.PropTypes.func,
|
|
98
|
+
onFocus: import_ds_utilities.PropTypes.func,
|
|
99
|
+
onBlur: import_ds_utilities.PropTypes.func,
|
|
100
|
+
readOnly: import_ds_utilities.PropTypes.bool,
|
|
101
|
+
tabIndex: import_ds_utilities.PropTypes.number
|
|
102
102
|
};
|
|
103
103
|
Picker.propTypes = PickerPropsTypes;
|
|
104
104
|
var DatePickerPicker_default = Picker;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/DatePickerPicker/DatePickerPicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport PropTypes from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\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 {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AA,EAClB,UAAU,8BAAU;AAAA,EACpB,UAAU,8BAAU;AACtB;AAEA,OAAO,YAAY;AAGnB,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSDatePicker.js
CHANGED
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import React2 from "react";
|
|
22
|
-
import { PropTypes, describe } from "
|
|
22
|
+
import { PropTypes, describe } from "@elliemae/ds-utilities";
|
|
23
23
|
import "react-dates/initialize";
|
|
24
24
|
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
25
25
|
import moment from "moment";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDatePicker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\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 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"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\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 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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AACA;AACA;AA8CA,MAAM,eAAiC,CAAC;AAAA,EACtC,iBAAiB,CAAC;AAAA,EAClB,KAAK;AAAA,EACL,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,2BAA2B;AAAA,EAC3B,oBAAoB;AAAA,EACpB,sBAAsB,OAAO;AAAA,EAC7B,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,6BAA6B;AAAA,EAC7B,WAAW,MAAM;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB,MAAM;AAAA,EACzB,mBAAmB,MAAM;AAAA,EACzB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,E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BAAgB,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAC5G,kBAAkB,UAAU,KAAK,YAAY,4DAA4D;AAAA,EACzG,gBAAgB,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAC/D,eAAe,UAAU,OAAO,YAAY,6BAA6B,EAAE,aAAa,MAAM;AAAA,EAC9F,UAAU,UAAU,OAAO,YAAY,oCAAoC;AAAA,EAC3E,QAAQ,UAAU,OAAO,YAAY,kCAAkC;AAAA,EACvE,aAAa,UAAU,MAAM,gBAAgB,EAAE,YAAY,4CAA4C;AAAA,EACvG,eAAe,UAAU,MAAM,EAAE,UAAU,UAAU,OAAO,CAAC,EAAE,YAC7D,8CACF;AAAA,EACA,kBAAkB,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAC7G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,uBAAuB,SAAS,YAAY;AAClD,qBAAqB,YAAY;AAmBjC,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ var __objRest = (source, exclude) => {
|
|
|
15
15
|
};
|
|
16
16
|
import * as React from "react";
|
|
17
17
|
import React2 from "react";
|
|
18
|
-
import PropTypes from "
|
|
18
|
+
import { PropTypes } from "@elliemae/ds-utilities";
|
|
19
19
|
import { DSIconColors, DSIconSizes } from "@elliemae/ds-icon";
|
|
20
20
|
import { DatePicker } from "@elliemae/ds-icons";
|
|
21
21
|
import { DSButton, buttonTypes } from "@elliemae/ds-button";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/DatePickerPicker/DatePickerPicker.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from '
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes } from '@elliemae/ds-utilities';\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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,SAAS,CAAC,OAYpB;AAZoB,eACrB;AAAA,gBAAY;AAAA,IACZ,WAAW;AAAA,IACX,OAAO,qCAAC,gBAAW;AAAA,IACnB,OAAO,YAAY;AAAA,IACnB,mBAAmB;AAAA,IACnB,UAAU,MAAM;AAAA,IAChB,SAAS,MAAM;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,MAVqB,IAWlB,iBAXkB,IAWlB;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,8CAAC;AAAA,IACC;AAAA,IACA,cAAY,KAAK,iBAAiB;AAAA,IAClC,YAAY;AAAA,IACZ;AAAA,IACA,OAAO,CAAC,WAAW,aAAa,UAAU,aAAa;AAAA,IACvD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAY;AAAA,GACd;AAAA;AAGK,MAAM,mBAAmB;AAAA,EAC9B,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3F,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA,EAChB,MAAM,UAAU,MAAM,SAAS;AAAA,EAC/B,kBAAkB,UAAU,MAAM,WAAW;AAAA,EAC7C,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AACtB;AAEA,OAAO,YAAY;AAGnB,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-picker",
|
|
3
|
-
"version": "3.1.0-next.
|
|
3
|
+
"version": "3.1.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Picker",
|
|
6
6
|
"files": [
|
|
@@ -94,26 +94,20 @@
|
|
|
94
94
|
"reportFile": "tests.xml",
|
|
95
95
|
"indent": 4
|
|
96
96
|
},
|
|
97
|
-
"scripts": {
|
|
98
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
99
|
-
"test": "node ../../scripts/testing/test.mjs",
|
|
100
|
-
"lint": "node ../../scripts/lint.mjs",
|
|
101
|
-
"dts": "node ../../scripts/dts.mjs",
|
|
102
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
103
|
-
},
|
|
104
97
|
"dependencies": {
|
|
105
|
-
"@elliemae/ds-button": "3.1.0-next.
|
|
106
|
-
"@elliemae/ds-classnames": "3.1.0-next.
|
|
107
|
-
"@elliemae/ds-form": "3.1.0-next.
|
|
108
|
-
"@elliemae/ds-grid": "3.1.0-next.
|
|
109
|
-
"@elliemae/ds-
|
|
110
|
-
"@elliemae/ds-
|
|
111
|
-
"@elliemae/ds-
|
|
112
|
-
"@elliemae/ds-
|
|
98
|
+
"@elliemae/ds-button": "3.1.0-next.3",
|
|
99
|
+
"@elliemae/ds-classnames": "3.1.0-next.3",
|
|
100
|
+
"@elliemae/ds-form": "3.1.0-next.3",
|
|
101
|
+
"@elliemae/ds-grid": "3.1.0-next.3",
|
|
102
|
+
"@elliemae/ds-icon": "3.1.0-next.3",
|
|
103
|
+
"@elliemae/ds-icons": "3.1.0-next.3",
|
|
104
|
+
"@elliemae/ds-popper": "3.1.0-next.3",
|
|
105
|
+
"@elliemae/ds-shared": "3.1.0-next.3",
|
|
106
|
+
"@elliemae/ds-system": "3.1.0-next.3",
|
|
107
|
+
"@elliemae/ds-utilities": "3.1.0-next.3",
|
|
113
108
|
"moment": "~2.29.1",
|
|
114
109
|
"prop-types": "~15.8.1",
|
|
115
|
-
"react-dates": "~21.8.0"
|
|
116
|
-
"react-desc": "~4.1.3"
|
|
110
|
+
"react-dates": "~21.8.0"
|
|
117
111
|
},
|
|
118
112
|
"devDependencies": {
|
|
119
113
|
"@testing-library/jest-dom": "~5.16.2",
|
|
@@ -127,5 +121,13 @@
|
|
|
127
121
|
"publishConfig": {
|
|
128
122
|
"access": "public",
|
|
129
123
|
"typeSafety": false
|
|
124
|
+
},
|
|
125
|
+
"scripts": {
|
|
126
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
127
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
128
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
129
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
130
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
131
|
+
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
130
132
|
}
|
|
131
|
-
}
|
|
133
|
+
}
|