@elliemae/ds-date-time-recurrence-picker 2.2.0-alpha.2 → 2.2.0-beta.0
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/cjs/DSDateTimeRecurrenceSelector.js +195 -226
- package/cjs/__test__/DSDateTimeRecurrenceSelector.test.js +30 -0
- package/cjs/components/AlertModal/DateTimeRangeModal.js +66 -87
- package/cjs/components/CustomOptionRender/CustomOptionRender.js +88 -81
- package/cjs/components/DateTimeRangeModal/DateTimeRangeModal.js +69 -81
- package/cjs/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +149 -105
- package/cjs/components/DateTimeRecurenceSelectorImpl.js +172 -142
- package/cjs/components/DayOfMonthPicker/DayOfMonthPicker.js +51 -64
- package/cjs/components/DayOfYearPicker/DayOfYearPicker.js +47 -62
- package/cjs/components/DaysOfWeekPicker/DaysOfWeekPicker.js +56 -66
- package/cjs/components/EndDate/EndDate.js +49 -68
- package/cjs/components/FieldWrapper/FieldWrapper.js +23 -42
- package/cjs/components/Forms/FormField.js +7 -36
- package/cjs/components/Forms/FormFieldGroup.js +7 -36
- package/cjs/components/Forms/FormGroup.js +11 -36
- package/cjs/components/Forms/FormLabel.js +7 -36
- package/cjs/components/LabelWrapper/LabelWrapper.js +23 -42
- package/cjs/components/RepeatPickerInput/RepeatPickerInput.js +58 -63
- package/cjs/components/StartDateTime/StartDateTime.js +41 -59
- package/cjs/components/TimeZonePicker/TimeZonePicker.js +43 -61
- package/cjs/components/ValidationMessage/ValidationMessage.js +23 -40
- package/cjs/components/helpers/nthday.js +13 -62
- package/cjs/index.js +29 -36
- package/cjs/options/dropdownDayOfMonthOptions.js +13 -44
- package/cjs/options/dropdownDayOfWeekOptions.js +28 -64
- package/cjs/options/dropdownDayOfYearOptions.js +13 -44
- package/cjs/options/dropdownPreselectedOptions.js +24 -57
- package/cjs/options/dropdownRepeatOptions.js +24 -57
- package/cjs/options/dropdownTimeZoneOptions.js +32 -67
- package/cjs/options/endTypesOptions.js +37 -75
- package/esm/DSDateTimeRecurrenceSelector.js +155 -180
- package/esm/__test__/DSDateTimeRecurrenceSelector.test.js +24 -0
- package/esm/components/AlertModal/DateTimeRangeModal.js +59 -58
- package/esm/components/CustomOptionRender/CustomOptionRender.js +79 -49
- package/esm/components/DateTimeRangeModal/DateTimeRangeModal.js +61 -52
- package/esm/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +131 -67
- package/esm/components/DateTimeRecurenceSelectorImpl.js +163 -111
- package/esm/components/DayOfMonthPicker/DayOfMonthPicker.js +45 -35
- package/esm/components/DayOfYearPicker/DayOfYearPicker.js +41 -33
- package/esm/components/DaysOfWeekPicker/DaysOfWeekPicker.js +50 -37
- package/esm/components/EndDate/EndDate.js +42 -39
- package/esm/components/FieldWrapper/FieldWrapper.js +17 -13
- package/esm/components/Forms/FormField.js +5 -7
- package/esm/components/Forms/FormFieldGroup.js +5 -7
- package/esm/components/Forms/FormGroup.js +9 -7
- package/esm/components/Forms/FormLabel.js +5 -7
- package/esm/components/LabelWrapper/LabelWrapper.js +17 -13
- package/esm/components/RepeatPickerInput/RepeatPickerInput.js +50 -34
- package/esm/components/StartDateTime/StartDateTime.js +33 -30
- package/esm/components/TimeZonePicker/TimeZonePicker.js +37 -32
- package/esm/components/ValidationMessage/ValidationMessage.js +17 -11
- package/esm/components/helpers/nthday.js +6 -33
- package/esm/index.js +8 -7
- package/esm/options/dropdownDayOfMonthOptions.js +9 -15
- package/esm/options/dropdownDayOfWeekOptions.js +24 -35
- package/esm/options/dropdownDayOfYearOptions.js +9 -15
- package/esm/options/dropdownPreselectedOptions.js +19 -28
- package/esm/options/dropdownRepeatOptions.js +19 -28
- package/esm/options/dropdownTimeZoneOptions.js +27 -38
- package/esm/options/endTypesOptions.js +31 -46
- package/package.json +6 -6
- package/types/DSDateTimeRecurrenceSelector.d.ts +1 -88
- package/cjs/DSDateTimeRecurrenceSelector.js.map +0 -7
- package/cjs/components/AlertModal/DateTimeRangeModal.js.map +0 -7
- package/cjs/components/CustomOptionRender/CustomOptionRender.js.map +0 -7
- package/cjs/components/DateTimeRangeModal/DateTimeRangeModal.js.map +0 -7
- package/cjs/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js.map +0 -7
- package/cjs/components/DateTimeRecurenceSelectorImpl.js.map +0 -7
- package/cjs/components/DayOfMonthPicker/DayOfMonthPicker.js.map +0 -7
- package/cjs/components/DayOfYearPicker/DayOfYearPicker.js.map +0 -7
- package/cjs/components/DaysOfWeekPicker/DaysOfWeekPicker.js.map +0 -7
- package/cjs/components/EndDate/EndDate.js.map +0 -7
- package/cjs/components/FieldWrapper/FieldWrapper.js.map +0 -7
- package/cjs/components/Forms/FormField.js.map +0 -7
- package/cjs/components/Forms/FormFieldGroup.js.map +0 -7
- package/cjs/components/Forms/FormGroup.js.map +0 -7
- package/cjs/components/Forms/FormLabel.js.map +0 -7
- package/cjs/components/LabelWrapper/LabelWrapper.js.map +0 -7
- package/cjs/components/RepeatPickerInput/RepeatPickerInput.js.map +0 -7
- package/cjs/components/StartDateTime/StartDateTime.js.map +0 -7
- package/cjs/components/TimeZonePicker/TimeZonePicker.js.map +0 -7
- package/cjs/components/ValidationMessage/ValidationMessage.js.map +0 -7
- package/cjs/components/helpers/nthday.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/options/dropdownDayOfMonthOptions.js.map +0 -7
- package/cjs/options/dropdownDayOfWeekOptions.js.map +0 -7
- package/cjs/options/dropdownDayOfYearOptions.js.map +0 -7
- package/cjs/options/dropdownPreselectedOptions.js.map +0 -7
- package/cjs/options/dropdownRepeatOptions.js.map +0 -7
- package/cjs/options/dropdownTimeZoneOptions.js.map +0 -7
- package/cjs/options/endTypesOptions.js.map +0 -7
- package/esm/DSDateTimeRecurrenceSelector.js.map +0 -7
- package/esm/components/AlertModal/DateTimeRangeModal.js.map +0 -7
- package/esm/components/CustomOptionRender/CustomOptionRender.js.map +0 -7
- package/esm/components/DateTimeRangeModal/DateTimeRangeModal.js.map +0 -7
- package/esm/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js.map +0 -7
- package/esm/components/DateTimeRecurenceSelectorImpl.js.map +0 -7
- package/esm/components/DayOfMonthPicker/DayOfMonthPicker.js.map +0 -7
- package/esm/components/DayOfYearPicker/DayOfYearPicker.js.map +0 -7
- package/esm/components/DaysOfWeekPicker/DaysOfWeekPicker.js.map +0 -7
- package/esm/components/EndDate/EndDate.js.map +0 -7
- package/esm/components/FieldWrapper/FieldWrapper.js.map +0 -7
- package/esm/components/Forms/FormField.js.map +0 -7
- package/esm/components/Forms/FormFieldGroup.js.map +0 -7
- package/esm/components/Forms/FormGroup.js.map +0 -7
- package/esm/components/Forms/FormLabel.js.map +0 -7
- package/esm/components/LabelWrapper/LabelWrapper.js.map +0 -7
- package/esm/components/RepeatPickerInput/RepeatPickerInput.js.map +0 -7
- package/esm/components/StartDateTime/StartDateTime.js.map +0 -7
- package/esm/components/TimeZonePicker/TimeZonePicker.js.map +0 -7
- package/esm/components/ValidationMessage/ValidationMessage.js.map +0 -7
- package/esm/components/helpers/nthday.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/options/dropdownDayOfMonthOptions.js.map +0 -7
- package/esm/options/dropdownDayOfWeekOptions.js.map +0 -7
- package/esm/options/dropdownDayOfYearOptions.js.map +0 -7
- package/esm/options/dropdownPreselectedOptions.js.map +0 -7
- package/esm/options/dropdownRepeatOptions.js.map +0 -7
- package/esm/options/dropdownTimeZoneOptions.js.map +0 -7
- package/esm/options/endTypesOptions.js.map +0 -7
|
@@ -1,69 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var import_ds_classnames = __toESM(require("@elliemae/ds-classnames"));
|
|
38
|
-
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
39
|
-
var import_DateTimeRangeModal = __toESM(require("./DateTimeRangeModal/DateTimeRangeModal"));
|
|
40
|
-
const { cssClassName, classNameElement, classNameBlock } = (0, import_ds_classnames.convertPropToCssClassName)("date-time-predefined-range-selector");
|
|
41
|
-
class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.find.js');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var lodash = require('lodash');
|
|
15
|
+
require('react-dates/initialize');
|
|
16
|
+
var reactSelect = require('react-select');
|
|
17
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
18
|
+
var dsForm = require('@elliemae/ds-form');
|
|
19
|
+
var DateTimeRangeModal = require('./DateTimeRangeModal/DateTimeRangeModal.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
+
|
|
27
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
|
|
29
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
|
+
const {
|
|
31
|
+
cssClassName,
|
|
32
|
+
classNameElement,
|
|
33
|
+
classNameBlock
|
|
34
|
+
} = dsClassnames.convertPropToCssClassName('date-time-predefined-range-selector');
|
|
35
|
+
|
|
36
|
+
class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
42
37
|
constructor(props) {
|
|
43
38
|
super(props);
|
|
39
|
+
|
|
44
40
|
this.onChange = () => {
|
|
45
|
-
const {
|
|
46
|
-
|
|
41
|
+
const {
|
|
42
|
+
onChange
|
|
43
|
+
} = this.props;
|
|
44
|
+
const {
|
|
45
|
+
customRange,
|
|
46
|
+
selected
|
|
47
|
+
} = this.state;
|
|
47
48
|
onChange(selected, customRange);
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
this.onCustomDateTimeRange = customRange => {
|
|
52
|
+
this.setState({
|
|
53
|
+
customRange
|
|
54
|
+
});
|
|
51
55
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
+
|
|
57
|
+
this.onChangeDropdown = value => {
|
|
58
|
+
const {
|
|
59
|
+
dropdownPreselectedOptions
|
|
60
|
+
} = this.props;
|
|
61
|
+
const selected = dropdownPreselectedOptions.find(op => op.value === value);
|
|
62
|
+
const {
|
|
63
|
+
onChange
|
|
64
|
+
} = this.props;
|
|
65
|
+
|
|
56
66
|
if (!selected) {
|
|
57
|
-
this.setState(
|
|
67
|
+
this.setState(previousState => ({
|
|
58
68
|
selected: value,
|
|
59
69
|
previousSelection: previousState.selected
|
|
60
70
|
}));
|
|
61
71
|
this.handleOpenModal();
|
|
62
72
|
} else if (selected) {
|
|
63
73
|
onChange(value);
|
|
64
|
-
this.setState({
|
|
74
|
+
this.setState({
|
|
75
|
+
selected: value,
|
|
76
|
+
openModal: false
|
|
77
|
+
});
|
|
65
78
|
}
|
|
66
79
|
};
|
|
80
|
+
|
|
67
81
|
this.handleConfirm = () => {
|
|
68
82
|
const {
|
|
69
83
|
onConfirmField,
|
|
@@ -74,48 +88,60 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
74
88
|
useTimezoneSelector,
|
|
75
89
|
allowMultipleDaysOfWeek
|
|
76
90
|
} = this.props;
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
const {
|
|
92
|
+
customRange
|
|
93
|
+
} = this.state;
|
|
94
|
+
this.props.advanceOption.label = /*#__PURE__*/_jsx__default["default"](CustomOptionRender, {
|
|
95
|
+
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|
|
96
|
+
customRange: customRange,
|
|
97
|
+
dayOfMonthOptionsEnable: dayOfMonthOptionsEnable,
|
|
98
|
+
dayOfWeekOptionsEnable: dayOfWeekOptionsEnable,
|
|
99
|
+
dayOfYearOptionsEnable: dayOfYearOptionsEnable,
|
|
100
|
+
useTimezoneSelector: useTimezoneSelector
|
|
85
101
|
});
|
|
86
102
|
this.onChange();
|
|
87
103
|
this.handleCloseModal();
|
|
88
104
|
onConfirmField();
|
|
89
105
|
};
|
|
106
|
+
|
|
90
107
|
this.handleReject = () => {
|
|
91
|
-
const {
|
|
108
|
+
const {
|
|
109
|
+
onRejectField
|
|
110
|
+
} = this.props;
|
|
92
111
|
this.handleActionClose();
|
|
93
112
|
onRejectField();
|
|
94
113
|
};
|
|
114
|
+
|
|
95
115
|
this.handleActionClose = () => {
|
|
96
|
-
this.setState(
|
|
116
|
+
this.setState(previousState => ({
|
|
97
117
|
selected: previousState.previousSelection
|
|
98
118
|
}));
|
|
99
119
|
this.handleCloseModal();
|
|
100
120
|
};
|
|
101
|
-
|
|
121
|
+
|
|
122
|
+
this.handleOpenModal = () => this.setState({
|
|
123
|
+
openModal: true
|
|
124
|
+
});
|
|
125
|
+
|
|
102
126
|
this.handleCloseModal = () => {
|
|
103
|
-
this.setState({
|
|
104
|
-
|
|
127
|
+
this.setState({
|
|
128
|
+
openModal: false
|
|
129
|
+
});
|
|
130
|
+
setTimeout(() => document.activeElement.blur(), 0); // https://github.com/reactjs/react-modal/issues/680
|
|
105
131
|
};
|
|
132
|
+
|
|
106
133
|
this.initCustomRange = props.customRange;
|
|
107
134
|
this.state = {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
135
|
+
// eslint-disable-next-line react/no-unused-state
|
|
136
|
+
previousCustomRange: _objectSpread({}, props.customRange),
|
|
111
137
|
openModal: props.openModal || false,
|
|
112
138
|
selected: props.value,
|
|
113
|
-
customRange: {
|
|
114
|
-
...props.customRange
|
|
115
|
-
}
|
|
139
|
+
customRange: _objectSpread({}, props.customRange)
|
|
116
140
|
};
|
|
141
|
+
|
|
117
142
|
if (props.value === props.advanceOption.value) {
|
|
118
|
-
|
|
143
|
+
// eslint-disable-next-line no-param-reassign
|
|
144
|
+
props.advanceOption.label = /*#__PURE__*/_jsx__default["default"](props.customOptionRender, {
|
|
119
145
|
allowMultipleDaysOfWeek: props.allowMultipleDaysOfWeek,
|
|
120
146
|
customRange: props.customRange,
|
|
121
147
|
dayOfMonthOptionsEnable: props.dayOfMonthOptionsEnable,
|
|
@@ -125,10 +151,12 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
125
151
|
});
|
|
126
152
|
}
|
|
127
153
|
}
|
|
154
|
+
|
|
128
155
|
static getDerivedStateFromProps(props, state) {
|
|
129
|
-
if (props.customRange && !
|
|
156
|
+
if (props.customRange && !lodash.isEqual(props.customRange, state.previousCustomRange)) {
|
|
130
157
|
if (props.value === props.advanceOption.value) {
|
|
131
|
-
|
|
158
|
+
// eslint-disable-next-line no-param-reassign
|
|
159
|
+
props.advanceOption.label = /*#__PURE__*/_jsx__default["default"](props.customOptionRender, {
|
|
132
160
|
allowMultipleDaysOfWeek: props.allowMultipleDaysOfWeek,
|
|
133
161
|
customRange: props.customRange,
|
|
134
162
|
dayOfMonthOptionsEnable: props.dayOfMonthOptionsEnable,
|
|
@@ -137,18 +165,17 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
137
165
|
useTimezoneSelector: props.useTimezoneSelector
|
|
138
166
|
});
|
|
139
167
|
}
|
|
168
|
+
|
|
140
169
|
return {
|
|
141
|
-
previousCustomRange: {
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
customRange: {
|
|
145
|
-
...props.customRange
|
|
146
|
-
},
|
|
170
|
+
previousCustomRange: _objectSpread({}, props.customRange),
|
|
171
|
+
customRange: _objectSpread({}, props.customRange),
|
|
147
172
|
selected: props.value
|
|
148
173
|
};
|
|
149
174
|
}
|
|
175
|
+
|
|
150
176
|
return null;
|
|
151
177
|
}
|
|
178
|
+
|
|
152
179
|
render() {
|
|
153
180
|
const {
|
|
154
181
|
placeholder,
|
|
@@ -185,70 +212,73 @@ class DateTimeRecurenceSelectorImpl extends import_react.Component {
|
|
|
185
212
|
displayYearCustomOption,
|
|
186
213
|
containerProps
|
|
187
214
|
} = this.props;
|
|
188
|
-
const {
|
|
215
|
+
const {
|
|
216
|
+
selected,
|
|
217
|
+
openModal,
|
|
218
|
+
customRange
|
|
219
|
+
} = this.state;
|
|
189
220
|
const options = [...dropdownPreselectedOptions, advanceOption];
|
|
190
|
-
return
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
validationMessage
|
|
221
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
222
|
+
className: "".concat(cssClassName, " ").concat(className),
|
|
223
|
+
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
224
|
+
className: "".concat(classNameBlock('container-selector'))
|
|
225
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSComboBox, {
|
|
226
|
+
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
227
|
+
components: {
|
|
228
|
+
Option: props => /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
|
|
229
|
+
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|
|
230
|
+
dayOfMonthOptionsEnable: dayOfMonthOptionsEnable,
|
|
231
|
+
dayOfWeekOptionsEnable: dayOfWeekOptionsEnable,
|
|
232
|
+
dayOfYearOptionsEnable: dayOfYearOptionsEnable,
|
|
233
|
+
useTimezoneSelector: useTimezoneSelector
|
|
234
|
+
})),
|
|
235
|
+
IndicatorSeparator: () => null
|
|
236
|
+
},
|
|
237
|
+
onChange: this.onChangeDropdown,
|
|
238
|
+
onKeyDown: this.onKeyDown,
|
|
239
|
+
options: options,
|
|
240
|
+
placeholder: placeholder,
|
|
241
|
+
value: selected
|
|
242
|
+
})), /*#__PURE__*/_jsx__default["default"](DateTimeRangeModal, {
|
|
243
|
+
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|
|
244
|
+
appElement: appElement,
|
|
245
|
+
confirmLabel: confirmLabel,
|
|
246
|
+
dayOfMonthAsCurrentDateOptions: dayOfMonthAsCurrentDateOptions,
|
|
247
|
+
dayOfMonthOptionsEnable: dayOfMonthOptionsEnable,
|
|
248
|
+
dayOfWeekOptionsEnable: dayOfWeekOptionsEnable,
|
|
249
|
+
dayOfYearAsCurrentDateOptions: dayOfYearAsCurrentDateOptions,
|
|
250
|
+
dayOfYearOptionsEnable: dayOfYearOptionsEnable,
|
|
251
|
+
displayCurrentMonthYear: displayCurrentMonthYear,
|
|
252
|
+
displayMonthCustomOption: displayMonthCustomOption,
|
|
253
|
+
displayYearCustomOption: displayYearCustomOption,
|
|
254
|
+
dropdownDayOfMonthOptions: dropdownDayOfMonthOptions,
|
|
255
|
+
dropdownDayOfWeekOptions: dropdownDayOfWeekOptions,
|
|
256
|
+
dropdownDayOfYearOptions: dropdownDayOfYearOptions,
|
|
257
|
+
dropdownRepeatOptions: dropdownRepeatOptions,
|
|
258
|
+
endDayBlocked: endDayBlocked,
|
|
259
|
+
endTimesOptions: endTimesOptions,
|
|
260
|
+
endTypesOptions: endTypesOptions,
|
|
261
|
+
isOpen: openModal,
|
|
262
|
+
isValidRecurrence: isValidRecurrence,
|
|
263
|
+
modalSize: modalSize,
|
|
264
|
+
modalTitle: modalTitle,
|
|
265
|
+
modalType: modalType,
|
|
266
|
+
onClose: this.handleActionClose,
|
|
267
|
+
onConfirmField: this.handleConfirm,
|
|
268
|
+
onCustomDateTimeRange: this.onCustomDateTimeRange,
|
|
269
|
+
onRejectField: this.handleReject,
|
|
270
|
+
placeholder: placeholder,
|
|
271
|
+
rangeValue: customRange,
|
|
272
|
+
rejectLabel: rejectLabel,
|
|
273
|
+
repeatFrecuencyCustomProps: repeatFrecuencyCustomProps,
|
|
274
|
+
startDayBlocked: startDayBlocked,
|
|
275
|
+
timeZoneOptions: timeZoneOptions,
|
|
276
|
+
useTimezoneSelector: useTimezoneSelector,
|
|
277
|
+
validationMessage: validationMessage
|
|
278
|
+
})]
|
|
249
279
|
}));
|
|
250
280
|
}
|
|
281
|
+
|
|
251
282
|
}
|
|
252
|
-
|
|
253
|
-
module.exports =
|
|
254
|
-
//# sourceMappingURL=DateTimeRecurenceSelectorImpl.js.map
|
|
283
|
+
|
|
284
|
+
module.exports = DateTimeRecurenceSelectorImpl;
|
|
@@ -1,87 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
35
|
-
var import_nthday = __toESM(require("../helpers/nthday"));
|
|
36
|
-
var import_dropdownDayOfMonthOptions = __toESM(require("../../options/dropdownDayOfMonthOptions"));
|
|
37
|
-
var import_FormLabel = __toESM(require("../Forms/FormLabel"));
|
|
38
|
-
var import_FormFieldGroup = __toESM(require("../Forms/FormFieldGroup"));
|
|
39
|
-
var import_FormGroup = __toESM(require("../Forms/FormGroup"));
|
|
40
|
-
const DaysOfMonthPicker = ({
|
|
41
|
-
onDayChange = () => null,
|
|
42
|
-
dayOfMonthValue = import_dropdownDayOfMonthOptions.dropdownDayOfMonthOptions[0].value,
|
|
43
|
-
dayOfMonthOptions = import_dropdownDayOfMonthOptions.dropdownDayOfMonthOptions,
|
|
44
|
-
displayOptionsAsCurrentDate = true,
|
|
45
|
-
currentDate = null,
|
|
46
|
-
inputLabel = "On",
|
|
47
|
-
dayOfMonthAsCurrentDateOptions,
|
|
48
|
-
displayMonthCustomOption
|
|
49
|
-
}) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.find.js');
|
|
8
|
+
require('react');
|
|
9
|
+
var dsForm = require('@elliemae/ds-form');
|
|
10
|
+
var nthday = require('../helpers/nthday.js');
|
|
11
|
+
var dropdownDayOfMonthOptions = require('../../options/dropdownDayOfMonthOptions.js');
|
|
12
|
+
var FormLabel = require('../Forms/FormLabel.js');
|
|
13
|
+
var FormFieldGroup = require('../Forms/FormFieldGroup.js');
|
|
14
|
+
var FormGroup = require('../Forms/FormGroup.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
19
|
+
|
|
20
|
+
const DaysOfMonthPicker = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
onDayChange = () => null,
|
|
23
|
+
dayOfMonthValue = dropdownDayOfMonthOptions.dropdownDayOfMonthOptions[0].value,
|
|
24
|
+
dayOfMonthOptions = dropdownDayOfMonthOptions.dropdownDayOfMonthOptions,
|
|
25
|
+
displayOptionsAsCurrentDate = true,
|
|
26
|
+
currentDate = null,
|
|
27
|
+
inputLabel = 'On',
|
|
28
|
+
dayOfMonthAsCurrentDateOptions,
|
|
29
|
+
displayMonthCustomOption
|
|
30
|
+
} = _ref;
|
|
50
31
|
let options = dayOfMonthOptions;
|
|
32
|
+
|
|
51
33
|
if (displayOptionsAsCurrentDate) {
|
|
52
|
-
const numberoption =
|
|
53
|
-
const nthoption =
|
|
34
|
+
const numberoption = "on the ".concat(currentDate.format('Do'), " of the month");
|
|
35
|
+
const nthoption = "on the ".concat(nthday.nthDay(currentDate.toDate()), " ").concat(currentDate.format('dddd'), " of the month");
|
|
54
36
|
options = [];
|
|
55
|
-
|
|
37
|
+
|
|
38
|
+
if (dayOfMonthAsCurrentDateOptions.indexOf('numberOfMonth') > -1) {
|
|
56
39
|
options.push({
|
|
57
|
-
number: currentDate.format(
|
|
40
|
+
number: currentDate.format('DD'),
|
|
58
41
|
label: numberoption,
|
|
59
42
|
value: numberoption,
|
|
60
|
-
dayOfMonthRepeatPickerKey:
|
|
43
|
+
dayOfMonthRepeatPickerKey: 'numberOfMonth'
|
|
61
44
|
});
|
|
62
45
|
}
|
|
63
|
-
|
|
46
|
+
|
|
47
|
+
if (dayOfMonthAsCurrentDateOptions.indexOf('dayOfTheWeekOfMonth') > -1) {
|
|
64
48
|
options.push({
|
|
65
|
-
numberLabel:
|
|
49
|
+
numberLabel: "".concat(nthday.nthDay(currentDate.toDate()), " ").concat(currentDate.format('dddd')),
|
|
66
50
|
label: nthoption,
|
|
67
51
|
value: nthoption,
|
|
68
|
-
dayOfMonthRepeatPickerKey:
|
|
52
|
+
dayOfMonthRepeatPickerKey: 'dayOfTheWeekOfMonth'
|
|
69
53
|
});
|
|
70
54
|
}
|
|
55
|
+
|
|
71
56
|
if (displayMonthCustomOption) {
|
|
72
57
|
options = [...options, ...dayOfMonthOptions];
|
|
73
58
|
}
|
|
74
59
|
}
|
|
75
|
-
|
|
60
|
+
|
|
61
|
+
const selected = options.find(option => option.value === dayOfMonthValue) ? dayOfMonthValue : null;
|
|
62
|
+
|
|
76
63
|
if (!selected) {
|
|
77
64
|
onDayChange(options[0].value, options[0]);
|
|
78
65
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
options,
|
|
66
|
+
|
|
67
|
+
return /*#__PURE__*/_jsx__default["default"](FormGroup, {}, void 0, /*#__PURE__*/_jsx__default["default"](FormLabel, {}, void 0, inputLabel), /*#__PURE__*/_jsx__default["default"](FormFieldGroup, {}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSComboBox, {
|
|
68
|
+
onChange: value => onDayChange(value, options.find(o => o.value === value)),
|
|
69
|
+
options: options,
|
|
82
70
|
value: selected
|
|
83
71
|
})));
|
|
84
72
|
};
|
|
85
|
-
|
|
86
|
-
module.exports =
|
|
87
|
-
//# sourceMappingURL=DayOfMonthPicker.js.map
|
|
73
|
+
|
|
74
|
+
module.exports = DaysOfMonthPicker;
|