@ztwoint/z-ui 0.1.26 → 0.1.28
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/components/assets/icons/chevron-left.d.ts +7 -0
- package/dist/components/assets/icons/chevron-left.js +20 -0
- package/dist/components/assets/icons/chevron-right.js +30 -0
- package/dist/components/assets/icons/circle-check.js +32 -0
- package/dist/components/assets/icons/double-chevron-left.d.ts +7 -0
- package/dist/components/assets/icons/double-chevron-left.js +24 -0
- package/dist/components/assets/icons/double-chevron-right.d.ts +7 -0
- package/dist/components/assets/icons/double-chevron-right.js +24 -0
- package/dist/components/assets/icons/info-icon.js +16 -0
- package/dist/components/assets/icons/magnifier-icon.js +16 -0
- package/dist/components/assets/icons/sub-nav-indicator.d.ts +3 -2
- package/dist/components/assets/icons/sub-nav-indicator.js +26 -41
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +45 -30
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-content.js +16 -16
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-footer.js +1 -1
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-group.js +24 -16
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +60 -54
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-item.js +61 -62
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-provider.js +23 -23
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.d.ts +1 -1
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.js +14 -14
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dropdown/helpers/hover-card.js +34 -0
- package/dist/components/dropdown/z2-dropdown.d.ts +1 -1
- package/dist/components/dropdown/z2-dropdown.js +245 -0
- package/dist/components/dropdown-menu/z2-dropdown-menu.js +255 -0
- package/dist/components/nav-header/nav-header.js +7 -7
- package/dist/components/table/components/cell/boolean-cell.d.ts +7 -0
- package/dist/components/table/components/cell/boolean-cell.js +7 -0
- package/dist/components/table/components/cell/index.d.ts +3 -0
- package/dist/components/table/components/cell/number-cell.d.ts +7 -0
- package/dist/components/table/components/cell/number-cell.js +5 -0
- package/dist/components/table/components/cell/text-cell.d.ts +7 -0
- package/dist/components/table/components/cell/text-cell.js +5 -0
- package/dist/components/table/components/index.d.ts +11 -0
- package/dist/components/table/components/pagination/components/index.d.ts +3 -0
- package/dist/components/table/components/pagination/components/pagination-info.d.ts +4 -0
- package/dist/components/table/components/pagination/components/pagination-info.js +27 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.d.ts +4 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts +6 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.js +24 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.js +35 -0
- package/dist/components/table/components/pagination/index.d.ts +6 -0
- package/dist/components/table/components/pagination/pagination.const.d.ts +26 -0
- package/dist/components/table/components/pagination/pagination.const.js +22 -0
- package/dist/components/table/components/pagination/pagination.d.ts +4 -0
- package/dist/components/table/components/pagination/pagination.hook.d.ts +5 -0
- package/dist/components/table/components/pagination/pagination.hook.js +22 -0
- package/dist/components/table/components/pagination/pagination.js +112 -0
- package/dist/components/table/components/pagination/pagination.type.d.ts +33 -0
- package/dist/components/table/components/pagination/pagination.utils.d.ts +7 -0
- package/dist/components/table/components/pagination/pagination.utils.js +35 -0
- package/dist/components/table/components/table-cell.d.ts +15 -0
- package/dist/components/table/components/table-cell.js +45 -0
- package/dist/components/table/components/table-empty-state.d.ts +7 -0
- package/dist/components/table/components/table-empty-state.js +6 -0
- package/dist/components/table/components/table-filter/filters/boolean.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/boolean.js +31 -0
- package/dist/components/table/components/table-filter/filters/index.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/number.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/number.js +28 -0
- package/dist/components/table/components/table-filter/filters/text.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/text.js +28 -0
- package/dist/components/table/components/table-filter/index.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.d.ts +9 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +15 -0
- package/dist/components/table/components/table-filter/table-filter.hook.js +34 -0
- package/dist/components/table/components/table-filter/table-filter.js +105 -0
- package/dist/components/table/components/table-filter/table-filter.type.d.ts +18 -0
- package/dist/components/table/components/table-footer-content.d.ts +7 -0
- package/dist/components/table/components/table-footer-content.js +9 -0
- package/dist/components/table/components/table-footer.d.ts +7 -0
- package/dist/components/table/components/table-footer.js +6 -0
- package/dist/components/table/components/table-header/index.d.ts +2 -0
- package/dist/components/table/components/table-header/table-header.d.ts +9 -0
- package/dist/components/table/components/table-header/table-header.js +27 -0
- package/dist/components/table/components/table-header/table-header.utils.d.ts +5 -0
- package/dist/components/table/components/table-header/table-header.utils.js +15 -0
- package/dist/components/table/components/table-header/table-sort-icon.d.ts +8 -0
- package/dist/components/table/components/table-header/table-sort-icon.js +13 -0
- package/dist/components/table/components/table-header-content.d.ts +7 -0
- package/dist/components/table/components/table-header-content.js +9 -0
- package/dist/components/table/components/table-header-wrapper.d.ts +7 -0
- package/dist/components/table/components/table-header-wrapper.js +9 -0
- package/dist/components/table/components/table-loading-state.d.ts +7 -0
- package/dist/components/table/components/table-loading-state.js +9 -0
- package/dist/components/table/components/table-row.d.ts +11 -0
- package/dist/components/table/components/table-row.js +23 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/table-provider.d.ts +26 -0
- package/dist/components/table/table-provider.js +45 -0
- package/dist/components/table/table.const.d.ts +24 -0
- package/dist/components/table/table.const.js +27 -0
- package/dist/components/table/table.context.d.ts +7 -0
- package/dist/components/table/table.context.js +11 -0
- package/dist/components/table/table.d.ts +4 -0
- package/dist/components/table/table.js +39 -0
- package/dist/components/table/table.type.d.ts +63 -0
- package/dist/components/table/table.utils.d.ts +3 -0
- package/dist/components/table/table.utils.js +5 -0
- package/dist/css/config/colors/components/select.css +15 -0
- package/dist/css/config/colors/defaults.css +378 -137
- package/dist/css/config/colors/semantic-colors.css +356 -0
- package/dist/css/config/components/button.css +152 -0
- package/dist/css/config/components/index.css +1 -0
- package/dist/css/config/config-deprecated.css +41 -0
- package/dist/css/config/config.css +4 -18
- package/dist/css/config/typography/2xl.css +7 -0
- package/dist/css/config/typography/3xl.css +7 -0
- package/dist/css/config/typography/4xl.css +7 -0
- package/dist/css/config/typography/base.css +7 -0
- package/dist/css/config/typography/lg.css +7 -0
- package/dist/css/config/typography/sm.css +7 -0
- package/dist/css/config/typography/xl.css +7 -0
- package/dist/css/config/typography/xs.css +7 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/devComponents/navigation/index.d.ts +1 -0
- package/dist/devComponents/navigation/navigation.d.ts +1 -0
- package/dist/index.d.ts +41 -7
- package/dist/index.js +176 -92
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/theme.hook.d.ts +8 -0
- package/dist/lib/theme.hook.js +50 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +26 -0
- package/dist/routes/default.d.ts +2 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/table.d.ts +2 -0
- package/dist/sample/text-cell.d.ts +3 -0
- package/dist/types/components/assets/icons/chevron-left.d.ts +7 -0
- package/dist/types/components/assets/icons/double-chevron-left.d.ts +7 -0
- package/dist/types/components/assets/icons/double-chevron-right.d.ts +7 -0
- package/dist/types/components/assets/icons/sub-nav-indicator.d.ts +3 -2
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar.d.ts +1 -1
- package/dist/types/components/dropdown/z2-dropdown.d.ts +1 -1
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +3 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/text-cell.d.ts +7 -0
- package/dist/types/components/table/components/index.d.ts +11 -0
- package/dist/types/components/table/components/pagination/components/index.d.ts +3 -0
- package/dist/types/components/table/components/pagination/components/pagination-info.d.ts +4 -0
- package/dist/types/components/table/components/pagination/components/pagination-quick-jumper.d.ts +4 -0
- package/dist/types/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts +6 -0
- package/dist/types/components/table/components/pagination/index.d.ts +6 -0
- package/dist/types/components/table/components/pagination/pagination.const.d.ts +26 -0
- package/dist/types/components/table/components/pagination/pagination.d.ts +4 -0
- package/dist/types/components/table/components/pagination/pagination.hook.d.ts +5 -0
- package/dist/types/components/table/components/pagination/pagination.type.d.ts +33 -0
- package/dist/types/components/table/components/pagination/pagination.utils.d.ts +7 -0
- package/dist/types/components/table/components/table-cell.d.ts +15 -0
- package/dist/types/components/table/components/table-empty-state.d.ts +7 -0
- package/dist/types/components/table/components/table-filter/filters/boolean.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/index.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/number.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/text.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/index.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/table-filter.d.ts +9 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +15 -0
- package/dist/types/components/table/components/table-filter/table-filter.type.d.ts +18 -0
- package/dist/types/components/table/components/table-footer-content.d.ts +7 -0
- package/dist/types/components/table/components/table-footer.d.ts +7 -0
- package/dist/types/components/table/components/table-header/index.d.ts +2 -0
- package/dist/types/components/table/components/table-header/table-header.d.ts +10 -0
- package/dist/types/components/table/components/table-header/table-header.utils.d.ts +5 -0
- package/dist/types/components/table/components/table-header/table-sort-icon.d.ts +8 -0
- package/dist/types/components/table/components/table-header-content.d.ts +7 -0
- package/dist/types/components/table/components/table-header-wrapper.d.ts +7 -0
- package/dist/types/components/table/components/table-loading-state.d.ts +7 -0
- package/dist/types/components/table/components/table-row.d.ts +11 -0
- package/dist/types/components/table/index.d.ts +9 -0
- package/dist/types/components/table/table-provider.d.ts +26 -0
- package/dist/types/components/table/table.const.d.ts +24 -0
- package/dist/types/components/table/table.context.d.ts +7 -0
- package/dist/types/components/table/table.d.ts +4 -0
- package/dist/types/components/table/table.type.d.ts +63 -0
- package/dist/types/components/table/table.utils.d.ts +3 -0
- package/dist/types/devComponents/navigation/index.d.ts +1 -0
- package/dist/types/devComponents/navigation/navigation.d.ts +1 -0
- package/dist/types/index.d.ts +41 -7
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/theme.hook.d.ts +8 -0
- package/dist/types/routes/default.d.ts +2 -0
- package/dist/types/routes/index.d.ts +2 -0
- package/dist/types/routes/table.d.ts +2 -0
- package/dist/types/sample/text-cell.d.ts +3 -0
- package/package.json +3 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "@radix-ui/react-popover";
|
|
3
|
+
import D, { createContext as N, useState as v, useRef as k, useEffect as C, useMemo as E, useCallback as P, useContext as V } from "react";
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
|
+
import { SearchIcon as Z, ChevronDown as S } from "lucide-react";
|
|
6
|
+
import b from "../assets/icons/circle-check.js";
|
|
7
|
+
import { HoverCard as T, HoverCardTrigger as O, HoverCardContent as R } from "./helpers/hover-card.js";
|
|
8
|
+
const y = N(void 0), g = () => {
|
|
9
|
+
const e = V(y);
|
|
10
|
+
if (!e)
|
|
11
|
+
throw new Error("useDropdown must be used within a Z2Dropdown");
|
|
12
|
+
return e;
|
|
13
|
+
};
|
|
14
|
+
function q({
|
|
15
|
+
defaultOpen: e = !1,
|
|
16
|
+
value: a,
|
|
17
|
+
onValueChange: o,
|
|
18
|
+
...l
|
|
19
|
+
}) {
|
|
20
|
+
const [r, s] = v(e), [c, f] = v(""), [h, i] = v(a || "");
|
|
21
|
+
return /* @__PURE__ */ t(
|
|
22
|
+
y.Provider,
|
|
23
|
+
{
|
|
24
|
+
value: {
|
|
25
|
+
open: r,
|
|
26
|
+
setOpen: s,
|
|
27
|
+
searchValue: c,
|
|
28
|
+
setSearchValue: f,
|
|
29
|
+
value: h,
|
|
30
|
+
setSelectedValue: i,
|
|
31
|
+
onValueChange: o
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ t(_, { ...l })
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function _({ ...e }) {
|
|
38
|
+
const { open: a } = g();
|
|
39
|
+
return /* @__PURE__ */ t(p.Root, { "data-slot": "popover", open: a, ...e });
|
|
40
|
+
}
|
|
41
|
+
function I({ ...e }) {
|
|
42
|
+
return /* @__PURE__ */ t(p.Trigger, { "data-slot": "popover-trigger", ...e });
|
|
43
|
+
}
|
|
44
|
+
function j({
|
|
45
|
+
...e
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ t(p.Anchor, { "data-slot": "popover-anchor", ...e });
|
|
48
|
+
}
|
|
49
|
+
function B({
|
|
50
|
+
onSearchChange: e,
|
|
51
|
+
placeholder: a = "Search...",
|
|
52
|
+
className: o = "",
|
|
53
|
+
selectedIcon: l
|
|
54
|
+
}) {
|
|
55
|
+
const { open: r, setOpen: s, searchValue: c, setSearchValue: f, value: h } = g(), i = k(null);
|
|
56
|
+
C(() => {
|
|
57
|
+
if (r && i.current) {
|
|
58
|
+
const n = setTimeout(() => {
|
|
59
|
+
var u;
|
|
60
|
+
(u = i.current) == null || u.focus();
|
|
61
|
+
}, 10);
|
|
62
|
+
return () => clearTimeout(n);
|
|
63
|
+
}
|
|
64
|
+
!r && i.current && i.current.blur();
|
|
65
|
+
}, [r]);
|
|
66
|
+
const m = (n) => {
|
|
67
|
+
const u = n.target.value;
|
|
68
|
+
f(u), e == null || e(u);
|
|
69
|
+
}, w = E(() => r ? c : h, [r, c, h]);
|
|
70
|
+
return /* @__PURE__ */ t(j, { asChild: !0, children: /* @__PURE__ */ t(I, { onClick: () => s(!r), "data-prevent-close": !0, className: "w-full", children: /* @__PURE__ */ x(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: d(
|
|
74
|
+
"flex items-center justify-center gap-1.5 p-2 self-stretch relative cursor-pointer rounded-lg bg-white border-[0.5px] border-[#E0E0E0] shadow-[0px_1px_2px_0px_rgba(0,0,0,0.05)] hover:border-neutral-300 ",
|
|
75
|
+
o
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
l && !r && /* @__PURE__ */ t("div", { className: "text-neutral-400 w-[14px] h-[14px] flex-shrink-0", children: l }),
|
|
79
|
+
r && /* @__PURE__ */ t("div", { className: "text-neutral-400 w-[14px] h-[14px] flex-shrink-0", children: /* @__PURE__ */ t(Z, { className: "w-3.5 h-3.5 flex-shrink-0" }) }),
|
|
80
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-center px-0.5 gap-2.5 flex-1 relative h-[14px]", children: /* @__PURE__ */ t(
|
|
81
|
+
"input",
|
|
82
|
+
{
|
|
83
|
+
ref: i,
|
|
84
|
+
id: "z2-dropdown-input",
|
|
85
|
+
type: "text",
|
|
86
|
+
placeholder: a,
|
|
87
|
+
className: "w-full text-default-primary h-3.5 !text-sm bg-transparent border-none outline-none placeholder:text-default-muted overflow-visible",
|
|
88
|
+
value: w,
|
|
89
|
+
onChange: m,
|
|
90
|
+
onClick: (n) => {
|
|
91
|
+
s(!0), n.stopPropagation();
|
|
92
|
+
},
|
|
93
|
+
onKeyDown: (n) => {
|
|
94
|
+
var u;
|
|
95
|
+
n.stopPropagation(), n.key === "Escape" ? (s(!1), f(""), (u = i.current) == null || u.blur()) : n.key === "Enter" || n.key === " " || (n.key === "ArrowDown" || n.key === "ArrowUp") && n.preventDefault();
|
|
96
|
+
},
|
|
97
|
+
onKeyUp: (n) => {
|
|
98
|
+
n.stopPropagation(), n.key === " " && n.preventDefault();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
) }),
|
|
102
|
+
/* @__PURE__ */ t("div", { className: "text-neutral-400 w-[14px] h-[14px] flex-shrink-0", children: /* @__PURE__ */ t(S, { className: d(r && "rotate-180", "w-3.5 h-3.5 flex-shrink-0") }) })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
) }) });
|
|
106
|
+
}
|
|
107
|
+
function F({
|
|
108
|
+
className: e,
|
|
109
|
+
align: a = "start",
|
|
110
|
+
...o
|
|
111
|
+
}) {
|
|
112
|
+
const { setOpen: l } = g(), r = P((s) => {
|
|
113
|
+
s && setTimeout(() => {
|
|
114
|
+
const c = s.offsetHeight;
|
|
115
|
+
c > 0 && document.documentElement.style.setProperty(
|
|
116
|
+
"--radix-popover-content-height",
|
|
117
|
+
`${c}px`
|
|
118
|
+
);
|
|
119
|
+
}, 10);
|
|
120
|
+
}, []);
|
|
121
|
+
return /* @__PURE__ */ t(p.Portal, { children: /* @__PURE__ */ t(
|
|
122
|
+
p.Content,
|
|
123
|
+
{
|
|
124
|
+
ref: r,
|
|
125
|
+
onInteractOutside: (s) => {
|
|
126
|
+
if (s.target.closest("[data-prevent-close]")) {
|
|
127
|
+
s.preventDefault();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
l(!1);
|
|
131
|
+
},
|
|
132
|
+
"data-slot": "popover-content",
|
|
133
|
+
align: a,
|
|
134
|
+
sideOffset: 8,
|
|
135
|
+
className: d(
|
|
136
|
+
"bg-white max-w-fit w-[var(--radix-popover-trigger-width)] p-1 flex flex-col items-start rounded-2xl border-[0.5px] border-[#E0E0E0] shadow-lg z-50 min-w-fit",
|
|
137
|
+
e
|
|
138
|
+
),
|
|
139
|
+
...o
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
142
|
+
}
|
|
143
|
+
function A({
|
|
144
|
+
icon: e,
|
|
145
|
+
label: a,
|
|
146
|
+
value: o,
|
|
147
|
+
hoverComponent: l,
|
|
148
|
+
disablePopoverClose: r = !1
|
|
149
|
+
}) {
|
|
150
|
+
const { onValueChange: s, value: c, setSelectedValue: f, setOpen: h } = g(), i = c === o, m = D.useMemo(() => /* @__PURE__ */ x(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
onClick: (w) => {
|
|
154
|
+
w.preventDefault(), f(o), s && s(o), r || h(!1);
|
|
155
|
+
},
|
|
156
|
+
className: d(
|
|
157
|
+
i && "bg-neutral-secondary",
|
|
158
|
+
"p-2 gap-2 flex items-center rounded-lg cursor-pointer h-[30px] self-stretch",
|
|
159
|
+
"hover:bg-neutral-secondary"
|
|
160
|
+
),
|
|
161
|
+
children: [
|
|
162
|
+
e && /* @__PURE__ */ t("span", { className: "h-3.5 w-3.5 relative", children: e }),
|
|
163
|
+
a || o,
|
|
164
|
+
/* @__PURE__ */ t(b, { className: d("ml-auto", i ? "opacity-100" : "opacity-0") })
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
o
|
|
168
|
+
), [
|
|
169
|
+
o,
|
|
170
|
+
i,
|
|
171
|
+
e,
|
|
172
|
+
a,
|
|
173
|
+
f,
|
|
174
|
+
s,
|
|
175
|
+
r,
|
|
176
|
+
h
|
|
177
|
+
]);
|
|
178
|
+
return l ? /* @__PURE__ */ x(T, { openDelay: 1e3, children: [
|
|
179
|
+
/* @__PURE__ */ t(O, { className: "w-full", children: m }),
|
|
180
|
+
/* @__PURE__ */ t(R, { side: "right", sideOffset: 14, children: l })
|
|
181
|
+
] }) : m;
|
|
182
|
+
}
|
|
183
|
+
function G({ ...e }) {
|
|
184
|
+
return /* @__PURE__ */ t(p.Root, { "data-slot": "popover", ...e });
|
|
185
|
+
}
|
|
186
|
+
function J({
|
|
187
|
+
value: e,
|
|
188
|
+
label: a,
|
|
189
|
+
icon: o,
|
|
190
|
+
isSelected: l = !1
|
|
191
|
+
}) {
|
|
192
|
+
return /* @__PURE__ */ x(
|
|
193
|
+
p.Trigger,
|
|
194
|
+
{
|
|
195
|
+
"data-slot": "popover-sub-trigger",
|
|
196
|
+
className: d(
|
|
197
|
+
"!w-full",
|
|
198
|
+
"p-2 gap-2 flex items-center rounded-lg cursor-pointer h-[30px] self-stretch",
|
|
199
|
+
"hover:bg-neutral-secondary"
|
|
200
|
+
),
|
|
201
|
+
children: [
|
|
202
|
+
o && /* @__PURE__ */ t("span", { className: "h-3.5 w-3.5 relative", children: o }),
|
|
203
|
+
a || e,
|
|
204
|
+
/* @__PURE__ */ t(b, { className: d("ml-auto", l ? "opacity-100" : "opacity-0") })
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
function L({
|
|
210
|
+
className: e,
|
|
211
|
+
align: a = "start",
|
|
212
|
+
sideOffset: o = 4,
|
|
213
|
+
side: l = "right",
|
|
214
|
+
...r
|
|
215
|
+
}) {
|
|
216
|
+
return /* @__PURE__ */ t(p.Portal, { children: /* @__PURE__ */ t(
|
|
217
|
+
p.Content,
|
|
218
|
+
{
|
|
219
|
+
"data-slot": "popover-content",
|
|
220
|
+
align: a,
|
|
221
|
+
sideOffset: o,
|
|
222
|
+
side: l,
|
|
223
|
+
className: d(
|
|
224
|
+
"min-w-md min-h-fit h-[var(--radix-popover-content-height)]",
|
|
225
|
+
"bg-white w-full p-1 flex flex-col items-start rounded-2xl border-[0.5px] border-[#E0E0E0] shadow-lg z-50",
|
|
226
|
+
e
|
|
227
|
+
),
|
|
228
|
+
...r
|
|
229
|
+
}
|
|
230
|
+
) });
|
|
231
|
+
}
|
|
232
|
+
function Q({ ...e }) {
|
|
233
|
+
return /* @__PURE__ */ t(A, { ...e });
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
y as DropdownContext,
|
|
237
|
+
q as Z2Dropdown,
|
|
238
|
+
F as Z2DropdownContent,
|
|
239
|
+
B as Z2DropdownInput,
|
|
240
|
+
A as Z2DropdownItem,
|
|
241
|
+
G as Z2DropdownSub,
|
|
242
|
+
L as Z2DropdownSubContent,
|
|
243
|
+
Q as Z2DropdownSubItem,
|
|
244
|
+
J as Z2DropdownSubTrigger
|
|
245
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
import { CheckIcon as i, CircleIcon as u, ChevronRightIcon as l } from "lucide-react";
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
function b({ ...e }) {
|
|
6
|
+
return /* @__PURE__ */ t(o.Root, { "data-slot": "dropdown-menu", ...e });
|
|
7
|
+
}
|
|
8
|
+
function m({
|
|
9
|
+
...e
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ t(o.Portal, { "data-slot": "dropdown-menu-portal", ...e });
|
|
12
|
+
}
|
|
13
|
+
function f({
|
|
14
|
+
...e
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ t(o.Trigger, { "data-slot": "dropdown-menu-trigger", ...e });
|
|
17
|
+
}
|
|
18
|
+
function x({
|
|
19
|
+
className: e,
|
|
20
|
+
sideOffset: a = 8,
|
|
21
|
+
...r
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
|
|
24
|
+
o.Content,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "dropdown-menu-content",
|
|
27
|
+
sideOffset: a,
|
|
28
|
+
className: n(
|
|
29
|
+
"bg-white dark:bg-gray-950 text-gray-900 dark:text-gray-100 border border-gray-200 dark:border-gray-800",
|
|
30
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
31
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
32
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
33
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
34
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
35
|
+
"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[12rem]",
|
|
36
|
+
"origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",
|
|
37
|
+
"rounded-xl p-2 shadow-2xl shadow-black/10 dark:shadow-black/30",
|
|
38
|
+
"backdrop-blur-xl bg-white/95 dark:bg-gray-950/95",
|
|
39
|
+
e
|
|
40
|
+
),
|
|
41
|
+
...r
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
}
|
|
45
|
+
function w({ ...e }) {
|
|
46
|
+
return /* @__PURE__ */ t(o.Group, { "data-slot": "dropdown-menu-group", ...e });
|
|
47
|
+
}
|
|
48
|
+
function k({
|
|
49
|
+
className: e,
|
|
50
|
+
inset: a,
|
|
51
|
+
variant: r = "default",
|
|
52
|
+
...d
|
|
53
|
+
}) {
|
|
54
|
+
return /* @__PURE__ */ t(
|
|
55
|
+
o.Item,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "dropdown-menu-item",
|
|
58
|
+
"data-inset": a,
|
|
59
|
+
"data-variant": r,
|
|
60
|
+
className: n(
|
|
61
|
+
"relative flex cursor-default items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
62
|
+
"outline-none select-none transition-all duration-150",
|
|
63
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
64
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
65
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
66
|
+
"data-[variant=destructive]:text-red-600 dark:data-[variant=destructive]:text-red-400",
|
|
67
|
+
"data-[variant=destructive]:hover:bg-red-50 dark:data-[variant=destructive]:hover:bg-red-950/20",
|
|
68
|
+
"data-[variant=destructive]:focus:bg-red-50 dark:data-[variant=destructive]:focus:bg-red-950/30",
|
|
69
|
+
"data-[inset]:pl-10",
|
|
70
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
71
|
+
"[&_svg:not([class*='text-'])]:text-gray-500 dark:[&_svg:not([class*='text-'])]:text-gray-400",
|
|
72
|
+
e
|
|
73
|
+
),
|
|
74
|
+
...d
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function h({
|
|
79
|
+
className: e,
|
|
80
|
+
children: a,
|
|
81
|
+
checked: r,
|
|
82
|
+
...d
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ s(
|
|
85
|
+
o.CheckboxItem,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
88
|
+
className: n(
|
|
89
|
+
"relative flex cursor-default items-center gap-3 rounded-lg py-2.5 pr-3 pl-10 text-sm font-medium",
|
|
90
|
+
"outline-none select-none transition-all duration-150",
|
|
91
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
92
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
93
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
94
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
95
|
+
e
|
|
96
|
+
),
|
|
97
|
+
checked: r,
|
|
98
|
+
...d,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-3 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, { className: "size-3.5 text-blue-600 dark:text-blue-400" }) }) }),
|
|
101
|
+
a
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function v({
|
|
107
|
+
...e
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ t(o.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...e });
|
|
110
|
+
}
|
|
111
|
+
function y({
|
|
112
|
+
className: e,
|
|
113
|
+
children: a,
|
|
114
|
+
...r
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ s(
|
|
117
|
+
o.RadioItem,
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
120
|
+
className: n(
|
|
121
|
+
"relative flex cursor-default items-center gap-3 rounded-lg py-2.5 pr-3 pl-10 text-sm font-medium",
|
|
122
|
+
"outline-none select-none transition-all duration-150",
|
|
123
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
124
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
125
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
126
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
127
|
+
e
|
|
128
|
+
),
|
|
129
|
+
...r,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-3 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(u, { className: "size-2 fill-blue-600 dark:fill-blue-400 text-blue-600 dark:text-blue-400" }) }) }),
|
|
132
|
+
a
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function D({
|
|
138
|
+
className: e,
|
|
139
|
+
inset: a,
|
|
140
|
+
...r
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ t(
|
|
143
|
+
o.Label,
|
|
144
|
+
{
|
|
145
|
+
"data-slot": "dropdown-menu-label",
|
|
146
|
+
"data-inset": a,
|
|
147
|
+
className: n(
|
|
148
|
+
"px-3 py-2 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400",
|
|
149
|
+
"data-[inset]:pl-10",
|
|
150
|
+
e
|
|
151
|
+
),
|
|
152
|
+
...r
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function M({
|
|
157
|
+
className: e,
|
|
158
|
+
...a
|
|
159
|
+
}) {
|
|
160
|
+
return /* @__PURE__ */ t(
|
|
161
|
+
o.Separator,
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "dropdown-menu-separator",
|
|
164
|
+
className: n("bg-gray-200 dark:bg-gray-800 my-2 h-px", e),
|
|
165
|
+
...a
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function z({ className: e, ...a }) {
|
|
170
|
+
return /* @__PURE__ */ t(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
174
|
+
className: n(
|
|
175
|
+
"ml-auto text-xs font-mono text-gray-400 dark:text-gray-500 tracking-wider",
|
|
176
|
+
"bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded",
|
|
177
|
+
e
|
|
178
|
+
),
|
|
179
|
+
...a
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function I({ ...e }) {
|
|
184
|
+
return /* @__PURE__ */ t(o.Sub, { "data-slot": "dropdown-menu-sub", ...e });
|
|
185
|
+
}
|
|
186
|
+
function Z({
|
|
187
|
+
className: e,
|
|
188
|
+
inset: a,
|
|
189
|
+
children: r,
|
|
190
|
+
...d
|
|
191
|
+
}) {
|
|
192
|
+
return /* @__PURE__ */ s(
|
|
193
|
+
o.SubTrigger,
|
|
194
|
+
{
|
|
195
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
196
|
+
"data-inset": a,
|
|
197
|
+
className: n(
|
|
198
|
+
"flex cursor-default items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
199
|
+
"outline-none select-none transition-all duration-150",
|
|
200
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
201
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
202
|
+
"data-[state=open]:bg-blue-50 dark:data-[state=open]:bg-blue-950/30",
|
|
203
|
+
"data-[state=open]:text-blue-700 dark:data-[state=open]:text-blue-300",
|
|
204
|
+
"data-[inset]:pl-10",
|
|
205
|
+
e
|
|
206
|
+
),
|
|
207
|
+
...d,
|
|
208
|
+
children: [
|
|
209
|
+
r,
|
|
210
|
+
/* @__PURE__ */ t(l, { className: "ml-auto size-4 text-gray-400 dark:text-gray-500" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
function N({
|
|
216
|
+
className: e,
|
|
217
|
+
...a
|
|
218
|
+
}) {
|
|
219
|
+
return /* @__PURE__ */ t(
|
|
220
|
+
o.SubContent,
|
|
221
|
+
{
|
|
222
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
223
|
+
className: n(
|
|
224
|
+
"bg-white dark:bg-gray-950 text-gray-900 dark:text-gray-100 border border-gray-200 dark:border-gray-800",
|
|
225
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
226
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
227
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
228
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
229
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
230
|
+
"z-50 min-w-[10rem] origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
231
|
+
"overflow-hidden rounded-xl p-2 shadow-2xl shadow-black/10 dark:shadow-black/30",
|
|
232
|
+
"backdrop-blur-xl bg-white/95 dark:bg-gray-950/95",
|
|
233
|
+
e
|
|
234
|
+
),
|
|
235
|
+
...a
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
export {
|
|
240
|
+
b as Z2DropdownMenu,
|
|
241
|
+
h as Z2DropdownMenuCheckboxItem,
|
|
242
|
+
x as Z2DropdownMenuContent,
|
|
243
|
+
w as Z2DropdownMenuGroup,
|
|
244
|
+
k as Z2DropdownMenuItem,
|
|
245
|
+
D as Z2DropdownMenuLabel,
|
|
246
|
+
m as Z2DropdownMenuPortal,
|
|
247
|
+
v as Z2DropdownMenuRadioGroup,
|
|
248
|
+
y as Z2DropdownMenuRadioItem,
|
|
249
|
+
M as Z2DropdownMenuSeparator,
|
|
250
|
+
z as Z2DropdownMenuShortcut,
|
|
251
|
+
I as Z2DropdownMenuSub,
|
|
252
|
+
N as Z2DropdownMenuSubContent,
|
|
253
|
+
Z as Z2DropdownMenuSubTrigger,
|
|
254
|
+
f as Z2DropdownMenuTrigger
|
|
255
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as d } from "react";
|
|
3
3
|
import n from "../assets/icons/z2-icon.js";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
import { NavItem as c } from "./nav-item/nav-item.js";
|
|
6
|
-
const N = d({}), i = ({ className: a, children: r, ...
|
|
6
|
+
const N = d({}), i = ({ className: a, children: r, ...s }) => /* @__PURE__ */ e(N.Provider, { value: {}, children: /* @__PURE__ */ l(
|
|
7
7
|
"header",
|
|
8
8
|
{
|
|
9
|
-
className:
|
|
10
|
-
"flex items-center h-
|
|
9
|
+
className: t(
|
|
10
|
+
"flex items-center h-12 p-3",
|
|
11
11
|
"gap-6",
|
|
12
12
|
// space between icon/separator/list
|
|
13
13
|
"bg-[#001534]",
|
|
14
14
|
a
|
|
15
15
|
),
|
|
16
|
-
...
|
|
16
|
+
...s,
|
|
17
17
|
children: [
|
|
18
18
|
/* @__PURE__ */ e("div", { className: "flex items-center flex-shrink-0", children: /* @__PURE__ */ e(n, { className: "shrink-0" }) }),
|
|
19
19
|
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-white/20", "aria-hidden": "true" }),
|
|
@@ -22,12 +22,12 @@ const N = d({}), i = ({ className: a, children: r, ...t }) => /* @__PURE__ */ e(
|
|
|
22
22
|
}
|
|
23
23
|
) });
|
|
24
24
|
i.displayName = "NavHeader.Root";
|
|
25
|
-
const m = ({ className: a, children: r, ...
|
|
25
|
+
const m = ({ className: a, children: r, ...s }) => /* @__PURE__ */ e("nav", { className: t("flex flex-row gap-2 ml-0", a), ...s, children: r });
|
|
26
26
|
m.displayName = "NavHeader.List";
|
|
27
27
|
const o = ({
|
|
28
28
|
className: a,
|
|
29
29
|
...r
|
|
30
|
-
}) => /* @__PURE__ */ e("div", { className:
|
|
30
|
+
}) => /* @__PURE__ */ e("div", { className: "list-none", children: /* @__PURE__ */ e(c, { ...r, className: t(a) }) });
|
|
31
31
|
o.displayName = "NavHeader.Item";
|
|
32
32
|
const H = {
|
|
33
33
|
Root: i,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../../node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js";
|
|
3
|
+
import t from "../../../../node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js";
|
|
4
|
+
const l = ({ value: r }) => r == null ? null : r ? /* @__PURE__ */ e(o, { className: "text-green-500 w-4 h-4" }) : /* @__PURE__ */ e(t, { className: "text-red-500 w-4 h-4" });
|
|
5
|
+
export {
|
|
6
|
+
l as BooleanCell
|
|
7
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { TableCell } from './table-cell';
|
|
2
|
+
export { TableHeader, TableSortIcon } from './table-header';
|
|
3
|
+
export { TableRow } from './table-row';
|
|
4
|
+
export { TableEmptyState } from './table-empty-state';
|
|
5
|
+
export { TableLoadingState } from './table-loading-state';
|
|
6
|
+
export { Pagination as TablePagination } from './pagination';
|
|
7
|
+
export { TableHeaderWrapper } from './table-header-wrapper';
|
|
8
|
+
export { TableHeaderContent } from './table-header-content';
|
|
9
|
+
export { TableFooter } from './table-footer';
|
|
10
|
+
export { TableFooterContent } from './table-footer-content';
|
|
11
|
+
export * from './cell';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { calculateItemRange as s } from "../pagination.utils.js";
|
|
3
|
+
import { PAGINATION_LABELS as r, PAGINATION_CSS_CLASSES as c } from "../pagination.const.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
showTotal: o,
|
|
6
|
+
totalItems: n,
|
|
7
|
+
currentPage: i,
|
|
8
|
+
itemsPerPage: a
|
|
9
|
+
}) => {
|
|
10
|
+
if (!o || !n) return null;
|
|
11
|
+
const { start: e, end: f } = s(i, a, n);
|
|
12
|
+
return /* @__PURE__ */ t("div", { className: c.info, children: [
|
|
13
|
+
r.showing,
|
|
14
|
+
" ",
|
|
15
|
+
e,
|
|
16
|
+
"-",
|
|
17
|
+
f,
|
|
18
|
+
" ",
|
|
19
|
+
r.of,
|
|
20
|
+
" ",
|
|
21
|
+
n
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
l as PaginationInfo,
|
|
26
|
+
l as default
|
|
27
|
+
};
|
package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const usePaginationQuickJumper: (currentPage: number, totalPage: number, onPageChange: (page: number) => void) => {
|
|
2
|
+
inputValue: string;
|
|
3
|
+
handleInputChange: (value: string) => void;
|
|
4
|
+
handleInputSubmit: () => void;
|
|
5
|
+
handleKeyPress: (event: React.KeyboardEvent) => void;
|
|
6
|
+
};
|
package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState as m, useCallback as s } from "react";
|
|
2
|
+
import { isValidPageNumber as c } from "../pagination.utils.js";
|
|
3
|
+
const l = (i, u, r) => {
|
|
4
|
+
const [e, o] = m(""), p = s((t) => {
|
|
5
|
+
(t === "" || /^\d+$/.test(t)) && o(t);
|
|
6
|
+
}, []), n = s(() => {
|
|
7
|
+
const t = parseInt(e, 10);
|
|
8
|
+
c(t, u) && t !== i && r(t), o("");
|
|
9
|
+
}, [e, u, i, r]), a = s(
|
|
10
|
+
(t) => {
|
|
11
|
+
t.key === "Enter" && n();
|
|
12
|
+
},
|
|
13
|
+
[n]
|
|
14
|
+
);
|
|
15
|
+
return {
|
|
16
|
+
inputValue: e,
|
|
17
|
+
handleInputChange: p,
|
|
18
|
+
handleInputSubmit: n,
|
|
19
|
+
handleKeyPress: a
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
l as usePaginationQuickJumper
|
|
24
|
+
};
|