@expcat/tigercat-react 1.3.4 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3SV6J7I5.mjs → chunk-2L7QEOFD.mjs} +34 -25
- package/dist/{chunk-FNJDBFKM.mjs → chunk-2LYV6NBJ.mjs} +6 -1
- package/dist/{chunk-EEWHWEYO.js → chunk-2RBHQBSG.js} +2 -2
- package/dist/{chunk-Y5RQN5BO.mjs → chunk-376X7SDZ.mjs} +2 -2
- package/dist/{chunk-UXUYCWQC.js → chunk-3EDASNTG.js} +5 -5
- package/dist/{chunk-NPTXXUXF.mjs → chunk-3RBRWBUG.mjs} +9 -7
- package/dist/{chunk-PUZDW7NR.js → chunk-4AMSYFYC.js} +134 -20
- package/dist/{chunk-IG75YSX3.mjs → chunk-4MONGWU5.mjs} +4 -6
- package/dist/{chunk-3CJFNG54.mjs → chunk-56CTXEJS.mjs} +1 -1
- package/dist/{chunk-TMON4MPO.js → chunk-5ALMTE35.js} +9 -7
- package/dist/{chunk-MSHCPJIJ.mjs → chunk-6BOSSZM3.mjs} +8 -9
- package/dist/{chunk-SIY6FDKJ.js → chunk-7CHTTM6D.js} +339 -314
- package/dist/{chunk-RF2BA2N6.js → chunk-7PXALKLM.js} +4 -4
- package/dist/{chunk-DLKUDB2R.js → chunk-AF2AEZKM.js} +15 -3
- package/dist/{chunk-FB34UWF7.mjs → chunk-AVLIUHOS.mjs} +101 -40
- package/dist/{chunk-TSJYAEFZ.js → chunk-B63GEB2Y.js} +358 -305
- package/dist/{chunk-6I6X255M.js → chunk-BA6TJQZL.js} +12 -12
- package/dist/{chunk-LMTUM3J3.js → chunk-BEM7XG2L.js} +2 -4
- package/dist/{chunk-MB6U72CI.js → chunk-BEZO5IE4.js} +2 -2
- package/dist/{chunk-5OHVTGHS.mjs → chunk-BN4ZKCAI.mjs} +368 -315
- package/dist/{chunk-UHFHOTNI.js → chunk-BRA3PO53.js} +6 -7
- package/dist/{chunk-M7HBWFQO.js → chunk-BROIZ266.js} +11 -1
- package/dist/{chunk-SDZOVRVR.mjs → chunk-CAQPYJFA.mjs} +350 -325
- package/dist/{chunk-BFAZZUD6.js → chunk-CC5GFX6F.js} +5 -22
- package/dist/{chunk-LQT6ZGME.mjs → chunk-CME2IFUT.mjs} +15 -3
- package/dist/{chunk-KQ5I7PRM.js → chunk-CNNEUJR2.js} +28 -14
- package/dist/{chunk-EF5ZTNHX.js → chunk-D5MQBUP2.js} +16 -4
- package/dist/{chunk-RQXY2MGX.mjs → chunk-D7UR526A.mjs} +231 -184
- package/dist/{chunk-CBYJXDW4.js → chunk-DBMC6FPU.js} +16 -4
- package/dist/{chunk-WQ4FOHOU.mjs → chunk-DEIVWO2D.mjs} +3 -5
- package/dist/{chunk-7QZ4XT2P.mjs → chunk-DVEK5SO6.mjs} +3 -8
- package/dist/{chunk-TC6JLEGZ.js → chunk-EJKOUI26.js} +24 -7
- package/dist/{chunk-4GITZKAH.mjs → chunk-EPJ6W4VI.mjs} +14 -2
- package/dist/{chunk-KYP7U6FK.js → chunk-FZHBVHQ6.js} +34 -25
- package/dist/{chunk-WVVXZKNI.js → chunk-GDPU5MYA.js} +3 -8
- package/dist/{chunk-2GQCFTD7.mjs → chunk-H4MPPCTB.mjs} +23 -4
- package/dist/{chunk-YOAYDEWW.mjs → chunk-HHMYERHY.mjs} +3 -20
- package/dist/{chunk-LRPPXU74.mjs → chunk-I7FEGKX2.mjs} +19 -5
- package/dist/{chunk-F6IXIH6B.mjs → chunk-IZGXDHPB.mjs} +24 -5
- package/dist/{chunk-GQFVVAEF.js → chunk-J6OZWT3P.js} +5 -5
- package/dist/{chunk-IGAMV6ML.mjs → chunk-KDXKF6B2.mjs} +1 -1
- package/dist/{chunk-A42OLED6.mjs → chunk-KED5S2WG.mjs} +13 -2
- package/dist/{chunk-BJQIYELW.mjs → chunk-KGMVRIYC.mjs} +5 -5
- package/dist/{chunk-6GYT3EZD.mjs → chunk-KXT2TP6A.mjs} +3 -4
- package/dist/{chunk-BBLVRLXT.js → chunk-KYNWNTGO.js} +230 -146
- package/dist/{chunk-M73NMNZX.js → chunk-L24PPXLV.js} +17 -5
- package/dist/chunk-L3WPA2RP.js +25 -0
- package/dist/{chunk-V4JIZN3E.mjs → chunk-L6KSO66F.mjs} +4 -12
- package/dist/{chunk-4LX5UGPQ.js → chunk-LJRCEB7F.js} +168 -121
- package/dist/{chunk-F7H4ALKN.js → chunk-LZG24TDB.js} +8 -9
- package/dist/{chunk-ZYJTHGQW.js → chunk-M3FVPPMM.js} +9 -13
- package/dist/{chunk-GN3TSQWW.mjs → chunk-M6YXUNOU.mjs} +2 -2
- package/dist/{chunk-I373B74W.js → chunk-MC26ORSN.js} +102 -41
- package/dist/{chunk-5HFHHFQS.mjs → chunk-MTIGGMHG.mjs} +17 -5
- package/dist/{chunk-DKT2EYVM.mjs → chunk-MV2JQ6XQ.mjs} +3 -6
- package/dist/{chunk-HR5GBE3P.js → chunk-NDGA3N6H.js} +19 -7
- package/dist/{chunk-PU7KEYLP.mjs → chunk-NEZ445D4.mjs} +9 -9
- package/dist/{chunk-4U5HSR2H.js → chunk-NVI2P7VH.js} +3 -4
- package/dist/{chunk-NVEIVIAW.mjs → chunk-OFRKYQOZ.mjs} +133 -19
- package/dist/{chunk-AW5M3EL4.js → chunk-OS6M3IZF.js} +62 -12
- package/dist/{chunk-3ZNZLGQO.mjs → chunk-OXQOKKTP.mjs} +6 -7
- package/dist/{chunk-NMEVQPOD.js → chunk-PHAJXRGE.js} +2 -4
- package/dist/{chunk-WG3YS2QV.js → chunk-PT5T5F4H.js} +13 -2
- package/dist/{chunk-WNLUUD5N.mjs → chunk-QIL24WZD.mjs} +8 -12
- package/dist/{chunk-ZFMMAYSX.js → chunk-QLATA4UB.js} +4 -6
- package/dist/{chunk-2TZ3SBMU.mjs → chunk-RVLV63SI.mjs} +16 -11
- package/dist/{chunk-3QPCQH62.mjs → chunk-RYNLPRUM.mjs} +1 -1
- package/dist/{chunk-6GIJ7NFV.mjs → chunk-SDZKL3IB.mjs} +3 -5
- package/dist/{chunk-G5USITWF.js → chunk-SH4BZYXO.js} +27 -8
- package/dist/{chunk-L5AMVEQL.mjs → chunk-SLEXEH7R.mjs} +60 -10
- package/dist/{chunk-JLRRXRZO.js → chunk-SQONS5PH.js} +4 -7
- package/dist/chunk-SQTOVSDU.mjs +692 -0
- package/dist/{chunk-ITRYKHQJ.js → chunk-TEYL5X56.js} +19 -14
- package/dist/{chunk-KGSDDVRC.mjs → chunk-TNTOSFGN.mjs} +4 -4
- package/dist/{chunk-CY5GRTAX.js → chunk-UAM3RQY4.js} +24 -5
- package/dist/{chunk-XRNKHQTL.js → chunk-UEAXYZSE.js} +3 -2
- package/dist/{chunk-7ISEWLA3.js → chunk-UKQMF3JV.js} +21 -6
- package/dist/{chunk-ITVLIR7T.mjs → chunk-ULWT6W6M.mjs} +13 -20
- package/dist/{chunk-M5GSLKUX.mjs → chunk-VAIWWELW.mjs} +15 -3
- package/dist/{chunk-4SO4LANY.js → chunk-VC26SAXB.js} +340 -274
- package/dist/{chunk-SKMZTW3K.js → chunk-WCTNQYXO.js} +16 -23
- package/dist/{chunk-KXNWY2Q7.mjs → chunk-WFWEMXO7.mjs} +241 -157
- package/dist/chunk-WHYHLUXG.mjs +25 -0
- package/dist/{chunk-ONTRGV5T.js → chunk-WZUADPYB.js} +6 -14
- package/dist/{chunk-N4PP3ENO.js → chunk-XTQUPDRI.js} +2 -2
- package/dist/{chunk-XATXFVKR.mjs → chunk-Y7K27DVV.mjs} +4 -3
- package/dist/{chunk-WI4N5DD3.mjs → chunk-YH57D4AV.mjs} +16 -4
- package/dist/{chunk-3MRP3XYI.js → chunk-YRVAF2ID.js} +7 -2
- package/dist/{chunk-5XE5VBDS.mjs → chunk-YSGM22AH.mjs} +11 -1
- package/dist/{chunk-6TR7JB6C.js → chunk-ZDNQGS4O.js} +4 -4
- package/dist/{chunk-CHBUNQIJ.mjs → chunk-ZQSMJS2Q.mjs} +23 -6
- package/dist/{chunk-QQFLRNI3.mjs → chunk-ZRZB3C5J.mjs} +18 -3
- package/dist/components/ActivityFeed.js +4 -3
- package/dist/components/ActivityFeed.mjs +3 -2
- package/dist/components/Cascader.d.mts +3 -1
- package/dist/components/Cascader.d.ts +3 -1
- package/dist/components/Cascader.js +3 -2
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ChatWindow.js +5 -5
- package/dist/components/ChatWindow.mjs +4 -4
- package/dist/components/Checkbox.js +4 -4
- package/dist/components/Checkbox.mjs +3 -3
- package/dist/components/CheckboxGroup.js +3 -3
- package/dist/components/CheckboxGroup.mjs +2 -2
- package/dist/components/CommentThread.js +4 -4
- package/dist/components/CommentThread.mjs +3 -3
- package/dist/components/CropUpload.js +4 -4
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataTableWithToolbar.d.mts +2 -2
- package/dist/components/DataTableWithToolbar.d.ts +2 -2
- package/dist/components/DataTableWithToolbar.js +11 -11
- package/dist/components/DataTableWithToolbar.mjs +10 -10
- package/dist/components/DatePicker.d.mts +1 -0
- package/dist/components/DatePicker.d.ts +1 -0
- package/dist/components/DatePicker.js +3 -2
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/Drawer.js +3 -3
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/FileManager.d.mts +2 -1
- package/dist/components/FileManager.d.ts +2 -1
- package/dist/components/FileManager.js +3 -2
- package/dist/components/FileManager.mjs +2 -1
- package/dist/components/Form.js +3 -2
- package/dist/components/Form.mjs +2 -1
- package/dist/components/FormItem.js +4 -3
- package/dist/components/FormItem.mjs +3 -2
- package/dist/components/FormWizard.js +4 -4
- package/dist/components/FormWizard.mjs +3 -3
- package/dist/components/Image.js +4 -4
- package/dist/components/Image.mjs +3 -3
- package/dist/components/ImageGroup.js +3 -3
- package/dist/components/ImageGroup.mjs +2 -2
- package/dist/components/ImagePreview.js +2 -2
- package/dist/components/ImagePreview.mjs +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/ImageViewer.d.ts +1 -1
- package/dist/components/ImageViewer.js +2 -2
- package/dist/components/ImageViewer.mjs +1 -1
- package/dist/components/InfiniteScroll.d.mts +2 -0
- package/dist/components/InfiniteScroll.d.ts +2 -0
- package/dist/components/InfiniteScroll.js +3 -2
- package/dist/components/InfiniteScroll.mjs +2 -1
- package/dist/components/Input.js +3 -2
- package/dist/components/Input.mjs +2 -1
- package/dist/components/InputNumber.js +3 -2
- package/dist/components/InputNumber.mjs +2 -1
- package/dist/components/List.d.mts +6 -2
- package/dist/components/List.d.ts +6 -2
- package/dist/components/List.js +3 -2
- package/dist/components/List.mjs +2 -1
- package/dist/components/Loading.js +3 -2
- package/dist/components/Loading.mjs +2 -1
- package/dist/components/MarkdownEditor.js +3 -3
- package/dist/components/MarkdownEditor.mjs +2 -2
- package/dist/components/Mentions.js +2 -2
- package/dist/components/Mentions.mjs +1 -1
- package/dist/components/Menu.d.mts +8 -80
- package/dist/components/Menu.d.ts +8 -80
- package/dist/components/Menu.js +2 -2
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuItem.d.mts +6 -2
- package/dist/components/MenuItem.d.ts +6 -2
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/MenuItem.mjs +1 -1
- package/dist/components/MenuItemGroup.d.mts +6 -2
- package/dist/components/MenuItemGroup.d.ts +6 -2
- package/dist/components/MenuItemGroup.js +2 -2
- package/dist/components/MenuItemGroup.mjs +1 -1
- package/dist/components/Message.js +2 -2
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Modal.js +3 -3
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/Notification.js +2 -2
- package/dist/components/Notification.mjs +1 -1
- package/dist/components/NotificationCenter.js +5 -4
- package/dist/components/NotificationCenter.mjs +4 -3
- package/dist/components/NumberKeyboard.js +3 -2
- package/dist/components/NumberKeyboard.mjs +2 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/Radio.mjs +3 -3
- package/dist/components/RadioGroup.js +3 -3
- package/dist/components/RadioGroup.mjs +2 -2
- package/dist/components/RichTextEditor.js +3 -3
- package/dist/components/RichTextEditor.mjs +2 -2
- package/dist/components/Select.d.mts +3 -1
- package/dist/components/Select.d.ts +3 -1
- package/dist/components/Select.js +3 -2
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Signature.d.mts +1 -0
- package/dist/components/Signature.d.ts +1 -0
- package/dist/components/Signature.js +3 -2
- package/dist/components/Signature.mjs +2 -1
- package/dist/components/Spotlight.js +4 -2
- package/dist/components/Spotlight.mjs +3 -1
- package/dist/components/Steps.js +2 -2
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +2 -2
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/SubMenu.d.mts +6 -2
- package/dist/components/SubMenu.d.ts +6 -2
- package/dist/components/SubMenu.js +2 -2
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.d.ts +2 -2
- package/dist/components/Table.js +9 -9
- package/dist/components/Table.mjs +8 -8
- package/dist/components/Textarea.js +3 -3
- package/dist/components/Textarea.mjs +2 -2
- package/dist/components/TimePicker.d.mts +1 -0
- package/dist/components/TimePicker.d.ts +1 -0
- package/dist/components/TimePicker.js +4 -2
- package/dist/components/TimePicker.mjs +3 -1
- package/dist/components/Tour.js +3 -2
- package/dist/components/Tour.mjs +2 -1
- package/dist/components/Transfer.d.mts +3 -1
- package/dist/components/Transfer.d.ts +3 -1
- package/dist/components/Transfer.js +3 -2
- package/dist/components/Transfer.mjs +2 -1
- package/dist/components/Tree.d.mts +3 -1
- package/dist/components/Tree.d.ts +3 -1
- package/dist/components/Tree.js +3 -2
- package/dist/components/Tree.mjs +2 -1
- package/dist/components/TreeSelect.d.mts +3 -1
- package/dist/components/TreeSelect.d.ts +3 -1
- package/dist/components/TreeSelect.js +3 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/components/Upload.js +3 -2
- package/dist/components/Upload.mjs +2 -1
- package/dist/components/VirtualTable.d.mts +3 -2
- package/dist/components/VirtualTable.d.ts +3 -2
- package/dist/components/VirtualTable.js +3 -2
- package/dist/components/VirtualTable.mjs +2 -1
- package/dist/index.d.mts +33 -7
- package/dist/index.d.ts +33 -7
- package/dist/index.js +54 -54
- package/dist/index.mjs +53 -53
- package/dist/{types-CHmCMNEM.d.mts → types-0oVwMXtR.d.mts} +1 -1
- package/dist/{types-CHmCMNEM.d.ts → types-0oVwMXtR.d.ts} +1 -1
- package/dist/types-DaC4a0Ny.d.mts +80 -0
- package/dist/types-DaC4a0Ny.d.ts +80 -0
- package/package.json +2 -2
- package/dist/chunk-UKGQ7256.js +0 -12
- package/dist/chunk-UQMPEMY7.mjs +0 -12
- package/dist/chunk-VNVGSPBI.mjs +0 -626
- package/dist/{chunk-OZD75CLT.js → chunk-ANBNSUSR.js} +3 -3
- package/dist/{chunk-I2AUOICV.mjs → chunk-M3MOSUZO.mjs} +3 -3
- package/dist/{chunk-UMZ3PMUJ.js → chunk-SXHCMZ6U.js} +2 -2
- package/dist/{chunk-BWDQZSAB.mjs → chunk-WTSG7QXK.mjs} +3 -3
package/dist/chunk-VNVGSPBI.mjs
DELETED
|
@@ -1,626 +0,0 @@
|
|
|
1
|
-
// src/components/TimePicker.tsx
|
|
2
|
-
import { useState, useMemo, useRef, useEffect, useCallback } from "react";
|
|
3
|
-
import {
|
|
4
|
-
classNames,
|
|
5
|
-
icon20ViewBox,
|
|
6
|
-
parseTime,
|
|
7
|
-
formatTime,
|
|
8
|
-
formatTimeDisplayWithLocale,
|
|
9
|
-
getTimePeriodLabels,
|
|
10
|
-
getTimePickerLabels,
|
|
11
|
-
getTimePickerOptionAriaLabel,
|
|
12
|
-
to12HourFormat,
|
|
13
|
-
to24HourFormat,
|
|
14
|
-
isTimeInRange,
|
|
15
|
-
generateHours,
|
|
16
|
-
generateMinutes,
|
|
17
|
-
generateSeconds,
|
|
18
|
-
getCurrentTime,
|
|
19
|
-
padTwo,
|
|
20
|
-
timePickerBaseClasses,
|
|
21
|
-
timePickerInputWrapperClasses,
|
|
22
|
-
getTimePickerInputClasses,
|
|
23
|
-
getTimePickerIconButtonClasses,
|
|
24
|
-
timePickerClearButtonClasses,
|
|
25
|
-
timePickerPanelClasses,
|
|
26
|
-
timePickerDesktopPanelContentClasses,
|
|
27
|
-
timePickerMobileWheelClasses,
|
|
28
|
-
timePickerMobileWheelSelectClasses,
|
|
29
|
-
timePickerRangeHeaderClasses,
|
|
30
|
-
getTimePickerRangeTabButtonClasses,
|
|
31
|
-
timePickerColumnClasses,
|
|
32
|
-
timePickerColumnHeaderClasses,
|
|
33
|
-
timePickerColumnListClasses,
|
|
34
|
-
getTimePickerItemClasses,
|
|
35
|
-
getTimePickerPeriodButtonClasses,
|
|
36
|
-
timePickerFooterClasses,
|
|
37
|
-
timePickerFooterButtonClasses,
|
|
38
|
-
ClockIconPath,
|
|
39
|
-
TimePickerCloseIconPath
|
|
40
|
-
} from "@expcat/tigercat-core";
|
|
41
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
42
|
-
var Icon = ({ path, className }) => /* @__PURE__ */ jsx(
|
|
43
|
-
"svg",
|
|
44
|
-
{
|
|
45
|
-
className,
|
|
46
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
-
viewBox: icon20ViewBox,
|
|
48
|
-
fill: "currentColor",
|
|
49
|
-
children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: path, clipRule: "evenodd" })
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
var TimePicker = (allProps) => {
|
|
53
|
-
const {
|
|
54
|
-
size = "md",
|
|
55
|
-
format = "24",
|
|
56
|
-
showSeconds = false,
|
|
57
|
-
hourStep = 1,
|
|
58
|
-
minuteStep = 1,
|
|
59
|
-
secondStep = 1,
|
|
60
|
-
disabled = false,
|
|
61
|
-
readonly = false,
|
|
62
|
-
required = false,
|
|
63
|
-
minTime,
|
|
64
|
-
maxTime,
|
|
65
|
-
clearable = true,
|
|
66
|
-
name,
|
|
67
|
-
id,
|
|
68
|
-
className,
|
|
69
|
-
onClear,
|
|
70
|
-
locale,
|
|
71
|
-
labels: labelsOverrides,
|
|
72
|
-
value,
|
|
73
|
-
defaultValue,
|
|
74
|
-
range,
|
|
75
|
-
...restProps
|
|
76
|
-
} = allProps;
|
|
77
|
-
const divProps = (({ onChange: _omitOnChange, ...rest }) => rest)(restProps);
|
|
78
|
-
const isRangeMode = range === true;
|
|
79
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
80
|
-
const [internalSingleValue, setInternalSingleValue] = useState(() => {
|
|
81
|
-
if (isRangeMode) return null;
|
|
82
|
-
const dv = defaultValue;
|
|
83
|
-
if (typeof dv === "string" || dv === null || dv === void 0) return dv ?? null;
|
|
84
|
-
return null;
|
|
85
|
-
});
|
|
86
|
-
const [internalRangeValue, setInternalRangeValue] = useState(() => {
|
|
87
|
-
const dv = defaultValue;
|
|
88
|
-
if (Array.isArray(dv)) return [dv[0] ?? null, dv[1] ?? null];
|
|
89
|
-
return [null, null];
|
|
90
|
-
});
|
|
91
|
-
const [activePart, setActivePart] = useState("start");
|
|
92
|
-
const panelRef = useRef(null);
|
|
93
|
-
const inputWrapperRef = useRef(null);
|
|
94
|
-
const inputRef = useRef(null);
|
|
95
|
-
const normalizeRangeValue = (input) => {
|
|
96
|
-
if (Array.isArray(input)) return [input[0] ?? null, input[1] ?? null];
|
|
97
|
-
return [null, null];
|
|
98
|
-
};
|
|
99
|
-
const isControlled = value !== void 0;
|
|
100
|
-
const currentSingleValue = (() => {
|
|
101
|
-
if (isRangeMode) return null;
|
|
102
|
-
const v = value;
|
|
103
|
-
if (isControlled && (typeof v === "string" || v === null)) return v;
|
|
104
|
-
return internalSingleValue;
|
|
105
|
-
})();
|
|
106
|
-
const currentRangeValue = (() => {
|
|
107
|
-
if (!isRangeMode) return [null, null];
|
|
108
|
-
if (isControlled) return normalizeRangeValue(value);
|
|
109
|
-
return internalRangeValue;
|
|
110
|
-
})();
|
|
111
|
-
const activeValue = isRangeMode ? currentRangeValue[activePart === "start" ? 0 : 1] : currentSingleValue;
|
|
112
|
-
const parsedTime = parseTime(activeValue);
|
|
113
|
-
const [selectedHours, setSelectedHours] = useState(parsedTime?.hours ?? 0);
|
|
114
|
-
const [selectedMinutes, setSelectedMinutes] = useState(parsedTime?.minutes ?? 0);
|
|
115
|
-
const [selectedSeconds, setSelectedSeconds] = useState(parsedTime?.seconds ?? 0);
|
|
116
|
-
const [selectedPeriod, setSelectedPeriod] = useState("AM");
|
|
117
|
-
const syncFromActiveValue = useCallback(() => {
|
|
118
|
-
const parsed = parseTime(activeValue);
|
|
119
|
-
if (!parsed) return;
|
|
120
|
-
setSelectedHours(parsed.hours);
|
|
121
|
-
setSelectedMinutes(parsed.minutes);
|
|
122
|
-
setSelectedSeconds(parsed.seconds);
|
|
123
|
-
if (format === "12") {
|
|
124
|
-
const { period } = to12HourFormat(parsed.hours);
|
|
125
|
-
setSelectedPeriod(period);
|
|
126
|
-
}
|
|
127
|
-
}, [activeValue, format]);
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
syncFromActiveValue();
|
|
130
|
-
}, [syncFromActiveValue]);
|
|
131
|
-
const labels = useMemo(
|
|
132
|
-
() => getTimePickerLabels(locale, labelsOverrides),
|
|
133
|
-
[locale, labelsOverrides]
|
|
134
|
-
);
|
|
135
|
-
const placeholder = allProps.placeholder ?? (isRangeMode ? labels.selectTimeRange : labels.selectTime);
|
|
136
|
-
const periodLabels = useMemo(() => getTimePeriodLabels(locale), [locale]);
|
|
137
|
-
const displayValue = (() => {
|
|
138
|
-
if (!isRangeMode) {
|
|
139
|
-
return parsedTime ? formatTimeDisplayWithLocale(
|
|
140
|
-
parsedTime.hours,
|
|
141
|
-
parsedTime.minutes,
|
|
142
|
-
parsedTime.seconds,
|
|
143
|
-
format,
|
|
144
|
-
showSeconds,
|
|
145
|
-
locale
|
|
146
|
-
) : "";
|
|
147
|
-
}
|
|
148
|
-
const toDisplay = (timeStr) => {
|
|
149
|
-
const parsed = parseTime(timeStr);
|
|
150
|
-
if (!parsed) return "";
|
|
151
|
-
return formatTimeDisplayWithLocale(
|
|
152
|
-
parsed.hours,
|
|
153
|
-
parsed.minutes,
|
|
154
|
-
parsed.seconds,
|
|
155
|
-
format,
|
|
156
|
-
showSeconds,
|
|
157
|
-
locale
|
|
158
|
-
);
|
|
159
|
-
};
|
|
160
|
-
const start = toDisplay(currentRangeValue[0]);
|
|
161
|
-
const end = toDisplay(currentRangeValue[1]);
|
|
162
|
-
if (!start && !end) return "";
|
|
163
|
-
return `${start} - ${end}`;
|
|
164
|
-
})();
|
|
165
|
-
const showClearButton = (() => {
|
|
166
|
-
if (!clearable || disabled || readonly) return false;
|
|
167
|
-
if (!isRangeMode) return currentSingleValue !== null;
|
|
168
|
-
return currentRangeValue[0] !== null || currentRangeValue[1] !== null;
|
|
169
|
-
})();
|
|
170
|
-
const hoursList = useMemo(() => generateHours(hourStep, format), [hourStep, format]);
|
|
171
|
-
const minutesList = useMemo(() => generateMinutes(minuteStep), [minuteStep]);
|
|
172
|
-
const secondsList = useMemo(() => generateSeconds(secondStep), [secondStep]);
|
|
173
|
-
const togglePanel = () => {
|
|
174
|
-
if (!disabled && !readonly) {
|
|
175
|
-
if (isOpen) {
|
|
176
|
-
closePanel();
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
setIsOpen(true);
|
|
180
|
-
syncFromActiveValue();
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const closePanel = () => {
|
|
184
|
-
setIsOpen(false);
|
|
185
|
-
inputRef.current?.focus();
|
|
186
|
-
};
|
|
187
|
-
const focusOptionInUnit = (unit, action) => {
|
|
188
|
-
const panel = panelRef.current;
|
|
189
|
-
if (!panel) return;
|
|
190
|
-
const nodes = Array.from(
|
|
191
|
-
panel.querySelectorAll(`button[data-tiger-timepicker-unit="${unit}"]`)
|
|
192
|
-
).filter((button) => !button.disabled);
|
|
193
|
-
if (nodes.length === 0) return;
|
|
194
|
-
const active = document.activeElement;
|
|
195
|
-
const activeIndex = active ? nodes.indexOf(active) : -1;
|
|
196
|
-
const selectedIndex = nodes.findIndex(
|
|
197
|
-
(button) => button.getAttribute("aria-selected") === "true"
|
|
198
|
-
);
|
|
199
|
-
const baseIndex = activeIndex >= 0 ? activeIndex : Math.max(0, selectedIndex);
|
|
200
|
-
let nextIndex = baseIndex;
|
|
201
|
-
if (action === "prev") nextIndex = Math.max(0, baseIndex - 1);
|
|
202
|
-
if (action === "next") nextIndex = Math.min(nodes.length - 1, baseIndex + 1);
|
|
203
|
-
if (action === "first") nextIndex = 0;
|
|
204
|
-
if (action === "last") nextIndex = nodes.length - 1;
|
|
205
|
-
nodes[nextIndex]?.focus();
|
|
206
|
-
};
|
|
207
|
-
const handlePanelKeyDown = (event) => {
|
|
208
|
-
if (event.key === "Escape") {
|
|
209
|
-
event.preventDefault();
|
|
210
|
-
closePanel();
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const active = document.activeElement;
|
|
214
|
-
const unit = active?.getAttribute("data-tiger-timepicker-unit");
|
|
215
|
-
if (!unit) return;
|
|
216
|
-
if (event.key === "ArrowUp") {
|
|
217
|
-
event.preventDefault();
|
|
218
|
-
focusOptionInUnit(unit, "prev");
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (event.key === "ArrowDown") {
|
|
222
|
-
event.preventDefault();
|
|
223
|
-
focusOptionInUnit(unit, "next");
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (event.key === "Home") {
|
|
227
|
-
event.preventDefault();
|
|
228
|
-
focusOptionInUnit(unit, "first");
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
if (event.key === "End") {
|
|
232
|
-
event.preventDefault();
|
|
233
|
-
focusOptionInUnit(unit, "last");
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
237
|
-
const el = document.activeElement;
|
|
238
|
-
if (el && el.tagName === "BUTTON" && !el.disabled) {
|
|
239
|
-
event.preventDefault();
|
|
240
|
-
el.click();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
const selectHour = (hour) => {
|
|
245
|
-
const hours24 = format === "12" ? to24HourFormat(hour, selectedPeriod) : hour;
|
|
246
|
-
setSelectedHours(hours24);
|
|
247
|
-
updateTime(hours24, selectedMinutes, selectedSeconds);
|
|
248
|
-
};
|
|
249
|
-
const selectMinute = (minute) => {
|
|
250
|
-
setSelectedMinutes(minute);
|
|
251
|
-
updateTime(selectedHours, minute, selectedSeconds);
|
|
252
|
-
};
|
|
253
|
-
const selectSecond = (second) => {
|
|
254
|
-
setSelectedSeconds(second);
|
|
255
|
-
updateTime(selectedHours, selectedMinutes, second);
|
|
256
|
-
};
|
|
257
|
-
const selectPeriod = (period) => {
|
|
258
|
-
setSelectedPeriod(period);
|
|
259
|
-
const { hours: hours12 } = to12HourFormat(selectedHours);
|
|
260
|
-
const hours24 = to24HourFormat(hours12, period);
|
|
261
|
-
setSelectedHours(hours24);
|
|
262
|
-
updateTime(hours24, selectedMinutes, selectedSeconds);
|
|
263
|
-
};
|
|
264
|
-
const updateTime = (hours, minutes, seconds) => {
|
|
265
|
-
if (!isTimeInRange(hours, minutes, minTime, maxTime)) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
let timeString = formatTime(hours, minutes, seconds, showSeconds);
|
|
269
|
-
if (allProps.range !== true) {
|
|
270
|
-
if (!isControlled) {
|
|
271
|
-
setInternalSingleValue(timeString);
|
|
272
|
-
}
|
|
273
|
-
allProps.onChange?.(timeString);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
const index = activePart === "start" ? 0 : 1;
|
|
277
|
-
const parsedStart = parseTime(currentRangeValue[0]);
|
|
278
|
-
const parsedEnd = parseTime(currentRangeValue[1]);
|
|
279
|
-
const candidateSeconds = hours * 3600 + minutes * 60 + seconds;
|
|
280
|
-
const startSeconds = parsedStart ? parsedStart.hours * 3600 + parsedStart.minutes * 60 + parsedStart.seconds : null;
|
|
281
|
-
const endSeconds = parsedEnd ? parsedEnd.hours * 3600 + parsedEnd.minutes * 60 + parsedEnd.seconds : null;
|
|
282
|
-
if (activePart === "end" && parsedStart && startSeconds !== null) {
|
|
283
|
-
if (candidateSeconds < startSeconds) {
|
|
284
|
-
timeString = formatTime(
|
|
285
|
-
parsedStart.hours,
|
|
286
|
-
parsedStart.minutes,
|
|
287
|
-
parsedStart.seconds,
|
|
288
|
-
showSeconds
|
|
289
|
-
);
|
|
290
|
-
setSelectedHours(parsedStart.hours);
|
|
291
|
-
setSelectedMinutes(parsedStart.minutes);
|
|
292
|
-
setSelectedSeconds(parsedStart.seconds);
|
|
293
|
-
if (format === "12") {
|
|
294
|
-
const { period } = to12HourFormat(parsedStart.hours);
|
|
295
|
-
setSelectedPeriod(period);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
const nextRange = [currentRangeValue[0], currentRangeValue[1]];
|
|
300
|
-
nextRange[index] = timeString;
|
|
301
|
-
if (activePart === "start" && endSeconds !== null && candidateSeconds > endSeconds) {
|
|
302
|
-
nextRange[1] = timeString;
|
|
303
|
-
}
|
|
304
|
-
if (!isControlled) {
|
|
305
|
-
setInternalRangeValue(nextRange);
|
|
306
|
-
}
|
|
307
|
-
allProps.onChange?.(nextRange);
|
|
308
|
-
if (activePart === "start" && nextRange[1] === null) {
|
|
309
|
-
setActivePart("end");
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
const clearTime = (event) => {
|
|
313
|
-
event.stopPropagation();
|
|
314
|
-
if (allProps.range !== true) {
|
|
315
|
-
if (!isControlled) {
|
|
316
|
-
setInternalSingleValue(null);
|
|
317
|
-
}
|
|
318
|
-
allProps.onChange?.(null);
|
|
319
|
-
onClear?.();
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
const cleared = [null, null];
|
|
323
|
-
if (!isControlled) {
|
|
324
|
-
setInternalRangeValue(cleared);
|
|
325
|
-
}
|
|
326
|
-
allProps.onChange?.(cleared);
|
|
327
|
-
onClear?.();
|
|
328
|
-
};
|
|
329
|
-
const setNow = () => {
|
|
330
|
-
const now = getCurrentTime(showSeconds);
|
|
331
|
-
const parsed = parseTime(now);
|
|
332
|
-
if (parsed) {
|
|
333
|
-
setSelectedHours(parsed.hours);
|
|
334
|
-
setSelectedMinutes(parsed.minutes);
|
|
335
|
-
setSelectedSeconds(parsed.seconds);
|
|
336
|
-
if (format === "12") {
|
|
337
|
-
const { period } = to12HourFormat(parsed.hours);
|
|
338
|
-
setSelectedPeriod(period);
|
|
339
|
-
}
|
|
340
|
-
updateTime(parsed.hours, parsed.minutes, parsed.seconds);
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
const isHourDisabled = (hour) => {
|
|
344
|
-
const hours24 = format === "12" ? to24HourFormat(hour, selectedPeriod) : hour;
|
|
345
|
-
return !isTimeInRange(hours24, selectedMinutes, minTime, maxTime);
|
|
346
|
-
};
|
|
347
|
-
const isMinuteDisabled = (minute) => {
|
|
348
|
-
return !isTimeInRange(selectedHours, minute, minTime, maxTime);
|
|
349
|
-
};
|
|
350
|
-
const handleInputClick = () => {
|
|
351
|
-
togglePanel();
|
|
352
|
-
};
|
|
353
|
-
useEffect(() => {
|
|
354
|
-
const handleClickOutside = (event) => {
|
|
355
|
-
if (panelRef.current && inputWrapperRef.current && !panelRef.current.contains(event.target) && !inputWrapperRef.current.contains(event.target)) {
|
|
356
|
-
closePanel();
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
if (isOpen) {
|
|
360
|
-
document.addEventListener("click", handleClickOutside);
|
|
361
|
-
return () => {
|
|
362
|
-
document.removeEventListener("click", handleClickOutside);
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
}, [isOpen]);
|
|
366
|
-
useEffect(() => {
|
|
367
|
-
if (!isOpen) return;
|
|
368
|
-
const panel = panelRef.current;
|
|
369
|
-
if (!panel) return;
|
|
370
|
-
const focusTimer = window.setTimeout(() => {
|
|
371
|
-
const selectedHour = panel.querySelector(
|
|
372
|
-
'button[data-tiger-timepicker-unit="hour"][aria-selected="true"]:not([disabled])'
|
|
373
|
-
);
|
|
374
|
-
if (selectedHour) {
|
|
375
|
-
selectedHour.focus();
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
const firstHour = panel.querySelector(
|
|
379
|
-
'button[data-tiger-timepicker-unit="hour"]:not([disabled])'
|
|
380
|
-
);
|
|
381
|
-
firstHour?.focus();
|
|
382
|
-
}, 0);
|
|
383
|
-
return () => window.clearTimeout(focusTimer);
|
|
384
|
-
}, [isOpen, activePart]);
|
|
385
|
-
const inputClasses = getTimePickerInputClasses(size, disabled || readonly);
|
|
386
|
-
const iconButtonClasses = getTimePickerIconButtonClasses(size);
|
|
387
|
-
return /* @__PURE__ */ jsxs("div", { className: classNames(timePickerBaseClasses, className), ...divProps, children: [
|
|
388
|
-
/* @__PURE__ */ jsxs("div", { ref: inputWrapperRef, className: timePickerInputWrapperClasses, children: [
|
|
389
|
-
/* @__PURE__ */ jsx(
|
|
390
|
-
"input",
|
|
391
|
-
{
|
|
392
|
-
ref: inputRef,
|
|
393
|
-
type: "text",
|
|
394
|
-
className: inputClasses,
|
|
395
|
-
value: displayValue,
|
|
396
|
-
placeholder,
|
|
397
|
-
disabled,
|
|
398
|
-
readOnly: true,
|
|
399
|
-
required,
|
|
400
|
-
name,
|
|
401
|
-
id,
|
|
402
|
-
onClick: handleInputClick,
|
|
403
|
-
"aria-label": placeholder || labels.selectTime
|
|
404
|
-
}
|
|
405
|
-
),
|
|
406
|
-
showClearButton && /* @__PURE__ */ jsx(
|
|
407
|
-
"button",
|
|
408
|
-
{
|
|
409
|
-
type: "button",
|
|
410
|
-
className: timePickerClearButtonClasses,
|
|
411
|
-
onClick: clearTime,
|
|
412
|
-
"aria-label": labels.clear,
|
|
413
|
-
children: /* @__PURE__ */ jsx(Icon, { path: TimePickerCloseIconPath, className: "w-4 h-4" })
|
|
414
|
-
}
|
|
415
|
-
),
|
|
416
|
-
/* @__PURE__ */ jsx(
|
|
417
|
-
"button",
|
|
418
|
-
{
|
|
419
|
-
type: "button",
|
|
420
|
-
className: iconButtonClasses,
|
|
421
|
-
disabled: disabled || readonly,
|
|
422
|
-
onClick: togglePanel,
|
|
423
|
-
"aria-label": labels.toggle,
|
|
424
|
-
children: /* @__PURE__ */ jsx(Icon, { path: ClockIconPath, className: "w-5 h-5" })
|
|
425
|
-
}
|
|
426
|
-
)
|
|
427
|
-
] }),
|
|
428
|
-
isOpen && /* @__PURE__ */ jsxs(
|
|
429
|
-
"div",
|
|
430
|
-
{
|
|
431
|
-
ref: panelRef,
|
|
432
|
-
className: timePickerPanelClasses,
|
|
433
|
-
role: "dialog",
|
|
434
|
-
"aria-label": labels.dialog,
|
|
435
|
-
onKeyDown: handlePanelKeyDown,
|
|
436
|
-
children: [
|
|
437
|
-
isRangeMode && /* @__PURE__ */ jsxs("div", { className: timePickerRangeHeaderClasses, children: [
|
|
438
|
-
/* @__PURE__ */ jsx(
|
|
439
|
-
"button",
|
|
440
|
-
{
|
|
441
|
-
type: "button",
|
|
442
|
-
className: getTimePickerRangeTabButtonClasses(activePart === "start"),
|
|
443
|
-
onClick: () => setActivePart("start"),
|
|
444
|
-
"aria-label": labels.start,
|
|
445
|
-
"aria-selected": activePart === "start",
|
|
446
|
-
children: labels.start
|
|
447
|
-
}
|
|
448
|
-
),
|
|
449
|
-
/* @__PURE__ */ jsx(
|
|
450
|
-
"button",
|
|
451
|
-
{
|
|
452
|
-
type: "button",
|
|
453
|
-
className: getTimePickerRangeTabButtonClasses(activePart === "end"),
|
|
454
|
-
onClick: () => setActivePart("end"),
|
|
455
|
-
"aria-label": labels.end,
|
|
456
|
-
"aria-selected": activePart === "end",
|
|
457
|
-
children: labels.end
|
|
458
|
-
}
|
|
459
|
-
)
|
|
460
|
-
] }),
|
|
461
|
-
/* @__PURE__ */ jsxs("div", { className: timePickerMobileWheelClasses, children: [
|
|
462
|
-
/* @__PURE__ */ jsx(
|
|
463
|
-
"select",
|
|
464
|
-
{
|
|
465
|
-
className: timePickerMobileWheelSelectClasses,
|
|
466
|
-
value: format === "12" ? to12HourFormat(selectedHours).hours : selectedHours,
|
|
467
|
-
"aria-label": labels.hour,
|
|
468
|
-
onChange: (event) => selectHour(Number(event.target.value)),
|
|
469
|
-
children: hoursList.map((hour) => /* @__PURE__ */ jsx("option", { value: hour, disabled: isHourDisabled(hour), children: padTwo(hour) }, hour))
|
|
470
|
-
}
|
|
471
|
-
),
|
|
472
|
-
/* @__PURE__ */ jsx(
|
|
473
|
-
"select",
|
|
474
|
-
{
|
|
475
|
-
className: timePickerMobileWheelSelectClasses,
|
|
476
|
-
value: selectedMinutes,
|
|
477
|
-
"aria-label": labels.minute,
|
|
478
|
-
onChange: (event) => selectMinute(Number(event.target.value)),
|
|
479
|
-
children: minutesList.map((minute) => /* @__PURE__ */ jsx("option", { value: minute, disabled: isMinuteDisabled(minute), children: padTwo(minute) }, minute))
|
|
480
|
-
}
|
|
481
|
-
),
|
|
482
|
-
showSeconds && /* @__PURE__ */ jsx(
|
|
483
|
-
"select",
|
|
484
|
-
{
|
|
485
|
-
className: timePickerMobileWheelSelectClasses,
|
|
486
|
-
value: selectedSeconds,
|
|
487
|
-
"aria-label": labels.second,
|
|
488
|
-
onChange: (event) => selectSecond(Number(event.target.value)),
|
|
489
|
-
children: secondsList.map((second) => /* @__PURE__ */ jsx("option", { value: second, children: padTwo(second) }, second))
|
|
490
|
-
}
|
|
491
|
-
),
|
|
492
|
-
format === "12" && /* @__PURE__ */ jsxs(
|
|
493
|
-
"select",
|
|
494
|
-
{
|
|
495
|
-
className: timePickerMobileWheelSelectClasses,
|
|
496
|
-
value: selectedPeriod,
|
|
497
|
-
"aria-label": "Period",
|
|
498
|
-
onChange: (event) => selectPeriod(event.target.value),
|
|
499
|
-
children: [
|
|
500
|
-
/* @__PURE__ */ jsx("option", { value: "AM", children: periodLabels.am }),
|
|
501
|
-
/* @__PURE__ */ jsx("option", { value: "PM", children: periodLabels.pm })
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
)
|
|
505
|
-
] }),
|
|
506
|
-
/* @__PURE__ */ jsxs("div", { className: timePickerDesktopPanelContentClasses, children: [
|
|
507
|
-
/* @__PURE__ */ jsxs("div", { className: timePickerColumnClasses, children: [
|
|
508
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnHeaderClasses, children: labels.hour }),
|
|
509
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnListClasses, children: hoursList.map((hour) => {
|
|
510
|
-
const hours24 = format === "12" ? to24HourFormat(hour, selectedPeriod) : hour;
|
|
511
|
-
const isSelected = selectedHours === hours24;
|
|
512
|
-
const isDisabled = isHourDisabled(hour);
|
|
513
|
-
return /* @__PURE__ */ jsx(
|
|
514
|
-
"button",
|
|
515
|
-
{
|
|
516
|
-
type: "button",
|
|
517
|
-
className: getTimePickerItemClasses(isSelected, isDisabled),
|
|
518
|
-
disabled: isDisabled,
|
|
519
|
-
onClick: () => selectHour(hour),
|
|
520
|
-
"data-tiger-timepicker-unit": "hour",
|
|
521
|
-
"aria-label": getTimePickerOptionAriaLabel(
|
|
522
|
-
hour,
|
|
523
|
-
"hour",
|
|
524
|
-
locale,
|
|
525
|
-
labelsOverrides
|
|
526
|
-
),
|
|
527
|
-
"aria-selected": isSelected,
|
|
528
|
-
children: padTwo(hour)
|
|
529
|
-
},
|
|
530
|
-
hour
|
|
531
|
-
);
|
|
532
|
-
}) })
|
|
533
|
-
] }),
|
|
534
|
-
/* @__PURE__ */ jsxs("div", { className: timePickerColumnClasses, children: [
|
|
535
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnHeaderClasses, children: labels.minute }),
|
|
536
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnListClasses, children: minutesList.map((minute) => {
|
|
537
|
-
const isSelected = selectedMinutes === minute;
|
|
538
|
-
const isDisabled = isMinuteDisabled(minute);
|
|
539
|
-
return /* @__PURE__ */ jsx(
|
|
540
|
-
"button",
|
|
541
|
-
{
|
|
542
|
-
type: "button",
|
|
543
|
-
className: getTimePickerItemClasses(isSelected, isDisabled),
|
|
544
|
-
disabled: isDisabled,
|
|
545
|
-
onClick: () => selectMinute(minute),
|
|
546
|
-
"data-tiger-timepicker-unit": "minute",
|
|
547
|
-
"aria-label": getTimePickerOptionAriaLabel(
|
|
548
|
-
minute,
|
|
549
|
-
"minute",
|
|
550
|
-
locale,
|
|
551
|
-
labelsOverrides
|
|
552
|
-
),
|
|
553
|
-
"aria-selected": isSelected,
|
|
554
|
-
children: padTwo(minute)
|
|
555
|
-
},
|
|
556
|
-
minute
|
|
557
|
-
);
|
|
558
|
-
}) })
|
|
559
|
-
] }),
|
|
560
|
-
showSeconds && /* @__PURE__ */ jsxs("div", { className: timePickerColumnClasses, children: [
|
|
561
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnHeaderClasses, children: labels.second }),
|
|
562
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnListClasses, children: secondsList.map((second) => {
|
|
563
|
-
const isSelected = selectedSeconds === second;
|
|
564
|
-
return /* @__PURE__ */ jsx(
|
|
565
|
-
"button",
|
|
566
|
-
{
|
|
567
|
-
type: "button",
|
|
568
|
-
className: getTimePickerItemClasses(isSelected, false),
|
|
569
|
-
onClick: () => selectSecond(second),
|
|
570
|
-
"data-tiger-timepicker-unit": "second",
|
|
571
|
-
"aria-label": getTimePickerOptionAriaLabel(
|
|
572
|
-
second,
|
|
573
|
-
"second",
|
|
574
|
-
locale,
|
|
575
|
-
labelsOverrides
|
|
576
|
-
),
|
|
577
|
-
"aria-selected": isSelected,
|
|
578
|
-
children: padTwo(second)
|
|
579
|
-
},
|
|
580
|
-
second
|
|
581
|
-
);
|
|
582
|
-
}) })
|
|
583
|
-
] }),
|
|
584
|
-
format === "12" && /* @__PURE__ */ jsxs("div", { className: timePickerColumnClasses, children: [
|
|
585
|
-
/* @__PURE__ */ jsx("div", { className: timePickerColumnHeaderClasses, children: " " }),
|
|
586
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
587
|
-
/* @__PURE__ */ jsx(
|
|
588
|
-
"button",
|
|
589
|
-
{
|
|
590
|
-
type: "button",
|
|
591
|
-
className: getTimePickerPeriodButtonClasses(selectedPeriod === "AM"),
|
|
592
|
-
onClick: () => selectPeriod("AM"),
|
|
593
|
-
"data-tiger-timepicker-unit": "period",
|
|
594
|
-
"aria-label": periodLabels.am,
|
|
595
|
-
"aria-selected": selectedPeriod === "AM",
|
|
596
|
-
children: periodLabels.am
|
|
597
|
-
}
|
|
598
|
-
),
|
|
599
|
-
/* @__PURE__ */ jsx(
|
|
600
|
-
"button",
|
|
601
|
-
{
|
|
602
|
-
type: "button",
|
|
603
|
-
className: getTimePickerPeriodButtonClasses(selectedPeriod === "PM"),
|
|
604
|
-
onClick: () => selectPeriod("PM"),
|
|
605
|
-
"data-tiger-timepicker-unit": "period",
|
|
606
|
-
"aria-label": periodLabels.pm,
|
|
607
|
-
"aria-selected": selectedPeriod === "PM",
|
|
608
|
-
children: periodLabels.pm
|
|
609
|
-
}
|
|
610
|
-
)
|
|
611
|
-
] })
|
|
612
|
-
] })
|
|
613
|
-
] }),
|
|
614
|
-
/* @__PURE__ */ jsxs("div", { className: timePickerFooterClasses, children: [
|
|
615
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: timePickerFooterButtonClasses, onClick: setNow, children: labels.now }),
|
|
616
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: timePickerFooterButtonClasses, onClick: closePanel, children: labels.ok })
|
|
617
|
-
] })
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
)
|
|
621
|
-
] });
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
export {
|
|
625
|
-
TimePicker
|
|
626
|
-
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkZLNBE4ISjs = require('./chunk-ZLNBE4IS.js');
|
|
7
4
|
|
|
8
5
|
|
|
@@ -11,6 +8,9 @@ var _chunkZLNBE4ISjs = require('./chunk-ZLNBE4IS.js');
|
|
|
11
8
|
|
|
12
9
|
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
13
10
|
|
|
11
|
+
|
|
12
|
+
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
13
|
+
|
|
14
14
|
// src/components/Modal.tsx
|
|
15
15
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
16
16
|
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTigerConfig
|
|
3
|
-
} from "./chunk-QAIBQHIO.mjs";
|
|
4
1
|
import {
|
|
5
2
|
Button
|
|
6
3
|
} from "./chunk-5TE7KLE5.mjs";
|
|
@@ -10,6 +7,9 @@ import {
|
|
|
10
7
|
useEscapeKey,
|
|
11
8
|
useFocusTrap
|
|
12
9
|
} from "./chunk-SEWNVIHH.mjs";
|
|
10
|
+
import {
|
|
11
|
+
useTigerConfig
|
|
12
|
+
} from "./chunk-QAIBQHIO.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/Modal.tsx
|
|
15
15
|
import React, { useEffect, useMemo, useCallback, useRef, useId } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
6
|
+
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
10
10
|
|
|
11
11
|
// src/components/Drawer.tsx
|
|
12
12
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTigerConfig
|
|
3
|
-
} from "./chunk-QAIBQHIO.mjs";
|
|
4
1
|
import {
|
|
5
2
|
renderBodyPortal,
|
|
6
3
|
useBodyScrollLock,
|
|
7
4
|
useEscapeKey,
|
|
8
5
|
useFocusTrap
|
|
9
6
|
} from "./chunk-SEWNVIHH.mjs";
|
|
7
|
+
import {
|
|
8
|
+
useTigerConfig
|
|
9
|
+
} from "./chunk-QAIBQHIO.mjs";
|
|
10
10
|
|
|
11
11
|
// src/components/Drawer.tsx
|
|
12
12
|
import React, { useCallback, useEffect, useId, useMemo, useRef } from "react";
|