@elliemae/ds-date-range-selector 3.0.0-next.8 → 3.0.0-next.80
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 +15 -18
- package/dist/cjs/DSDateRangeSelector.js.map +2 -2
- package/dist/cjs/components/CustomOptionRender/CustomOptionRender.js +9 -16
- package/dist/cjs/components/CustomOptionRender/CustomOptionRender.js.map +1 -1
- package/dist/cjs/components/DateRangeSelectorImpl.js +14 -17
- package/dist/cjs/components/DateRangeSelectorImpl.js.map +2 -2
- package/dist/cjs/index.js +10 -16
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/options/dropdownPreselectedOptions.js +9 -16
- package/dist/cjs/options/dropdownPreselectedOptions.js.map +1 -1
- package/dist/esm/DSDateRangeSelector.js +6 -2
- package/dist/esm/DSDateRangeSelector.js.map +2 -2
- package/dist/esm/components/CustomOptionRender/CustomOptionRender.js.map +1 -1
- package/dist/esm/components/DateRangeSelectorImpl.js +5 -1
- package/dist/esm/components/DateRangeSelectorImpl.js.map +2 -2
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/options/dropdownPreselectedOptions.js.map +1 -1
- package/package.json +14 -14
|
@@ -4,35 +4,30 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var DSDateRangeSelector_exports = {};
|
|
29
22
|
__export(DSDateRangeSelector_exports, {
|
|
30
23
|
CUSTOM_OPTION_VALUE: () => import_dropdownPreselectedOptions.CUSTOM_OPTION_VALUE,
|
|
24
|
+
DSDateRangeSelector: () => DSDateRangeSelector,
|
|
31
25
|
DateRangeRecurrenceSelectorWithSchema: () => DateRangeRecurrenceSelectorWithSchema,
|
|
32
26
|
DropdownOptionsTypes: () => import_dropdownPreselectedOptions.DropdownOptionsTypes,
|
|
33
27
|
default: () => DSDateRangeSelector_default,
|
|
34
28
|
dropdownPreselectedOptions: () => import_dropdownPreselectedOptions.dropdownPreselectedOptions
|
|
35
29
|
});
|
|
30
|
+
module.exports = __toCommonJS(DSDateRangeSelector_exports);
|
|
36
31
|
var React = __toESM(require("react"));
|
|
37
32
|
var import_react = __toESM(require("react"));
|
|
38
33
|
var import_react_desc = require("react-desc");
|
|
@@ -51,7 +46,8 @@ const DSDateRangeSelector = ({
|
|
|
51
46
|
startDate = null,
|
|
52
47
|
endDate = null,
|
|
53
48
|
displayFormatDay = "D",
|
|
54
|
-
disableCustomOption = false
|
|
49
|
+
disableCustomOption = false,
|
|
50
|
+
hasError = false
|
|
55
51
|
}) => /* @__PURE__ */ import_react.default.createElement(import_DateRangeSelectorImpl.default, {
|
|
56
52
|
className,
|
|
57
53
|
containerProps,
|
|
@@ -63,7 +59,8 @@ const DSDateRangeSelector = ({
|
|
|
63
59
|
onChange,
|
|
64
60
|
placeholder,
|
|
65
61
|
startDate,
|
|
66
|
-
value
|
|
62
|
+
value,
|
|
63
|
+
hasError
|
|
67
64
|
});
|
|
68
65
|
const dateRangeRecurrenceSelectorProps = {
|
|
69
66
|
containerProps: import_react_desc.PropTypes.object.description("Set of properties attached to the main container"),
|
|
@@ -82,8 +79,8 @@ const dateRangeRecurrenceSelectorProps = {
|
|
|
82
79
|
disableCustomOption: import_react_desc.PropTypes.bool.description("disables custom options").defaultValue(false)
|
|
83
80
|
};
|
|
84
81
|
DSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;
|
|
82
|
+
DSDateRangeSelector.displayName = "DSDateRangeSelector";
|
|
85
83
|
const DateRangeRecurrenceSelectorWithSchema = (0, import_react_desc.describe)(DSDateRangeSelector);
|
|
86
84
|
DateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;
|
|
87
85
|
var DSDateRangeSelector_default = DSDateRangeSelector;
|
|
88
|
-
module.exports = __toCommonJS(DSDateRangeSelector_exports);
|
|
89
86
|
//# sourceMappingURL=DSDateRangeSelector.js.map
|
|
@@ -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 { PropTypes, describe } from 'react-desc';\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}) => (\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 />\n);\n\nexport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\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 <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\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;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,oBAAmB;AACnB,mCAAkC;AAClC,wCAIO;AACP,gCAA+B;AAE/B,MAAM,sBAAsB,CAAC;AAAA,EAC3B,iBAAiB,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,q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AGlD,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var CustomOptionRender_exports = {};
|
|
29
22
|
__export(CustomOptionRender_exports, {
|
|
30
23
|
default: () => CustomOptionRender_default
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(CustomOptionRender_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = __toESM(require("react"));
|
|
34
28
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
@@ -42,5 +36,4 @@ const CustomOptionRender = ({ customRange: { startDate, endDate } }) => {
|
|
|
42
36
|
}, display);
|
|
43
37
|
};
|
|
44
38
|
var CustomOptionRender_default = CustomOptionRender;
|
|
45
|
-
module.exports = __toCommonJS(CustomOptionRender_exports);
|
|
46
39
|
//# sourceMappingURL=CustomOptionRender.js.map
|
|
@@ -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(\n 'date-range-selector-customoption',\n);\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;ADAvB,mBAAkB;AAClB,2BAA0C;AAE1C,MAAM,EAAE,iBAAiB,oDACvB,kCACF;AAWA,MAAM,qBAAqB,CAAC,EAAE,aAAa,EAAE,WAAW,gBAAgB;AACtE,QAAM,QAAQ,YAAY,UAAU,OAAO,YAAY,IAAI;AAC3D,QAAM,MAAM,UAAU,QAAQ,OAAO,YAAY,IAAI;AACrD,QAAM,UAAU,QAAQ,YAAY,SAAS;AAC7C,SAAO,mDAAC;AAAA,IAAG,WAAW;AAAA,KAAe,OAAQ;AAC/C;AAEA,IAAO,6BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,31 +21,25 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var DateRangeSelectorImpl_exports = {};
|
|
46
39
|
__export(DateRangeSelectorImpl_exports, {
|
|
47
40
|
default: () => DateRangeSelectorImpl_default
|
|
48
41
|
});
|
|
42
|
+
module.exports = __toCommonJS(DateRangeSelectorImpl_exports);
|
|
49
43
|
var React = __toESM(require("react"));
|
|
50
44
|
var import_react = __toESM(require("react"));
|
|
51
45
|
var import_moment = __toESM(require("moment"));
|
|
@@ -108,6 +102,8 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
108
102
|
focusedInput: START_DATE,
|
|
109
103
|
customRange
|
|
110
104
|
};
|
|
105
|
+
this.onDatesChange = this.onDatesChange.bind(this);
|
|
106
|
+
this.onFocusChange = this.onFocusChange.bind(this);
|
|
111
107
|
const { customOptionRender: CustomOptionRender } = props;
|
|
112
108
|
advanceOption.label = /* @__PURE__ */ import_react.default.createElement(CustomOptionRender, {
|
|
113
109
|
customRange
|
|
@@ -135,7 +131,8 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
135
131
|
displayFormatDay,
|
|
136
132
|
className,
|
|
137
133
|
disableCustomOption,
|
|
138
|
-
containerProps
|
|
134
|
+
containerProps,
|
|
135
|
+
hasError
|
|
139
136
|
} = this.props;
|
|
140
137
|
const {
|
|
141
138
|
selected,
|
|
@@ -162,6 +159,7 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
162
159
|
options,
|
|
163
160
|
placeholder,
|
|
164
161
|
value: selected,
|
|
162
|
+
hasError,
|
|
165
163
|
keepTypedValue: false
|
|
166
164
|
})), /* @__PURE__ */ import_react.default.createElement(import_ds_popper.default, {
|
|
167
165
|
contentComponent: /* @__PURE__ */ import_react.default.createElement("div", {
|
|
@@ -193,5 +191,4 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
193
191
|
}
|
|
194
192
|
}
|
|
195
193
|
var DateRangeSelectorImpl_default = DateTimeRecurenceSelectorImpl;
|
|
196
|
-
module.exports = __toCommonJS(DateRangeSelectorImpl_exports);
|
|
197
194
|
//# sourceMappingURL=DateRangeSelectorImpl.js.map
|
|
@@ -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 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 } = 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 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';\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,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,mBAAmB,oDAA0B,qBAAqB;AAE1G,MAAM,EAAE,kBAAkB,sBAAsB,oDAA0B,YAAY;AAEtF,MAAM,sCAAsC,uBAAU;AAAA,EACpD,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,oBAAW,MAAM;AACf,YAAM,EAAE,aAAa,KAAK;AAC1B,YAAM,EAAE,aAAa,aAAa,KAAK;AACvC,eAAS,UAAU,WAAW;A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B;AAAA,UAAG,MAAM;AAAA,SAAa;AAAA,QACnG,eAAe,KAAK;AAAA,QACpB,eAAe,KAAK;AAAA,QACpB,gBAAgB,KAAK;AAAA,QACrB,mBAAmB,CAAC,SAClB,mDAAC;AAAA,UAAc,WAAW,kBAAkB,cAAc;AAAA,UAAG,MAAM,KAAK,OAAO,gBAAgB;AAAA,SAAG;AAAA,QAEpG;AAAA,OACF,CACF;AAAA,MAEF,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,kBAAkB,mDAAC,WAAI;AAAA,KACzB,CACF;AAAA,EAEJ;AACF;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,35 +4,29 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var src_exports = {};
|
|
29
22
|
__export(src_exports, {
|
|
30
23
|
CUSTOM_OPTION_VALUE: () => import_DSDateRangeSelector2.CUSTOM_OPTION_VALUE,
|
|
24
|
+
DSDateRangeSelector: () => import_DSDateRangeSelector.DSDateRangeSelector,
|
|
31
25
|
DateRangeRecurrenceSelectorWithSchema: () => import_DSDateRangeSelector.DateRangeRecurrenceSelectorWithSchema,
|
|
32
26
|
default: () => import_DSDateRangeSelector.default
|
|
33
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
29
|
var React = __toESM(require("react"));
|
|
35
30
|
var import_DSDateRangeSelector = __toESM(require("./DSDateRangeSelector"));
|
|
36
31
|
var import_DSDateRangeSelector2 = require("./DSDateRangeSelector");
|
|
37
|
-
module.exports = __toCommonJS(src_exports);
|
|
38
32
|
//# 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 {
|
|
5
|
-
"mappings": "
|
|
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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAoF;AACpF,kCAAoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var dropdownPreselectedOptions_exports = {};
|
|
29
22
|
__export(dropdownPreselectedOptions_exports, {
|
|
30
23
|
CUSTOM_OPTION_VALUE: () => CUSTOM_OPTION_VALUE,
|
|
31
24
|
DropdownOptionsTypes: () => DropdownOptionsTypes,
|
|
32
25
|
dropdownPreselectedOptions: () => dropdownPreselectedOptions
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(dropdownPreselectedOptions_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
const DropdownOptionsTypes = {
|
|
36
30
|
TODAY: "today",
|
|
@@ -67,5 +61,4 @@ const dropdownPreselectedOptions = [
|
|
|
67
61
|
}
|
|
68
62
|
];
|
|
69
63
|
const CUSTOM_OPTION_VALUE = "custom-option-value";
|
|
70
|
-
module.exports = __toCommonJS(dropdownPreselectedOptions_exports);
|
|
71
64
|
//# sourceMappingURL=dropdownPreselectedOptions.js.map
|
|
@@ -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
|
}
|
|
@@ -20,7 +20,8 @@ const DSDateRangeSelector = ({
|
|
|
20
20
|
startDate = null,
|
|
21
21
|
endDate = null,
|
|
22
22
|
displayFormatDay = "D",
|
|
23
|
-
disableCustomOption = false
|
|
23
|
+
disableCustomOption = false,
|
|
24
|
+
hasError = false
|
|
24
25
|
}) => /* @__PURE__ */ React2.createElement(DateRangeSelectorImpl, {
|
|
25
26
|
className,
|
|
26
27
|
containerProps,
|
|
@@ -32,7 +33,8 @@ const DSDateRangeSelector = ({
|
|
|
32
33
|
onChange,
|
|
33
34
|
placeholder,
|
|
34
35
|
startDate,
|
|
35
|
-
value
|
|
36
|
+
value,
|
|
37
|
+
hasError
|
|
36
38
|
});
|
|
37
39
|
const dateRangeRecurrenceSelectorProps = {
|
|
38
40
|
containerProps: PropTypes.object.description("Set of properties attached to the main container"),
|
|
@@ -51,11 +53,13 @@ const dateRangeRecurrenceSelectorProps = {
|
|
|
51
53
|
disableCustomOption: PropTypes.bool.description("disables custom options").defaultValue(false)
|
|
52
54
|
};
|
|
53
55
|
DSDateRangeSelector.propTypes = dateRangeRecurrenceSelectorProps;
|
|
56
|
+
DSDateRangeSelector.displayName = "DSDateRangeSelector";
|
|
54
57
|
const DateRangeRecurrenceSelectorWithSchema = describe(DSDateRangeSelector);
|
|
55
58
|
DateRangeRecurrenceSelectorWithSchema.propTypes = dateRangeRecurrenceSelectorProps;
|
|
56
59
|
var DSDateRangeSelector_default = DSDateRangeSelector;
|
|
57
60
|
export {
|
|
58
61
|
CUSTOM_OPTION_VALUE,
|
|
62
|
+
DSDateRangeSelector,
|
|
59
63
|
DateRangeRecurrenceSelectorWithSchema,
|
|
60
64
|
DropdownOptionsTypes,
|
|
61
65
|
DSDateRangeSelector_default as default,
|
|
@@ -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 { PropTypes, describe } from 'react-desc';\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}) => (\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 />\n);\n\nexport {
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AAEA,MAAM,sBAAsB,CAAC;AAAA,EAC3B,iBAAiB;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\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 <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\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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AAEA,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;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,WAAW;AAAA,MAEX,qCAAC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,CACF;AAKF,MAAM,mCAAmC;AAAA,EACvC,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,WAAW,UAAU,OAAO,YAAY,sBAAsB;AAAA,EAC9D,oBAAoB,UAAU,QAC5B,UAAU,MAAM;AAAA,IACd,OAAO,UAAU;AAAA,IACjB,OAAO,UAAU;AAAA,EACnB,CAAC,CACH,EAAE,YAAY,qCAAqC;AAAA,EACnD,UAAU,UAAU,KAAK,YAAY,0CAA0C;AAAA,EAC/E,aAAa,UAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,cAAc;AAAA,EAC3F,OAAO,UAAU,MAAM,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,gBAAgB;AAAA,EACzF,oBAAoB,UAAU,QAAQ,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
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/CustomOptionRender/CustomOptionRender.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\n\nconst { cssClassName } = convertPropToCssClassName(\n 'date-range-selector-customoption',\n);\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"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,EAAE,iBAAiB,0BACvB;
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,EAAE,iBAAiB,0BACvB,kCACF;AAWA,MAAM,qBAAqB,CAAC,EAAE,aAAa,EAAE,WAAW,gBAAgB;AACtE,QAAM,QAAQ,YAAY,UAAU,OAAO,YAAY,IAAI;AAC3D,QAAM,MAAM,UAAU,QAAQ,OAAO,YAAY,IAAI;AACrD,QAAM,UAAU,QAAQ,YAAY,SAAS;AAC7C,SAAO,qCAAC;AAAA,IAAG,WAAW;AAAA,KAAe,OAAQ;AAC/C;AAEA,IAAO,6BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -79,6 +79,8 @@ class DateTimeRecurenceSelectorImpl extends Component {
|
|
|
79
79
|
focusedInput: START_DATE,
|
|
80
80
|
customRange
|
|
81
81
|
};
|
|
82
|
+
this.onDatesChange = this.onDatesChange.bind(this);
|
|
83
|
+
this.onFocusChange = this.onFocusChange.bind(this);
|
|
82
84
|
const { customOptionRender: CustomOptionRender } = props;
|
|
83
85
|
advanceOption.label = /* @__PURE__ */ React2.createElement(CustomOptionRender, {
|
|
84
86
|
customRange
|
|
@@ -106,7 +108,8 @@ class DateTimeRecurenceSelectorImpl extends Component {
|
|
|
106
108
|
displayFormatDay,
|
|
107
109
|
className,
|
|
108
110
|
disableCustomOption,
|
|
109
|
-
containerProps
|
|
111
|
+
containerProps,
|
|
112
|
+
hasError
|
|
110
113
|
} = this.props;
|
|
111
114
|
const {
|
|
112
115
|
selected,
|
|
@@ -133,6 +136,7 @@ class DateTimeRecurenceSelectorImpl extends Component {
|
|
|
133
136
|
options,
|
|
134
137
|
placeholder,
|
|
135
138
|
value: selected,
|
|
139
|
+
hasError,
|
|
136
140
|
keepTypedValue: false
|
|
137
141
|
})), /* @__PURE__ */ React2.createElement(DSPopper, {
|
|
138
142
|
contentComponent: /* @__PURE__ */ React2.createElement("div", {
|
|
@@ -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 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 } = 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 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
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;
|
|
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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AACb;AACA,MAAM,EAAE,cAAc,kBAAkB,mBAAmB,0BAA0B,qBAAqB;AAE1G,MAAM,EAAE,kBAAkB,sBAAsB,0BAA0B,YAAY;AAEtF,MAAM,sCAAsC,UAAU;AAAA,EACpD,YAAY,OAAO;AACjB,UAAM,KAAK;AAoBb,oBAAW,MAAM;AACf,YAAM,EAAE,aAAa,KAAK;AAC1B,YAAM,EAAE,aAAa,aAAa,KAAK;AACvC,eAAS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B,iBAAiB;AAAA,UAAG,MAAM;AAAA,SAAa;AAAA,QACnG,eAAe,KAAK;AAAA,QACpB,eAAe,KAAK;AAAA,QACpB,gBAAgB,KAAK;AAAA,QACrB,mBAAmB,CAAC,SAClB,qCAAC;AAAA,UAAc,WAAW,kBAAkB,cAAc;AAAA,UAAG,MAAM,KAAK,OAAO,gBAAgB;AAAA,SAAG;AAAA,QAEpG;AAAA,OACF,CACF;AAAA,MAEF,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,kBAAkB,qCAAC,WAAI;AAAA,KACzB,CACF;AAAA,EAEJ;AACF;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
default as default2,
|
|
4
|
-
DateRangeRecurrenceSelectorWithSchema
|
|
5
|
-
} from "./DSDateRangeSelector";
|
|
2
|
+
import { default as default2, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from "./DSDateRangeSelector";
|
|
6
3
|
import { CUSTOM_OPTION_VALUE } from "./DSDateRangeSelector";
|
|
7
4
|
export {
|
|
8
5
|
CUSTOM_OPTION_VALUE,
|
|
6
|
+
DSDateRangeSelector,
|
|
9
7
|
DateRangeRecurrenceSelectorWithSchema,
|
|
10
8
|
default2 as default
|
|
11
9
|
};
|
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 {
|
|
5
|
-
"mappings": "AAAA;ACAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default, DateRangeRecurrenceSelectorWithSchema, DSDateRangeSelector } from './DSDateRangeSelector';\nexport { CUSTOM_OPTION_VALUE } from './DSDateRangeSelector';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/options/dropdownPreselectedOptions.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA;ACAO,MAAM,uBAAuB;AAAA,EAClC,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;
|
|
5
|
+
"mappings": "AAAA;ACAO,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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-range-selector",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.80",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Range Selector",
|
|
6
6
|
"files": [
|
|
@@ -50,12 +50,19 @@
|
|
|
50
50
|
"reportFile": "tests.xml",
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
55
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
56
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
57
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
58
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
59
|
+
},
|
|
53
60
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-classnames": "
|
|
55
|
-
"@elliemae/ds-date-picker": "
|
|
56
|
-
"@elliemae/ds-form": "
|
|
57
|
-
"@elliemae/ds-icons": "
|
|
58
|
-
"@elliemae/ds-popper": "
|
|
61
|
+
"@elliemae/ds-classnames": "workspace:*",
|
|
62
|
+
"@elliemae/ds-date-picker": "workspace:*",
|
|
63
|
+
"@elliemae/ds-form": "workspace:*",
|
|
64
|
+
"@elliemae/ds-icons": "workspace:*",
|
|
65
|
+
"@elliemae/ds-popper": "workspace:*",
|
|
59
66
|
"moment": "~2.29.1",
|
|
60
67
|
"react-dates": "~21.8.0",
|
|
61
68
|
"react-desc": "~4.1.3",
|
|
@@ -69,12 +76,5 @@
|
|
|
69
76
|
"publishConfig": {
|
|
70
77
|
"access": "public",
|
|
71
78
|
"typeSafety": false
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
75
|
-
"test": "node ../../scripts/testing/test.mjs",
|
|
76
|
-
"lint": "node ../../scripts/lint.mjs",
|
|
77
|
-
"dts": "node ../../scripts/dts.mjs",
|
|
78
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
79
79
|
}
|
|
80
|
-
}
|
|
80
|
+
}
|