@expcat/tigercat-react 0.0.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/LICENSE +21 -0
- package/dist/chunk-2DOPHSZP.js +32 -0
- package/dist/chunk-2TS6X5RA.js +73 -0
- package/dist/chunk-2Y327ZU4.js +493 -0
- package/dist/chunk-3GD3LOII.mjs +23 -0
- package/dist/chunk-3OF7XPIQ.js +90 -0
- package/dist/chunk-3WPKVV4N.js +140 -0
- package/dist/chunk-3XXXM4OB.mjs +203 -0
- package/dist/chunk-427CM2U6.mjs +76 -0
- package/dist/chunk-472D2S4R.mjs +23 -0
- package/dist/chunk-5FRENLDC.js +194 -0
- package/dist/chunk-5HUYCSA4.mjs +77 -0
- package/dist/chunk-5QKMQRCW.js +89 -0
- package/dist/chunk-5ZVSFIZD.js +50 -0
- package/dist/chunk-6575DOCV.mjs +117 -0
- package/dist/chunk-672SCJWZ.mjs +88 -0
- package/dist/chunk-6MGEGOYJ.js +108 -0
- package/dist/chunk-6PUSRC6S.js +68 -0
- package/dist/chunk-6YDIBMCM.mjs +33 -0
- package/dist/chunk-72ZRDBXN.js +25 -0
- package/dist/chunk-77D7VQMG.js +43 -0
- package/dist/chunk-7CAJK2ZK.mjs +54 -0
- package/dist/chunk-7JQ7LURS.mjs +25 -0
- package/dist/chunk-7KRBDT2Z.mjs +269 -0
- package/dist/chunk-7O2OQKVY.mjs +10 -0
- package/dist/chunk-7OLWGHUR.mjs +169 -0
- package/dist/chunk-7P6PHSFM.js +548 -0
- package/dist/chunk-ADOPAXPG.mjs +301 -0
- package/dist/chunk-AG6GVQ5O.js +271 -0
- package/dist/chunk-ALP3KYYY.mjs +47 -0
- package/dist/chunk-AQ6DHCP6.js +53 -0
- package/dist/chunk-AQQRWISY.js +184 -0
- package/dist/chunk-C52ZCGYG.mjs +313 -0
- package/dist/chunk-C5EFBJBR.js +540 -0
- package/dist/chunk-CES6LGQ7.mjs +546 -0
- package/dist/chunk-CKUSQR2H.mjs +41 -0
- package/dist/chunk-CR4QK2AB.mjs +88 -0
- package/dist/chunk-CTAMMQBC.mjs +297 -0
- package/dist/chunk-D3I2SY7X.js +301 -0
- package/dist/chunk-DCRVIDMY.mjs +41 -0
- package/dist/chunk-DIZNY6N4.mjs +71 -0
- package/dist/chunk-DZJUFU55.js +300 -0
- package/dist/chunk-EB6EDLJZ.mjs +50 -0
- package/dist/chunk-EI2GHMQS.js +37 -0
- package/dist/chunk-ENR3RIMM.js +205 -0
- package/dist/chunk-EQWQXURG.js +18 -0
- package/dist/chunk-EUHWE7MN.js +267 -0
- package/dist/chunk-FAKTU64M.js +67 -0
- package/dist/chunk-FQ6UHRAO.js +499 -0
- package/dist/chunk-G6FSHN2I.mjs +111 -0
- package/dist/chunk-GIYBVWR4.mjs +213 -0
- package/dist/chunk-HDDBBZQH.js +321 -0
- package/dist/chunk-HQLZL3XQ.mjs +48 -0
- package/dist/chunk-HQXZVTP4.mjs +199 -0
- package/dist/chunk-HUMGEP7S.mjs +17 -0
- package/dist/chunk-IFY46RWU.js +25 -0
- package/dist/chunk-IQINYCU6.js +99 -0
- package/dist/chunk-IWENGARY.mjs +32 -0
- package/dist/chunk-IY4LEJYF.js +78 -0
- package/dist/chunk-JW64IJP2.js +210 -0
- package/dist/chunk-K7ZMB2TH.mjs +696 -0
- package/dist/chunk-KAEHFMTQ.mjs +537 -0
- package/dist/chunk-KMQOLVWP.mjs +65 -0
- package/dist/chunk-KUCFT2OA.js +43 -0
- package/dist/chunk-LADCWARG.mjs +97 -0
- package/dist/chunk-LAZGEMA2.mjs +176 -0
- package/dist/chunk-LNKI6HQ3.js +152 -0
- package/dist/chunk-LXA2YBAO.js +38 -0
- package/dist/chunk-MKWXJZ3T.js +74 -0
- package/dist/chunk-MQXBU5YX.mjs +87 -0
- package/dist/chunk-NEULKOYJ.js +48 -0
- package/dist/chunk-NI2WNZRT.js +38 -0
- package/dist/chunk-NOOPXNR4.mjs +36 -0
- package/dist/chunk-NSGDRTSQ.mjs +138 -0
- package/dist/chunk-O3EUFIOS.mjs +142 -0
- package/dist/chunk-OCVQ3LOT.mjs +45 -0
- package/dist/chunk-OFCKGWTS.js +12 -0
- package/dist/chunk-OQTPXPAP.mjs +10 -0
- package/dist/chunk-OTRGVENC.js +305 -0
- package/dist/chunk-P273E6XE.js +219 -0
- package/dist/chunk-PAD2DX5M.mjs +331 -0
- package/dist/chunk-PUDU34R4.mjs +106 -0
- package/dist/chunk-Q3DPJHNM.js +407 -0
- package/dist/chunk-QEAC4MIG.mjs +295 -0
- package/dist/chunk-QFVE7GKD.js +109 -0
- package/dist/chunk-QL6OBKEN.js +84 -0
- package/dist/chunk-QL6UEG3U.js +27 -0
- package/dist/chunk-QN7NIX7D.mjs +82 -0
- package/dist/chunk-QORSSZX4.js +144 -0
- package/dist/chunk-R4JSBXGG.js +12 -0
- package/dist/chunk-R5BQHZWB.js +698 -0
- package/dist/chunk-R7MS42PL.js +90 -0
- package/dist/chunk-RTQNWZN4.mjs +405 -0
- package/dist/chunk-SIVJX7VU.mjs +16 -0
- package/dist/chunk-SJ5RFU2O.mjs +17 -0
- package/dist/chunk-T4TJJMLM.mjs +34 -0
- package/dist/chunk-TB2UHDOZ.js +19 -0
- package/dist/chunk-TBIEWDY5.js +175 -0
- package/dist/chunk-TJFS44SH.js +48 -0
- package/dist/chunk-TR246HQP.mjs +69 -0
- package/dist/chunk-TZ26HQAW.js +85 -0
- package/dist/chunk-U4ZVEPYD.js +71 -0
- package/dist/chunk-UFAXJVMD.js +120 -0
- package/dist/chunk-V2HVHLBY.mjs +83 -0
- package/dist/chunk-VD3IK5XT.mjs +35 -0
- package/dist/chunk-VEGBO77D.mjs +20 -0
- package/dist/chunk-VJJ76I7U.js +19 -0
- package/dist/chunk-VO4WDK4K.js +37 -0
- package/dist/chunk-VSF4DF7N.js +84 -0
- package/dist/chunk-VVO4V4IK.js +56 -0
- package/dist/chunk-W7HUFFPJ.mjs +263 -0
- package/dist/chunk-WDAMDVLU.mjs +106 -0
- package/dist/chunk-WEGU7O4J.mjs +66 -0
- package/dist/chunk-WK5HN4OH.js +113 -0
- package/dist/chunk-WSCSDSV7.mjs +145 -0
- package/dist/chunk-WSJO2PIE.mjs +72 -0
- package/dist/chunk-XDKXL2BP.mjs +188 -0
- package/dist/chunk-XS5JP2KO.mjs +491 -0
- package/dist/chunk-XZDJ5FRB.js +333 -0
- package/dist/chunk-YE2M2HNM.js +168 -0
- package/dist/chunk-YYGTJKP5.js +39 -0
- package/dist/chunk-YYKJ63LD.mjs +497 -0
- package/dist/chunk-Z4Z3I74Q.mjs +166 -0
- package/dist/chunk-ZO4XVOHU.mjs +45 -0
- package/dist/chunk-ZREFCRX3.js +52 -0
- package/dist/components/Alert.d.mts +24 -0
- package/dist/components/Alert.d.ts +24 -0
- package/dist/components/Alert.js +10 -0
- package/dist/components/Alert.mjs +1 -0
- package/dist/components/Avatar.d.mts +12 -0
- package/dist/components/Avatar.d.ts +12 -0
- package/dist/components/Avatar.js +10 -0
- package/dist/components/Avatar.mjs +1 -0
- package/dist/components/Badge.d.mts +12 -0
- package/dist/components/Badge.d.ts +12 -0
- package/dist/components/Badge.js +10 -0
- package/dist/components/Badge.mjs +1 -0
- package/dist/components/Breadcrumb.d.mts +13 -0
- package/dist/components/Breadcrumb.d.ts +13 -0
- package/dist/components/Breadcrumb.js +14 -0
- package/dist/components/Breadcrumb.mjs +1 -0
- package/dist/components/BreadcrumbItem.d.mts +21 -0
- package/dist/components/BreadcrumbItem.d.ts +21 -0
- package/dist/components/BreadcrumbItem.js +11 -0
- package/dist/components/BreadcrumbItem.mjs +2 -0
- package/dist/components/Button.d.mts +8 -0
- package/dist/components/Button.d.ts +8 -0
- package/dist/components/Button.js +10 -0
- package/dist/components/Button.mjs +1 -0
- package/dist/components/Card.d.mts +33 -0
- package/dist/components/Card.d.ts +33 -0
- package/dist/components/Card.js +10 -0
- package/dist/components/Card.mjs +1 -0
- package/dist/components/Checkbox.d.mts +48 -0
- package/dist/components/Checkbox.d.ts +48 -0
- package/dist/components/Checkbox.js +11 -0
- package/dist/components/Checkbox.mjs +2 -0
- package/dist/components/CheckboxGroup.d.mts +39 -0
- package/dist/components/CheckboxGroup.d.ts +39 -0
- package/dist/components/CheckboxGroup.js +14 -0
- package/dist/components/CheckboxGroup.mjs +1 -0
- package/dist/components/Col.d.mts +7 -0
- package/dist/components/Col.d.ts +7 -0
- package/dist/components/Col.js +11 -0
- package/dist/components/Col.mjs +2 -0
- package/dist/components/ConfigProvider.d.mts +14 -0
- package/dist/components/ConfigProvider.d.ts +14 -0
- package/dist/components/ConfigProvider.js +14 -0
- package/dist/components/ConfigProvider.mjs +1 -0
- package/dist/components/Container.d.mts +13 -0
- package/dist/components/Container.d.ts +13 -0
- package/dist/components/Container.js +10 -0
- package/dist/components/Container.mjs +1 -0
- package/dist/components/Content.d.mts +9 -0
- package/dist/components/Content.d.ts +9 -0
- package/dist/components/Content.js +10 -0
- package/dist/components/Content.mjs +1 -0
- package/dist/components/DatePicker.d.mts +24 -0
- package/dist/components/DatePicker.d.ts +24 -0
- package/dist/components/DatePicker.js +10 -0
- package/dist/components/DatePicker.mjs +1 -0
- package/dist/components/Descriptions.d.mts +53 -0
- package/dist/components/Descriptions.d.ts +53 -0
- package/dist/components/Descriptions.js +16 -0
- package/dist/components/Descriptions.mjs +1 -0
- package/dist/components/Divider.d.mts +12 -0
- package/dist/components/Divider.d.ts +12 -0
- package/dist/components/Divider.js +10 -0
- package/dist/components/Divider.mjs +1 -0
- package/dist/components/Drawer.d.mts +19 -0
- package/dist/components/Drawer.d.ts +19 -0
- package/dist/components/Drawer.js +11 -0
- package/dist/components/Drawer.mjs +2 -0
- package/dist/components/Dropdown.d.mts +22 -0
- package/dist/components/Dropdown.d.ts +22 -0
- package/dist/components/Dropdown.js +16 -0
- package/dist/components/Dropdown.mjs +3 -0
- package/dist/components/DropdownItem.d.mts +17 -0
- package/dist/components/DropdownItem.d.ts +17 -0
- package/dist/components/DropdownItem.js +13 -0
- package/dist/components/DropdownItem.mjs +4 -0
- package/dist/components/DropdownMenu.d.mts +13 -0
- package/dist/components/DropdownMenu.d.ts +13 -0
- package/dist/components/DropdownMenu.js +10 -0
- package/dist/components/DropdownMenu.mjs +1 -0
- package/dist/components/Footer.d.mts +9 -0
- package/dist/components/Footer.d.ts +9 -0
- package/dist/components/Footer.js +10 -0
- package/dist/components/Footer.mjs +1 -0
- package/dist/components/Form.d.mts +56 -0
- package/dist/components/Form.d.ts +56 -0
- package/dist/components/Form.js +14 -0
- package/dist/components/Form.mjs +1 -0
- package/dist/components/FormItem.d.mts +16 -0
- package/dist/components/FormItem.d.ts +16 -0
- package/dist/components/FormItem.js +11 -0
- package/dist/components/FormItem.mjs +2 -0
- package/dist/components/Header.d.mts +9 -0
- package/dist/components/Header.d.ts +9 -0
- package/dist/components/Header.js +10 -0
- package/dist/components/Header.mjs +1 -0
- package/dist/components/Icon.d.mts +9 -0
- package/dist/components/Icon.d.ts +9 -0
- package/dist/components/Icon.js +10 -0
- package/dist/components/Icon.mjs +1 -0
- package/dist/components/Input.d.mts +28 -0
- package/dist/components/Input.d.ts +28 -0
- package/dist/components/Input.js +10 -0
- package/dist/components/Input.mjs +1 -0
- package/dist/components/Layout.d.mts +9 -0
- package/dist/components/Layout.d.ts +9 -0
- package/dist/components/Layout.js +10 -0
- package/dist/components/Layout.mjs +1 -0
- package/dist/components/Link.d.mts +10 -0
- package/dist/components/Link.d.ts +10 -0
- package/dist/components/Link.js +10 -0
- package/dist/components/Link.mjs +1 -0
- package/dist/components/List.d.mts +94 -0
- package/dist/components/List.d.ts +94 -0
- package/dist/components/List.js +12 -0
- package/dist/components/List.mjs +3 -0
- package/dist/components/Loading.d.mts +8 -0
- package/dist/components/Loading.d.ts +8 -0
- package/dist/components/Loading.js +10 -0
- package/dist/components/Loading.mjs +1 -0
- package/dist/components/Menu.d.mts +35 -0
- package/dist/components/Menu.d.ts +35 -0
- package/dist/components/Menu.js +14 -0
- package/dist/components/Menu.mjs +1 -0
- package/dist/components/MenuItem.d.mts +20 -0
- package/dist/components/MenuItem.d.ts +20 -0
- package/dist/components/MenuItem.js +11 -0
- package/dist/components/MenuItem.mjs +2 -0
- package/dist/components/MenuItemGroup.d.mts +16 -0
- package/dist/components/MenuItemGroup.d.ts +16 -0
- package/dist/components/MenuItemGroup.js +12 -0
- package/dist/components/MenuItemGroup.mjs +3 -0
- package/dist/components/Message.d.mts +44 -0
- package/dist/components/Message.d.ts +44 -0
- package/dist/components/Message.js +20 -0
- package/dist/components/Message.mjs +1 -0
- package/dist/components/Modal.d.mts +41 -0
- package/dist/components/Modal.d.ts +41 -0
- package/dist/components/Modal.js +11 -0
- package/dist/components/Modal.mjs +2 -0
- package/dist/components/Notification.d.mts +40 -0
- package/dist/components/Notification.d.ts +40 -0
- package/dist/components/Notification.js +20 -0
- package/dist/components/Notification.mjs +1 -0
- package/dist/components/Pagination.d.mts +11 -0
- package/dist/components/Pagination.d.ts +11 -0
- package/dist/components/Pagination.js +16 -0
- package/dist/components/Pagination.mjs +1 -0
- package/dist/components/Popconfirm.d.mts +34 -0
- package/dist/components/Popconfirm.d.ts +34 -0
- package/dist/components/Popconfirm.js +10 -0
- package/dist/components/Popconfirm.mjs +1 -0
- package/dist/components/Popover.d.mts +14 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/Popover.js +10 -0
- package/dist/components/Popover.mjs +1 -0
- package/dist/components/Progress.d.mts +8 -0
- package/dist/components/Progress.d.ts +8 -0
- package/dist/components/Progress.js +10 -0
- package/dist/components/Progress.mjs +1 -0
- package/dist/components/Radio.d.mts +20 -0
- package/dist/components/Radio.d.ts +20 -0
- package/dist/components/Radio.js +11 -0
- package/dist/components/Radio.mjs +2 -0
- package/dist/components/RadioGroup.d.mts +28 -0
- package/dist/components/RadioGroup.d.ts +28 -0
- package/dist/components/RadioGroup.js +14 -0
- package/dist/components/RadioGroup.mjs +1 -0
- package/dist/components/Row.d.mts +11 -0
- package/dist/components/Row.d.ts +11 -0
- package/dist/components/Row.js +14 -0
- package/dist/components/Row.mjs +1 -0
- package/dist/components/Select.d.mts +23 -0
- package/dist/components/Select.d.ts +23 -0
- package/dist/components/Select.js +10 -0
- package/dist/components/Select.mjs +1 -0
- package/dist/components/Sidebar.d.mts +9 -0
- package/dist/components/Sidebar.d.ts +9 -0
- package/dist/components/Sidebar.js +10 -0
- package/dist/components/Sidebar.mjs +1 -0
- package/dist/components/Skeleton.d.mts +7 -0
- package/dist/components/Skeleton.d.ts +7 -0
- package/dist/components/Skeleton.js +10 -0
- package/dist/components/Skeleton.mjs +1 -0
- package/dist/components/Slider.d.mts +12 -0
- package/dist/components/Slider.d.ts +12 -0
- package/dist/components/Slider.js +10 -0
- package/dist/components/Slider.mjs +1 -0
- package/dist/components/Space.d.mts +11 -0
- package/dist/components/Space.d.ts +11 -0
- package/dist/components/Space.js +10 -0
- package/dist/components/Space.mjs +1 -0
- package/dist/components/Steps.d.mts +31 -0
- package/dist/components/Steps.d.ts +31 -0
- package/dist/components/Steps.js +14 -0
- package/dist/components/Steps.mjs +1 -0
- package/dist/components/StepsItem.d.mts +36 -0
- package/dist/components/StepsItem.d.ts +36 -0
- package/dist/components/StepsItem.js +10 -0
- package/dist/components/StepsItem.mjs +1 -0
- package/dist/components/SubMenu.d.mts +20 -0
- package/dist/components/SubMenu.d.ts +20 -0
- package/dist/components/SubMenu.js +13 -0
- package/dist/components/SubMenu.mjs +4 -0
- package/dist/components/Switch.d.mts +12 -0
- package/dist/components/Switch.d.ts +12 -0
- package/dist/components/Switch.js +10 -0
- package/dist/components/Switch.mjs +1 -0
- package/dist/components/TabPane.d.mts +42 -0
- package/dist/components/TabPane.d.ts +42 -0
- package/dist/components/TabPane.js +10 -0
- package/dist/components/TabPane.mjs +1 -0
- package/dist/components/Table.d.mts +46 -0
- package/dist/components/Table.d.ts +46 -0
- package/dist/components/Table.js +10 -0
- package/dist/components/Table.mjs +1 -0
- package/dist/components/Tabs.d.mts +43 -0
- package/dist/components/Tabs.d.ts +43 -0
- package/dist/components/Tabs.js +14 -0
- package/dist/components/Tabs.mjs +1 -0
- package/dist/components/Tag.d.mts +16 -0
- package/dist/components/Tag.d.ts +16 -0
- package/dist/components/Tag.js +10 -0
- package/dist/components/Tag.mjs +1 -0
- package/dist/components/Text.d.mts +9 -0
- package/dist/components/Text.d.ts +9 -0
- package/dist/components/Text.js +10 -0
- package/dist/components/Text.mjs +1 -0
- package/dist/components/Textarea.d.mts +13 -0
- package/dist/components/Textarea.d.ts +13 -0
- package/dist/components/Textarea.js +10 -0
- package/dist/components/Textarea.mjs +1 -0
- package/dist/components/TimePicker.d.mts +28 -0
- package/dist/components/TimePicker.d.ts +28 -0
- package/dist/components/TimePicker.js +10 -0
- package/dist/components/TimePicker.mjs +1 -0
- package/dist/components/Timeline.d.mts +47 -0
- package/dist/components/Timeline.d.ts +47 -0
- package/dist/components/Timeline.js +10 -0
- package/dist/components/Timeline.mjs +1 -0
- package/dist/components/Tooltip.d.mts +15 -0
- package/dist/components/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip.js +10 -0
- package/dist/components/Tooltip.mjs +1 -0
- package/dist/components/Tree.d.mts +154 -0
- package/dist/components/Tree.d.ts +154 -0
- package/dist/components/Tree.js +16 -0
- package/dist/components/Tree.mjs +1 -0
- package/dist/components/Upload.d.mts +16 -0
- package/dist/components/Upload.d.ts +16 -0
- package/dist/components/Upload.js +11 -0
- package/dist/components/Upload.mjs +2 -0
- package/dist/index.d.mts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +359 -0
- package/dist/index.mjs +67 -0
- package/package.json +60 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var tigercatCore = require('@expcat/tigercat-core');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// src/components/TimePicker.tsx
|
|
8
|
+
var Icon = ({ path, className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
className,
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
viewBox: tigercatCore.icon20ViewBox,
|
|
14
|
+
fill: "currentColor",
|
|
15
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: path, clipRule: "evenodd" })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
var TimePicker = (allProps) => {
|
|
19
|
+
const {
|
|
20
|
+
size = "md",
|
|
21
|
+
format = "24",
|
|
22
|
+
showSeconds = false,
|
|
23
|
+
hourStep = 1,
|
|
24
|
+
minuteStep = 1,
|
|
25
|
+
secondStep = 1,
|
|
26
|
+
disabled = false,
|
|
27
|
+
readonly = false,
|
|
28
|
+
required = false,
|
|
29
|
+
minTime,
|
|
30
|
+
maxTime,
|
|
31
|
+
clearable = true,
|
|
32
|
+
name,
|
|
33
|
+
id,
|
|
34
|
+
className,
|
|
35
|
+
onClear,
|
|
36
|
+
locale,
|
|
37
|
+
labels: labelsOverrides,
|
|
38
|
+
value,
|
|
39
|
+
defaultValue,
|
|
40
|
+
range,
|
|
41
|
+
...restProps
|
|
42
|
+
} = allProps;
|
|
43
|
+
const divProps = (({ onChange: _omitOnChange, ...rest }) => rest)(restProps);
|
|
44
|
+
const isRangeMode = range === true;
|
|
45
|
+
const [isOpen, setIsOpen] = react.useState(false);
|
|
46
|
+
const [internalSingleValue, setInternalSingleValue] = react.useState(() => {
|
|
47
|
+
if (isRangeMode) return null;
|
|
48
|
+
const dv = defaultValue;
|
|
49
|
+
if (typeof dv === "string" || dv === null || dv === void 0) return dv ?? null;
|
|
50
|
+
return null;
|
|
51
|
+
});
|
|
52
|
+
const [internalRangeValue, setInternalRangeValue] = react.useState(() => {
|
|
53
|
+
const dv = defaultValue;
|
|
54
|
+
if (Array.isArray(dv)) return [dv[0] ?? null, dv[1] ?? null];
|
|
55
|
+
return [null, null];
|
|
56
|
+
});
|
|
57
|
+
const [activePart, setActivePart] = react.useState("start");
|
|
58
|
+
const panelRef = react.useRef(null);
|
|
59
|
+
const inputWrapperRef = react.useRef(null);
|
|
60
|
+
const inputRef = react.useRef(null);
|
|
61
|
+
const normalizeRangeValue = (input) => {
|
|
62
|
+
if (Array.isArray(input)) return [input[0] ?? null, input[1] ?? null];
|
|
63
|
+
return [null, null];
|
|
64
|
+
};
|
|
65
|
+
const isControlled = value !== void 0;
|
|
66
|
+
const currentSingleValue = (() => {
|
|
67
|
+
if (isRangeMode) return null;
|
|
68
|
+
const v = value;
|
|
69
|
+
if (isControlled && (typeof v === "string" || v === null)) return v;
|
|
70
|
+
return internalSingleValue;
|
|
71
|
+
})();
|
|
72
|
+
const currentRangeValue = (() => {
|
|
73
|
+
if (!isRangeMode) return [null, null];
|
|
74
|
+
if (isControlled) return normalizeRangeValue(value);
|
|
75
|
+
return internalRangeValue;
|
|
76
|
+
})();
|
|
77
|
+
const activeValue = isRangeMode ? currentRangeValue[activePart === "start" ? 0 : 1] : currentSingleValue;
|
|
78
|
+
const parsedTime = tigercatCore.parseTime(activeValue);
|
|
79
|
+
const [selectedHours, setSelectedHours] = react.useState(parsedTime?.hours ?? 0);
|
|
80
|
+
const [selectedMinutes, setSelectedMinutes] = react.useState(parsedTime?.minutes ?? 0);
|
|
81
|
+
const [selectedSeconds, setSelectedSeconds] = react.useState(parsedTime?.seconds ?? 0);
|
|
82
|
+
const [selectedPeriod, setSelectedPeriod] = react.useState("AM");
|
|
83
|
+
react.useEffect(() => {
|
|
84
|
+
const parsed = tigercatCore.parseTime(activeValue);
|
|
85
|
+
if (parsed) {
|
|
86
|
+
setSelectedHours(parsed.hours);
|
|
87
|
+
setSelectedMinutes(parsed.minutes);
|
|
88
|
+
setSelectedSeconds(parsed.seconds);
|
|
89
|
+
if (format === "12") {
|
|
90
|
+
const { period } = tigercatCore.to12HourFormat(parsed.hours);
|
|
91
|
+
setSelectedPeriod(period);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, [activeValue, format, activePart, isRangeMode]);
|
|
95
|
+
const labels = tigercatCore.getTimePickerLabels(locale, labelsOverrides);
|
|
96
|
+
const placeholder = allProps.placeholder ?? (isRangeMode ? labels.selectTimeRange : labels.selectTime);
|
|
97
|
+
const periodLabels = tigercatCore.getTimePeriodLabels(locale);
|
|
98
|
+
const singleDisplayValue = parsedTime ? tigercatCore.formatTimeDisplayWithLocale(
|
|
99
|
+
parsedTime.hours,
|
|
100
|
+
parsedTime.minutes,
|
|
101
|
+
parsedTime.seconds,
|
|
102
|
+
format,
|
|
103
|
+
showSeconds,
|
|
104
|
+
locale
|
|
105
|
+
) : "";
|
|
106
|
+
const displayValue = (() => {
|
|
107
|
+
if (!isRangeMode) return singleDisplayValue;
|
|
108
|
+
const toDisplay = (timeStr) => {
|
|
109
|
+
const parsed = tigercatCore.parseTime(timeStr);
|
|
110
|
+
if (!parsed) return "";
|
|
111
|
+
return tigercatCore.formatTimeDisplayWithLocale(
|
|
112
|
+
parsed.hours,
|
|
113
|
+
parsed.minutes,
|
|
114
|
+
parsed.seconds,
|
|
115
|
+
format,
|
|
116
|
+
showSeconds,
|
|
117
|
+
locale
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
const start = toDisplay(currentRangeValue[0]);
|
|
121
|
+
const end = toDisplay(currentRangeValue[1]);
|
|
122
|
+
if (!start && !end) return "";
|
|
123
|
+
return `${start} - ${end}`;
|
|
124
|
+
})();
|
|
125
|
+
const showClearButton = (() => {
|
|
126
|
+
if (!clearable || disabled || readonly) return false;
|
|
127
|
+
if (!isRangeMode) return currentSingleValue !== null;
|
|
128
|
+
return currentRangeValue[0] !== null || currentRangeValue[1] !== null;
|
|
129
|
+
})();
|
|
130
|
+
const hoursList = tigercatCore.generateHours(hourStep, format);
|
|
131
|
+
const minutesList = tigercatCore.generateMinutes(minuteStep);
|
|
132
|
+
const secondsList = tigercatCore.generateSeconds(secondStep);
|
|
133
|
+
const togglePanel = () => {
|
|
134
|
+
if (!disabled && !readonly) {
|
|
135
|
+
if (isOpen) {
|
|
136
|
+
closePanel();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
setIsOpen(true);
|
|
140
|
+
if (parsedTime) {
|
|
141
|
+
setSelectedHours(parsedTime.hours);
|
|
142
|
+
setSelectedMinutes(parsedTime.minutes);
|
|
143
|
+
setSelectedSeconds(parsedTime.seconds);
|
|
144
|
+
if (format === "12") {
|
|
145
|
+
const { period } = tigercatCore.to12HourFormat(parsedTime.hours);
|
|
146
|
+
setSelectedPeriod(period);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const closePanel = () => {
|
|
152
|
+
setIsOpen(false);
|
|
153
|
+
inputRef.current?.focus();
|
|
154
|
+
};
|
|
155
|
+
const focusOptionInUnit = (unit, action) => {
|
|
156
|
+
const panel = panelRef.current;
|
|
157
|
+
if (!panel) return;
|
|
158
|
+
const nodes = Array.from(
|
|
159
|
+
panel.querySelectorAll(`button[data-tiger-timepicker-unit="${unit}"]`)
|
|
160
|
+
).filter((button) => !button.disabled);
|
|
161
|
+
if (nodes.length === 0) return;
|
|
162
|
+
const active = document.activeElement;
|
|
163
|
+
const activeIndex = active ? nodes.indexOf(active) : -1;
|
|
164
|
+
const selectedIndex = nodes.findIndex(
|
|
165
|
+
(button) => button.getAttribute("aria-selected") === "true"
|
|
166
|
+
);
|
|
167
|
+
const baseIndex = activeIndex >= 0 ? activeIndex : Math.max(0, selectedIndex);
|
|
168
|
+
let nextIndex = baseIndex;
|
|
169
|
+
if (action === "prev") nextIndex = Math.max(0, baseIndex - 1);
|
|
170
|
+
if (action === "next") nextIndex = Math.min(nodes.length - 1, baseIndex + 1);
|
|
171
|
+
if (action === "first") nextIndex = 0;
|
|
172
|
+
if (action === "last") nextIndex = nodes.length - 1;
|
|
173
|
+
nodes[nextIndex]?.focus();
|
|
174
|
+
};
|
|
175
|
+
const handlePanelKeyDown = (event) => {
|
|
176
|
+
if (event.key === "Escape") {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
closePanel();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const active = document.activeElement;
|
|
182
|
+
const unit = active?.getAttribute("data-tiger-timepicker-unit");
|
|
183
|
+
if (!unit) return;
|
|
184
|
+
if (event.key === "ArrowUp") {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
focusOptionInUnit(unit, "prev");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (event.key === "ArrowDown") {
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
focusOptionInUnit(unit, "next");
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (event.key === "Home") {
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
focusOptionInUnit(unit, "first");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (event.key === "End") {
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
focusOptionInUnit(unit, "last");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
205
|
+
const el = document.activeElement;
|
|
206
|
+
if (el && el.tagName === "BUTTON" && !el.disabled) {
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
el.click();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const selectHour = (hour) => {
|
|
213
|
+
const hours24 = format === "12" ? tigercatCore.to24HourFormat(hour, selectedPeriod) : hour;
|
|
214
|
+
setSelectedHours(hours24);
|
|
215
|
+
updateTime(hours24, selectedMinutes, selectedSeconds);
|
|
216
|
+
};
|
|
217
|
+
const selectMinute = (minute) => {
|
|
218
|
+
setSelectedMinutes(minute);
|
|
219
|
+
updateTime(selectedHours, minute, selectedSeconds);
|
|
220
|
+
};
|
|
221
|
+
const selectSecond = (second) => {
|
|
222
|
+
setSelectedSeconds(second);
|
|
223
|
+
updateTime(selectedHours, selectedMinutes, second);
|
|
224
|
+
};
|
|
225
|
+
const selectPeriod = (period) => {
|
|
226
|
+
setSelectedPeriod(period);
|
|
227
|
+
const { hours: hours12 } = tigercatCore.to12HourFormat(selectedHours);
|
|
228
|
+
const hours24 = tigercatCore.to24HourFormat(hours12, period);
|
|
229
|
+
setSelectedHours(hours24);
|
|
230
|
+
updateTime(hours24, selectedMinutes, selectedSeconds);
|
|
231
|
+
};
|
|
232
|
+
const updateTime = (hours, minutes, seconds) => {
|
|
233
|
+
if (!tigercatCore.isTimeInRange(hours, minutes, minTime, maxTime)) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
let timeString = tigercatCore.formatTime(hours, minutes, seconds, showSeconds);
|
|
237
|
+
if (allProps.range !== true) {
|
|
238
|
+
if (!isControlled) {
|
|
239
|
+
setInternalSingleValue(timeString);
|
|
240
|
+
}
|
|
241
|
+
allProps.onChange?.(timeString);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const index = activePart === "start" ? 0 : 1;
|
|
245
|
+
const parsedStart = tigercatCore.parseTime(currentRangeValue[0]);
|
|
246
|
+
const parsedEnd = tigercatCore.parseTime(currentRangeValue[1]);
|
|
247
|
+
const candidateSeconds = hours * 3600 + minutes * 60 + seconds;
|
|
248
|
+
const startSeconds = parsedStart ? parsedStart.hours * 3600 + parsedStart.minutes * 60 + parsedStart.seconds : null;
|
|
249
|
+
const endSeconds = parsedEnd ? parsedEnd.hours * 3600 + parsedEnd.minutes * 60 + parsedEnd.seconds : null;
|
|
250
|
+
if (activePart === "end" && parsedStart && startSeconds !== null) {
|
|
251
|
+
if (candidateSeconds < startSeconds) {
|
|
252
|
+
timeString = tigercatCore.formatTime(
|
|
253
|
+
parsedStart.hours,
|
|
254
|
+
parsedStart.minutes,
|
|
255
|
+
parsedStart.seconds,
|
|
256
|
+
showSeconds
|
|
257
|
+
);
|
|
258
|
+
setSelectedHours(parsedStart.hours);
|
|
259
|
+
setSelectedMinutes(parsedStart.minutes);
|
|
260
|
+
setSelectedSeconds(parsedStart.seconds);
|
|
261
|
+
if (format === "12") {
|
|
262
|
+
const { period } = tigercatCore.to12HourFormat(parsedStart.hours);
|
|
263
|
+
setSelectedPeriod(period);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const nextRange = [currentRangeValue[0], currentRangeValue[1]];
|
|
268
|
+
nextRange[index] = timeString;
|
|
269
|
+
if (activePart === "start" && endSeconds !== null && candidateSeconds > endSeconds) {
|
|
270
|
+
nextRange[1] = timeString;
|
|
271
|
+
}
|
|
272
|
+
if (!isControlled) {
|
|
273
|
+
setInternalRangeValue(nextRange);
|
|
274
|
+
}
|
|
275
|
+
allProps.onChange?.(nextRange);
|
|
276
|
+
if (activePart === "start" && nextRange[1] === null) {
|
|
277
|
+
setActivePart("end");
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const clearTime = (event) => {
|
|
281
|
+
event.stopPropagation();
|
|
282
|
+
if (allProps.range !== true) {
|
|
283
|
+
if (!isControlled) {
|
|
284
|
+
setInternalSingleValue(null);
|
|
285
|
+
}
|
|
286
|
+
allProps.onChange?.(null);
|
|
287
|
+
onClear?.();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const cleared = [null, null];
|
|
291
|
+
if (!isControlled) {
|
|
292
|
+
setInternalRangeValue(cleared);
|
|
293
|
+
}
|
|
294
|
+
allProps.onChange?.(cleared);
|
|
295
|
+
onClear?.();
|
|
296
|
+
};
|
|
297
|
+
const setNow = () => {
|
|
298
|
+
const now = tigercatCore.getCurrentTime(showSeconds);
|
|
299
|
+
const parsed = tigercatCore.parseTime(now);
|
|
300
|
+
if (parsed) {
|
|
301
|
+
setSelectedHours(parsed.hours);
|
|
302
|
+
setSelectedMinutes(parsed.minutes);
|
|
303
|
+
setSelectedSeconds(parsed.seconds);
|
|
304
|
+
if (format === "12") {
|
|
305
|
+
const { period } = tigercatCore.to12HourFormat(parsed.hours);
|
|
306
|
+
setSelectedPeriod(period);
|
|
307
|
+
}
|
|
308
|
+
updateTime(parsed.hours, parsed.minutes, parsed.seconds);
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const isHourDisabled = (hour) => {
|
|
312
|
+
const hours24 = format === "12" ? tigercatCore.to24HourFormat(hour, selectedPeriod) : hour;
|
|
313
|
+
return !tigercatCore.isTimeInRange(hours24, selectedMinutes, minTime, maxTime);
|
|
314
|
+
};
|
|
315
|
+
const isMinuteDisabled = (minute) => {
|
|
316
|
+
return !tigercatCore.isTimeInRange(selectedHours, minute, minTime, maxTime);
|
|
317
|
+
};
|
|
318
|
+
const handleInputClick = () => {
|
|
319
|
+
togglePanel();
|
|
320
|
+
};
|
|
321
|
+
react.useEffect(() => {
|
|
322
|
+
const handleClickOutside = (event) => {
|
|
323
|
+
if (panelRef.current && inputWrapperRef.current && !panelRef.current.contains(event.target) && !inputWrapperRef.current.contains(event.target)) {
|
|
324
|
+
closePanel();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
if (isOpen) {
|
|
328
|
+
document.addEventListener("click", handleClickOutside);
|
|
329
|
+
return () => {
|
|
330
|
+
document.removeEventListener("click", handleClickOutside);
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
}, [isOpen]);
|
|
334
|
+
react.useEffect(() => {
|
|
335
|
+
if (!isOpen) return;
|
|
336
|
+
const panel = panelRef.current;
|
|
337
|
+
if (!panel) return;
|
|
338
|
+
const focusTimer = window.setTimeout(() => {
|
|
339
|
+
const selectedHour = panel.querySelector(
|
|
340
|
+
'button[data-tiger-timepicker-unit="hour"][aria-selected="true"]:not([disabled])'
|
|
341
|
+
);
|
|
342
|
+
if (selectedHour) {
|
|
343
|
+
selectedHour.focus();
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
const firstHour = panel.querySelector(
|
|
347
|
+
'button[data-tiger-timepicker-unit="hour"]:not([disabled])'
|
|
348
|
+
);
|
|
349
|
+
firstHour?.focus();
|
|
350
|
+
}, 0);
|
|
351
|
+
return () => window.clearTimeout(focusTimer);
|
|
352
|
+
}, [isOpen, activePart]);
|
|
353
|
+
const inputClasses = tigercatCore.getTimePickerInputClasses(size, disabled || readonly);
|
|
354
|
+
const iconButtonClasses = tigercatCore.getTimePickerIconButtonClasses(size);
|
|
355
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.classNames(tigercatCore.timePickerBaseClasses, className), ...divProps, children: [
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: inputWrapperRef, className: tigercatCore.timePickerInputWrapperClasses, children: [
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
358
|
+
"input",
|
|
359
|
+
{
|
|
360
|
+
ref: inputRef,
|
|
361
|
+
type: "text",
|
|
362
|
+
className: inputClasses,
|
|
363
|
+
value: displayValue,
|
|
364
|
+
placeholder,
|
|
365
|
+
disabled,
|
|
366
|
+
readOnly: true,
|
|
367
|
+
required,
|
|
368
|
+
name,
|
|
369
|
+
id,
|
|
370
|
+
onClick: handleInputClick,
|
|
371
|
+
"aria-label": placeholder || labels.selectTime
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
showClearButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
375
|
+
"button",
|
|
376
|
+
{
|
|
377
|
+
type: "button",
|
|
378
|
+
className: tigercatCore.timePickerClearButtonClasses,
|
|
379
|
+
onClick: clearTime,
|
|
380
|
+
"aria-label": labels.clear,
|
|
381
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { path: tigercatCore.TimePickerCloseIconPath, className: "w-4 h-4" })
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
385
|
+
"button",
|
|
386
|
+
{
|
|
387
|
+
type: "button",
|
|
388
|
+
className: iconButtonClasses,
|
|
389
|
+
disabled: disabled || readonly,
|
|
390
|
+
onClick: togglePanel,
|
|
391
|
+
"aria-label": labels.toggle,
|
|
392
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { path: tigercatCore.ClockIconPath, className: "w-5 h-5" })
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
] }),
|
|
396
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
397
|
+
"div",
|
|
398
|
+
{
|
|
399
|
+
ref: panelRef,
|
|
400
|
+
className: tigercatCore.timePickerPanelClasses,
|
|
401
|
+
role: "dialog",
|
|
402
|
+
"aria-label": labels.dialog,
|
|
403
|
+
onKeyDown: handlePanelKeyDown,
|
|
404
|
+
children: [
|
|
405
|
+
isRangeMode && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerRangeHeaderClasses, children: [
|
|
406
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
407
|
+
"button",
|
|
408
|
+
{
|
|
409
|
+
type: "button",
|
|
410
|
+
className: tigercatCore.getTimePickerRangeTabButtonClasses(activePart === "start"),
|
|
411
|
+
onClick: () => setActivePart("start"),
|
|
412
|
+
"aria-label": labels.start,
|
|
413
|
+
"aria-selected": activePart === "start",
|
|
414
|
+
children: labels.start
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
418
|
+
"button",
|
|
419
|
+
{
|
|
420
|
+
type: "button",
|
|
421
|
+
className: tigercatCore.getTimePickerRangeTabButtonClasses(activePart === "end"),
|
|
422
|
+
onClick: () => setActivePart("end"),
|
|
423
|
+
"aria-label": labels.end,
|
|
424
|
+
"aria-selected": activePart === "end",
|
|
425
|
+
children: labels.end
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] }),
|
|
429
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerPanelContentClasses, children: [
|
|
430
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerColumnClasses, children: [
|
|
431
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnHeaderClasses, children: labels.hour }),
|
|
432
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnListClasses, children: hoursList.map((hour) => {
|
|
433
|
+
const displayHour = format === "12" ? hour : hour;
|
|
434
|
+
const hours24 = format === "12" ? tigercatCore.to24HourFormat(hour, selectedPeriod) : hour;
|
|
435
|
+
const isSelected = selectedHours === hours24;
|
|
436
|
+
const isDisabled = isHourDisabled(hour);
|
|
437
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
438
|
+
"button",
|
|
439
|
+
{
|
|
440
|
+
type: "button",
|
|
441
|
+
className: tigercatCore.getTimePickerItemClasses(isSelected, isDisabled),
|
|
442
|
+
disabled: isDisabled,
|
|
443
|
+
onClick: () => selectHour(hour),
|
|
444
|
+
"data-tiger-timepicker-unit": "hour",
|
|
445
|
+
"aria-label": tigercatCore.getTimePickerOptionAriaLabel(
|
|
446
|
+
displayHour,
|
|
447
|
+
"hour",
|
|
448
|
+
locale,
|
|
449
|
+
labelsOverrides
|
|
450
|
+
),
|
|
451
|
+
"aria-selected": isSelected,
|
|
452
|
+
children: displayHour.toString().padStart(2, "0")
|
|
453
|
+
},
|
|
454
|
+
hour
|
|
455
|
+
);
|
|
456
|
+
}) })
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerColumnClasses, children: [
|
|
459
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnHeaderClasses, children: labels.minute }),
|
|
460
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnListClasses, children: minutesList.map((minute) => {
|
|
461
|
+
const isSelected = selectedMinutes === minute;
|
|
462
|
+
const isDisabled = isMinuteDisabled(minute);
|
|
463
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
"button",
|
|
465
|
+
{
|
|
466
|
+
type: "button",
|
|
467
|
+
className: tigercatCore.getTimePickerItemClasses(isSelected, isDisabled),
|
|
468
|
+
disabled: isDisabled,
|
|
469
|
+
onClick: () => selectMinute(minute),
|
|
470
|
+
"data-tiger-timepicker-unit": "minute",
|
|
471
|
+
"aria-label": tigercatCore.getTimePickerOptionAriaLabel(
|
|
472
|
+
minute,
|
|
473
|
+
"minute",
|
|
474
|
+
locale,
|
|
475
|
+
labelsOverrides
|
|
476
|
+
),
|
|
477
|
+
"aria-selected": isSelected,
|
|
478
|
+
children: minute.toString().padStart(2, "0")
|
|
479
|
+
},
|
|
480
|
+
minute
|
|
481
|
+
);
|
|
482
|
+
}) })
|
|
483
|
+
] }),
|
|
484
|
+
showSeconds && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerColumnClasses, children: [
|
|
485
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnHeaderClasses, children: labels.second }),
|
|
486
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnListClasses, children: secondsList.map((second) => {
|
|
487
|
+
const isSelected = selectedSeconds === second;
|
|
488
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
489
|
+
"button",
|
|
490
|
+
{
|
|
491
|
+
type: "button",
|
|
492
|
+
className: tigercatCore.getTimePickerItemClasses(isSelected, false),
|
|
493
|
+
onClick: () => selectSecond(second),
|
|
494
|
+
"data-tiger-timepicker-unit": "second",
|
|
495
|
+
"aria-label": tigercatCore.getTimePickerOptionAriaLabel(
|
|
496
|
+
second,
|
|
497
|
+
"second",
|
|
498
|
+
locale,
|
|
499
|
+
labelsOverrides
|
|
500
|
+
),
|
|
501
|
+
"aria-selected": isSelected,
|
|
502
|
+
children: second.toString().padStart(2, "0")
|
|
503
|
+
},
|
|
504
|
+
second
|
|
505
|
+
);
|
|
506
|
+
}) })
|
|
507
|
+
] }),
|
|
508
|
+
format === "12" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerColumnClasses, children: [
|
|
509
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.timePickerColumnHeaderClasses, children: " " }),
|
|
510
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
511
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
512
|
+
"button",
|
|
513
|
+
{
|
|
514
|
+
type: "button",
|
|
515
|
+
className: tigercatCore.getTimePickerPeriodButtonClasses(selectedPeriod === "AM"),
|
|
516
|
+
onClick: () => selectPeriod("AM"),
|
|
517
|
+
"data-tiger-timepicker-unit": "period",
|
|
518
|
+
"aria-label": periodLabels.am,
|
|
519
|
+
"aria-selected": selectedPeriod === "AM",
|
|
520
|
+
children: periodLabels.am
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
524
|
+
"button",
|
|
525
|
+
{
|
|
526
|
+
type: "button",
|
|
527
|
+
className: tigercatCore.getTimePickerPeriodButtonClasses(selectedPeriod === "PM"),
|
|
528
|
+
onClick: () => selectPeriod("PM"),
|
|
529
|
+
"data-tiger-timepicker-unit": "period",
|
|
530
|
+
"aria-label": periodLabels.pm,
|
|
531
|
+
"aria-selected": selectedPeriod === "PM",
|
|
532
|
+
children: periodLabels.pm
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
] })
|
|
536
|
+
] })
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.timePickerFooterClasses, children: [
|
|
539
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: tigercatCore.timePickerFooterButtonClasses, onClick: setNow, children: labels.now }),
|
|
540
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: tigercatCore.timePickerFooterButtonClasses, onClick: closePanel, children: labels.ok })
|
|
541
|
+
] })
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
)
|
|
545
|
+
] });
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
exports.TimePicker = TimePicker;
|