@mailstep/design-system 0.7.30-beta.9 → 0.7.31-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/package.json +1 -1
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +8 -5
- package/ui/Blocks/CommonGrid/store/index.js +0 -1
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +3 -2
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +1 -0
- package/ui/index.es.js +8987 -8979
- package/ui/index.umd.js +410 -410
- package/ui/utils/translations.js +1 -1
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ type InitialView = 'past' | 'future';
|
|
|
4
4
|
type DatePickerRangeProps = FilterComponentProps<Date[]> & {
|
|
5
5
|
filterTime?: number;
|
|
6
6
|
initialView?: InitialView;
|
|
7
|
-
onChange: (value: Date[], others?: DateTimeOthers) => void;
|
|
7
|
+
onChange: (value: Date[], others?: DateTimeOthers[]) => void;
|
|
8
8
|
};
|
|
9
9
|
type DateRangeProps = DatePickerRangeProps & {
|
|
10
10
|
error?: string;
|
|
@@ -71,9 +71,12 @@ var DatePickerRange = function (props) {
|
|
|
71
71
|
setEndRangeValue(v);
|
|
72
72
|
onChange([cleanValue[0], v], others);
|
|
73
73
|
}, [onChange, others, cleanValue]);
|
|
74
|
-
var
|
|
75
|
-
onChange(cleanValue, others);
|
|
76
|
-
}, [onChange, cleanValue]);
|
|
74
|
+
var handleOthersChangeFrom = useCallback(function (othersFrom) {
|
|
75
|
+
onChange(cleanValue, [othersFrom, others === null || others === void 0 ? void 0 : others[1]]);
|
|
76
|
+
}, [onChange, cleanValue, others]);
|
|
77
|
+
var handleOthersChangeTo = useCallback(function (othersTo) {
|
|
78
|
+
onChange(cleanValue, [others === null || others === void 0 ? void 0 : others[0], othersTo]);
|
|
79
|
+
}, [onChange, cleanValue, others]);
|
|
77
80
|
var openPicker = useCallback(function () {
|
|
78
81
|
setOpen(true);
|
|
79
82
|
}, [setOpen]);
|
|
@@ -81,7 +84,6 @@ var DatePickerRange = function (props) {
|
|
|
81
84
|
onChange([]);
|
|
82
85
|
setStartRangeValue(undefined);
|
|
83
86
|
setEndRangeValue(undefined);
|
|
84
|
-
// setOthersValues(undefined)
|
|
85
87
|
}, [onChange]);
|
|
86
88
|
var isValidDateFrom = useCallback(function (current) { return !cleanValue[1] || DateTime.fromJSDate(cleanValue[1]) >= DateTime.fromJSDate(current); }, [cleanValue]);
|
|
87
89
|
var isValidDateTo = useCallback(function (current) { return !cleanValue[0] || DateTime.fromJSDate(current) >= DateTime.fromJSDate(cleanValue[0]); }, [cleanValue]);
|
|
@@ -91,7 +93,8 @@ var DatePickerRange = function (props) {
|
|
|
91
93
|
// Check if the second value is not selected and the first value is the same as the initial value
|
|
92
94
|
var secondDatePickerValue = cleanValue[1] === null ? cleanValue[0] : cleanValue[1];
|
|
93
95
|
var ref = useClickOutside({ onClose: onClose });
|
|
94
|
-
|
|
96
|
+
console.log(others);
|
|
97
|
+
return (_jsxs("div", { ref: ref, children: [_jsx(Input, { name: props.name, placeholder: placeholder, type: "text", icon: "calendar", value: pickerRangeToString(cleanValue, others), label: props.label, onFocus: openPicker, iconOnClick: openPicker, onClear: clear, error: error, readOnly: true }), _jsx(OverlayComponent, { children: _jsx(_Fragment, { children: isOpen && (_jsxs(RangeWrapper, { className: "ignore-element-for-closing-hook", children: [_jsx(DatePicker, __assign({}, rest, { timeFormat: timeFormat, value: (_c = cleanValue[0]) !== null && _c !== void 0 ? _c : '', initialViewDate: initialViewDate[0], secondValue: endRangeValue, onChange: setDateFrom, others: others === null || others === void 0 ? void 0 : others[0], onChangeOthers: handleOthersChangeFrom, icon: false, label: isOpen && i18n._({ id: 'dataGrid.filterCell.from', message: 'From' }), isValidDate: isValidDateFrom, input: false, spaceAround: true, open: true, disabled: cleanValue[0] === null })), _jsx(DatePicker, __assign({}, rest, { timeFormat: timeFormat, value: secondDatePickerValue, initialViewDate: initialViewDate[1], secondValue: startRangeValue, onChange: setDateTo, others: others === null || others === void 0 ? void 0 : others[1], onChangeOthers: handleOthersChangeTo, icon: false, label: isOpen && i18n._({ id: 'dataGrid.filterCell.to', message: 'To' }), isValidDate: isValidDateTo, input: false, spaceAround: true, open: true, disabled: secondDatePickerValue === null || !!(others === null || others === void 0 ? void 0 : others.dateTypeRepeater), isSecondDatePicker: true }))] })) }) })] }));
|
|
95
98
|
};
|
|
96
99
|
export default DatePickerRange;
|
|
97
100
|
var templateObject_1;
|
|
@@ -98,7 +98,6 @@ export default (function (state, action) {
|
|
|
98
98
|
draft[gridName].filter = action.filters;
|
|
99
99
|
break;
|
|
100
100
|
case actionTypes.addFilter:
|
|
101
|
-
console.log(action);
|
|
102
101
|
var column = action.column, value = action.value, filterProps = action.filterProps, others = action.others;
|
|
103
102
|
var currentFilterState = (_b = {}, _b[column] = { value: value, filterProps: filterProps, others: others }, _b);
|
|
104
103
|
draft[gridName].filter = __assign(__assign({}, draft[gridName].filter), currentFilterState);
|
|
@@ -29,11 +29,12 @@ export var Timepicker = function (_a) {
|
|
|
29
29
|
var onChange = useCallback(function (e) {
|
|
30
30
|
var value = e.target.value;
|
|
31
31
|
var _a = value.split(':'), hours = _a[0], minutes = _a[1];
|
|
32
|
-
var
|
|
32
|
+
var defaultTimePickerType = isSecondDatePicker ? TimePickerRepeat.TO : TimePickerRepeat.FROM;
|
|
33
|
+
var timeTypeRepeater = (others === null || others === void 0 ? void 0 : others.dateTypeRepeater) ? (others === null || others === void 0 ? void 0 : others.timeTypeRepeater) || defaultTimePickerType : undefined;
|
|
33
34
|
setHours(Number(hours));
|
|
34
35
|
setMinutes(Number(minutes));
|
|
35
36
|
onChangeOthers === null || onChangeOthers === void 0 ? void 0 : onChangeOthers(__assign(__assign({}, others), { timeTypeRepeater: timeTypeRepeater, time: { h: Number(hours), m: Number(minutes) } }));
|
|
36
|
-
}, [onChangeOthers, others]);
|
|
37
|
+
}, [onChangeOthers, others, isSecondDatePicker]);
|
|
37
38
|
var handleChangeTimer = useCallback(function (e) {
|
|
38
39
|
onChangeOthers === null || onChangeOthers === void 0 ? void 0 : onChangeOthers(__assign(__assign({}, others), { timeTypeRepeater: e.target.value }));
|
|
39
40
|
}, [onChangeOthers, others]);
|
|
@@ -123,6 +123,7 @@ var DaysView = /** @class */ (function (_super) {
|
|
|
123
123
|
var value = this.props.value;
|
|
124
124
|
var others = this.props.others;
|
|
125
125
|
var disabled = this.props.disabled;
|
|
126
|
+
console.log('foooter: ', others);
|
|
126
127
|
return (_jsx("tfoot", { children: _jsx("tr", { children: _jsxs("td", { colSpan: 7, children: [onChangeOthers && _jsx(DateRepeater, { onChangeOthers: onChangeOthers, others: others, reset: reset }), this.props.timeFormat && (_jsx(Timepicker, { setTime: setTime, value: value, disabled: disabled || (!value && !(others === null || others === void 0 ? void 0 : others.dateTypeRepeater)), others: others, onChangeOthers: onChangeOthers, isSecondDatePicker: this.props.isSecondDatePicker }))] }) }) }));
|
|
127
128
|
};
|
|
128
129
|
DaysView.defaultProps = {
|