impact-nova 1.3.0 → 1.5.2
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/README.md +49 -0
- package/dist/components/layout/dashboard-layout.d.ts +15 -1
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
- package/dist/components/ui/accordion.js +38 -34
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
- package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +45 -44
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
- package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
- package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
- package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
- package/dist/components/ui/alert.js +62 -58
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +354 -354
- package/dist/components/ui/chart/chart.js +63 -62
- package/dist/components/ui/chips.js +42 -38
- package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
- package/dist/components/ui/command-palette/command-palette-context.js +110 -0
- package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
- package/dist/components/ui/command-palette/command-palette.js +402 -0
- package/dist/components/ui/command-palette/index.d.ts +23 -0
- package/dist/components/ui/command-palette/index.js +44 -0
- package/dist/components/ui/command-palette/kbd.d.ts +28 -0
- package/dist/components/ui/command-palette/kbd.js +52 -0
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
- package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
- package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
- package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
- package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
- package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
- package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
- package/dist/components/ui/command-palette/use-shortcut.js +49 -0
- package/dist/components/ui/command-palette/utils.d.ts +119 -0
- package/dist/components/ui/command-palette/utils.js +248 -0
- package/dist/components/ui/data-table/data-table-column-list.js +87 -86
- package/dist/components/ui/data-table/data-table-format-options.js +45 -44
- package/dist/components/ui/data-table/data-table-view-options.js +39 -38
- package/dist/components/ui/date-picker/date-picker.js +89 -87
- package/dist/components/ui/date-picker/date-range-picker.js +140 -138
- package/dist/components/ui/date-picker/month-picker.js +82 -81
- package/dist/components/ui/date-picker/month-range-picker.js +108 -105
- package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
- package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
- package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
- package/dist/components/ui/date-picker/week-picker.js +117 -115
- package/dist/components/ui/date-picker/week-range-picker.js +166 -164
- package/dist/components/ui/dialog.js +78 -73
- package/dist/components/ui/drawer.js +71 -66
- package/dist/components/ui/file-upload.js +131 -127
- package/dist/components/ui/filter-panel/filter-panel.js +98 -94
- package/dist/components/ui/filter-strip/filter-strip.js +95 -91
- package/dist/components/ui/filter-strip/filter-summary.js +91 -90
- package/dist/components/ui/header.js +57 -53
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
- package/dist/components/ui/loader.js +17 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
- package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
- package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
- package/dist/components/ui/nested-list/nested-list.js +184 -182
- package/dist/components/ui/notification-panel/notification-panel.js +60 -53
- package/dist/components/ui/popover.js +45 -40
- package/dist/components/ui/prompt.js +90 -86
- package/dist/components/ui/select/select.js +206 -209
- package/dist/components/ui/sheet.d.ts +1 -0
- package/dist/components/ui/sheet.js +50 -48
- package/dist/components/ui/sidebar.js +273 -267
- package/dist/components/ui/stepper.js +75 -63
- package/dist/components/ui/tag.js +48 -44
- package/dist/components/ui/toast.js +46 -41
- package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
- package/dist/i18n/ImpactNovaI18nContext.js +76 -0
- package/dist/i18n/defaultMessages.d.ts +231 -0
- package/dist/i18n/defaultMessages.js +206 -0
- package/dist/i18n/getDateFnsLocale.d.ts +11 -0
- package/dist/i18n/getDateFnsLocale.js +21 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/locales/de.d.ts +2 -0
- package/dist/i18n/locales/de.js +206 -0
- package/dist/i18n/locales/es.d.ts +2 -0
- package/dist/i18n/locales/es.js +206 -0
- package/dist/i18n/locales/hi.d.ts +2 -0
- package/dist/i18n/locales/hi.js +206 -0
- package/dist/i18n/locales/index.d.ts +4 -0
- package/dist/i18n/locales/kn.d.ts +2 -0
- package/dist/i18n/locales/kn.js +206 -0
- package/dist/icons/assets/boxAdd.svg.js +5 -0
- package/dist/icons/assets/boxed.svg.js +5 -0
- package/dist/icons/assets/trolley.svg.js +5 -0
- package/dist/icons/assets/unlocked.svg.js +5 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +179 -171
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +232 -172
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,242 +1,244 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { resolveWeekSelection as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { X as we } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as ke, Info as ye } from "../../../icons/index.js";
|
|
5
|
+
import { format as b, isValid as S, parse as C } from "date-fns";
|
|
6
|
+
import { cn as N, padValidDateString as Q, maskDate as U } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as De, PopoverTrigger as Re, PopoverContent as Se } from "../popover.js";
|
|
8
|
+
import { Calendar as Ce } from "../calendar.js";
|
|
9
|
+
import { Tooltip as Z, TooltipTrigger as Y, TooltipContent as _ } from "../tooltip.js";
|
|
10
|
+
import { resolveWeekSelection as Ne } from "../../../lib/fiscal-calendar.js";
|
|
11
|
+
import { getDateFnsLocale as Ie } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { useImpactNovaI18n as We } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
13
|
+
const x = (t, l = "MM/dd/yyyy", e) => {
|
|
14
|
+
const V = b(t.startDate, l, e ? { locale: e } : {}), v = b(t.endDate, l, e ? { locale: e } : {});
|
|
15
|
+
return `${V} - ${v}`;
|
|
16
|
+
}, Pe = s.forwardRef(
|
|
15
17
|
({
|
|
16
|
-
value:
|
|
17
|
-
onChange:
|
|
18
|
-
format:
|
|
19
|
-
placeholder:
|
|
20
|
-
minDate:
|
|
21
|
-
maxDate:
|
|
22
|
-
startMonth:
|
|
23
|
-
endMonth:
|
|
24
|
-
showFooter:
|
|
25
|
-
calendarType:
|
|
26
|
-
fiscalMode:
|
|
27
|
-
selectionMode:
|
|
28
|
-
fiscalMonthPattern:
|
|
29
|
-
fiscalYearStartMonth:
|
|
30
|
-
weekStartsOn:
|
|
31
|
-
disabled:
|
|
32
|
-
className:
|
|
33
|
-
isError:
|
|
34
|
-
size:
|
|
35
|
-
label:
|
|
36
|
-
helperText:
|
|
37
|
-
required:
|
|
38
|
-
prefix:
|
|
39
|
-
prefixClick:
|
|
40
|
-
...
|
|
41
|
-
},
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [e,
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
}, P = (n) =>
|
|
59
|
-
calendarType:
|
|
60
|
-
fiscalMode:
|
|
61
|
-
selectionMode:
|
|
62
|
-
fiscalMonthPattern:
|
|
63
|
-
fiscalYearStartMonth:
|
|
64
|
-
weekStartsOn:
|
|
65
|
-
}),
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
|
|
18
|
+
value: t,
|
|
19
|
+
onChange: l,
|
|
20
|
+
format: e = "MM/dd/yyyy",
|
|
21
|
+
placeholder: V,
|
|
22
|
+
minDate: v,
|
|
23
|
+
maxDate: F,
|
|
24
|
+
startMonth: ee,
|
|
25
|
+
endMonth: te,
|
|
26
|
+
showFooter: u = !0,
|
|
27
|
+
calendarType: M = "calendar",
|
|
28
|
+
fiscalMode: A = "basic",
|
|
29
|
+
selectionMode: L = "week",
|
|
30
|
+
fiscalMonthPattern: j,
|
|
31
|
+
fiscalYearStartMonth: B = 1,
|
|
32
|
+
weekStartsOn: O = 1,
|
|
33
|
+
disabled: k,
|
|
34
|
+
className: ne,
|
|
35
|
+
isError: I,
|
|
36
|
+
size: $,
|
|
37
|
+
label: z,
|
|
38
|
+
helperText: H,
|
|
39
|
+
required: oe,
|
|
40
|
+
prefix: Ve,
|
|
41
|
+
prefixClick: ve,
|
|
42
|
+
...re
|
|
43
|
+
}, se) => {
|
|
44
|
+
const { locale: X, t: T } = We(), o = s.useMemo(() => Ie(X), [X]), q = V ?? T("datePicker.selectWeekRange"), G = s.useRef(null), ie = s.useRef(null);
|
|
45
|
+
s.useRef(null), s.useRef(null), s.useImperativeHandle(se, () => G.current);
|
|
46
|
+
const [c, W] = s.useState(!1), [y, d] = s.useState(t), [D, h] = s.useState(t?.from ? b(t.from.startDate, e, { locale: o }) : ""), [R, g] = s.useState(t?.to ? b(t.to.endDate, e, { locale: o }) : ""), [le, E] = s.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
|
|
47
|
+
s.useEffect(() => {
|
|
48
|
+
c || (h(t?.from ? b(t.from.startDate, e, { locale: o }) : ""), g(t?.to ? b(t.to.endDate, e, { locale: o }) : ""), d(t));
|
|
49
|
+
}, [t, e, c, o]), s.useEffect(() => {
|
|
50
|
+
c && (d(t), h(t?.from ? b(t.from.startDate, e, { locale: o }) : ""), g(t?.to ? b(t.to.endDate, e, { locale: o }) : ""), E(t?.from?.startDate || /* @__PURE__ */ new Date()));
|
|
51
|
+
}, [c, t, e, o]);
|
|
52
|
+
const ce = (n) => {
|
|
53
|
+
d(n), n?.from && h(x(n.from, e, o)), n?.to && g(x(n.to, e, o)), !u && n?.from && n?.to && n.from.startDate.getTime() !== n.to.startDate.getTime() && (l?.(n), W(!1));
|
|
54
|
+
}, de = (n) => {
|
|
55
|
+
l?.(n !== void 0 ? n : y), W(!1);
|
|
56
|
+
}, ae = () => {
|
|
57
|
+
d(t), h(t?.from ? x(t.from, e, o) : ""), g(t?.to ? x(t.to, e, o) : ""), W(!1);
|
|
58
|
+
}, J = () => {
|
|
59
|
+
d(void 0), h(""), g(""), l?.(void 0), u || W(!1);
|
|
60
|
+
}, P = (n) => Ne(n, {
|
|
61
|
+
calendarType: M,
|
|
62
|
+
fiscalMode: A,
|
|
63
|
+
selectionMode: L,
|
|
64
|
+
fiscalMonthPattern: j,
|
|
65
|
+
fiscalYearStartMonth: B,
|
|
66
|
+
weekStartsOn: O
|
|
67
|
+
}), fe = (n) => {
|
|
68
|
+
const p = n.target.value, i = U(p, e, D);
|
|
69
|
+
if (h(i), i === "") {
|
|
70
|
+
const f = { from: void 0, to: y?.to };
|
|
71
|
+
d(f), u || l?.(f);
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
72
|
-
const
|
|
73
|
-
if (S(
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const a = C(i, e, /* @__PURE__ */ new Date(), { locale: o });
|
|
75
|
+
if (S(a) && i.length === e.length) {
|
|
76
|
+
const w = { from: P(a), to: y?.to };
|
|
77
|
+
d(w), u || l?.(w);
|
|
76
78
|
}
|
|
77
|
-
},
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
|
|
79
|
+
}, pe = (n) => {
|
|
80
|
+
const p = n.target.value, i = U(p, e, R);
|
|
81
|
+
if (g(i), i === "") {
|
|
82
|
+
const f = { from: y?.from, to: void 0 };
|
|
83
|
+
d(f), u || l?.(f);
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
|
-
const
|
|
85
|
-
if (S(
|
|
86
|
-
const
|
|
87
|
-
|
|
86
|
+
const a = C(i, e, /* @__PURE__ */ new Date(), { locale: o });
|
|
87
|
+
if (S(a) && i.length === e.length) {
|
|
88
|
+
const f = P(a), w = { from: y?.from, to: f };
|
|
89
|
+
d(w), a && E(a), u || l?.(w);
|
|
88
90
|
}
|
|
89
|
-
},
|
|
90
|
-
if (
|
|
91
|
-
const n =
|
|
92
|
-
if (!
|
|
93
|
-
|
|
94
|
-
else if (
|
|
95
|
-
const
|
|
96
|
-
|
|
91
|
+
}, K = () => {
|
|
92
|
+
if (c) return;
|
|
93
|
+
const n = Q(D, e), p = Q(R, e), i = C(n, e, /* @__PURE__ */ new Date(), { locale: o }), a = C(p, e, /* @__PURE__ */ new Date(), { locale: o }), f = S(i) && n.length === e.length, w = S(a) && p.length === e.length;
|
|
94
|
+
if (!f || !w)
|
|
95
|
+
h(t?.from ? x(t.from, e, o) : ""), g(t?.to ? x(t.to, e, o) : ""), d(t);
|
|
96
|
+
else if (h(n), g(p), !u) {
|
|
97
|
+
const xe = P(i), be = P(a);
|
|
98
|
+
l?.({ from: xe, to: be });
|
|
97
99
|
}
|
|
98
|
-
},
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
100
|
+
}, me = (t?.from ? x(t.from, e, o) : "") !== D, ue = (t?.to ? x(t.to, e, o) : "") !== R, he = D.length === e.length && !S(C(D, e, /* @__PURE__ */ new Date(), { locale: o })), ge = R.length === e.length && !S(C(R, e, /* @__PURE__ */ new Date(), { locale: o }));
|
|
101
|
+
return /* @__PURE__ */ m("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "week-range-picker", "data-disabled": k || void 0, children: [
|
|
102
|
+
z && /* @__PURE__ */ m(
|
|
101
103
|
"label",
|
|
102
104
|
{
|
|
103
|
-
className:
|
|
105
|
+
className: N(
|
|
104
106
|
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
k && "opacity-70",
|
|
108
|
+
I && "text-destructive"
|
|
107
109
|
),
|
|
108
110
|
children: [
|
|
109
|
-
|
|
111
|
+
z,
|
|
110
112
|
" ",
|
|
111
|
-
|
|
113
|
+
oe && /* @__PURE__ */ r("span", { className: "text-destructive", children: "*" })
|
|
112
114
|
]
|
|
113
115
|
}
|
|
114
116
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ m(De, { open: c, onOpenChange: W, children: [
|
|
118
|
+
/* @__PURE__ */ r(Re, { asChild: !0, children: /* @__PURE__ */ m(
|
|
117
119
|
"div",
|
|
118
120
|
{
|
|
119
|
-
"data-state":
|
|
120
|
-
className:
|
|
121
|
+
"data-state": c ? "open" : "closed",
|
|
122
|
+
className: N(
|
|
121
123
|
"flex w-full items-center justify-between gap-2 rounded-md border bg-white px-3 text-sm shadow-sm transition-colors hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
I ? "border-destructive hover:border-destructive" : "border-input",
|
|
125
|
+
$ === "sm" ? "h-6" : $ === "md" ? "h-[28px]" : "h-8",
|
|
126
|
+
k && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
125
127
|
"cursor-pointer",
|
|
126
|
-
|
|
128
|
+
ne
|
|
127
129
|
),
|
|
128
130
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
132
|
+
/* @__PURE__ */ r(
|
|
131
133
|
"input",
|
|
132
134
|
{
|
|
133
|
-
ref:
|
|
135
|
+
ref: G,
|
|
134
136
|
type: "text",
|
|
135
|
-
value:
|
|
136
|
-
onChange:
|
|
137
|
-
onBlur:
|
|
138
|
-
onClick: (n) =>
|
|
139
|
-
placeholder:
|
|
140
|
-
disabled: !!
|
|
137
|
+
value: D,
|
|
138
|
+
onChange: fe,
|
|
139
|
+
onBlur: K,
|
|
140
|
+
onClick: (n) => c && n.stopPropagation(),
|
|
141
|
+
placeholder: c ? e : q,
|
|
142
|
+
disabled: !!k,
|
|
141
143
|
"data-field": "start",
|
|
142
|
-
className:
|
|
144
|
+
className: N(
|
|
143
145
|
"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",
|
|
144
|
-
|
|
146
|
+
he ? "text-destructive" : me ? "text-muted-foreground" : ""
|
|
145
147
|
),
|
|
146
|
-
...
|
|
148
|
+
...re
|
|
147
149
|
}
|
|
148
150
|
),
|
|
149
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ r(
|
|
150
152
|
"input",
|
|
151
153
|
{
|
|
152
|
-
ref:
|
|
154
|
+
ref: ie,
|
|
153
155
|
type: "text",
|
|
154
|
-
value:
|
|
155
|
-
onChange:
|
|
156
|
-
onBlur:
|
|
157
|
-
onClick: (n) =>
|
|
158
|
-
placeholder:
|
|
159
|
-
disabled: !!
|
|
156
|
+
value: R,
|
|
157
|
+
onChange: pe,
|
|
158
|
+
onBlur: K,
|
|
159
|
+
onClick: (n) => c && n.stopPropagation(),
|
|
160
|
+
placeholder: c ? e : q,
|
|
161
|
+
disabled: !!k,
|
|
160
162
|
"data-field": "end",
|
|
161
|
-
className:
|
|
163
|
+
className: N(
|
|
162
164
|
"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",
|
|
163
|
-
|
|
165
|
+
ge ? "text-destructive" : ue ? "text-muted-foreground" : ""
|
|
164
166
|
)
|
|
165
167
|
}
|
|
166
168
|
)
|
|
167
169
|
] }),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
170
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
171
|
+
t?.from && !k && /* @__PURE__ */ m(Z, { children: [
|
|
172
|
+
/* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ r(
|
|
173
|
+
we,
|
|
172
174
|
{
|
|
173
175
|
className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
|
|
174
176
|
onClick: (n) => {
|
|
175
|
-
n.stopPropagation(),
|
|
177
|
+
n.stopPropagation(), J();
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
) }),
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ r(_, { variant: "tertiary", side: "top", children: T("calendar.clear") })
|
|
180
182
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ m(Z, { children: [
|
|
184
|
+
/* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ r(ke, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
185
|
+
/* @__PURE__ */ r(_, { variant: "tertiary", side: "top", children: T("datePicker.selectWeekRange") })
|
|
184
186
|
] })
|
|
185
187
|
] })
|
|
186
188
|
]
|
|
187
189
|
}
|
|
188
190
|
) }),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
|
|
191
|
+
/* @__PURE__ */ r(
|
|
192
|
+
Se,
|
|
191
193
|
{
|
|
192
194
|
className: "w-auto p-0",
|
|
193
195
|
align: "start",
|
|
194
196
|
onOpenAutoFocus: (n) => n.preventDefault(),
|
|
195
|
-
children: /* @__PURE__ */
|
|
196
|
-
|
|
197
|
+
children: /* @__PURE__ */ r(
|
|
198
|
+
Ce,
|
|
197
199
|
{
|
|
198
200
|
pickerType: "week",
|
|
199
201
|
weekMode: "range",
|
|
200
202
|
selectedWeeks: y,
|
|
201
|
-
onWeekSelect:
|
|
202
|
-
month:
|
|
203
|
-
onMonthChange:
|
|
204
|
-
disabled: { before:
|
|
205
|
-
startMonth:
|
|
206
|
-
endMonth:
|
|
207
|
-
showFooter:
|
|
208
|
-
calendarType:
|
|
209
|
-
fiscalMode:
|
|
210
|
-
selectionMode:
|
|
211
|
-
fiscalMonthPattern:
|
|
212
|
-
fiscalYearStartMonth:
|
|
213
|
-
weekStartsOn:
|
|
214
|
-
onApply:
|
|
215
|
-
onCancel:
|
|
216
|
-
onClear:
|
|
203
|
+
onWeekSelect: ce,
|
|
204
|
+
month: le,
|
|
205
|
+
onMonthChange: E,
|
|
206
|
+
disabled: { before: v, after: F },
|
|
207
|
+
startMonth: ee,
|
|
208
|
+
endMonth: te,
|
|
209
|
+
showFooter: u,
|
|
210
|
+
calendarType: M,
|
|
211
|
+
fiscalMode: A,
|
|
212
|
+
selectionMode: L,
|
|
213
|
+
fiscalMonthPattern: j,
|
|
214
|
+
fiscalYearStartMonth: B,
|
|
215
|
+
weekStartsOn: O,
|
|
216
|
+
onApply: de,
|
|
217
|
+
onCancel: ae,
|
|
218
|
+
onClear: J,
|
|
217
219
|
captionLayout: "dropdown"
|
|
218
220
|
}
|
|
219
221
|
)
|
|
220
222
|
}
|
|
221
223
|
)
|
|
222
224
|
] }),
|
|
223
|
-
|
|
224
|
-
!
|
|
225
|
-
/* @__PURE__ */
|
|
225
|
+
H && /* @__PURE__ */ m("div", { className: N("flex items-center gap-1", I && "text-destructive"), children: [
|
|
226
|
+
!I && /* @__PURE__ */ r(ye, { size: 10, className: "shrink-0 text-muted-foreground" }),
|
|
227
|
+
/* @__PURE__ */ r(
|
|
226
228
|
"p",
|
|
227
229
|
{
|
|
228
|
-
className:
|
|
230
|
+
className: N(
|
|
229
231
|
"text-[10px] text-[#7a8294]",
|
|
230
|
-
|
|
232
|
+
I && "text-destructive"
|
|
231
233
|
),
|
|
232
|
-
children:
|
|
234
|
+
children: H
|
|
233
235
|
}
|
|
234
236
|
)
|
|
235
237
|
] })
|
|
236
238
|
] });
|
|
237
239
|
}
|
|
238
240
|
);
|
|
239
|
-
|
|
241
|
+
Pe.displayName = "WeekRangePicker";
|
|
240
242
|
export {
|
|
241
|
-
|
|
243
|
+
Pe as WeekRangePicker
|
|
242
244
|
};
|
|
@@ -1,58 +1,63 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { X as
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-dialog";
|
|
4
|
+
import { X as f } from "lucide-react";
|
|
5
5
|
import { cn as i } from "../../lib/utils.js";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { Tooltip as g, TooltipTrigger as u, TooltipContent as x } from "./tooltip.js";
|
|
7
|
+
import { useImpactNovaI18n as y } from "../../i18n/ImpactNovaI18nContext.js";
|
|
8
|
+
const O = t.Root, P = t.Trigger, N = t.Portal, B = t.Close, r = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
9
|
+
t.Overlay,
|
|
9
10
|
{
|
|
10
11
|
ref: s,
|
|
11
12
|
className: i(
|
|
12
13
|
"fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
13
14
|
e
|
|
14
15
|
),
|
|
15
|
-
...
|
|
16
|
+
...a
|
|
16
17
|
}
|
|
17
18
|
));
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ l(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
|
|
19
|
+
r.displayName = t.Overlay.displayName;
|
|
20
|
+
const b = n.forwardRef(({ className: e, children: a, hideClose: s, ...c }, m) => {
|
|
21
|
+
const { t: p } = y(), d = p("aria.close");
|
|
22
|
+
return /* @__PURE__ */ l(N, { children: [
|
|
23
|
+
/* @__PURE__ */ o(r, {}),
|
|
24
|
+
/* @__PURE__ */ l(
|
|
25
|
+
t.Content,
|
|
26
|
+
{
|
|
27
|
+
ref: m,
|
|
28
|
+
"aria-describedby": void 0,
|
|
29
|
+
"data-component": "dialog-content",
|
|
30
|
+
className: i(
|
|
31
|
+
"fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg overflow-hidden",
|
|
32
|
+
e
|
|
33
|
+
),
|
|
34
|
+
...c,
|
|
35
|
+
children: [
|
|
36
|
+
a,
|
|
37
|
+
!s && /* @__PURE__ */ l(g, { children: [
|
|
38
|
+
/* @__PURE__ */ o(u, { asChild: !0, children: /* @__PURE__ */ l(
|
|
39
|
+
t.Close,
|
|
40
|
+
{
|
|
41
|
+
"data-component": "dialog-close",
|
|
42
|
+
className: "absolute right-4 top-4 rounded-sm opacity-50 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
43
|
+
"aria-label": d,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ o(f, { className: "h-4 w-4" }),
|
|
46
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: d })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
/* @__PURE__ */ o(x, { variant: "tertiary", side: "top", children: d })
|
|
51
|
+
] })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] });
|
|
56
|
+
});
|
|
57
|
+
b.displayName = t.Content.displayName;
|
|
58
|
+
const D = ({
|
|
54
59
|
className: e,
|
|
55
|
-
...
|
|
60
|
+
...a
|
|
56
61
|
}) => /* @__PURE__ */ o(
|
|
57
62
|
"div",
|
|
58
63
|
{
|
|
@@ -60,13 +65,13 @@ const u = ({
|
|
|
60
65
|
"flex flex-col text-center sm:text-left bg-light-blue p-4 border-b",
|
|
61
66
|
e
|
|
62
67
|
),
|
|
63
|
-
...
|
|
68
|
+
...a
|
|
64
69
|
}
|
|
65
70
|
);
|
|
66
|
-
|
|
67
|
-
const
|
|
71
|
+
D.displayName = "DialogHeader";
|
|
72
|
+
const h = ({
|
|
68
73
|
className: e,
|
|
69
|
-
...
|
|
74
|
+
...a
|
|
70
75
|
}) => /* @__PURE__ */ o(
|
|
71
76
|
"div",
|
|
72
77
|
{
|
|
@@ -74,13 +79,13 @@ const N = ({
|
|
|
74
79
|
"px-6 py-6 flex-1 overflow-y-auto min-h-0",
|
|
75
80
|
e
|
|
76
81
|
),
|
|
77
|
-
...
|
|
82
|
+
...a
|
|
78
83
|
}
|
|
79
84
|
);
|
|
80
|
-
|
|
81
|
-
const
|
|
85
|
+
h.displayName = "DialogBody";
|
|
86
|
+
const v = ({
|
|
82
87
|
className: e,
|
|
83
|
-
...
|
|
88
|
+
...a
|
|
84
89
|
}) => /* @__PURE__ */ o(
|
|
85
90
|
"div",
|
|
86
91
|
{
|
|
@@ -88,12 +93,12 @@ const b = ({
|
|
|
88
93
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:items-center sm:space-x-2 px-4 py-3 border-t bg-white",
|
|
89
94
|
e
|
|
90
95
|
),
|
|
91
|
-
...
|
|
96
|
+
...a
|
|
92
97
|
}
|
|
93
98
|
);
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
99
|
+
v.displayName = "DialogFooter";
|
|
100
|
+
const w = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
101
|
+
t.Title,
|
|
97
102
|
{
|
|
98
103
|
ref: s,
|
|
99
104
|
"data-component": "dialog-title",
|
|
@@ -101,29 +106,29 @@ const D = d.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
|
|
|
101
106
|
"text-md font-bold leading-none tracking-tight text-slate-900",
|
|
102
107
|
e
|
|
103
108
|
),
|
|
104
|
-
...
|
|
109
|
+
...a
|
|
105
110
|
}
|
|
106
111
|
));
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
112
|
+
w.displayName = t.Title.displayName;
|
|
113
|
+
const T = n.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
|
|
114
|
+
t.Description,
|
|
110
115
|
{
|
|
111
116
|
ref: s,
|
|
112
117
|
className: i("text-sm text-slate-600 leading-relaxed", e),
|
|
113
|
-
...
|
|
118
|
+
...a
|
|
114
119
|
}
|
|
115
120
|
));
|
|
116
|
-
|
|
121
|
+
T.displayName = t.Description.displayName;
|
|
117
122
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
O as Dialog,
|
|
124
|
+
h as DialogBody,
|
|
125
|
+
B as DialogClose,
|
|
126
|
+
b as DialogContent,
|
|
127
|
+
T as DialogDescription,
|
|
128
|
+
v as DialogFooter,
|
|
129
|
+
D as DialogHeader,
|
|
130
|
+
r as DialogOverlay,
|
|
131
|
+
N as DialogPortal,
|
|
132
|
+
w as DialogTitle,
|
|
133
|
+
P as DialogTrigger
|
|
129
134
|
};
|