eidos-ui 4.2.0 → 4.4.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/dist/{chunk-AMVA62UC.js → chunk-5IOT3QKC.js} +2 -2
- package/dist/{chunk-YEBWP7FD.cjs → chunk-CDHNAASM.cjs} +11 -11
- package/dist/{chunk-YEBWP7FD.cjs.map → chunk-CDHNAASM.cjs.map} +1 -1
- package/dist/{chunk-2LSQGDRH.js → chunk-EWCVMY7Q.js} +2 -2
- package/dist/{chunk-TUNG4IDW.cjs → chunk-HSXLSB5X.cjs} +3 -3
- package/dist/{chunk-TUNG4IDW.cjs.map → chunk-HSXLSB5X.cjs.map} +1 -1
- package/dist/{chunk-STVAB7FD.cjs → chunk-L5EZWBUT.cjs} +12 -12
- package/dist/{chunk-STVAB7FD.cjs.map → chunk-L5EZWBUT.cjs.map} +1 -1
- package/dist/{chunk-A7K53LDB.js → chunk-RYAWIDL3.js} +160 -65
- package/dist/chunk-RYAWIDL3.js.map +1 -0
- package/dist/{chunk-F2FGZFWF.js → chunk-YRE433X4.js} +2 -2
- package/dist/{chunk-J2GJGXGH.cjs → chunk-Z5B7OTPL.cjs} +162 -67
- package/dist/{chunk-J2GJGXGH.cjs.map → chunk-Z5B7OTPL.cjs.map} +1 -1
- package/dist/data-grid/index.cjs +4 -4
- package/dist/data-grid/index.js +3 -3
- package/dist/date-picker/index.cjs +2 -2
- package/dist/date-picker/index.d.cts +35 -2
- package/dist/date-picker/index.d.ts +35 -2
- package/dist/date-picker/index.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.css +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/table/index.cjs +4 -4
- package/dist/table/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-A7K53LDB.js.map +0 -1
- /package/dist/{chunk-AMVA62UC.js.map → chunk-5IOT3QKC.js.map} +0 -0
- /package/dist/{chunk-2LSQGDRH.js.map → chunk-EWCVMY7Q.js.map} +0 -0
- /package/dist/{chunk-F2FGZFWF.js.map → chunk-YRE433X4.js.map} +0 -0
|
@@ -868,11 +868,30 @@ var TimeInput = ({
|
|
|
868
868
|
|
|
869
869
|
import_dayjs2.default.extend(import_utc.default);
|
|
870
870
|
import_dayjs2.default.extend(import_timezone.default);
|
|
871
|
+
function presetDateEquals(presetDate, currentDate, mode, toKey) {
|
|
872
|
+
const key = (iso) => typeof iso === "string" ? toKey(iso) : null;
|
|
873
|
+
switch (mode) {
|
|
874
|
+
case "range": {
|
|
875
|
+
const a = presetDate;
|
|
876
|
+
const b = currentDate;
|
|
877
|
+
return key(_optionalChain([a, 'optionalAccess', _10 => _10.start])) === key(_optionalChain([b, 'optionalAccess', _11 => _11.start])) && key(_optionalChain([a, 'optionalAccess', _12 => _12.end])) === key(_optionalChain([b, 'optionalAccess', _13 => _13.end]));
|
|
878
|
+
}
|
|
879
|
+
case "multiple": {
|
|
880
|
+
const a = (Array.isArray(presetDate) ? presetDate : []).map(key).sort();
|
|
881
|
+
const b = (Array.isArray(currentDate) ? currentDate : []).map(key).sort();
|
|
882
|
+
return a.length === b.length && a.every((k, i) => k === b[i]);
|
|
883
|
+
}
|
|
884
|
+
default:
|
|
885
|
+
return key(presetDate) === key(currentDate);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
871
888
|
var DatePicker = ({
|
|
872
889
|
mode,
|
|
873
890
|
value,
|
|
874
891
|
onChange,
|
|
875
892
|
granularity = "day",
|
|
893
|
+
showActions = false,
|
|
894
|
+
presets,
|
|
876
895
|
time = { enabled: false },
|
|
877
896
|
calendar = { numberOfCalendars: 2 },
|
|
878
897
|
format = {
|
|
@@ -908,7 +927,7 @@ var DatePicker = ({
|
|
|
908
927
|
_react.useEffect.call(void 0, () => {
|
|
909
928
|
const element = fieldRef.current;
|
|
910
929
|
if (!element) return;
|
|
911
|
-
const named = (_nullishCoalesce(_optionalChain([element, 'access',
|
|
930
|
+
const named = (_nullishCoalesce(_optionalChain([element, 'access', _14 => _14.labels, 'optionalAccess', _15 => _15.length]), () => ( 0))) > 0 || element.hasAttribute("aria-label") || element.hasAttribute("aria-labelledby");
|
|
912
931
|
if (!named) {
|
|
913
932
|
_chunkR5WI5IGRcjs.devWarn.call(void 0,
|
|
914
933
|
"date-picker-missing-label",
|
|
@@ -978,13 +997,30 @@ var DatePicker = ({
|
|
|
978
997
|
},
|
|
979
998
|
[time.enabled, pickerTimezone]
|
|
980
999
|
);
|
|
1000
|
+
const [draft, setDraft] = _react.useState.call(void 0, void 0);
|
|
1001
|
+
const wasOpen = _react.useRef.call(void 0, false);
|
|
1002
|
+
_react.useEffect.call(void 0, () => {
|
|
1003
|
+
if (!showActions) return;
|
|
1004
|
+
if (isOpen && !wasOpen.current)
|
|
1005
|
+
setDraft(value);
|
|
1006
|
+
else if (!isOpen && wasOpen.current) setDraft(void 0);
|
|
1007
|
+
wasOpen.current = isOpen;
|
|
1008
|
+
}, [isOpen, showActions, value]);
|
|
1009
|
+
const effectiveValue = showActions ? _nullishCoalesce(draft, () => ( value)) : value;
|
|
1010
|
+
const commit = _react.useCallback.call(void 0,
|
|
1011
|
+
(newValue) => {
|
|
1012
|
+
if (showActions) setDraft(newValue);
|
|
1013
|
+
else _optionalChain([onChange, 'optionalCall', _16 => _16(newValue)]);
|
|
1014
|
+
},
|
|
1015
|
+
[showActions, onChange]
|
|
1016
|
+
);
|
|
981
1017
|
const { selectedDates, rangeStart, rangeEnd } = _react.useMemo.call(void 0, () => {
|
|
982
|
-
if (!_optionalChain([
|
|
1018
|
+
if (!_optionalChain([effectiveValue, 'optionalAccess', _17 => _17.date])) {
|
|
983
1019
|
return { selectedDates: [], rangeStart: null, rangeEnd: null };
|
|
984
1020
|
}
|
|
985
1021
|
switch (mode) {
|
|
986
1022
|
case "single": {
|
|
987
|
-
const isoString =
|
|
1023
|
+
const isoString = effectiveValue.date;
|
|
988
1024
|
const localDateStr = toLocalDateString(isoString);
|
|
989
1025
|
return {
|
|
990
1026
|
selectedDates: localDateStr ? [(0, import_dayjs2.default)(localDateStr)] : [],
|
|
@@ -993,7 +1029,7 @@ var DatePicker = ({
|
|
|
993
1029
|
};
|
|
994
1030
|
}
|
|
995
1031
|
case "multiple": {
|
|
996
|
-
const isoStrings =
|
|
1032
|
+
const isoStrings = effectiveValue.date;
|
|
997
1033
|
const localDateStrings = isoStrings.map((d) => toLocalDateString(d)).filter(Boolean);
|
|
998
1034
|
return {
|
|
999
1035
|
selectedDates: localDateStrings.map((d) => (0, import_dayjs2.default)(d)),
|
|
@@ -1002,7 +1038,7 @@ var DatePicker = ({
|
|
|
1002
1038
|
};
|
|
1003
1039
|
}
|
|
1004
1040
|
case "range": {
|
|
1005
|
-
const range =
|
|
1041
|
+
const range = effectiveValue.date;
|
|
1006
1042
|
const startStr = toLocalDateString(range.start);
|
|
1007
1043
|
const endStr = toLocalDateString(range.end);
|
|
1008
1044
|
return {
|
|
@@ -1014,15 +1050,16 @@ var DatePicker = ({
|
|
|
1014
1050
|
default:
|
|
1015
1051
|
return { selectedDates: [], rangeStart: null, rangeEnd: null };
|
|
1016
1052
|
}
|
|
1017
|
-
}, [
|
|
1053
|
+
}, [effectiveValue, mode, toLocalDateString]);
|
|
1018
1054
|
const handleDateSelect = _react.useCallback.call(void 0,
|
|
1019
1055
|
(selectedDate) => {
|
|
1020
1056
|
const effectiveDate = granularity === "month" ? selectedDate.endOf("month") : selectedDate;
|
|
1057
|
+
const effectiveRangeStart = granularity === "month" ? selectedDate.startOf("month") : selectedDate;
|
|
1021
1058
|
const compareUnit = granularity === "month" ? "month" : "day";
|
|
1022
1059
|
switch (mode) {
|
|
1023
1060
|
case "single": {
|
|
1024
1061
|
let dateWithTime;
|
|
1025
|
-
const activeTime = _nullishCoalesce(_optionalChain([
|
|
1062
|
+
const activeTime = _nullishCoalesce(_optionalChain([effectiveValue, 'optionalAccess', _18 => _18.time]), () => ( defaultStartTime));
|
|
1026
1063
|
if (time.enabled) {
|
|
1027
1064
|
dateWithTime = composeLocalDateTime(effectiveDate, activeTime);
|
|
1028
1065
|
} else {
|
|
@@ -1032,45 +1069,45 @@ var DatePicker = ({
|
|
|
1032
1069
|
date: dateWithTime.toISOString(),
|
|
1033
1070
|
time: time.enabled ? activeTime : void 0
|
|
1034
1071
|
};
|
|
1035
|
-
|
|
1036
|
-
setIsOpen(false);
|
|
1072
|
+
commit(newValue);
|
|
1073
|
+
if (!showActions) setIsOpen(false);
|
|
1037
1074
|
break;
|
|
1038
1075
|
}
|
|
1039
1076
|
case "multiple": {
|
|
1040
|
-
const currentDates = _optionalChain([
|
|
1077
|
+
const currentDates = _optionalChain([effectiveValue, 'optionalAccess', _19 => _19.date]) || [];
|
|
1041
1078
|
const currentDayjs = currentDates.map((d) => (0, import_dayjs2.default)(d));
|
|
1042
1079
|
const existingIndex = currentDayjs.findIndex((d) => d.isSame(effectiveDate, compareUnit));
|
|
1043
1080
|
let newDates;
|
|
1044
1081
|
if (existingIndex >= 0) {
|
|
1045
1082
|
newDates = currentDayjs.filter((_, index) => index !== existingIndex);
|
|
1046
1083
|
} else {
|
|
1047
|
-
const activeTime = _nullishCoalesce(_optionalChain([
|
|
1084
|
+
const activeTime = _nullishCoalesce(_optionalChain([effectiveValue, 'optionalAccess', _20 => _20.time]), () => ( defaultStartTime));
|
|
1048
1085
|
const dateWithTime = time.enabled ? composeLocalDateTime(effectiveDate, activeTime) : composeDateOnly(effectiveDate, "start");
|
|
1049
1086
|
newDates = [...currentDayjs, dateWithTime];
|
|
1050
1087
|
}
|
|
1051
1088
|
const newValue = {
|
|
1052
1089
|
date: newDates.map((d) => d.toISOString()),
|
|
1053
|
-
time: time.enabled ? _nullishCoalesce(_optionalChain([
|
|
1090
|
+
time: time.enabled ? _nullishCoalesce(_optionalChain([effectiveValue, 'optionalAccess', _21 => _21.time]), () => ( defaultStartTime)) : void 0
|
|
1054
1091
|
};
|
|
1055
|
-
|
|
1092
|
+
commit(newValue);
|
|
1056
1093
|
break;
|
|
1057
1094
|
}
|
|
1058
1095
|
case "range": {
|
|
1059
|
-
const currentRange = _optionalChain([
|
|
1096
|
+
const currentRange = _optionalChain([effectiveValue, 'optionalAccess', _22 => _22.date]) || {
|
|
1060
1097
|
start: null,
|
|
1061
1098
|
end: null
|
|
1062
1099
|
};
|
|
1063
|
-
const currentRangeTime = _optionalChain([
|
|
1100
|
+
const currentRangeTime = _optionalChain([effectiveValue, 'optionalAccess', _23 => _23.time]) || {
|
|
1064
1101
|
start: defaultStartTime,
|
|
1065
1102
|
end: defaultEndTime
|
|
1066
1103
|
};
|
|
1067
1104
|
if (!currentRange.start || currentRange.start && currentRange.end) {
|
|
1068
|
-
const startWithTime = time.enabled ? composeLocalDateTime(
|
|
1105
|
+
const startWithTime = time.enabled ? composeLocalDateTime(effectiveRangeStart, currentRangeTime.start) : composeDateOnly(effectiveRangeStart, "start");
|
|
1069
1106
|
const newValue = {
|
|
1070
1107
|
date: { start: startWithTime.toISOString(), end: null },
|
|
1071
1108
|
time: time.enabled ? currentRangeTime : void 0
|
|
1072
1109
|
};
|
|
1073
|
-
|
|
1110
|
+
commit(newValue);
|
|
1074
1111
|
} else {
|
|
1075
1112
|
const start = time.enabled ? (0, import_dayjs2.default)(currentRange.start) : (0, import_dayjs2.default)(currentRange.start).tz(pickerTimezone);
|
|
1076
1113
|
let end = effectiveDate;
|
|
@@ -1085,8 +1122,8 @@ var DatePicker = ({
|
|
|
1085
1122
|
},
|
|
1086
1123
|
time: time.enabled ? currentRangeTime : void 0
|
|
1087
1124
|
};
|
|
1088
|
-
|
|
1089
|
-
setIsOpen(false);
|
|
1125
|
+
commit(newValue);
|
|
1126
|
+
if (!showActions) setIsOpen(false);
|
|
1090
1127
|
}
|
|
1091
1128
|
break;
|
|
1092
1129
|
}
|
|
@@ -1095,8 +1132,9 @@ var DatePicker = ({
|
|
|
1095
1132
|
[
|
|
1096
1133
|
mode,
|
|
1097
1134
|
time,
|
|
1098
|
-
|
|
1099
|
-
|
|
1135
|
+
effectiveValue,
|
|
1136
|
+
commit,
|
|
1137
|
+
showActions,
|
|
1100
1138
|
defaultStartTime,
|
|
1101
1139
|
defaultEndTime,
|
|
1102
1140
|
composeDateOnly,
|
|
@@ -1106,7 +1144,7 @@ var DatePicker = ({
|
|
|
1106
1144
|
]
|
|
1107
1145
|
);
|
|
1108
1146
|
const displayValue = _react.useMemo.call(void 0, () => {
|
|
1109
|
-
if (!_optionalChain([value, 'optionalAccess',
|
|
1147
|
+
if (!_optionalChain([value, 'optionalAccess', _24 => _24.date])) return "";
|
|
1110
1148
|
const displayFmt = format.displayFormat || (granularity === "month" ? "MMM YYYY" : "MMM DD, YYYY");
|
|
1111
1149
|
const parseDateOnlyAware = (iso) => time.enabled ? (0, import_dayjs2.default)(iso) : (0, import_dayjs2.default)(iso).tz(pickerTimezone);
|
|
1112
1150
|
switch (mode) {
|
|
@@ -1187,11 +1225,42 @@ var DatePicker = ({
|
|
|
1187
1225
|
};
|
|
1188
1226
|
}
|
|
1189
1227
|
})();
|
|
1190
|
-
|
|
1191
|
-
|
|
1228
|
+
if (showActions && isOpen) {
|
|
1229
|
+
setDraft(clearedValue);
|
|
1230
|
+
} else {
|
|
1231
|
+
_optionalChain([onChange, 'optionalCall', _25 => _25(clearedValue)]);
|
|
1232
|
+
setIsOpen(false);
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
[mode, time, onChange, showActions, isOpen, defaultStartTime, defaultEndTime]
|
|
1236
|
+
);
|
|
1237
|
+
const applyDraft = _react.useCallback.call(void 0, () => {
|
|
1238
|
+
const next = _nullishCoalesce(draft, () => ( value));
|
|
1239
|
+
if (next !== void 0) _optionalChain([onChange, 'optionalCall', _26 => _26(next)]);
|
|
1240
|
+
setIsOpen(false);
|
|
1241
|
+
}, [onChange, draft, value]);
|
|
1242
|
+
const cancelDraft = _react.useCallback.call(void 0, () => {
|
|
1243
|
+
setIsOpen(false);
|
|
1244
|
+
}, []);
|
|
1245
|
+
const presetCompareKey = _react.useCallback.call(void 0,
|
|
1246
|
+
(iso) => {
|
|
1247
|
+
const day = toLocalDateString(iso);
|
|
1248
|
+
return day ? granularity === "month" ? day.slice(0, 7) : day : "";
|
|
1192
1249
|
},
|
|
1193
|
-
[
|
|
1250
|
+
[toLocalDateString, granularity]
|
|
1194
1251
|
);
|
|
1252
|
+
const handlePresetSelect = _react.useCallback.call(void 0,
|
|
1253
|
+
(preset) => {
|
|
1254
|
+
const newValue = {
|
|
1255
|
+
date: preset.getValue(),
|
|
1256
|
+
time: time.enabled ? _optionalChain([effectiveValue, 'optionalAccess', _27 => _27.time]) : void 0
|
|
1257
|
+
};
|
|
1258
|
+
commit(newValue);
|
|
1259
|
+
if (!showActions) setIsOpen(false);
|
|
1260
|
+
},
|
|
1261
|
+
[time.enabled, effectiveValue, commit, showActions]
|
|
1262
|
+
);
|
|
1263
|
+
const applyDisabled = mode === "range" && !!draft && !!draft.date.start && !draft.date.end;
|
|
1195
1264
|
const triggerElement = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1196
1265
|
"div",
|
|
1197
1266
|
{
|
|
@@ -1236,43 +1305,65 @@ var DatePicker = ({
|
|
|
1236
1305
|
}
|
|
1237
1306
|
);
|
|
1238
1307
|
const dropdownContent = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: panelRef, id: panelId, className: "eidos-date-picker-content", children: [
|
|
1239
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
currentDate: calendarDate,
|
|
1245
|
-
selectedDates,
|
|
1246
|
-
rangeStart,
|
|
1247
|
-
rangeEnd,
|
|
1308
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-date-picker-calendars-wrapper", children: [
|
|
1309
|
+
presets && presets.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "eidos-date-picker-presets", role: "group", "aria-label": "Quick ranges", children: presets.map((preset) => {
|
|
1310
|
+
const active = presetDateEquals(
|
|
1311
|
+
preset.getValue(),
|
|
1312
|
+
_optionalChain([effectiveValue, 'optionalAccess', _28 => _28.date]),
|
|
1248
1313
|
mode,
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1314
|
+
presetCompareKey
|
|
1315
|
+
);
|
|
1316
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1317
|
+
_chunkNSA7ASZ7cjs.Button,
|
|
1318
|
+
{
|
|
1319
|
+
size: "sm",
|
|
1320
|
+
variant: active ? "filled" : "outlined",
|
|
1321
|
+
color: "primary",
|
|
1322
|
+
"aria-pressed": active,
|
|
1323
|
+
onClick: () => handlePresetSelect(preset),
|
|
1324
|
+
children: preset.label
|
|
1325
|
+
},
|
|
1326
|
+
preset.id
|
|
1327
|
+
);
|
|
1328
|
+
}) }),
|
|
1329
|
+
Array.from({ length: numberOfCalendars }, (_, index) => {
|
|
1330
|
+
const calendarDate = _nullishCoalesce(calendarDates[index], () => ( (0, import_dayjs2.default)().add(index, "month")));
|
|
1331
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
+
Calendar,
|
|
1333
|
+
{
|
|
1334
|
+
currentDate: calendarDate,
|
|
1335
|
+
selectedDates,
|
|
1336
|
+
rangeStart,
|
|
1337
|
+
rangeEnd,
|
|
1338
|
+
mode,
|
|
1339
|
+
granularity,
|
|
1340
|
+
onDateSelect: handleDateSelect,
|
|
1341
|
+
onMonthChange: (newDate) => handleCalendarMonthChange(index, newDate),
|
|
1342
|
+
minDate: minDateObj,
|
|
1343
|
+
maxDate: maxDateObj,
|
|
1344
|
+
disabledDates: disabledDatesObj,
|
|
1345
|
+
disabledDaysOfWeek,
|
|
1346
|
+
showWeekNumbers: calendar.showWeekNumbers,
|
|
1347
|
+
firstDayOfWeek: calendar.firstDayOfWeek,
|
|
1348
|
+
showNavigation: independentCalendars || index === 0
|
|
1349
|
+
},
|
|
1350
|
+
index
|
|
1351
|
+
);
|
|
1352
|
+
})
|
|
1353
|
+
] }),
|
|
1263
1354
|
time.enabled && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-date-picker-time-container", children: [
|
|
1264
1355
|
mode === "single" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1265
1356
|
TimeInput,
|
|
1266
1357
|
{
|
|
1267
|
-
value: _optionalChain([
|
|
1358
|
+
value: _optionalChain([effectiveValue, 'optionalAccess', _29 => _29.time]) || defaultStartTime,
|
|
1268
1359
|
onChange: (newTime) => {
|
|
1269
|
-
const currentIso = _optionalChain([
|
|
1360
|
+
const currentIso = _optionalChain([effectiveValue, 'optionalAccess', _30 => _30.date]);
|
|
1270
1361
|
const newValue = {
|
|
1271
|
-
...
|
|
1362
|
+
...effectiveValue,
|
|
1272
1363
|
date: currentIso ? recomposeIsoWithTime(currentIso, newTime) : currentIso,
|
|
1273
1364
|
time: newTime
|
|
1274
1365
|
};
|
|
1275
|
-
|
|
1366
|
+
commit(newValue);
|
|
1276
1367
|
},
|
|
1277
1368
|
includeSeconds: time.includeSeconds,
|
|
1278
1369
|
disabled,
|
|
@@ -1282,17 +1373,17 @@ var DatePicker = ({
|
|
|
1282
1373
|
mode === "multiple" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1283
1374
|
TimeInput,
|
|
1284
1375
|
{
|
|
1285
|
-
value: _optionalChain([
|
|
1376
|
+
value: _optionalChain([effectiveValue, 'optionalAccess', _31 => _31.time]) || defaultStartTime,
|
|
1286
1377
|
onChange: (newTime) => {
|
|
1287
|
-
const currentDates = _optionalChain([
|
|
1378
|
+
const currentDates = _optionalChain([effectiveValue, 'optionalAccess', _32 => _32.date]) || [];
|
|
1288
1379
|
const newValue = {
|
|
1289
|
-
...
|
|
1380
|
+
...effectiveValue,
|
|
1290
1381
|
date: currentDates.map(
|
|
1291
1382
|
(d) => recomposeIsoWithTime(d, newTime)
|
|
1292
1383
|
),
|
|
1293
1384
|
time: newTime
|
|
1294
1385
|
};
|
|
1295
|
-
|
|
1386
|
+
commit(newValue);
|
|
1296
1387
|
},
|
|
1297
1388
|
includeSeconds: time.includeSeconds,
|
|
1298
1389
|
disabled,
|
|
@@ -1303,18 +1394,18 @@ var DatePicker = ({
|
|
|
1303
1394
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1304
1395
|
TimeInput,
|
|
1305
1396
|
{
|
|
1306
|
-
value: _optionalChain([
|
|
1397
|
+
value: _optionalChain([effectiveValue, 'optionalAccess', _33 => _33.time, 'optionalAccess', _34 => _34.start]) || defaultStartTime,
|
|
1307
1398
|
onChange: (newTime) => {
|
|
1308
|
-
const currentRangeTime = _optionalChain([
|
|
1399
|
+
const currentRangeTime = _optionalChain([effectiveValue, 'optionalAccess', _35 => _35.time]) || {
|
|
1309
1400
|
start: defaultStartTime,
|
|
1310
1401
|
end: defaultEndTime
|
|
1311
1402
|
};
|
|
1312
|
-
const currentRange = _optionalChain([
|
|
1403
|
+
const currentRange = _optionalChain([effectiveValue, 'optionalAccess', _36 => _36.date]) || {
|
|
1313
1404
|
start: null,
|
|
1314
1405
|
end: null
|
|
1315
1406
|
};
|
|
1316
1407
|
const newValue = {
|
|
1317
|
-
...
|
|
1408
|
+
...effectiveValue,
|
|
1318
1409
|
date: {
|
|
1319
1410
|
...currentRange,
|
|
1320
1411
|
start: currentRange.start ? recomposeIsoWithTime(currentRange.start, newTime) : currentRange.start
|
|
@@ -1324,7 +1415,7 @@ var DatePicker = ({
|
|
|
1324
1415
|
start: newTime
|
|
1325
1416
|
}
|
|
1326
1417
|
};
|
|
1327
|
-
|
|
1418
|
+
commit(newValue);
|
|
1328
1419
|
},
|
|
1329
1420
|
includeSeconds: time.includeSeconds,
|
|
1330
1421
|
disabled,
|
|
@@ -1334,18 +1425,18 @@ var DatePicker = ({
|
|
|
1334
1425
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
1426
|
TimeInput,
|
|
1336
1427
|
{
|
|
1337
|
-
value: _optionalChain([
|
|
1428
|
+
value: _optionalChain([effectiveValue, 'optionalAccess', _37 => _37.time, 'optionalAccess', _38 => _38.end]) || defaultEndTime,
|
|
1338
1429
|
onChange: (newTime) => {
|
|
1339
|
-
const currentRangeTime = _optionalChain([
|
|
1430
|
+
const currentRangeTime = _optionalChain([effectiveValue, 'optionalAccess', _39 => _39.time]) || {
|
|
1340
1431
|
start: defaultStartTime,
|
|
1341
1432
|
end: defaultEndTime
|
|
1342
1433
|
};
|
|
1343
|
-
const currentRange = _optionalChain([
|
|
1434
|
+
const currentRange = _optionalChain([effectiveValue, 'optionalAccess', _40 => _40.date]) || {
|
|
1344
1435
|
start: null,
|
|
1345
1436
|
end: null
|
|
1346
1437
|
};
|
|
1347
1438
|
const newValue = {
|
|
1348
|
-
...
|
|
1439
|
+
...effectiveValue,
|
|
1349
1440
|
date: {
|
|
1350
1441
|
...currentRange,
|
|
1351
1442
|
end: currentRange.end ? recomposeIsoWithTime(currentRange.end, newTime) : currentRange.end
|
|
@@ -1355,7 +1446,7 @@ var DatePicker = ({
|
|
|
1355
1446
|
end: newTime
|
|
1356
1447
|
}
|
|
1357
1448
|
};
|
|
1358
|
-
|
|
1449
|
+
commit(newValue);
|
|
1359
1450
|
},
|
|
1360
1451
|
includeSeconds: time.includeSeconds,
|
|
1361
1452
|
disabled,
|
|
@@ -1363,6 +1454,10 @@ var DatePicker = ({
|
|
|
1363
1454
|
}
|
|
1364
1455
|
)
|
|
1365
1456
|
] })
|
|
1457
|
+
] }),
|
|
1458
|
+
showActions && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-date-picker-actions", children: [
|
|
1459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNSA7ASZ7cjs.Button, { variant: "text", color: "secondary", onClick: cancelDraft, children: "Cancel" }),
|
|
1460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNSA7ASZ7cjs.Button, { variant: "filled", color: "primary", disabled: applyDisabled, onClick: applyDraft, children: "Apply" })
|
|
1366
1461
|
] })
|
|
1367
1462
|
] });
|
|
1368
1463
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1396,4 +1491,4 @@ DatePicker.displayName = "DatePicker";
|
|
|
1396
1491
|
|
|
1397
1492
|
|
|
1398
1493
|
exports.Calendar = Calendar; exports.TimeInput = TimeInput; exports.DatePicker = DatePicker;
|
|
1399
|
-
//# sourceMappingURL=chunk-
|
|
1494
|
+
//# sourceMappingURL=chunk-Z5B7OTPL.cjs.map
|