@expcat/tigercat-react 0.1.8 → 0.2.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-TBIEWDY5.js → chunk-36RRHNZD.js} +13 -2
- package/dist/chunk-3CDAG4HD.mjs +151 -0
- package/dist/chunk-3QFHVAZT.js +68 -0
- package/dist/{chunk-ALP3KYYY.mjs → chunk-3XKBDV2Q.mjs} +5 -5
- package/dist/chunk-42UKIFFQ.js +278 -0
- package/dist/{chunk-K7ZMB2TH.mjs → chunk-5XKYWZZZ.mjs} +16 -22
- package/dist/chunk-677VSTPW.mjs +65 -0
- package/dist/chunk-6DYS4PJT.mjs +99 -0
- package/dist/chunk-6PBNFLM7.js +95 -0
- package/dist/{chunk-DCRVIDMY.mjs → chunk-6ZC7H22S.mjs} +1 -1
- package/dist/{chunk-WSCSDSV7.mjs → chunk-7IKJBQQV.mjs} +27 -5
- package/dist/{chunk-OTRGVENC.js → chunk-7SLNHUGJ.js} +1 -1
- package/dist/chunk-A2UW5OKX.mjs +415 -0
- package/dist/{chunk-NOOPXNR4.mjs → chunk-AGUPZEUL.mjs} +2 -3
- package/dist/chunk-AX5XRD2Q.js +35 -0
- package/dist/{chunk-BJU5N7WU.mjs → chunk-BAPR7UUR.mjs} +7 -7
- package/dist/chunk-CBALIFPW.mjs +275 -0
- package/dist/{chunk-BIWO5KB4.mjs → chunk-CJJ56NVL.mjs} +2 -2
- package/dist/{chunk-ENR3RIMM.js → chunk-DGBYGBLR.js} +72 -59
- package/dist/chunk-DUWAV47E.js +42 -0
- package/dist/chunk-E5GD3H7L.js +94 -0
- package/dist/chunk-EJLJYOO7.js +367 -0
- package/dist/{chunk-FQ6UHRAO.js → chunk-GQMYCYZ4.js} +6 -27
- package/dist/{chunk-G6FSHN2I.mjs → chunk-GW4EWT2K.mjs} +45 -31
- package/dist/{chunk-AQQRWISY.js → chunk-GXTBCX3M.js} +1 -1
- package/dist/{chunk-HQXZVTP4.mjs → chunk-HGF2EL25.mjs} +74 -61
- package/dist/{chunk-R5BQHZWB.js → chunk-HRYBEBZC.js} +15 -21
- package/dist/{chunk-PAD2DX5M.mjs → chunk-IIVRVCCP.mjs} +6 -24
- package/dist/chunk-IS467WAO.mjs +39 -0
- package/dist/{chunk-CTAMMQBC.mjs → chunk-IS7YOBR7.mjs} +16 -13
- package/dist/{chunk-ADOPAXPG.mjs → chunk-JI7SFMUT.mjs} +2 -2
- package/dist/chunk-KBGURVTD.mjs +282 -0
- package/dist/{chunk-O3EUFIOS.mjs → chunk-KELLYJZY.mjs} +36 -30
- package/dist/{chunk-XZDJ5FRB.js → chunk-KPZTGRNA.js} +5 -23
- package/dist/chunk-KQZ4F7FZ.js +153 -0
- package/dist/{chunk-XDKXL2BP.mjs → chunk-KV4LLPAY.mjs} +14 -3
- package/dist/{chunk-LNKI6HQ3.js → chunk-LIJLFLYE.js} +27 -5
- package/dist/chunk-LVC43YX2.mjs +72 -0
- package/dist/chunk-LZNG2HGC.mjs +227 -0
- package/dist/chunk-M375I56K.js +75 -0
- package/dist/{chunk-7OLWGHUR.mjs → chunk-MF3H7WWW.mjs} +13 -2
- package/dist/chunk-N32MAX4A.js +230 -0
- package/dist/{chunk-YYKJ63LD.mjs → chunk-NMDNLB3C.mjs} +7 -28
- package/dist/{chunk-77D7VQMG.js → chunk-OD2NNQD2.js} +2 -2
- package/dist/chunk-OONM7FO7.js +418 -0
- package/dist/{chunk-Q5Q7FG4U.js → chunk-OZLGNWET.js} +7 -7
- package/dist/{chunk-LAZGEMA2.mjs → chunk-P4EFJIXU.mjs} +1 -1
- package/dist/chunk-QI6WAP6Y.js +285 -0
- package/dist/{chunk-WK5HN4OH.js → chunk-QY6I7LU5.js} +43 -29
- package/dist/{chunk-KSW5JDIV.js → chunk-R7TOQU3U.js} +1 -1
- package/dist/chunk-RQSQXQN6.mjs +91 -0
- package/dist/chunk-SDLMB34Y.mjs +32 -0
- package/dist/chunk-UG3I4PCY.js +102 -0
- package/dist/chunk-VBSK4TGO.mjs +364 -0
- package/dist/{chunk-DZJUFU55.js → chunk-VXHBQTZS.js} +14 -11
- package/dist/chunk-WLIFEALE.mjs +111 -0
- package/dist/{chunk-AQ6DHCP6.js → chunk-XRFK2IXM.js} +4 -4
- package/dist/{chunk-5FRENLDC.js → chunk-Y2JOJ4D6.js} +14 -3
- package/dist/chunk-YER7IQF4.mjs +429 -0
- package/dist/{chunk-NI2WNZRT.js → chunk-YESS6YKC.js} +1 -2
- package/dist/chunk-Z6F67MJE.mjs +92 -0
- package/dist/{chunk-QORSSZX4.js → chunk-ZPFZMXA6.js} +34 -28
- package/dist/chunk-ZUUG3WOL.js +432 -0
- package/dist/chunk-ZYPEO2KY.js +115 -0
- package/dist/components/AreaChart.d.mts +19 -0
- package/dist/components/AreaChart.d.ts +19 -0
- package/dist/components/AreaChart.js +23 -0
- package/dist/components/AreaChart.mjs +8 -0
- package/dist/components/BarChart.d.mts +16 -0
- package/dist/components/BarChart.d.ts +16 -0
- package/dist/components/BarChart.js +23 -0
- package/dist/components/BarChart.mjs +8 -0
- package/dist/components/ChartAxis.d.mts +10 -0
- package/dist/components/ChartAxis.d.ts +10 -0
- package/dist/components/ChartAxis.js +16 -0
- package/dist/components/ChartAxis.mjs +1 -0
- package/dist/components/ChartCanvas.d.mts +9 -0
- package/dist/components/ChartCanvas.d.ts +9 -0
- package/dist/components/ChartCanvas.js +16 -0
- package/dist/components/ChartCanvas.mjs +1 -0
- package/dist/components/ChartGrid.d.mts +11 -0
- package/dist/components/ChartGrid.d.ts +11 -0
- package/dist/components/ChartGrid.js +16 -0
- package/dist/components/ChartGrid.mjs +1 -0
- package/dist/components/ChartLegend.d.mts +17 -0
- package/dist/components/ChartLegend.d.ts +17 -0
- package/dist/components/ChartLegend.js +16 -0
- package/dist/components/ChartLegend.mjs +1 -0
- package/dist/components/ChartSeries.d.mts +18 -0
- package/dist/components/ChartSeries.d.ts +18 -0
- package/dist/components/ChartSeries.js +16 -0
- package/dist/components/ChartSeries.mjs +1 -0
- package/dist/components/ChartTooltip.d.mts +12 -0
- package/dist/components/ChartTooltip.d.ts +12 -0
- package/dist/components/ChartTooltip.js +16 -0
- package/dist/components/ChartTooltip.mjs +1 -0
- package/dist/components/DonutChart.d.mts +14 -0
- package/dist/components/DonutChart.d.ts +14 -0
- package/dist/components/DonutChart.js +21 -0
- package/dist/components/DonutChart.mjs +6 -0
- package/dist/components/Drawer.js +3 -3
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.d.mts +12 -2
- package/dist/components/Dropdown.d.ts +12 -2
- package/dist/components/Dropdown.js +4 -4
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/DropdownItem.js +4 -4
- package/dist/components/DropdownItem.mjs +3 -3
- package/dist/components/Icon.js +2 -2
- package/dist/components/Icon.mjs +1 -1
- package/dist/components/LineChart.d.mts +19 -0
- package/dist/components/LineChart.d.ts +19 -0
- package/dist/components/LineChart.js +23 -0
- package/dist/components/LineChart.mjs +8 -0
- package/dist/components/List.js +3 -3
- package/dist/components/List.mjs +2 -2
- package/dist/components/Message.js +4 -4
- 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 +4 -4
- package/dist/components/Notification.mjs +1 -1
- package/dist/components/Pagination.d.mts +5 -1
- package/dist/components/Pagination.d.ts +5 -1
- package/dist/components/Pagination.js +3 -3
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.d.mts +14 -0
- package/dist/components/PieChart.d.ts +14 -0
- package/dist/components/PieChart.js +20 -0
- package/dist/components/PieChart.mjs +5 -0
- package/dist/components/Popconfirm.d.mts +12 -2
- package/dist/components/Popconfirm.d.ts +12 -2
- package/dist/components/Popconfirm.js +3 -2
- package/dist/components/Popconfirm.mjs +2 -1
- package/dist/components/Popover.d.mts +12 -2
- package/dist/components/Popover.d.ts +12 -2
- package/dist/components/Popover.js +3 -2
- package/dist/components/Popover.mjs +2 -1
- package/dist/components/RadarChart.d.mts +20 -0
- package/dist/components/RadarChart.d.ts +20 -0
- package/dist/components/RadarChart.js +20 -0
- package/dist/components/RadarChart.mjs +5 -0
- package/dist/components/ScatterChart.d.mts +32 -0
- package/dist/components/ScatterChart.d.ts +32 -0
- package/dist/components/ScatterChart.js +23 -0
- package/dist/components/ScatterChart.mjs +8 -0
- package/dist/components/Select.js +2 -2
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Slider.js +2 -2
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Space.js +2 -2
- package/dist/components/Space.mjs +1 -1
- package/dist/components/Steps.js +3 -3
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/StepsItem.js +2 -2
- package/dist/components/StepsItem.mjs +1 -1
- package/dist/components/Table.js +2 -2
- package/dist/components/Table.mjs +1 -1
- package/dist/components/Tooltip.d.mts +12 -2
- package/dist/components/Tooltip.d.ts +12 -2
- package/dist/components/Tooltip.js +3 -2
- package/dist/components/Tooltip.mjs +2 -1
- package/dist/index.d.mts +97 -1
- package/dist/index.d.ts +97 -1
- package/dist/index.js +178 -108
- package/dist/index.mjs +41 -27
- package/package.json +2 -2
- package/dist/chunk-NEULKOYJ.js +0 -48
- package/dist/chunk-ZO4XVOHU.mjs +0 -45
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { useFloating, useClickOutside, useEscapeKey } from './chunk-WLIFEALE.mjs';
|
|
2
|
+
import React, { useState, useRef, useCallback, useMemo } from 'react';
|
|
3
|
+
import { getTransformOrigin, classNames, getPopconfirmContainerClasses, getPopconfirmTriggerClasses, getPopconfirmArrowClasses, getPopconfirmContentClasses, getPopconfirmTitleClasses, getPopconfirmDescriptionClasses, getPopconfirmIconClasses, getPopconfirmButtonsClasses, getPopconfirmCancelButtonClasses, getPopconfirmOkButtonClasses, mergeStyleValues, popconfirmIconStrokeWidth, popconfirmIconViewBox, getPopconfirmIconPath, popconfirmIconPathStrokeLinejoin, popconfirmIconPathStrokeLinecap } from '@expcat/tigercat-core';
|
|
3
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
|
-
// src/components/Popconfirm.tsx
|
|
6
6
|
var popconfirmIdCounter = 0;
|
|
7
7
|
var createPopconfirmId = () => `tiger-popconfirm-${++popconfirmIdCounter}`;
|
|
8
8
|
var PopconfirmIcon = ({ type }) => /* @__PURE__ */ jsx(
|
|
@@ -33,7 +33,8 @@ var Popconfirm = ({
|
|
|
33
33
|
okText = "\u786E\u5B9A",
|
|
34
34
|
cancelText = "\u53D6\u6D88",
|
|
35
35
|
okType = "primary",
|
|
36
|
-
placement = "top",
|
|
36
|
+
placement: initialPlacement = "top",
|
|
37
|
+
offset = 8,
|
|
37
38
|
disabled = false,
|
|
38
39
|
className,
|
|
39
40
|
style,
|
|
@@ -49,6 +50,8 @@ var Popconfirm = ({
|
|
|
49
50
|
const [internalVisible, setInternalVisible] = useState(defaultVisible);
|
|
50
51
|
const currentVisible = isControlled ? visible : internalVisible;
|
|
51
52
|
const containerRef = useRef(null);
|
|
53
|
+
const triggerRef = useRef(null);
|
|
54
|
+
const floatingRef = useRef(null);
|
|
52
55
|
const popconfirmIdRef = useRef(null);
|
|
53
56
|
if (!popconfirmIdRef.current) {
|
|
54
57
|
popconfirmIdRef.current = createPopconfirmId();
|
|
@@ -76,40 +79,40 @@ var Popconfirm = ({
|
|
|
76
79
|
if (disabled) return;
|
|
77
80
|
setVisible(!currentVisible);
|
|
78
81
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
const { x, y, placement } = useFloating({
|
|
83
|
+
referenceRef: triggerRef,
|
|
84
|
+
floatingRef,
|
|
85
|
+
enabled: currentVisible,
|
|
86
|
+
placement: initialPlacement,
|
|
87
|
+
offset
|
|
88
|
+
});
|
|
89
|
+
const handleOutsideClick = useCallback(() => setVisible(false), []);
|
|
90
|
+
const handleEscape = useCallback(() => setVisible(false), []);
|
|
91
|
+
useClickOutside({
|
|
92
|
+
enabled: currentVisible,
|
|
93
|
+
refs: [containerRef],
|
|
94
|
+
onOutsideClick: handleOutsideClick,
|
|
95
|
+
defer: true
|
|
96
|
+
});
|
|
97
|
+
useEscapeKey({
|
|
98
|
+
enabled: currentVisible,
|
|
99
|
+
onEscape: handleEscape
|
|
100
|
+
});
|
|
101
|
+
const contentWrapperStyles = useMemo(
|
|
102
|
+
() => ({
|
|
103
|
+
position: "absolute",
|
|
104
|
+
left: x,
|
|
105
|
+
top: y,
|
|
106
|
+
transformOrigin: getTransformOrigin(placement)
|
|
107
|
+
}),
|
|
108
|
+
[x, y, placement]
|
|
109
|
+
);
|
|
104
110
|
const containerClasses = useMemo(
|
|
105
111
|
() => classNames(getPopconfirmContainerClasses(), className),
|
|
106
112
|
[className]
|
|
107
113
|
);
|
|
108
114
|
const triggerClasses = useMemo(() => getPopconfirmTriggerClasses(disabled), [disabled]);
|
|
109
|
-
const contentWrapperClasses = useMemo(
|
|
110
|
-
() => getDropdownMenuWrapperClasses(Boolean(currentVisible), placement),
|
|
111
|
-
[currentVisible, placement]
|
|
112
|
-
);
|
|
115
|
+
const contentWrapperClasses = useMemo(() => "absolute z-50", []);
|
|
113
116
|
const arrowClasses = useMemo(() => getPopconfirmArrowClasses(placement), [placement]);
|
|
114
117
|
const contentClasses = useMemo(() => getPopconfirmContentClasses(), []);
|
|
115
118
|
const titleClasses = useMemo(() => getPopconfirmTitleClasses(), []);
|
|
@@ -165,34 +168,44 @@ var Popconfirm = ({
|
|
|
165
168
|
);
|
|
166
169
|
})();
|
|
167
170
|
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClasses, style: mergedStyle, ...divProps, children: [
|
|
168
|
-
triggerNode,
|
|
169
|
-
/* @__PURE__ */ jsx(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"aria-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
171
|
+
/* @__PURE__ */ jsx("div", { ref: triggerRef, children: triggerNode }),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
ref: floatingRef,
|
|
176
|
+
className: contentWrapperClasses,
|
|
177
|
+
style: contentWrapperStyles,
|
|
178
|
+
hidden: !currentVisible,
|
|
179
|
+
"aria-hidden": !currentVisible,
|
|
180
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
181
|
+
/* @__PURE__ */ jsx("div", { className: arrowClasses, "aria-hidden": "true" }),
|
|
182
|
+
/* @__PURE__ */ jsxs(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
id: popconfirmId,
|
|
186
|
+
role: "dialog",
|
|
187
|
+
"aria-modal": "false",
|
|
188
|
+
"aria-labelledby": titleId,
|
|
189
|
+
"aria-describedby": describedBy,
|
|
190
|
+
className: contentClasses,
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start", children: [
|
|
193
|
+
showIcon && /* @__PURE__ */ jsx("div", { className: iconClasses, "aria-hidden": "true", children: /* @__PURE__ */ jsx(PopconfirmIcon, { type: icon }) }),
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
195
|
+
/* @__PURE__ */ jsx("div", { id: titleId, className: titleClasses, children: titleContent || title }),
|
|
196
|
+
(description || descriptionContent) && /* @__PURE__ */ jsx("div", { id: descriptionId, className: descriptionClasses, children: descriptionContent || description })
|
|
197
|
+
] })
|
|
198
|
+
] }),
|
|
199
|
+
/* @__PURE__ */ jsxs("div", { className: buttonsClasses, children: [
|
|
200
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: cancelButtonClasses, onClick: handleCancel, children: cancelText }),
|
|
201
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: okButtonClasses, onClick: handleConfirm, children: okText })
|
|
202
|
+
] })
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] })
|
|
207
|
+
}
|
|
208
|
+
)
|
|
196
209
|
] });
|
|
197
210
|
};
|
|
198
211
|
|
|
@@ -14,9 +14,9 @@ var SortIcon = ({ direction }) => {
|
|
|
14
14
|
className: tigercatCore.getSortIconClasses(true),
|
|
15
15
|
width: "16",
|
|
16
16
|
height: "16",
|
|
17
|
-
viewBox:
|
|
17
|
+
viewBox: tigercatCore.icon16ViewBox,
|
|
18
18
|
fill: "currentColor",
|
|
19
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d:
|
|
19
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortAscIcon16PathD })
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -27,9 +27,9 @@ var SortIcon = ({ direction }) => {
|
|
|
27
27
|
className: tigercatCore.getSortIconClasses(true),
|
|
28
28
|
width: "16",
|
|
29
29
|
height: "16",
|
|
30
|
-
viewBox:
|
|
30
|
+
viewBox: tigercatCore.icon16ViewBox,
|
|
31
31
|
fill: "currentColor",
|
|
32
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d:
|
|
32
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortDescIcon16PathD })
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
}
|
|
@@ -39,14 +39,14 @@ var SortIcon = ({ direction }) => {
|
|
|
39
39
|
className: tigercatCore.getSortIconClasses(false),
|
|
40
40
|
width: "16",
|
|
41
41
|
height: "16",
|
|
42
|
-
viewBox:
|
|
42
|
+
viewBox: tigercatCore.icon16ViewBox,
|
|
43
43
|
fill: "currentColor",
|
|
44
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d:
|
|
44
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: tigercatCore.sortBothIcon16PathD })
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
48
|
var LockIcon = ({ locked }) => {
|
|
49
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox:
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: tigercatCore.icon24ViewBox, fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: locked ? tigercatCore.lockClosedIcon24PathD : tigercatCore.lockOpenIcon24PathD }) });
|
|
50
50
|
};
|
|
51
51
|
var LoadingSpinner = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
52
|
"svg",
|
|
@@ -588,13 +588,13 @@ function Table({
|
|
|
588
588
|
const { totalPages, startIndex, endIndex, hasNext, hasPrev } = paginationInfo;
|
|
589
589
|
const total = processedData.length;
|
|
590
590
|
const paginationConfig2 = pagination;
|
|
591
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.
|
|
592
|
-
paginationConfig2.showTotal !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
593
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
591
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationContainerClasses(), children: [
|
|
592
|
+
paginationConfig2.showTotal !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.getSimplePaginationTotalClasses(), children: paginationConfig2.totalText ? paginationConfig2.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} results` }),
|
|
593
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationControlsClasses(), children: [
|
|
594
594
|
paginationConfig2.showSizeChanger !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
595
|
"select",
|
|
596
596
|
{
|
|
597
|
-
className:
|
|
597
|
+
className: tigercatCore.getSimplePaginationSelectClasses(),
|
|
598
598
|
value: currentPageSize,
|
|
599
599
|
onChange: (e) => handlePageSizeChange(Number(e.target.value)),
|
|
600
600
|
children: (paginationConfig2.pageSizeOptions || [10, 20, 50, 100]).map((size2) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: size2, children: [
|
|
@@ -603,20 +603,17 @@ function Table({
|
|
|
603
603
|
] }, size2))
|
|
604
604
|
}
|
|
605
605
|
),
|
|
606
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
606
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.getSimplePaginationButtonsWrapperClasses(), children: [
|
|
607
607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
608
608
|
"button",
|
|
609
609
|
{
|
|
610
|
-
className: tigercatCore.
|
|
611
|
-
"px-3 py-1 border border-gray-300 rounded text-sm",
|
|
612
|
-
hasPrev ? "hover:bg-gray-50 text-gray-700" : "text-gray-400 cursor-not-allowed"
|
|
613
|
-
),
|
|
610
|
+
className: tigercatCore.getSimplePaginationButtonClasses(!hasPrev),
|
|
614
611
|
disabled: !hasPrev,
|
|
615
612
|
onClick: () => handlePageChange(currentPage - 1),
|
|
616
613
|
children: "Previous"
|
|
617
614
|
}
|
|
618
615
|
),
|
|
619
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
616
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: tigercatCore.getSimplePaginationPageIndicatorClasses(), children: [
|
|
620
617
|
"Page ",
|
|
621
618
|
currentPage,
|
|
622
619
|
" of ",
|
|
@@ -625,10 +622,7 @@ function Table({
|
|
|
625
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
626
623
|
"button",
|
|
627
624
|
{
|
|
628
|
-
className: tigercatCore.
|
|
629
|
-
"px-3 py-1 border border-gray-300 rounded text-sm",
|
|
630
|
-
hasNext ? "hover:bg-gray-50 text-gray-700" : "text-gray-400 cursor-not-allowed"
|
|
631
|
-
),
|
|
625
|
+
className: tigercatCore.getSimplePaginationButtonClasses(!hasNext),
|
|
632
626
|
disabled: !hasNext,
|
|
633
627
|
onClick: () => handlePageChange(currentPage + 1),
|
|
634
628
|
children: "Next"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo, useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import { getSliderTrackClasses, getSliderThumbClasses, getSliderTooltipClasses, classNames, sliderRangeClasses, sliderBaseClasses } from '@expcat/tigercat-core';
|
|
2
|
+
import { sliderNormalizeValue, sliderGetPercentage, getSliderTrackClasses, getSliderThumbClasses, getSliderTooltipClasses, classNames, sliderRangeClasses, sliderBaseClasses, sliderGetKeyboardValue } from '@expcat/tigercat-core';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
// src/components/Slider.tsx
|
|
@@ -92,16 +92,11 @@ var Slider = ({
|
|
|
92
92
|
}
|
|
93
93
|
}, [controlledValue]);
|
|
94
94
|
const normalizeValue = useCallback(
|
|
95
|
-
(val) =>
|
|
96
|
-
const steps = Math.round((val - min) / step);
|
|
97
|
-
return Math.min(Math.max(min + steps * step, min), max);
|
|
98
|
-
},
|
|
95
|
+
(val) => sliderNormalizeValue(val, min, max, step),
|
|
99
96
|
[min, max, step]
|
|
100
97
|
);
|
|
101
98
|
const getPercentage = useCallback(
|
|
102
|
-
(val) =>
|
|
103
|
-
return (val - min) / (max - min) * 100;
|
|
104
|
-
},
|
|
99
|
+
(val) => sliderGetPercentage(val, min, max),
|
|
105
100
|
[min, max]
|
|
106
101
|
);
|
|
107
102
|
const getValueFromPosition = useCallback(
|
|
@@ -185,22 +180,9 @@ var Slider = ({
|
|
|
185
180
|
};
|
|
186
181
|
const handleKeyDown = (e, value, thumbType) => {
|
|
187
182
|
if (disabled) return;
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
-
newValue = normalizeValue(value + step);
|
|
192
|
-
} else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
193
|
-
e.preventDefault();
|
|
194
|
-
newValue = normalizeValue(value - step);
|
|
195
|
-
} else if (e.key === "Home") {
|
|
196
|
-
e.preventDefault();
|
|
197
|
-
newValue = min;
|
|
198
|
-
} else if (e.key === "End") {
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
newValue = max;
|
|
201
|
-
} else {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
183
|
+
const newValue = sliderGetKeyboardValue(e.key, value, min, max, step);
|
|
184
|
+
if (newValue === null) return;
|
|
185
|
+
e.preventDefault();
|
|
204
186
|
if (range && Array.isArray(internalValue)) {
|
|
205
187
|
const [minVal, maxVal] = internalValue;
|
|
206
188
|
if (thumbType === "min") {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { getChartInnerRect, classNames, chartCanvasBaseClasses } from '@expcat/tigercat-core';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/ChartCanvas.tsx
|
|
6
|
+
var ChartCanvas = ({
|
|
7
|
+
width = 320,
|
|
8
|
+
height = 200,
|
|
9
|
+
padding = 24,
|
|
10
|
+
className,
|
|
11
|
+
title,
|
|
12
|
+
desc,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const innerRect = useMemo(
|
|
17
|
+
() => getChartInnerRect(width, height, padding),
|
|
18
|
+
[width, height, padding]
|
|
19
|
+
);
|
|
20
|
+
const svgClasses = useMemo(() => classNames(chartCanvasBaseClasses, className), [className]);
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
...props,
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
28
|
+
className: svgClasses,
|
|
29
|
+
children: [
|
|
30
|
+
title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
|
|
31
|
+
desc ? /* @__PURE__ */ jsx("desc", { children: desc }) : null,
|
|
32
|
+
/* @__PURE__ */ jsx("g", { transform: `translate(${innerRect.x}, ${innerRect.y})`, children })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
var ChartCanvas_default = ChartCanvas;
|
|
38
|
+
|
|
39
|
+
export { ChartCanvas, ChartCanvas_default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
import { getTotalPages, validateCurrentPage, getPageRange, getPaginationContainerClasses, defaultTotalText, getTotalTextClasses, getPaginationButtonBaseClasses, classNames, getPageNumbers, getPaginationEllipsisClasses, getPaginationButtonActiveClasses, getPageSizeSelectorClasses, getQuickJumperInputClasses } from '@expcat/tigercat-core';
|
|
1
|
+
import { useMemo, useState, useCallback } from 'react';
|
|
2
|
+
import { getPaginationLabels, getTotalPages, validateCurrentPage, getPageRange, getPaginationContainerClasses, defaultTotalText, getTotalTextClasses, getPaginationButtonBaseClasses, classNames, getPageNumbers, getPaginationEllipsisClasses, formatPageAriaLabel, getPaginationButtonActiveClasses, getPageSizeSelectorClasses, getQuickJumperInputClasses } from '@expcat/tigercat-core';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
// src/components/Pagination.tsx
|
|
@@ -24,9 +24,11 @@ var Pagination = ({
|
|
|
24
24
|
style,
|
|
25
25
|
onChange,
|
|
26
26
|
onPageSizeChange,
|
|
27
|
+
locale,
|
|
27
28
|
...props
|
|
28
29
|
}) => {
|
|
29
30
|
const { "aria-label": ariaLabelProp, ...navProps } = props;
|
|
31
|
+
const labels = useMemo(() => getPaginationLabels(locale), [locale]);
|
|
30
32
|
const [internalCurrent, setInternalCurrent] = useState(defaultCurrent);
|
|
31
33
|
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
32
34
|
const [quickJumperValue, setQuickJumperValue] = useState("");
|
|
@@ -114,7 +116,7 @@ var Pagination = ({
|
|
|
114
116
|
className: getPaginationButtonBaseClasses(size),
|
|
115
117
|
disabled: prevDisabled,
|
|
116
118
|
onClick: () => handlePageChange(validatedCurrentPage - 1),
|
|
117
|
-
"aria-label":
|
|
119
|
+
"aria-label": labels.prevPageAriaLabel,
|
|
118
120
|
children: "\u2039"
|
|
119
121
|
},
|
|
120
122
|
"prev"
|
|
@@ -145,7 +147,7 @@ var Pagination = ({
|
|
|
145
147
|
className: getPaginationButtonBaseClasses(size),
|
|
146
148
|
disabled: nextDisabled,
|
|
147
149
|
onClick: () => handlePageChange(validatedCurrentPage + 1),
|
|
148
|
-
"aria-label":
|
|
150
|
+
"aria-label": labels.nextPageAriaLabel,
|
|
149
151
|
children: "\u203A"
|
|
150
152
|
},
|
|
151
153
|
"next"
|
|
@@ -162,7 +164,7 @@ var Pagination = ({
|
|
|
162
164
|
className: getPaginationButtonBaseClasses(size),
|
|
163
165
|
disabled: prevDisabled,
|
|
164
166
|
onClick: () => handlePageChange(validatedCurrentPage - 1),
|
|
165
|
-
"aria-label":
|
|
167
|
+
"aria-label": labels.prevPageAriaLabel,
|
|
166
168
|
children: "\u2039"
|
|
167
169
|
},
|
|
168
170
|
"prev"
|
|
@@ -195,7 +197,7 @@ var Pagination = ({
|
|
|
195
197
|
),
|
|
196
198
|
disabled,
|
|
197
199
|
onClick: () => handlePageChange(pageNum),
|
|
198
|
-
"aria-label":
|
|
200
|
+
"aria-label": formatPageAriaLabel(labels.pageAriaLabel, pageNum),
|
|
199
201
|
"aria-current": isActive ? "page" : void 0,
|
|
200
202
|
children: String(pageNum)
|
|
201
203
|
},
|
|
@@ -212,7 +214,7 @@ var Pagination = ({
|
|
|
212
214
|
className: getPaginationButtonBaseClasses(size),
|
|
213
215
|
disabled: nextDisabled,
|
|
214
216
|
onClick: () => handlePageChange(validatedCurrentPage + 1),
|
|
215
|
-
"aria-label":
|
|
217
|
+
"aria-label": labels.nextPageAriaLabel,
|
|
216
218
|
children: "\u203A"
|
|
217
219
|
},
|
|
218
220
|
"next"
|
|
@@ -228,10 +230,11 @@ var Pagination = ({
|
|
|
228
230
|
disabled,
|
|
229
231
|
value: currentPageSize,
|
|
230
232
|
onChange: (e) => handlePageSizeChange(parseInt(e.target.value, 10)),
|
|
231
|
-
"aria-label":
|
|
233
|
+
"aria-label": labels.itemsPerPageText,
|
|
232
234
|
children: pageSizeOptions.map((sizeOption) => /* @__PURE__ */ jsxs("option", { value: sizeOption, children: [
|
|
233
235
|
sizeOption,
|
|
234
|
-
"
|
|
236
|
+
" ",
|
|
237
|
+
labels.itemsPerPageText
|
|
235
238
|
] }, sizeOption))
|
|
236
239
|
},
|
|
237
240
|
"size-changer"
|
|
@@ -247,7 +250,7 @@ var Pagination = ({
|
|
|
247
250
|
"ml-2",
|
|
248
251
|
size === "small" ? "text-sm" : size === "large" ? "text-lg" : "text-base"
|
|
249
252
|
),
|
|
250
|
-
children:
|
|
253
|
+
children: labels.jumpToText
|
|
251
254
|
},
|
|
252
255
|
"jumper-label-start"
|
|
253
256
|
)
|
|
@@ -264,7 +267,7 @@ var Pagination = ({
|
|
|
264
267
|
onKeyDown: handleQuickJumperKeyPress,
|
|
265
268
|
min: 1,
|
|
266
269
|
max: totalPages,
|
|
267
|
-
"aria-label":
|
|
270
|
+
"aria-label": labels.jumpToText
|
|
268
271
|
},
|
|
269
272
|
"jumper-input"
|
|
270
273
|
)
|
|
@@ -274,7 +277,7 @@ var Pagination = ({
|
|
|
274
277
|
"span",
|
|
275
278
|
{
|
|
276
279
|
className: size === "small" ? "text-sm" : size === "large" ? "text-lg" : "text-base",
|
|
277
|
-
children:
|
|
280
|
+
children: labels.pageText
|
|
278
281
|
},
|
|
279
282
|
"jumper-label-end"
|
|
280
283
|
)
|
|
@@ -286,7 +289,7 @@ var Pagination = ({
|
|
|
286
289
|
className: containerClasses,
|
|
287
290
|
...navProps,
|
|
288
291
|
role: "navigation",
|
|
289
|
-
"aria-label": ariaLabelProp ?? "
|
|
292
|
+
"aria-label": ariaLabelProp ?? "Pagination",
|
|
290
293
|
style,
|
|
291
294
|
children: elements
|
|
292
295
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { classNames, notificationContainerBaseClasses, notificationPositionClasses, getNotificationTypeClasses, defaultNotificationThemeColors, notificationBaseClasses, getNotificationIconPath, notificationIconClasses, notificationContentClasses, notificationTitleClasses, notificationDescriptionClasses, notificationCloseButtonClasses, notificationCloseIconClasses, notificationCloseIconPath, icon24StrokeWidth, icon24ViewBox, icon24PathStrokeLinejoin, icon24PathStrokeLinecap, isBrowser } from '@expcat/tigercat-core';
|
|
3
|
+
import { classNames, notificationContainerBaseClasses, notificationPositionClasses, getNotificationTypeClasses, defaultNotificationThemeColors, notificationBaseClasses, getNotificationIconPath, notificationIconClasses, notificationContentClasses, notificationTitleClasses, notificationDescriptionClasses, notificationCloseButtonClasses, notificationCloseIconClasses, notificationCloseIconPath, icon24StrokeWidth, icon24ViewBox, icon24PathStrokeLinejoin, icon24PathStrokeLinecap, ANIMATION_DURATION_MS, isBrowser } from '@expcat/tigercat-core';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
// src/components/Notification.tsx
|
|
@@ -67,7 +67,7 @@ var NotificationItem = ({ notification: notification2, onClose }) => {
|
|
|
67
67
|
const iconClass = classNames(notificationIconClasses, colorScheme.icon);
|
|
68
68
|
const handleClose = () => {
|
|
69
69
|
setIsVisible(false);
|
|
70
|
-
setTimeout(() => onClose(notification2.id),
|
|
70
|
+
setTimeout(() => onClose(notification2.id), ANIMATION_DURATION_MS);
|
|
71
71
|
};
|
|
72
72
|
const a11yRole = notification2.type === "error" ? "alert" : "status";
|
|
73
73
|
const ariaLive = notification2.type === "error" ? "assertive" : "polite";
|