@vlrc-fe/components 1.0.6 → 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/Form/FormFileUpload/index.d.ts +1 -1
- package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -40
- 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/index184.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import e from "./index171.js";
|
|
2
|
+
import t from "./index183.js";
|
|
3
|
+
//#region src/Form/FormDatePicker/useFormDatePicker.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
let { pickerType: t = "date", showTime: n, dateFormat: r, rules: i = {}, onChangeDate: a, onChangeRange: o } = e, s = r || c(t, n), d = i.required !== void 0 && i.required !== !1;
|
|
6
|
+
return {
|
|
7
|
+
dateFormat: s,
|
|
8
|
+
isRequired: d,
|
|
9
|
+
processedRules: u(i, d),
|
|
10
|
+
handleRangeChange: (e, t) => {
|
|
11
|
+
e.onChange(t), o && o(t, [t[0] ? l(t[0], s) : "", t[1] ? l(t[1], s) : ""]);
|
|
12
|
+
},
|
|
13
|
+
handleSingleChange: (e, t) => {
|
|
14
|
+
e.onChange(t), a && a(t, t ? l(t, s) : "");
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var r = (e, t) => {
|
|
19
|
+
if (typeof e == "object") return e;
|
|
20
|
+
if (e === !0 || t === "time") return { showSecond: !0 };
|
|
21
|
+
}, i = (e, t) => {
|
|
22
|
+
if (t) return typeof t == "function" && e ? t(e) : t;
|
|
23
|
+
}, a = (e, t, n) => {
|
|
24
|
+
if (!e && !t) return "";
|
|
25
|
+
let r = e ? l(e, n) : "", i = t ? l(t, n) : "";
|
|
26
|
+
return r && i ? `${r} ~ ${i}` : r || "";
|
|
27
|
+
}, o = (e) => {
|
|
28
|
+
switch (e) {
|
|
29
|
+
case "small": return "h-8 text-xs";
|
|
30
|
+
case "large": return "h-12 text-base";
|
|
31
|
+
default: return "h-10 text-sm";
|
|
32
|
+
}
|
|
33
|
+
}, s = (e) => {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "error": return "border-destructive focus-visible:ring-destructive";
|
|
36
|
+
case "warning": return "border-yellow-500 focus-visible:ring-yellow-500";
|
|
37
|
+
default: return "";
|
|
38
|
+
}
|
|
39
|
+
}, c = (e, t) => e === "time" ? typeof t == "object" && t.format ? t.format : "HH:mm:ss" : e === "month" ? "MM/yyyy" : e === "year" ? "yyyy" : e === "datetime" || t ? typeof t == "object" && t.format ? `dd/MM/yyyy ${t.format}` : "dd/MM/yyyy HH:mm:ss" : "dd/MM/yyyy", l = (n, r) => {
|
|
40
|
+
if (!n || !e(n)) return "";
|
|
41
|
+
try {
|
|
42
|
+
return t(n, r);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
return console.warn("Error formatting date:", e), "";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function u(e = {}, t) {
|
|
48
|
+
let n = { ...e };
|
|
49
|
+
return t && typeof n.required != "string" && typeof n.required != "object" ? n.required = "Trường này là bắt buộc" : typeof n.required == "object" && !n.required.message && (n.required = {
|
|
50
|
+
...n.required,
|
|
51
|
+
message: "Trường này là bắt buộc"
|
|
52
|
+
}), n;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { i as buildDisabledTime, a as buildRangeDisplayValue, r as buildTimeConfig, l as formatDateValue, o as getSizeClassName, s as getStatusClassName, n as useFormDatePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index172.cjs"),t=require("./index184.cjs");function n(e){let{pickerType:t=`date`,showTime:n,dateFormat:r,rules:i={},onChangeDate:a,onChangeRange:o}=e,s=r||c(t,n),d=i.required!==void 0&&i.required!==!1;return{dateFormat:s,isRequired:d,processedRules:u(i,d),handleRangeChange:(e,t)=>{e.onChange(t),o&&o(t,[t[0]?l(t[0],s):``,t[1]?l(t[1],s):``])},handleSingleChange:(e,t)=>{e.onChange(t),a&&a(t,t?l(t,s):``)}}}var r=(e,t)=>{if(typeof e==`object`)return e;if(e===!0||t===`time`)return{showSecond:!0}},i=(e,t)=>{if(t)return typeof t==`function`&&e?t(e):t},a=(e,t,n)=>{if(!e&&!t)return``;let r=e?l(e,n):``,i=t?l(t,n):``;return r&&i?`${r} ~ ${i}`:r||``},o=e=>{switch(e){case`small`:return`h-8 text-xs`;case`large`:return`h-12 text-base`;default:return`h-10 text-sm`}},s=e=>{switch(e){case`error`:return`border-destructive focus-visible:ring-destructive`;case`warning`:return`border-yellow-500 focus-visible:ring-yellow-500`;default:return``}},c=(e,t)=>e===`time`?typeof t==`object`&&t.format?t.format:`HH:mm:ss`:e===`month`?`MM/yyyy`:e===`year`?`yyyy`:e===`datetime`||t?typeof t==`object`&&t.format?`dd/MM/yyyy ${t.format}`:`dd/MM/yyyy HH:mm:ss`:`dd/MM/yyyy`,l=(n,r)=>{if(!n||!e.default(n))return``;try{return t.default(n,r)}catch(e){return console.warn(`Error formatting date:`,e),``}};function u(e={},t){let n={...e};return t&&typeof n.required!=`string`&&typeof n.required!=`object`?n.required=`Trường này là bắt buộc`:typeof n.required==`object`&&!n.required.message&&(n.required={...n.required,message:`Trường này là bắt buộc`}),n}exports.buildDisabledTime=i,exports.buildRangeDisplayValue=a,exports.buildTimeConfig=r,exports.formatDateValue=l,exports.getSizeClassName=o,exports.getStatusClassName=s,exports.useFormDatePicker=n;
|
package/dist/index185.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { Button as t } from "./index10.js";
|
|
3
|
+
import { Calendar as n } from "./index21.js";
|
|
4
|
+
import { Popover as r, PopoverContent as i, PopoverTrigger as a } from "./index98.js";
|
|
5
|
+
import { Icons as o } from "./index134.js";
|
|
6
|
+
import s from "./index163.js";
|
|
7
|
+
import { buildRangeDisplayValue as c, getSizeClassName as l, getStatusClassName as u } from "./index184.js";
|
|
8
|
+
import d from "react";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
//#region src/Form/FormDatePicker/RangeDatePicker.tsx
|
|
11
|
+
function m({ value: m, onChange: h, placeholder: g = "Select Date Range", dateFormat: _, showTime: v, size: y = "large", status: b, width: x = "auto", disabled: S, allowClear: C, hideValue: w, suffixIcon: T, className: E, disabledDate: D }) {
|
|
12
|
+
let [O, k] = d.useState(!1), [A, j] = d.useState(!1), [M, N] = m, P = c(M, N, _);
|
|
13
|
+
return /* @__PURE__ */ p(r, {
|
|
14
|
+
open: O,
|
|
15
|
+
onOpenChange: (e) => {
|
|
16
|
+
k(e), e || j(!1);
|
|
17
|
+
},
|
|
18
|
+
children: [/* @__PURE__ */ f(a, {
|
|
19
|
+
asChild: !0,
|
|
20
|
+
children: /* @__PURE__ */ p(t, {
|
|
21
|
+
variant: "outline",
|
|
22
|
+
disabled: S,
|
|
23
|
+
className: e("justify-between font-normal", l(y), u(b), !P && "text-muted-foreground", x === "auto" ? "w-full" : "", E),
|
|
24
|
+
style: x === "auto" ? void 0 : { width: x },
|
|
25
|
+
children: [!w && P ? P : /* @__PURE__ */ f("span", { children: g }), /* @__PURE__ */ p("div", {
|
|
26
|
+
className: "ml-auto flex items-center gap-1",
|
|
27
|
+
children: [C && (M || N) && /* @__PURE__ */ f("span", {
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
e.stopPropagation(), h([void 0, void 0]), j(!1);
|
|
30
|
+
},
|
|
31
|
+
className: "hover:text-destructive cursor-pointer",
|
|
32
|
+
children: "×"
|
|
33
|
+
}), T || /* @__PURE__ */ f(o.CalendarIcon, { className: "h-4 w-4 opacity-50" })]
|
|
34
|
+
})]
|
|
35
|
+
})
|
|
36
|
+
}), /* @__PURE__ */ f(i, {
|
|
37
|
+
className: "w-auto p-0",
|
|
38
|
+
align: "start",
|
|
39
|
+
children: /* @__PURE__ */ f(n, {
|
|
40
|
+
mode: "single",
|
|
41
|
+
selected: A ? N : M,
|
|
42
|
+
onSelect: (e) => {
|
|
43
|
+
e && (!M || A ? M ? (h([e < M ? e : M, e < M ? M : e]), v || (k(!1), j(!1))) : (h([e, void 0]), j(!0)) : (h([e < M ? e : M, e < M ? M : e]), v || (k(!1), j(!1))));
|
|
44
|
+
},
|
|
45
|
+
disabled: D,
|
|
46
|
+
captionLayout: "dropdown",
|
|
47
|
+
hidden: { after: new Date((/* @__PURE__ */ new Date()).getFullYear() + 50, 11, 31) },
|
|
48
|
+
locale: s
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { m as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index11.cjs"),r=require("./index22.cjs"),i=require("./index99.cjs"),a=require("./index135.cjs"),o=require("./index164.cjs"),s=require("./index185.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");function u({value:e,onChange:u,placeholder:d=`Select Date Range`,dateFormat:f,showTime:p,size:m=`large`,status:h,width:g=`auto`,disabled:_,allowClear:v,hideValue:y,suffixIcon:b,className:x,disabledDate:S}){let[C,w]=c.default.useState(!1),[T,E]=c.default.useState(!1),[D,O]=e,k=s.buildRangeDisplayValue(D,O,f);return(0,l.jsxs)(i.Popover,{open:C,onOpenChange:e=>{w(e),e||E(!1)},children:[(0,l.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,l.jsxs)(n.Button,{variant:`outline`,disabled:_,className:t.cn(`justify-between font-normal`,s.getSizeClassName(m),s.getStatusClassName(h),!k&&`text-muted-foreground`,g===`auto`?`w-full`:``,x),style:g===`auto`?void 0:{width:g},children:[!y&&k?k:(0,l.jsx)(`span`,{children:d}),(0,l.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[v&&(D||O)&&(0,l.jsx)(`span`,{onClick:e=>{e.stopPropagation(),u([void 0,void 0]),E(!1)},className:`hover:text-destructive cursor-pointer`,children:`×`}),b||(0,l.jsx)(a.Icons.CalendarIcon,{className:`h-4 w-4 opacity-50`})]})]})}),(0,l.jsx)(i.PopoverContent,{className:`w-auto p-0`,align:`start`,children:(0,l.jsx)(r.Calendar,{mode:`single`,selected:T?O:D,onSelect:e=>{e&&(!D||T?D?(u([e<D?e:D,e<D?D:e]),p||(w(!1),E(!1))):(u([e,void 0]),E(!0)):(u([e<D?e:D,e<D?D:e]),p||(w(!1),E(!1))))},disabled:S,captionLayout:`dropdown`,hidden:{after:new Date(new Date().getFullYear()+50,11,31)},locale:o.default})})]})}exports.default=u;
|
package/dist/index186.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { Input as t } from "./index87.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/Form/FormDatePicker/TimeInput.tsx
|
|
6
|
+
function o({ value: o, onChange: s, timeConfig: c, className: l }) {
|
|
7
|
+
let u = c?.showHour !== !1, d = c?.showMinute !== !1, f = c?.showSecond ?? !1, p = o || /* @__PURE__ */ new Date(), m = p.getHours(), h = p.getMinutes(), g = p.getSeconds(), [_, v] = n.useState(m.toString().padStart(2, "0")), [y, b] = n.useState(h.toString().padStart(2, "0")), [x, S] = n.useState(g.toString().padStart(2, "0"));
|
|
8
|
+
n.useEffect(() => {
|
|
9
|
+
v(m.toString().padStart(2, "0")), b(h.toString().padStart(2, "0")), S(g.toString().padStart(2, "0"));
|
|
10
|
+
}, [
|
|
11
|
+
m,
|
|
12
|
+
h,
|
|
13
|
+
g
|
|
14
|
+
]);
|
|
15
|
+
let C = (e, t) => {
|
|
16
|
+
let n = parseInt(t, 10);
|
|
17
|
+
if (Number.isNaN(n)) return;
|
|
18
|
+
let r = 59;
|
|
19
|
+
if (e === "hour" && (r = 23), n < 0 || n > r) return;
|
|
20
|
+
let i = new Date(p);
|
|
21
|
+
e === "hour" ? i.setHours(n) : e === "minute" ? i.setMinutes(n) : i.setSeconds(n), s(i);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ a("div", {
|
|
24
|
+
className: e("flex items-center gap-1", l),
|
|
25
|
+
children: [
|
|
26
|
+
u && /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(t, {
|
|
27
|
+
type: "number",
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 23,
|
|
30
|
+
value: _,
|
|
31
|
+
onChange: (e) => v(e.target.value),
|
|
32
|
+
onBlur: (e) => C("hour", e.target.value),
|
|
33
|
+
className: "w-14 text-center"
|
|
34
|
+
}), (d || f) && /* @__PURE__ */ i("span", { children: ":" })] }),
|
|
35
|
+
d && /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(t, {
|
|
36
|
+
type: "number",
|
|
37
|
+
min: 0,
|
|
38
|
+
max: 59,
|
|
39
|
+
value: y,
|
|
40
|
+
onChange: (e) => b(e.target.value),
|
|
41
|
+
onBlur: (e) => C("minute", e.target.value),
|
|
42
|
+
className: "w-14 text-center"
|
|
43
|
+
}), f && /* @__PURE__ */ i("span", { children: ":" })] }),
|
|
44
|
+
f && /* @__PURE__ */ i(t, {
|
|
45
|
+
type: "number",
|
|
46
|
+
min: 0,
|
|
47
|
+
max: 59,
|
|
48
|
+
value: x,
|
|
49
|
+
onChange: (e) => S(e.target.value),
|
|
50
|
+
onBlur: (e) => C("second", e.target.value),
|
|
51
|
+
className: "w-14 text-center"
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { o as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index88.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({value:e,onChange:a,timeConfig:o,className:s}){let c=o?.showHour!==!1,l=o?.showMinute!==!1,u=o?.showSecond??!1,d=e||new Date,f=d.getHours(),p=d.getMinutes(),m=d.getSeconds(),[h,g]=r.default.useState(f.toString().padStart(2,`0`)),[_,v]=r.default.useState(p.toString().padStart(2,`0`)),[y,b]=r.default.useState(m.toString().padStart(2,`0`));r.default.useEffect(()=>{g(f.toString().padStart(2,`0`)),v(p.toString().padStart(2,`0`)),b(m.toString().padStart(2,`0`))},[f,p,m]);let x=(e,t)=>{let n=parseInt(t,10);if(Number.isNaN(n))return;let r=59;if(e===`hour`&&(r=23),n<0||n>r)return;let i=new Date(d);e===`hour`?i.setHours(n):e===`minute`?i.setMinutes(n):i.setSeconds(n),a(i)};return(0,i.jsxs)(`div`,{className:t.cn(`flex items-center gap-1`,s),children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Input,{type:`number`,min:0,max:23,value:h,onChange:e=>g(e.target.value),onBlur:e=>x(`hour`,e.target.value),className:`w-14 text-center`}),(l||u)&&(0,i.jsx)(`span`,{children:`:`})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Input,{type:`number`,min:0,max:59,value:_,onChange:e=>v(e.target.value),onBlur:e=>x(`minute`,e.target.value),className:`w-14 text-center`}),u&&(0,i.jsx)(`span`,{children:`:`})]}),u&&(0,i.jsx)(n.Input,{type:`number`,min:0,max:59,value:y,onChange:e=>b(e.target.value),onBlur:e=>x(`second`,e.target.value),className:`w-14 text-center`})]})}exports.default=a;
|
package/dist/index187.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { ScrollArea as t } from "./index103.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/Form/FormDatePicker/TimePicker.tsx
|
|
5
|
+
function i({ value: i, onChange: a, timeConfig: o, disabledTime: s }) {
|
|
6
|
+
let c = o?.showHour !== !1, l = o?.showMinute !== !1, u = o?.showSecond ?? !1, d = o?.hourStep ?? 1, f = o?.minuteStep ?? 1, p = o?.secondStep ?? 1, m = i || /* @__PURE__ */ new Date(), h = m.getHours(), g = m.getMinutes(), _ = m.getSeconds(), v = s?.disabledHours?.() || [], y = s?.disabledMinutes?.(h) || [], b = s?.disabledSeconds?.(h, g) || [], x = (e, t) => {
|
|
7
|
+
let n = new Date(m);
|
|
8
|
+
e === "hour" ? n.setHours(t) : e === "minute" ? n.setMinutes(t) : n.setSeconds(t), a(n);
|
|
9
|
+
}, S = (r, i, a, o, s) => {
|
|
10
|
+
let c = [];
|
|
11
|
+
for (let e = 0; e < i; e += a) c.push(e);
|
|
12
|
+
return /* @__PURE__ */ n(t, {
|
|
13
|
+
className: "h-60 w-16",
|
|
14
|
+
children: /* @__PURE__ */ n("div", {
|
|
15
|
+
className: "flex flex-col",
|
|
16
|
+
children: c.map((t) => {
|
|
17
|
+
let i = s.includes(t);
|
|
18
|
+
return /* @__PURE__ */ n("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
disabled: i,
|
|
21
|
+
onClick: () => x(r, t),
|
|
22
|
+
className: e("px-2 py-1 text-center hover:bg-accent transition-colors", o === t && "bg-primary text-primary-foreground hover:bg-primary/90", i && "opacity-50 cursor-not-allowed hover:bg-transparent"),
|
|
23
|
+
children: t.toString().padStart(2, "0")
|
|
24
|
+
}, t);
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ r("div", {
|
|
30
|
+
className: "flex gap-1 p-1",
|
|
31
|
+
children: [
|
|
32
|
+
c && /* @__PURE__ */ r("div", {
|
|
33
|
+
className: "flex flex-col items-center",
|
|
34
|
+
children: [/* @__PURE__ */ n("span", {
|
|
35
|
+
className: "text-xs font-medium mb-1",
|
|
36
|
+
children: "Giờ"
|
|
37
|
+
}), S("hour", 24, d, h, v)]
|
|
38
|
+
}),
|
|
39
|
+
l && /* @__PURE__ */ r("div", {
|
|
40
|
+
className: "flex flex-col items-center",
|
|
41
|
+
children: [/* @__PURE__ */ n("span", {
|
|
42
|
+
className: "text-xs font-medium mb-1",
|
|
43
|
+
children: "Phút"
|
|
44
|
+
}), S("minute", 60, f, g, y)]
|
|
45
|
+
}),
|
|
46
|
+
u && /* @__PURE__ */ r("div", {
|
|
47
|
+
className: "flex flex-col items-center",
|
|
48
|
+
children: [/* @__PURE__ */ n("span", {
|
|
49
|
+
className: "text-xs font-medium mb-1",
|
|
50
|
+
children: "Giây"
|
|
51
|
+
}), S("second", 60, p, _, b)]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { i as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index4.cjs"),t=require("./index104.cjs");let n=require("react/jsx-runtime");function r({value:r,onChange:i,timeConfig:a,disabledTime:o}){let s=a?.showHour!==!1,c=a?.showMinute!==!1,l=a?.showSecond??!1,u=a?.hourStep??1,d=a?.minuteStep??1,f=a?.secondStep??1,p=r||new Date,m=p.getHours(),h=p.getMinutes(),g=p.getSeconds(),_=o?.disabledHours?.()||[],v=o?.disabledMinutes?.(m)||[],y=o?.disabledSeconds?.(m,h)||[],b=(e,t)=>{let n=new Date(p);e===`hour`?n.setHours(t):e===`minute`?n.setMinutes(t):n.setSeconds(t),i(n)},x=(r,i,a,o,s)=>{let c=[];for(let e=0;e<i;e+=a)c.push(e);return(0,n.jsx)(t.ScrollArea,{className:`h-60 w-16`,children:(0,n.jsx)(`div`,{className:`flex flex-col`,children:c.map(t=>{let i=s.includes(t);return(0,n.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>b(r,t),className:e.cn(`px-2 py-1 text-center hover:bg-accent transition-colors`,o===t&&`bg-primary text-primary-foreground hover:bg-primary/90`,i&&`opacity-50 cursor-not-allowed hover:bg-transparent`),children:t.toString().padStart(2,`0`)},t)})})})};return(0,n.jsxs)(`div`,{className:`flex gap-1 p-1`,children:[s&&(0,n.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,n.jsx)(`span`,{className:`text-xs font-medium mb-1`,children:`Giờ`}),x(`hour`,24,u,m,_)]}),c&&(0,n.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,n.jsx)(`span`,{className:`text-xs font-medium mb-1`,children:`Phút`}),x(`minute`,60,d,h,v)]}),l&&(0,n.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,n.jsx)(`span`,{className:`text-xs font-medium mb-1`,children:`Giây`}),x(`second`,60,f,g,y)]})]})}exports.default=r;
|
package/dist/index188.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
import { Button as t } from "./index10.js";
|
|
3
|
+
import { Calendar as n } from "./index21.js";
|
|
4
|
+
import { Popover as r, PopoverContent as i, PopoverTrigger as a } from "./index98.js";
|
|
5
|
+
import o from "./index163.js";
|
|
6
|
+
import { buildDisabledTime as s, buildTimeConfig as c, formatDateValue as l, getSizeClassName as u, getStatusClassName as d } from "./index184.js";
|
|
7
|
+
import f from "./index186.js";
|
|
8
|
+
import p from "./index187.js";
|
|
9
|
+
import { CalendarIcon as m, Clock as h } from "lucide-react";
|
|
10
|
+
import g from "react";
|
|
11
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
//#region src/Form/FormDatePicker/SingleDatePicker.tsx
|
|
13
|
+
function y({ value: y, onChange: b, placeholder: x = "Select Date", pickerType: S, dateFormat: C, showTime: w, size: T = "large", status: E, width: D = "auto", disabled: O, allowClear: k, hideValue: A, suffixIcon: j, className: M, disabledDate: N, disabledTime: P }) {
|
|
14
|
+
let [F, I] = g.useState(!1), L = c(w, S), R = y ? l(y, C) : "", z = (e) => {
|
|
15
|
+
if (!e) {
|
|
16
|
+
b(void 0), (S === "date" || !w) && I(!1);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let t = e;
|
|
20
|
+
w && y && (t = new Date(e), t.setHours(y.getHours(), y.getMinutes(), y.getSeconds())), b(t), S === "date" && !w && I(!1);
|
|
21
|
+
}, B = (e) => {
|
|
22
|
+
b(e);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ v(r, {
|
|
25
|
+
open: F,
|
|
26
|
+
onOpenChange: I,
|
|
27
|
+
children: [/* @__PURE__ */ _(a, {
|
|
28
|
+
asChild: !0,
|
|
29
|
+
children: /* @__PURE__ */ v(t, {
|
|
30
|
+
variant: "outline",
|
|
31
|
+
disabled: O,
|
|
32
|
+
className: e("justify-between font-normal", u(T), d(E), !y && "text-muted-foreground", D === "auto" ? "w-full" : "", M),
|
|
33
|
+
style: D === "auto" ? void 0 : { width: D },
|
|
34
|
+
children: [!A && R ? R : /* @__PURE__ */ _("span", { children: x }), /* @__PURE__ */ v("div", {
|
|
35
|
+
className: "ml-auto flex items-center gap-1",
|
|
36
|
+
children: [k && y && /* @__PURE__ */ _("span", {
|
|
37
|
+
onClick: (e) => {
|
|
38
|
+
e.stopPropagation(), b(void 0);
|
|
39
|
+
},
|
|
40
|
+
className: "hover:text-destructive cursor-pointer",
|
|
41
|
+
children: "×"
|
|
42
|
+
}), j || _(S === "time" ? h : m, { className: "h-4 w-4 opacity-50" })]
|
|
43
|
+
})]
|
|
44
|
+
})
|
|
45
|
+
}), /* @__PURE__ */ _(i, {
|
|
46
|
+
className: "w-auto p-0",
|
|
47
|
+
align: "start",
|
|
48
|
+
children: S === "time" ? /* @__PURE__ */ v("div", {
|
|
49
|
+
className: "p-2",
|
|
50
|
+
children: [/* @__PURE__ */ _(p, {
|
|
51
|
+
value: y,
|
|
52
|
+
onChange: B,
|
|
53
|
+
timeConfig: L,
|
|
54
|
+
disabledTime: s(y, P)
|
|
55
|
+
}), /* @__PURE__ */ _("div", {
|
|
56
|
+
className: "mt-2 pt-2 border-t",
|
|
57
|
+
children: /* @__PURE__ */ _(f, {
|
|
58
|
+
value: y,
|
|
59
|
+
onChange: B,
|
|
60
|
+
timeConfig: L
|
|
61
|
+
})
|
|
62
|
+
})]
|
|
63
|
+
}) : /* @__PURE__ */ v("div", {
|
|
64
|
+
className: "flex",
|
|
65
|
+
children: [/* @__PURE__ */ _(n, {
|
|
66
|
+
mode: "single",
|
|
67
|
+
selected: y,
|
|
68
|
+
onSelect: z,
|
|
69
|
+
disabled: N,
|
|
70
|
+
captionLayout: "dropdown",
|
|
71
|
+
locale: o,
|
|
72
|
+
month: y,
|
|
73
|
+
hidden: { after: new Date((/* @__PURE__ */ new Date()).getFullYear() + 50, 11, 31) },
|
|
74
|
+
onMonthChange: (e) => {
|
|
75
|
+
S === "month" && (b(e), I(!1));
|
|
76
|
+
}
|
|
77
|
+
}), w && /* @__PURE__ */ _(p, {
|
|
78
|
+
value: y,
|
|
79
|
+
onChange: B,
|
|
80
|
+
timeConfig: L,
|
|
81
|
+
disabledTime: s(y, P)
|
|
82
|
+
})]
|
|
83
|
+
})
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { y as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index11.cjs"),r=require("./index22.cjs"),i=require("./index99.cjs"),a=require("./index164.cjs"),o=require("./index185.cjs"),s=require("./index187.cjs"),c=require("./index188.cjs");let l=require("lucide-react"),u=require("react");u=e.__toESM(u,1);let d=require("react/jsx-runtime");function f({value:e,onChange:f,placeholder:p=`Select Date`,pickerType:m,dateFormat:h,showTime:g,size:_=`large`,status:v,width:y=`auto`,disabled:b,allowClear:x,hideValue:S,suffixIcon:C,className:w,disabledDate:T,disabledTime:E}){let[D,O]=u.default.useState(!1),k=o.buildTimeConfig(g,m),A=e?o.formatDateValue(e,h):``,j=t=>{if(!t){f(void 0),(m===`date`||!g)&&O(!1);return}let n=t;g&&e&&(n=new Date(t),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds())),f(n),m===`date`&&!g&&O(!1)},M=e=>{f(e)};return(0,d.jsxs)(i.Popover,{open:D,onOpenChange:O,children:[(0,d.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,d.jsxs)(n.Button,{variant:`outline`,disabled:b,className:t.cn(`justify-between font-normal`,o.getSizeClassName(_),o.getStatusClassName(v),!e&&`text-muted-foreground`,y===`auto`?`w-full`:``,w),style:y===`auto`?void 0:{width:y},children:[!S&&A?A:(0,d.jsx)(`span`,{children:p}),(0,d.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[x&&e&&(0,d.jsx)(`span`,{onClick:e=>{e.stopPropagation(),f(void 0)},className:`hover:text-destructive cursor-pointer`,children:`×`}),C||(m===`time`?(0,d.jsx)(l.Clock,{className:`h-4 w-4 opacity-50`}):(0,d.jsx)(l.CalendarIcon,{className:`h-4 w-4 opacity-50`}))]})]})}),(0,d.jsx)(i.PopoverContent,{className:`w-auto p-0`,align:`start`,children:m===`time`?(0,d.jsxs)(`div`,{className:`p-2`,children:[(0,d.jsx)(c.default,{value:e,onChange:M,timeConfig:k,disabledTime:o.buildDisabledTime(e,E)}),(0,d.jsx)(`div`,{className:`mt-2 pt-2 border-t`,children:(0,d.jsx)(s.default,{value:e,onChange:M,timeConfig:k})})]}):(0,d.jsxs)(`div`,{className:`flex`,children:[(0,d.jsx)(r.Calendar,{mode:`single`,selected:e,onSelect:j,disabled:T,captionLayout:`dropdown`,locale:a.default,month:e,hidden:{after:new Date(new Date().getFullYear()+50,11,31)},onMonthChange:e=>{m===`month`&&(f(e),O(!1))}}),g&&(0,d.jsx)(c.default,{value:e,onChange:M,timeConfig:k,disabledTime:o.buildDisabledTime(e,E)})]})})]})}exports.default=f;
|
package/dist/index189.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FormControl as e, FormField as t, FormItem as n, FormLabel as r, FormMessage as i } from "./index84.js";
|
|
2
|
+
import { useFormDatePicker as a } from "./index184.js";
|
|
3
|
+
import o from "./index185.js";
|
|
4
|
+
import s from "./index188.js";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/Form/FormDatePicker/FormDatePicker.tsx
|
|
7
|
+
function u(u) {
|
|
8
|
+
let { control: d, name: f, label: p, placeholder: m, status: h, size: g = "large", width: _ = "auto", pickerType: v = "date", dateFormat: y, showTime: b, disabled: x = !1, hideValue: S = !1, allowClear: C = !1, isRangePicker: w = !1, onChangeDate: T, onChangeRange: E, rules: D = {}, hideErrorMessage: O = !1, suffixIcon: k, className: A, disabledDate: j, disabledTime: M } = u, { dateFormat: N, isRequired: P, processedRules: F, handleRangeChange: I, handleSingleChange: L } = a({
|
|
9
|
+
pickerType: v,
|
|
10
|
+
showTime: b,
|
|
11
|
+
dateFormat: y,
|
|
12
|
+
rules: D,
|
|
13
|
+
onChangeDate: T,
|
|
14
|
+
onChangeRange: E
|
|
15
|
+
}), R = (e) => /* @__PURE__ */ c(o, {
|
|
16
|
+
value: e.value || [void 0, void 0],
|
|
17
|
+
onChange: (t) => I(e, t),
|
|
18
|
+
placeholder: m,
|
|
19
|
+
dateFormat: N,
|
|
20
|
+
showTime: b,
|
|
21
|
+
size: g,
|
|
22
|
+
status: h,
|
|
23
|
+
width: _,
|
|
24
|
+
disabled: x,
|
|
25
|
+
allowClear: C,
|
|
26
|
+
hideValue: S,
|
|
27
|
+
suffixIcon: k,
|
|
28
|
+
className: A,
|
|
29
|
+
disabledDate: j
|
|
30
|
+
}), z = (e) => /* @__PURE__ */ c(s, {
|
|
31
|
+
value: e.value,
|
|
32
|
+
onChange: (t) => L(e, t),
|
|
33
|
+
placeholder: m,
|
|
34
|
+
pickerType: v,
|
|
35
|
+
dateFormat: N,
|
|
36
|
+
showTime: b,
|
|
37
|
+
size: g,
|
|
38
|
+
status: h,
|
|
39
|
+
width: _,
|
|
40
|
+
disabled: x,
|
|
41
|
+
allowClear: C,
|
|
42
|
+
hideValue: S,
|
|
43
|
+
suffixIcon: k,
|
|
44
|
+
className: A,
|
|
45
|
+
disabledDate: j,
|
|
46
|
+
disabledTime: M
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ c(t, {
|
|
49
|
+
control: d,
|
|
50
|
+
name: f,
|
|
51
|
+
rules: F,
|
|
52
|
+
render: ({ field: t }) => /* @__PURE__ */ l(n, {
|
|
53
|
+
className: "flex flex-col",
|
|
54
|
+
children: [
|
|
55
|
+
p && /* @__PURE__ */ l(r, { children: [p, P && /* @__PURE__ */ c("span", {
|
|
56
|
+
className: "text-destructive ml-1",
|
|
57
|
+
children: "*"
|
|
58
|
+
})] }),
|
|
59
|
+
/* @__PURE__ */ c(e, { children: w ? R(t) : z(t) }),
|
|
60
|
+
!O && /* @__PURE__ */ c(i, {})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { u as default };
|
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./
|
|
1
|
+
"use client";const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index18.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({className:e,...r}){return(0,i.jsx)(n.Avatar,{"data-slot":`avatar`,className:t.cn(`relative flex size-8 shrink-0 overflow-hidden rounded-full`,e),...r})}function o({className:e,...r}){return(0,i.jsx)(n.AvatarImage,{"data-slot":`avatar-image`,className:t.cn(`aspect-square size-full`,e),...r})}function s({className:e,...r}){return(0,i.jsx)(n.AvatarFallback,{"data-slot":`avatar-fallback`,className:t.cn(`bg-muted flex size-full items-center justify-center rounded-full`,e),...r})}exports.Avatar=a,exports.AvatarFallback=s,exports.AvatarImage=o;
|
package/dist/index19.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { cn as e } from "./index3.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { cva as n } from "class-variance-authority";
|
|
5
|
+
import { Slot as r } from "@radix-ui/react-slot";
|
|
6
|
+
//#region src/ui/badge.tsx
|
|
7
|
+
var i = n("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
10
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
11
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
12
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { variant: "default" }
|
|
15
|
+
});
|
|
16
|
+
function a({ className: n, variant: a, asChild: o = !1, ...s }) {
|
|
17
|
+
return /* @__PURE__ */ t(o ? r : "span", {
|
|
18
|
+
"data-slot": "badge",
|
|
19
|
+
className: e(i({ variant: a }), n),
|
|
20
|
+
...s
|
|
11
21
|
});
|
|
12
22
|
}
|
|
13
23
|
//#endregion
|
|
14
|
-
export {
|
|
24
|
+
export { a as Badge, i as badgeVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./index85.cjs"),t=require("./index185.cjs"),n=require("./index186.cjs"),r=require("./index189.cjs");let i=require("react/jsx-runtime");function a(a){let{control:o,name:s,label:c,placeholder:l,status:u,size:d=`large`,width:f=`auto`,pickerType:p=`date`,dateFormat:m,showTime:h,disabled:g=!1,hideValue:_=!1,allowClear:v=!1,isRangePicker:y=!1,onChangeDate:b,onChangeRange:x,rules:S={},hideErrorMessage:C=!1,suffixIcon:w,className:T,disabledDate:E,disabledTime:D}=a,{dateFormat:O,isRequired:k,processedRules:A,handleRangeChange:j,handleSingleChange:M}=t.useFormDatePicker({pickerType:p,showTime:h,dateFormat:m,rules:S,onChangeDate:b,onChangeRange:x}),N=e=>(0,i.jsx)(n.default,{value:e.value||[void 0,void 0],onChange:t=>j(e,t),placeholder:l,dateFormat:O,showTime:h,size:d,status:u,width:f,disabled:g,allowClear:v,hideValue:_,suffixIcon:w,className:T,disabledDate:E}),P=e=>(0,i.jsx)(r.default,{value:e.value,onChange:t=>M(e,t),placeholder:l,pickerType:p,dateFormat:O,showTime:h,size:d,status:u,width:f,disabled:g,allowClear:v,hideValue:_,suffixIcon:w,className:T,disabledDate:E,disabledTime:D});return(0,i.jsx)(e.FormField,{control:o,name:s,rules:A,render:({field:t})=>(0,i.jsxs)(e.FormItem,{className:`flex flex-col`,children:[c&&(0,i.jsxs)(e.FormLabel,{children:[c,k&&(0,i.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,i.jsx)(e.FormControl,{children:y?N(t):P(t)}),!C&&(0,i.jsx)(e.FormMessage,{})]})})}exports.default=a;
|