@vygruppen/spor-react 4.0.3 → 4.1.1
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/.turbo/turbo-build.log +9 -11
- package/CHANGELOG.md +26 -0
- package/dist/{CountryCodeSelect-RUH47EQH.mjs → CountryCodeSelect-7MAIS4VT.mjs} +1 -1
- package/dist/{chunk-XT6QVKN5.mjs → chunk-U2IWIWOD.mjs} +152 -1953
- package/dist/index.d.mts +17 -93
- package/dist/index.d.ts +17 -93
- package/dist/index.js +151 -1980
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.test.tsx +1 -1
- package/src/accordion/Accordion.tsx +1 -1
- package/src/accordion/AccordionContext.tsx +1 -1
- package/src/accordion/Expandable.tsx +6 -6
- package/src/alert/BaseAlert.test.tsx +5 -5
- package/src/alert/BaseAlert.tsx +5 -1
- package/src/alert/ClosableAlert.test.tsx +3 -3
- package/src/alert/ExpandableAlert.test.tsx +5 -5
- package/src/button/Button.test.tsx +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/button/CloseButton.tsx +1 -1
- package/src/button/FloatingActionButton.tsx +5 -5
- package/src/button/IconButton.tsx +1 -1
- package/src/card/Card.tsx +3 -2
- package/src/card/index.tsx +1 -1
- package/src/datepicker/Calendar.tsx +9 -9
- package/src/datepicker/CalendarCell.tsx +9 -8
- package/src/datepicker/CalendarGrid.tsx +9 -9
- package/src/datepicker/CalendarHeader.tsx +2 -2
- package/src/datepicker/CalendarTriggerButton.tsx +5 -10
- package/src/datepicker/DateField.tsx +3 -3
- package/src/datepicker/DatePicker.tsx +6 -6
- package/src/datepicker/DateRangePicker.tsx +1 -1
- package/src/datepicker/DateTimeSegment.tsx +2 -2
- package/src/datepicker/RangeCalendar.tsx +8 -5
- package/src/datepicker/StyledField.tsx +2 -6
- package/src/datepicker/TimePicker.test.tsx +4 -4
- package/src/datepicker/TimePicker.tsx +5 -5
- package/src/index.tsx +0 -1
- package/src/input/CardSelect.tsx +3 -3
- package/src/input/Combobox.tsx +1 -1
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/FormErrorMessage.tsx +1 -1
- package/src/input/InfoSelect.tsx +1 -1
- package/src/input/Input.tsx +1 -1
- package/src/input/InputElement.tsx +2 -2
- package/src/input/ListBox.tsx +3 -3
- package/src/input/NativeSelect.tsx +1 -1
- package/src/input/PasswordInput.tsx +1 -1
- package/src/input/PhoneNumberInput.tsx +13 -4
- package/src/input/Popover.tsx +4 -4
- package/src/input/RadioGroup.tsx +1 -1
- package/src/input/SearchInput.tsx +1 -1
- package/src/input/Switch.tsx +1 -1
- package/src/layout/Stack.tsx +1 -1
- package/src/linjetag/TravelTag.tsx +2 -2
- package/src/link/TextLink.tsx +1 -1
- package/src/list/index.tsx +0 -1
- package/src/loader/DarkSpinner.tsx +2 -4
- package/src/loader/SkeletonText.tsx +6 -3
- package/src/loader/useRotatingLabel.tsx +2 -2
- package/src/media-controller/index.test.tsx +6 -6
- package/src/modal/Drawer.tsx +2 -4
- package/src/modal/ModalHeader.tsx +1 -1
- package/src/provider/index.tsx +1 -1
- package/src/stepper/Stepper.tsx +10 -6
- package/src/stepper/StepperContext.tsx +7 -7
- package/src/stepper/StepperStep.tsx +56 -16
- package/src/theme/components/button.ts +25 -44
- package/src/theme/components/card.ts +7 -1
- package/src/theme/components/close-button.ts +3 -1
- package/src/theme/components/datepicker.ts +2 -2
- package/src/theme/components/divider.ts +17 -17
- package/src/theme/components/fab.ts +16 -13
- package/src/theme/components/info-tag.ts +7 -8
- package/src/theme/components/input.ts +4 -2
- package/src/theme/components/line-icon.ts +1 -2
- package/src/theme/components/media-controller-button.ts +1 -1
- package/src/theme/components/popover.ts +1 -2
- package/src/theme/components/select.ts +4 -4
- package/src/theme/components/stepper.ts +8 -155
- package/src/theme/components/switch.ts +9 -9
- package/src/theme/components/table.ts +3 -3
- package/src/theme/components/tabs.ts +24 -18
- package/src/theme/components/textarea.ts +1 -1
- package/src/theme/components/travel-tag.ts +2 -2
- package/src/theme/foundations/spacing.ts +1 -1
- package/src/theme/foundations/styles.ts +10 -10
- package/src/theme/utils/box-shadow-utils.ts +2 -2
- package/src/toast/ActionToast.test.tsx +1 -1
- package/src/toast/BaseToast.test.tsx +3 -3
- package/src/toast/ClosableToast.test.tsx +1 -1
- package/src/toast/index.tsx +1 -1
- package/src/toast/useToast.tsx +3 -3
- package/src/typography/Badge.tsx +1 -1
- package/src/typography/Text.tsx +1 -1
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
@@ -959,7 +959,11 @@ var init_AlertIcon = __esm({
|
|
959
959
|
var BaseAlert;
|
960
960
|
var init_BaseAlert = __esm({
|
961
961
|
"src/alert/BaseAlert.tsx"() {
|
962
|
-
BaseAlert = ({
|
962
|
+
BaseAlert = ({
|
963
|
+
variant,
|
964
|
+
children,
|
965
|
+
...boxProps
|
966
|
+
}) => {
|
963
967
|
const styles3 = react.useMultiStyleConfig("Alert", { variant });
|
964
968
|
return /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { __css: styles3.container, ...boxProps }, children);
|
965
969
|
};
|
@@ -1124,1757 +1128,6 @@ var init_card = __esm({
|
|
1124
1128
|
init_Card();
|
1125
1129
|
}
|
1126
1130
|
});
|
1127
|
-
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
1128
|
-
let [stateValue, setStateValue] = (React69.useState)(value || defaultValue);
|
1129
|
-
let isControlledRef = (React69.useRef)(value !== void 0);
|
1130
|
-
let isControlled = value !== void 0;
|
1131
|
-
(React69.useEffect)(() => {
|
1132
|
-
let wasControlled = isControlledRef.current;
|
1133
|
-
if (wasControlled !== isControlled)
|
1134
|
-
console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
|
1135
|
-
isControlledRef.current = isControlled;
|
1136
|
-
}, [
|
1137
|
-
isControlled
|
1138
|
-
]);
|
1139
|
-
let currentValue = isControlled ? value : stateValue;
|
1140
|
-
let setValue = (React69.useCallback)((value2, ...args) => {
|
1141
|
-
let onChangeCaller = (value3, ...onChangeArgs) => {
|
1142
|
-
if (onChange) {
|
1143
|
-
if (!Object.is(currentValue, value3))
|
1144
|
-
onChange(value3, ...onChangeArgs);
|
1145
|
-
}
|
1146
|
-
if (!isControlled)
|
1147
|
-
currentValue = value3;
|
1148
|
-
};
|
1149
|
-
if (typeof value2 === "function") {
|
1150
|
-
console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320");
|
1151
|
-
let updateFunction = (oldValue, ...functionArgs) => {
|
1152
|
-
let interceptedValue = value2(isControlled ? currentValue : oldValue, ...functionArgs);
|
1153
|
-
onChangeCaller(interceptedValue, ...args);
|
1154
|
-
if (!isControlled)
|
1155
|
-
return interceptedValue;
|
1156
|
-
return oldValue;
|
1157
|
-
};
|
1158
|
-
setStateValue(updateFunction);
|
1159
|
-
} else {
|
1160
|
-
if (!isControlled)
|
1161
|
-
setStateValue(value2);
|
1162
|
-
onChangeCaller(value2, ...args);
|
1163
|
-
}
|
1164
|
-
}, [
|
1165
|
-
isControlled,
|
1166
|
-
currentValue,
|
1167
|
-
onChange
|
1168
|
-
]);
|
1169
|
-
return [
|
1170
|
-
currentValue,
|
1171
|
-
setValue
|
1172
|
-
];
|
1173
|
-
}
|
1174
|
-
var init_import = __esm({
|
1175
|
-
"../../node_modules/@react-stately/utils/dist/import.mjs"() {
|
1176
|
-
}
|
1177
|
-
});
|
1178
|
-
function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
|
1179
|
-
let [isOpen, setOpen] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
1180
|
-
const open = (React69.useCallback)(() => {
|
1181
|
-
setOpen(true);
|
1182
|
-
}, [
|
1183
|
-
setOpen
|
1184
|
-
]);
|
1185
|
-
const close = (React69.useCallback)(() => {
|
1186
|
-
setOpen(false);
|
1187
|
-
}, [
|
1188
|
-
setOpen
|
1189
|
-
]);
|
1190
|
-
const toggle = (React69.useCallback)(() => {
|
1191
|
-
setOpen(!isOpen);
|
1192
|
-
}, [
|
1193
|
-
setOpen,
|
1194
|
-
isOpen
|
1195
|
-
]);
|
1196
|
-
return {
|
1197
|
-
isOpen,
|
1198
|
-
setOpen,
|
1199
|
-
open,
|
1200
|
-
close,
|
1201
|
-
toggle
|
1202
|
-
};
|
1203
|
-
}
|
1204
|
-
var init_import2 = __esm({
|
1205
|
-
"../../node_modules/@react-stately/overlays/dist/import.mjs"() {
|
1206
|
-
init_import();
|
1207
|
-
}
|
1208
|
-
});
|
1209
|
-
|
1210
|
-
// ../../node_modules/@internationalized/string/dist/import.mjs
|
1211
|
-
function $5b160d28a433310d$var$getStringsForLocale(locale, strings, defaultLocale = "en-US") {
|
1212
|
-
if (strings[locale])
|
1213
|
-
return strings[locale];
|
1214
|
-
let language = $5b160d28a433310d$var$getLanguage(locale);
|
1215
|
-
if (strings[language])
|
1216
|
-
return strings[language];
|
1217
|
-
for (let key in strings) {
|
1218
|
-
if (key.startsWith(language + "-"))
|
1219
|
-
return strings[key];
|
1220
|
-
}
|
1221
|
-
return strings[defaultLocale];
|
1222
|
-
}
|
1223
|
-
function $5b160d28a433310d$var$getLanguage(locale) {
|
1224
|
-
if (Intl.Locale)
|
1225
|
-
return new Intl.Locale(locale).language;
|
1226
|
-
return locale.split("-")[0];
|
1227
|
-
}
|
1228
|
-
var $5b160d28a433310d$export$c17fa47878dc55b6;
|
1229
|
-
var init_import3 = __esm({
|
1230
|
-
"../../node_modules/@internationalized/string/dist/import.mjs"() {
|
1231
|
-
$5b160d28a433310d$export$c17fa47878dc55b6 = class {
|
1232
|
-
/** Returns a localized string for the given key and locale. */
|
1233
|
-
getStringForLocale(key, locale) {
|
1234
|
-
let strings = this.strings[locale];
|
1235
|
-
if (!strings) {
|
1236
|
-
strings = $5b160d28a433310d$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
|
1237
|
-
this.strings[locale] = strings;
|
1238
|
-
}
|
1239
|
-
let string = strings[key];
|
1240
|
-
if (!string)
|
1241
|
-
throw new Error(`Could not find intl message ${key} in ${locale} locale`);
|
1242
|
-
return string;
|
1243
|
-
}
|
1244
|
-
constructor(messages, defaultLocale = "en-US") {
|
1245
|
-
this.strings = {
|
1246
|
-
...messages
|
1247
|
-
};
|
1248
|
-
this.defaultLocale = defaultLocale;
|
1249
|
-
}
|
1250
|
-
};
|
1251
|
-
}
|
1252
|
-
});
|
1253
|
-
function $35a22f14a1f04b11$export$eac50920cf2fd59a(value, minValue, maxValue) {
|
1254
|
-
return value != null && (minValue != null && value.compare(minValue) < 0 || maxValue != null && value.compare(maxValue) > 0);
|
1255
|
-
}
|
1256
|
-
function $35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, options) {
|
1257
|
-
let defaultFieldOptions = options.shouldForceLeadingZeros ? $35a22f14a1f04b11$var$TWO_DIGIT_FIELD_OPTIONS : $35a22f14a1f04b11$var$DEFAULT_FIELD_OPTIONS;
|
1258
|
-
fieldOptions = {
|
1259
|
-
...defaultFieldOptions,
|
1260
|
-
...fieldOptions
|
1261
|
-
};
|
1262
|
-
let granularity = options.granularity || "minute";
|
1263
|
-
let keys = Object.keys(fieldOptions);
|
1264
|
-
var _options_maxGranularity;
|
1265
|
-
let startIdx = keys.indexOf((_options_maxGranularity = options.maxGranularity) !== null && _options_maxGranularity !== void 0 ? _options_maxGranularity : "year");
|
1266
|
-
if (startIdx < 0)
|
1267
|
-
startIdx = 0;
|
1268
|
-
let endIdx = keys.indexOf(granularity);
|
1269
|
-
if (endIdx < 0)
|
1270
|
-
endIdx = 2;
|
1271
|
-
if (startIdx > endIdx)
|
1272
|
-
throw new Error("maxGranularity must be greater than granularity");
|
1273
|
-
let opts = keys.slice(startIdx, endIdx + 1).reduce((opts2, key) => {
|
1274
|
-
opts2[key] = fieldOptions[key];
|
1275
|
-
return opts2;
|
1276
|
-
}, {});
|
1277
|
-
if (options.hourCycle != null)
|
1278
|
-
opts.hour12 = options.hourCycle === 12;
|
1279
|
-
opts.timeZone = options.timeZone || "UTC";
|
1280
|
-
let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
|
1281
|
-
if (hasTime && options.timeZone && !options.hideTimeZone)
|
1282
|
-
opts.timeZoneName = "short";
|
1283
|
-
if (options.showEra && startIdx === 0)
|
1284
|
-
opts.era = "short";
|
1285
|
-
return opts;
|
1286
|
-
}
|
1287
|
-
function $35a22f14a1f04b11$export$c5221a78ef73c5e9(placeholderValue) {
|
1288
|
-
if (placeholderValue && "hour" in placeholderValue)
|
1289
|
-
return placeholderValue;
|
1290
|
-
return new (date.Time)();
|
1291
|
-
}
|
1292
|
-
function $35a22f14a1f04b11$export$61a490a80c552550(value, calendar) {
|
1293
|
-
if (value === null)
|
1294
|
-
return null;
|
1295
|
-
if (!value)
|
1296
|
-
return void 0;
|
1297
|
-
return (date.toCalendar)(value, calendar);
|
1298
|
-
}
|
1299
|
-
function $35a22f14a1f04b11$export$66aa2b09de4b1ea5(placeholderValue, granularity, calendar, timeZone) {
|
1300
|
-
if (placeholderValue)
|
1301
|
-
return $35a22f14a1f04b11$export$61a490a80c552550(placeholderValue, calendar);
|
1302
|
-
let date$1 = (date.toCalendar)((date.now)(timeZone).set({
|
1303
|
-
hour: 0,
|
1304
|
-
minute: 0,
|
1305
|
-
second: 0,
|
1306
|
-
millisecond: 0
|
1307
|
-
}), calendar);
|
1308
|
-
if (granularity === "year" || granularity === "month" || granularity === "day")
|
1309
|
-
return (date.toCalendarDate)(date$1);
|
1310
|
-
if (!timeZone)
|
1311
|
-
return (date.toCalendarDateTime)(date$1);
|
1312
|
-
return date$1;
|
1313
|
-
}
|
1314
|
-
function $35a22f14a1f04b11$export$2440da353cedad43(v, granularity) {
|
1315
|
-
let defaultTimeZone = v && "timeZone" in v ? v.timeZone : void 0;
|
1316
|
-
let defaultGranularity = v && "minute" in v ? "minute" : "day";
|
1317
|
-
if (v && granularity && !(granularity in v))
|
1318
|
-
throw new Error("Invalid granularity " + granularity + " for value " + v.toString());
|
1319
|
-
let [lastValue, setLastValue] = (React69.useState)([
|
1320
|
-
defaultGranularity,
|
1321
|
-
defaultTimeZone
|
1322
|
-
]);
|
1323
|
-
if (v && (lastValue[0] !== defaultGranularity || lastValue[1] !== defaultTimeZone))
|
1324
|
-
setLastValue([
|
1325
|
-
defaultGranularity,
|
1326
|
-
defaultTimeZone
|
1327
|
-
]);
|
1328
|
-
if (!granularity)
|
1329
|
-
granularity = v ? defaultGranularity : lastValue[0];
|
1330
|
-
let timeZone = v ? defaultTimeZone : lastValue[1];
|
1331
|
-
return [
|
1332
|
-
granularity,
|
1333
|
-
timeZone
|
1334
|
-
];
|
1335
|
-
}
|
1336
|
-
function $ab5bf3f618090389$export$87194bb378cc3ac2(props) {
|
1337
|
-
var _props_isDateUnavailable;
|
1338
|
-
let overlayState = ($fc909762b330b746$export$61c6a8c84e605fb6)(props);
|
1339
|
-
let [value, setValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue || null, props.onChange);
|
1340
|
-
let v = value || props.placeholderValue;
|
1341
|
-
let [granularity, defaultTimeZone] = ($35a22f14a1f04b11$export$2440da353cedad43)(v, props.granularity);
|
1342
|
-
let dateValue = value != null ? value.toDate(defaultTimeZone !== null && defaultTimeZone !== void 0 ? defaultTimeZone : "UTC") : null;
|
1343
|
-
let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
|
1344
|
-
var _props_shouldCloseOnSelect;
|
1345
|
-
let shouldCloseOnSelect = (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : true;
|
1346
|
-
let [selectedDate, setSelectedDate] = (React69.useState)(null);
|
1347
|
-
let [selectedTime, setSelectedTime] = (React69.useState)(null);
|
1348
|
-
if (value) {
|
1349
|
-
selectedDate = value;
|
1350
|
-
if ("hour" in value)
|
1351
|
-
selectedTime = value;
|
1352
|
-
}
|
1353
|
-
if (v && !(granularity in v))
|
1354
|
-
throw new Error("Invalid granularity " + granularity + " for value " + v.toString());
|
1355
|
-
let commitValue = (date$1, time) => {
|
1356
|
-
setValue("timeZone" in time ? time.set((date.toCalendarDate)(date$1)) : (date.toCalendarDateTime)(date$1, time));
|
1357
|
-
setSelectedDate(null);
|
1358
|
-
setSelectedTime(null);
|
1359
|
-
};
|
1360
|
-
let selectDate = (newValue) => {
|
1361
|
-
let shouldClose = typeof shouldCloseOnSelect === "function" ? shouldCloseOnSelect() : shouldCloseOnSelect;
|
1362
|
-
if (hasTime) {
|
1363
|
-
if (selectedTime || shouldClose)
|
1364
|
-
commitValue(newValue, selectedTime || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue));
|
1365
|
-
else
|
1366
|
-
setSelectedDate(newValue);
|
1367
|
-
} else
|
1368
|
-
setValue(newValue);
|
1369
|
-
if (shouldClose)
|
1370
|
-
overlayState.setOpen(false);
|
1371
|
-
};
|
1372
|
-
let selectTime = (newValue) => {
|
1373
|
-
if (selectedDate && newValue)
|
1374
|
-
commitValue(selectedDate, newValue);
|
1375
|
-
else
|
1376
|
-
setSelectedTime(newValue);
|
1377
|
-
};
|
1378
|
-
let validationState = props.validationState || (($35a22f14a1f04b11$export$eac50920cf2fd59a)(value, props.minValue, props.maxValue) ? "invalid" : null) || (value && ((_props_isDateUnavailable = props.isDateUnavailable) === null || _props_isDateUnavailable === void 0 ? void 0 : _props_isDateUnavailable.call(props, value)) ? "invalid" : null);
|
1379
|
-
return {
|
1380
|
-
value,
|
1381
|
-
setValue,
|
1382
|
-
dateValue: selectedDate,
|
1383
|
-
timeValue: selectedTime,
|
1384
|
-
setDateValue: selectDate,
|
1385
|
-
setTimeValue: selectTime,
|
1386
|
-
granularity,
|
1387
|
-
hasTime,
|
1388
|
-
...overlayState,
|
1389
|
-
setOpen(isOpen) {
|
1390
|
-
if (!isOpen && !value && selectedDate && hasTime)
|
1391
|
-
commitValue(selectedDate, selectedTime || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue));
|
1392
|
-
overlayState.setOpen(isOpen);
|
1393
|
-
},
|
1394
|
-
validationState,
|
1395
|
-
formatValue(locale, fieldOptions) {
|
1396
|
-
if (!dateValue)
|
1397
|
-
return "";
|
1398
|
-
let formatOptions = ($35a22f14a1f04b11$export$7e319ea407e63bc0)(fieldOptions, {
|
1399
|
-
granularity,
|
1400
|
-
timeZone: defaultTimeZone,
|
1401
|
-
hideTimeZone: props.hideTimeZone,
|
1402
|
-
hourCycle: props.hourCycle,
|
1403
|
-
showEra: value.calendar.identifier === "gregory" && value.era === "BC"
|
1404
|
-
});
|
1405
|
-
let formatter = new (date.DateFormatter)(locale, formatOptions);
|
1406
|
-
return formatter.format(dateValue);
|
1407
|
-
}
|
1408
|
-
};
|
1409
|
-
}
|
1410
|
-
function $3e3ed55ab2966714$export$d3f5c5e0a5023fa0(field, value, locale) {
|
1411
|
-
if (field === "era" || field === "dayPeriod")
|
1412
|
-
return value;
|
1413
|
-
if (field === "year" || field === "month" || field === "day")
|
1414
|
-
return $3e3ed55ab2966714$var$placeholders.getStringForLocale(field, locale);
|
1415
|
-
return "\u2013\u2013";
|
1416
|
-
}
|
1417
|
-
function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
|
1418
|
-
let { locale, createCalendar: createCalendar4, hideTimeZone, isDisabled, isReadOnly, isRequired } = props;
|
1419
|
-
let v = props.value || props.defaultValue || props.placeholderValue;
|
1420
|
-
let [granularity, defaultTimeZone] = ($35a22f14a1f04b11$export$2440da353cedad43)(v, props.granularity);
|
1421
|
-
let timeZone = defaultTimeZone || "UTC";
|
1422
|
-
if (v && !(granularity in v))
|
1423
|
-
throw new Error("Invalid granularity " + granularity + " for value " + v.toString());
|
1424
|
-
let defaultFormatter = (React69.useMemo)(() => new (date.DateFormatter)(locale), [
|
1425
|
-
locale
|
1426
|
-
]);
|
1427
|
-
let calendar = (React69.useMemo)(() => createCalendar4(defaultFormatter.resolvedOptions().calendar), [
|
1428
|
-
createCalendar4,
|
1429
|
-
defaultFormatter
|
1430
|
-
]);
|
1431
|
-
let [value, setDate] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue, props.onChange);
|
1432
|
-
let calendarValue = (React69.useMemo)(() => ($35a22f14a1f04b11$export$61a490a80c552550)(value, calendar), [
|
1433
|
-
value,
|
1434
|
-
calendar
|
1435
|
-
]);
|
1436
|
-
let [placeholderDate, setPlaceholderDate] = (React69.useState)(() => ($35a22f14a1f04b11$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone));
|
1437
|
-
let val = calendarValue || placeholderDate;
|
1438
|
-
let showEra = calendar.identifier === "gregory" && val.era === "BC";
|
1439
|
-
var _props_maxGranularity;
|
1440
|
-
let formatOpts = (React69.useMemo)(() => ({
|
1441
|
-
granularity,
|
1442
|
-
maxGranularity: (_props_maxGranularity = props.maxGranularity) !== null && _props_maxGranularity !== void 0 ? _props_maxGranularity : "year",
|
1443
|
-
timeZone: defaultTimeZone,
|
1444
|
-
hideTimeZone,
|
1445
|
-
hourCycle: props.hourCycle,
|
1446
|
-
showEra,
|
1447
|
-
shouldForceLeadingZeros: props.shouldForceLeadingZeros
|
1448
|
-
}), [
|
1449
|
-
props.maxGranularity,
|
1450
|
-
granularity,
|
1451
|
-
props.hourCycle,
|
1452
|
-
props.shouldForceLeadingZeros,
|
1453
|
-
defaultTimeZone,
|
1454
|
-
hideTimeZone,
|
1455
|
-
showEra
|
1456
|
-
]);
|
1457
|
-
let opts = (React69.useMemo)(() => ($35a22f14a1f04b11$export$7e319ea407e63bc0)({}, formatOpts), [
|
1458
|
-
formatOpts
|
1459
|
-
]);
|
1460
|
-
let dateFormatter = (React69.useMemo)(() => new (date.DateFormatter)(locale, opts), [
|
1461
|
-
locale,
|
1462
|
-
opts
|
1463
|
-
]);
|
1464
|
-
let resolvedOptions = (React69.useMemo)(() => dateFormatter.resolvedOptions(), [
|
1465
|
-
dateFormatter
|
1466
|
-
]);
|
1467
|
-
let allSegments = (React69.useMemo)(() => dateFormatter.formatToParts(/* @__PURE__ */ new Date()).filter((seg) => $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[seg.type]).reduce((p, seg) => (p[seg.type] = true, p), {}), [
|
1468
|
-
dateFormatter
|
1469
|
-
]);
|
1470
|
-
let [validSegments, setValidSegments] = (React69.useState)(() => props.value || props.defaultValue ? {
|
1471
|
-
...allSegments
|
1472
|
-
} : {});
|
1473
|
-
let clearedSegment = (React69.useRef)();
|
1474
|
-
let lastCalendarIdentifier = (React69.useRef)(calendar.identifier);
|
1475
|
-
(React69.useEffect)(() => {
|
1476
|
-
if (calendar.identifier !== lastCalendarIdentifier.current) {
|
1477
|
-
lastCalendarIdentifier.current = calendar.identifier;
|
1478
|
-
setPlaceholderDate((placeholder) => Object.keys(validSegments).length > 0 ? (date.toCalendar)(placeholder, calendar) : ($35a22f14a1f04b11$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone));
|
1479
|
-
}
|
1480
|
-
}, [
|
1481
|
-
calendar,
|
1482
|
-
granularity,
|
1483
|
-
validSegments,
|
1484
|
-
defaultTimeZone,
|
1485
|
-
props.placeholderValue
|
1486
|
-
]);
|
1487
|
-
if (value && Object.keys(validSegments).length < Object.keys(allSegments).length) {
|
1488
|
-
validSegments = {
|
1489
|
-
...allSegments
|
1490
|
-
};
|
1491
|
-
setValidSegments(validSegments);
|
1492
|
-
}
|
1493
|
-
if (value == null && Object.keys(validSegments).length === Object.keys(allSegments).length) {
|
1494
|
-
validSegments = {};
|
1495
|
-
setValidSegments(validSegments);
|
1496
|
-
setPlaceholderDate(($35a22f14a1f04b11$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone));
|
1497
|
-
}
|
1498
|
-
let displayValue = calendarValue && Object.keys(validSegments).length >= Object.keys(allSegments).length ? calendarValue : placeholderDate;
|
1499
|
-
let setValue = (newValue) => {
|
1500
|
-
if (props.isDisabled || props.isReadOnly)
|
1501
|
-
return;
|
1502
|
-
let validKeys = Object.keys(validSegments);
|
1503
|
-
let allKeys = Object.keys(allSegments);
|
1504
|
-
if (newValue == null) {
|
1505
|
-
setDate(null);
|
1506
|
-
setPlaceholderDate(($35a22f14a1f04b11$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone));
|
1507
|
-
setValidSegments({});
|
1508
|
-
} else if (validKeys.length >= allKeys.length || validKeys.length === allKeys.length - 1 && allSegments.dayPeriod && !validSegments.dayPeriod && clearedSegment.current !== "dayPeriod") {
|
1509
|
-
newValue = (date.toCalendar)(newValue, (v === null || v === void 0 ? void 0 : v.calendar) || new (date.GregorianCalendar)());
|
1510
|
-
setDate(newValue);
|
1511
|
-
} else
|
1512
|
-
setPlaceholderDate(newValue);
|
1513
|
-
clearedSegment.current = null;
|
1514
|
-
};
|
1515
|
-
let dateValue = (React69.useMemo)(() => displayValue.toDate(timeZone), [
|
1516
|
-
displayValue,
|
1517
|
-
timeZone
|
1518
|
-
]);
|
1519
|
-
let segments = (React69.useMemo)(() => dateFormatter.formatToParts(dateValue).map((segment) => {
|
1520
|
-
let isEditable = $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[segment.type];
|
1521
|
-
if (segment.type === "era" && calendar.getEras().length === 1)
|
1522
|
-
isEditable = false;
|
1523
|
-
let isPlaceholder = $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[segment.type] && !validSegments[segment.type];
|
1524
|
-
let placeholder = $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[segment.type] ? ($3e3ed55ab2966714$export$d3f5c5e0a5023fa0)(segment.type, segment.value, locale) : null;
|
1525
|
-
return {
|
1526
|
-
type: $3c0fc76039f1c516$var$TYPE_MAPPING[segment.type] || segment.type,
|
1527
|
-
text: isPlaceholder ? placeholder : segment.value,
|
1528
|
-
...$3c0fc76039f1c516$var$getSegmentLimits(displayValue, segment.type, resolvedOptions),
|
1529
|
-
isPlaceholder,
|
1530
|
-
placeholder,
|
1531
|
-
isEditable
|
1532
|
-
};
|
1533
|
-
}), [
|
1534
|
-
dateValue,
|
1535
|
-
validSegments,
|
1536
|
-
dateFormatter,
|
1537
|
-
resolvedOptions,
|
1538
|
-
displayValue,
|
1539
|
-
calendar,
|
1540
|
-
locale
|
1541
|
-
]);
|
1542
|
-
if (allSegments.era && validSegments.year && !validSegments.era) {
|
1543
|
-
validSegments.era = true;
|
1544
|
-
setValidSegments({
|
1545
|
-
...validSegments
|
1546
|
-
});
|
1547
|
-
} else if (!allSegments.era && validSegments.era) {
|
1548
|
-
delete validSegments.era;
|
1549
|
-
setValidSegments({
|
1550
|
-
...validSegments
|
1551
|
-
});
|
1552
|
-
}
|
1553
|
-
let markValid = (part) => {
|
1554
|
-
validSegments[part] = true;
|
1555
|
-
if (part === "year" && allSegments.era)
|
1556
|
-
validSegments.era = true;
|
1557
|
-
setValidSegments({
|
1558
|
-
...validSegments
|
1559
|
-
});
|
1560
|
-
};
|
1561
|
-
let adjustSegment = (type, amount) => {
|
1562
|
-
if (!validSegments[type]) {
|
1563
|
-
markValid(type);
|
1564
|
-
let validKeys = Object.keys(validSegments);
|
1565
|
-
let allKeys = Object.keys(allSegments);
|
1566
|
-
if (validKeys.length >= allKeys.length || validKeys.length === allKeys.length - 1 && allSegments.dayPeriod && !validSegments.dayPeriod)
|
1567
|
-
setValue(displayValue);
|
1568
|
-
} else
|
1569
|
-
setValue($3c0fc76039f1c516$var$addSegment(displayValue, type, amount, resolvedOptions));
|
1570
|
-
};
|
1571
|
-
let validationState = props.validationState || (($35a22f14a1f04b11$export$eac50920cf2fd59a)(calendarValue, props.minValue, props.maxValue) ? "invalid" : null);
|
1572
|
-
var _props_maxGranularity1;
|
1573
|
-
return {
|
1574
|
-
value: calendarValue,
|
1575
|
-
dateValue,
|
1576
|
-
calendar,
|
1577
|
-
setValue,
|
1578
|
-
segments,
|
1579
|
-
dateFormatter,
|
1580
|
-
validationState,
|
1581
|
-
granularity,
|
1582
|
-
maxGranularity: (_props_maxGranularity1 = props.maxGranularity) !== null && _props_maxGranularity1 !== void 0 ? _props_maxGranularity1 : "year",
|
1583
|
-
isDisabled,
|
1584
|
-
isReadOnly,
|
1585
|
-
isRequired,
|
1586
|
-
increment(part) {
|
1587
|
-
adjustSegment(part, 1);
|
1588
|
-
},
|
1589
|
-
decrement(part) {
|
1590
|
-
adjustSegment(part, -1);
|
1591
|
-
},
|
1592
|
-
incrementPage(part) {
|
1593
|
-
adjustSegment(part, $3c0fc76039f1c516$var$PAGE_STEP[part] || 1);
|
1594
|
-
},
|
1595
|
-
decrementPage(part) {
|
1596
|
-
adjustSegment(part, -($3c0fc76039f1c516$var$PAGE_STEP[part] || 1));
|
1597
|
-
},
|
1598
|
-
setSegment(part, v2) {
|
1599
|
-
markValid(part);
|
1600
|
-
setValue($3c0fc76039f1c516$var$setSegment(displayValue, part, v2, resolvedOptions));
|
1601
|
-
},
|
1602
|
-
confirmPlaceholder() {
|
1603
|
-
if (props.isDisabled || props.isReadOnly)
|
1604
|
-
return;
|
1605
|
-
let validKeys = Object.keys(validSegments);
|
1606
|
-
let allKeys = Object.keys(allSegments);
|
1607
|
-
if (validKeys.length === allKeys.length - 1 && allSegments.dayPeriod && !validSegments.dayPeriod) {
|
1608
|
-
validSegments = {
|
1609
|
-
...allSegments
|
1610
|
-
};
|
1611
|
-
setValidSegments(validSegments);
|
1612
|
-
setValue(displayValue.copy());
|
1613
|
-
}
|
1614
|
-
},
|
1615
|
-
clearSegment(part) {
|
1616
|
-
delete validSegments[part];
|
1617
|
-
clearedSegment.current = part;
|
1618
|
-
setValidSegments({
|
1619
|
-
...validSegments
|
1620
|
-
});
|
1621
|
-
let placeholder = ($35a22f14a1f04b11$export$66aa2b09de4b1ea5)(props.placeholderValue, granularity, calendar, defaultTimeZone);
|
1622
|
-
let value2 = displayValue;
|
1623
|
-
if (part === "dayPeriod" && "hour" in displayValue && "hour" in placeholder) {
|
1624
|
-
let isPM = displayValue.hour >= 12;
|
1625
|
-
let shouldBePM = placeholder.hour >= 12;
|
1626
|
-
if (isPM && !shouldBePM)
|
1627
|
-
value2 = displayValue.set({
|
1628
|
-
hour: displayValue.hour - 12
|
1629
|
-
});
|
1630
|
-
else if (!isPM && shouldBePM)
|
1631
|
-
value2 = displayValue.set({
|
1632
|
-
hour: displayValue.hour + 12
|
1633
|
-
});
|
1634
|
-
} else if (part in displayValue)
|
1635
|
-
value2 = displayValue.set({
|
1636
|
-
[part]: placeholder[part]
|
1637
|
-
});
|
1638
|
-
setDate(null);
|
1639
|
-
setValue(value2);
|
1640
|
-
},
|
1641
|
-
formatValue(fieldOptions) {
|
1642
|
-
if (!calendarValue)
|
1643
|
-
return "";
|
1644
|
-
let formatOptions = ($35a22f14a1f04b11$export$7e319ea407e63bc0)(fieldOptions, formatOpts);
|
1645
|
-
let formatter = new (date.DateFormatter)(locale, formatOptions);
|
1646
|
-
return formatter.format(dateValue);
|
1647
|
-
}
|
1648
|
-
};
|
1649
|
-
}
|
1650
|
-
function $3c0fc76039f1c516$var$getSegmentLimits(date$1, type, options) {
|
1651
|
-
switch (type) {
|
1652
|
-
case "era": {
|
1653
|
-
let eras = date$1.calendar.getEras();
|
1654
|
-
return {
|
1655
|
-
value: eras.indexOf(date$1.era),
|
1656
|
-
minValue: 0,
|
1657
|
-
maxValue: eras.length - 1
|
1658
|
-
};
|
1659
|
-
}
|
1660
|
-
case "year":
|
1661
|
-
return {
|
1662
|
-
value: date$1.year,
|
1663
|
-
minValue: 1,
|
1664
|
-
maxValue: date$1.calendar.getYearsInEra(date$1)
|
1665
|
-
};
|
1666
|
-
case "month":
|
1667
|
-
return {
|
1668
|
-
value: date$1.month,
|
1669
|
-
minValue: (date.getMinimumMonthInYear)(date$1),
|
1670
|
-
maxValue: date$1.calendar.getMonthsInYear(date$1)
|
1671
|
-
};
|
1672
|
-
case "day":
|
1673
|
-
return {
|
1674
|
-
value: date$1.day,
|
1675
|
-
minValue: (date.getMinimumDayInMonth)(date$1),
|
1676
|
-
maxValue: date$1.calendar.getDaysInMonth(date$1)
|
1677
|
-
};
|
1678
|
-
}
|
1679
|
-
if ("hour" in date$1)
|
1680
|
-
switch (type) {
|
1681
|
-
case "dayPeriod":
|
1682
|
-
return {
|
1683
|
-
value: date$1.hour >= 12 ? 12 : 0,
|
1684
|
-
minValue: 0,
|
1685
|
-
maxValue: 12
|
1686
|
-
};
|
1687
|
-
case "hour":
|
1688
|
-
if (options.hour12) {
|
1689
|
-
let isPM = date$1.hour >= 12;
|
1690
|
-
return {
|
1691
|
-
value: date$1.hour,
|
1692
|
-
minValue: isPM ? 12 : 0,
|
1693
|
-
maxValue: isPM ? 23 : 11
|
1694
|
-
};
|
1695
|
-
}
|
1696
|
-
return {
|
1697
|
-
value: date$1.hour,
|
1698
|
-
minValue: 0,
|
1699
|
-
maxValue: 23
|
1700
|
-
};
|
1701
|
-
case "minute":
|
1702
|
-
return {
|
1703
|
-
value: date$1.minute,
|
1704
|
-
minValue: 0,
|
1705
|
-
maxValue: 59
|
1706
|
-
};
|
1707
|
-
case "second":
|
1708
|
-
return {
|
1709
|
-
value: date$1.second,
|
1710
|
-
minValue: 0,
|
1711
|
-
maxValue: 59
|
1712
|
-
};
|
1713
|
-
}
|
1714
|
-
return {};
|
1715
|
-
}
|
1716
|
-
function $3c0fc76039f1c516$var$addSegment(value, part, amount, options) {
|
1717
|
-
switch (part) {
|
1718
|
-
case "era":
|
1719
|
-
case "year":
|
1720
|
-
case "month":
|
1721
|
-
case "day":
|
1722
|
-
return value.cycle(part, amount, {
|
1723
|
-
round: part === "year"
|
1724
|
-
});
|
1725
|
-
}
|
1726
|
-
if ("hour" in value)
|
1727
|
-
switch (part) {
|
1728
|
-
case "dayPeriod": {
|
1729
|
-
let hours = value.hour;
|
1730
|
-
let isPM = hours >= 12;
|
1731
|
-
return value.set({
|
1732
|
-
hour: isPM ? hours - 12 : hours + 12
|
1733
|
-
});
|
1734
|
-
}
|
1735
|
-
case "hour":
|
1736
|
-
case "minute":
|
1737
|
-
case "second":
|
1738
|
-
return value.cycle(part, amount, {
|
1739
|
-
round: part !== "hour",
|
1740
|
-
hourCycle: options.hour12 ? 12 : 24
|
1741
|
-
});
|
1742
|
-
}
|
1743
|
-
}
|
1744
|
-
function $3c0fc76039f1c516$var$setSegment(value, part, segmentValue, options) {
|
1745
|
-
switch (part) {
|
1746
|
-
case "day":
|
1747
|
-
case "month":
|
1748
|
-
case "year":
|
1749
|
-
case "era":
|
1750
|
-
return value.set({
|
1751
|
-
[part]: segmentValue
|
1752
|
-
});
|
1753
|
-
}
|
1754
|
-
if ("hour" in value)
|
1755
|
-
switch (part) {
|
1756
|
-
case "dayPeriod": {
|
1757
|
-
let hours = value.hour;
|
1758
|
-
let wasPM = hours >= 12;
|
1759
|
-
let isPM = segmentValue >= 12;
|
1760
|
-
if (isPM === wasPM)
|
1761
|
-
return value;
|
1762
|
-
return value.set({
|
1763
|
-
hour: wasPM ? hours - 12 : hours + 12
|
1764
|
-
});
|
1765
|
-
}
|
1766
|
-
case "hour":
|
1767
|
-
if (options.hour12) {
|
1768
|
-
let hours = value.hour;
|
1769
|
-
let wasPM = hours >= 12;
|
1770
|
-
if (!wasPM && segmentValue === 12)
|
1771
|
-
segmentValue = 0;
|
1772
|
-
if (wasPM && segmentValue < 12)
|
1773
|
-
segmentValue += 12;
|
1774
|
-
}
|
1775
|
-
case "minute":
|
1776
|
-
case "second":
|
1777
|
-
return value.set({
|
1778
|
-
[part]: segmentValue
|
1779
|
-
});
|
1780
|
-
}
|
1781
|
-
}
|
1782
|
-
function $93c38a5e28be6249$export$e50a61c1de9f574(props) {
|
1783
|
-
var _props_isDateUnavailable, _props_isDateUnavailable1;
|
1784
|
-
let overlayState = ($fc909762b330b746$export$61c6a8c84e605fb6)(props);
|
1785
|
-
let [controlledValue, setControlledValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue || null, props.onChange);
|
1786
|
-
let [placeholderValue, setPlaceholderValue] = (React69.useState)(() => controlledValue || {
|
1787
|
-
start: null,
|
1788
|
-
end: null
|
1789
|
-
});
|
1790
|
-
if (controlledValue == null && placeholderValue.start && placeholderValue.end) {
|
1791
|
-
placeholderValue = {
|
1792
|
-
start: null,
|
1793
|
-
end: null
|
1794
|
-
};
|
1795
|
-
setPlaceholderValue(placeholderValue);
|
1796
|
-
}
|
1797
|
-
let value = controlledValue || placeholderValue;
|
1798
|
-
let setValue = (value2) => {
|
1799
|
-
setPlaceholderValue(value2);
|
1800
|
-
if ((value2 === null || value2 === void 0 ? void 0 : value2.start) && value2.end)
|
1801
|
-
setControlledValue(value2);
|
1802
|
-
else
|
1803
|
-
setControlledValue(null);
|
1804
|
-
};
|
1805
|
-
let v = (value === null || value === void 0 ? void 0 : value.start) || (value === null || value === void 0 ? void 0 : value.end) || props.placeholderValue;
|
1806
|
-
let [granularity] = ($35a22f14a1f04b11$export$2440da353cedad43)(v, props.granularity);
|
1807
|
-
let hasTime = granularity === "hour" || granularity === "minute" || granularity === "second";
|
1808
|
-
var _props_shouldCloseOnSelect;
|
1809
|
-
let shouldCloseOnSelect = (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : true;
|
1810
|
-
let [dateRange, setSelectedDateRange] = (React69.useState)(null);
|
1811
|
-
let [timeRange, setSelectedTimeRange] = (React69.useState)(null);
|
1812
|
-
if (value && value.start && value.end) {
|
1813
|
-
dateRange = value;
|
1814
|
-
if ("hour" in value.start)
|
1815
|
-
timeRange = value;
|
1816
|
-
}
|
1817
|
-
let commitValue = (dateRange2, timeRange2) => {
|
1818
|
-
setValue({
|
1819
|
-
start: "timeZone" in timeRange2.start ? timeRange2.start.set((date.toCalendarDate)(dateRange2.start)) : (date.toCalendarDateTime)(dateRange2.start, timeRange2.start),
|
1820
|
-
end: "timeZone" in timeRange2.end ? timeRange2.end.set((date.toCalendarDate)(dateRange2.end)) : (date.toCalendarDateTime)(dateRange2.end, timeRange2.end)
|
1821
|
-
});
|
1822
|
-
setSelectedDateRange(null);
|
1823
|
-
setSelectedTimeRange(null);
|
1824
|
-
};
|
1825
|
-
let setDateRange = (range) => {
|
1826
|
-
let shouldClose = typeof shouldCloseOnSelect === "function" ? shouldCloseOnSelect() : shouldCloseOnSelect;
|
1827
|
-
if (hasTime) {
|
1828
|
-
if (shouldClose || range.start && range.end && (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) && (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end))
|
1829
|
-
commitValue(range, {
|
1830
|
-
start: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue),
|
1831
|
-
end: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue)
|
1832
|
-
});
|
1833
|
-
else
|
1834
|
-
setSelectedDateRange(range);
|
1835
|
-
} else if (range.start && range.end)
|
1836
|
-
setValue(range);
|
1837
|
-
else
|
1838
|
-
setSelectedDateRange(range);
|
1839
|
-
if (shouldClose)
|
1840
|
-
overlayState.setOpen(false);
|
1841
|
-
};
|
1842
|
-
let setTimeRange = (range) => {
|
1843
|
-
if ((dateRange === null || dateRange === void 0 ? void 0 : dateRange.start) && (dateRange === null || dateRange === void 0 ? void 0 : dateRange.end) && range.start && range.end)
|
1844
|
-
commitValue(dateRange, range);
|
1845
|
-
else
|
1846
|
-
setSelectedTimeRange(range);
|
1847
|
-
};
|
1848
|
-
let validationState = props.validationState || (value != null && (($35a22f14a1f04b11$export$eac50920cf2fd59a)(value.start, props.minValue, props.maxValue) || ($35a22f14a1f04b11$export$eac50920cf2fd59a)(value.end, props.minValue, props.maxValue) || value.end != null && value.start != null && value.end.compare(value.start) < 0 || (value === null || value === void 0 ? void 0 : value.start) && ((_props_isDateUnavailable = props.isDateUnavailable) === null || _props_isDateUnavailable === void 0 ? void 0 : _props_isDateUnavailable.call(props, value.start)) || (value === null || value === void 0 ? void 0 : value.end) && ((_props_isDateUnavailable1 = props.isDateUnavailable) === null || _props_isDateUnavailable1 === void 0 ? void 0 : _props_isDateUnavailable1.call(props, value.end))) ? "invalid" : null);
|
1849
|
-
return {
|
1850
|
-
value,
|
1851
|
-
setValue,
|
1852
|
-
dateRange,
|
1853
|
-
timeRange,
|
1854
|
-
granularity,
|
1855
|
-
hasTime,
|
1856
|
-
setDate(part, date) {
|
1857
|
-
setDateRange({
|
1858
|
-
...dateRange,
|
1859
|
-
[part]: date
|
1860
|
-
});
|
1861
|
-
},
|
1862
|
-
setTime(part, time) {
|
1863
|
-
setTimeRange({
|
1864
|
-
...timeRange,
|
1865
|
-
[part]: time
|
1866
|
-
});
|
1867
|
-
},
|
1868
|
-
setDateTime(part, dateTime) {
|
1869
|
-
setValue({
|
1870
|
-
...value,
|
1871
|
-
[part]: dateTime
|
1872
|
-
});
|
1873
|
-
},
|
1874
|
-
setDateRange,
|
1875
|
-
setTimeRange,
|
1876
|
-
...overlayState,
|
1877
|
-
setOpen(isOpen) {
|
1878
|
-
if (!isOpen && !((value === null || value === void 0 ? void 0 : value.start) && (value === null || value === void 0 ? void 0 : value.end)) && (dateRange === null || dateRange === void 0 ? void 0 : dateRange.start) && (dateRange === null || dateRange === void 0 ? void 0 : dateRange.end) && hasTime)
|
1879
|
-
commitValue(dateRange, {
|
1880
|
-
start: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.start) || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue),
|
1881
|
-
end: (timeRange === null || timeRange === void 0 ? void 0 : timeRange.end) || ($35a22f14a1f04b11$export$c5221a78ef73c5e9)(props.placeholderValue)
|
1882
|
-
});
|
1883
|
-
overlayState.setOpen(isOpen);
|
1884
|
-
},
|
1885
|
-
validationState,
|
1886
|
-
formatValue(locale, fieldOptions) {
|
1887
|
-
if (!value || !value.start || !value.end)
|
1888
|
-
return null;
|
1889
|
-
let startTimeZone = "timeZone" in value.start ? value.start.timeZone : void 0;
|
1890
|
-
let startGranularity = props.granularity || (value.start && "minute" in value.start ? "minute" : "day");
|
1891
|
-
let endTimeZone = "timeZone" in value.end ? value.end.timeZone : void 0;
|
1892
|
-
let endGranularity = props.granularity || (value.end && "minute" in value.end ? "minute" : "day");
|
1893
|
-
let startOptions = ($35a22f14a1f04b11$export$7e319ea407e63bc0)(fieldOptions, {
|
1894
|
-
granularity: startGranularity,
|
1895
|
-
timeZone: startTimeZone,
|
1896
|
-
hideTimeZone: props.hideTimeZone,
|
1897
|
-
hourCycle: props.hourCycle,
|
1898
|
-
showEra: value.start.calendar.identifier === "gregory" && value.start.era === "BC" || value.end.calendar.identifier === "gregory" && value.end.era === "BC"
|
1899
|
-
});
|
1900
|
-
let startDate = value.start.toDate(startTimeZone || "UTC");
|
1901
|
-
let endDate = value.end.toDate(endTimeZone || "UTC");
|
1902
|
-
let startFormatter = new (date.DateFormatter)(locale, startOptions);
|
1903
|
-
let endFormatter;
|
1904
|
-
if (startTimeZone === endTimeZone && startGranularity === endGranularity && value.start.compare(value.end) !== 0) {
|
1905
|
-
try {
|
1906
|
-
let parts14 = startFormatter.formatRangeToParts(startDate, endDate);
|
1907
|
-
let separatorIndex = -1;
|
1908
|
-
for (let i = 0; i < parts14.length; i++) {
|
1909
|
-
let part = parts14[i];
|
1910
|
-
if (part.source === "shared" && part.type === "literal")
|
1911
|
-
separatorIndex = i;
|
1912
|
-
else if (part.source === "endRange")
|
1913
|
-
break;
|
1914
|
-
}
|
1915
|
-
let start = "";
|
1916
|
-
let end = "";
|
1917
|
-
for (let i = 0; i < parts14.length; i++) {
|
1918
|
-
if (i < separatorIndex)
|
1919
|
-
start += parts14[i].value;
|
1920
|
-
else if (i > separatorIndex)
|
1921
|
-
end += parts14[i].value;
|
1922
|
-
}
|
1923
|
-
return {
|
1924
|
-
start,
|
1925
|
-
end
|
1926
|
-
};
|
1927
|
-
} catch (e) {
|
1928
|
-
}
|
1929
|
-
endFormatter = startFormatter;
|
1930
|
-
} else {
|
1931
|
-
let endOptions = ($35a22f14a1f04b11$export$7e319ea407e63bc0)(fieldOptions, {
|
1932
|
-
granularity: endGranularity,
|
1933
|
-
timeZone: endTimeZone,
|
1934
|
-
hideTimeZone: props.hideTimeZone,
|
1935
|
-
hourCycle: props.hourCycle
|
1936
|
-
});
|
1937
|
-
endFormatter = new (date.DateFormatter)(locale, endOptions);
|
1938
|
-
}
|
1939
|
-
return {
|
1940
|
-
start: startFormatter.format(startDate),
|
1941
|
-
end: endFormatter.format(endDate)
|
1942
|
-
};
|
1943
|
-
}
|
1944
|
-
};
|
1945
|
-
}
|
1946
|
-
var $35a22f14a1f04b11$var$DEFAULT_FIELD_OPTIONS, $35a22f14a1f04b11$var$TWO_DIGIT_FIELD_OPTIONS, $3e3ed55ab2966714$var$placeholders, $3c0fc76039f1c516$var$EDITABLE_SEGMENTS, $3c0fc76039f1c516$var$PAGE_STEP, $3c0fc76039f1c516$var$TYPE_MAPPING;
|
1947
|
-
var init_import4 = __esm({
|
1948
|
-
"../../node_modules/@react-stately/datepicker/dist/import.mjs"() {
|
1949
|
-
init_import2();
|
1950
|
-
init_import();
|
1951
|
-
init_import3();
|
1952
|
-
$35a22f14a1f04b11$var$DEFAULT_FIELD_OPTIONS = {
|
1953
|
-
year: "numeric",
|
1954
|
-
month: "numeric",
|
1955
|
-
day: "numeric",
|
1956
|
-
hour: "numeric",
|
1957
|
-
minute: "2-digit",
|
1958
|
-
second: "2-digit"
|
1959
|
-
};
|
1960
|
-
$35a22f14a1f04b11$var$TWO_DIGIT_FIELD_OPTIONS = {
|
1961
|
-
year: "numeric",
|
1962
|
-
month: "2-digit",
|
1963
|
-
day: "2-digit",
|
1964
|
-
hour: "2-digit",
|
1965
|
-
minute: "2-digit",
|
1966
|
-
second: "2-digit"
|
1967
|
-
};
|
1968
|
-
$3e3ed55ab2966714$var$placeholders = new ($5b160d28a433310d$export$c17fa47878dc55b6)({
|
1969
|
-
ach: {
|
1970
|
-
year: "mwaka",
|
1971
|
-
month: "dwe",
|
1972
|
-
day: "nino"
|
1973
|
-
},
|
1974
|
-
af: {
|
1975
|
-
year: "jjjj",
|
1976
|
-
month: "mm",
|
1977
|
-
day: "dd"
|
1978
|
-
},
|
1979
|
-
am: {
|
1980
|
-
year: "\u12D3\u12D3\u12D3\u12D3",
|
1981
|
-
month: "\u121A\u121C",
|
1982
|
-
day: "\u1240\u1240"
|
1983
|
-
},
|
1984
|
-
an: {
|
1985
|
-
year: "aaaa",
|
1986
|
-
month: "mm",
|
1987
|
-
day: "dd"
|
1988
|
-
},
|
1989
|
-
ar: {
|
1990
|
-
year: "\u0633\u0646\u0629",
|
1991
|
-
month: "\u0634\u0647\u0631",
|
1992
|
-
day: "\u064A\u0648\u0645"
|
1993
|
-
},
|
1994
|
-
ast: {
|
1995
|
-
year: "aaaa",
|
1996
|
-
month: "mm",
|
1997
|
-
day: "dd"
|
1998
|
-
},
|
1999
|
-
az: {
|
2000
|
-
year: "iiii",
|
2001
|
-
month: "aa",
|
2002
|
-
day: "gg"
|
2003
|
-
},
|
2004
|
-
be: {
|
2005
|
-
year: "\u0433\u0433\u0433\u0433",
|
2006
|
-
month: "\u043C\u043C",
|
2007
|
-
day: "\u0434\u0434"
|
2008
|
-
},
|
2009
|
-
bg: {
|
2010
|
-
year: "\u0433\u0433\u0433\u0433",
|
2011
|
-
month: "\u043C\u043C",
|
2012
|
-
day: "\u0434\u0434"
|
2013
|
-
},
|
2014
|
-
bn: {
|
2015
|
-
year: "yyyy",
|
2016
|
-
month: "\u09AE\u09BF\u09AE\u09BF",
|
2017
|
-
day: "dd"
|
2018
|
-
},
|
2019
|
-
br: {
|
2020
|
-
year: "bbbb",
|
2021
|
-
month: "mm",
|
2022
|
-
day: "dd"
|
2023
|
-
},
|
2024
|
-
bs: {
|
2025
|
-
year: "gggg",
|
2026
|
-
month: "mm",
|
2027
|
-
day: "dd"
|
2028
|
-
},
|
2029
|
-
ca: {
|
2030
|
-
year: "aaaa",
|
2031
|
-
month: "mm",
|
2032
|
-
day: "dd"
|
2033
|
-
},
|
2034
|
-
cak: {
|
2035
|
-
year: "jjjj",
|
2036
|
-
month: "ii",
|
2037
|
-
day: "q'q'"
|
2038
|
-
},
|
2039
|
-
ckb: {
|
2040
|
-
year: "\u0633\u0627\u06B5",
|
2041
|
-
month: "\u0645\u0627\u0646\u06AF",
|
2042
|
-
day: "\u0695\u06C6\u0698"
|
2043
|
-
},
|
2044
|
-
cs: {
|
2045
|
-
year: "rrrr",
|
2046
|
-
month: "mm",
|
2047
|
-
day: "dd"
|
2048
|
-
},
|
2049
|
-
cy: {
|
2050
|
-
year: "bbbb",
|
2051
|
-
month: "mm",
|
2052
|
-
day: "dd"
|
2053
|
-
},
|
2054
|
-
da: {
|
2055
|
-
year: "\xE5\xE5\xE5\xE5",
|
2056
|
-
month: "mm",
|
2057
|
-
day: "dd"
|
2058
|
-
},
|
2059
|
-
de: {
|
2060
|
-
year: "jjjj",
|
2061
|
-
month: "mm",
|
2062
|
-
day: "tt"
|
2063
|
-
},
|
2064
|
-
dsb: {
|
2065
|
-
year: "llll",
|
2066
|
-
month: "mm",
|
2067
|
-
day: "\u017A\u017A"
|
2068
|
-
},
|
2069
|
-
el: {
|
2070
|
-
year: "\u03B5\u03B5\u03B5\u03B5",
|
2071
|
-
month: "\u03BC\u03BC",
|
2072
|
-
day: "\u03B7\u03B7"
|
2073
|
-
},
|
2074
|
-
en: {
|
2075
|
-
year: "yyyy",
|
2076
|
-
month: "mm",
|
2077
|
-
day: "dd"
|
2078
|
-
},
|
2079
|
-
eo: {
|
2080
|
-
year: "jjjj",
|
2081
|
-
month: "mm",
|
2082
|
-
day: "tt"
|
2083
|
-
},
|
2084
|
-
es: {
|
2085
|
-
year: "aaaa",
|
2086
|
-
month: "mm",
|
2087
|
-
day: "dd"
|
2088
|
-
},
|
2089
|
-
et: {
|
2090
|
-
year: "aaaa",
|
2091
|
-
month: "kk",
|
2092
|
-
day: "pp"
|
2093
|
-
},
|
2094
|
-
eu: {
|
2095
|
-
year: "uuuu",
|
2096
|
-
month: "hh",
|
2097
|
-
day: "ee"
|
2098
|
-
},
|
2099
|
-
fa: {
|
2100
|
-
year: "\u0633\u0627\u0644",
|
2101
|
-
month: "\u0645\u0627\u0647",
|
2102
|
-
day: "\u0631\u0648\u0632"
|
2103
|
-
},
|
2104
|
-
ff: {
|
2105
|
-
year: "hhhh",
|
2106
|
-
month: "ll",
|
2107
|
-
day: "\xF1\xF1"
|
2108
|
-
},
|
2109
|
-
fi: {
|
2110
|
-
year: "vvvv",
|
2111
|
-
month: "kk",
|
2112
|
-
day: "pp"
|
2113
|
-
},
|
2114
|
-
fr: {
|
2115
|
-
year: "aaaa",
|
2116
|
-
month: "mm",
|
2117
|
-
day: "jj"
|
2118
|
-
},
|
2119
|
-
fy: {
|
2120
|
-
year: "jjjj",
|
2121
|
-
month: "mm",
|
2122
|
-
day: "dd"
|
2123
|
-
},
|
2124
|
-
ga: {
|
2125
|
-
year: "bbbb",
|
2126
|
-
month: "mm",
|
2127
|
-
day: "ll"
|
2128
|
-
},
|
2129
|
-
gd: {
|
2130
|
-
year: "bbbb",
|
2131
|
-
month: "mm",
|
2132
|
-
day: "ll"
|
2133
|
-
},
|
2134
|
-
gl: {
|
2135
|
-
year: "aaaa",
|
2136
|
-
month: "mm",
|
2137
|
-
day: "dd"
|
2138
|
-
},
|
2139
|
-
he: {
|
2140
|
-
year: "\u05E9\u05E0\u05D4",
|
2141
|
-
month: "\u05D7\u05D5\u05D3\u05E9",
|
2142
|
-
day: "\u05D9\u05D5\u05DD"
|
2143
|
-
},
|
2144
|
-
hr: {
|
2145
|
-
year: "gggg",
|
2146
|
-
month: "mm",
|
2147
|
-
day: "dd"
|
2148
|
-
},
|
2149
|
-
hsb: {
|
2150
|
-
year: "llll",
|
2151
|
-
month: "mm",
|
2152
|
-
day: "dd"
|
2153
|
-
},
|
2154
|
-
hu: {
|
2155
|
-
year: "\xE9\xE9\xE9\xE9",
|
2156
|
-
month: "hh",
|
2157
|
-
day: "nn"
|
2158
|
-
},
|
2159
|
-
ia: {
|
2160
|
-
year: "aaaa",
|
2161
|
-
month: "mm",
|
2162
|
-
day: "dd"
|
2163
|
-
},
|
2164
|
-
id: {
|
2165
|
-
year: "tttt",
|
2166
|
-
month: "bb",
|
2167
|
-
day: "hh"
|
2168
|
-
},
|
2169
|
-
it: {
|
2170
|
-
year: "aaaa",
|
2171
|
-
month: "mm",
|
2172
|
-
day: "gg"
|
2173
|
-
},
|
2174
|
-
ja: {
|
2175
|
-
year: " \u5E74 ",
|
2176
|
-
month: "\u6708",
|
2177
|
-
day: "\u65E5"
|
2178
|
-
},
|
2179
|
-
ka: {
|
2180
|
-
year: "\u10EC\u10EC\u10EC\u10EC",
|
2181
|
-
month: "\u10D7\u10D7",
|
2182
|
-
day: "\u10E0\u10E0"
|
2183
|
-
},
|
2184
|
-
kk: {
|
2185
|
-
year: "\u0436\u0436\u0436\u0436",
|
2186
|
-
month: "\u0430\u0430",
|
2187
|
-
day: "\u043A\u043A"
|
2188
|
-
},
|
2189
|
-
kn: {
|
2190
|
-
year: "\u0CB5\u0CB5\u0CB5\u0CB5",
|
2191
|
-
month: "\u0CAE\u0CBF\u0CAE\u0CC0",
|
2192
|
-
day: "\u0CA6\u0CBF\u0CA6\u0CBF"
|
2193
|
-
},
|
2194
|
-
ko: {
|
2195
|
-
year: "\uC5F0\uB3C4",
|
2196
|
-
month: "\uC6D4",
|
2197
|
-
day: "\uC77C"
|
2198
|
-
},
|
2199
|
-
lb: {
|
2200
|
-
year: "jjjj",
|
2201
|
-
month: "mm",
|
2202
|
-
day: "dd"
|
2203
|
-
},
|
2204
|
-
lo: {
|
2205
|
-
year: "\u0E9B\u0E9B\u0E9B\u0E9B",
|
2206
|
-
month: "\u0E94\u0E94",
|
2207
|
-
day: "\u0EA7\u0EA7"
|
2208
|
-
},
|
2209
|
-
lt: {
|
2210
|
-
year: "mmmm",
|
2211
|
-
month: "mm",
|
2212
|
-
day: "dd"
|
2213
|
-
},
|
2214
|
-
lv: {
|
2215
|
-
year: "gggg",
|
2216
|
-
month: "mm",
|
2217
|
-
day: "dd"
|
2218
|
-
},
|
2219
|
-
meh: {
|
2220
|
-
year: "aaaa",
|
2221
|
-
month: "mm",
|
2222
|
-
day: "dd"
|
2223
|
-
},
|
2224
|
-
ml: {
|
2225
|
-
year: "\u0D35\u0D7C\u0D37\u0D02",
|
2226
|
-
month: "\u0D2E\u0D3E\u0D38\u0D02",
|
2227
|
-
day: "\u0D24\u0D40\u0D2F\u0D24\u0D3F"
|
2228
|
-
},
|
2229
|
-
ms: {
|
2230
|
-
year: "tttt",
|
2231
|
-
month: "mm",
|
2232
|
-
day: "hh"
|
2233
|
-
},
|
2234
|
-
nl: {
|
2235
|
-
year: "jjjj",
|
2236
|
-
month: "mm",
|
2237
|
-
day: "dd"
|
2238
|
-
},
|
2239
|
-
nn: {
|
2240
|
-
year: "\xE5\xE5\xE5\xE5",
|
2241
|
-
month: "mm",
|
2242
|
-
day: "dd"
|
2243
|
-
},
|
2244
|
-
no: {
|
2245
|
-
year: "\xE5\xE5\xE5\xE5",
|
2246
|
-
month: "mm",
|
2247
|
-
day: "dd"
|
2248
|
-
},
|
2249
|
-
oc: {
|
2250
|
-
year: "aaaa",
|
2251
|
-
month: "mm",
|
2252
|
-
day: "jj"
|
2253
|
-
},
|
2254
|
-
pl: {
|
2255
|
-
year: "rrrr",
|
2256
|
-
month: "mm",
|
2257
|
-
day: "dd"
|
2258
|
-
},
|
2259
|
-
pt: {
|
2260
|
-
year: "aaaa",
|
2261
|
-
month: "mm",
|
2262
|
-
day: "dd"
|
2263
|
-
},
|
2264
|
-
rm: {
|
2265
|
-
year: "oooo",
|
2266
|
-
month: "mm",
|
2267
|
-
day: "dd"
|
2268
|
-
},
|
2269
|
-
ro: {
|
2270
|
-
year: "aaaa",
|
2271
|
-
month: "ll",
|
2272
|
-
day: "zz"
|
2273
|
-
},
|
2274
|
-
ru: {
|
2275
|
-
year: "\u0433\u0433\u0433\u0433",
|
2276
|
-
month: "\u043C\u043C",
|
2277
|
-
day: "\u0434\u0434"
|
2278
|
-
},
|
2279
|
-
sc: {
|
2280
|
-
year: "aaaa",
|
2281
|
-
month: "mm",
|
2282
|
-
day: "dd"
|
2283
|
-
},
|
2284
|
-
scn: {
|
2285
|
-
year: "aaaa",
|
2286
|
-
month: "mm",
|
2287
|
-
day: "jj"
|
2288
|
-
},
|
2289
|
-
sk: {
|
2290
|
-
year: "rrrr",
|
2291
|
-
month: "mm",
|
2292
|
-
day: "dd"
|
2293
|
-
},
|
2294
|
-
sl: {
|
2295
|
-
year: "llll",
|
2296
|
-
month: "mm",
|
2297
|
-
day: "dd"
|
2298
|
-
},
|
2299
|
-
sr: {
|
2300
|
-
year: "\u0433\u0433\u0433\u0433",
|
2301
|
-
month: "\u043C\u043C",
|
2302
|
-
day: "\u0434\u0434"
|
2303
|
-
},
|
2304
|
-
sv: {
|
2305
|
-
year: "\xE5\xE5\xE5\xE5",
|
2306
|
-
month: "mm",
|
2307
|
-
day: "dd"
|
2308
|
-
},
|
2309
|
-
szl: {
|
2310
|
-
year: "rrrr",
|
2311
|
-
month: "mm",
|
2312
|
-
day: "dd"
|
2313
|
-
},
|
2314
|
-
tg: {
|
2315
|
-
year: "\u0441\u0441\u0441\u0441",
|
2316
|
-
month: "\u043C\u043C",
|
2317
|
-
day: "\u0440\u0440"
|
2318
|
-
},
|
2319
|
-
th: {
|
2320
|
-
year: "\u0E1B\u0E1B\u0E1B\u0E1B",
|
2321
|
-
month: "\u0E14\u0E14",
|
2322
|
-
day: "\u0E27\u0E27"
|
2323
|
-
},
|
2324
|
-
tr: {
|
2325
|
-
year: "yyyy",
|
2326
|
-
month: "aa",
|
2327
|
-
day: "gg"
|
2328
|
-
},
|
2329
|
-
uk: {
|
2330
|
-
year: "\u0440\u0440\u0440\u0440",
|
2331
|
-
month: "\u043C\u043C",
|
2332
|
-
day: "\u0434\u0434"
|
2333
|
-
},
|
2334
|
-
"zh-CN": {
|
2335
|
-
year: "\u5E74",
|
2336
|
-
month: "\u6708",
|
2337
|
-
day: "\u65E5"
|
2338
|
-
},
|
2339
|
-
"zh-TW": {
|
2340
|
-
year: "\u5E74",
|
2341
|
-
month: "\u6708",
|
2342
|
-
day: "\u65E5"
|
2343
|
-
}
|
2344
|
-
}, "en");
|
2345
|
-
$3c0fc76039f1c516$var$EDITABLE_SEGMENTS = {
|
2346
|
-
year: true,
|
2347
|
-
month: true,
|
2348
|
-
day: true,
|
2349
|
-
hour: true,
|
2350
|
-
minute: true,
|
2351
|
-
second: true,
|
2352
|
-
dayPeriod: true,
|
2353
|
-
era: true
|
2354
|
-
};
|
2355
|
-
$3c0fc76039f1c516$var$PAGE_STEP = {
|
2356
|
-
year: 5,
|
2357
|
-
month: 2,
|
2358
|
-
day: 7,
|
2359
|
-
hour: 2,
|
2360
|
-
minute: 15,
|
2361
|
-
second: 15
|
2362
|
-
};
|
2363
|
-
$3c0fc76039f1c516$var$TYPE_MAPPING = {
|
2364
|
-
dayperiod: "dayPeriod"
|
2365
|
-
};
|
2366
|
-
}
|
2367
|
-
});
|
2368
|
-
function $f62d864046160412$export$eac50920cf2fd59a(date, minValue, maxValue) {
|
2369
|
-
return minValue != null && date.compare(minValue) < 0 || maxValue != null && date.compare(maxValue) > 0;
|
2370
|
-
}
|
2371
|
-
function $f62d864046160412$export$f4a51ff076cc9a09(date, duration, locale, minValue, maxValue) {
|
2372
|
-
let halfDuration = {};
|
2373
|
-
for (let key in duration) {
|
2374
|
-
halfDuration[key] = Math.floor(duration[key] / 2);
|
2375
|
-
if (halfDuration[key] > 0 && duration[key] % 2 === 0)
|
2376
|
-
halfDuration[key]--;
|
2377
|
-
}
|
2378
|
-
let aligned = $f62d864046160412$export$144a00ba6044eb9(date, duration, locale).subtract(halfDuration);
|
2379
|
-
return $f62d864046160412$export$5bb865b12696a77d(date, aligned, duration, locale, minValue, maxValue);
|
2380
|
-
}
|
2381
|
-
function $f62d864046160412$export$144a00ba6044eb9(date$1, duration, locale, minValue, maxValue) {
|
2382
|
-
let aligned = date$1;
|
2383
|
-
if (duration.years)
|
2384
|
-
aligned = (date.startOfYear)(date$1);
|
2385
|
-
else if (duration.months)
|
2386
|
-
aligned = (date.startOfMonth)(date$1);
|
2387
|
-
else if (duration.weeks)
|
2388
|
-
aligned = (date.startOfWeek)(date$1, locale);
|
2389
|
-
return $f62d864046160412$export$5bb865b12696a77d(date$1, aligned, duration, locale, minValue, maxValue);
|
2390
|
-
}
|
2391
|
-
function $f62d864046160412$export$530edbfc915b2b04(date, duration, locale, minValue, maxValue) {
|
2392
|
-
let d = {
|
2393
|
-
...duration
|
2394
|
-
};
|
2395
|
-
if (duration.days)
|
2396
|
-
d.days--;
|
2397
|
-
else if (duration.weeks)
|
2398
|
-
d.weeks--;
|
2399
|
-
else if (duration.months)
|
2400
|
-
d.months--;
|
2401
|
-
else if (duration.years)
|
2402
|
-
d.years--;
|
2403
|
-
let aligned = $f62d864046160412$export$144a00ba6044eb9(date, duration, locale).subtract(d);
|
2404
|
-
return $f62d864046160412$export$5bb865b12696a77d(date, aligned, duration, locale, minValue, maxValue);
|
2405
|
-
}
|
2406
|
-
function $f62d864046160412$export$5bb865b12696a77d(date$1, aligned, duration, locale, minValue, maxValue) {
|
2407
|
-
if (minValue && date$1.compare(minValue) >= 0)
|
2408
|
-
aligned = (date.maxDate)(aligned, $f62d864046160412$export$144a00ba6044eb9((date.toCalendarDate)(minValue), duration, locale));
|
2409
|
-
if (maxValue && date$1.compare(maxValue) <= 0)
|
2410
|
-
aligned = (date.minDate)(aligned, $f62d864046160412$export$530edbfc915b2b04((date.toCalendarDate)(maxValue), duration, locale));
|
2411
|
-
return aligned;
|
2412
|
-
}
|
2413
|
-
function $f62d864046160412$export$4f5203c0d889109e(date$1, minValue, maxValue) {
|
2414
|
-
if (minValue)
|
2415
|
-
date$1 = (date.maxDate)(date$1, (date.toCalendarDate)(minValue));
|
2416
|
-
if (maxValue)
|
2417
|
-
date$1 = (date.minDate)(date$1, (date.toCalendarDate)(maxValue));
|
2418
|
-
return date$1;
|
2419
|
-
}
|
2420
|
-
function $f62d864046160412$export$a1d3911297b952d7(date, minValue, isDateUnavailable) {
|
2421
|
-
if (!isDateUnavailable)
|
2422
|
-
return date;
|
2423
|
-
while (date.compare(minValue) >= 0 && isDateUnavailable(date))
|
2424
|
-
date = date.subtract({
|
2425
|
-
days: 1
|
2426
|
-
});
|
2427
|
-
if (date.compare(minValue) >= 0)
|
2428
|
-
return date;
|
2429
|
-
}
|
2430
|
-
function $131cf43a05231e1e$export$6d095e787d2b5e1f(props) {
|
2431
|
-
let defaultFormatter = (React69.useMemo)(() => new (date.DateFormatter)(props.locale), [
|
2432
|
-
props.locale
|
2433
|
-
]);
|
2434
|
-
let resolvedOptions = (React69.useMemo)(() => defaultFormatter.resolvedOptions(), [
|
2435
|
-
defaultFormatter
|
2436
|
-
]);
|
2437
|
-
let { locale, createCalendar: createCalendar4, visibleDuration = {
|
2438
|
-
months: 1
|
2439
|
-
}, minValue, maxValue, selectionAlignment, isDateUnavailable, pageBehavior = "visible" } = props;
|
2440
|
-
let calendar = (React69.useMemo)(() => createCalendar4(resolvedOptions.calendar), [
|
2441
|
-
createCalendar4,
|
2442
|
-
resolvedOptions.calendar
|
2443
|
-
]);
|
2444
|
-
let [value, setControlledValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue, props.onChange);
|
2445
|
-
let calendarDateValue = (React69.useMemo)(() => value ? (date.toCalendar)((date.toCalendarDate)(value), calendar) : null, [
|
2446
|
-
value,
|
2447
|
-
calendar
|
2448
|
-
]);
|
2449
|
-
let timeZone = (React69.useMemo)(() => value && "timeZone" in value ? value.timeZone : resolvedOptions.timeZone, [
|
2450
|
-
value,
|
2451
|
-
resolvedOptions.timeZone
|
2452
|
-
]);
|
2453
|
-
let focusedCalendarDate = (React69.useMemo)(() => props.focusedValue ? ($f62d864046160412$export$4f5203c0d889109e)((date.toCalendar)((date.toCalendarDate)(props.focusedValue), calendar), minValue, maxValue) : void 0, [
|
2454
|
-
props.focusedValue,
|
2455
|
-
calendar,
|
2456
|
-
minValue,
|
2457
|
-
maxValue
|
2458
|
-
]);
|
2459
|
-
let defaultFocusedCalendarDate = (React69.useMemo)(() => ($f62d864046160412$export$4f5203c0d889109e)(props.defaultFocusedValue ? (date.toCalendar)((date.toCalendarDate)(props.defaultFocusedValue), calendar) : calendarDateValue || (date.toCalendar)((date.today)(timeZone), calendar), minValue, maxValue), [
|
2460
|
-
props.defaultFocusedValue,
|
2461
|
-
calendarDateValue,
|
2462
|
-
timeZone,
|
2463
|
-
calendar,
|
2464
|
-
minValue,
|
2465
|
-
maxValue
|
2466
|
-
]);
|
2467
|
-
let [focusedDate, setFocusedDate] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(focusedCalendarDate, defaultFocusedCalendarDate, props.onFocusChange);
|
2468
|
-
let [startDate, setStartDate] = (React69.useState)(() => {
|
2469
|
-
switch (selectionAlignment) {
|
2470
|
-
case "start":
|
2471
|
-
return ($f62d864046160412$export$144a00ba6044eb9)(focusedDate, visibleDuration, locale, minValue, maxValue);
|
2472
|
-
case "end":
|
2473
|
-
return ($f62d864046160412$export$530edbfc915b2b04)(focusedDate, visibleDuration, locale, minValue, maxValue);
|
2474
|
-
case "center":
|
2475
|
-
default:
|
2476
|
-
return ($f62d864046160412$export$f4a51ff076cc9a09)(focusedDate, visibleDuration, locale, minValue, maxValue);
|
2477
|
-
}
|
2478
|
-
});
|
2479
|
-
let [isFocused, setFocused] = (React69.useState)(props.autoFocus || false);
|
2480
|
-
let endDate = (React69.useMemo)(() => {
|
2481
|
-
let duration = {
|
2482
|
-
...visibleDuration
|
2483
|
-
};
|
2484
|
-
if (duration.days)
|
2485
|
-
duration.days--;
|
2486
|
-
else
|
2487
|
-
duration.days = -1;
|
2488
|
-
return startDate.add(duration);
|
2489
|
-
}, [
|
2490
|
-
startDate,
|
2491
|
-
visibleDuration
|
2492
|
-
]);
|
2493
|
-
let [lastCalendarIdentifier, setLastCalendarIdentifier] = (React69.useState)(calendar.identifier);
|
2494
|
-
if (calendar.identifier !== lastCalendarIdentifier) {
|
2495
|
-
let newFocusedDate = (date.toCalendar)(focusedDate, calendar);
|
2496
|
-
setStartDate(($f62d864046160412$export$f4a51ff076cc9a09)(newFocusedDate, visibleDuration, locale, minValue, maxValue));
|
2497
|
-
setFocusedDate(newFocusedDate);
|
2498
|
-
setLastCalendarIdentifier(calendar.identifier);
|
2499
|
-
}
|
2500
|
-
if (($f62d864046160412$export$eac50920cf2fd59a)(focusedDate, minValue, maxValue))
|
2501
|
-
setFocusedDate(($f62d864046160412$export$4f5203c0d889109e)(focusedDate, minValue, maxValue));
|
2502
|
-
else if (focusedDate.compare(startDate) < 0)
|
2503
|
-
setStartDate(($f62d864046160412$export$530edbfc915b2b04)(focusedDate, visibleDuration, locale, minValue, maxValue));
|
2504
|
-
else if (focusedDate.compare(endDate) > 0)
|
2505
|
-
setStartDate(($f62d864046160412$export$144a00ba6044eb9)(focusedDate, visibleDuration, locale, minValue, maxValue));
|
2506
|
-
function focusCell(date) {
|
2507
|
-
date = ($f62d864046160412$export$4f5203c0d889109e)(date, minValue, maxValue);
|
2508
|
-
setFocusedDate(date);
|
2509
|
-
}
|
2510
|
-
function setValue(newValue) {
|
2511
|
-
if (!props.isDisabled && !props.isReadOnly) {
|
2512
|
-
newValue = ($f62d864046160412$export$4f5203c0d889109e)(newValue, minValue, maxValue);
|
2513
|
-
newValue = ($f62d864046160412$export$a1d3911297b952d7)(newValue, startDate, isDateUnavailable);
|
2514
|
-
if (!newValue)
|
2515
|
-
return;
|
2516
|
-
newValue = (date.toCalendar)(newValue, (value === null || value === void 0 ? void 0 : value.calendar) || new (date.GregorianCalendar)());
|
2517
|
-
if (value && "hour" in value)
|
2518
|
-
setControlledValue(value.set(newValue));
|
2519
|
-
else
|
2520
|
-
setControlledValue(newValue);
|
2521
|
-
}
|
2522
|
-
}
|
2523
|
-
let isUnavailable = (React69.useMemo)(() => {
|
2524
|
-
if (!calendarDateValue)
|
2525
|
-
return false;
|
2526
|
-
if (isDateUnavailable && isDateUnavailable(calendarDateValue))
|
2527
|
-
return true;
|
2528
|
-
return ($f62d864046160412$export$eac50920cf2fd59a)(calendarDateValue, minValue, maxValue);
|
2529
|
-
}, [
|
2530
|
-
calendarDateValue,
|
2531
|
-
isDateUnavailable,
|
2532
|
-
minValue,
|
2533
|
-
maxValue
|
2534
|
-
]);
|
2535
|
-
let validationState = props.validationState || (isUnavailable ? "invalid" : null);
|
2536
|
-
let pageDuration = (React69.useMemo)(() => {
|
2537
|
-
if (pageBehavior === "visible")
|
2538
|
-
return visibleDuration;
|
2539
|
-
return $131cf43a05231e1e$var$unitDuration(visibleDuration);
|
2540
|
-
}, [
|
2541
|
-
pageBehavior,
|
2542
|
-
visibleDuration
|
2543
|
-
]);
|
2544
|
-
return {
|
2545
|
-
isDisabled: props.isDisabled,
|
2546
|
-
isReadOnly: props.isReadOnly,
|
2547
|
-
value: calendarDateValue,
|
2548
|
-
setValue,
|
2549
|
-
visibleRange: {
|
2550
|
-
start: startDate,
|
2551
|
-
end: endDate
|
2552
|
-
},
|
2553
|
-
minValue,
|
2554
|
-
maxValue,
|
2555
|
-
focusedDate,
|
2556
|
-
timeZone,
|
2557
|
-
validationState,
|
2558
|
-
setFocusedDate(date) {
|
2559
|
-
focusCell(date);
|
2560
|
-
setFocused(true);
|
2561
|
-
},
|
2562
|
-
focusNextDay() {
|
2563
|
-
focusCell(focusedDate.add({
|
2564
|
-
days: 1
|
2565
|
-
}));
|
2566
|
-
},
|
2567
|
-
focusPreviousDay() {
|
2568
|
-
focusCell(focusedDate.subtract({
|
2569
|
-
days: 1
|
2570
|
-
}));
|
2571
|
-
},
|
2572
|
-
focusNextRow() {
|
2573
|
-
if (visibleDuration.days)
|
2574
|
-
this.focusNextPage();
|
2575
|
-
else if (visibleDuration.weeks || visibleDuration.months || visibleDuration.years)
|
2576
|
-
focusCell(focusedDate.add({
|
2577
|
-
weeks: 1
|
2578
|
-
}));
|
2579
|
-
},
|
2580
|
-
focusPreviousRow() {
|
2581
|
-
if (visibleDuration.days)
|
2582
|
-
this.focusPreviousPage();
|
2583
|
-
else if (visibleDuration.weeks || visibleDuration.months || visibleDuration.years)
|
2584
|
-
focusCell(focusedDate.subtract({
|
2585
|
-
weeks: 1
|
2586
|
-
}));
|
2587
|
-
},
|
2588
|
-
focusNextPage() {
|
2589
|
-
let start = startDate.add(pageDuration);
|
2590
|
-
setFocusedDate(($f62d864046160412$export$4f5203c0d889109e)(focusedDate.add(pageDuration), minValue, maxValue));
|
2591
|
-
setStartDate(($f62d864046160412$export$144a00ba6044eb9)(($f62d864046160412$export$5bb865b12696a77d)(focusedDate, start, pageDuration, locale, minValue, maxValue), pageDuration, locale));
|
2592
|
-
},
|
2593
|
-
focusPreviousPage() {
|
2594
|
-
let start = startDate.subtract(pageDuration);
|
2595
|
-
setFocusedDate(($f62d864046160412$export$4f5203c0d889109e)(focusedDate.subtract(pageDuration), minValue, maxValue));
|
2596
|
-
setStartDate(($f62d864046160412$export$144a00ba6044eb9)(($f62d864046160412$export$5bb865b12696a77d)(focusedDate, start, pageDuration, locale, minValue, maxValue), pageDuration, locale));
|
2597
|
-
},
|
2598
|
-
focusSectionStart() {
|
2599
|
-
if (visibleDuration.days)
|
2600
|
-
focusCell(startDate);
|
2601
|
-
else if (visibleDuration.weeks)
|
2602
|
-
focusCell((date.startOfWeek)(focusedDate, locale));
|
2603
|
-
else if (visibleDuration.months || visibleDuration.years)
|
2604
|
-
focusCell((date.startOfMonth)(focusedDate));
|
2605
|
-
},
|
2606
|
-
focusSectionEnd() {
|
2607
|
-
if (visibleDuration.days)
|
2608
|
-
focusCell(endDate);
|
2609
|
-
else if (visibleDuration.weeks)
|
2610
|
-
focusCell((date.endOfWeek)(focusedDate, locale));
|
2611
|
-
else if (visibleDuration.months || visibleDuration.years)
|
2612
|
-
focusCell((date.endOfMonth)(focusedDate));
|
2613
|
-
},
|
2614
|
-
focusNextSection(larger) {
|
2615
|
-
if (!larger && !visibleDuration.days) {
|
2616
|
-
focusCell(focusedDate.add($131cf43a05231e1e$var$unitDuration(visibleDuration)));
|
2617
|
-
return;
|
2618
|
-
}
|
2619
|
-
if (visibleDuration.days)
|
2620
|
-
this.focusNextPage();
|
2621
|
-
else if (visibleDuration.weeks)
|
2622
|
-
focusCell(focusedDate.add({
|
2623
|
-
months: 1
|
2624
|
-
}));
|
2625
|
-
else if (visibleDuration.months || visibleDuration.years)
|
2626
|
-
focusCell(focusedDate.add({
|
2627
|
-
years: 1
|
2628
|
-
}));
|
2629
|
-
},
|
2630
|
-
focusPreviousSection(larger) {
|
2631
|
-
if (!larger && !visibleDuration.days) {
|
2632
|
-
focusCell(focusedDate.subtract($131cf43a05231e1e$var$unitDuration(visibleDuration)));
|
2633
|
-
return;
|
2634
|
-
}
|
2635
|
-
if (visibleDuration.days)
|
2636
|
-
this.focusPreviousPage();
|
2637
|
-
else if (visibleDuration.weeks)
|
2638
|
-
focusCell(focusedDate.subtract({
|
2639
|
-
months: 1
|
2640
|
-
}));
|
2641
|
-
else if (visibleDuration.months || visibleDuration.years)
|
2642
|
-
focusCell(focusedDate.subtract({
|
2643
|
-
years: 1
|
2644
|
-
}));
|
2645
|
-
},
|
2646
|
-
selectFocusedDate() {
|
2647
|
-
setValue(focusedDate);
|
2648
|
-
},
|
2649
|
-
selectDate(date) {
|
2650
|
-
setValue(date);
|
2651
|
-
},
|
2652
|
-
isFocused,
|
2653
|
-
setFocused,
|
2654
|
-
isInvalid(date) {
|
2655
|
-
return ($f62d864046160412$export$eac50920cf2fd59a)(date, minValue, maxValue);
|
2656
|
-
},
|
2657
|
-
isSelected(date$1) {
|
2658
|
-
return calendarDateValue != null && (date.isSameDay)(date$1, calendarDateValue) && !this.isCellDisabled(date$1) && !this.isCellUnavailable(date$1);
|
2659
|
-
},
|
2660
|
-
isCellFocused(date$1) {
|
2661
|
-
return isFocused && focusedDate && (date.isSameDay)(date$1, focusedDate);
|
2662
|
-
},
|
2663
|
-
isCellDisabled(date) {
|
2664
|
-
return props.isDisabled || date.compare(startDate) < 0 || date.compare(endDate) > 0 || this.isInvalid(date, minValue, maxValue);
|
2665
|
-
},
|
2666
|
-
isCellUnavailable(date) {
|
2667
|
-
return props.isDateUnavailable && props.isDateUnavailable(date);
|
2668
|
-
},
|
2669
|
-
isPreviousVisibleRangeInvalid() {
|
2670
|
-
let prev = startDate.subtract({
|
2671
|
-
days: 1
|
2672
|
-
});
|
2673
|
-
return (date.isSameDay)(prev, startDate) || this.isInvalid(prev, minValue, maxValue);
|
2674
|
-
},
|
2675
|
-
isNextVisibleRangeInvalid() {
|
2676
|
-
let next = endDate.add({
|
2677
|
-
days: 1
|
2678
|
-
});
|
2679
|
-
return (date.isSameDay)(next, endDate) || this.isInvalid(next, minValue, maxValue);
|
2680
|
-
},
|
2681
|
-
getDatesInWeek(weekIndex, from = startDate) {
|
2682
|
-
let date$1 = from.add({
|
2683
|
-
weeks: weekIndex
|
2684
|
-
});
|
2685
|
-
let dates = [];
|
2686
|
-
date$1 = (date.startOfWeek)(date$1, locale);
|
2687
|
-
let dayOfWeek = (date.getDayOfWeek)(date$1, locale);
|
2688
|
-
for (let i = 0; i < dayOfWeek; i++)
|
2689
|
-
dates.push(null);
|
2690
|
-
while (dates.length < 7) {
|
2691
|
-
dates.push(date$1);
|
2692
|
-
let nextDate = date$1.add({
|
2693
|
-
days: 1
|
2694
|
-
});
|
2695
|
-
if ((date.isSameDay)(date$1, nextDate))
|
2696
|
-
break;
|
2697
|
-
date$1 = nextDate;
|
2698
|
-
}
|
2699
|
-
while (dates.length < 7)
|
2700
|
-
dates.push(null);
|
2701
|
-
return dates;
|
2702
|
-
}
|
2703
|
-
};
|
2704
|
-
}
|
2705
|
-
function $131cf43a05231e1e$var$unitDuration(duration) {
|
2706
|
-
let unit = {
|
2707
|
-
...duration
|
2708
|
-
};
|
2709
|
-
for (let key in duration)
|
2710
|
-
unit[key] = 1;
|
2711
|
-
return unit;
|
2712
|
-
}
|
2713
|
-
function $9a36b6ba2fb1a7c5$export$9a987164d97ecc90(props) {
|
2714
|
-
let { value: valueProp, defaultValue, onChange, createCalendar: createCalendar4, locale, visibleDuration = {
|
2715
|
-
months: 1
|
2716
|
-
}, minValue, maxValue, ...calendarProps } = props;
|
2717
|
-
let [value, setValue] = ($458b0a5536c1a7cf$export$40bfa8c7b0832715)(valueProp, defaultValue || null, onChange);
|
2718
|
-
let [anchorDate, setAnchorDateState] = (React69.useState)(null);
|
2719
|
-
let alignment = "center";
|
2720
|
-
if (value && value.start && value.end) {
|
2721
|
-
let start = ($f62d864046160412$export$f4a51ff076cc9a09)((date.toCalendarDate)(value.start), visibleDuration, locale, minValue, maxValue);
|
2722
|
-
let end = start.add(visibleDuration).subtract({
|
2723
|
-
days: 1
|
2724
|
-
});
|
2725
|
-
if (value.end.compare(end) > 0)
|
2726
|
-
alignment = "start";
|
2727
|
-
}
|
2728
|
-
let availableRangeRef = (React69.useRef)(null);
|
2729
|
-
let [availableRange, setAvailableRange] = (React69.useState)(null);
|
2730
|
-
let min = (React69.useMemo)(() => {
|
2731
|
-
return (date.maxDate)(minValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.start);
|
2732
|
-
}, [
|
2733
|
-
minValue,
|
2734
|
-
availableRange
|
2735
|
-
]);
|
2736
|
-
let max = (React69.useMemo)(() => {
|
2737
|
-
return (date.minDate)(maxValue, availableRange === null || availableRange === void 0 ? void 0 : availableRange.end);
|
2738
|
-
}, [
|
2739
|
-
maxValue,
|
2740
|
-
availableRange
|
2741
|
-
]);
|
2742
|
-
let calendar = ($131cf43a05231e1e$export$6d095e787d2b5e1f)({
|
2743
|
-
...calendarProps,
|
2744
|
-
value: value && value.start,
|
2745
|
-
createCalendar: createCalendar4,
|
2746
|
-
locale,
|
2747
|
-
visibleDuration,
|
2748
|
-
minValue: min,
|
2749
|
-
maxValue: max,
|
2750
|
-
selectionAlignment: alignment
|
2751
|
-
});
|
2752
|
-
let updateAvailableRange = (date) => {
|
2753
|
-
if (date && props.isDateUnavailable && !props.allowsNonContiguousRanges) {
|
2754
|
-
availableRangeRef.current = {
|
2755
|
-
start: $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, -1),
|
2756
|
-
end: $9a36b6ba2fb1a7c5$var$nextUnavailableDate(date, calendar, 1)
|
2757
|
-
};
|
2758
|
-
setAvailableRange(availableRangeRef.current);
|
2759
|
-
} else {
|
2760
|
-
availableRangeRef.current = null;
|
2761
|
-
setAvailableRange(null);
|
2762
|
-
}
|
2763
|
-
};
|
2764
|
-
let [lastVisibleRange, setLastVisibleRange] = (React69.useState)(calendar.visibleRange);
|
2765
|
-
if (!(date.isEqualDay)(calendar.visibleRange.start, lastVisibleRange.start) || !(date.isEqualDay)(calendar.visibleRange.end, lastVisibleRange.end)) {
|
2766
|
-
updateAvailableRange(anchorDate);
|
2767
|
-
setLastVisibleRange(calendar.visibleRange);
|
2768
|
-
}
|
2769
|
-
let setAnchorDate = (date) => {
|
2770
|
-
if (date) {
|
2771
|
-
setAnchorDateState(date);
|
2772
|
-
updateAvailableRange(date);
|
2773
|
-
} else {
|
2774
|
-
setAnchorDateState(null);
|
2775
|
-
updateAvailableRange(null);
|
2776
|
-
}
|
2777
|
-
};
|
2778
|
-
let highlightedRange = anchorDate ? $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, calendar.focusedDate) : value && $9a36b6ba2fb1a7c5$var$makeRange(value.start, value.end);
|
2779
|
-
let selectDate = (date) => {
|
2780
|
-
if (props.isReadOnly)
|
2781
|
-
return;
|
2782
|
-
date = ($f62d864046160412$export$4f5203c0d889109e)(date, min, max);
|
2783
|
-
date = ($f62d864046160412$export$a1d3911297b952d7)(date, calendar.visibleRange.start, props.isDateUnavailable);
|
2784
|
-
if (!date)
|
2785
|
-
return;
|
2786
|
-
if (!anchorDate)
|
2787
|
-
setAnchorDate(date);
|
2788
|
-
else {
|
2789
|
-
let range = $9a36b6ba2fb1a7c5$var$makeRange(anchorDate, date);
|
2790
|
-
setValue({
|
2791
|
-
start: $9a36b6ba2fb1a7c5$var$convertValue(range.start, value === null || value === void 0 ? void 0 : value.start),
|
2792
|
-
end: $9a36b6ba2fb1a7c5$var$convertValue(range.end, value === null || value === void 0 ? void 0 : value.end)
|
2793
|
-
});
|
2794
|
-
setAnchorDate(null);
|
2795
|
-
}
|
2796
|
-
};
|
2797
|
-
let [isDragging, setDragging] = (React69.useState)(false);
|
2798
|
-
let { isDateUnavailable } = props;
|
2799
|
-
let isInvalidSelection = (React69.useMemo)(() => {
|
2800
|
-
if (!value || anchorDate)
|
2801
|
-
return false;
|
2802
|
-
if (isDateUnavailable && (isDateUnavailable(value.start) || isDateUnavailable(value.end)))
|
2803
|
-
return true;
|
2804
|
-
return ($f62d864046160412$export$eac50920cf2fd59a)(value.start, minValue, maxValue) || ($f62d864046160412$export$eac50920cf2fd59a)(value.end, minValue, maxValue);
|
2805
|
-
}, [
|
2806
|
-
isDateUnavailable,
|
2807
|
-
value,
|
2808
|
-
anchorDate,
|
2809
|
-
minValue,
|
2810
|
-
maxValue
|
2811
|
-
]);
|
2812
|
-
let validationState = props.validationState || (isInvalidSelection ? "invalid" : null);
|
2813
|
-
return {
|
2814
|
-
...calendar,
|
2815
|
-
value,
|
2816
|
-
setValue,
|
2817
|
-
anchorDate,
|
2818
|
-
setAnchorDate,
|
2819
|
-
highlightedRange,
|
2820
|
-
validationState,
|
2821
|
-
selectFocusedDate() {
|
2822
|
-
selectDate(calendar.focusedDate);
|
2823
|
-
},
|
2824
|
-
selectDate,
|
2825
|
-
highlightDate(date) {
|
2826
|
-
if (anchorDate)
|
2827
|
-
calendar.setFocusedDate(date);
|
2828
|
-
},
|
2829
|
-
isSelected(date) {
|
2830
|
-
return highlightedRange && date.compare(highlightedRange.start) >= 0 && date.compare(highlightedRange.end) <= 0 && !calendar.isCellDisabled(date) && !calendar.isCellUnavailable(date);
|
2831
|
-
},
|
2832
|
-
isInvalid(date) {
|
2833
|
-
var _availableRangeRef_current, _availableRangeRef_current1;
|
2834
|
-
return calendar.isInvalid(date) || ($f62d864046160412$export$eac50920cf2fd59a)(date, (_availableRangeRef_current = availableRangeRef.current) === null || _availableRangeRef_current === void 0 ? void 0 : _availableRangeRef_current.start, (_availableRangeRef_current1 = availableRangeRef.current) === null || _availableRangeRef_current1 === void 0 ? void 0 : _availableRangeRef_current1.end);
|
2835
|
-
},
|
2836
|
-
isDragging,
|
2837
|
-
setDragging
|
2838
|
-
};
|
2839
|
-
}
|
2840
|
-
function $9a36b6ba2fb1a7c5$var$makeRange(start, end) {
|
2841
|
-
if (!start || !end)
|
2842
|
-
return null;
|
2843
|
-
if (end.compare(start) < 0)
|
2844
|
-
[start, end] = [
|
2845
|
-
end,
|
2846
|
-
start
|
2847
|
-
];
|
2848
|
-
return {
|
2849
|
-
start: (date.toCalendarDate)(start),
|
2850
|
-
end: (date.toCalendarDate)(end)
|
2851
|
-
};
|
2852
|
-
}
|
2853
|
-
function $9a36b6ba2fb1a7c5$var$convertValue(newValue, oldValue) {
|
2854
|
-
newValue = (date.toCalendar)(newValue, (oldValue === null || oldValue === void 0 ? void 0 : oldValue.calendar) || new (date.GregorianCalendar)());
|
2855
|
-
if (oldValue && "hour" in oldValue)
|
2856
|
-
return oldValue.set(newValue);
|
2857
|
-
return newValue;
|
2858
|
-
}
|
2859
|
-
function $9a36b6ba2fb1a7c5$var$nextUnavailableDate(anchorDate, state2, dir) {
|
2860
|
-
let nextDate = anchorDate.add({
|
2861
|
-
days: dir
|
2862
|
-
});
|
2863
|
-
while ((dir < 0 ? nextDate.compare(state2.visibleRange.start) >= 0 : nextDate.compare(state2.visibleRange.end) <= 0) && !state2.isCellUnavailable(nextDate))
|
2864
|
-
nextDate = nextDate.add({
|
2865
|
-
days: dir
|
2866
|
-
});
|
2867
|
-
if (state2.isCellUnavailable(nextDate))
|
2868
|
-
return nextDate.add({
|
2869
|
-
days: -dir
|
2870
|
-
});
|
2871
|
-
return null;
|
2872
|
-
}
|
2873
|
-
var init_import5 = __esm({
|
2874
|
-
"../../node_modules/@react-stately/calendar/dist/import.mjs"() {
|
2875
|
-
init_import();
|
2876
|
-
}
|
2877
|
-
});
|
2878
1131
|
exports.Badge = void 0;
|
2879
1132
|
var init_Badge = __esm({
|
2880
1133
|
"src/typography/Badge.tsx"() {
|
@@ -2933,7 +1186,12 @@ var init_typography = __esm({
|
|
2933
1186
|
init_Text();
|
2934
1187
|
}
|
2935
1188
|
});
|
2936
|
-
function CalendarCell({
|
1189
|
+
function CalendarCell({
|
1190
|
+
state: state2,
|
1191
|
+
date: date$1,
|
1192
|
+
currentMonth,
|
1193
|
+
variant
|
1194
|
+
}) {
|
2937
1195
|
const ref = React69.useRef(null);
|
2938
1196
|
const {
|
2939
1197
|
cellProps,
|
@@ -3039,7 +1297,11 @@ var init_utils = __esm({
|
|
3039
1297
|
};
|
3040
1298
|
}
|
3041
1299
|
});
|
3042
|
-
function CalendarGrid({
|
1300
|
+
function CalendarGrid({
|
1301
|
+
state: state2,
|
1302
|
+
variant,
|
1303
|
+
offset = {}
|
1304
|
+
}) {
|
3043
1305
|
const { language } = useTranslation();
|
3044
1306
|
const locale = useCurrentLocale();
|
3045
1307
|
const startDate = state2.visibleRange.start.add(offset);
|
@@ -3233,10 +1495,14 @@ var init_CalendarHeader = __esm({
|
|
3233
1495
|
});
|
3234
1496
|
}
|
3235
1497
|
});
|
3236
|
-
function Calendar({
|
1498
|
+
function Calendar({
|
1499
|
+
showYearNavigation,
|
1500
|
+
variant,
|
1501
|
+
...props
|
1502
|
+
}) {
|
3237
1503
|
const { t: t2 } = useTranslation();
|
3238
1504
|
const locale = useCurrentLocale();
|
3239
|
-
const state2 =
|
1505
|
+
const state2 = reactStately.useCalendarState({
|
3240
1506
|
...props,
|
3241
1507
|
locale,
|
3242
1508
|
createCalendar: date.createCalendar
|
@@ -3249,11 +1515,10 @@ function Calendar({ showYearNavigation, variant, ...props }) {
|
|
3249
1515
|
var texts8;
|
3250
1516
|
var init_Calendar = __esm({
|
3251
1517
|
"src/datepicker/Calendar.tsx"() {
|
3252
|
-
|
1518
|
+
init_i18n();
|
3253
1519
|
init_CalendarGrid();
|
3254
1520
|
init_CalendarHeader();
|
3255
1521
|
init_utils();
|
3256
|
-
init_i18n();
|
3257
1522
|
texts8 = createTexts({
|
3258
1523
|
calendar: {
|
3259
1524
|
nb: "Kalender",
|
@@ -3357,7 +1622,6 @@ function createCalendar2(identifier) {
|
|
3357
1622
|
var DateField;
|
3358
1623
|
var init_DateField = __esm({
|
3359
1624
|
"src/datepicker/DateField.tsx"() {
|
3360
|
-
init_import4();
|
3361
1625
|
init_DateTimeSegment();
|
3362
1626
|
init_utils();
|
3363
1627
|
DateField = React69.forwardRef(
|
@@ -3365,7 +1629,7 @@ var init_DateField = __esm({
|
|
3365
1629
|
var _a6;
|
3366
1630
|
const locale = useCurrentLocale();
|
3367
1631
|
const styles3 = react.useMultiStyleConfig("Datepicker", {});
|
3368
|
-
const state2 =
|
1632
|
+
const state2 = reactStately.useDateFieldState({
|
3369
1633
|
...props,
|
3370
1634
|
locale,
|
3371
1635
|
createCalendar: createCalendar2
|
@@ -3433,7 +1697,6 @@ var init_StyledField = __esm({
|
|
3433
1697
|
exports.DatePicker = void 0;
|
3434
1698
|
var init_DatePicker = __esm({
|
3435
1699
|
"src/datepicker/DatePicker.tsx"() {
|
3436
|
-
init_import4();
|
3437
1700
|
init_src();
|
3438
1701
|
init_Calendar();
|
3439
1702
|
init_CalendarTriggerButton();
|
@@ -3451,7 +1714,7 @@ var init_DatePicker = __esm({
|
|
3451
1714
|
...props
|
3452
1715
|
}, externalRef) => {
|
3453
1716
|
const formControlProps = react.useFormControlContext();
|
3454
|
-
const state2 =
|
1717
|
+
const state2 = reactStately.useDatePickerState({
|
3455
1718
|
...props,
|
3456
1719
|
shouldCloseOnSelect: true,
|
3457
1720
|
errorMessage,
|
@@ -3539,7 +1802,7 @@ var init_DatePicker = __esm({
|
|
3539
1802
|
});
|
3540
1803
|
function RangeCalendar(props) {
|
3541
1804
|
const locale = useCurrentLocale();
|
3542
|
-
const state2 =
|
1805
|
+
const state2 = reactStately.useRangeCalendarState({
|
3543
1806
|
...props,
|
3544
1807
|
visibleDuration: { months: 2 },
|
3545
1808
|
locale,
|
@@ -3547,11 +1810,17 @@ function RangeCalendar(props) {
|
|
3547
1810
|
});
|
3548
1811
|
const ref = React69.useRef(null);
|
3549
1812
|
const { calendarProps, title } = reactAria.useRangeCalendar(props, state2, ref);
|
3550
|
-
return /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { ...calendarProps, ref }, /* @__PURE__ */ React69__namespace.default.createElement(CalendarHeader, { state: state2, title }), /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { display: "flex", gap: "8" }, /* @__PURE__ */ React69__namespace.default.createElement(CalendarGrid, { variant: props.variant, state: state2 }), /* @__PURE__ */ React69__namespace.default.createElement(
|
1813
|
+
return /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { ...calendarProps, ref }, /* @__PURE__ */ React69__namespace.default.createElement(CalendarHeader, { state: state2, title }), /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { display: "flex", gap: "8" }, /* @__PURE__ */ React69__namespace.default.createElement(CalendarGrid, { variant: props.variant, state: state2 }), /* @__PURE__ */ React69__namespace.default.createElement(
|
1814
|
+
CalendarGrid,
|
1815
|
+
{
|
1816
|
+
variant: props.variant,
|
1817
|
+
state: state2,
|
1818
|
+
offset: { months: 1 }
|
1819
|
+
}
|
1820
|
+
)));
|
3551
1821
|
}
|
3552
1822
|
var init_RangeCalendar = __esm({
|
3553
1823
|
"src/datepicker/RangeCalendar.tsx"() {
|
3554
|
-
init_import5();
|
3555
1824
|
init_CalendarGrid();
|
3556
1825
|
init_CalendarHeader();
|
3557
1826
|
init_utils();
|
@@ -3566,7 +1835,7 @@ function DateRangePicker({
|
|
3566
1835
|
...props
|
3567
1836
|
}) {
|
3568
1837
|
const formControlProps = react.useFormControlContext();
|
3569
|
-
const state2 =
|
1838
|
+
const state2 = reactStately.useDateRangePickerState({
|
3570
1839
|
...props,
|
3571
1840
|
shouldCloseOnSelect: true,
|
3572
1841
|
isRequired: props.isRequired ?? (formControlProps == null ? void 0 : formControlProps.isRequired),
|
@@ -3648,7 +1917,6 @@ function DateRangePicker({
|
|
3648
1917
|
}
|
3649
1918
|
var init_DateRangePicker = __esm({
|
3650
1919
|
"src/datepicker/DateRangePicker.tsx"() {
|
3651
|
-
init_import4();
|
3652
1920
|
init_CalendarTriggerButton();
|
3653
1921
|
init_DateField();
|
3654
1922
|
init_RangeCalendar();
|
@@ -5710,8 +3978,15 @@ var init_PhoneNumberInput = __esm({
|
|
5710
3978
|
init_src();
|
5711
3979
|
init_AttachedInputs();
|
5712
3980
|
exports.PhoneNumberInput = react.forwardRef(
|
5713
|
-
({
|
3981
|
+
({
|
3982
|
+
label: externalLabel,
|
3983
|
+
name,
|
3984
|
+
value: externalValue,
|
3985
|
+
onChange: externalOnChange,
|
3986
|
+
...boxProps
|
3987
|
+
}, ref) => {
|
5714
3988
|
const { t: t2 } = useTranslation();
|
3989
|
+
const label = externalLabel ?? t2(texts15.phoneNumber);
|
5715
3990
|
const [value, onChange] = react.useControllableState({
|
5716
3991
|
value: externalValue,
|
5717
3992
|
onChange: externalOnChange,
|
@@ -5753,7 +4028,7 @@ var init_PhoneNumberInput = __esm({
|
|
5753
4028
|
{
|
5754
4029
|
ref,
|
5755
4030
|
type: "tel",
|
5756
|
-
label
|
4031
|
+
label,
|
5757
4032
|
value: value.nationalNumber,
|
5758
4033
|
name: name ? `${name}-phone-number` : "phone-number",
|
5759
4034
|
onChange: (e) => {
|
@@ -6745,13 +5020,13 @@ var init_StepperContext = __esm({
|
|
6745
5020
|
activeStep,
|
6746
5021
|
children,
|
6747
5022
|
onClick,
|
6748
|
-
|
6749
|
-
|
5023
|
+
numberOfSteps,
|
5024
|
+
variant
|
6750
5025
|
}) => {
|
6751
5026
|
return /* @__PURE__ */ React69__namespace.default.createElement(
|
6752
5027
|
StepperContext.Provider,
|
6753
5028
|
{
|
6754
|
-
value: { activeStep, onClick,
|
5029
|
+
value: { activeStep, onClick, numberOfSteps, variant }
|
6755
5030
|
},
|
6756
5031
|
children
|
6757
5032
|
);
|
@@ -6779,9 +5054,9 @@ var init_Stepper = __esm({
|
|
6779
5054
|
steps,
|
6780
5055
|
activeStep: activeStepAsStringOrNumber,
|
6781
5056
|
title,
|
6782
|
-
|
5057
|
+
variant
|
6783
5058
|
}) => {
|
6784
|
-
const style = react.useMultiStyleConfig("Stepper", {
|
5059
|
+
const style = react.useMultiStyleConfig("Stepper", { variant });
|
6785
5060
|
const numberOfSteps = steps.length;
|
6786
5061
|
const activeStep = Number(activeStepAsStringOrNumber);
|
6787
5062
|
const { t: t2 } = useTranslation();
|
@@ -6790,7 +5065,7 @@ var init_Stepper = __esm({
|
|
6790
5065
|
{
|
6791
5066
|
onClick,
|
6792
5067
|
activeStep,
|
6793
|
-
|
5068
|
+
variant,
|
6794
5069
|
numberOfSteps
|
6795
5070
|
},
|
6796
5071
|
/* @__PURE__ */ React69__namespace.default.createElement(react.Box, { __css: style.container }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { __css: style.innerContainer }, /* @__PURE__ */ React69__namespace.default.createElement(react.HStack, null, activeStep > 1 && /* @__PURE__ */ React69__namespace.default.createElement(
|
@@ -6809,8 +5084,16 @@ var init_Stepper = __esm({
|
|
6809
5084
|
triggerElement: /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { as: "button", __css: style.stepCounter }, t2(texts22.stepsOf(activeStep, numberOfSteps))),
|
6810
5085
|
borderRadius: "xs"
|
6811
5086
|
},
|
6812
|
-
steps.map((step, index) => /* @__PURE__ */ React69__namespace.default.createElement(
|
6813
|
-
|
5087
|
+
steps.map((step, index) => /* @__PURE__ */ React69__namespace.default.createElement(
|
5088
|
+
exports.StepperStep,
|
5089
|
+
{
|
5090
|
+
key: step,
|
5091
|
+
stepNumber: index + 1,
|
5092
|
+
variant
|
5093
|
+
},
|
5094
|
+
step
|
5095
|
+
))
|
5096
|
+
)), title && /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { as: "h3", __css: style.title }, title)), /* @__PURE__ */ React69__namespace.default.createElement(react.Flex, { justifyContent: "center", display: ["none", "flex"] }, steps.map((step, index) => /* @__PURE__ */ React69__namespace.default.createElement(exports.StepperStep, { key: index, stepNumber: index + 1, variant }, step))))
|
6814
5097
|
));
|
6815
5098
|
};
|
6816
5099
|
texts22 = createTexts({
|
@@ -6829,33 +5112,62 @@ var init_Stepper = __esm({
|
|
6829
5112
|
});
|
6830
5113
|
}
|
6831
5114
|
});
|
6832
|
-
exports.StepperStep = void 0; var
|
5115
|
+
exports.StepperStep = void 0; var getButtonStylesForState, getState;
|
6833
5116
|
var init_StepperStep = __esm({
|
6834
5117
|
"src/stepper/StepperStep.tsx"() {
|
6835
5118
|
init_src();
|
6836
5119
|
init_StepperContext();
|
6837
|
-
exports.StepperStep = ({
|
6838
|
-
|
6839
|
-
|
5120
|
+
exports.StepperStep = ({
|
5121
|
+
children,
|
5122
|
+
stepNumber,
|
5123
|
+
variant
|
5124
|
+
}) => {
|
5125
|
+
const { activeStep, onClick } = useStepper();
|
5126
|
+
const state2 = getState(stepNumber, activeStep);
|
6840
5127
|
const style = react.useMultiStyleConfig("Stepper", {
|
6841
|
-
|
6842
|
-
|
5128
|
+
state: state2,
|
5129
|
+
variant
|
6843
5130
|
});
|
5131
|
+
const adjustedProps = getButtonStylesForState(state2);
|
6844
5132
|
return /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { __css: style.stepContainer }, stepNumber > 1 && /* @__PURE__ */ React69__namespace.default.createElement(sporIconReact.DropdownRightFill18Icon, { marginX: 5, display: ["none", "block"] }), /* @__PURE__ */ React69__namespace.default.createElement(
|
6845
|
-
|
5133
|
+
exports.Button,
|
6846
5134
|
{
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
type: "button",
|
6851
|
-
disabled: variant === "disabled" || variant === "active",
|
5135
|
+
size: "xs",
|
5136
|
+
variant: state2 === "active" ? "primary" : state2 === "completed" ? "additional" : "ghost",
|
5137
|
+
...adjustedProps,
|
6852
5138
|
onClick: () => onClick(stepNumber)
|
6853
5139
|
},
|
6854
|
-
|
6855
|
-
/* @__PURE__ */ React69__namespace.default.createElement(react.Box, { __css: style.stepTitle }, children)
|
5140
|
+
children
|
6856
5141
|
));
|
6857
5142
|
};
|
6858
|
-
|
5143
|
+
getButtonStylesForState = (state2) => {
|
5144
|
+
switch (state2) {
|
5145
|
+
case "active":
|
5146
|
+
return {
|
5147
|
+
_hover: {},
|
5148
|
+
boxShadow: "none",
|
5149
|
+
_focus: {},
|
5150
|
+
_active: {},
|
5151
|
+
cursor: "auto"
|
5152
|
+
};
|
5153
|
+
case "completed":
|
5154
|
+
return {
|
5155
|
+
boxShadow: "none"
|
5156
|
+
};
|
5157
|
+
case "disabled":
|
5158
|
+
return {
|
5159
|
+
_disabled: {},
|
5160
|
+
_hover: {},
|
5161
|
+
_focus: {},
|
5162
|
+
_active: {},
|
5163
|
+
color: "dimGrey",
|
5164
|
+
cursor: "auto"
|
5165
|
+
};
|
5166
|
+
default:
|
5167
|
+
return {};
|
5168
|
+
}
|
5169
|
+
};
|
5170
|
+
getState = (stepNumber, activeStep) => {
|
6859
5171
|
if (stepNumber < activeStep) {
|
6860
5172
|
return "completed";
|
6861
5173
|
}
|
@@ -12971,30 +11283,11 @@ var init_button2 = __esm({
|
|
12971
11283
|
}
|
12972
11284
|
},
|
12973
11285
|
variants: {
|
12974
|
-
control: (props) => ({
|
12975
|
-
backgroundColor: themeTools.mode("darkTeal", "mint")(props),
|
12976
|
-
color: themeTools.mode("white", "darkTeal")(props),
|
12977
|
-
...focusVisible({
|
12978
|
-
focus: {
|
12979
|
-
boxShadow: `inset 0 0 0 4px ${themeTools.mode(
|
12980
|
-
colors.darkTeal,
|
12981
|
-
colors.seaMist
|
12982
|
-
)(props)}, inset 0 0 0 6px currentColor`
|
12983
|
-
},
|
12984
|
-
notFocus: { boxShadow: "none" }
|
12985
|
-
}),
|
12986
|
-
_hover: {
|
12987
|
-
backgroundColor: themeTools.mode("night", "coralGreen")(props)
|
12988
|
-
},
|
12989
|
-
_active: {
|
12990
|
-
backgroundColor: themeTools.mode("pine", "white")(props)
|
12991
|
-
}
|
12992
|
-
}),
|
12993
11286
|
primary: (props) => ({
|
12994
11287
|
// FIXME: Update to use a global defined background color for darkMode whenever it is available.
|
12995
11288
|
// hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
|
12996
|
-
backgroundColor: "primaryGreen",
|
12997
|
-
color: "white",
|
11289
|
+
backgroundColor: themeTools.mode("primaryGreen", "coralGreen")(props),
|
11290
|
+
color: themeTools.mode("white", "darkTeal")(props),
|
12998
11291
|
...focusVisible({
|
12999
11292
|
focus: {
|
13000
11293
|
boxShadow: `inset 0 0 0 2px ${themeTools.mode(
|
@@ -13008,28 +11301,28 @@ var init_button2 = __esm({
|
|
13008
11301
|
notFocus: { boxShadow: "none" }
|
13009
11302
|
}),
|
13010
11303
|
_hover: {
|
13011
|
-
backgroundColor: "
|
11304
|
+
backgroundColor: themeTools.mode("darkTeal", "blueGreen")(props)
|
13012
11305
|
},
|
13013
11306
|
_active: {
|
13014
|
-
backgroundColor: "
|
11307
|
+
backgroundColor: themeTools.mode("greenHaze", "seaMist")(props)
|
13015
11308
|
}
|
13016
11309
|
}),
|
13017
11310
|
secondary: (props) => ({
|
13018
11311
|
// FIXME: Update to use global defined background color for darkMode whenever it is available instead of alpha
|
13019
|
-
backgroundColor: themeTools.mode("seaMist", "
|
11312
|
+
backgroundColor: themeTools.mode("seaMist", "primaryGreen")(props),
|
13020
11313
|
color: themeTools.mode("darkTeal", "white")(props),
|
13021
11314
|
// order is important here for now while we do not have global defined background color for darkMode
|
13022
11315
|
_hover: {
|
13023
|
-
backgroundColor: themeTools.mode("coralGreen", "
|
11316
|
+
backgroundColor: themeTools.mode("coralGreen", "greenHaze")(props)
|
13024
11317
|
},
|
13025
11318
|
...focusVisible({
|
13026
11319
|
focus: {
|
13027
11320
|
boxShadow: `inset 0 0 0 2px ${themeTools.mode(
|
13028
11321
|
colors.greenHaze,
|
13029
|
-
colors.
|
11322
|
+
colors.primaryGreen
|
13030
11323
|
)(props)}, inset 0 0 0 4px ${themeTools.mode(
|
13031
11324
|
colors.white,
|
13032
|
-
colors.
|
11325
|
+
colors.darkTeal
|
13033
11326
|
)(props)}`,
|
13034
11327
|
_hover: {
|
13035
11328
|
boxShadow: `inset 0 0 0 2px ${themeTools.mode(
|
@@ -13046,7 +11339,7 @@ var init_button2 = __esm({
|
|
13046
11339
|
}
|
13047
11340
|
}),
|
13048
11341
|
_active: {
|
13049
|
-
backgroundColor: themeTools.mode("mint", "
|
11342
|
+
backgroundColor: themeTools.mode("mint", "darkTeal")(props),
|
13050
11343
|
boxShadow: `inset 0 0 0 2px ${themeTools.mode(
|
13051
11344
|
colors.greenHaze,
|
13052
11345
|
colors.azure
|
@@ -13065,7 +11358,7 @@ var init_button2 = __esm({
|
|
13065
11358
|
}
|
13066
11359
|
}
|
13067
11360
|
}),
|
13068
|
-
|
11361
|
+
tertiary: (props) => ({
|
13069
11362
|
backgroundColor: "transparent",
|
13070
11363
|
color: themeTools.mode("darkGrey", "white")(props),
|
13071
11364
|
fontWeight: "normal",
|
@@ -13077,7 +11370,7 @@ var init_button2 = __esm({
|
|
13077
11370
|
focus: {
|
13078
11371
|
boxShadow: getBoxShadowString({
|
13079
11372
|
borderWidth: 2,
|
13080
|
-
borderColor: "
|
11373
|
+
borderColor: "azure"
|
13081
11374
|
})
|
13082
11375
|
},
|
13083
11376
|
notFocus: {
|
@@ -13114,13 +11407,13 @@ var init_button2 = __esm({
|
|
13114
11407
|
}
|
13115
11408
|
}),
|
13116
11409
|
_hover: {
|
13117
|
-
backgroundColor: themeTools.mode("seaMist", "
|
11410
|
+
backgroundColor: themeTools.mode("seaMist", "whiteAlpha.200")(props),
|
13118
11411
|
_disabled: {
|
13119
11412
|
color: "blackAlpha.300"
|
13120
11413
|
}
|
13121
11414
|
},
|
13122
11415
|
_active: {
|
13123
|
-
backgroundColor: themeTools.mode("mint", "whiteAlpha.
|
11416
|
+
backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props)
|
13124
11417
|
}
|
13125
11418
|
}),
|
13126
11419
|
floating: (props) => ({
|
@@ -13130,7 +11423,7 @@ var init_button2 = __esm({
|
|
13130
11423
|
baseShadow: "sm"
|
13131
11424
|
}),
|
13132
11425
|
_active: {
|
13133
|
-
backgroundColor: themeTools.mode("mint", "whiteAlpha.
|
11426
|
+
backgroundColor: themeTools.mode("mint", "whiteAlpha.400")(props)
|
13134
11427
|
},
|
13135
11428
|
_hover: {
|
13136
11429
|
backgroundColor: themeTools.mode("white", "whiteAlpha.200")(props),
|
@@ -13296,6 +11589,11 @@ var init_card2 = __esm({
|
|
13296
11589
|
backgroundColor: "seaMist"
|
13297
11590
|
};
|
13298
11591
|
}
|
11592
|
+
case "red": {
|
11593
|
+
return {
|
11594
|
+
backgroundColor: "pink"
|
11595
|
+
};
|
11596
|
+
}
|
13299
11597
|
default:
|
13300
11598
|
return {
|
13301
11599
|
backgroundColor: ((_a6 = colors[colorScheme]) == null ? void 0 : _a6[100]) ?? "platinum"
|
@@ -13722,7 +12020,9 @@ var init_close_button = __esm({
|
|
13722
12020
|
...focusVisible({
|
13723
12021
|
focus: {
|
13724
12022
|
outline: "none",
|
13725
|
-
boxShadow: getBoxShadowString({
|
12023
|
+
boxShadow: getBoxShadowString({
|
12024
|
+
borderColor: themeTools.mode("greenHaze", "azure")(props)
|
12025
|
+
}),
|
13726
12026
|
outlineOffset: "2px"
|
13727
12027
|
},
|
13728
12028
|
notFocus: {
|
@@ -14387,7 +12687,10 @@ var init_fab = __esm({
|
|
14387
12687
|
},
|
14388
12688
|
_hover: {
|
14389
12689
|
backgroundColor: themeTools.mode("white", "transparent")(props),
|
14390
|
-
boxShadow: themeTools.mode(
|
12690
|
+
boxShadow: themeTools.mode(
|
12691
|
+
`inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
|
12692
|
+
`inset 0 0 0 2px ${props.theme.colors.white}`
|
12693
|
+
)(props),
|
14391
12694
|
color: themeTools.mode("darkGrey", "white")(props)
|
14392
12695
|
},
|
14393
12696
|
...focusVisible({
|
@@ -14981,7 +13284,7 @@ var init_info_tag = __esm({
|
|
14981
13284
|
size: "md"
|
14982
13285
|
},
|
14983
13286
|
variants: {
|
14984
|
-
|
13287
|
+
walk: (props) => ({
|
14985
13288
|
iconContainer: {
|
14986
13289
|
backgroundColor: themeTools.mode("white", "transparent")(props),
|
14987
13290
|
boxShadow: themeTools.mode(
|
@@ -15040,7 +13343,9 @@ var init_input2 = __esm({
|
|
15040
13343
|
})
|
15041
13344
|
},
|
15042
13345
|
notFocus: {
|
15043
|
-
boxShadow: getBoxShadowString({
|
13346
|
+
boxShadow: getBoxShadowString({
|
13347
|
+
borderColor: themeTools.mode("darkGrey", "white")(props)
|
13348
|
+
})
|
15044
13349
|
}
|
15045
13350
|
}),
|
15046
13351
|
_disabled: {
|
@@ -15872,7 +14177,7 @@ var init_skeleton = __esm({
|
|
15872
14177
|
skeleton_default = config30;
|
15873
14178
|
}
|
15874
14179
|
});
|
15875
|
-
var parts13, helpers21, config31, stepper_default
|
14180
|
+
var parts13, helpers21, config31, stepper_default;
|
15876
14181
|
var init_stepper2 = __esm({
|
15877
14182
|
"src/theme/components/stepper.ts"() {
|
15878
14183
|
parts13 = themeTools.anatomy("stepper").parts(
|
@@ -15892,7 +14197,6 @@ var init_stepper2 = __esm({
|
|
15892
14197
|
config31 = helpers21.defineMultiStyleConfig({
|
15893
14198
|
baseStyle: (props) => ({
|
15894
14199
|
root: {
|
15895
|
-
backgroundColor: getRootBackgroundColor(props),
|
15896
14200
|
display: "flex",
|
15897
14201
|
alignItems: "center",
|
15898
14202
|
justifyContent: ["space-between", "center"],
|
@@ -15910,8 +14214,7 @@ var init_stepper2 = __esm({
|
|
15910
14214
|
overflow: "hidden",
|
15911
14215
|
display: ["flex", "none"],
|
15912
14216
|
alignItems: "center",
|
15913
|
-
justifyContent: "space-between"
|
15914
|
-
color: getColor5(props)
|
14217
|
+
justifyContent: "space-between"
|
15915
14218
|
},
|
15916
14219
|
backButton: {
|
15917
14220
|
borderRadius: "xs",
|
@@ -15928,170 +14231,32 @@ var init_stepper2 = __esm({
|
|
15928
14231
|
ml: 2,
|
15929
14232
|
textAlign: "right"
|
15930
14233
|
},
|
15931
|
-
stepCounter: {
|
15932
|
-
whiteSpace: "nowrap",
|
15933
|
-
textDecoration: "underline"
|
15934
|
-
},
|
15935
14234
|
stepContainer: {
|
15936
14235
|
display: "flex",
|
15937
14236
|
alignItems: "center"
|
15938
14237
|
},
|
15939
|
-
stepButton: {
|
15940
|
-
color: "inherit",
|
15941
|
-
display: "flex",
|
15942
|
-
alignItems: "center",
|
15943
|
-
padding: 1,
|
15944
|
-
borderRadius: "xs"
|
15945
|
-
},
|
15946
|
-
stepNumber: {
|
15947
|
-
borderRadius: "round",
|
15948
|
-
border: "sm",
|
15949
|
-
borderColor: "currentColor",
|
15950
|
-
width: 4,
|
15951
|
-
height: 4,
|
15952
|
-
mr: 1,
|
15953
|
-
display: "flex",
|
15954
|
-
alignItems: "center",
|
15955
|
-
justifyContent: "center",
|
15956
|
-
fontSize: ["mobile.xs", "desktop.xs"]
|
15957
|
-
},
|
15958
14238
|
stepTitle: {
|
15959
14239
|
textStyle: "sm",
|
15960
14240
|
whiteSpace: "nowrap"
|
15961
14241
|
}
|
15962
14242
|
}),
|
15963
14243
|
variants: {
|
15964
|
-
|
15965
|
-
|
15966
|
-
|
15967
|
-
},
|
15968
|
-
stepButton: {
|
15969
|
-
_hover: getHoverStyles(props),
|
15970
|
-
_focus: getFocusStyles(props),
|
15971
|
-
"&:focus:not(:focus-visible)": {
|
15972
|
-
boxShadow: "none"
|
15973
|
-
},
|
15974
|
-
_focusVisible: getFocusStyles(props),
|
15975
|
-
_active: getActiveStyles(props)
|
15976
|
-
}
|
15977
|
-
}),
|
15978
|
-
active: (props) => ({
|
15979
|
-
stepContainer: {
|
15980
|
-
color: getColor5(props)
|
15981
|
-
},
|
15982
|
-
stepButton: {
|
15983
|
-
pointerEvents: "none"
|
15984
|
-
},
|
15985
|
-
stepNumber: getStepNumberStyles(props),
|
15986
|
-
stepTitle: {
|
15987
|
-
fontWeight: "bold"
|
14244
|
+
base: (props) => ({
|
14245
|
+
root: {
|
14246
|
+
backgroundColor: "transparent"
|
15988
14247
|
}
|
15989
14248
|
}),
|
15990
|
-
|
15991
|
-
|
15992
|
-
|
15993
|
-
},
|
15994
|
-
stepButton: {
|
15995
|
-
pointerEvents: "none"
|
14249
|
+
accent: (props) => ({
|
14250
|
+
root: {
|
14251
|
+
backgroundColor: themeTools.mode("seaMist", "pine")(props)
|
15996
14252
|
}
|
15997
14253
|
})
|
15998
14254
|
},
|
15999
14255
|
defaultProps: {
|
16000
|
-
|
14256
|
+
variant: "base"
|
16001
14257
|
}
|
16002
14258
|
});
|
16003
14259
|
stepper_default = config31;
|
16004
|
-
getRootBackgroundColor = (props) => {
|
16005
|
-
switch (props.colorScheme) {
|
16006
|
-
case "light":
|
16007
|
-
return "white";
|
16008
|
-
case "dark":
|
16009
|
-
return "darkTeal";
|
16010
|
-
case "green":
|
16011
|
-
default:
|
16012
|
-
return "seaMist";
|
16013
|
-
}
|
16014
|
-
};
|
16015
|
-
getColor5 = (props) => {
|
16016
|
-
switch (props.colorScheme) {
|
16017
|
-
case "light":
|
16018
|
-
return themeTools.mode("darkGrey", "white")(props);
|
16019
|
-
case "dark":
|
16020
|
-
return "white";
|
16021
|
-
case "green":
|
16022
|
-
default:
|
16023
|
-
return themeTools.mode("darkTeal", "white")(props);
|
16024
|
-
}
|
16025
|
-
};
|
16026
|
-
getStepNumberStyles = (props) => {
|
16027
|
-
switch (props.colorScheme) {
|
16028
|
-
case "dark":
|
16029
|
-
return {
|
16030
|
-
backgroundColor: "white",
|
16031
|
-
color: "darkTeal"
|
16032
|
-
};
|
16033
|
-
case "light":
|
16034
|
-
case "green":
|
16035
|
-
default:
|
16036
|
-
return {
|
16037
|
-
backgroundColor: themeTools.mode("darkTeal", "white")(props),
|
16038
|
-
color: themeTools.mode("white", "darkTeal")(props)
|
16039
|
-
};
|
16040
|
-
}
|
16041
|
-
};
|
16042
|
-
getDisabledColor = (props) => {
|
16043
|
-
switch (props.colorScheme) {
|
16044
|
-
case "dark":
|
16045
|
-
return "whiteAlpha.400";
|
16046
|
-
case "green":
|
16047
|
-
return "dimGrey";
|
16048
|
-
case "light":
|
16049
|
-
default:
|
16050
|
-
return "osloGrey";
|
16051
|
-
}
|
16052
|
-
};
|
16053
|
-
getHoverStyles = (props) => {
|
16054
|
-
switch (props.colorScheme) {
|
16055
|
-
case "dark":
|
16056
|
-
return { backgroundColor: "pine" };
|
16057
|
-
case "green":
|
16058
|
-
return {
|
16059
|
-
backgroundColor: themeTools.mode("coralGreen", "primaryGreen")(props)
|
16060
|
-
};
|
16061
|
-
case "light":
|
16062
|
-
default:
|
16063
|
-
return {
|
16064
|
-
backgroundColor: themeTools.mode("seaMist", "primaryGreen")(props)
|
16065
|
-
};
|
16066
|
-
}
|
16067
|
-
};
|
16068
|
-
getFocusStyles = (props) => {
|
16069
|
-
switch (props.colorScheme) {
|
16070
|
-
case "dark":
|
16071
|
-
return {
|
16072
|
-
outline: "none",
|
16073
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.white}`
|
16074
|
-
};
|
16075
|
-
case "light":
|
16076
|
-
case "green":
|
16077
|
-
default:
|
16078
|
-
return {
|
16079
|
-
outline: "none",
|
16080
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`
|
16081
|
-
};
|
16082
|
-
}
|
16083
|
-
};
|
16084
|
-
getActiveStyles = (props) => {
|
16085
|
-
switch (props.colorScheme) {
|
16086
|
-
case "light":
|
16087
|
-
return { backgroundColor: "mint" };
|
16088
|
-
case "dark":
|
16089
|
-
return { backgroundColor: "celadon" };
|
16090
|
-
case "green":
|
16091
|
-
default:
|
16092
|
-
return { color: "azure", backgroundColor: "transparent" };
|
16093
|
-
}
|
16094
|
-
};
|
16095
14260
|
}
|
16096
14261
|
});
|
16097
14262
|
var $width2, $height3, $diff2, diffValue2, $translateX2, helpers22, config32, switch_default;
|
@@ -16722,7 +14887,10 @@ var init_tabs = __esm({
|
|
16722
14887
|
};
|
16723
14888
|
case "base":
|
16724
14889
|
return {
|
16725
|
-
boxShadow: themeTools.mode(
|
14890
|
+
boxShadow: themeTools.mode(
|
14891
|
+
`inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
|
14892
|
+
`inset 0 0 0 2px ${props.theme.colors.white}`
|
14893
|
+
)(props),
|
16726
14894
|
color: themeTools.mode("darkGrey", "white")(props)
|
16727
14895
|
};
|
16728
14896
|
case "accent":
|
@@ -16821,7 +14989,10 @@ var init_tabs = __esm({
|
|
16821
14989
|
return {
|
16822
14990
|
backgroundColor: themeTools.mode("white", "transparent")(props),
|
16823
14991
|
color: "darkGrey",
|
16824
|
-
boxShadow: themeTools.mode(
|
14992
|
+
boxShadow: themeTools.mode(
|
14993
|
+
`inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`,
|
14994
|
+
`inset 0 0 0 1px ${props.theme.colors.whiteAlpha["400"]}`
|
14995
|
+
)(props)
|
16825
14996
|
};
|
16826
14997
|
case "accent":
|
16827
14998
|
return {
|