impact-nova 1.5.14 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +4 -1
- package/dist/components/ui/accordion.js +28 -22
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/checkbox-display-renderer.js +12 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +30 -30
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +16 -16
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +17 -17
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +2 -2
- package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +11 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +8 -8
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.js +14 -14
- package/dist/components/ui/ag-grid-react/cell-renderers/switch-display-renderer.js +18 -18
- package/dist/components/ui/ag-grid-react/cell-renderers/textarea-display-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +14 -14
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +35 -35
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +49 -49
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +29 -29
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +9 -9
- package/dist/components/ui/ag-grid-react/headers/components/section-renderers.js +20 -20
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +10 -10
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +76 -76
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +118 -118
- package/dist/components/ui/ag-grid-react/index.js +121 -102
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/alert.d.ts +4 -3
- package/dist/components/ui/alert.js +182 -64
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +7 -2
- package/dist/components/ui/badge.js +105 -32
- package/dist/components/ui/breadcrumb.js +26 -21
- package/dist/components/ui/button-group.d.ts +7 -0
- package/dist/components/ui/button-group.js +116 -91
- package/dist/components/ui/button-variants.d.ts +7 -2
- package/dist/components/ui/button-variants.js +31 -16
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +10 -10
- package/dist/components/ui/calendar.js +185 -184
- package/dist/components/ui/card.js +24 -24
- package/dist/components/ui/chart/chart.js +27 -27
- package/dist/components/ui/chart/chart.utils.js +50 -50
- package/dist/components/ui/checkbox.js +22 -22
- package/dist/components/ui/chips.d.ts +19 -3
- package/dist/components/ui/chips.js +140 -41
- package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
- package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
- package/dist/components/ui/command-palette/command-palette.js +254 -264
- package/dist/components/ui/command-palette/index.d.ts +1 -1
- package/dist/components/ui/command-palette/index.js +42 -41
- package/dist/components/ui/command-palette/kbd.js +18 -18
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
- package/dist/components/ui/command-palette/shortcut-settings.js +105 -111
- package/dist/components/ui/command-palette/utils.d.ts +6 -1
- package/dist/components/ui/command-palette/utils.js +81 -74
- package/dist/components/ui/data-table/data-table-column-list.js +31 -31
- package/dist/components/ui/data-table/data-table-constants.d.ts +6 -0
- package/dist/components/ui/data-table/data-table-constants.js +4 -0
- package/dist/components/ui/data-table/data-table-context.d.ts +4 -0
- package/dist/components/ui/data-table/data-table-format-options.js +35 -35
- package/dist/components/ui/data-table/data-table-sheet.d.ts +4 -4
- package/dist/components/ui/data-table/data-table-sheet.js +91 -58
- package/dist/components/ui/data-table/data-table-view-options.js +29 -29
- package/dist/components/ui/data-table/data-table.js +84 -52
- package/dist/components/ui/data-table/index.d.ts +1 -0
- package/dist/components/ui/data-table/index.js +15 -13
- package/dist/components/ui/date-picker/date-picker.js +35 -35
- package/dist/components/ui/date-picker/date-range-picker.js +166 -164
- package/dist/components/ui/date-picker/month-picker.js +14 -14
- package/dist/components/ui/date-picker/month-range-picker.js +198 -189
- package/dist/components/ui/date-picker/multi-date-picker.js +14 -14
- package/dist/components/ui/date-picker/multi-month-picker.js +1 -1
- package/dist/components/ui/date-picker/multi-week-picker.js +1 -1
- package/dist/components/ui/date-picker/week-picker.js +2 -2
- package/dist/components/ui/date-picker/week-range-picker.js +164 -162
- package/dist/components/ui/dialog.js +25 -28
- package/dist/components/ui/drawer.js +40 -40
- package/dist/components/ui/dropdown-menu.js +72 -72
- package/dist/components/ui/empty-container.js +73 -69
- package/dist/components/ui/file-upload.js +137 -135
- package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
- package/dist/components/ui/filter-panel/filter-panel.js +175 -97
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +63 -50
- package/dist/components/ui/filter-strip/filter-summary.d.ts +4 -1
- package/dist/components/ui/filter-strip/filter-summary.js +230 -146
- package/dist/components/ui/filter-strip/filter-tag-list.js +125 -91
- package/dist/components/ui/header.d.ts +7 -3
- package/dist/components/ui/header.js +87 -79
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +44 -44
- package/dist/components/ui/hover-card.js +10 -10
- package/dist/components/ui/input.js +79 -70
- package/dist/components/ui/loader.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListCategoryFilters.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.js +27 -27
- package/dist/components/ui/nested-list/components/SortableItem.js +58 -58
- package/dist/components/ui/notification-panel/notification-item.js +32 -32
- package/dist/components/ui/notification-panel/notification-list.js +24 -24
- package/dist/components/ui/notification-panel/notification-panel.js +26 -26
- package/dist/components/ui/popover.js +22 -22
- package/dist/components/ui/progress.js +34 -34
- package/dist/components/ui/prompt.js +48 -48
- package/dist/components/ui/radio-group.js +63 -54
- package/dist/components/ui/select/components/LabelWithSequence.js +6 -6
- package/dist/components/ui/select/components/Submenu.js +33 -33
- package/dist/components/ui/select/select.js +425 -376
- package/dist/components/ui/sheet.js +88 -66
- package/dist/components/ui/sidebar.js +342 -296
- package/dist/components/ui/skeleton.js +6 -6
- package/dist/components/ui/slider.js +17 -17
- package/dist/components/ui/statistics-card.d.ts +86 -0
- package/dist/components/ui/statistics-card.hooks.d.ts +150 -0
- package/dist/components/ui/statistics-card.hooks.js +100 -0
- package/dist/components/ui/statistics-card.js +259 -0
- package/dist/components/ui/stepper.js +51 -51
- package/dist/components/ui/switch.js +7 -7
- package/dist/components/ui/tabs.js +70 -70
- package/dist/components/ui/tag-group.d.ts +1 -0
- package/dist/components/ui/tag-group.js +14 -13
- package/dist/components/ui/tag.js +43 -43
- package/dist/components/ui/textarea.js +86 -58
- package/dist/components/ui/toast.js +39 -39
- package/dist/components/ui/tooltip.js +23 -23
- package/dist/components/ui/types/date-picker.types.d.ts +1 -0
- package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
- package/dist/components/ui/types/filter-strip.types.d.ts +14 -0
- package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
- package/dist/components/ui/types/statistics-card.types.d.ts +1 -0
- package/dist/i18n/defaultMessages.d.ts +8 -0
- package/dist/i18n/defaultMessages.js +15 -9
- package/dist/i18n/locales/de.js +7 -1
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/hi.js +7 -1
- package/dist/i18n/locales/kn.js +7 -1
- package/dist/icons/assets/bulk-edit.svg.js +5 -0
- package/dist/icons/assets/clock.svg.js +5 -0
- package/dist/icons/assets/statistics.svg.js +5 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +254 -206
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +361 -347
- package/package.json +3 -2
- package/tailwind.config.js +259 -152
- /package/dist/icons/assets/{PivotMode.svg.js → pivotMode.svg.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
3
|
import { X as me } from "lucide-react";
|
|
4
4
|
import { CalendarMonth as he, Info as ue } from "../../../icons/index.js";
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as
|
|
5
|
+
import { format as c, isValid as N, parse as k } from "date-fns";
|
|
6
|
+
import { cn as C, padValidDateString as j, maskDate as B } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as xe, PopoverTrigger as ge, PopoverContent as be } from "../popover.js";
|
|
8
8
|
import { Calendar as we } from "../calendar.js";
|
|
9
9
|
import { Tooltip as O, TooltipTrigger as z, TooltipContent as H } from "../tooltip.js";
|
|
10
10
|
import { getDateFnsLocale as ye } from "../../../i18n/getDateFnsLocale.js";
|
|
11
11
|
import { useImpactNovaI18n as Pe } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
12
|
-
const
|
|
12
|
+
const Ne = r.forwardRef(
|
|
13
13
|
({
|
|
14
14
|
value: e,
|
|
15
15
|
onChange: h,
|
|
@@ -22,196 +22,198 @@ const Ce = s.forwardRef(
|
|
|
22
22
|
endMonth: Q,
|
|
23
23
|
showFooter: u = !0,
|
|
24
24
|
disabled: b,
|
|
25
|
-
label:
|
|
26
|
-
helperText:
|
|
27
|
-
prefix:
|
|
28
|
-
prefixClick:
|
|
29
|
-
isError:
|
|
25
|
+
label: v,
|
|
26
|
+
helperText: V,
|
|
27
|
+
prefix: ke,
|
|
28
|
+
prefixClick: Ce,
|
|
29
|
+
isError: D,
|
|
30
30
|
size: M,
|
|
31
31
|
required: U,
|
|
32
32
|
className: W,
|
|
33
33
|
...Y
|
|
34
34
|
}, Z) => {
|
|
35
|
-
const { locale: E, t:
|
|
36
|
-
|
|
37
|
-
const [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [e, t,
|
|
41
|
-
|
|
42
|
-
}, [
|
|
35
|
+
const { locale: E, t: S } = Pe(), o = r.useMemo(() => ye(E), [E]), $ = X ?? S("datePicker.startDate"), _ = q ?? S("datePicker.endDate"), T = r.useRef(null), F = r.useRef(null);
|
|
36
|
+
r.useRef(null), r.useRef(null), r.useImperativeHandle(Z, () => T.current);
|
|
37
|
+
const [d, R] = r.useState(!1), [w, p] = r.useState(e), [y, x] = r.useState(e?.from ? c(e.from, t, { locale: o }) : ""), [P, g] = r.useState(e?.to ? c(e.to, t, { locale: o }) : ""), [ee, I] = r.useState(e?.from || /* @__PURE__ */ new Date());
|
|
38
|
+
r.useEffect(() => {
|
|
39
|
+
d || (x(e?.from ? c(e.from, t, { locale: o }) : ""), g(e?.to ? c(e.to, t, { locale: o }) : ""), p(e));
|
|
40
|
+
}, [e, t, d, o]), r.useEffect(() => {
|
|
41
|
+
d && (p(e), x(e?.from ? c(e.from, t, { locale: o }) : ""), g(e?.to ? c(e.to, t, { locale: o }) : ""), I(e?.from || /* @__PURE__ */ new Date()));
|
|
42
|
+
}, [d, e, t, o]);
|
|
43
43
|
const te = (n) => {
|
|
44
|
-
p(n), n?.from &&
|
|
44
|
+
p(n), n?.from && x(c(n.from, t, { locale: o })), n?.to && g(c(n.to, t, { locale: o })), u || n?.from && n?.to && n.from.getTime() !== n.to.getTime() && (h?.(n), R(!1));
|
|
45
45
|
}, ne = (n) => {
|
|
46
|
-
let
|
|
47
|
-
|
|
46
|
+
let l = n !== void 0 ? n : w;
|
|
47
|
+
l?.from && !l.to && (l = { from: l.from, to: l.from }), h?.(l), R(!1);
|
|
48
48
|
}, oe = () => {
|
|
49
|
-
p(e),
|
|
49
|
+
p(e), x(e?.from ? c(e.from, t, { locale: o }) : ""), g(e?.to ? c(e.to, t, { locale: o }) : ""), R(!1);
|
|
50
50
|
}, A = () => {
|
|
51
|
-
p(void 0),
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
p(
|
|
51
|
+
p(void 0), x(""), g(""), h?.(void 0), u || R(!1);
|
|
52
|
+
}, le = (n) => {
|
|
53
|
+
const l = n.target.value, a = B(l, t, y);
|
|
54
|
+
if (x(a), a === "") {
|
|
55
|
+
const i = { from: void 0, to: w?.to };
|
|
56
|
+
p(i), u || h?.(i);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
const f =
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
p(
|
|
59
|
+
const f = k(a, t, /* @__PURE__ */ new Date(), { locale: o });
|
|
60
|
+
if (N(f) && a.length === t.length) {
|
|
61
|
+
const i = { from: f, to: w?.to };
|
|
62
|
+
p(i), I(f), u || h?.(i);
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
p(
|
|
64
|
+
}, se = (n) => {
|
|
65
|
+
const l = n.target.value, a = B(l, t, P);
|
|
66
|
+
if (g(a), a === "") {
|
|
67
|
+
const i = { from: w?.from, to: void 0 };
|
|
68
|
+
p(i), u || h?.(i);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const f =
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
p(
|
|
71
|
+
const f = k(a, t, /* @__PURE__ */ new Date(), { locale: o });
|
|
72
|
+
if (N(f) && a.length === t.length) {
|
|
73
|
+
const i = { from: w?.from, to: f };
|
|
74
|
+
p(i), f && I(f), u || h?.(i);
|
|
75
75
|
}
|
|
76
76
|
}, L = () => {
|
|
77
|
-
if (
|
|
78
|
-
const n = j(y, t),
|
|
79
|
-
!
|
|
80
|
-
},
|
|
81
|
-
return /* @__PURE__ */ m("div", { className: "w-full
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className: N(
|
|
86
|
-
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
87
|
-
b && "opacity-70",
|
|
88
|
-
R && "text-destructive"
|
|
89
|
-
),
|
|
90
|
-
children: [
|
|
91
|
-
V,
|
|
92
|
-
" ",
|
|
93
|
-
U && /* @__PURE__ */ l("span", { className: "text-destructive", children: "*" })
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ m(ge, { open: a, onOpenChange: S, children: [
|
|
98
|
-
/* @__PURE__ */ l(xe, { asChild: !0, children: /* @__PURE__ */ m(
|
|
99
|
-
"div",
|
|
77
|
+
if (d) return;
|
|
78
|
+
const n = j(y, t), l = j(P, t), a = k(n, t, /* @__PURE__ */ new Date(), { locale: o }), f = k(l, t, /* @__PURE__ */ new Date(), { locale: o }), i = N(a) && n.length === t.length, pe = N(f) && l.length === t.length;
|
|
79
|
+
!i || !pe ? (x(e?.from ? c(e.from, t, { locale: o }) : ""), g(e?.to ? c(e.to, t, { locale: o }) : ""), p(e)) : (x(n), g(l), u || h?.({ from: a, to: f }));
|
|
80
|
+
}, re = e?.from ? c(e.from, t, { locale: o }) : "", ce = e?.to ? c(e.to, t, { locale: o }) : "", ie = y !== re, ae = P !== ce, de = y.length === t.length && !N(k(y, t, /* @__PURE__ */ new Date(), { locale: o })), fe = P.length === t.length && !N(k(P, t, /* @__PURE__ */ new Date(), { locale: o }));
|
|
81
|
+
return /* @__PURE__ */ m("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "date-range-picker", "data-disabled": b || void 0, children: [
|
|
82
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-[6px]", children: [
|
|
83
|
+
v && /* @__PURE__ */ m(
|
|
84
|
+
"label",
|
|
100
85
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
M === "sm" ? "h-6" : M === "md" ? "h-[28px]" : "h-8",
|
|
106
|
-
b && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
107
|
-
"cursor-pointer",
|
|
108
|
-
W
|
|
86
|
+
className: C(
|
|
87
|
+
"text-xs font-medium leading-[18px] text-content-tertiary",
|
|
88
|
+
b && "opacity-70",
|
|
89
|
+
D && "text-destructive"
|
|
109
90
|
),
|
|
110
91
|
children: [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
ref: F,
|
|
135
|
-
type: "text",
|
|
136
|
-
value: P,
|
|
137
|
-
onChange: le,
|
|
138
|
-
onBlur: L,
|
|
139
|
-
onClick: (n) => a && n.stopPropagation(),
|
|
140
|
-
placeholder: a ? t : _,
|
|
141
|
-
disabled: !!b,
|
|
142
|
-
"data-field": "end",
|
|
143
|
-
className: N(
|
|
144
|
-
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
145
|
-
fe ? "text-destructive" : de ? "text-muted-foreground" : ""
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ m("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
151
|
-
e?.from && !b && /* @__PURE__ */ m(O, { children: [
|
|
152
|
-
/* @__PURE__ */ l(z, { asChild: !0, children: /* @__PURE__ */ l(
|
|
153
|
-
me,
|
|
92
|
+
v,
|
|
93
|
+
" ",
|
|
94
|
+
U && /* @__PURE__ */ s("span", { className: "text-destructive", children: "*" })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ m(xe, { open: d, onOpenChange: R, children: [
|
|
99
|
+
/* @__PURE__ */ s(ge, { asChild: !0, children: /* @__PURE__ */ m(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
"data-state": d ? "open" : "closed",
|
|
103
|
+
className: C(
|
|
104
|
+
"flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
|
|
105
|
+
D ? "border-destructive hover:border-destructive" : "border-field",
|
|
106
|
+
M === "sm" ? "h-6" : M === "md" ? "h-[28px]" : "h-8",
|
|
107
|
+
b && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
108
|
+
"cursor-pointer",
|
|
109
|
+
W
|
|
110
|
+
),
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
113
|
+
/* @__PURE__ */ s(
|
|
114
|
+
"input",
|
|
154
115
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
116
|
+
ref: T,
|
|
117
|
+
type: "text",
|
|
118
|
+
value: y,
|
|
119
|
+
onChange: le,
|
|
120
|
+
onBlur: L,
|
|
121
|
+
onClick: (n) => d && n.stopPropagation(),
|
|
122
|
+
placeholder: d ? t : $,
|
|
123
|
+
disabled: !!b,
|
|
124
|
+
"data-field": "start",
|
|
125
|
+
className: C(
|
|
126
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
127
|
+
de ? "text-destructive" : ie ? "text-content-muted" : ""
|
|
128
|
+
),
|
|
129
|
+
...Y
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ s(
|
|
133
|
+
"input",
|
|
134
|
+
{
|
|
135
|
+
ref: F,
|
|
136
|
+
type: "text",
|
|
137
|
+
value: P,
|
|
138
|
+
onChange: se,
|
|
139
|
+
onBlur: L,
|
|
140
|
+
onClick: (n) => d && n.stopPropagation(),
|
|
141
|
+
placeholder: d ? t : _,
|
|
142
|
+
disabled: !!b,
|
|
143
|
+
"data-field": "end",
|
|
144
|
+
className: C(
|
|
145
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
146
|
+
fe ? "text-destructive" : ae ? "text-content-muted" : ""
|
|
147
|
+
)
|
|
159
148
|
}
|
|
160
|
-
)
|
|
161
|
-
/* @__PURE__ */ l(H, { variant: "tertiary", side: "top", children: I("calendar.clear") })
|
|
149
|
+
)
|
|
162
150
|
] }),
|
|
163
|
-
/* @__PURE__ */ m(
|
|
164
|
-
|
|
165
|
-
|
|
151
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
152
|
+
e?.from && !b && /* @__PURE__ */ m(O, { children: [
|
|
153
|
+
/* @__PURE__ */ s(z, { asChild: !0, children: /* @__PURE__ */ s(
|
|
154
|
+
me,
|
|
155
|
+
{
|
|
156
|
+
className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
|
|
157
|
+
onClick: (n) => {
|
|
158
|
+
n.stopPropagation(), A();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
) }),
|
|
162
|
+
/* @__PURE__ */ s(H, { variant: "tertiary", side: "top", children: S("calendar.clear") })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ m(O, { children: [
|
|
165
|
+
/* @__PURE__ */ s(z, { asChild: !0, children: /* @__PURE__ */ s(he, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
166
|
+
/* @__PURE__ */ s(H, { variant: "tertiary", side: "top", children: S("datePicker.selectMonthRange") })
|
|
167
|
+
] })
|
|
166
168
|
] })
|
|
167
|
-
]
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
)
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
) }),
|
|
172
|
+
/* @__PURE__ */ s(
|
|
173
|
+
be,
|
|
174
|
+
{
|
|
175
|
+
className: "w-auto p-0",
|
|
176
|
+
align: "start",
|
|
177
|
+
onOpenAutoFocus: (n) => n.preventDefault(),
|
|
178
|
+
children: /* @__PURE__ */ s(
|
|
179
|
+
we,
|
|
180
|
+
{
|
|
181
|
+
mode: "range",
|
|
182
|
+
selected: w,
|
|
183
|
+
onSelect: te,
|
|
184
|
+
month: ee,
|
|
185
|
+
onMonthChange: I,
|
|
186
|
+
disabled: { before: G, after: J },
|
|
187
|
+
startMonth: K,
|
|
188
|
+
endMonth: Q,
|
|
189
|
+
showFooter: u,
|
|
190
|
+
onApply: ne,
|
|
191
|
+
onCancel: oe,
|
|
192
|
+
onClear: A,
|
|
193
|
+
captionLayout: "dropdown"
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
197
199
|
] }),
|
|
198
|
-
|
|
199
|
-
!
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
V && /* @__PURE__ */ m("div", { className: C("flex items-center gap-[6px]", D && "text-destructive"), children: [
|
|
201
|
+
!D && /* @__PURE__ */ s(ue, { size: 10, className: "shrink-0 text-content-muted" }),
|
|
202
|
+
/* @__PURE__ */ s(
|
|
201
203
|
"p",
|
|
202
204
|
{
|
|
203
|
-
className:
|
|
204
|
-
"text-[10px] text-
|
|
205
|
-
|
|
205
|
+
className: C(
|
|
206
|
+
"text-[10px] leading-4 text-navigation-muted",
|
|
207
|
+
D && "text-destructive"
|
|
206
208
|
),
|
|
207
|
-
children:
|
|
209
|
+
children: V
|
|
208
210
|
}
|
|
209
211
|
)
|
|
210
212
|
] })
|
|
211
213
|
] });
|
|
212
214
|
}
|
|
213
215
|
);
|
|
214
|
-
|
|
216
|
+
Ne.displayName = "DateRangePicker";
|
|
215
217
|
export {
|
|
216
|
-
|
|
218
|
+
Ne as DateRangePicker
|
|
217
219
|
};
|
|
@@ -25,28 +25,28 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
|
|
|
25
25
|
}, E) => {
|
|
26
26
|
const { t: m } = et(), $ = V ?? m("datePicker.selectMonth"), w = o.useRef(null);
|
|
27
27
|
o.useRef(null), o.useImperativeHandle(E, () => w.current);
|
|
28
|
-
const [r,
|
|
28
|
+
const [r, f] = o.useState(!1), [S, a] = o.useState(t), [l, i] = o.useState(t ? c(t) : ""), [b, g] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
29
29
|
o.useEffect(() => {
|
|
30
30
|
r || (i(t ? c(t) : ""), a(t));
|
|
31
31
|
}, [r, t]), o.useEffect(() => {
|
|
32
32
|
r && (a(t), g(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), i(t ? c(t) : ""));
|
|
33
33
|
}, [r, t]);
|
|
34
34
|
const H = (e) => {
|
|
35
|
-
a(e), e && i(c(e)), d || (s?.(e),
|
|
35
|
+
a(e), e && i(c(e)), d || (s?.(e), f(!1));
|
|
36
36
|
}, X = (e) => {
|
|
37
|
-
s?.(e !== void 0 ? e : S),
|
|
37
|
+
s?.(e !== void 0 ? e : S), f(!1);
|
|
38
38
|
}, q = () => {
|
|
39
|
-
a(t), i(t ? c(t) : ""),
|
|
39
|
+
a(t), i(t ? c(t) : ""), f(!1);
|
|
40
40
|
}, k = () => {
|
|
41
|
-
a(void 0), i(""), s?.(void 0), d ||
|
|
41
|
+
a(void 0), i(""), s?.(void 0), d || f(!1);
|
|
42
42
|
}, z = (e) => {
|
|
43
|
-
const p = e.target.value,
|
|
44
|
-
if (i(
|
|
43
|
+
const p = e.target.value, h = W(p, "MM/yyyy", l);
|
|
44
|
+
if (i(h), h === "") {
|
|
45
45
|
a(void 0), d || s?.(void 0);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const y = C(
|
|
49
|
-
if (u(y) &&
|
|
48
|
+
const y = C(h, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
49
|
+
if (u(y) && h.length === 7) {
|
|
50
50
|
const x = { month: y.getMonth(), year: y.getFullYear() };
|
|
51
51
|
a(x), g(y), d || s?.(x);
|
|
52
52
|
}
|
|
@@ -56,11 +56,11 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
|
|
|
56
56
|
if (!u(p) || e.length !== 7)
|
|
57
57
|
i(t ? c(t) : ""), a(t);
|
|
58
58
|
else if (i(e), !d) {
|
|
59
|
-
const
|
|
60
|
-
s?.(
|
|
59
|
+
const h = { month: p.getMonth(), year: p.getFullYear() };
|
|
60
|
+
s?.(h);
|
|
61
61
|
}
|
|
62
62
|
}, D = (t ? c(t) : "") !== l, J = l.length === 7 && !u(C(l, "MM/yyyy", /* @__PURE__ */ new Date()));
|
|
63
|
-
return /* @__PURE__ */ M(_, { open: r, onOpenChange:
|
|
63
|
+
return /* @__PURE__ */ M(_, { open: r, onOpenChange: f, children: [
|
|
64
64
|
/* @__PURE__ */ n(F, { asChild: !0, children: /* @__PURE__ */ n("div", { "data-component": "month-picker", "data-state": r ? "open" : "closed", "data-pending": D || void 0, children: /* @__PURE__ */ n(
|
|
65
65
|
Z,
|
|
66
66
|
{
|
|
@@ -74,7 +74,7 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
|
|
|
74
74
|
"data-form-control": "input",
|
|
75
75
|
className: Q(
|
|
76
76
|
"cursor-pointer",
|
|
77
|
-
J ? "text-destructive" : D ? "text-muted
|
|
77
|
+
J ? "text-destructive" : D ? "text-content-muted" : "",
|
|
78
78
|
j
|
|
79
79
|
),
|
|
80
80
|
suffix: /* @__PURE__ */ M("div", { className: "flex items-center gap-1", children: [
|
|
@@ -82,7 +82,7 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, nt =
|
|
|
82
82
|
/* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(
|
|
83
83
|
K,
|
|
84
84
|
{
|
|
85
|
-
className: "h-4 w-4 cursor-pointer hover:text-
|
|
85
|
+
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
86
86
|
onClick: (e) => {
|
|
87
87
|
e.stopPropagation(), k();
|
|
88
88
|
}
|