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,148 +1,150 @@
|
|
|
1
1
|
import { jsxs as g, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { isValid as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
import { Tooltip as
|
|
11
|
-
import { resolveWeekSelection as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { X as te } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as oe } from "../../../icons/index.js";
|
|
5
|
+
import { isValid as w, parse as P, format as E } from "date-fns";
|
|
6
|
+
import { cn as re, padValidDateString as ie, maskDate as se } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as ce } from "../input.js";
|
|
8
|
+
import { Popover as le, PopoverTrigger as pe, PopoverContent as ae } from "../popover.js";
|
|
9
|
+
import { Calendar as de } from "../calendar.js";
|
|
10
|
+
import { Tooltip as O, TooltipTrigger as $, TooltipContent as H } from "../tooltip.js";
|
|
11
|
+
import { resolveWeekSelection as fe } from "../../../lib/fiscal-calendar.js";
|
|
12
|
+
import { getDateFnsLocale as he } from "../../../i18n/getDateFnsLocale.js";
|
|
13
|
+
import { useImpactNovaI18n as ue } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
14
|
+
const a = (e, s = "MM/dd/yyyy", n) => {
|
|
15
|
+
const k = E(e.startDate, s, n ? { locale: n } : {}), y = E(e.endDate, s, n ? { locale: n } : {});
|
|
16
|
+
return `${k} - ${y}`;
|
|
17
|
+
}, me = i.forwardRef(
|
|
16
18
|
({
|
|
17
19
|
value: e,
|
|
18
|
-
onChange:
|
|
19
|
-
format:
|
|
20
|
-
placeholder: k
|
|
21
|
-
minDate:
|
|
22
|
-
maxDate:
|
|
23
|
-
startMonth:
|
|
24
|
-
endMonth:
|
|
20
|
+
onChange: s,
|
|
21
|
+
format: n = "MM/dd/yyyy",
|
|
22
|
+
placeholder: k,
|
|
23
|
+
minDate: y,
|
|
24
|
+
maxDate: X,
|
|
25
|
+
startMonth: q,
|
|
26
|
+
endMonth: z,
|
|
25
27
|
showFooter: d = !0,
|
|
26
|
-
calendarType:
|
|
27
|
-
fiscalMode:
|
|
28
|
-
selectionMode:
|
|
29
|
-
fiscalMonthPattern:
|
|
30
|
-
fiscalYearStartMonth:
|
|
31
|
-
weekStartsOn:
|
|
32
|
-
disabled:
|
|
33
|
-
className:
|
|
34
|
-
...
|
|
35
|
-
},
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
calendarType:
|
|
54
|
-
fiscalMode:
|
|
55
|
-
selectionMode:
|
|
56
|
-
fiscalMonthPattern:
|
|
57
|
-
fiscalYearStartMonth:
|
|
58
|
-
weekStartsOn:
|
|
59
|
-
}),
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
28
|
+
calendarType: x = "calendar",
|
|
29
|
+
fiscalMode: S = "basic",
|
|
30
|
+
selectionMode: I = "week",
|
|
31
|
+
fiscalMonthPattern: N,
|
|
32
|
+
fiscalYearStartMonth: T = 1,
|
|
33
|
+
weekStartsOn: V = 1,
|
|
34
|
+
disabled: M,
|
|
35
|
+
className: G,
|
|
36
|
+
...J
|
|
37
|
+
}, K) => {
|
|
38
|
+
const { locale: A, t: D } = ue(), o = i.useMemo(() => he(A), [A]), Q = k ?? D("datePicker.selectWeek"), L = i.useRef(null);
|
|
39
|
+
i.useRef(null), i.useImperativeHandle(K, () => L.current);
|
|
40
|
+
const [c, u] = i.useState(!1), [R, l] = i.useState(e), [f, p] = i.useState(e ? a(e, n, o) : ""), [U, C] = i.useState(e?.startDate || /* @__PURE__ */ new Date());
|
|
41
|
+
i.useEffect(() => {
|
|
42
|
+
c || (p(e ? a(e, n, o) : ""), l(e));
|
|
43
|
+
}, [c, e, n, o]), i.useEffect(() => {
|
|
44
|
+
c && (l(e), C(e?.startDate || /* @__PURE__ */ new Date()), p(e ? a(e, n, o) : ""));
|
|
45
|
+
}, [c, e, n, o]);
|
|
46
|
+
const Z = (t) => {
|
|
47
|
+
l(t), t && p(a(t, n, o)), d || (s?.(t), u(!1));
|
|
48
|
+
}, _ = (t) => {
|
|
49
|
+
s?.(t !== void 0 ? t : R), u(!1);
|
|
50
|
+
}, Y = () => {
|
|
51
|
+
l(e), p(e ? a(e, n, o) : ""), u(!1);
|
|
52
|
+
}, v = () => {
|
|
53
|
+
l(void 0), p(""), s?.(void 0), d || u(!1);
|
|
54
|
+
}, b = (t) => fe(t, {
|
|
55
|
+
calendarType: x,
|
|
56
|
+
fiscalMode: S,
|
|
57
|
+
selectionMode: I,
|
|
58
|
+
fiscalMonthPattern: N,
|
|
59
|
+
fiscalYearStartMonth: T,
|
|
60
|
+
weekStartsOn: V
|
|
61
|
+
}), F = (t) => {
|
|
62
|
+
const m = t.target.value, h = se(m, n, f);
|
|
63
|
+
if (p(h), h === "") {
|
|
64
|
+
l(void 0), d || s?.(void 0);
|
|
63
65
|
return;
|
|
64
66
|
}
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const W = P(h, n, /* @__PURE__ */ new Date(), { locale: o });
|
|
68
|
+
if (w(W) && h.length === n.length) {
|
|
69
|
+
const B = b(W);
|
|
70
|
+
l(B), C(W), d || s?.(B);
|
|
69
71
|
}
|
|
70
|
-
},
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
|
|
75
|
-
else if (
|
|
76
|
-
const
|
|
77
|
-
|
|
72
|
+
}, ee = () => {
|
|
73
|
+
if (c) return;
|
|
74
|
+
const t = ie(f, n), m = P(t, n, /* @__PURE__ */ new Date(), { locale: o });
|
|
75
|
+
if (!w(m) || t.length !== n.length)
|
|
76
|
+
p(e ? a(e, n, o) : ""), l(e);
|
|
77
|
+
else if (p(t), !d) {
|
|
78
|
+
const h = b(m);
|
|
79
|
+
s?.(h);
|
|
78
80
|
}
|
|
79
|
-
},
|
|
80
|
-
return /* @__PURE__ */ g(
|
|
81
|
-
/* @__PURE__ */ r(
|
|
82
|
-
|
|
81
|
+
}, j = (e ? a(e, n, o) : "") !== f, ne = f.length === n.length && !w(P(f, n, /* @__PURE__ */ new Date(), { locale: o }));
|
|
82
|
+
return /* @__PURE__ */ g(le, { open: c, onOpenChange: u, children: [
|
|
83
|
+
/* @__PURE__ */ r(pe, { asChild: !0, children: /* @__PURE__ */ r("div", { "data-component": "week-picker", "data-state": c ? "open" : "closed", "data-pending": j || void 0, children: /* @__PURE__ */ r(
|
|
84
|
+
ce,
|
|
83
85
|
{
|
|
84
|
-
ref:
|
|
85
|
-
value:
|
|
86
|
-
onChange:
|
|
87
|
-
onBlur:
|
|
88
|
-
onClick: (
|
|
89
|
-
placeholder:
|
|
90
|
-
disabled:
|
|
86
|
+
ref: L,
|
|
87
|
+
value: f,
|
|
88
|
+
onChange: F,
|
|
89
|
+
onBlur: ee,
|
|
90
|
+
onClick: (t) => c && t.stopPropagation(),
|
|
91
|
+
placeholder: c ? n : Q,
|
|
92
|
+
disabled: M,
|
|
91
93
|
"data-form-control": "input",
|
|
92
|
-
className:
|
|
94
|
+
className: re(
|
|
93
95
|
"cursor-pointer",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
ne ? "text-destructive" : j ? "text-muted-foreground" : "",
|
|
97
|
+
G
|
|
96
98
|
),
|
|
97
99
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
98
|
-
e && !
|
|
99
|
-
/* @__PURE__ */ r(
|
|
100
|
-
|
|
100
|
+
e && !M && /* @__PURE__ */ g(O, { children: [
|
|
101
|
+
/* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ r(
|
|
102
|
+
te,
|
|
101
103
|
{
|
|
102
104
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
103
|
-
onClick: (
|
|
104
|
-
|
|
105
|
+
onClick: (t) => {
|
|
106
|
+
t.stopPropagation(), v();
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
) }),
|
|
108
|
-
/* @__PURE__ */ r(
|
|
110
|
+
/* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: D("calendar.clear") })
|
|
109
111
|
] }),
|
|
110
|
-
/* @__PURE__ */ g(
|
|
111
|
-
/* @__PURE__ */ r(
|
|
112
|
-
/* @__PURE__ */ r(
|
|
112
|
+
/* @__PURE__ */ g(O, { children: [
|
|
113
|
+
/* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ r(oe, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
114
|
+
/* @__PURE__ */ r(H, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
|
|
113
115
|
] })
|
|
114
116
|
] }),
|
|
115
|
-
...
|
|
117
|
+
...J
|
|
116
118
|
}
|
|
117
119
|
) }) }),
|
|
118
120
|
/* @__PURE__ */ r(
|
|
119
|
-
|
|
121
|
+
ae,
|
|
120
122
|
{
|
|
121
123
|
className: "w-auto p-0",
|
|
122
124
|
align: "start",
|
|
123
|
-
onOpenAutoFocus: (
|
|
125
|
+
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
124
126
|
children: /* @__PURE__ */ r(
|
|
125
|
-
|
|
127
|
+
de,
|
|
126
128
|
{
|
|
127
129
|
pickerType: "week",
|
|
128
130
|
weekMode: "single",
|
|
129
|
-
selectedWeeks:
|
|
130
|
-
onWeekSelect:
|
|
131
|
-
month:
|
|
132
|
-
onMonthChange:
|
|
133
|
-
disabled: { before:
|
|
134
|
-
startMonth:
|
|
135
|
-
endMonth:
|
|
131
|
+
selectedWeeks: R,
|
|
132
|
+
onWeekSelect: Z,
|
|
133
|
+
month: U,
|
|
134
|
+
onMonthChange: C,
|
|
135
|
+
disabled: { before: y, after: X },
|
|
136
|
+
startMonth: q,
|
|
137
|
+
endMonth: z,
|
|
136
138
|
showFooter: d,
|
|
137
|
-
calendarType:
|
|
138
|
-
fiscalMode:
|
|
139
|
-
selectionMode:
|
|
140
|
-
fiscalMonthPattern:
|
|
141
|
-
fiscalYearStartMonth:
|
|
142
|
-
weekStartsOn:
|
|
143
|
-
onApply:
|
|
144
|
-
onCancel:
|
|
145
|
-
onClear:
|
|
139
|
+
calendarType: x,
|
|
140
|
+
fiscalMode: S,
|
|
141
|
+
selectionMode: I,
|
|
142
|
+
fiscalMonthPattern: N,
|
|
143
|
+
fiscalYearStartMonth: T,
|
|
144
|
+
weekStartsOn: V,
|
|
145
|
+
onApply: _,
|
|
146
|
+
onCancel: Y,
|
|
147
|
+
onClear: v,
|
|
146
148
|
captionLayout: "dropdown"
|
|
147
149
|
}
|
|
148
150
|
)
|
|
@@ -151,7 +153,7 @@ const p = (e, i = "MM/dd/yyyy") => {
|
|
|
151
153
|
] });
|
|
152
154
|
}
|
|
153
155
|
);
|
|
154
|
-
|
|
156
|
+
me.displayName = "WeekPicker";
|
|
155
157
|
export {
|
|
156
|
-
|
|
158
|
+
me as WeekPicker
|
|
157
159
|
};
|