@sth87/shadcn-design-system 0.2.3 → 0.2.5
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/AI_README.md +131 -131
- package/README.md +547 -547
- package/dist/AI_CONTEXT.md +2506 -2506
- package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/RangePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/TimePicker.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-date-filter.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs +1 -1
- package/dist/cjs/components/Table/TableFilter/data-table-slider-filter.cjs +1 -1
- package/dist/cjs/components/Table/data-table-pagination.cjs +1 -1
- package/dist/cjs/components/Table/data-table-toolbar.cjs +1 -1
- package/dist/cjs/components/Table/data-table-view-options.cjs +1 -1
- package/dist/cjs/components/Table/data-table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +1 -0
- package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/cjs/utils/data-table.cjs +1 -1
- package/dist/cjs/utils/parsers.cjs +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +6 -6
- package/dist/esm/components/DatePicker/DatePicker.js +13 -13
- package/dist/esm/components/DatePicker/RangePicker.js +14 -14
- package/dist/esm/components/DatePicker/TimePicker.js +30 -30
- package/dist/esm/components/Table/TableFilter/data-table-date-filter.js +2 -2
- package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js +12 -12
- package/dist/esm/components/Table/TableFilter/data-table-slider-filter.js +11 -11
- package/dist/esm/components/Table/data-table-pagination.js +38 -28
- package/dist/esm/components/Table/data-table-toolbar.js +1 -1
- package/dist/esm/components/Table/data-table-view-options.js +5 -5
- package/dist/esm/components/Table/data-table.js +146 -81
- package/dist/esm/index.js +248 -248
- package/dist/esm/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.js +2 -2
- package/dist/esm/node_modules/.pnpm/{@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → @dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443}/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +2 -2
- package/dist/esm/packages/ui/src/components/table.js +20 -6
- package/dist/esm/styles/index.css +1 -1
- package/dist/esm/utils/data-table.js +16 -11
- package/dist/esm/utils/parsers.js +1 -1
- package/dist/types/components/Table/data-table-pagination.d.ts +10 -1
- package/dist/types/components/Table/data-table-pagination.d.ts.map +1 -1
- package/dist/types/components/Table/data-table.d.ts +45 -2
- package/dist/types/components/Table/data-table.d.ts.map +1 -1
- package/dist/types/utils/data-table.d.ts.map +1 -1
- package/package.json +321 -321
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +0 -1
- /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs +0 -0
- /package/dist/cjs/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.cjs +0 -0
- /package/dist/esm/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -0
- /package/dist/esm/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r({column:t,withBorder:i=!1}){const e=t.getIsPinned(),n=e==="left"&&t.getIsLastColumn("left"),o=e==="right"&&t.getIsFirstColumn("right");return{boxShadow:i?n?"-4px 0 4px -4px var(--border) inset":o?"4px 0 4px -4px var(--border) inset":void 0:void 0,left:e==="left"?`${t.getStart("left")}px`:void 0,right:e==="right"?`${t.getAfter("right")}px`:void 0,position:e?"sticky":"relative",width:t.getSize(),zIndex:e?1:void 0}}exports.getCommonPinningStyles=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../node_modules/.pnpm/nuqs@2.8.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../node_modules/.pnpm/nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2/node_modules/nuqs/dist/server.cjs"),e=require("zod"),o=require("../config/data-table.cjs"),c=e.z.object({id:e.z.string(),desc:e.z.boolean()}),u=n=>{const i=n?n instanceof Set?n:new Set(n):null;return l.createParser({parse:r=>{try{const a=JSON.parse(r),t=e.z.array(c).safeParse(a);return!t.success||i&&t.data.some(s=>!i.has(s.id))?null:t.data}catch{return null}},serialize:r=>JSON.stringify(r),eq:(r,a)=>r.length===a.length&&r.every((t,s)=>t.id===a[s]?.id&&t.desc===a[s]?.desc)})};e.z.object({id:e.z.string(),value:e.z.union([e.z.string(),e.z.array(e.z.string())]),variant:e.z.enum(o.dataTableConfig.filterVariants),operator:e.z.enum(o.dataTableConfig.operators),filterId:e.z.string()});exports.getSortingStateParser=u;
|
|
@@ -3,10 +3,10 @@ import u, { useState as L } from "react";
|
|
|
3
3
|
import { Checkbox as V } from "../../packages/ui/src/components/checkbox.js";
|
|
4
4
|
import { cn as r } from "../../packages/ui/src/lib/utils.js";
|
|
5
5
|
import { Tooltip as g } from "../Tooltip/Tooltip.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Info as b } from "lucide-react";
|
|
6
|
+
import { Info as C } from "lucide-react";
|
|
8
7
|
import { AnimatePresence as $ } from "motion/react";
|
|
9
8
|
import { ConfettiPiece as q } from "../../utils/css.js";
|
|
9
|
+
import { Label as b } from "../../packages/ui/src/components/label.js";
|
|
10
10
|
const B = u.forwardRef(
|
|
11
11
|
(N, w) => {
|
|
12
12
|
const {
|
|
@@ -34,9 +34,9 @@ const B = u.forwardRef(
|
|
|
34
34
|
}, p = s === "top" || s === "bottom", F = p ? "ds:flex-col" : "ds:flex-row", R = p ? "ds:gap-1.5" : "ds:gap-2", D = c === "start" ? "ds:items-start" : c === "center" ? "ds:items-center" : "ds:items-end", h = "ds:flex ds:gap-2 ds:peer-disabled:cursor-not-allowed ds:peer-disabled:opacity-70";
|
|
35
35
|
return /* @__PURE__ */ t("div", { className: r("ds:flex ds:flex-col ds:gap-1.5 ds:relative", {}), children: [
|
|
36
36
|
/* @__PURE__ */ t("div", { className: r("ds:flex", F, R, D), children: [
|
|
37
|
-
(s === "top" || s === "left") && o && /* @__PURE__ */ t(
|
|
37
|
+
(s === "top" || s === "left") && o && /* @__PURE__ */ t(b, { htmlFor: a, className: h, children: [
|
|
38
38
|
o,
|
|
39
|
-
d && /* @__PURE__ */ e(g, { content: d, children: /* @__PURE__ */ e(
|
|
39
|
+
d && /* @__PURE__ */ e(g, { content: d, children: /* @__PURE__ */ e(C, { className: "ds:size-3.5 ds:min-w-3.5" }) })
|
|
40
40
|
] }),
|
|
41
41
|
/* @__PURE__ */ t("div", { className: "ds:relative ds:inline-flex", children: [
|
|
42
42
|
/* @__PURE__ */ e(
|
|
@@ -54,9 +54,9 @@ const B = u.forwardRef(
|
|
|
54
54
|
),
|
|
55
55
|
/* @__PURE__ */ e($, { children: A && /* @__PURE__ */ e("div", { className: "ds:pointer-events-none ds:absolute ds:inset-0", children: [...Array(12)].map((i, x) => /* @__PURE__ */ e(q, { index: x }, x)) }) })
|
|
56
56
|
] }),
|
|
57
|
-
(s === "bottom" || s === "right") && o && /* @__PURE__ */ t(
|
|
57
|
+
(s === "bottom" || s === "right") && o && /* @__PURE__ */ t(b, { htmlFor: a, className: h, children: [
|
|
58
58
|
o,
|
|
59
|
-
d && /* @__PURE__ */ e(g, { content: d, children: /* @__PURE__ */ e(
|
|
59
|
+
d && /* @__PURE__ */ e(g, { content: d, children: /* @__PURE__ */ e(C, { className: "ds:size-3.5 ds:min-w-3.5" }) })
|
|
60
60
|
] })
|
|
61
61
|
] }),
|
|
62
62
|
n && /* @__PURE__ */ e("div", { className: "ds:flex ds:items-center ds:justify-between ds:text-xs ds:gap-2", children: n && /* @__PURE__ */ e(
|
|
@@ -4,20 +4,20 @@ import { Calendar as ge } from "../../packages/ui/src/components/calendar.js";
|
|
|
4
4
|
import { Popover as ve, PopoverTrigger as we, PopoverContent as he } from "../../packages/ui/src/components/popover.js";
|
|
5
5
|
import { Drawer as ye, DrawerTrigger as be, DrawerContent as De, DrawerHeader as Me, DrawerTitle as xe, DrawerDescription as ze } from "../../packages/ui/src/components/drawer.js";
|
|
6
6
|
import { cn as M } from "../../packages/ui/src/lib/utils.js";
|
|
7
|
-
import Ce from "
|
|
8
|
-
import He from "
|
|
9
|
-
import { TimePicker as Ne } from "./TimePicker.js";
|
|
10
|
-
import { CalendarIcon as Pe } from "lucide-react";
|
|
7
|
+
import { TimePicker as Ce } from "./TimePicker.js";
|
|
8
|
+
import { CalendarIcon as He } from "lucide-react";
|
|
11
9
|
import { isMobile as x } from "react-device-detect";
|
|
12
|
-
import { format as B, parse as
|
|
13
|
-
import { enUS as
|
|
10
|
+
import { format as B, parse as Ne, isValid as Pe } from "date-fns";
|
|
11
|
+
import { enUS as ke, vi as Se } from "date-fns/locale";
|
|
14
12
|
import { DATE_FORMAT as _ } from "../../constants/common.js";
|
|
13
|
+
import Re from "../Button/Button.js";
|
|
14
|
+
import Oe from "../Input/Input.js";
|
|
15
15
|
function Fe(t, o = _, s) {
|
|
16
16
|
return t ? B(t, o, s ? { locale: s } : void 0) : "";
|
|
17
17
|
}
|
|
18
18
|
const z = (t, o = _) => {
|
|
19
|
-
const s =
|
|
20
|
-
return
|
|
19
|
+
const s = Ne(t, o, /* @__PURE__ */ new Date());
|
|
20
|
+
return Pe(s) ? s : void 0;
|
|
21
21
|
};
|
|
22
22
|
function Ie(t) {
|
|
23
23
|
return t.replace(/dd|MM|yyyy/g, (o) => {
|
|
@@ -81,7 +81,7 @@ function Qe({
|
|
|
81
81
|
typeof y == "string" ? (u = y, O = y) : (u = y.input, O = y.output);
|
|
82
82
|
let C;
|
|
83
83
|
N === !0 ? C = Ie(u) : typeof N == "string" && (C = N);
|
|
84
|
-
const F = R && c ? g : c ? `${u} ${g}` : u, T = t ? z(t, F) : void 0, [b, D] = p.useState(!1), [d, i] = p.useState(T), [ce, v] = p.useState(T), [w, f] = p.useState(t || ""), ue = p.useRef(null), I = p.useRef(!1), V = P?.locale ? P?.locale : Q === "en" ?
|
|
84
|
+
const F = R && c ? g : c ? `${u} ${g}` : u, T = t ? z(t, F) : void 0, [b, D] = p.useState(!1), [d, i] = p.useState(T), [ce, v] = p.useState(T), [w, f] = p.useState(t || ""), ue = p.useRef(null), I = p.useRef(!1), V = P?.locale ? P?.locale : Q === "en" ? ke : Se, A = x ? X : k;
|
|
85
85
|
p.useEffect(() => {
|
|
86
86
|
if (t !== w && !I.current) {
|
|
87
87
|
f(t || "");
|
|
@@ -121,14 +121,14 @@ function Qe({
|
|
|
121
121
|
onSelect: fe,
|
|
122
122
|
onChange: me
|
|
123
123
|
}) : /* @__PURE__ */ h(
|
|
124
|
-
|
|
124
|
+
Re,
|
|
125
125
|
{
|
|
126
126
|
variant: "ghost",
|
|
127
127
|
className: "ds:!p-1 ds:!leading-0 ds:h-auto ds:rounded ds:hover:bg-accent ds:transition-colors",
|
|
128
128
|
size: n.size,
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ a(
|
|
131
|
-
|
|
131
|
+
He,
|
|
132
132
|
{
|
|
133
133
|
className: M({
|
|
134
134
|
"ds:size-3": n.size === "xs" || n.size === "sm",
|
|
@@ -188,7 +188,7 @@ function Qe({
|
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
190
|
c && /* @__PURE__ */ a("div", { className: "ds:border-l ds:border-border", children: /* @__PURE__ */ a(
|
|
191
|
-
|
|
191
|
+
Ce,
|
|
192
192
|
{
|
|
193
193
|
value: d ? B(d, g) : void 0,
|
|
194
194
|
format: g,
|
|
@@ -246,7 +246,7 @@ function Qe({
|
|
|
246
246
|
)
|
|
247
247
|
] });
|
|
248
248
|
return S ? A === "drawer" ? K : E : /* @__PURE__ */ a(
|
|
249
|
-
|
|
249
|
+
Oe,
|
|
250
250
|
{
|
|
251
251
|
...n,
|
|
252
252
|
ref: ue,
|
|
@@ -4,21 +4,21 @@ import { Calendar as xe } from "../../packages/ui/src/components/calendar.js";
|
|
|
4
4
|
import { Popover as Ce, PopoverTrigger as Ve, PopoverContent as Pe } from "../../packages/ui/src/components/popover.js";
|
|
5
5
|
import { Drawer as Se, DrawerTrigger as ke, DrawerContent as Oe, DrawerHeader as je, DrawerTitle as Le, DrawerDescription as Ee } from "../../packages/ui/src/components/drawer.js";
|
|
6
6
|
import { cn as H } from "../../packages/ui/src/lib/utils.js";
|
|
7
|
-
import $e from "../Input/Input.js";
|
|
8
|
-
import Ae from "../Button/Button.js";
|
|
9
7
|
import { TimePicker as ce } from "./TimePicker.js";
|
|
10
|
-
import { CalendarIcon as
|
|
8
|
+
import { CalendarIcon as $e, MoveRight as Ae } from "lucide-react";
|
|
11
9
|
import { isMobile as P } from "react-device-detect";
|
|
12
|
-
import { format as O, parse as
|
|
13
|
-
import { enUS as
|
|
10
|
+
import { format as O, parse as Be, isValid as Ue } from "date-fns";
|
|
11
|
+
import { enUS as Ye, vi as _e } from "date-fns/locale";
|
|
14
12
|
import { DATE_FORMAT as me } from "../../constants/common.js";
|
|
15
|
-
import { FloatingLabel as
|
|
13
|
+
import { FloatingLabel as Ke } from "../FloatLabel.js";
|
|
14
|
+
import qe from "../Button/Button.js";
|
|
15
|
+
import Ge from "../Input/Input.js";
|
|
16
16
|
function Je(w, d = me, h) {
|
|
17
17
|
return w ? O(w, d, h ? { locale: h } : void 0) : "";
|
|
18
18
|
}
|
|
19
19
|
const y = (w, d = me) => {
|
|
20
|
-
const h =
|
|
21
|
-
return
|
|
20
|
+
const h = Be(w, d, /* @__PURE__ */ new Date());
|
|
21
|
+
return Ue(h) ? h : void 0;
|
|
22
22
|
};
|
|
23
23
|
function Qe(w) {
|
|
24
24
|
return w.replace(/dd|MM|yyyy/g, (d) => {
|
|
@@ -62,7 +62,7 @@ function lo({
|
|
|
62
62
|
desktopMode: S = "popover",
|
|
63
63
|
mobileMode: ee = "drawer",
|
|
64
64
|
children: E,
|
|
65
|
-
separator: he = /* @__PURE__ */ m(
|
|
65
|
+
separator: he = /* @__PURE__ */ m(Ae, { className: "ds:size-5" }),
|
|
66
66
|
showTime: z = !1,
|
|
67
67
|
timeFormat: v = "HH:mm",
|
|
68
68
|
hideDate: oe = !1,
|
|
@@ -81,7 +81,7 @@ function lo({
|
|
|
81
81
|
to: ye
|
|
82
82
|
}, [se, k] = D.useState(!1), [s, f] = D.useState(ze), [Me, B] = D.useState(
|
|
83
83
|
re || /* @__PURE__ */ new Date()
|
|
84
|
-
), [I, b] = D.useState(d?.from || ""), [x, p] = D.useState(d?.to || ""), [U, Y] = D.useState(void 0), [_, K] = D.useState(void 0), q = D.useRef(null), G = D.useRef(null), Fe = !!(I.trim() || x.trim()), J = L?.locale ? L?.locale : ge === "en" ?
|
|
84
|
+
), [I, b] = D.useState(d?.from || ""), [x, p] = D.useState(d?.to || ""), [U, Y] = D.useState(void 0), [_, K] = D.useState(void 0), q = D.useRef(null), G = D.useRef(null), Fe = !!(I.trim() || x.trim()), J = L?.locale ? L?.locale : ge === "en" ? Ye : _e, t = (e) => {
|
|
85
85
|
if (!e) return "";
|
|
86
86
|
let o = Je(e, $, J);
|
|
87
87
|
return z && (o += ` ${O(e, v)}`), o;
|
|
@@ -178,14 +178,14 @@ function lo({
|
|
|
178
178
|
onFromChange: Re,
|
|
179
179
|
onToChange: Te
|
|
180
180
|
}) : /* @__PURE__ */ T(
|
|
181
|
-
|
|
181
|
+
qe,
|
|
182
182
|
{
|
|
183
183
|
variant: "ghost",
|
|
184
184
|
className: "ds:!p-1 ds:!leading-0 ds:h-auto ds:rounded ds:hover:bg-accent ds:transition-colors",
|
|
185
185
|
size: n?.size,
|
|
186
186
|
children: [
|
|
187
187
|
/* @__PURE__ */ m(
|
|
188
|
-
|
|
188
|
+
$e,
|
|
189
189
|
{
|
|
190
190
|
className: H({
|
|
191
191
|
"ds:size-3": n.size === "xs" || n.size === "sm",
|
|
@@ -331,7 +331,7 @@ function lo({
|
|
|
331
331
|
const ae = (e, o, r, u) => {
|
|
332
332
|
const i = e === "from";
|
|
333
333
|
return /* @__PURE__ */ m(
|
|
334
|
-
|
|
334
|
+
Ge,
|
|
335
335
|
{
|
|
336
336
|
...n,
|
|
337
337
|
...u,
|
|
@@ -436,7 +436,7 @@ function lo({
|
|
|
436
436
|
suffixIcon: P ? ee === "drawer" ? W : Q : S === "drawer" ? W : Q
|
|
437
437
|
}),
|
|
438
438
|
n.isFloatLabel && typeof w == "string" && /* @__PURE__ */ m(
|
|
439
|
-
|
|
439
|
+
Ke,
|
|
440
440
|
{
|
|
441
441
|
htmlFor: te,
|
|
442
442
|
size: n.size,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsxs as b, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as E, useEffect as Ne, useRef as U, useMemo as _, useCallback as V, memo as ze } from "react";
|
|
3
3
|
import { cn as C } from "../../packages/ui/src/lib/utils.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import Ue from "../Input/Input.js";
|
|
7
|
-
import { Popover as qe, PopoverTrigger as Ae, PopoverContent as Ge } from "../../packages/ui/src/components/popover.js";
|
|
8
|
-
import { Drawer as Je, DrawerTrigger as Ke, DrawerContent as Qe, DrawerHeader as We, DrawerTitle as Xe, DrawerDescription as Ye } from "../../packages/ui/src/components/drawer.js";
|
|
4
|
+
import { Popover as Ee, PopoverTrigger as Ue, PopoverContent as qe } from "../../packages/ui/src/components/popover.js";
|
|
5
|
+
import { Drawer as Ae, DrawerTrigger as Ge, DrawerContent as Je, DrawerHeader as Ke, DrawerTitle as Qe, DrawerDescription as We } from "../../packages/ui/src/components/drawer.js";
|
|
9
6
|
import { isMobile as De } from "react-device-detect";
|
|
10
|
-
import { Clock as
|
|
11
|
-
import { TimeColumnwheel as
|
|
12
|
-
import { TimeGridView as
|
|
13
|
-
import { parse as
|
|
7
|
+
import { Clock as Xe } from "lucide-react";
|
|
8
|
+
import { TimeColumnwheel as B } from "../WheelColumn.js";
|
|
9
|
+
import { TimeGridView as Ye } from "../TimeGridView.js";
|
|
10
|
+
import { parse as Ze, isValid as Me, format as _e } from "date-fns";
|
|
11
|
+
import Be from "../Select/Select.js";
|
|
12
|
+
import L from "../Button/Button.js";
|
|
13
|
+
import Le from "../Input/Input.js";
|
|
14
14
|
const ee = (o, m = 1) => {
|
|
15
15
|
const H = [];
|
|
16
16
|
for (let v = 0; v < o; v += m)
|
|
17
17
|
H.push(v);
|
|
18
18
|
return H;
|
|
19
|
-
}, q = (o) => String(o).padStart(2, "0"), Se = (o, m = "HH:mm") => !o || !Me(o) ? "" :
|
|
19
|
+
}, q = (o) => String(o).padStart(2, "0"), Se = (o, m = "HH:mm") => !o || !Me(o) ? "" : _e(o, m), ye = (o, m = "HH:mm") => {
|
|
20
20
|
if (!o) return;
|
|
21
|
-
const v =
|
|
21
|
+
const v = Ze(o, m, /* @__PURE__ */ new Date());
|
|
22
22
|
if (Me(v))
|
|
23
23
|
return v;
|
|
24
24
|
};
|
|
@@ -190,7 +190,7 @@ function hs({
|
|
|
190
190
|
}) => /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-2", children: [
|
|
191
191
|
n && /* @__PURE__ */ r("div", { className: "ds:text-xs ds:font-semibold ds:text-muted-foreground ds:uppercase ds:p-2 ds:border-b ds:w-full ds:text-center", children: n }),
|
|
192
192
|
/* @__PURE__ */ r("div", { className: "ds:p-2", children: /* @__PURE__ */ r(
|
|
193
|
-
|
|
193
|
+
Be,
|
|
194
194
|
{
|
|
195
195
|
value: s?.toString() || "",
|
|
196
196
|
onValueChange: (u) => t(Number(u)),
|
|
@@ -214,7 +214,7 @@ function hs({
|
|
|
214
214
|
const e = [];
|
|
215
215
|
if (l === "compact")
|
|
216
216
|
return /* @__PURE__ */ r(
|
|
217
|
-
|
|
217
|
+
Ye,
|
|
218
218
|
{
|
|
219
219
|
HOURS: M,
|
|
220
220
|
MINUTES: k,
|
|
@@ -231,7 +231,7 @@ function hs({
|
|
|
231
231
|
const s = typeof c == "string" ? void 0 : W("hours");
|
|
232
232
|
l === "wheel" ? e.push(
|
|
233
233
|
/* @__PURE__ */ r(
|
|
234
|
-
|
|
234
|
+
B,
|
|
235
235
|
{
|
|
236
236
|
ref: G,
|
|
237
237
|
items: M,
|
|
@@ -262,7 +262,7 @@ function hs({
|
|
|
262
262
|
const s = typeof c == "string" ? void 0 : W("minutes");
|
|
263
263
|
l === "wheel" ? e.push(
|
|
264
264
|
/* @__PURE__ */ r(
|
|
265
|
-
|
|
265
|
+
B,
|
|
266
266
|
{
|
|
267
267
|
ref: J,
|
|
268
268
|
items: k,
|
|
@@ -294,7 +294,7 @@ function hs({
|
|
|
294
294
|
const s = typeof c == "string" ? void 0 : W("seconds");
|
|
295
295
|
l === "wheel" ? e.push(
|
|
296
296
|
/* @__PURE__ */ r(
|
|
297
|
-
|
|
297
|
+
B,
|
|
298
298
|
{
|
|
299
299
|
ref: K,
|
|
300
300
|
items: j,
|
|
@@ -342,7 +342,7 @@ function hs({
|
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
344
|
le && /* @__PURE__ */ r(
|
|
345
|
-
|
|
345
|
+
L,
|
|
346
346
|
{
|
|
347
347
|
type: "button",
|
|
348
348
|
variant: "solid",
|
|
@@ -373,7 +373,7 @@ function hs({
|
|
|
373
373
|
}
|
|
374
374
|
),
|
|
375
375
|
le && /* @__PURE__ */ r(
|
|
376
|
-
|
|
376
|
+
L,
|
|
377
377
|
{
|
|
378
378
|
type: "button",
|
|
379
379
|
variant: "solid",
|
|
@@ -385,20 +385,20 @@ function hs({
|
|
|
385
385
|
}
|
|
386
386
|
)
|
|
387
387
|
] }), be = /* @__PURE__ */ b(
|
|
388
|
-
|
|
388
|
+
L,
|
|
389
389
|
{
|
|
390
390
|
variant: "ghost",
|
|
391
391
|
className: "ds:!p-1 ds:!leading-0 ds:h-auto ds:rounded ds:hover:bg-accent ds:transition-colors",
|
|
392
392
|
disabled: w,
|
|
393
393
|
children: [
|
|
394
|
-
/* @__PURE__ */ r(
|
|
394
|
+
/* @__PURE__ */ r(Xe, { className: "ds:size-4" }),
|
|
395
395
|
/* @__PURE__ */ r("span", { className: "ds:sr-only", children: "Select time" })
|
|
396
396
|
]
|
|
397
397
|
}
|
|
398
|
-
), Ce = /* @__PURE__ */ b(
|
|
399
|
-
/* @__PURE__ */ r(
|
|
398
|
+
), Ce = /* @__PURE__ */ b(Ee, { open: $, onOpenChange: me, children: [
|
|
399
|
+
/* @__PURE__ */ r(Ue, { asChild: !0, disabled: w, children: be }),
|
|
400
400
|
/* @__PURE__ */ r(
|
|
401
|
-
|
|
401
|
+
qe,
|
|
402
402
|
{
|
|
403
403
|
className: C(
|
|
404
404
|
"ds:w-auto ds:overflow-hidden ds:p-0",
|
|
@@ -407,19 +407,19 @@ function hs({
|
|
|
407
407
|
children: He
|
|
408
408
|
}
|
|
409
409
|
)
|
|
410
|
-
] }), xe = /* @__PURE__ */ b(
|
|
411
|
-
/* @__PURE__ */ r(
|
|
410
|
+
] }), xe = /* @__PURE__ */ b(Ae, { open: $, onOpenChange: me, children: [
|
|
411
|
+
/* @__PURE__ */ r(Ge, { asChild: !0, children: be }),
|
|
412
412
|
/* @__PURE__ */ b(
|
|
413
|
-
|
|
413
|
+
Je,
|
|
414
414
|
{
|
|
415
415
|
className: C(
|
|
416
416
|
"ds:w-auto ds:overflow-hidden ds:p-0",
|
|
417
417
|
"ds:backdrop-blur ds:bg-background"
|
|
418
418
|
),
|
|
419
419
|
children: [
|
|
420
|
-
/* @__PURE__ */ b(
|
|
421
|
-
/* @__PURE__ */ r(
|
|
422
|
-
/* @__PURE__ */ r(
|
|
420
|
+
/* @__PURE__ */ b(Ke, { className: "ds:sr-only", children: [
|
|
421
|
+
/* @__PURE__ */ r(Qe, { children: "Select time" }),
|
|
422
|
+
/* @__PURE__ */ r(We, { children: "Choose a time" })
|
|
423
423
|
] }),
|
|
424
424
|
He
|
|
425
425
|
]
|
|
@@ -428,7 +428,7 @@ function hs({
|
|
|
428
428
|
] }), Ie = T;
|
|
429
429
|
let Z;
|
|
430
430
|
return A === !0 ? Z = es(x) : typeof A == "string" && (Z = A), /* @__PURE__ */ r(
|
|
431
|
-
|
|
431
|
+
Le,
|
|
432
432
|
{
|
|
433
433
|
...Ve,
|
|
434
434
|
clearable: !0,
|
|
@@ -2,10 +2,10 @@ import { jsxs as d, jsx as n, Fragment as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { formatDate as m } from "../../../utils/datetime.js";
|
|
3
3
|
import { XCircle as T, CalendarIcon as V } from "lucide-react";
|
|
4
4
|
import * as c from "react";
|
|
5
|
-
import b from "../../Separator/Separator.js";
|
|
6
5
|
import { Popover as A } from "../../Popover/index.js";
|
|
7
|
-
import
|
|
6
|
+
import b from "../../Separator/Separator.js";
|
|
8
7
|
import { Calendar as y } from "../../Calendar/Calendar.js";
|
|
8
|
+
import S from "../../Button/Button.js";
|
|
9
9
|
function f(e) {
|
|
10
10
|
return e && typeof e == "object" && !Array.isArray(e);
|
|
11
11
|
}
|
|
@@ -2,13 +2,13 @@ import { jsx as a, jsxs as i, Fragment as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { X as V } from "lucide-react";
|
|
3
3
|
import * as C from "react";
|
|
4
4
|
import { Popover as N } from "../../Popover/index.js";
|
|
5
|
+
import { DataTableSliderFilter as x } from "./data-table-slider-filter.js";
|
|
6
|
+
import { DataTableDateFilter as w } from "./data-table-date-filter.js";
|
|
7
|
+
import D from "../../Separator/Separator.js";
|
|
8
|
+
import O from "../../Button/Button.js";
|
|
9
|
+
import S from "../../Checkbox/Checkbox.js";
|
|
10
|
+
import k from "../../Radio/Radio.js";
|
|
5
11
|
import o from "../../Input/Input.js";
|
|
6
|
-
import x from "../../Checkbox/Checkbox.js";
|
|
7
|
-
import w from "../../Radio/Radio.js";
|
|
8
|
-
import { DataTableSliderFilter as D } from "./data-table-slider-filter.js";
|
|
9
|
-
import { DataTableDateFilter as O } from "./data-table-date-filter.js";
|
|
10
|
-
import S from "../../Separator/Separator.js";
|
|
11
|
-
import k from "../../Button/Button.js";
|
|
12
12
|
function A({
|
|
13
13
|
column: e,
|
|
14
14
|
trigger: c,
|
|
@@ -42,7 +42,7 @@ function A({
|
|
|
42
42
|
case "date":
|
|
43
43
|
case "dateRange":
|
|
44
44
|
return /* @__PURE__ */ a(
|
|
45
|
-
|
|
45
|
+
w,
|
|
46
46
|
{
|
|
47
47
|
column: e,
|
|
48
48
|
title: t.label ?? e.id,
|
|
@@ -51,7 +51,7 @@ function A({
|
|
|
51
51
|
);
|
|
52
52
|
case "range":
|
|
53
53
|
return /* @__PURE__ */ a(
|
|
54
|
-
|
|
54
|
+
x,
|
|
55
55
|
{
|
|
56
56
|
column: e,
|
|
57
57
|
title: t.label ?? e.id
|
|
@@ -67,7 +67,7 @@ function A({
|
|
|
67
67
|
{
|
|
68
68
|
className: "ds:flex ds:items-center ds:space-x-2",
|
|
69
69
|
children: /* @__PURE__ */ a(
|
|
70
|
-
|
|
70
|
+
S,
|
|
71
71
|
{
|
|
72
72
|
checked: s.includes(l.value),
|
|
73
73
|
onCheckedChange: (b) => {
|
|
@@ -87,7 +87,7 @@ function A({
|
|
|
87
87
|
} else {
|
|
88
88
|
const s = e.getFilterValue();
|
|
89
89
|
return /* @__PURE__ */ a(
|
|
90
|
-
|
|
90
|
+
k,
|
|
91
91
|
{
|
|
92
92
|
value: s,
|
|
93
93
|
onValueChange: (l) => e.setFilterValue(l),
|
|
@@ -113,9 +113,9 @@ function A({
|
|
|
113
113
|
content: /* @__PURE__ */ i("div", { className: "ds:p-2 ds:min-w-32", children: [
|
|
114
114
|
f(),
|
|
115
115
|
F && /* @__PURE__ */ i(d, { children: [
|
|
116
|
-
/* @__PURE__ */ a(
|
|
116
|
+
/* @__PURE__ */ a(D, { className: "ds:mt-3 ds:mb-1" }),
|
|
117
117
|
/* @__PURE__ */ i(
|
|
118
|
-
|
|
118
|
+
O,
|
|
119
119
|
{
|
|
120
120
|
variant: "ghost",
|
|
121
121
|
size: "sm",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as d, jsx as s, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import { XCircle as I, PlusCircle as D } from "lucide-react";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import y from "../../Button/Button.js";
|
|
5
|
-
import v from "../../Input/Input.js";
|
|
6
4
|
import { Popover as w } from "../../Popover/index.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
5
|
+
import { cn as y } from "../../../packages/ui/src/lib/utils.js";
|
|
6
|
+
import v from "../../Input/Input.js";
|
|
7
|
+
import P from "../../Slider/Slider.js";
|
|
8
|
+
import C from "../../Button/Button.js";
|
|
9
|
+
import R from "../../Separator/Separator.js";
|
|
10
10
|
function z(e) {
|
|
11
11
|
return Array.isArray(e) && e.length === 2 && typeof e[0] == "number" && typeof e[1] == "number";
|
|
12
12
|
}
|
|
@@ -75,7 +75,7 @@ function J({
|
|
|
75
75
|
max: n,
|
|
76
76
|
value: l[0]?.toString(),
|
|
77
77
|
onChange: F,
|
|
78
|
-
className:
|
|
78
|
+
className: y("ds:h-8 ds:w-24", o && "ds:pr-8")
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
81
|
o && /* @__PURE__ */ s("span", { className: "ds:absolute ds:top-0 ds:right-0 ds:bottom-0 ds:flex ds:items-center ds:rounded-r-md ds:bg-accent ds:px-2 ds:text-muted-foreground ds:text-sm", children: o })
|
|
@@ -96,7 +96,7 @@ function J({
|
|
|
96
96
|
max: n,
|
|
97
97
|
value: l[1]?.toString(),
|
|
98
98
|
onChange: M,
|
|
99
|
-
className:
|
|
99
|
+
className: y("ds:h-8 ds:w-24", o && "ds:pr-8")
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
102
|
o && /* @__PURE__ */ s("span", { className: "ds:absolute ds:top-0 ds:right-0 ds:bottom-0 ds:flex ds:items-center ds:rounded-r-md ds:bg-accent ds:px-2 ds:text-muted-foreground ds:text-sm", children: o })
|
|
@@ -107,7 +107,7 @@ function J({
|
|
|
107
107
|
" slider"
|
|
108
108
|
] }),
|
|
109
109
|
/* @__PURE__ */ s(
|
|
110
|
-
|
|
110
|
+
P,
|
|
111
111
|
{
|
|
112
112
|
id: `${c}-slider`,
|
|
113
113
|
min: a,
|
|
@@ -119,7 +119,7 @@ function J({
|
|
|
119
119
|
)
|
|
120
120
|
] }),
|
|
121
121
|
/* @__PURE__ */ s(
|
|
122
|
-
|
|
122
|
+
C,
|
|
123
123
|
{
|
|
124
124
|
"aria-label": `Clear ${i} filter`,
|
|
125
125
|
variant: "outline",
|
|
@@ -129,7 +129,7 @@ function J({
|
|
|
129
129
|
}
|
|
130
130
|
)
|
|
131
131
|
] });
|
|
132
|
-
return /* @__PURE__ */ s(w, { content: A, children: /* @__PURE__ */ d(
|
|
132
|
+
return /* @__PURE__ */ s(w, { content: A, children: /* @__PURE__ */ d(C, { variant: "outline", size: "sm", className: "ds:border-dashed ds:font-normal", children: [
|
|
133
133
|
u ? /* @__PURE__ */ s(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
@@ -144,7 +144,7 @@ function J({
|
|
|
144
144
|
/* @__PURE__ */ s("span", { children: i }),
|
|
145
145
|
u ? /* @__PURE__ */ d(k, { children: [
|
|
146
146
|
/* @__PURE__ */ s(
|
|
147
|
-
|
|
147
|
+
R,
|
|
148
148
|
{
|
|
149
149
|
orientation: "vertical",
|
|
150
150
|
className: "ds:mx-0.5 ds:data-[orientation=vertical]:h-4"
|
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import { jsxs as t, jsx as a, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
function
|
|
1
|
+
import { jsxs as t, jsx as a, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { Pagination as P } from "../Pagination/index.js";
|
|
3
|
+
import { cn as S } from "../../packages/ui/src/lib/utils.js";
|
|
4
|
+
import C from "../Select/Select.js";
|
|
5
|
+
function y({
|
|
6
6
|
table: e,
|
|
7
|
-
pageSizeOptions:
|
|
8
|
-
className:
|
|
9
|
-
showPageInfo:
|
|
10
|
-
showPageSizeOptions:
|
|
11
|
-
showRowSelectionCount:
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
pageSizeOptions: l = [5, 10, 20, 30, 40, 50, 100],
|
|
8
|
+
className: m,
|
|
9
|
+
showPageInfo: c = !1,
|
|
10
|
+
showPageSizeOptions: f = !1,
|
|
11
|
+
showRowSelectionCount: p = !1,
|
|
12
|
+
showTotalCount: u = !1,
|
|
13
|
+
totalCount: o,
|
|
14
|
+
showPagination: x = !0,
|
|
15
|
+
...h
|
|
14
16
|
}) {
|
|
17
|
+
const { pageIndex: w, pageSize: d } = e.getState().pagination, n = e.getRowCount(), r = e.getFilteredSelectedRowModel().rows.length, i = n === 0 ? 0 : w * d + 1, v = Math.min(i + d - 1, n);
|
|
15
18
|
return /* @__PURE__ */ t(
|
|
16
19
|
"div",
|
|
17
20
|
{
|
|
18
|
-
className:
|
|
21
|
+
className: S(
|
|
19
22
|
"ds:flex ds:w-full ds:flex-col-reverse ds:items-center ds:justify-between ds:gap-4 ds:overflow-auto ds:p-1 ds:sm:flex-row ds:sm:gap-8",
|
|
20
|
-
|
|
23
|
+
m
|
|
21
24
|
),
|
|
22
|
-
...
|
|
25
|
+
...h,
|
|
23
26
|
children: [
|
|
24
|
-
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:whitespace-nowrap ds:text-muted-foreground ds:text-sm", children:
|
|
25
|
-
|
|
26
|
-
" of",
|
|
27
|
-
|
|
28
|
-
e.getFilteredRowModel().rows.length,
|
|
27
|
+
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:whitespace-nowrap ds:text-muted-foreground ds:text-sm", children: p && r > 0 ? /* @__PURE__ */ t(g, { children: [
|
|
28
|
+
r,
|
|
29
|
+
" of ",
|
|
30
|
+
n,
|
|
29
31
|
" row(s) selected."
|
|
32
|
+
] }) : u && /* @__PURE__ */ t(g, { children: [
|
|
33
|
+
"Hiển thị ",
|
|
34
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
35
|
+
i,
|
|
36
|
+
" - ",
|
|
37
|
+
v
|
|
38
|
+
] }),
|
|
39
|
+
typeof o == "number" && ` / ${o}`
|
|
30
40
|
] }) }),
|
|
31
41
|
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col-reverse ds:items-center ds:gap-2 ds:sm:flex-row ds:sm:gap-2 ds:lg:gap-4", children: [
|
|
32
|
-
|
|
42
|
+
c && /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:justify-center ds:font-medium ds:text-sm", children: [
|
|
33
43
|
"Page ",
|
|
34
44
|
e.getState().pagination.pageIndex + 1,
|
|
35
45
|
" of",
|
|
36
46
|
" ",
|
|
37
47
|
e.getPageCount()
|
|
38
48
|
] }),
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
x && /* @__PURE__ */ a(
|
|
50
|
+
P,
|
|
41
51
|
{
|
|
42
52
|
total: e.getPageCount(),
|
|
43
53
|
currentPage: e.getState().pagination.pageIndex + 1,
|
|
@@ -49,16 +59,16 @@ function v({
|
|
|
49
59
|
showPreviousNext: !0
|
|
50
60
|
}
|
|
51
61
|
),
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
f && /* @__PURE__ */ a(
|
|
63
|
+
C,
|
|
54
64
|
{
|
|
55
65
|
value: `${e.getState().pagination.pageSize}`,
|
|
56
66
|
onValueChange: (s) => {
|
|
57
67
|
e.setPageSize(Number(s));
|
|
58
68
|
},
|
|
59
|
-
options:
|
|
69
|
+
options: l.map((s) => ({
|
|
60
70
|
value: `${s}`,
|
|
61
|
-
label: `${s} /
|
|
71
|
+
label: `${s} / trang`
|
|
62
72
|
}))
|
|
63
73
|
}
|
|
64
74
|
)
|
|
@@ -68,5 +78,5 @@ function v({
|
|
|
68
78
|
);
|
|
69
79
|
}
|
|
70
80
|
export {
|
|
71
|
-
|
|
81
|
+
y as DataTablePagination
|
|
72
82
|
};
|
|
@@ -3,8 +3,8 @@ import { X as p, XCircle as h, PlusCircle as b } from "lucide-react";
|
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { DataTableFilterPopover as F } from "./TableFilter/data-table-filter-popover.js";
|
|
5
5
|
import { DataTableViewOptions as v } from "./data-table-view-options.js";
|
|
6
|
-
import d from "../Button/Button.js";
|
|
7
6
|
import { cn as x } from "../../packages/ui/src/lib/utils.js";
|
|
7
|
+
import d from "../Button/Button.js";
|
|
8
8
|
function V({
|
|
9
9
|
table: e,
|
|
10
10
|
children: s,
|