@elliemae/ds-date-time-recurrence-picker 2.0.0-alpha.11 → 2.0.0-alpha.12
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 +20 -19
- package/cjs/components/DateTimeRangeModal/DateTimeRangeModal.js +13 -12
- package/cjs/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +9 -4
- package/cjs/components/DateTimeRecurenceSelectorImpl.js +27 -21
- package/cjs/components/DayOfMonthPicker/DayOfMonthPicker.js +16 -13
- package/cjs/components/DayOfYearPicker/DayOfYearPicker.js +16 -13
- package/cjs/components/DaysOfWeekPicker/DaysOfWeekPicker.js +32 -30
- package/cjs/components/EndDate/EndDate.js +30 -28
- package/cjs/components/FieldWrapper/FieldWrapper.js +4 -3
- package/cjs/components/LabelWrapper/LabelWrapper.js +4 -3
- package/cjs/components/RepeatPickerInput/RepeatPickerInput.js +18 -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 +20 -19
- package/esm/components/DateTimeRangeModal/DateTimeRangeModal.js +13 -11
- package/esm/components/DateTimeRangeModalImpl/DateTimeRangeModalImpl.js +9 -4
- package/esm/components/DateTimeRecurenceSelectorImpl.js +25 -18
- package/esm/components/DayOfMonthPicker/DayOfMonthPicker.js +15 -11
- package/esm/components/DayOfYearPicker/DayOfYearPicker.js +15 -11
- package/esm/components/DaysOfWeekPicker/DaysOfWeekPicker.js +31 -25
- package/esm/components/EndDate/EndDate.js +30 -27
- package/esm/components/FieldWrapper/FieldWrapper.js +4 -3
- package/esm/components/LabelWrapper/LabelWrapper.js +4 -3
- package/esm/components/RepeatPickerInput/RepeatPickerInput.js +16 -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
|
@@ -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,25 +48,26 @@ 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
73
|
if (qtyRepeatPickerInput === 1) display = typeRepeat[typeRepeatPickerInput];else display = "every ".concat(qtyRepeatPickerInput, " ").concat(typeRepeatPickerInput, "s"); // type
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
4
|
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var DSModal = require('@elliemae/ds-modal');
|
|
@@ -10,28 +9,30 @@ var DateTimeRangeModalImpl = require('../DateTimeRangeModalImpl/DateTimeRangeMod
|
|
|
10
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
10
|
|
|
12
11
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
13
|
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
16
14
|
|
|
17
15
|
class DateTimeRangeModal extends React__default["default"].Component {
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
var _this;
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
super(...arguments);
|
|
20
|
+
_this = this;
|
|
21
|
+
this.state = {
|
|
22
22
|
isValid: true
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
this.updateIsValid = function () {
|
|
26
26
|
const {
|
|
27
27
|
onCustomDateTimeRange = () => null,
|
|
28
28
|
isValidRecurrence
|
|
29
|
-
} =
|
|
30
|
-
onCustomDateTimeRange(...
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
} = _this.props;
|
|
30
|
+
onCustomDateTimeRange(...arguments);
|
|
31
|
+
|
|
32
|
+
_this.setState({
|
|
33
|
+
isValid: isValidRecurrence(...arguments)
|
|
33
34
|
});
|
|
34
|
-
}
|
|
35
|
+
};
|
|
35
36
|
}
|
|
36
37
|
|
|
37
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,
|
|
@@ -1,22 +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');
|
|
5
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');
|
|
6
13
|
var React = require('react');
|
|
7
14
|
var lodash = require('lodash');
|
|
8
15
|
require('react-dates/initialize');
|
|
9
16
|
var reactSelect = require('react-select');
|
|
10
17
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
11
|
-
var
|
|
18
|
+
var dsForm = require('@elliemae/ds-form');
|
|
12
19
|
var DateTimeRangeModal = require('./DateTimeRangeModal/DateTimeRangeModal.js');
|
|
13
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
21
|
|
|
15
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
23
|
|
|
17
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
24
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
19
|
-
var
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
20
26
|
|
|
21
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; }
|
|
22
28
|
|
|
@@ -31,7 +37,7 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
31
37
|
constructor(props) {
|
|
32
38
|
super(props);
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
this.onChange = () => {
|
|
35
41
|
const {
|
|
36
42
|
onChange
|
|
37
43
|
} = this.props;
|
|
@@ -40,15 +46,15 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
40
46
|
selected
|
|
41
47
|
} = this.state;
|
|
42
48
|
onChange(selected, customRange);
|
|
43
|
-
}
|
|
49
|
+
};
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
this.onCustomDateTimeRange = customRange => {
|
|
46
52
|
this.setState({
|
|
47
53
|
customRange
|
|
48
54
|
});
|
|
49
|
-
}
|
|
55
|
+
};
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
this.onChangeDropdown = value => {
|
|
52
58
|
const {
|
|
53
59
|
dropdownPreselectedOptions
|
|
54
60
|
} = this.props;
|
|
@@ -70,9 +76,9 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
70
76
|
openModal: false
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
|
-
}
|
|
79
|
+
};
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
this.handleConfirm = () => {
|
|
76
82
|
const {
|
|
77
83
|
onConfirmField,
|
|
78
84
|
customOptionRender: CustomOptionRender,
|
|
@@ -96,33 +102,33 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
96
102
|
this.onChange();
|
|
97
103
|
this.handleCloseModal();
|
|
98
104
|
onConfirmField();
|
|
99
|
-
}
|
|
105
|
+
};
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
this.handleReject = () => {
|
|
102
108
|
const {
|
|
103
109
|
onRejectField
|
|
104
110
|
} = this.props;
|
|
105
111
|
this.handleActionClose();
|
|
106
112
|
onRejectField();
|
|
107
|
-
}
|
|
113
|
+
};
|
|
108
114
|
|
|
109
|
-
|
|
115
|
+
this.handleActionClose = () => {
|
|
110
116
|
this.setState(previousState => ({
|
|
111
117
|
selected: previousState.previousSelection
|
|
112
118
|
}));
|
|
113
119
|
this.handleCloseModal();
|
|
114
|
-
}
|
|
120
|
+
};
|
|
115
121
|
|
|
116
|
-
|
|
122
|
+
this.handleOpenModal = () => this.setState({
|
|
117
123
|
openModal: true
|
|
118
|
-
})
|
|
124
|
+
});
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
this.handleCloseModal = () => {
|
|
121
127
|
this.setState({
|
|
122
128
|
openModal: false
|
|
123
129
|
});
|
|
124
130
|
setTimeout(() => document.activeElement.blur(), 0); // https://github.com/reactjs/react-modal/issues/680
|
|
125
|
-
}
|
|
131
|
+
};
|
|
126
132
|
|
|
127
133
|
this.initCustomRange = props.customRange;
|
|
128
134
|
this.state = {
|
|
@@ -216,7 +222,7 @@ class DateTimeRecurenceSelectorImpl extends React.Component {
|
|
|
216
222
|
className: "".concat(cssClassName, " ").concat(className),
|
|
217
223
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
218
224
|
className: "".concat(classNameBlock('container-selector'))
|
|
219
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
225
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSComboBox, {
|
|
220
226
|
className: "".concat(classNameElement('dropdown-field-selector')),
|
|
221
227
|
components: {
|
|
222
228
|
Option: props => /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
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');
|
|
5
8
|
require('react');
|
|
6
|
-
var
|
|
9
|
+
var dsForm = require('@elliemae/ds-form');
|
|
7
10
|
var nthday = require('../helpers/nthday.js');
|
|
8
11
|
var dropdownDayOfMonthOptions = require('../../options/dropdownDayOfMonthOptions.js');
|
|
9
12
|
var FormLabel = require('../Forms/FormLabel.js');
|
|
@@ -13,18 +16,18 @@ var FormGroup = require('../Forms/FormGroup.js');
|
|
|
13
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
17
|
|
|
15
18
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
-
var DSComboBox__default = /*#__PURE__*/_interopDefaultLegacy(DSComboBox);
|
|
17
19
|
|
|
18
|
-
const DaysOfMonthPicker =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
28
31
|
let options = dayOfMonthOptions;
|
|
29
32
|
|
|
30
33
|
if (displayOptionsAsCurrentDate) {
|
|
@@ -61,7 +64,7 @@ const DaysOfMonthPicker = ({
|
|
|
61
64
|
onDayChange(options[0].value, options[0]);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
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"](
|
|
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, {
|
|
65
68
|
onChange: value => onDayChange(value, options.find(o => o.value === value)),
|
|
66
69
|
options: options,
|
|
67
70
|
value: selected
|