@elliemae/ds-date-time-recurrence-picker 2.0.0-alpha.10 → 2.0.0-alpha.14
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 +90 -87
- package/cjs/components/AlertModal/DateTimeRangeModal.js +53 -50
- package/cjs/components/CustomOptionRender/CustomOptionRender.js +27 -26
- package/cjs/components/DateTimeRangeModal/DateTimeRangeModal.js +14 -12
- package/cjs/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +12 -7
- package/cjs/components/DateTimeRecurenceSelectorImpl.js +31 -24
- package/cjs/components/DayOfMonthPicker/DayOfMonthPicker.js +20 -16
- package/cjs/components/DayOfYearPicker/DayOfYearPicker.js +19 -15
- package/cjs/components/DaysOfWeekPicker/DaysOfWeekPicker.js +32 -30
- package/cjs/components/EndDate/EndDate.js +30 -28
- package/cjs/components/FieldWrapper/FieldWrapper.js +5 -4
- package/cjs/components/LabelWrapper/LabelWrapper.js +5 -4
- package/cjs/components/RepeatPickerInput/RepeatPickerInput.js +19 -15
- package/cjs/components/StartDateTime/StartDateTime.js +22 -19
- package/cjs/components/TimeZonePicker/TimeZonePicker.js +24 -22
- package/cjs/components/ValidationMessage/ValidationMessage.js +8 -5
- package/esm/DSDateTimeRecurrenceSelector.js +90 -87
- package/esm/components/AlertModal/DateTimeRangeModal.js +53 -50
- package/esm/components/CustomOptionRender/CustomOptionRender.js +27 -26
- package/esm/components/DateTimeRangeModal/DateTimeRangeModal.js +14 -11
- package/esm/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +12 -7
- package/esm/components/DateTimeRecurenceSelectorImpl.js +29 -21
- package/esm/components/DayOfMonthPicker/DayOfMonthPicker.js +19 -14
- package/esm/components/DayOfYearPicker/DayOfYearPicker.js +18 -13
- package/esm/components/DaysOfWeekPicker/DaysOfWeekPicker.js +31 -25
- package/esm/components/EndDate/EndDate.js +30 -27
- package/esm/components/FieldWrapper/FieldWrapper.js +5 -4
- package/esm/components/LabelWrapper/LabelWrapper.js +5 -4
- package/esm/components/RepeatPickerInput/RepeatPickerInput.js +17 -11
- package/esm/components/StartDateTime/StartDateTime.js +22 -19
- package/esm/components/TimeZonePicker/TimeZonePicker.js +24 -21
- package/esm/components/ValidationMessage/ValidationMessage.js +8 -5
- package/package.json +12 -7
- package/types/DSDateTimeRecurrenceSelector.d.ts +276 -40
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -19,93 +19,96 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
19
|
|
|
20
20
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
21
|
|
|
22
|
-
const DSDateTimeRecurrenceSelector =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
22
|
+
const DSDateTimeRecurrenceSelector = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
containerProps = {},
|
|
25
|
+
className = '',
|
|
26
|
+
preselectedOptions = dropdownPreselectedOptions.dropdownPreselectedOptions,
|
|
27
|
+
repeatOptions = dropdownRepeatOptions.dropdownRepeatOptions,
|
|
28
|
+
endTypesOptions: endTypesOptions$1 = endTypesOptions.endTypesOptions,
|
|
29
|
+
endTimesOptions = endTypesOptions.endTimesOptions,
|
|
30
|
+
dayOfWeekOptions = dropdownDayOfWeekOptions.dropdownDayOfWeekOptions,
|
|
31
|
+
dayOfWeekOptionsEnable = true,
|
|
32
|
+
dayOfMonthOptions = dropdownDayOfMonthOptions.dropdownDayOfMonthOptions,
|
|
33
|
+
dayOfMonthOptionsEnable = true,
|
|
34
|
+
dayOfYearOptions = dropdownDayOfYearOptions.dropdownDayOfYearOptions,
|
|
35
|
+
dayOfYearOptionsEnable = true,
|
|
36
|
+
displayMonthCustomOption = false,
|
|
37
|
+
displayYearCustomOption = false,
|
|
38
|
+
dayOfMonthAsCurrentDateOptions = ['numberOfMonth', 'dayOfTheWeekOfMonth'],
|
|
39
|
+
dayOfYearAsCurrentDateOptions = ['numberOfYear', 'dayOfTheMonthOfYear'],
|
|
40
|
+
onChange = () => null,
|
|
41
|
+
placeholder = 'Select Range',
|
|
42
|
+
modalSize = 'medium',
|
|
43
|
+
modalTitle = 'Report Scheduling',
|
|
44
|
+
confirmLabel = 'Apply',
|
|
45
|
+
rejectLabel = 'Cancel',
|
|
46
|
+
modalType = 'confirm',
|
|
47
|
+
onConfirmField = () => null,
|
|
48
|
+
onRejectField = () => null,
|
|
49
|
+
openModal = false,
|
|
50
|
+
appElement = '#root',
|
|
51
|
+
value = null,
|
|
52
|
+
customRange = null,
|
|
53
|
+
customOptionRender = CustomOptionRender,
|
|
54
|
+
displayCurrentMonthYear = true,
|
|
55
|
+
timeZoneOptions = dropdownTimeZoneOptions.dropdownTimeZoneOptions,
|
|
56
|
+
useTimezoneSelector = false,
|
|
57
|
+
allowMultipleDaysOfWeek = false,
|
|
58
|
+
advanceOption = {
|
|
59
|
+
label: 'Custom',
|
|
60
|
+
value: 'custom-range',
|
|
61
|
+
isAdvance: true
|
|
62
|
+
},
|
|
63
|
+
isValidRecurrence = () => true,
|
|
64
|
+
validationMessage = '',
|
|
65
|
+
endDayBlocked = () => false,
|
|
66
|
+
startDayBlocked = () => false,
|
|
67
|
+
repeatFrecuencyCustomProps = {}
|
|
68
|
+
} = _ref;
|
|
69
|
+
return /*#__PURE__*/_jsx__default["default"](DateTimeRecurenceSelectorImpl, {
|
|
70
|
+
advanceOption: advanceOption,
|
|
71
|
+
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|
|
72
|
+
appElement: appElement,
|
|
73
|
+
className: className,
|
|
74
|
+
confirmLabel: confirmLabel,
|
|
75
|
+
containerProps: containerProps,
|
|
76
|
+
customOptionRender: customOptionRender,
|
|
77
|
+
customRange: customRange,
|
|
78
|
+
dayOfMonthAsCurrentDateOptions: dayOfMonthAsCurrentDateOptions,
|
|
79
|
+
dayOfMonthOptionsEnable: dayOfMonthOptionsEnable,
|
|
80
|
+
dayOfWeekOptionsEnable: dayOfWeekOptionsEnable,
|
|
81
|
+
dayOfYearAsCurrentDateOptions: dayOfYearAsCurrentDateOptions,
|
|
82
|
+
dayOfYearOptionsEnable: dayOfYearOptionsEnable,
|
|
83
|
+
displayCurrentMonthYear: displayCurrentMonthYear,
|
|
84
|
+
displayMonthCustomOption: displayMonthCustomOption,
|
|
85
|
+
displayYearCustomOption: displayYearCustomOption,
|
|
86
|
+
dropdownDayOfMonthOptions: dayOfMonthOptions,
|
|
87
|
+
dropdownDayOfWeekOptions: dayOfWeekOptions,
|
|
88
|
+
dropdownDayOfYearOptions: dayOfYearOptions,
|
|
89
|
+
dropdownPreselectedOptions: preselectedOptions,
|
|
90
|
+
dropdownRepeatOptions: repeatOptions,
|
|
91
|
+
endDayBlocked: endDayBlocked,
|
|
92
|
+
endTimesOptions: endTimesOptions,
|
|
93
|
+
endTypesOptions: endTypesOptions$1,
|
|
94
|
+
isValidRecurrence: isValidRecurrence,
|
|
95
|
+
modalSize: modalSize,
|
|
96
|
+
modalTitle: modalTitle,
|
|
97
|
+
modalType: modalType,
|
|
98
|
+
onChange: onChange,
|
|
99
|
+
onConfirmField: onConfirmField,
|
|
100
|
+
onRejectField: onRejectField,
|
|
101
|
+
openModal: openModal,
|
|
102
|
+
placeholder: placeholder,
|
|
103
|
+
rejectLabel: rejectLabel,
|
|
104
|
+
repeatFrecuencyCustomProps: repeatFrecuencyCustomProps,
|
|
105
|
+
startDayBlocked: startDayBlocked,
|
|
106
|
+
timeZoneOptions: timeZoneOptions,
|
|
107
|
+
useTimezoneSelector: useTimezoneSelector,
|
|
108
|
+
validationMessage: validationMessage,
|
|
109
|
+
value: value
|
|
110
|
+
});
|
|
111
|
+
};
|
|
109
112
|
const dateTimeRecurrenceSelectorProps = {
|
|
110
113
|
containerProps: reactDesc.PropTypes.shape({}).description('Set of Properties attached to the main container'),
|
|
111
114
|
className: reactDesc.PropTypes.string.description('html class attribute'),
|
|
@@ -10,55 +10,58 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
11
11
|
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
12
12
|
|
|
13
|
-
const DateTimeRangeModal =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
13
|
+
const DateTimeRangeModal = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
isOpen = false,
|
|
16
|
+
onClose = () => null,
|
|
17
|
+
modalTitle = 'Report Scheduling',
|
|
18
|
+
modalSize = 'medium ',
|
|
19
|
+
confirmLabel = 'Apply',
|
|
20
|
+
rejectLabel = 'Cancel',
|
|
21
|
+
modalType = 'confirm',
|
|
22
|
+
onConfirmField = () => null,
|
|
23
|
+
onRejectField = () => null,
|
|
24
|
+
appElement = null,
|
|
25
|
+
onCustomDateTimeRange = () => null,
|
|
26
|
+
displayCurrentMonthYear = true,
|
|
27
|
+
dropdownDayOfMonthOptions = [],
|
|
28
|
+
dropdownDayOfWeekOptions = [],
|
|
29
|
+
dropdownDayOfYearOptions = [],
|
|
30
|
+
dropdownRepeatOptions = [],
|
|
31
|
+
rangeValue = {},
|
|
32
|
+
dayOfMonthOptionsEnable = true,
|
|
33
|
+
dayOfWeekOptionsEnable = true,
|
|
34
|
+
dayOfYearOptionsEnable = true,
|
|
35
|
+
timeZoneOptions = [],
|
|
36
|
+
useTimezoneSelector = false,
|
|
37
|
+
allowMultipleDaysOfWeek = false
|
|
38
|
+
} = _ref;
|
|
39
|
+
return /*#__PURE__*/_jsx__default["default"](DSModal__default["default"], {
|
|
40
|
+
appElement: appElement,
|
|
41
|
+
confirmLabel: confirmLabel,
|
|
42
|
+
isOpen: isOpen,
|
|
43
|
+
modalTitle: modalTitle,
|
|
44
|
+
modalType: modalType,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
onConfirm: onConfirmField,
|
|
47
|
+
onReject: onRejectField,
|
|
48
|
+
rejectLabel: rejectLabel,
|
|
49
|
+
size: modalSize
|
|
50
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](DateTimeRangeModalImpl, {
|
|
51
|
+
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|
|
52
|
+
dayOfMonthOptionsEnable: dayOfMonthOptionsEnable,
|
|
53
|
+
dayOfWeekOptionsEnable: dayOfWeekOptionsEnable,
|
|
54
|
+
dayOfYearOptionsEnable: dayOfYearOptionsEnable,
|
|
55
|
+
displayCurrentMonthYear: displayCurrentMonthYear,
|
|
56
|
+
dropdownDayOfMonthOptions: dropdownDayOfMonthOptions,
|
|
57
|
+
dropdownDayOfWeekOptions: dropdownDayOfWeekOptions,
|
|
58
|
+
dropdownDayOfYearOptions: dropdownDayOfYearOptions,
|
|
59
|
+
dropdownRepeatOptions: dropdownRepeatOptions,
|
|
60
|
+
onCustomDateTimeRange: onCustomDateTimeRange,
|
|
61
|
+
rangeValue: rangeValue,
|
|
62
|
+
timeZoneOptions: timeZoneOptions,
|
|
63
|
+
useTimezoneSelector: useTimezoneSelector
|
|
64
|
+
}));
|
|
65
|
+
};
|
|
63
66
|
|
|
64
67
|
module.exports = DateTimeRangeModal;
|
|
@@ -48,44 +48,45 @@ timezonePickerInput
|
|
|
48
48
|
}
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
const CustomOptionRender =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
const CustomOptionRender = _ref => {
|
|
52
|
+
let {
|
|
53
|
+
customRange: {
|
|
54
|
+
startDateInput,
|
|
55
|
+
startTimeInput,
|
|
56
|
+
qtyRepeatPickerInput,
|
|
57
|
+
typeRepeatPickerInput,
|
|
58
|
+
dayWeekRepeatPickerInput,
|
|
59
|
+
endDateInput,
|
|
60
|
+
endTypeInput,
|
|
61
|
+
endTimesInput,
|
|
62
|
+
dayOfMonthRepeatPickerInput,
|
|
63
|
+
dayOfYearRepeatPickerInput,
|
|
64
|
+
timezonePickerInput
|
|
65
|
+
},
|
|
66
|
+
dayOfMonthOptionsEnable,
|
|
67
|
+
dayOfWeekOptionsEnable,
|
|
68
|
+
dayOfYearOptionsEnable,
|
|
69
|
+
useTimezoneSelector
|
|
70
|
+
} = _ref;
|
|
70
71
|
let display = 'Custom'; // frequency
|
|
71
72
|
|
|
72
|
-
if (qtyRepeatPickerInput === 1) display = typeRepeat[typeRepeatPickerInput];else display =
|
|
73
|
+
if (qtyRepeatPickerInput === 1) display = typeRepeat[typeRepeatPickerInput];else display = "every ".concat(qtyRepeatPickerInput, " ").concat(typeRepeatPickerInput, "s"); // type
|
|
73
74
|
|
|
74
75
|
if (typeRepeatPickerInput === dropdownRepeatOptions.DropdownRepeatOptionsTypes.WEEK) {
|
|
75
|
-
display += dayOfWeekOptionsEnable ?
|
|
76
|
+
display += dayOfWeekOptionsEnable ? " on ".concat(dayWeekRepeatPickerInput, " ") : '';
|
|
76
77
|
} else if (typeRepeatPickerInput === dropdownRepeatOptions.DropdownRepeatOptionsTypes.MONTH) {
|
|
77
|
-
display += dayOfMonthOptionsEnable ?
|
|
78
|
+
display += dayOfMonthOptionsEnable ? " ".concat(dayOfMonthRepeatPickerInput, " ") : '';
|
|
78
79
|
} else if (typeRepeatPickerInput === dropdownRepeatOptions.DropdownRepeatOptionsTypes.YEAR) {
|
|
79
|
-
display += dayOfYearOptionsEnable ?
|
|
80
|
+
display += dayOfYearOptionsEnable ? " ".concat(dayOfYearRepeatPickerInput, " ") : '';
|
|
80
81
|
} // start & end
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
if (startDateInput && startDateInput.format) {
|
|
84
|
-
display +=
|
|
85
|
+
display += " starting on ".concat(startDateInput.format('MM/DD/YYYY'), " at ").concat(startTimeInput.format('HH:mm A'));
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
if (endTypeInput === endTypesOptions.endTypes.ON) display +=
|
|
88
|
-
if (useTimezoneSelector && timezonePickerInput) display +=
|
|
88
|
+
if (endTypeInput === endTypesOptions.endTypes.ON) display += ", until ".concat(endDateInput.format('MM/DD/YYYY'), " ");else if (endTypeInput === endTypesOptions.endTypes.AFTER) display += ", for ".concat(endTimesInput, " times");
|
|
89
|
+
if (useTimezoneSelector && timezonePickerInput) display += " [".concat(timezonePickerInput, "]");
|
|
89
90
|
return /*#__PURE__*/_jsx__default["default"]("em", {}, void 0, display);
|
|
90
91
|
};
|
|
91
92
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
-
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var DSModal = require('@elliemae/ds-modal');
|
|
7
7
|
var DateTimeRangeModalImpl = require('../DateTimeRangeModalImpl/DateTimeRangeModalImpl.js');
|
|
@@ -9,28 +9,30 @@ var DateTimeRangeModalImpl = require('../DateTimeRangeModalImpl/DateTimeRangeMod
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
11
11
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
13
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
13
|
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
15
14
|
|
|
16
15
|
class DateTimeRangeModal extends React__default["default"].Component {
|
|
17
|
-
constructor(
|
|
18
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
var _this;
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
super(...arguments);
|
|
20
|
+
_this = this;
|
|
21
|
+
this.state = {
|
|
21
22
|
isValid: true
|
|
22
|
-
}
|
|
23
|
+
};
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
this.updateIsValid = function () {
|
|
25
26
|
const {
|
|
26
27
|
onCustomDateTimeRange = () => null,
|
|
27
28
|
isValidRecurrence
|
|
28
|
-
} =
|
|
29
|
-
onCustomDateTimeRange(...
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
} = _this.props;
|
|
30
|
+
onCustomDateTimeRange(...arguments);
|
|
31
|
+
|
|
32
|
+
_this.setState({
|
|
33
|
+
isValid: isValidRecurrence(...arguments)
|
|
32
34
|
});
|
|
33
|
-
}
|
|
35
|
+
};
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
render() {
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
5
|
require('core-js/modules/es.string.replace.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
11
|
var React = require('react');
|
|
7
12
|
var moment = require('moment');
|
|
8
13
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
@@ -38,20 +43,20 @@ class DateTimePredefinedRangeSelectorImpl extends React.Component {
|
|
|
38
43
|
constructor(props) {
|
|
39
44
|
super(props);
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
this.onChange = () => {
|
|
42
47
|
const {
|
|
43
48
|
onCustomDateTimeRange
|
|
44
49
|
} = this.props;
|
|
45
50
|
onCustomDateTimeRange(this.state);
|
|
46
|
-
}
|
|
51
|
+
};
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
this.onQtyRepeatPickerInput = value => {
|
|
49
54
|
this.setState({
|
|
50
55
|
qtyRepeatPickerInput: value.replace(/[^0-9]/g, '')
|
|
51
56
|
}, () => {
|
|
52
57
|
this.onChange();
|
|
53
58
|
});
|
|
54
|
-
}
|
|
59
|
+
};
|
|
55
60
|
|
|
56
61
|
const {
|
|
57
62
|
dropdownDayOfMonthOptions,
|
|
@@ -177,7 +182,7 @@ class DateTimePredefinedRangeSelectorImpl extends React.Component {
|
|
|
177
182
|
dayOfMonthRepeatPickerInput: value,
|
|
178
183
|
dayOfMonthRepeatPickerKey: option.dayOfMonthRepeatPickerKey,
|
|
179
184
|
alertModal: option.number > 28 || (option.numberLabel || '').includes('Fifth'),
|
|
180
|
-
alertReplace: option.number ||
|
|
185
|
+
alertReplace: option.number || "".concat(option.numberLabel, " ")
|
|
181
186
|
}, () => {
|
|
182
187
|
this.onChange();
|
|
183
188
|
});
|
|
@@ -240,7 +245,7 @@ class DateTimePredefinedRangeSelectorImpl extends React.Component {
|
|
|
240
245
|
displayYearCustomOption
|
|
241
246
|
} = this.props;
|
|
242
247
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
243
|
-
className:
|
|
248
|
+
className: "".concat(cssClassName)
|
|
244
249
|
}, void 0, /*#__PURE__*/_jsx__default["default"](StartDateTime, {
|
|
245
250
|
onStartDateChange: this.onStartDateChangeInput,
|
|
246
251
|
onStartTimeChange: this.onStartTimeChangeInput,
|
|
@@ -292,7 +297,7 @@ class DateTimePredefinedRangeSelectorImpl extends React.Component {
|
|
|
292
297
|
}), /*#__PURE__*/_jsx__default["default"](DSModal__default["default"], {
|
|
293
298
|
className: "datetime-alert-modal",
|
|
294
299
|
isOpen: alertModal,
|
|
295
|
-
modalTitle:
|
|
300
|
+
modalTitle: "Some months have fewer than ".concat(alertReplace, " days") // modalType={modalType}
|
|
296
301
|
,
|
|
297
302
|
onClose: () => this.setState({
|
|
298
303
|
alertModal: false
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
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');
|
|
5
13
|
var React = require('react');
|
|
6
14
|
var lodash = require('lodash');
|
|
7
15
|
require('react-dates/initialize');
|
|
8
16
|
var reactSelect = require('react-select');
|
|
9
17
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
10
|
-
var
|
|
18
|
+
var dsForm = require('@elliemae/ds-form');
|
|
11
19
|
var DateTimeRangeModal = require('./DateTimeRangeModal/DateTimeRangeModal.js');
|
|
12
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
21
|
|
|
14
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
23
|
|
|
16
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
24
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
-
var
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
19
26
|
|
|
20
27
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
28
|
|
|
@@ -30,7 +37,7 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
30
37
|
constructor(props) {
|
|
31
38
|
super(props);
|
|
32
39
|
|
|
33
|
-
|
|
40
|
+
this.onChange = () => {
|
|
34
41
|
const {
|
|
35
42
|
onChange
|
|
36
43
|
} = this.props;
|
|
@@ -39,15 +46,15 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
39
46
|
selected
|
|
40
47
|
} = this.state;
|
|
41
48
|
onChange(selected, customRange);
|
|
42
|
-
}
|
|
49
|
+
};
|
|
43
50
|
|
|
44
|
-
|
|
51
|
+
this.onCustomDateTimeRange = customRange => {
|
|
45
52
|
this.setState({
|
|
46
53
|
customRange
|
|
47
54
|
});
|
|
48
|
-
}
|
|
55
|
+
};
|
|
49
56
|
|
|
50
|
-
|
|
57
|
+
this.onChangeDropdown = value => {
|
|
51
58
|
const {
|
|
52
59
|
dropdownPreselectedOptions
|
|
53
60
|
} = this.props;
|
|
@@ -69,9 +76,9 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
69
76
|
openModal: false
|
|
70
77
|
});
|
|
71
78
|
}
|
|
72
|
-
}
|
|
79
|
+
};
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
this.handleConfirm = () => {
|
|
75
82
|
const {
|
|
76
83
|
onConfirmField,
|
|
77
84
|
customOptionRender: CustomOptionRender,
|
|
@@ -95,33 +102,33 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
95
102
|
this.onChange();
|
|
96
103
|
this.handleCloseModal();
|
|
97
104
|
onConfirmField();
|
|
98
|
-
}
|
|
105
|
+
};
|
|
99
106
|
|
|
100
|
-
|
|
107
|
+
this.handleReject = () => {
|
|
101
108
|
const {
|
|
102
109
|
onRejectField
|
|
103
110
|
} = this.props;
|
|
104
111
|
this.handleActionClose();
|
|
105
112
|
onRejectField();
|
|
106
|
-
}
|
|
113
|
+
};
|
|
107
114
|
|
|
108
|
-
|
|
115
|
+
this.handleActionClose = () => {
|
|
109
116
|
this.setState(previousState => ({
|
|
110
117
|
selected: previousState.previousSelection
|
|
111
118
|
}));
|
|
112
119
|
this.handleCloseModal();
|
|
113
|
-
}
|
|
120
|
+
};
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
this.handleOpenModal = () => this.setState({
|
|
116
123
|
openModal: true
|
|
117
|
-
})
|
|
124
|
+
});
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
this.handleCloseModal = () => {
|
|
120
127
|
this.setState({
|
|
121
128
|
openModal: false
|
|
122
129
|
});
|
|
123
130
|
setTimeout(() => document.activeElement.blur(), 0); // https://github.com/reactjs/react-modal/issues/680
|
|
124
|
-
}
|
|
131
|
+
};
|
|
125
132
|
|
|
126
133
|
this.initCustomRange = props.customRange;
|
|
127
134
|
this.state = {
|
|
@@ -212,11 +219,11 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
212
219
|
} = this.state;
|
|
213
220
|
const options = [...dropdownPreselectedOptions, advanceOption];
|
|
214
221
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
215
|
-
className:
|
|
222
|
+
className: "".concat(cssClassName, " ").concat(className),
|
|
216
223
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
217
|
-
className:
|
|
218
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
219
|
-
className:
|
|
224
|
+
className: "".concat(classNameBlock('container-selector'))
|
|
225
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSComboBox, {
|
|
226
|
+
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
220
227
|
components: {
|
|
221
228
|
Option: props => /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
|
|
222
229
|
allowMultipleDaysOfWeek: allowMultipleDaysOfWeek,
|