@vlrc-fe/components 1.0.7 → 1.0.8
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/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -41
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +46 -80
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +22 -60
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1147 -43
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +30 -64
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -147
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +93 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +80 -25
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +9 -50
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +30 -156
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +350 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +11 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +55 -60
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +430 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +36 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +28 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +14 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +156 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +19 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +67 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +118 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +36 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +13 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +44 -121
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +31 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +37 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +123 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +44 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +43 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +14 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +23 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +34 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +27 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +30 -12
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +26 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +157 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +34 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +46 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +142 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +125 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +26 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +88 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +221 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +166 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +8 -12
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +126 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +15 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +17 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +22 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +18 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +6 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +7 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +8 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +7 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +12 -112
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +7 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +9 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +69 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +11 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +202 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +124 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +20 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +69 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +32 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -726
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +11 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +280 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +157 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +20 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +10 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +14 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +8 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +8 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +11 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +10 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +79 -339
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +6 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +8 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +8 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +10 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +11 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +15 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +11 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +11 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +6 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +43 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +19 -66
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +382 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +40 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +23 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +59 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +55 -0
- package/dist/index185.cjs +1 -0
- package/dist/index185.js +54 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +57 -0
- package/dist/index187.cjs +1 -0
- package/dist/index187.js +57 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +88 -0
- package/dist/index189.cjs +1 -0
- package/dist/index189.js +66 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +18 -8
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +594 -0
- package/dist/index191.cjs +9 -0
- package/dist/index191.js +30 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +50 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +65 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +48 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +67 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +151 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +23 -0
- package/dist/index198.cjs +1 -0
- package/dist/index198.js +27 -0
- package/dist/index199.cjs +1 -0
- package/dist/index199.js +53 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +51 -98
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +161 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +16 -0
- package/dist/index202.cjs +1 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +81 -28
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +64 -14
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +25 -22
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1014 -33
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +22 -96
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +108 -25
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +15 -9
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +20 -66
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +81 -11
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +91 -29
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +14 -41
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +93 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +22 -62
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +84 -22
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +85 -33
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +407 -25
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +170 -25
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +28 -154
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +158 -33
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +104 -45
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +337 -140
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +96 -124
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +319 -23
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +205 -81
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +33 -220
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +161 -163
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +20 -125
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -14
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +167 -7
- package/dist/index5.js +26 -14
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +44 -15
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +15 -18
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -17
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -4
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +24 -6
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +66 -4
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +14 -5
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -8
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +50 -67
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +85 -46
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +6 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -199
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +13 -122
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +9 -30
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +3 -20
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +24 -66
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +68 -30
- package/dist/index67.cjs +38 -1
- package/dist/index67.js +3 -11
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +12 -279
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -155
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +29 -85
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +115 -19
- package/dist/index71.cjs +4 -1
- package/dist/index71.js +6 -9
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +12 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +539 -6
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +197 -6
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +120 -9
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +912 -8
- package/dist/index77.cjs +3 -1
- package/dist/index77.js +76 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +120 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -6
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +35 -62
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +14 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +113 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +725 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +346 -9
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +74 -9
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +148 -4
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +31 -42
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +12 -380
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +345 -37
- package/dist/index89.cjs +20 -1
- package/dist/index89.js +40 -18
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +85 -17
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +113 -56
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +272 -51
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +129 -50
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +13 -54
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -55
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +525 -80
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +75 -61
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +67 -583
- package/dist/index98.cjs +1 -9
- package/dist/index98.js +32 -27
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -49
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/carousel.d.ts +20 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/context-menu.d.ts +26 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/drawer.d.ts +14 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/index.d.ts +23 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +12 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts +27 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/pagination.d.ts +14 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/resizable.d.ts +9 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sidebar.d.ts +70 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/toggle-group.d.ts +8 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle.d.ts +10 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/package.json +23 -5
package/dist/index131.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { DataTablePagination as t } from "./index126.js";
|
|
3
|
+
import { DataTableTable as n } from "./index127.js";
|
|
4
|
+
import { DataTableToolbar as r } from "./index128.js";
|
|
5
|
+
import { DataTableViewOptions as ee } from "./index129.js";
|
|
6
|
+
import { DEFAULT_API as te, DEFAULT_EMPTY as ne, DEFAULT_INFINITE_SCROLL as re, DEFAULT_PAGINATION as ie, DEFAULT_SEARCH as ae, createDefaultActions as oe } from "./index130.js";
|
|
7
|
+
import { useEffect as i, useRef as se, useState as a } from "react";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import { clamp as ce, debounce as c } from "lodash-es";
|
|
10
|
+
import { useUpdateEffect as l } from "ahooks";
|
|
11
|
+
import { functionalUpdate as u, getCoreRowModel as le, getExpandedRowModel as ue, getFilteredRowModel as de, getPaginationRowModel as d, getSortedRowModel as f, useReactTable as p } from "@tanstack/react-table";
|
|
12
|
+
//#region src/DataTable/DataTable.tsx
|
|
13
|
+
var m = {
|
|
14
|
+
sorting: [],
|
|
15
|
+
columnFilters: [],
|
|
16
|
+
globalFilter: "",
|
|
17
|
+
columnVisibility: {},
|
|
18
|
+
rowSelection: {},
|
|
19
|
+
pagination: {
|
|
20
|
+
pageIndex: 0,
|
|
21
|
+
pageSize: 10
|
|
22
|
+
},
|
|
23
|
+
expanded: {}
|
|
24
|
+
}, h = () => ({
|
|
25
|
+
enabled: !1,
|
|
26
|
+
renderSubComponent: () => null,
|
|
27
|
+
getSubRows: () => []
|
|
28
|
+
}), g = () => null, _ = (e, t) => String(t), v = ({ data: v, columns: fe, initialState: y, empty: b, search: x, pagination: S, actions: C, api: w, infiniteScroll: T, expand: E, className: D, containerClassName: O, getRowId: k, renderToolbarRight: A }) => {
|
|
29
|
+
let j = y === void 0 ? m : y, M = b === void 0 ? ne : b, N = x === void 0 ? ae : x, P = S === void 0 ? ie : S, F = C === void 0 ? oe() : C, I = w === void 0 ? te : w, L = T === void 0 ? re : T, R = E === void 0 ? h() : E, z = k === void 0 ? _ : k, B = A === void 0 ? g : A, [V, pe] = a(j.sorting), [H, me] = a(j.columnFilters), [U, he] = a(j.globalFilter), [W, ge] = a(j.columnVisibility), [_e, ve] = a(j.rowSelection), [G, K] = a(j.pagination), [q, J] = a(j.expanded), Y = I.mode === "server", ye = Y && G.pageSize > 0 ? Math.ceil(I.totalRows / G.pageSize) : void 0, X = p({
|
|
30
|
+
data: v,
|
|
31
|
+
columns: fe,
|
|
32
|
+
state: {
|
|
33
|
+
sorting: V,
|
|
34
|
+
columnFilters: H,
|
|
35
|
+
globalFilter: U,
|
|
36
|
+
columnVisibility: W,
|
|
37
|
+
rowSelection: _e,
|
|
38
|
+
pagination: G,
|
|
39
|
+
expanded: q
|
|
40
|
+
},
|
|
41
|
+
manualSorting: Y,
|
|
42
|
+
manualFiltering: Y,
|
|
43
|
+
manualPagination: Y,
|
|
44
|
+
pageCount: ye,
|
|
45
|
+
meta: { getRowActions: F.getRowActions },
|
|
46
|
+
enableRowSelection: !0,
|
|
47
|
+
getRowId: (e, t, n) => z(e, t, n === void 0 ? null : n),
|
|
48
|
+
onSortingChange: (e) => pe((t) => u(e, t)),
|
|
49
|
+
onColumnFiltersChange: (e) => me((t) => u(e, t)),
|
|
50
|
+
onGlobalFilterChange: (e) => he((t) => u(e, t)),
|
|
51
|
+
onColumnVisibilityChange: (e) => ge((t) => u(e, t)),
|
|
52
|
+
onRowSelectionChange: (e) => ve((t) => u(e, t)),
|
|
53
|
+
onPaginationChange: (e) => K((t) => u(e, t)),
|
|
54
|
+
onExpandedChange: (e) => J((t) => u(e, t)),
|
|
55
|
+
getCoreRowModel: le(),
|
|
56
|
+
getSortedRowModel: Y ? void 0 : f(),
|
|
57
|
+
getFilteredRowModel: Y ? void 0 : de(),
|
|
58
|
+
getPaginationRowModel: Y ? void 0 : d(),
|
|
59
|
+
getExpandedRowModel: ue(),
|
|
60
|
+
getSubRows: R.enabled ? R.getSubRows : void 0,
|
|
61
|
+
getRowCanExpand: () => R.enabled
|
|
62
|
+
}), Z = {
|
|
63
|
+
sorting: V,
|
|
64
|
+
columnFilters: H,
|
|
65
|
+
globalFilter: U,
|
|
66
|
+
pagination: G
|
|
67
|
+
};
|
|
68
|
+
l(() => {
|
|
69
|
+
Y || K((e) => ({
|
|
70
|
+
...e,
|
|
71
|
+
pageIndex: 0
|
|
72
|
+
}));
|
|
73
|
+
}, [
|
|
74
|
+
Y,
|
|
75
|
+
U,
|
|
76
|
+
H,
|
|
77
|
+
V
|
|
78
|
+
]), i(() => {
|
|
79
|
+
if (Y) return;
|
|
80
|
+
let e = X.getFilteredRowModel().rows.length, t = G.pageSize, n = t > 0 ? Math.ceil(e / t) : 0, r = n === 0 ? 0 : n - 1;
|
|
81
|
+
K((e) => ({
|
|
82
|
+
...e,
|
|
83
|
+
pageIndex: ce(e.pageIndex, 0, r)
|
|
84
|
+
}));
|
|
85
|
+
}, [
|
|
86
|
+
Y,
|
|
87
|
+
G.pageSize,
|
|
88
|
+
X
|
|
89
|
+
]);
|
|
90
|
+
let Q = se(c((e) => {
|
|
91
|
+
I.onQueryChange(e);
|
|
92
|
+
}, N.debounceMs));
|
|
93
|
+
i(() => (Q.current = c((e) => {
|
|
94
|
+
I.onQueryChange(e);
|
|
95
|
+
}, N.debounceMs), () => {
|
|
96
|
+
Q.current.cancel();
|
|
97
|
+
}), [I, N.debounceMs]), l(() => {
|
|
98
|
+
if (I.mode === "server") return Q.current(Z), () => {
|
|
99
|
+
Q.current.cancel();
|
|
100
|
+
};
|
|
101
|
+
}, [Z, I]);
|
|
102
|
+
let [$, be] = a(null);
|
|
103
|
+
i(() => {
|
|
104
|
+
if (L.enabled === !1 || $ === null) return;
|
|
105
|
+
let e = () => {
|
|
106
|
+
if (I.isFetching) return;
|
|
107
|
+
let e = $.scrollTop;
|
|
108
|
+
$.scrollHeight - (e + $.clientHeight) <= L.thresholdPx && L.onEndReached(Z);
|
|
109
|
+
};
|
|
110
|
+
return $.addEventListener("scroll", e, { passive: !0 }), () => {
|
|
111
|
+
$.removeEventListener("scroll", e);
|
|
112
|
+
};
|
|
113
|
+
}, [
|
|
114
|
+
I.isFetching,
|
|
115
|
+
L,
|
|
116
|
+
Z,
|
|
117
|
+
$
|
|
118
|
+
]);
|
|
119
|
+
let xe = X.getVisibleLeafColumns().length;
|
|
120
|
+
return /* @__PURE__ */ s("div", {
|
|
121
|
+
className: e("w-full", D === void 0 ? "" : D),
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ o(r, {
|
|
124
|
+
table: X,
|
|
125
|
+
placeholder: N.placeholder,
|
|
126
|
+
debounceMs: N.debounceMs,
|
|
127
|
+
right: /* @__PURE__ */ s("div", {
|
|
128
|
+
className: "ml-auto flex items-center gap-2",
|
|
129
|
+
children: [B(X), /* @__PURE__ */ o(ee, {
|
|
130
|
+
table: X,
|
|
131
|
+
columnVisibility: W
|
|
132
|
+
})]
|
|
133
|
+
})
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ o("div", {
|
|
136
|
+
ref: (e) => be(e),
|
|
137
|
+
className: e(O === void 0 ? "overflow-auto" : O),
|
|
138
|
+
children: /* @__PURE__ */ o(n, {
|
|
139
|
+
table: X,
|
|
140
|
+
columnVisibility: W,
|
|
141
|
+
expandedState: q,
|
|
142
|
+
expandConfig: R,
|
|
143
|
+
empty: M,
|
|
144
|
+
columnsCount: xe
|
|
145
|
+
})
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ o(t, {
|
|
148
|
+
table: X,
|
|
149
|
+
tableState: X.getState(),
|
|
150
|
+
pageSizeOptions: P.pageSizeOptions,
|
|
151
|
+
apiConfig: I
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
//#endregion
|
|
157
|
+
export { v as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index4.cjs"),t=require("./index127.cjs"),n=require("./index128.cjs"),r=require("./index129.cjs"),ee=require("./index130.cjs"),i=require("./index131.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("lodash-es"),c=require("ahooks"),l=require("@tanstack/react-table");var u={sorting:[],columnFilters:[],globalFilter:``,columnVisibility:{},rowSelection:{},pagination:{pageIndex:0,pageSize:10},expanded:{}},te=()=>({enabled:!1,renderSubComponent:()=>null,getSubRows:()=>[]}),d=()=>null,ne=(e,t)=>String(t),f=({data:f,columns:p,initialState:m,empty:h,search:g,pagination:_,actions:v,api:y,infiniteScroll:b,expand:x,className:S,containerClassName:C,getRowId:w,renderToolbarRight:T})=>{let E=m===void 0?u:m,D=h===void 0?i.DEFAULT_EMPTY:h,O=g===void 0?i.DEFAULT_SEARCH:g,k=_===void 0?i.DEFAULT_PAGINATION:_,A=v===void 0?i.createDefaultActions():v,j=y===void 0?i.DEFAULT_API:y,M=b===void 0?i.DEFAULT_INFINITE_SCROLL:b,N=x===void 0?te():x,P=w===void 0?ne:w,re=T===void 0?d:T,[F,ie]=(0,a.useState)(E.sorting),[I,L]=(0,a.useState)(E.columnFilters),[R,z]=(0,a.useState)(E.globalFilter),[B,V]=(0,a.useState)(E.columnVisibility),[H,U]=(0,a.useState)(E.rowSelection),[W,G]=(0,a.useState)(E.pagination),[K,q]=(0,a.useState)(E.expanded),J=j.mode===`server`,Y=J&&W.pageSize>0?Math.ceil(j.totalRows/W.pageSize):void 0,X=(0,l.useReactTable)({data:f,columns:p,state:{sorting:F,columnFilters:I,globalFilter:R,columnVisibility:B,rowSelection:H,pagination:W,expanded:K},manualSorting:J,manualFiltering:J,manualPagination:J,pageCount:Y,meta:{getRowActions:A.getRowActions},enableRowSelection:!0,getRowId:(e,t,n)=>P(e,t,n===void 0?null:n),onSortingChange:e=>ie(t=>(0,l.functionalUpdate)(e,t)),onColumnFiltersChange:e=>L(t=>(0,l.functionalUpdate)(e,t)),onGlobalFilterChange:e=>z(t=>(0,l.functionalUpdate)(e,t)),onColumnVisibilityChange:e=>V(t=>(0,l.functionalUpdate)(e,t)),onRowSelectionChange:e=>U(t=>(0,l.functionalUpdate)(e,t)),onPaginationChange:e=>G(t=>(0,l.functionalUpdate)(e,t)),onExpandedChange:e=>q(t=>(0,l.functionalUpdate)(e,t)),getCoreRowModel:(0,l.getCoreRowModel)(),getSortedRowModel:J?void 0:(0,l.getSortedRowModel)(),getFilteredRowModel:J?void 0:(0,l.getFilteredRowModel)(),getPaginationRowModel:J?void 0:(0,l.getPaginationRowModel)(),getExpandedRowModel:(0,l.getExpandedRowModel)(),getSubRows:N.enabled?N.getSubRows:void 0,getRowCanExpand:()=>N.enabled}),Z={sorting:F,columnFilters:I,globalFilter:R,pagination:W};(0,c.useUpdateEffect)(()=>{J||G(e=>({...e,pageIndex:0}))},[J,R,I,F]),(0,a.useEffect)(()=>{if(J)return;let e=X.getFilteredRowModel().rows.length,t=W.pageSize,n=t>0?Math.ceil(e/t):0,r=n===0?0:n-1;G(e=>({...e,pageIndex:(0,s.clamp)(e.pageIndex,0,r)}))},[J,W.pageSize,X]);let Q=(0,a.useRef)((0,s.debounce)(e=>{j.onQueryChange(e)},O.debounceMs));(0,a.useEffect)(()=>(Q.current=(0,s.debounce)(e=>{j.onQueryChange(e)},O.debounceMs),()=>{Q.current.cancel()}),[j,O.debounceMs]),(0,c.useUpdateEffect)(()=>{if(j.mode===`server`)return Q.current(Z),()=>{Q.current.cancel()}},[Z,j]);let[$,ae]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(M.enabled===!1||$===null)return;let e=()=>{if(j.isFetching)return;let e=$.scrollTop;$.scrollHeight-(e+$.clientHeight)<=M.thresholdPx&&M.onEndReached(Z)};return $.addEventListener(`scroll`,e,{passive:!0}),()=>{$.removeEventListener(`scroll`,e)}},[j.isFetching,M,Z,$]);let oe=X.getVisibleLeafColumns().length;return(0,o.jsxs)(`div`,{className:e.cn(`w-full`,S===void 0?``:S),children:[(0,o.jsx)(r.DataTableToolbar,{table:X,placeholder:O.placeholder,debounceMs:O.debounceMs,right:(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[re(X),(0,o.jsx)(ee.DataTableViewOptions,{table:X,columnVisibility:B})]})}),(0,o.jsx)(`div`,{ref:e=>ae(e),className:e.cn(C===void 0?`overflow-auto`:C),children:(0,o.jsx)(n.DataTableTable,{table:X,columnVisibility:B,expandedState:K,expandConfig:N,empty:D,columnsCount:oe})}),(0,o.jsx)(t.DataTablePagination,{table:X,tableState:X.getState(),pageSizeOptions:k.pageSizeOptions,apiConfig:j})]})};exports.default=f;
|
package/dist/index132.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Button as e } from "./index10.js";
|
|
2
|
+
import { DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuLabel as i, DropdownMenuSeparator as a, DropdownMenuTrigger as o } from "./index78.js";
|
|
3
|
+
import { MoreHorizontal as s } from "lucide-react";
|
|
4
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { get as u, isEmpty as d, map as f } from "lodash-es";
|
|
6
|
+
import { useTranslation as p } from "react-i18next";
|
|
7
|
+
//#region src/DataTable/components/DataTableRowActions.tsx
|
|
8
|
+
var m = ({ row: m, table: h }) => {
|
|
9
|
+
let { t: g } = p(), _ = h.options.meta, v = u(_, "getRowActions"), y = v === void 0 ? [] : v(m);
|
|
10
|
+
return d(y) ? null : /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(o, {
|
|
11
|
+
asChild: !0,
|
|
12
|
+
children: /* @__PURE__ */ l(e, {
|
|
13
|
+
variant: "ghost",
|
|
14
|
+
className: "h-8 w-8 p-0",
|
|
15
|
+
children: [/* @__PURE__ */ c("span", {
|
|
16
|
+
className: "sr-only",
|
|
17
|
+
children: g("datatable_open_menu")
|
|
18
|
+
}), /* @__PURE__ */ c(s, {})]
|
|
19
|
+
})
|
|
20
|
+
}), /* @__PURE__ */ l(n, {
|
|
21
|
+
align: "end",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ c(i, { children: g("datatable_actions") }),
|
|
24
|
+
/* @__PURE__ */ c(a, {}),
|
|
25
|
+
f(y, (e) => /* @__PURE__ */ c(r, {
|
|
26
|
+
disabled: e.disabled,
|
|
27
|
+
onClick: () => e.onSelect(m),
|
|
28
|
+
children: e.label
|
|
29
|
+
}, e.id))
|
|
30
|
+
]
|
|
31
|
+
})] });
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { m as DataTableRowActions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index11.cjs"),t=require("./index79.cjs");let n=require("lucide-react"),r=require("react/jsx-runtime"),i=require("lodash-es"),a=require("react-i18next");var o=({row:o,table:s})=>{let{t:c}=(0,a.useTranslation)(),l=s.options.meta,u=(0,i.get)(l,`getRowActions`),d=u===void 0?[]:u(o);return(0,i.isEmpty)(d)?null:(0,r.jsxs)(t.DropdownMenu,{children:[(0,r.jsx)(t.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsxs)(e.Button,{variant:`ghost`,className:`h-8 w-8 p-0`,children:[(0,r.jsx)(`span`,{className:`sr-only`,children:c(`datatable_open_menu`)}),(0,r.jsx)(n.MoreHorizontal,{})]})}),(0,r.jsxs)(t.DropdownMenuContent,{align:`end`,children:[(0,r.jsx)(t.DropdownMenuLabel,{children:c(`datatable_actions`)}),(0,r.jsx)(t.DropdownMenuSeparator,{}),(0,i.map)(d,e=>(0,r.jsx)(t.DropdownMenuItem,{disabled:e.disabled,onClick:()=>e.onSelect(o),children:e.label},e.id))]})]})};exports.DataTableRowActions=o;
|
package/dist/index133.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Button as e } from "./index10.js";
|
|
2
|
+
import { Checkbox as t } from "./index27.js";
|
|
3
|
+
import { DataTableRowActions as n } from "./index132.js";
|
|
4
|
+
import { ChevronDown as r, ChevronRight as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/DataTable/render/createColumns.tsx
|
|
7
|
+
var s = () => ({
|
|
8
|
+
id: "select",
|
|
9
|
+
header: ({ table: e }) => /* @__PURE__ */ a(t, {
|
|
10
|
+
checked: e.getIsAllPageRowsSelected() || (e.getIsSomePageRowsSelected() ? "indeterminate" : !1),
|
|
11
|
+
onCheckedChange: (t) => e.toggleAllPageRowsSelected(!!t),
|
|
12
|
+
"aria-label": "Select all"
|
|
13
|
+
}),
|
|
14
|
+
cell: ({ row: e }) => /* @__PURE__ */ a(t, {
|
|
15
|
+
checked: e.getIsSelected(),
|
|
16
|
+
onCheckedChange: (t) => e.toggleSelected(!!t),
|
|
17
|
+
"aria-label": "Select row"
|
|
18
|
+
}),
|
|
19
|
+
enableSorting: !1,
|
|
20
|
+
enableHiding: !1
|
|
21
|
+
}), c = () => ({
|
|
22
|
+
id: "expand",
|
|
23
|
+
enableSorting: !1,
|
|
24
|
+
enableHiding: !1,
|
|
25
|
+
header: () => null,
|
|
26
|
+
cell: ({ row: e }) => /* @__PURE__ */ a(l, { row: e })
|
|
27
|
+
}), l = ({ row: t }) => t.getCanExpand() ? /* @__PURE__ */ o(e, {
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
size: "sm",
|
|
30
|
+
className: "h-8 w-8 p-0",
|
|
31
|
+
onClick: () => t.toggleExpanded(),
|
|
32
|
+
children: [/* @__PURE__ */ a("span", {
|
|
33
|
+
className: "sr-only",
|
|
34
|
+
children: "Toggle"
|
|
35
|
+
}), t.getIsExpanded() ? /* @__PURE__ */ a(r, {}) : /* @__PURE__ */ a(i, {})]
|
|
36
|
+
}) : null, u = () => ({
|
|
37
|
+
id: "actions",
|
|
38
|
+
enableHiding: !1,
|
|
39
|
+
header: () => null,
|
|
40
|
+
cell: ({ row: e, table: t }) => /* @__PURE__ */ a(n, {
|
|
41
|
+
row: e,
|
|
42
|
+
table: t
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { c as createExpanderColumn, u as createRowActionsColumn, s as createSelectionColumn };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index11.cjs"),t=require("./index28.cjs"),n=require("./index133.cjs");let r=require("lucide-react"),i=require("react/jsx-runtime");var a=()=>({id:`select`,header:({table:e})=>(0,i.jsx)(t.Checkbox,{checked:e.getIsAllPageRowsSelected()||(e.getIsSomePageRowsSelected()?`indeterminate`:!1),onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":`Select all`}),cell:({row:e})=>(0,i.jsx)(t.Checkbox,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":`Select row`}),enableSorting:!1,enableHiding:!1}),o=()=>({id:`expand`,enableSorting:!1,enableHiding:!1,header:()=>null,cell:({row:e})=>(0,i.jsx)(s,{row:e})}),s=({row:t})=>t.getCanExpand()?(0,i.jsxs)(e.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:()=>t.toggleExpanded(),children:[(0,i.jsx)(`span`,{className:`sr-only`,children:`Toggle`}),t.getIsExpanded()?(0,i.jsx)(r.ChevronDown,{}):(0,i.jsx)(r.ChevronRight,{})]}):null,c=()=>({id:`actions`,enableHiding:!1,header:()=>null,cell:({row:e,table:t})=>(0,i.jsx)(n.DataTableRowActions,{row:e,table:t})});exports.createExpanderColumn=o,exports.createRowActionsColumn=c,exports.createSelectionColumn=a;
|
package/dist/index134.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Activity as e, AlertCircle as ee, ArrowLeft as t, ArrowRight as te, Award as ne, BarChart3 as re, BookOpen as ie, Bot as n, Brain as r, Calendar as i, CalendarIcon as a, Camera as o, Cat as s, Check as c, CheckCircle2 as l, CheckIcon as u, ChevronDown as d, ChevronDownIcon as f, ChevronLeft as p, ChevronRight as m, ChevronUp as h, Circle as g, Clock as _, CloudUpload as v, Code as y, Copy as b, Cpu as x, Database as S, Dog as C, DollarSign as w, Edit as T, Eye as E, EyeOff as D, FileArchiveIcon as O, FileAudioIcon as k, FileCodeIcon as A, FileCogIcon as j, FileIcon as M, FileQuestion as N, FileTextIcon as P, FileVideoIcon as F, Fish as I, Flame as L, Folder as R, FolderHeart as z, FolderOpen as B, GitBranch as V, GitCommit as H, GitMerge as U, Globe as W, HardDrive as G, Headphones as K, Heart as q, History as J, Home as Y, Image as X, Info as ae, Languages as oe, Lightbulb as se, Loader2 as ce, LoaderCircleIcon as le, LoaderIcon as ue, LoaderPinwheelIcon as de, Mail as fe, Maximize as Z, MessageCircle as pe, MessageSquare as me, Mic as he, Minimize as ge, Monitor as _e, Moon as ve, MoonIcon as ye, MoreHorizontal as be, MoreVertical as xe, Palette as Se, PenTool as Ce, Pencil as we, Phone as Te, PhoneOff as Ee, PieChart as De, Play as Oe, Plus as ke, PlusCircle as Ae, Rabbit as je, RefreshCcw as Me, Save as Ne, Search as Pe, SearchIcon as Fe, Send as Ie, Settings as Le, Shield as Re, Smartphone as ze, Sparkles as Be, Square as Ve, Star as He, Sun as Ue, SunMedium as We, Tag as Ge, Target as Ke, Terminal as qe, Trash2 as Je, TrendingUp as Ye, Trophy as Xe, Turtle as Ze, Type as Qe, Undo2 as $e, Upload as et, UploadCloud as tt, User as nt, Users as rt, Video as it, Volume2 as at, Wand2 as ot, WandSparkles as Q, X as st, XCircle as ct, XIcon as lt, Zap as ut } from "lucide-react";
|
|
2
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
3
|
+
//#region src/Icons/Icons.tsx
|
|
4
|
+
var dt = {
|
|
5
|
+
MoonIcon: ye,
|
|
6
|
+
SunIcon: We,
|
|
7
|
+
Award: ne,
|
|
8
|
+
Cat: s,
|
|
9
|
+
Dog: C,
|
|
10
|
+
Fish: I,
|
|
11
|
+
Rabbit: je,
|
|
12
|
+
Turtle: Ze,
|
|
13
|
+
Code: y,
|
|
14
|
+
Globe: W,
|
|
15
|
+
Users: rt,
|
|
16
|
+
Star: He,
|
|
17
|
+
Heart: q,
|
|
18
|
+
Zap: ut,
|
|
19
|
+
Cpu: x,
|
|
20
|
+
Database: S,
|
|
21
|
+
Monitor: _e,
|
|
22
|
+
Smartphone: ze,
|
|
23
|
+
Wand: ot,
|
|
24
|
+
WandSparkles: Q,
|
|
25
|
+
Calendar: i,
|
|
26
|
+
CalendarIcon: a,
|
|
27
|
+
HardDrive: G,
|
|
28
|
+
TrendingUp: Ye,
|
|
29
|
+
DollarSign: w,
|
|
30
|
+
Target: Ke,
|
|
31
|
+
Shield: Re,
|
|
32
|
+
Mail: fe,
|
|
33
|
+
PieChart: De,
|
|
34
|
+
Activity: e,
|
|
35
|
+
Search: Pe,
|
|
36
|
+
SearchIcon: Fe,
|
|
37
|
+
MessageCircle: pe,
|
|
38
|
+
Bot: n,
|
|
39
|
+
MoreHorizontal: be,
|
|
40
|
+
MoreVertical: xe,
|
|
41
|
+
Maximize: Z,
|
|
42
|
+
Minimize: ge,
|
|
43
|
+
X: st,
|
|
44
|
+
XIcon: lt,
|
|
45
|
+
XCircle: ct,
|
|
46
|
+
EyeOff: D,
|
|
47
|
+
Eye: E,
|
|
48
|
+
Copy: b,
|
|
49
|
+
Check: c,
|
|
50
|
+
CheckIcon: u,
|
|
51
|
+
Clock: _,
|
|
52
|
+
ChevronUp: h,
|
|
53
|
+
ChevronDown: d,
|
|
54
|
+
ChevronDownIcon: f,
|
|
55
|
+
ChevronRight: m,
|
|
56
|
+
ChevronLeft: p,
|
|
57
|
+
Sparkles: Be,
|
|
58
|
+
WandSparklesIcon: Q,
|
|
59
|
+
Play: Oe,
|
|
60
|
+
Headphones: K,
|
|
61
|
+
Brain: r,
|
|
62
|
+
PenTool: Ce,
|
|
63
|
+
BookOpen: ie,
|
|
64
|
+
BarChart3: re,
|
|
65
|
+
CheckCircle2: l,
|
|
66
|
+
Moon: ve,
|
|
67
|
+
Sun: Ue,
|
|
68
|
+
CloudUpload: v,
|
|
69
|
+
LoaderCircleIcon: le,
|
|
70
|
+
LoaderIcon: ue,
|
|
71
|
+
LoaderPinwheelIcon: de,
|
|
72
|
+
FileArchiveIcon: O,
|
|
73
|
+
FileAudioIcon: k,
|
|
74
|
+
FileCodeIcon: A,
|
|
75
|
+
FileCogIcon: j,
|
|
76
|
+
FileIcon: M,
|
|
77
|
+
FileTextIcon: P,
|
|
78
|
+
FileVideoIcon: F,
|
|
79
|
+
Trophy: Xe,
|
|
80
|
+
Flame: L,
|
|
81
|
+
Undo2: $e,
|
|
82
|
+
Volume2: at,
|
|
83
|
+
ArrowRight: te,
|
|
84
|
+
ArrowLeft: t,
|
|
85
|
+
Plus: ke,
|
|
86
|
+
PlusCircle: Ae,
|
|
87
|
+
Info: ae,
|
|
88
|
+
Square: Ve,
|
|
89
|
+
Mic: he,
|
|
90
|
+
MessageSquare: me,
|
|
91
|
+
Phone: Te,
|
|
92
|
+
PhoneOff: Ee,
|
|
93
|
+
Circle: g,
|
|
94
|
+
Send: Ie,
|
|
95
|
+
Loader2: ce,
|
|
96
|
+
History: J,
|
|
97
|
+
Languages: oe,
|
|
98
|
+
Lightbulb: se,
|
|
99
|
+
FileQuestion: N,
|
|
100
|
+
Home: Y,
|
|
101
|
+
AlertCircle: ee,
|
|
102
|
+
RefreshCcw: Me,
|
|
103
|
+
Settings: Le,
|
|
104
|
+
Camera: o,
|
|
105
|
+
Folder: R,
|
|
106
|
+
Image: X,
|
|
107
|
+
Video: it,
|
|
108
|
+
Upload: et,
|
|
109
|
+
UploadCloud: tt,
|
|
110
|
+
Save: Ne,
|
|
111
|
+
Palette: Se,
|
|
112
|
+
Type: Qe,
|
|
113
|
+
Edit: T,
|
|
114
|
+
Pencil: we,
|
|
115
|
+
Tag: Ge,
|
|
116
|
+
Trash2: Je,
|
|
117
|
+
FolderHeart: z,
|
|
118
|
+
FolderOpen: B,
|
|
119
|
+
GitBranch: V,
|
|
120
|
+
GitMerge: U,
|
|
121
|
+
GitCommit: H,
|
|
122
|
+
User: nt,
|
|
123
|
+
Terminal: qe,
|
|
124
|
+
HomeIcon: Y,
|
|
125
|
+
ImageIcon: X,
|
|
126
|
+
GitHub: ({ ...e }) => /* @__PURE__ */ $("svg", {
|
|
127
|
+
"aria-hidden": "true",
|
|
128
|
+
focusable: "false",
|
|
129
|
+
"data-prefix": "fab",
|
|
130
|
+
"data-icon": "github",
|
|
131
|
+
role: "img",
|
|
132
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
133
|
+
viewBox: "0 0 496 512",
|
|
134
|
+
...e,
|
|
135
|
+
children: /* @__PURE__ */ $("path", {
|
|
136
|
+
fill: "currentColor",
|
|
137
|
+
d: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { dt as Icons };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("lucide-react"),t=require("react/jsx-runtime");var n={MoonIcon:e.MoonIcon,SunIcon:e.SunMedium,Award:e.Award,Cat:e.Cat,Dog:e.Dog,Fish:e.Fish,Rabbit:e.Rabbit,Turtle:e.Turtle,Code:e.Code,Globe:e.Globe,Users:e.Users,Star:e.Star,Heart:e.Heart,Zap:e.Zap,Cpu:e.Cpu,Database:e.Database,Monitor:e.Monitor,Smartphone:e.Smartphone,Wand:e.Wand2,WandSparkles:e.WandSparkles,Calendar:e.Calendar,CalendarIcon:e.CalendarIcon,HardDrive:e.HardDrive,TrendingUp:e.TrendingUp,DollarSign:e.DollarSign,Target:e.Target,Shield:e.Shield,Mail:e.Mail,PieChart:e.PieChart,Activity:e.Activity,Search:e.Search,SearchIcon:e.SearchIcon,MessageCircle:e.MessageCircle,Bot:e.Bot,MoreHorizontal:e.MoreHorizontal,MoreVertical:e.MoreVertical,Maximize:e.Maximize,Minimize:e.Minimize,X:e.X,XIcon:e.XIcon,XCircle:e.XCircle,EyeOff:e.EyeOff,Eye:e.Eye,Copy:e.Copy,Check:e.Check,CheckIcon:e.CheckIcon,Clock:e.Clock,ChevronUp:e.ChevronUp,ChevronDown:e.ChevronDown,ChevronDownIcon:e.ChevronDownIcon,ChevronRight:e.ChevronRight,ChevronLeft:e.ChevronLeft,Sparkles:e.Sparkles,WandSparklesIcon:e.WandSparkles,Play:e.Play,Headphones:e.Headphones,Brain:e.Brain,PenTool:e.PenTool,BookOpen:e.BookOpen,BarChart3:e.BarChart3,CheckCircle2:e.CheckCircle2,Moon:e.Moon,Sun:e.Sun,CloudUpload:e.CloudUpload,LoaderCircleIcon:e.LoaderCircleIcon,LoaderIcon:e.LoaderIcon,LoaderPinwheelIcon:e.LoaderPinwheelIcon,FileArchiveIcon:e.FileArchiveIcon,FileAudioIcon:e.FileAudioIcon,FileCodeIcon:e.FileCodeIcon,FileCogIcon:e.FileCogIcon,FileIcon:e.FileIcon,FileTextIcon:e.FileTextIcon,FileVideoIcon:e.FileVideoIcon,Trophy:e.Trophy,Flame:e.Flame,Undo2:e.Undo2,Volume2:e.Volume2,ArrowRight:e.ArrowRight,ArrowLeft:e.ArrowLeft,Plus:e.Plus,PlusCircle:e.PlusCircle,Info:e.Info,Square:e.Square,Mic:e.Mic,MessageSquare:e.MessageSquare,Phone:e.Phone,PhoneOff:e.PhoneOff,Circle:e.Circle,Send:e.Send,Loader2:e.Loader2,History:e.History,Languages:e.Languages,Lightbulb:e.Lightbulb,FileQuestion:e.FileQuestion,Home:e.Home,AlertCircle:e.AlertCircle,RefreshCcw:e.RefreshCcw,Settings:e.Settings,Camera:e.Camera,Folder:e.Folder,Image:e.Image,Video:e.Video,Upload:e.Upload,UploadCloud:e.UploadCloud,Save:e.Save,Palette:e.Palette,Type:e.Type,Edit:e.Edit,Pencil:e.Pencil,Tag:e.Tag,Trash2:e.Trash2,FolderHeart:e.FolderHeart,FolderOpen:e.FolderOpen,GitBranch:e.GitBranch,GitMerge:e.GitMerge,GitCommit:e.GitCommit,User:e.User,Terminal:e.Terminal,HomeIcon:e.Home,ImageIcon:e.Image,GitHub:({...e})=>(0,t.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,"data-prefix":`fab`,"data-icon":`github`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 496 512`,...e,children:(0,t.jsx)(`path`,{fill:`currentColor`,d:`M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z`})})};exports.Icons=n;
|
package/dist/index135.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { Button as t } from "./index10.js";
|
|
3
|
+
import { Checkbox as n } from "./index27.js";
|
|
4
|
+
import { Field as r, FieldContent as i, FieldDescription as a, FieldError as o, FieldLabel as s } from "./index81.js";
|
|
5
|
+
import { Controller as c } from "./index83.js";
|
|
6
|
+
import { Input as l } from "./index87.js";
|
|
7
|
+
import { Select as u, SelectContent as d, SelectTrigger as f, SelectValue as p } from "./index104.js";
|
|
8
|
+
import { Textarea as m } from "./index119.js";
|
|
9
|
+
import { Icons as h } from "./index134.js";
|
|
10
|
+
import { useState as g } from "react";
|
|
11
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
//#region src/Form/Form.tsx
|
|
13
|
+
var b = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, x = /^(0|\+84)(3|5|7|8|9)[0-9]{8}$/, S = (e, t) => {
|
|
14
|
+
let n = e.toLowerCase();
|
|
15
|
+
if (t === "password") return n.includes("confirm") || n.includes("new") ? "new-password" : "current-password";
|
|
16
|
+
if (t === "email" || n.includes("email")) return "email";
|
|
17
|
+
if (t === "tel" || n.includes("phone")) return "tel";
|
|
18
|
+
if (n.includes("name")) return "name";
|
|
19
|
+
if (n.includes("username")) return "username";
|
|
20
|
+
};
|
|
21
|
+
function C({ children: e, label: t, control: n, name: l, htmlType: u, description: d, controlFirst: f, horizontal: p, rules: m, className: h }) {
|
|
22
|
+
return /* @__PURE__ */ v(c, {
|
|
23
|
+
control: n,
|
|
24
|
+
name: l,
|
|
25
|
+
rules: (() => {
|
|
26
|
+
let e = { ...m };
|
|
27
|
+
return u === "email" && !m?.pattern && (e.pattern = {
|
|
28
|
+
value: b,
|
|
29
|
+
message: "Email không hợp lệ"
|
|
30
|
+
}), u === "tel" && !m?.pattern && (e.pattern = {
|
|
31
|
+
value: x,
|
|
32
|
+
message: "Số điện thoại không hợp lệ"
|
|
33
|
+
}), m?.required !== void 0 && m.required !== !1 && (typeof m.required == "string" ? e.required = m.required : typeof m.required == "object" ? m.required.message || (e.required = {
|
|
34
|
+
...m.required,
|
|
35
|
+
message: "Trường này là bắt buộc"
|
|
36
|
+
}) : e.required = "Trường này là bắt buộc"), e;
|
|
37
|
+
})(),
|
|
38
|
+
render: ({ field: n, fieldState: c }) => {
|
|
39
|
+
let l = /* @__PURE__ */ y(_, { children: [t && /* @__PURE__ */ y(s, {
|
|
40
|
+
htmlFor: n.name,
|
|
41
|
+
children: [t, m?.required && /* @__PURE__ */ v("span", {
|
|
42
|
+
className: "text-red-500 ml-1",
|
|
43
|
+
children: "*"
|
|
44
|
+
})]
|
|
45
|
+
}), d && /* @__PURE__ */ v(a, { children: d })] }), u = e({
|
|
46
|
+
...n,
|
|
47
|
+
id: n.name,
|
|
48
|
+
"aria-invalid": c.invalid
|
|
49
|
+
}), g = c.invalid && /* @__PURE__ */ v(o, { errors: [c.error] });
|
|
50
|
+
return /* @__PURE__ */ v(r, {
|
|
51
|
+
className: h,
|
|
52
|
+
"data-invalid": c.invalid,
|
|
53
|
+
orientation: p ? "horizontal" : void 0,
|
|
54
|
+
children: f ? /* @__PURE__ */ y(_, { children: [u, /* @__PURE__ */ y(i, { children: [l, g] })] }) : /* @__PURE__ */ y(_, { children: [
|
|
55
|
+
/* @__PURE__ */ v(i, { children: l }),
|
|
56
|
+
u,
|
|
57
|
+
g
|
|
58
|
+
] })
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
var w = ({ placeholder: n, inputClassName: r, leftIcon: i, rightIcon: a, disabled: o, autoComplete: s, ...c }) => {
|
|
64
|
+
let [u, d] = g(!1), f = c.htmlType === "password", p = s ?? S(String(c.name), c.htmlType);
|
|
65
|
+
return /* @__PURE__ */ v(C, {
|
|
66
|
+
...c,
|
|
67
|
+
children: (s) => /* @__PURE__ */ y("div", {
|
|
68
|
+
className: "relative",
|
|
69
|
+
children: [
|
|
70
|
+
i && /* @__PURE__ */ v("div", {
|
|
71
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",
|
|
72
|
+
children: i
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ v(l, {
|
|
75
|
+
...s,
|
|
76
|
+
type: f && u ? "text" : c.htmlType,
|
|
77
|
+
autoComplete: p,
|
|
78
|
+
placeholder: n,
|
|
79
|
+
disabled: o,
|
|
80
|
+
className: e(i && "pl-10", (f || a) && "pr-10", r)
|
|
81
|
+
}),
|
|
82
|
+
f && /* @__PURE__ */ v(t, {
|
|
83
|
+
type: "button",
|
|
84
|
+
variant: "ghost",
|
|
85
|
+
size: "icon-sm",
|
|
86
|
+
onClick: () => d(!u),
|
|
87
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
children: v(u ? h.EyeOff : h.Eye, { className: "h-4 w-4" })
|
|
90
|
+
}),
|
|
91
|
+
!f && a && /* @__PURE__ */ v("div", {
|
|
92
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",
|
|
93
|
+
children: a
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}, T = (e) => /* @__PURE__ */ v(C, {
|
|
99
|
+
...e,
|
|
100
|
+
children: (e) => /* @__PURE__ */ v(m, { ...e })
|
|
101
|
+
}), E = ({ children: e, ...t }) => /* @__PURE__ */ v(C, {
|
|
102
|
+
...t,
|
|
103
|
+
children: ({ onChange: t, onBlur: n, ...r }) => /* @__PURE__ */ y(u, {
|
|
104
|
+
...r,
|
|
105
|
+
onValueChange: t,
|
|
106
|
+
children: [/* @__PURE__ */ v(f, {
|
|
107
|
+
"aria-invalid": r["aria-invalid"],
|
|
108
|
+
id: r.id,
|
|
109
|
+
onBlur: n,
|
|
110
|
+
children: /* @__PURE__ */ v(p, {})
|
|
111
|
+
}), /* @__PURE__ */ v(d, { children: e })]
|
|
112
|
+
})
|
|
113
|
+
}), D = ({ disabled: e, ...t }) => /* @__PURE__ */ v(C, {
|
|
114
|
+
...t,
|
|
115
|
+
horizontal: !0,
|
|
116
|
+
controlFirst: !0,
|
|
117
|
+
children: ({ onChange: t, value: r, ...i }) => /* @__PURE__ */ v(n, {
|
|
118
|
+
...i,
|
|
119
|
+
checked: r,
|
|
120
|
+
onCheckedChange: t,
|
|
121
|
+
disabled: e
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
export { C as FormBase, D as FormCheckbox, w as FormInput, E as FormSimpleSelect, T as FormTextarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index4.cjs"),t=require("./index11.cjs"),n=require("./index28.cjs"),r=require("./index82.cjs"),i=require("./index84.cjs"),a=require("./index88.cjs"),o=require("./index105.cjs"),s=require("./index120.cjs"),c=require("./index135.cjs");let l=require("react"),u=require("react/jsx-runtime");var d=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,f=/^(0|\+84)(3|5|7|8|9)[0-9]{8}$/,p=(e,t)=>{let n=e.toLowerCase();if(t===`password`)return n.includes(`confirm`)||n.includes(`new`)?`new-password`:`current-password`;if(t===`email`||n.includes(`email`))return`email`;if(t===`tel`||n.includes(`phone`))return`tel`;if(n.includes(`name`))return`name`;if(n.includes(`username`))return`username`};function m({children:e,label:t,control:n,name:a,htmlType:o,description:s,controlFirst:c,horizontal:l,rules:p,className:m}){return(0,u.jsx)(i.Controller,{control:n,name:a,rules:(()=>{let e={...p};return o===`email`&&!p?.pattern&&(e.pattern={value:d,message:`Email không hợp lệ`}),o===`tel`&&!p?.pattern&&(e.pattern={value:f,message:`Số điện thoại không hợp lệ`}),p?.required!==void 0&&p.required!==!1&&(typeof p.required==`string`?e.required=p.required:typeof p.required==`object`?p.required.message||(e.required={...p.required,message:`Trường này là bắt buộc`}):e.required=`Trường này là bắt buộc`),e})(),render:({field:n,fieldState:i})=>{let a=(0,u.jsxs)(u.Fragment,{children:[t&&(0,u.jsxs)(r.FieldLabel,{htmlFor:n.name,children:[t,p?.required&&(0,u.jsx)(`span`,{className:`text-red-500 ml-1`,children:`*`})]}),s&&(0,u.jsx)(r.FieldDescription,{children:s})]}),o=e({...n,id:n.name,"aria-invalid":i.invalid}),d=i.invalid&&(0,u.jsx)(r.FieldError,{errors:[i.error]});return(0,u.jsx)(r.Field,{className:m,"data-invalid":i.invalid,orientation:l?`horizontal`:void 0,children:c?(0,u.jsxs)(u.Fragment,{children:[o,(0,u.jsxs)(r.FieldContent,{children:[a,d]})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(r.FieldContent,{children:a}),o,d]})})}})}var h=({placeholder:n,inputClassName:r,leftIcon:i,rightIcon:o,disabled:s,autoComplete:d,...f})=>{let[h,g]=(0,l.useState)(!1),_=f.htmlType===`password`,v=d??p(String(f.name),f.htmlType);return(0,u.jsx)(m,{...f,children:l=>(0,u.jsxs)(`div`,{className:`relative`,children:[i&&(0,u.jsx)(`div`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none`,children:i}),(0,u.jsx)(a.Input,{...l,type:_&&h?`text`:f.htmlType,autoComplete:v,placeholder:n,disabled:s,className:e.cn(i&&`pl-10`,(_||o)&&`pr-10`,r)}),_&&(0,u.jsx)(t.Button,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>g(!h),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,tabIndex:-1,children:h?(0,u.jsx)(c.Icons.EyeOff,{className:`h-4 w-4`}):(0,u.jsx)(c.Icons.Eye,{className:`h-4 w-4`})}),!_&&o&&(0,u.jsx)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none`,children:o})]})})},g=e=>(0,u.jsx)(m,{...e,children:e=>(0,u.jsx)(s.Textarea,{...e})}),_=({children:e,...t})=>(0,u.jsx)(m,{...t,children:({onChange:t,onBlur:n,...r})=>(0,u.jsxs)(o.Select,{...r,onValueChange:t,children:[(0,u.jsx)(o.SelectTrigger,{"aria-invalid":r[`aria-invalid`],id:r.id,onBlur:n,children:(0,u.jsx)(o.SelectValue,{})}),(0,u.jsx)(o.SelectContent,{children:e})]})}),v=({disabled:e,...t})=>(0,u.jsx)(m,{...t,horizontal:!0,controlFirst:!0,children:({onChange:t,value:r,...i})=>(0,u.jsx)(n.Checkbox,{...i,checked:r,onCheckedChange:t,disabled:e})});exports.FormBase=m,exports.FormCheckbox=v,exports.FormInput=h,exports.FormSimpleSelect=_,exports.FormTextarea=g;
|
package/dist/index136.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
//#region src/MultiSelect/type.ts
|
|
3
|
+
var t = e("m-1 transition-all duration-300 ease-in-out", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
default: "border-foreground/10 text-foreground bg-card hover:bg-card/80",
|
|
7
|
+
secondary: "border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
8
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
9
|
+
inverted: "inverted"
|
|
10
|
+
},
|
|
11
|
+
badgeAnimation: {
|
|
12
|
+
bounce: "hover:-translate-y-1 hover:scale-110",
|
|
13
|
+
pulse: "hover:animate-pulse",
|
|
14
|
+
wiggle: "hover:animate-wiggle",
|
|
15
|
+
fade: "hover:opacity-80",
|
|
16
|
+
slide: "hover:translate-x-1",
|
|
17
|
+
none: ""
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
badgeAnimation: "bounce"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as multiSelectVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=(0,require("class-variance-authority").cva)(`m-1 transition-all duration-300 ease-in-out`,{variants:{variant:{default:`border-foreground/10 text-foreground bg-card hover:bg-card/80`,secondary:`border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,inverted:`inverted`},badgeAnimation:{bounce:`hover:-translate-y-1 hover:scale-110`,pulse:`hover:animate-pulse`,wiggle:`hover:animate-wiggle`,fade:`hover:opacity-80`,slide:`hover:translate-x-1`,none:``}},defaultVariants:{variant:`default`,badgeAnimation:`bounce`}});exports.multiSelectVariants=e;
|
package/dist/index137.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region src/MultiSelect/utils.ts
|
|
2
|
+
var e = (e) => Array.isArray(e) && e.length > 0 && "heading" in e[0], t = (e, t) => {
|
|
3
|
+
if (e.length !== t.length) return !1;
|
|
4
|
+
let n = [...e].sort(), r = [...t].sort();
|
|
5
|
+
return n.every((e, t) => e === r[t]);
|
|
6
|
+
}, n = (t, n) => {
|
|
7
|
+
if (t.length === 0) return {
|
|
8
|
+
options: [],
|
|
9
|
+
duplicates: []
|
|
10
|
+
};
|
|
11
|
+
let r = e(t) ? t.flatMap((e) => e.options) : t, i = /* @__PURE__ */ new Set(), a = [], o = [];
|
|
12
|
+
return r.forEach((e) => {
|
|
13
|
+
i.has(e.value) ? (a.push(e.value), n || o.push(e)) : (i.add(e.value), o.push(e));
|
|
14
|
+
}), {
|
|
15
|
+
options: n ? o : r,
|
|
16
|
+
duplicates: a
|
|
17
|
+
};
|
|
18
|
+
}, r = (e, t, n) => {
|
|
19
|
+
if (!e) return {
|
|
20
|
+
maxCount: t,
|
|
21
|
+
hideIcons: !1,
|
|
22
|
+
compactMode: !1
|
|
23
|
+
};
|
|
24
|
+
if (e === !0) {
|
|
25
|
+
let e = {
|
|
26
|
+
mobile: {
|
|
27
|
+
maxCount: 2,
|
|
28
|
+
hideIcons: !1,
|
|
29
|
+
compactMode: !0
|
|
30
|
+
},
|
|
31
|
+
tablet: {
|
|
32
|
+
maxCount: 4,
|
|
33
|
+
hideIcons: !1,
|
|
34
|
+
compactMode: !1
|
|
35
|
+
},
|
|
36
|
+
desktop: {
|
|
37
|
+
maxCount: 6,
|
|
38
|
+
hideIcons: !1,
|
|
39
|
+
compactMode: !1
|
|
40
|
+
}
|
|
41
|
+
}[n];
|
|
42
|
+
return {
|
|
43
|
+
maxCount: e?.maxCount ?? t,
|
|
44
|
+
hideIcons: e?.hideIcons ?? !1,
|
|
45
|
+
compactMode: e?.compactMode ?? !1
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
let r = e[n];
|
|
49
|
+
return {
|
|
50
|
+
maxCount: r?.maxCount ?? t,
|
|
51
|
+
hideIcons: r?.hideIcons ?? !1,
|
|
52
|
+
compactMode: r?.compactMode ?? !1
|
|
53
|
+
};
|
|
54
|
+
}, i = (e, t) => {
|
|
55
|
+
if (t?.badgeAnimation) switch (t.badgeAnimation) {
|
|
56
|
+
case "bounce": return e ? "animate-bounce" : "hover:-translate-y-1 hover:scale-110";
|
|
57
|
+
case "pulse": return "hover:animate-pulse";
|
|
58
|
+
case "wiggle": return "hover:animate-wiggle";
|
|
59
|
+
case "fade": return "hover:opacity-80";
|
|
60
|
+
case "slide": return "hover:translate-x-1";
|
|
61
|
+
case "none": return "";
|
|
62
|
+
default: return "";
|
|
63
|
+
}
|
|
64
|
+
return e ? "animate-bounce" : "";
|
|
65
|
+
}, a = (e) => {
|
|
66
|
+
if (e?.popoverAnimation) switch (e.popoverAnimation) {
|
|
67
|
+
case "scale": return "animate-scaleIn";
|
|
68
|
+
case "slide": return "animate-slideInDown";
|
|
69
|
+
case "fade": return "animate-fadeIn";
|
|
70
|
+
case "flip": return "animate-flipIn";
|
|
71
|
+
case "none": return "";
|
|
72
|
+
default: return "";
|
|
73
|
+
}
|
|
74
|
+
return "";
|
|
75
|
+
}, o = (t, n, r) => !r || !n ? t : t.length === 0 ? [] : e(t) ? t.map((e) => ({
|
|
76
|
+
...e,
|
|
77
|
+
options: e.options.filter((e) => e.label.toLowerCase().includes(n.toLowerCase()) || e.value.toLowerCase().includes(n.toLowerCase()))
|
|
78
|
+
})).filter((e) => e.options.length > 0) : t.filter((e) => e.label.toLowerCase().includes(n.toLowerCase()) || e.value.toLowerCase().includes(n.toLowerCase())), s = (e, t, n, r) => ({
|
|
79
|
+
minWidth: n || (e === "mobile" ? "0px" : "200px"),
|
|
80
|
+
maxWidth: r || "100%",
|
|
81
|
+
width: t ? "auto" : "100%"
|
|
82
|
+
}), c = (e, t) => {
|
|
83
|
+
if (!t) return e.length;
|
|
84
|
+
let n = t.toLowerCase();
|
|
85
|
+
return e.filter((e) => e.label.toLowerCase().includes(n) || e.value.toLowerCase().includes(n)).length;
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { t as arraysEqual, n as buildAllOptions, i as buildBadgeAnimationClass, a as buildPopoverAnimationClass, s as buildWidthConstraints, r as computeResponsiveSettings, c as countMatchingOptions, o as filterOptions, e as isGroupedOptions };
|