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