@elliemae/ds-date-range-selector 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSDateRangeSelector.js +7 -3
- package/dist/cjs/DSDateRangeSelector.js.map +2 -2
- package/dist/cjs/components/CustomOptionRender/CustomOptionRender.js +4 -0
- package/dist/cjs/components/CustomOptionRender/CustomOptionRender.js.map +1 -1
- package/dist/cjs/components/DateRangeSelectorImpl.js +6 -2
- package/dist/cjs/components/DateRangeSelectorImpl.js.map +2 -2
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/options/dropdownPreselectedOptions.js +4 -0
- package/dist/cjs/options/dropdownPreselectedOptions.js.map +1 -1
- package/dist/cjs/package.json +7 -0
- package/dist/esm/DSDateRangeSelector.js +3 -3
- package/dist/esm/DSDateRangeSelector.js.map +1 -1
- package/dist/esm/components/DateRangeSelectorImpl.js +2 -2
- package/dist/esm/components/DateRangeSelectorImpl.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/package.json +11 -11
- package/dist/types/DSDateRangeSelector.d.ts +0 -64
- package/dist/types/components/CustomOptionRender/CustomOptionRender.d.ts +0 -17
- package/dist/types/components/DateRangeSelectorImpl.d.ts +0 -17
- package/dist/types/index.d.ts +0 -2
- package/dist/types/options/dropdownPreselectedOptions.d.ts +0 -13
|
@@ -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
|
));
|
|
@@ -37,9 +41,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
41
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
38
42
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
43
|
var import_moment = __toESM(require("moment"));
|
|
40
|
-
var import_DateRangeSelectorImpl = __toESM(require("./components/DateRangeSelectorImpl"));
|
|
41
|
-
var import_dropdownPreselectedOptions = require("./options/dropdownPreselectedOptions");
|
|
42
|
-
var import_CustomOptionRender = __toESM(require("./components/CustomOptionRender/CustomOptionRender"));
|
|
44
|
+
var import_DateRangeSelectorImpl = __toESM(require("./components/DateRangeSelectorImpl.js"));
|
|
45
|
+
var import_dropdownPreselectedOptions = require("./options/dropdownPreselectedOptions.js");
|
|
46
|
+
var import_CustomOptionRender = __toESM(require("./components/CustomOptionRender/CustomOptionRender.js"));
|
|
43
47
|
const DSDateRangeSelector = ({
|
|
44
48
|
containerProps = {},
|
|
45
49
|
className = "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDateRangeSelector.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport moment from 'moment';\nimport DateRangeSelectorImpl from './components/DateRangeSelectorImpl';\nimport {\n DropdownOptionsTypes,\n dropdownPreselectedOptions,\n CUSTOM_OPTION_VALUE,\n} from './options/dropdownPreselectedOptions';\nimport CustomOptionRender from './components/CustomOptionRender/CustomOptionRender';\n\nconst DSDateRangeSelector = ({\n containerProps = {},\n className = '',\n preselectedOptions = dropdownPreselectedOptions,\n onChange = () => null,\n placeholder = 'Select Range',\n value = null,\n customOptionRender = CustomOptionRender,\n startDate = null,\n endDate = null,\n displayFormatDay = 'D',\n disableCustomOption = false,\n hasError = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-range-selector', version: 'TBD Date: 2023 Q1' });\n\n return (\n <DateRangeSelectorImpl\n className={className}\n containerProps={containerProps}\n customOptionRender={customOptionRender}\n disableCustomOption={disableCustomOption}\n displayFormatDay={displayFormatDay}\n dropdownPreselectedOptions={preselectedOptions}\n endDate={endDate}\n onChange={onChange}\n placeholder={placeholder}\n startDate={startDate}\n value={value}\n hasError={hasError}\n />\n );\n};\n\nexport { CUSTOM_OPTION_VALUE, dropdownPreselectedOptions, DropdownOptionsTypes };\n\nconst dateRangeRecurrenceSelectorProps = {\n containerProps: PropTypes.object.description('Set of properties attached to the main container'),\n className: PropTypes.string.description('html class attribute'),\n preselectedOptions: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n ).description('options to display in dropdown menu'),\n onChange: PropTypes.func.description('function executed when selection changes'),\n placeholder: PropTypes.string.description('inputs placeholder').defaultValue('Select Range'),\n value: PropTypes.oneOf([PropTypes.string, PropTypes.number]).description('selected value'),\n customOptionRender: PropTypes.element.description('custom renderer for options'),\n startDate: PropTypes.instanceOf(Date, moment).description('moment object of start date'),\n endDate: PropTypes.instanceOf(Date, moment).description('moment object of end date'),\n displayFormatDay: PropTypes.string.description('format to display date').defaultValue('D'),\n disableCustomOption: PropTypes.bool.description('disables custom options').defaultValue(false),\n};\n\nDSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;\nDSDateRangeSelector.displayName = 'DSDateRangeSelector';\nconst DateRangeRecurrenceSelectorWithSchema = describe(DSDateRangeSelector);\nDateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;\n\nexport { DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector };\nexport default DSDateRangeSelector;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport moment from 'moment';\nimport DateRangeSelectorImpl from './components/DateRangeSelectorImpl.js';\nimport {\n DropdownOptionsTypes,\n dropdownPreselectedOptions,\n CUSTOM_OPTION_VALUE,\n} from './options/dropdownPreselectedOptions.js';\nimport CustomOptionRender from './components/CustomOptionRender/CustomOptionRender.js';\n\nconst DSDateRangeSelector = ({\n containerProps = {},\n className = '',\n preselectedOptions = dropdownPreselectedOptions,\n onChange = () => null,\n placeholder = 'Select Range',\n value = null,\n customOptionRender = CustomOptionRender,\n startDate = null,\n endDate = null,\n displayFormatDay = 'D',\n disableCustomOption = false,\n hasError = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-range-selector', version: 'TBD Date: 2023 Q1' });\n\n return (\n <DateRangeSelectorImpl\n className={className}\n containerProps={containerProps}\n customOptionRender={customOptionRender}\n disableCustomOption={disableCustomOption}\n displayFormatDay={displayFormatDay}\n dropdownPreselectedOptions={preselectedOptions}\n endDate={endDate}\n onChange={onChange}\n placeholder={placeholder}\n startDate={startDate}\n value={value}\n hasError={hasError}\n />\n );\n};\n\nexport { CUSTOM_OPTION_VALUE, dropdownPreselectedOptions, DropdownOptionsTypes };\n\nconst dateRangeRecurrenceSelectorProps = {\n containerProps: PropTypes.object.description('Set of properties attached to the main container'),\n className: PropTypes.string.description('html class attribute'),\n preselectedOptions: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n ).description('options to display in dropdown menu'),\n onChange: PropTypes.func.description('function executed when selection changes'),\n placeholder: PropTypes.string.description('inputs placeholder').defaultValue('Select Range'),\n value: PropTypes.oneOf([PropTypes.string, PropTypes.number]).description('selected value'),\n customOptionRender: PropTypes.element.description('custom renderer for options'),\n startDate: PropTypes.instanceOf(Date, moment).description('moment object of start date'),\n endDate: PropTypes.instanceOf(Date, moment).description('moment object of end date'),\n displayFormatDay: PropTypes.string.description('format to display date').defaultValue('D'),\n disableCustomOption: PropTypes.bool.description('disables custom options').defaultValue(false),\n};\n\nDSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;\nDSDateRangeSelector.displayName = 'DSDateRangeSelector';\nconst DateRangeRecurrenceSelectorWithSchema = describe(DSDateRangeSelector);\nDateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;\n\nexport { DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector };\nexport default DSDateRangeSelector;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BnB;AA5BJ,0BAAsC;AACtC,8BAAoC;AACpC,oBAAmB;AACnB,mCAAkC;AAClC,wCAIO;AACP,gCAA+B;AAE/B,MAAM,sBAAsB,CAAC;AAAA,EAC3B,iBAAiB,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,WAAW,MAAM;AAAA,EACjB,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,qBAAqB,0BAAAA;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,WAAW;AACb,MAAM;AACJ,iDAAsB,EAAE,eAAe,0BAA0B,SAAS,oBAAoB,CAAC;AAE/F,SACE;AAAA,IAAC,6BAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,4BAA4B;AAAA,MAC5B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAIA,MAAM,mCAAmC;AAAA,EACvC,gBAAgB,kCAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,kCAAU,OAAO,YAAY,sBAAsB;AAAA,EAC9D,oBAAoB,kCAAU;AAAA,IAC5B,kCAAU,MAAM;AAAA,MACd,OAAO,kCAAU;AAAA,MACjB,OAAO,kCAAU;AAAA,IACnB,CAAC;AAAA,EACH,EAAE,YAAY,qCAAqC;AAAA,EACnD,UAAU,kCAAU,KAAK,YAAY,0CAA0C;AAAA,EAC/E,aAAa,kCAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,cAAc;AAAA,EAC3F,OAAO,kCAAU,MAAM,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE,YAAY,gBAAgB;AAAA,EACzF,oBAAoB,kCAAU,QAAQ,YAAY,6BAA6B;AAAA,EAC/E,WAAW,kCAAU,WAAW,MAAM,cAAAC,OAAM,EAAE,YAAY,6BAA6B;AAAA,EACvF,SAAS,kCAAU,WAAW,MAAM,cAAAA,OAAM,EAAE,YAAY,2BAA2B;AAAA,EACnF,kBAAkB,kCAAU,OAAO,YAAY,wBAAwB,EAAE,aAAa,GAAG;AAAA,EACzF,qBAAqB,kCAAU,KAAK,YAAY,yBAAyB,EAAE,aAAa,KAAK;AAC/F;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,4CAAwC,kCAAS,mBAAmB;AAC1E,sCAAsC,YAAY;AAGlD,IAAO,8BAAQ;",
|
|
6
6
|
"names": ["CustomOptionRender", "DateRangeSelectorImpl", "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
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/CustomOptionRender/CustomOptionRender.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\n\nconst { cssClassName } = convertPropToCssClassName('date-range-selector-customoption');\n/**\n * @param root0\n * @param root0.customRange\n * @param root0.customRange.startDate\n * @param root0.customRange.endDate\n * @customRange {\nendDate\nstartDate\n}\n */\nconst CustomOptionRender = ({ customRange: { startDate, endDate } }) => {\n const start = startDate ? startDate.format('MM/DD/YYYY') : null;\n const end = endDate ? endDate.format('MM/DD/YYYY') : null;\n const display = `From ${start} to ${end}` || 'Custom';\n return <em className={cssClassName}>{display}</em>;\n};\n\nexport default CustomOptionRender;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBd;AAjBT,2BAA0C;AAE1C,MAAM,EAAE,aAAa,QAAI,gDAA0B,kCAAkC;AAWrF,MAAM,qBAAqB,CAAC,EAAE,aAAa,EAAE,WAAW,QAAQ,EAAE,MAAM;AACtE,QAAM,QAAQ,YAAY,UAAU,OAAO,YAAY,IAAI;AAC3D,QAAM,MAAM,UAAU,QAAQ,OAAO,YAAY,IAAI;AACrD,QAAM,UAAU,QAAQ,YAAY,SAAS;AAC7C,SAAO,4CAAC,QAAG,WAAW,cAAe,mBAAQ;AAC/C;AAEA,IAAO,6BAAQ;",
|
|
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
|
));
|
|
@@ -32,14 +36,14 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
32
36
|
var import_react = require("react");
|
|
33
37
|
var import_moment = __toESM(require("moment"));
|
|
34
38
|
var import_react_select = require("react-select");
|
|
35
|
-
var import_initialize = require("react-dates/initialize");
|
|
39
|
+
var import_initialize = require("react-dates/initialize.js");
|
|
36
40
|
var import_react_dates = require("react-dates");
|
|
37
41
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
38
42
|
var import_ds_form = require("@elliemae/ds-form");
|
|
39
43
|
var import_ds_popper = __toESM(require("@elliemae/ds-popper"));
|
|
40
44
|
var import_ds_date_picker = require("@elliemae/ds-date-picker");
|
|
41
45
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
42
|
-
var import_dropdownPreselectedOptions = require("../options/dropdownPreselectedOptions");
|
|
46
|
+
var import_dropdownPreselectedOptions = require("../options/dropdownPreselectedOptions.js");
|
|
43
47
|
const START_DATE = "startDate";
|
|
44
48
|
const END_DATE = "endDate";
|
|
45
49
|
const advanceOption = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DateRangeSelectorImpl.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport moment from 'moment';\nimport { components } from 'react-select';\nimport 'react-dates/initialize';\nimport { DayPickerRangeController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox } from '@elliemae/ds-form';\nimport DSPopper from '@elliemae/ds-popper';\nimport { DatePickerDay, DatePickerNavigation } from '@elliemae/ds-date-picker';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { CUSTOM_OPTION_VALUE } from '../options/dropdownPreselectedOptions';\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst advanceOption = {\n label: 'Custom',\n value: CUSTOM_OPTION_VALUE,\n isAdvance: true,\n};\nconst { cssClassName, classNameElement, classNameBlock } = convertPropToCssClassName('date-range-selector');\n\nconst { classNameElement: pickerNameElement } = convertPropToCssClassName('datepicker');\n\nclass DateTimeRecurenceSelectorImpl extends Component {\n constructor(props) {\n super(props);\n\n const customRange = {\n startDate: props.startDate ? moment(props.startDate) : moment(),\n endDate: props.endDate ? moment(props.endDate) : moment(),\n };\n this.state = {\n openModal: false,\n selected: props.value,\n focusedInput: START_DATE,\n customRange,\n };\n\n this.onDatesChange = this.onDatesChange.bind(this);\n this.onFocusChange = this.onFocusChange.bind(this);\n\n const { customOptionRender: CustomOptionRender } = props;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n }\n\n onChange = () => {\n const { onChange } = this.props;\n const { customRange, selected } = this.state;\n onChange(selected, customRange);\n };\n\n onChangeDropdown = (value) => {\n const { dropdownPreselectedOptions } = this.props;\n const selected = dropdownPreselectedOptions.find((op) => op.value === value);\n const { onChange } = this.props;\n if (!selected) {\n this.setState({ selected: value });\n this.handleOpenModal();\n } else if (selected) {\n onChange(value);\n this.setState({ selected: value, openModal: false });\n }\n };\n\n onDatesChange({ startDate, endDate }) {\n this.setState(\n {\n customRange: {\n startDate,\n endDate,\n },\n },\n () => {\n this.onChange();\n },\n );\n }\n\n onFocusChange() {\n this.setState(({ focusedInput }) => ({\n focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE,\n }));\n }\n\n handleConfirm = () => {\n const { customOptionRender: CustomOptionRender } = this.props;\n const { customRange } = this.state;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n this.onChange();\n this.handleCloseModal();\n };\n\n handleOpenModal = () => this.setState({ openModal: true });\n\n handleCloseModal = () => this.setState({ openModal: false });\n\n render() {\n const {\n placeholder,\n dropdownPreselectedOptions,\n displayFormatDay,\n className,\n disableCustomOption,\n containerProps,\n hasError,\n } = this.props;\n const {\n selected,\n openModal,\n focusedInput,\n customRange: { startDate, endDate },\n } = this.state;\n\n let options = [...dropdownPreselectedOptions];\n if (!disableCustomOption) {\n options = [...options, advanceOption];\n // eslint-disable-next-line max-lines\n }\n\n return (\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={`${classNameBlock('container-selector')}`}>\n <DSComboBox\n className={`${classNameElement('dropdown-field-selector')}`}\n components={{\n Option: (props) => <components.Option {...props} />,\n IndicatorSeparator: () => null,\n }}\n onChange={this.onChangeDropdown}\n onKeyDown={this.onKeyDown}\n options={options}\n placeholder={placeholder}\n value={selected}\n hasError={hasError}\n keepTypedValue={false} // TEMPORARY FIX\n />\n </div>\n <DSPopper\n contentComponent={\n <div className={classNameBlock('wrap-day-picker')}>\n <DayPickerRangeController\n endDate={endDate}\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={pickerNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={pickerNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={this.onDatesChange}\n onFocusChange={this.onFocusChange}\n onOutsideClick={this.handleConfirm}\n renderDayContents={(date) => (\n <DatePickerDay className={pickerNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={startDate}\n />\n </div>\n }\n isOpen={openModal}\n showArrow={false}\n triggerComponent={<div />}\n />\n </div>\n );\n }\n}\n\nexport default DateTimeRecurenceSelectorImpl;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport moment from 'moment';\nimport { components } from 'react-select';\nimport 'react-dates/initialize.js';\nimport { DayPickerRangeController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox } from '@elliemae/ds-form';\nimport DSPopper from '@elliemae/ds-popper';\nimport { DatePickerDay, DatePickerNavigation } from '@elliemae/ds-date-picker';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { CUSTOM_OPTION_VALUE } from '../options/dropdownPreselectedOptions.js';\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst advanceOption = {\n label: 'Custom',\n value: CUSTOM_OPTION_VALUE,\n isAdvance: true,\n};\nconst { cssClassName, classNameElement, classNameBlock } = convertPropToCssClassName('date-range-selector');\n\nconst { classNameElement: pickerNameElement } = convertPropToCssClassName('datepicker');\n\nclass DateTimeRecurenceSelectorImpl extends Component {\n constructor(props) {\n super(props);\n\n const customRange = {\n startDate: props.startDate ? moment(props.startDate) : moment(),\n endDate: props.endDate ? moment(props.endDate) : moment(),\n };\n this.state = {\n openModal: false,\n selected: props.value,\n focusedInput: START_DATE,\n customRange,\n };\n\n this.onDatesChange = this.onDatesChange.bind(this);\n this.onFocusChange = this.onFocusChange.bind(this);\n\n const { customOptionRender: CustomOptionRender } = props;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n }\n\n onChange = () => {\n const { onChange } = this.props;\n const { customRange, selected } = this.state;\n onChange(selected, customRange);\n };\n\n onChangeDropdown = (value) => {\n const { dropdownPreselectedOptions } = this.props;\n const selected = dropdownPreselectedOptions.find((op) => op.value === value);\n const { onChange } = this.props;\n if (!selected) {\n this.setState({ selected: value });\n this.handleOpenModal();\n } else if (selected) {\n onChange(value);\n this.setState({ selected: value, openModal: false });\n }\n };\n\n onDatesChange({ startDate, endDate }) {\n this.setState(\n {\n customRange: {\n startDate,\n endDate,\n },\n },\n () => {\n this.onChange();\n },\n );\n }\n\n onFocusChange() {\n this.setState(({ focusedInput }) => ({\n focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE,\n }));\n }\n\n handleConfirm = () => {\n const { customOptionRender: CustomOptionRender } = this.props;\n const { customRange } = this.state;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n this.onChange();\n this.handleCloseModal();\n };\n\n handleOpenModal = () => this.setState({ openModal: true });\n\n handleCloseModal = () => this.setState({ openModal: false });\n\n render() {\n const {\n placeholder,\n dropdownPreselectedOptions,\n displayFormatDay,\n className,\n disableCustomOption,\n containerProps,\n hasError,\n } = this.props;\n const {\n selected,\n openModal,\n focusedInput,\n customRange: { startDate, endDate },\n } = this.state;\n\n let options = [...dropdownPreselectedOptions];\n if (!disableCustomOption) {\n options = [...options, advanceOption];\n // eslint-disable-next-line max-lines\n }\n\n return (\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={`${classNameBlock('container-selector')}`}>\n <DSComboBox\n className={`${classNameElement('dropdown-field-selector')}`}\n components={{\n Option: (props) => <components.Option {...props} />,\n IndicatorSeparator: () => null,\n }}\n onChange={this.onChangeDropdown}\n onKeyDown={this.onKeyDown}\n options={options}\n placeholder={placeholder}\n value={selected}\n hasError={hasError}\n keepTypedValue={false} // TEMPORARY FIX\n />\n </div>\n <DSPopper\n contentComponent={\n <div className={classNameBlock('wrap-day-picker')}>\n <DayPickerRangeController\n endDate={endDate}\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={pickerNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={pickerNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={this.onDatesChange}\n onFocusChange={this.onFocusChange}\n onOutsideClick={this.handleConfirm}\n renderDayContents={(date) => (\n <DatePickerDay className={pickerNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={startDate}\n />\n </div>\n }\n isOpen={openModal}\n showArrow={false}\n triggerComponent={<div />}\n />\n </div>\n );\n }\n}\n\nexport default DateTimeRecurenceSelectorImpl;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4CG;AA3C1B,mBAAiC;AACjC,oBAAmB;AACnB,0BAA2B;AAC3B,wBAAO;AACP,yBAAyC;AACzC,2BAA0C;AAC1C,qBAA2B;AAC3B,uBAAqB;AACrB,4BAAoD;AACpD,sBAA4B;AAC5B,wCAAoC;AAEpC,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AACb;AACA,MAAM,EAAE,cAAc,kBAAkB,eAAe,QAAI,gDAA0B,qBAAqB;AAE1G,MAAM,EAAE,kBAAkB,kBAAkB,QAAI,gDAA0B,YAAY;AAEtF,MAAM,sCAAsC,uBAAU;AAAA,EACpD,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,oBAAW,MAAM;AACf,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,YAAM,EAAE,aAAa,SAAS,IAAI,KAAK;AACvC,eAAS,UAAU,WAAW;AAAA,IAChC;AAEA,4BAAmB,CAAC,UAAU;AAC5B,YAAM,EAAE,2BAA2B,IAAI,KAAK;AAC5C,YAAM,WAAW,2BAA2B,KAAK,CAAC,OAAO,GAAG,UAAU,KAAK;AAC3E,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAI,CAAC,UAAU;AACb,aAAK,SAAS,EAAE,UAAU,MAAM,CAAC;AACjC,aAAK,gBAAgB;AAAA,MACvB,WAAW,UAAU;AACnB,iBAAS,KAAK;AACd,aAAK,SAAS,EAAE,UAAU,OAAO,WAAW,MAAM,CAAC;AAAA,MACrD;AAAA,IACF;AAsBA,yBAAgB,MAAM;AACpB,YAAM,EAAE,oBAAoB,mBA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EAEJ;AACF;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": ["moment", "DSPopper"]
|
|
7
7
|
}
|
package/dist/cjs/index.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
|
));
|
|
@@ -31,6 +35,6 @@ __export(src_exports, {
|
|
|
31
35
|
});
|
|
32
36
|
module.exports = __toCommonJS(src_exports);
|
|
33
37
|
var React = __toESM(require("react"));
|
|
34
|
-
var import_DSDateRangeSelector = __toESM(require("./DSDateRangeSelector"));
|
|
35
|
-
var import_DSDateRangeSelector2 = require("./DSDateRangeSelector");
|
|
38
|
+
var import_DSDateRangeSelector = __toESM(require("./DSDateRangeSelector.js"));
|
|
39
|
+
var import_DSDateRangeSelector2 = require("./DSDateRangeSelector.js");
|
|
36
40
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { default, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from './DSDateRangeSelector';\nexport { CUSTOM_OPTION_VALUE } from './DSDateRangeSelector';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { default, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from './DSDateRangeSelector.js';\nexport { CUSTOM_OPTION_VALUE } from './DSDateRangeSelector.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAoF;AACpF,IAAAA,8BAAoC;",
|
|
6
6
|
"names": ["import_DSDateRangeSelector"]
|
|
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/options/dropdownPreselectedOptions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const DropdownOptionsTypes = {\n TODAY: 'today',\n YESTERDAY: 'yesterday',\n LAST_7_DAYS: '7days',\n LAST_30_DAYS: '30days',\n THIS_MONTH: 'thismonth',\n LAST_MONTH: 'lastmonth',\n};\nexport const dropdownPreselectedOptions = [\n {\n label: 'Today',\n value: DropdownOptionsTypes.TODAY,\n },\n {\n label: 'Yesterday',\n value: DropdownOptionsTypes.YESTERDAY,\n },\n {\n label: 'Last 7 Days',\n value: DropdownOptionsTypes.LAST_7_DAYS,\n },\n {\n label: 'Last 30 days',\n value: DropdownOptionsTypes.LAST_30_DAYS,\n },\n {\n label: 'This month',\n value: DropdownOptionsTypes.THIS_MONTH,\n },\n {\n label: 'Last month',\n value: DropdownOptionsTypes.LAST_MONTH,\n },\n];\n\nexport const CUSTOM_OPTION_VALUE = 'custom-option-value';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,uBAAuB;AAAA,EAClC,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;AACd;AACO,MAAM,6BAA6B;AAAA,EACxC;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,qBAAqB;AAAA,EAC9B;AACF;AAEO,MAAM,sBAAsB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,13 +3,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useDeprecateComponent } from "@elliemae/ds-utilities";
|
|
4
4
|
import { PropTypes, describe } from "@elliemae/ds-props-helpers";
|
|
5
5
|
import moment from "moment";
|
|
6
|
-
import DateRangeSelectorImpl from "./components/DateRangeSelectorImpl";
|
|
6
|
+
import DateRangeSelectorImpl from "./components/DateRangeSelectorImpl.js";
|
|
7
7
|
import {
|
|
8
8
|
DropdownOptionsTypes,
|
|
9
9
|
dropdownPreselectedOptions,
|
|
10
10
|
CUSTOM_OPTION_VALUE
|
|
11
|
-
} from "./options/dropdownPreselectedOptions";
|
|
12
|
-
import CustomOptionRender from "./components/CustomOptionRender/CustomOptionRender";
|
|
11
|
+
} from "./options/dropdownPreselectedOptions.js";
|
|
12
|
+
import CustomOptionRender from "./components/CustomOptionRender/CustomOptionRender.js";
|
|
13
13
|
const DSDateRangeSelector = ({
|
|
14
14
|
containerProps = {},
|
|
15
15
|
className = "",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDateRangeSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport moment from 'moment';\nimport DateRangeSelectorImpl from './components/DateRangeSelectorImpl';\nimport {\n DropdownOptionsTypes,\n dropdownPreselectedOptions,\n CUSTOM_OPTION_VALUE,\n} from './options/dropdownPreselectedOptions';\nimport CustomOptionRender from './components/CustomOptionRender/CustomOptionRender';\n\nconst DSDateRangeSelector = ({\n containerProps = {},\n className = '',\n preselectedOptions = dropdownPreselectedOptions,\n onChange = () => null,\n placeholder = 'Select Range',\n value = null,\n customOptionRender = CustomOptionRender,\n startDate = null,\n endDate = null,\n displayFormatDay = 'D',\n disableCustomOption = false,\n hasError = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-range-selector', version: 'TBD Date: 2023 Q1' });\n\n return (\n <DateRangeSelectorImpl\n className={className}\n containerProps={containerProps}\n customOptionRender={customOptionRender}\n disableCustomOption={disableCustomOption}\n displayFormatDay={displayFormatDay}\n dropdownPreselectedOptions={preselectedOptions}\n endDate={endDate}\n onChange={onChange}\n placeholder={placeholder}\n startDate={startDate}\n value={value}\n hasError={hasError}\n />\n );\n};\n\nexport { CUSTOM_OPTION_VALUE, dropdownPreselectedOptions, DropdownOptionsTypes };\n\nconst dateRangeRecurrenceSelectorProps = {\n containerProps: PropTypes.object.description('Set of properties attached to the main container'),\n className: PropTypes.string.description('html class attribute'),\n preselectedOptions: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n ).description('options to display in dropdown menu'),\n onChange: PropTypes.func.description('function executed when selection changes'),\n placeholder: PropTypes.string.description('inputs placeholder').defaultValue('Select Range'),\n value: PropTypes.oneOf([PropTypes.string, PropTypes.number]).description('selected value'),\n customOptionRender: PropTypes.element.description('custom renderer for options'),\n startDate: PropTypes.instanceOf(Date, moment).description('moment object of start date'),\n endDate: PropTypes.instanceOf(Date, moment).description('moment object of end date'),\n displayFormatDay: PropTypes.string.description('format to display date').defaultValue('D'),\n disableCustomOption: PropTypes.bool.description('disables custom options').defaultValue(false),\n};\n\nDSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;\nDSDateRangeSelector.displayName = 'DSDateRangeSelector';\nconst DateRangeRecurrenceSelectorWithSchema = describe(DSDateRangeSelector);\nDateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;\n\nexport { DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector };\nexport default DSDateRangeSelector;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport moment from 'moment';\nimport DateRangeSelectorImpl from './components/DateRangeSelectorImpl.js';\nimport {\n DropdownOptionsTypes,\n dropdownPreselectedOptions,\n CUSTOM_OPTION_VALUE,\n} from './options/dropdownPreselectedOptions.js';\nimport CustomOptionRender from './components/CustomOptionRender/CustomOptionRender.js';\n\nconst DSDateRangeSelector = ({\n containerProps = {},\n className = '',\n preselectedOptions = dropdownPreselectedOptions,\n onChange = () => null,\n placeholder = 'Select Range',\n value = null,\n customOptionRender = CustomOptionRender,\n startDate = null,\n endDate = null,\n displayFormatDay = 'D',\n disableCustomOption = false,\n hasError = false,\n}) => {\n useDeprecateComponent({ componentName: 'ds-date-range-selector', version: 'TBD Date: 2023 Q1' });\n\n return (\n <DateRangeSelectorImpl\n className={className}\n containerProps={containerProps}\n customOptionRender={customOptionRender}\n disableCustomOption={disableCustomOption}\n displayFormatDay={displayFormatDay}\n dropdownPreselectedOptions={preselectedOptions}\n endDate={endDate}\n onChange={onChange}\n placeholder={placeholder}\n startDate={startDate}\n value={value}\n hasError={hasError}\n />\n );\n};\n\nexport { CUSTOM_OPTION_VALUE, dropdownPreselectedOptions, DropdownOptionsTypes };\n\nconst dateRangeRecurrenceSelectorProps = {\n containerProps: PropTypes.object.description('Set of properties attached to the main container'),\n className: PropTypes.string.description('html class attribute'),\n preselectedOptions: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n }),\n ).description('options to display in dropdown menu'),\n onChange: PropTypes.func.description('function executed when selection changes'),\n placeholder: PropTypes.string.description('inputs placeholder').defaultValue('Select Range'),\n value: PropTypes.oneOf([PropTypes.string, PropTypes.number]).description('selected value'),\n customOptionRender: PropTypes.element.description('custom renderer for options'),\n startDate: PropTypes.instanceOf(Date, moment).description('moment object of start date'),\n endDate: PropTypes.instanceOf(Date, moment).description('moment object of end date'),\n displayFormatDay: PropTypes.string.description('format to display date').defaultValue('D'),\n disableCustomOption: PropTypes.bool.description('disables custom options').defaultValue(false),\n};\n\nDSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;\nDSDateRangeSelector.displayName = 'DSDateRangeSelector';\nconst DateRangeRecurrenceSelectorWithSchema = describe(DSDateRangeSelector);\nDateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;\n\nexport { DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector };\nexport default DSDateR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AQ,YAAY,6BAA6B;AAAA,EAC/E,WAAW,UAAU,WAAW,MAAM,MAAM,EAAE,YAAY,6BAA6B;AAAA,EACvF,SAAS,UAAU,WAAW,MAAM,MAAM,EAAE,YAAY,2BAA2B;AAAA,EACnF,kBAAkB,UAAU,OAAO,YAAY,wBAAwB,EAAE,aAAa,GAAG;AAAA,EACzF,qBAAqB,UAAU,KAAK,YAAY,yBAAyB,EAAE,aAAa,KAAK;AAC/F;AAEA,oBAAoB,YAAY;AAChC,oBAAoB,cAAc;AAClC,MAAM,wCAAwC,SAAS,mBAAmB;AAC1E,sCAAsC,YAAY;AAGlD,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,14 +3,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Component } from "react";
|
|
4
4
|
import moment from "moment";
|
|
5
5
|
import { components } from "react-select";
|
|
6
|
-
import "react-dates/initialize";
|
|
6
|
+
import "react-dates/initialize.js";
|
|
7
7
|
import { DayPickerRangeController } from "react-dates";
|
|
8
8
|
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
9
9
|
import { DSComboBox } from "@elliemae/ds-form";
|
|
10
10
|
import DSPopper from "@elliemae/ds-popper";
|
|
11
11
|
import { DatePickerDay, DatePickerNavigation } from "@elliemae/ds-date-picker";
|
|
12
12
|
import { ChevronLeft } from "@elliemae/ds-icons";
|
|
13
|
-
import { CUSTOM_OPTION_VALUE } from "../options/dropdownPreselectedOptions";
|
|
13
|
+
import { CUSTOM_OPTION_VALUE } from "../options/dropdownPreselectedOptions.js";
|
|
14
14
|
const START_DATE = "startDate";
|
|
15
15
|
const END_DATE = "endDate";
|
|
16
16
|
const advanceOption = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/DateRangeSelectorImpl.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport moment from 'moment';\nimport { components } from 'react-select';\nimport 'react-dates/initialize';\nimport { DayPickerRangeController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox } from '@elliemae/ds-form';\nimport DSPopper from '@elliemae/ds-popper';\nimport { DatePickerDay, DatePickerNavigation } from '@elliemae/ds-date-picker';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { CUSTOM_OPTION_VALUE } from '../options/dropdownPreselectedOptions';\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst advanceOption = {\n label: 'Custom',\n value: CUSTOM_OPTION_VALUE,\n isAdvance: true,\n};\nconst { cssClassName, classNameElement, classNameBlock } = convertPropToCssClassName('date-range-selector');\n\nconst { classNameElement: pickerNameElement } = convertPropToCssClassName('datepicker');\n\nclass DateTimeRecurenceSelectorImpl extends Component {\n constructor(props) {\n super(props);\n\n const customRange = {\n startDate: props.startDate ? moment(props.startDate) : moment(),\n endDate: props.endDate ? moment(props.endDate) : moment(),\n };\n this.state = {\n openModal: false,\n selected: props.value,\n focusedInput: START_DATE,\n customRange,\n };\n\n this.onDatesChange = this.onDatesChange.bind(this);\n this.onFocusChange = this.onFocusChange.bind(this);\n\n const { customOptionRender: CustomOptionRender } = props;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n }\n\n onChange = () => {\n const { onChange } = this.props;\n const { customRange, selected } = this.state;\n onChange(selected, customRange);\n };\n\n onChangeDropdown = (value) => {\n const { dropdownPreselectedOptions } = this.props;\n const selected = dropdownPreselectedOptions.find((op) => op.value === value);\n const { onChange } = this.props;\n if (!selected) {\n this.setState({ selected: value });\n this.handleOpenModal();\n } else if (selected) {\n onChange(value);\n this.setState({ selected: value, openModal: false });\n }\n };\n\n onDatesChange({ startDate, endDate }) {\n this.setState(\n {\n customRange: {\n startDate,\n endDate,\n },\n },\n () => {\n this.onChange();\n },\n );\n }\n\n onFocusChange() {\n this.setState(({ focusedInput }) => ({\n focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE,\n }));\n }\n\n handleConfirm = () => {\n const { customOptionRender: CustomOptionRender } = this.props;\n const { customRange } = this.state;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n this.onChange();\n this.handleCloseModal();\n };\n\n handleOpenModal = () => this.setState({ openModal: true });\n\n handleCloseModal = () => this.setState({ openModal: false });\n\n render() {\n const {\n placeholder,\n dropdownPreselectedOptions,\n displayFormatDay,\n className,\n disableCustomOption,\n containerProps,\n hasError,\n } = this.props;\n const {\n selected,\n openModal,\n focusedInput,\n customRange: { startDate, endDate },\n } = this.state;\n\n let options = [...dropdownPreselectedOptions];\n if (!disableCustomOption) {\n options = [...options, advanceOption];\n // eslint-disable-next-line max-lines\n }\n\n return (\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={`${classNameBlock('container-selector')}`}>\n <DSComboBox\n className={`${classNameElement('dropdown-field-selector')}`}\n components={{\n Option: (props) => <components.Option {...props} />,\n IndicatorSeparator: () => null,\n }}\n onChange={this.onChangeDropdown}\n onKeyDown={this.onKeyDown}\n options={options}\n placeholder={placeholder}\n value={selected}\n hasError={hasError}\n keepTypedValue={false} // TEMPORARY FIX\n />\n </div>\n <DSPopper\n contentComponent={\n <div className={classNameBlock('wrap-day-picker')}>\n <DayPickerRangeController\n endDate={endDate}\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={pickerNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={pickerNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={this.onDatesChange}\n onFocusChange={this.onFocusChange}\n onOutsideClick={this.handleConfirm}\n renderDayContents={(date) => (\n <DatePickerDay className={pickerNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={startDate}\n />\n </div>\n }\n isOpen={openModal}\n showArrow={false}\n triggerComponent={<div />}\n />\n </div>\n );\n }\n}\n\nexport default DateTimeRecurenceSelectorImpl;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport moment from 'moment';\nimport { components } from 'react-select';\nimport 'react-dates/initialize.js';\nimport { DayPickerRangeController } from 'react-dates';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSComboBox } from '@elliemae/ds-form';\nimport DSPopper from '@elliemae/ds-popper';\nimport { DatePickerDay, DatePickerNavigation } from '@elliemae/ds-date-picker';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { CUSTOM_OPTION_VALUE } from '../options/dropdownPreselectedOptions.js';\n\nconst START_DATE = 'startDate';\nconst END_DATE = 'endDate';\n\nconst advanceOption = {\n label: 'Custom',\n value: CUSTOM_OPTION_VALUE,\n isAdvance: true,\n};\nconst { cssClassName, classNameElement, classNameBlock } = convertPropToCssClassName('date-range-selector');\n\nconst { classNameElement: pickerNameElement } = convertPropToCssClassName('datepicker');\n\nclass DateTimeRecurenceSelectorImpl extends Component {\n constructor(props) {\n super(props);\n\n const customRange = {\n startDate: props.startDate ? moment(props.startDate) : moment(),\n endDate: props.endDate ? moment(props.endDate) : moment(),\n };\n this.state = {\n openModal: false,\n selected: props.value,\n focusedInput: START_DATE,\n customRange,\n };\n\n this.onDatesChange = this.onDatesChange.bind(this);\n this.onFocusChange = this.onFocusChange.bind(this);\n\n const { customOptionRender: CustomOptionRender } = props;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n }\n\n onChange = () => {\n const { onChange } = this.props;\n const { customRange, selected } = this.state;\n onChange(selected, customRange);\n };\n\n onChangeDropdown = (value) => {\n const { dropdownPreselectedOptions } = this.props;\n const selected = dropdownPreselectedOptions.find((op) => op.value === value);\n const { onChange } = this.props;\n if (!selected) {\n this.setState({ selected: value });\n this.handleOpenModal();\n } else if (selected) {\n onChange(value);\n this.setState({ selected: value, openModal: false });\n }\n };\n\n onDatesChange({ startDate, endDate }) {\n this.setState(\n {\n customRange: {\n startDate,\n endDate,\n },\n },\n () => {\n this.onChange();\n },\n );\n }\n\n onFocusChange() {\n this.setState(({ focusedInput }) => ({\n focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE,\n }));\n }\n\n handleConfirm = () => {\n const { customOptionRender: CustomOptionRender } = this.props;\n const { customRange } = this.state;\n advanceOption.label = <CustomOptionRender customRange={customRange} />;\n this.onChange();\n this.handleCloseModal();\n };\n\n handleOpenModal = () => this.setState({ openModal: true });\n\n handleCloseModal = () => this.setState({ openModal: false });\n\n render() {\n const {\n placeholder,\n dropdownPreselectedOptions,\n displayFormatDay,\n className,\n disableCustomOption,\n containerProps,\n hasError,\n } = this.props;\n const {\n selected,\n openModal,\n focusedInput,\n customRange: { startDate, endDate },\n } = this.state;\n\n let options = [...dropdownPreselectedOptions];\n if (!disableCustomOption) {\n options = [...options, advanceOption];\n // eslint-disable-next-line max-lines\n }\n\n return (\n <div {...containerProps} className={`${cssClassName} ${className}`}>\n <div className={`${classNameBlock('container-selector')}`}>\n <DSComboBox\n className={`${classNameElement('dropdown-field-selector')}`}\n components={{\n Option: (props) => <components.Option {...props} />,\n IndicatorSeparator: () => null,\n }}\n onChange={this.onChangeDropdown}\n onKeyDown={this.onKeyDown}\n options={options}\n placeholder={placeholder}\n value={selected}\n hasError={hasError}\n keepTypedValue={false} // TEMPORARY FIX\n />\n </div>\n <DSPopper\n contentComponent={\n <div className={classNameBlock('wrap-day-picker')}>\n <DayPickerRangeController\n endDate={endDate}\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n navNext={<DatePickerNavigation className={pickerNameElement('navigation-next')} />}\n navPrev={<DatePickerNavigation className={pickerNameElement('navigation-prev')} icon={ChevronLeft} />}\n onDatesChange={this.onDatesChange}\n onFocusChange={this.onFocusChange}\n onOutsideClick={this.handleConfirm}\n renderDayContents={(date) => (\n <DatePickerDay className={pickerNameElement('day-contents')} date={date.format(displayFormatDay)} />\n )}\n startDate={startDate}\n />\n </div>\n }\n isOpen={openModal}\n showArrow={false}\n triggerComponent={<div />}\n />\n </div>\n );\n }\n}\n\nexport default DateTimeRecurenceSelectorImpl;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC4CG,cA8EpB,YA9EoB;AA3C1B,SAAgB,iBAAiB;AACjC,OAAO,YAAY;AACnB,SAAS,kBAAkB;AAC3B,OAAO;AACP,SAAS,gCAAgC;AACzC,SAAS,iCAAiC;AAC1C,SAAS,kBAAkB;AAC3B,OAAO,cAAc;AACrB,SAAS,eAAe,4BAA4B;AACpD,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AAEpC,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AACb;AACA,MAAM,EAAE,cAAc,kBAAkB,eAAe,IAAI,0BAA0B,qBAAqB;AAE1G,MAAM,EAAE,kBAAkB,kBAAkB,IAAI,0BAA0B,YAAY;AAEtF,MAAM,sCAAsC,UAAU;AAAA,EACpD,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,oBAAW,MAAM;AACf,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,YAAM,EAAE,aAAa,SAAS,IAAI,KAAK;AACvC,eAAS,UAAU,WAAW;AAAA,IAChC;AAEA,4BAAmB,CAAC,UAAU;AAC5B,YAAM,EAAE,2BAA2B,IAAI,KAAK;AAC5C,YAAM,WAAW,2BAA2B,KAAK,CAAC,OAAO,GAAG,UAAU,KAAK;AAC3E,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAI,CAAC,UAAU;AACb,aAAK,SAAS,EAAE,UAAU,MAAM,CAAC;AACjC,aAAK,gBAAgB;AAAA,MACvB,WAAW,UAAU;AACnB,iBAAS,KAAK;AACd,aAAK,SAAS,EAAE,UAAU,OAAO,WAAW,MAAM,CAAC;AAAA,MACrD;AAAA,IACF;AAsBA,yBAAgB,M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AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { default as default2, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from "./DSDateRangeSelector";
|
|
3
|
-
import { CUSTOM_OPTION_VALUE } from "./DSDateRangeSelector";
|
|
2
|
+
import { default as default2, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from "./DSDateRangeSelector.js";
|
|
3
|
+
import { CUSTOM_OPTION_VALUE } from "./DSDateRangeSelector.js";
|
|
4
4
|
export {
|
|
5
5
|
CUSTOM_OPTION_VALUE,
|
|
6
6
|
DSDateRangeSelector,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from './DSDateRangeSelector';\nexport { CUSTOM_OPTION_VALUE } from './DSDateRangeSelector';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from './DSDateRangeSelector.js';\nexport { CUSTOM_OPTION_VALUE } from './DSDateRangeSelector.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAAA,UAAS,uCAAuC,2BAA2B;AACpF,SAAS,2BAA2B;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-range-selector",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Range Selector",
|
|
6
6
|
"files": [
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"moment": "~2.29.
|
|
54
|
+
"moment": "~2.29.4",
|
|
55
55
|
"react-dates": "~21.8.0",
|
|
56
56
|
"react-select": "4.3.1",
|
|
57
|
-
"@elliemae/ds-classnames": "3.16.
|
|
58
|
-
"@elliemae/ds-date-picker": "3.16.
|
|
59
|
-
"@elliemae/ds-
|
|
60
|
-
"@elliemae/ds-
|
|
61
|
-
"@elliemae/ds-
|
|
62
|
-
"@elliemae/ds-props-helpers": "3.16.
|
|
63
|
-
"@elliemae/ds-
|
|
57
|
+
"@elliemae/ds-classnames": "3.16.1",
|
|
58
|
+
"@elliemae/ds-date-picker": "3.16.1",
|
|
59
|
+
"@elliemae/ds-popper": "3.16.1",
|
|
60
|
+
"@elliemae/ds-utilities": "3.16.1",
|
|
61
|
+
"@elliemae/ds-form": "3.16.1",
|
|
62
|
+
"@elliemae/ds-props-helpers": "3.16.1",
|
|
63
|
+
"@elliemae/ds-icons": "3.16.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"lodash": "^4.17.21",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
76
76
|
"test": "node ../../scripts/testing/test.mjs",
|
|
77
77
|
"lint": "node ../../scripts/lint.mjs",
|
|
78
|
-
"eslint:fix": "
|
|
79
|
-
"dts": "
|
|
78
|
+
"eslint:fix": "exit 0",
|
|
79
|
+
"dts": "exit 0",
|
|
80
80
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
81
81
|
"dev:build": "pnpm --filter {.}... build",
|
|
82
82
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { DropdownOptionsTypes, dropdownPreselectedOptions, CUSTOM_OPTION_VALUE } from './options/dropdownPreselectedOptions';
|
|
2
|
-
declare const DSDateRangeSelector: {
|
|
3
|
-
({ containerProps, className, preselectedOptions, onChange, placeholder, value, customOptionRender, startDate, endDate, displayFormatDay, disableCustomOption, hasError, }: {
|
|
4
|
-
containerProps?: {} | undefined;
|
|
5
|
-
className?: string | undefined;
|
|
6
|
-
preselectedOptions?: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[] | undefined;
|
|
10
|
-
onChange?: (() => null) | undefined;
|
|
11
|
-
placeholder?: string | undefined;
|
|
12
|
-
value?: null | undefined;
|
|
13
|
-
customOptionRender?: (({ customRange: { startDate, endDate } }: {
|
|
14
|
-
customRange: {
|
|
15
|
-
startDate: any;
|
|
16
|
-
endDate: any;
|
|
17
|
-
};
|
|
18
|
-
}) => JSX.Element) | undefined;
|
|
19
|
-
startDate?: null | undefined;
|
|
20
|
-
endDate?: null | undefined;
|
|
21
|
-
displayFormatDay?: string | undefined;
|
|
22
|
-
disableCustomOption?: boolean | undefined;
|
|
23
|
-
hasError?: boolean | undefined;
|
|
24
|
-
}): JSX.Element;
|
|
25
|
-
propTypes: {
|
|
26
|
-
containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
27
|
-
className: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
28
|
-
preselectedOptions: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
29
|
-
onChange: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
30
|
-
placeholder: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
31
|
-
value: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
32
|
-
customOptionRender: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
33
|
-
startDate: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
34
|
-
endDate: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
35
|
-
displayFormatDay: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
36
|
-
disableCustomOption: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
37
|
-
};
|
|
38
|
-
displayName: string;
|
|
39
|
-
};
|
|
40
|
-
export { CUSTOM_OPTION_VALUE, dropdownPreselectedOptions, DropdownOptionsTypes };
|
|
41
|
-
declare const DateRangeRecurrenceSelectorWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<{
|
|
42
|
-
containerProps?: {} | undefined;
|
|
43
|
-
className?: string | undefined;
|
|
44
|
-
preselectedOptions?: {
|
|
45
|
-
label: string;
|
|
46
|
-
value: string;
|
|
47
|
-
}[] | undefined;
|
|
48
|
-
onChange?: (() => null) | undefined;
|
|
49
|
-
placeholder?: string | undefined;
|
|
50
|
-
value?: null | undefined;
|
|
51
|
-
customOptionRender?: (({ customRange: { startDate, endDate } }: {
|
|
52
|
-
customRange: {
|
|
53
|
-
startDate: any;
|
|
54
|
-
endDate: any;
|
|
55
|
-
};
|
|
56
|
-
}) => JSX.Element) | undefined;
|
|
57
|
-
startDate?: null | undefined;
|
|
58
|
-
endDate?: null | undefined;
|
|
59
|
-
displayFormatDay?: string | undefined;
|
|
60
|
-
disableCustomOption?: boolean | undefined;
|
|
61
|
-
hasError?: boolean | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
export { DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector };
|
|
64
|
-
export default DSDateRangeSelector;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param root0
|
|
3
|
-
* @param root0.customRange
|
|
4
|
-
* @param root0.customRange.startDate
|
|
5
|
-
* @param root0.customRange.endDate
|
|
6
|
-
* @customRange {
|
|
7
|
-
endDate
|
|
8
|
-
startDate
|
|
9
|
-
}
|
|
10
|
-
*/
|
|
11
|
-
declare const CustomOptionRender: ({ customRange: { startDate, endDate } }: {
|
|
12
|
-
customRange: {
|
|
13
|
-
startDate: any;
|
|
14
|
-
endDate: any;
|
|
15
|
-
};
|
|
16
|
-
}) => JSX.Element;
|
|
17
|
-
export default CustomOptionRender;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import 'react-dates/initialize';
|
|
3
|
-
declare class DateTimeRecurenceSelectorImpl extends Component {
|
|
4
|
-
constructor(props: any);
|
|
5
|
-
onChange: () => void;
|
|
6
|
-
onChangeDropdown: (value: any) => void;
|
|
7
|
-
onDatesChange({ startDate, endDate }: {
|
|
8
|
-
startDate: any;
|
|
9
|
-
endDate: any;
|
|
10
|
-
}): void;
|
|
11
|
-
onFocusChange(): void;
|
|
12
|
-
handleConfirm: () => void;
|
|
13
|
-
handleOpenModal: () => void;
|
|
14
|
-
handleCloseModal: () => void;
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
export default DateTimeRecurenceSelectorImpl;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const DropdownOptionsTypes: {
|
|
2
|
-
TODAY: string;
|
|
3
|
-
YESTERDAY: string;
|
|
4
|
-
LAST_7_DAYS: string;
|
|
5
|
-
LAST_30_DAYS: string;
|
|
6
|
-
THIS_MONTH: string;
|
|
7
|
-
LAST_MONTH: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const dropdownPreselectedOptions: {
|
|
10
|
-
label: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}[];
|
|
13
|
-
export declare const CUSTOM_OPTION_VALUE = "custom-option-value";
|