impact-nova 0.1.13 → 1.0.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/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +83 -87
- package/dist/components/ui/date-picker/date-range-picker.js +129 -125
- package/dist/components/ui/date-picker/month-picker.js +90 -93
- package/dist/components/ui/date-picker/month-range-picker.js +132 -129
- package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
- package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
- package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
- package/dist/components/ui/date-picker/week-picker.js +116 -112
- package/dist/components/ui/date-picker/week-range-picker.js +153 -142
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
interface DashboardLayoutProps extends React.ComponentProps<"div"> {
|
|
3
3
|
/**
|
|
4
|
-
* The Sidebar component (e.g. <AppSidebar />)
|
|
4
|
+
* The Sidebar component (e.g. <AppSidebar />).
|
|
5
|
+
* Will be wrapped in a SidebarProvider automatically.
|
|
5
6
|
*/
|
|
6
7
|
sidebar: React.ReactNode;
|
|
7
8
|
/**
|
|
8
|
-
* The Header component (e.g. <Header />)
|
|
9
|
+
* The Header component (e.g. <Header />).
|
|
10
|
+
* Rendered above the main content area, below header it sticks to the top.
|
|
9
11
|
*/
|
|
10
12
|
header: React.ReactNode;
|
|
11
13
|
/**
|
|
12
|
-
* Optional
|
|
14
|
+
* Optional breadcrumb node rendered inside a sticky BreadcrumbHeader bar.
|
|
15
|
+
* When provided, the bar is sticky at the top of the scroll area.
|
|
13
16
|
*/
|
|
14
17
|
breadcrumb?: React.ReactNode;
|
|
15
18
|
/**
|
|
16
|
-
* Optional
|
|
19
|
+
* Optional content rendered on the right side of the breadcrumb header bar
|
|
20
|
+
* (e.g. action buttons, view toggles, filter toggle button).
|
|
21
|
+
*/
|
|
22
|
+
breadcrumbRightContent?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Optional FilterStrip or any content rendered below the BreadcrumbHeader bar
|
|
25
|
+
* with a smooth animated collapse/expand behaviour.
|
|
26
|
+
* Visibility is controlled by the built-in "Show/Hide Filters" toggle
|
|
27
|
+
* when `filterStrip` is provided.
|
|
17
28
|
*/
|
|
18
29
|
filterStrip?: React.ReactNode;
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* When true, the filter strip is shown by default. Defaults to `true`.
|
|
32
|
+
*/
|
|
33
|
+
defaultFiltersVisible?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Main content (e.g. <Outlet /> or page-level content).
|
|
21
36
|
*/
|
|
22
37
|
children: React.ReactNode;
|
|
23
38
|
}
|
|
24
|
-
export declare function DashboardLayout({ sidebar, header, breadcrumb, filterStrip, children, className, ...props }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function DashboardLayout({ sidebar, header, breadcrumb, breadcrumbRightContent, filterStrip, defaultFiltersVisible, children, className, ...props }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
25
40
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as W, useCallback as s, useMemo as _ } from "react";
|
|
3
3
|
import { Accordion as q, AccordionItem as z, AccordionTrigger as F, AccordionContent as G } from "../accordion.js";
|
|
4
4
|
import { Button as A } from "../button.js";
|
|
@@ -7,65 +7,66 @@ import { useAccordionNestedListState as J } from "./hooks/useAccordionNestedList
|
|
|
7
7
|
import { SelectionMode as K } from "../types/nested-list.types.js";
|
|
8
8
|
import { cn as P } from "../../../lib/utils.js";
|
|
9
9
|
const re = ({
|
|
10
|
-
sections:
|
|
10
|
+
sections: l,
|
|
11
11
|
onChange: d,
|
|
12
12
|
onSubmit: h,
|
|
13
13
|
onCancel: m,
|
|
14
|
-
enableApplyDiscard:
|
|
15
|
-
submitButtonLabel:
|
|
16
|
-
cancelButtonLabel:
|
|
17
|
-
className:
|
|
14
|
+
enableApplyDiscard: N = !0,
|
|
15
|
+
submitButtonLabel: g = "Apply",
|
|
16
|
+
cancelButtonLabel: v = "Reset",
|
|
17
|
+
className: C = "",
|
|
18
18
|
enableSearch: S = !0,
|
|
19
|
-
enableDragDrop:
|
|
20
|
-
enableSelectAll:
|
|
19
|
+
enableDragDrop: b = !0,
|
|
20
|
+
enableSelectAll: y = !0,
|
|
21
21
|
selectionMode: x = K.CASCADE_DOWN,
|
|
22
22
|
searchPlaceholder: k = "Search...",
|
|
23
23
|
value: D,
|
|
24
24
|
onValueChange: V,
|
|
25
|
-
isMultiExpanded:
|
|
25
|
+
isMultiExpanded: t = !0,
|
|
26
26
|
defaultCollapseAll: j = !1,
|
|
27
|
-
validateApply:
|
|
27
|
+
validateApply: o
|
|
28
28
|
}) => {
|
|
29
29
|
const {
|
|
30
|
-
currentSections:
|
|
31
|
-
hasChanges:
|
|
30
|
+
currentSections: n,
|
|
31
|
+
hasChanges: a,
|
|
32
32
|
setCurrentSection: u,
|
|
33
33
|
saveAllSections: f,
|
|
34
34
|
discardAllSections: p
|
|
35
|
-
} = J({ sections:
|
|
36
|
-
(e,
|
|
37
|
-
u(e,
|
|
35
|
+
} = J({ sections: l }), [L, w] = W(() => j ? t ? [] : "" : l.length > 0 ? t ? [l[0].id] : l[0].id : t ? [] : ""), B = D ?? L, I = V ?? w, M = s(
|
|
36
|
+
(e, i) => {
|
|
37
|
+
u(e, i), d?.(e, i);
|
|
38
38
|
},
|
|
39
39
|
[d, u]
|
|
40
40
|
), O = s(() => {
|
|
41
|
-
f(), h?.(
|
|
42
|
-
}, [
|
|
41
|
+
f(), h?.(n);
|
|
42
|
+
}, [n, h, f]), R = s(() => {
|
|
43
43
|
p(), m?.();
|
|
44
|
-
}, [p, m]), T = _(() =>
|
|
45
|
-
return /* @__PURE__ */
|
|
44
|
+
}, [p, m]), T = _(() => a ? o ? o(n) : !0 : !1, [a, o, n]);
|
|
45
|
+
return /* @__PURE__ */ c(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
className: P("flex flex-col h-full",
|
|
49
|
-
"data-
|
|
48
|
+
className: P("flex flex-col h-full", C),
|
|
49
|
+
"data-component": "accordion-nested-list",
|
|
50
|
+
"data-has-changes": a ? "" : void 0,
|
|
50
51
|
children: [
|
|
51
52
|
/* @__PURE__ */ r("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ r(
|
|
52
53
|
q,
|
|
53
54
|
{
|
|
54
|
-
type:
|
|
55
|
+
type: t ? "multiple" : "single",
|
|
55
56
|
value: B,
|
|
56
57
|
onValueChange: I,
|
|
57
58
|
className: "space-y-4",
|
|
58
|
-
children:
|
|
59
|
+
children: l.map((e) => /* @__PURE__ */ c(z, { value: e.id, children: [
|
|
59
60
|
/* @__PURE__ */ r(F, { children: e.label }),
|
|
60
61
|
/* @__PURE__ */ r(G, { className: "min-h-0 h-full", children: /* @__PURE__ */ r("div", { className: "h-full min-h-0 pb-2", children: /* @__PURE__ */ r(
|
|
61
62
|
H,
|
|
62
63
|
{
|
|
63
|
-
items:
|
|
64
|
-
onChange: (
|
|
64
|
+
items: n[e.id] || [],
|
|
65
|
+
onChange: (i) => M(e.id, i),
|
|
65
66
|
enableApplyDiscard: !1,
|
|
66
67
|
enableSearch: S,
|
|
67
|
-
enableDragDrop:
|
|
68
|
-
enableSelectAll:
|
|
68
|
+
enableDragDrop: b,
|
|
69
|
+
enableSelectAll: y,
|
|
69
70
|
selectionMode: e.selectionMode ?? x,
|
|
70
71
|
searchPlaceholder: k,
|
|
71
72
|
className: "h-full"
|
|
@@ -74,15 +75,14 @@ const re = ({
|
|
|
74
75
|
] }, e.id))
|
|
75
76
|
}
|
|
76
77
|
) }),
|
|
77
|
-
|
|
78
|
+
N && /* @__PURE__ */ c("div", { className: "flex-shrink-0 flex justify-end gap-2 pt-4 border-t mt-4", children: [
|
|
78
79
|
/* @__PURE__ */ r(
|
|
79
80
|
A,
|
|
80
81
|
{
|
|
81
82
|
variant: "tertiary",
|
|
82
83
|
onClick: R,
|
|
83
|
-
disabled: !
|
|
84
|
-
|
|
85
|
-
children: C
|
|
84
|
+
disabled: !a,
|
|
85
|
+
children: v
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
88
|
/* @__PURE__ */ r(
|
|
@@ -91,8 +91,7 @@ const re = ({
|
|
|
91
91
|
variant: "default",
|
|
92
92
|
onClick: O,
|
|
93
93
|
disabled: !T,
|
|
94
|
-
|
|
95
|
-
children: N
|
|
94
|
+
children: g
|
|
96
95
|
}
|
|
97
96
|
)
|
|
98
97
|
] })
|
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-accordion";
|
|
4
4
|
import { ChevronRight as l } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
6
|
-
const v =
|
|
7
|
-
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
|
+
const v = t.Root, f = n.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ a(
|
|
7
|
+
t.Item,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ref: o,
|
|
10
|
+
"data-item": e.value,
|
|
11
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
12
|
+
className: s("border-b rounded-lg bg-white overflow-hidden border-b-[#D9DDE7]", r),
|
|
13
|
+
...e
|
|
12
14
|
}
|
|
13
15
|
));
|
|
14
16
|
f.displayName = "AccordionItem";
|
|
15
|
-
const p =
|
|
16
|
-
|
|
17
|
+
const p = n.forwardRef(({ className: r, children: e, badge: o, rightActions: i, ...c }, m) => /* @__PURE__ */ a(t.Header, { className: "flex", children: /* @__PURE__ */ d(
|
|
18
|
+
t.Trigger,
|
|
17
19
|
{
|
|
18
20
|
ref: m,
|
|
19
|
-
className:
|
|
21
|
+
className: s(
|
|
20
22
|
"flex flex-1 items-center gap-3 px-4 py-2 text-sm font-semibold transition-all text-left [&[data-state=open]>div>svg]:-rotate-90",
|
|
21
23
|
r
|
|
22
24
|
),
|
|
23
25
|
...c,
|
|
24
26
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-center h-8 w-8 shrink-0 rounded-lg bg-secondary text-secondary-foreground transition-transform duration-200", children: /* @__PURE__ */ a(l, { className: "h-4 w-4 transition-transform duration-200" }) }),
|
|
28
|
+
/* @__PURE__ */ d("div", { className: "flex flex-1 items-center justify-between", children: [
|
|
29
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-3", children: [
|
|
30
|
+
e,
|
|
31
|
+
o
|
|
30
32
|
] }),
|
|
31
33
|
i
|
|
32
34
|
] })
|
|
33
35
|
]
|
|
34
36
|
}
|
|
35
37
|
) }));
|
|
36
|
-
p.displayName =
|
|
37
|
-
const x =
|
|
38
|
-
|
|
38
|
+
p.displayName = t.Trigger.displayName;
|
|
39
|
+
const x = n.forwardRef(({ className: r, children: e, ...o }, i) => /* @__PURE__ */ a(
|
|
40
|
+
t.Content,
|
|
39
41
|
{
|
|
40
42
|
ref: i,
|
|
41
43
|
className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
42
|
-
...
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
+
...o,
|
|
45
|
+
children: /* @__PURE__ */ a("div", { className: s("px-4 pb-4 pt-2", r), children: e })
|
|
44
46
|
}
|
|
45
47
|
));
|
|
46
|
-
x.displayName =
|
|
48
|
+
x.displayName = t.Content.displayName;
|
|
47
49
|
export {
|
|
48
50
|
v as Accordion,
|
|
49
51
|
x as AccordionContent,
|
|
@@ -30,6 +30,11 @@ export interface CellUpdatePayload {
|
|
|
30
30
|
newValue: unknown;
|
|
31
31
|
value: unknown;
|
|
32
32
|
field: string;
|
|
33
|
+
currentCellUpdate: {
|
|
34
|
+
valueKey: string;
|
|
35
|
+
field: string;
|
|
36
|
+
newValue: unknown;
|
|
37
|
+
};
|
|
33
38
|
}
|
|
34
39
|
export interface SplitCellEditorProps extends Omit<ICellEditorParams, 'context'> {
|
|
35
40
|
splits: SplitConfig[];
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
const
|
|
4
|
-
const { splits:
|
|
5
|
-
|
|
6
|
-
field:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as U, useMemo as E, useState as I, useCallback as P } from "react";
|
|
3
|
+
const R = U((V) => {
|
|
4
|
+
const { splits: r, commonParams: f, data: s, node: o, api: p, column: m, context: i, value: a, colDef: d } = V, h = E(() => r?.map((e) => {
|
|
5
|
+
const l = e?.field?.split(".")?.pop() ?? "", n = a?.[l]?.value;
|
|
6
|
+
return { valueKey: l, field: e.field, newValue: n };
|
|
7
|
+
}) ?? [], [r, a]), [u, b] = I(h), x = P((e) => {
|
|
8
|
+
const l = u.find((t) => t.field === e);
|
|
9
|
+
if (!l)
|
|
10
|
+
return;
|
|
11
|
+
const n = {
|
|
12
|
+
api: p,
|
|
13
|
+
colDef: d,
|
|
14
|
+
column: m,
|
|
15
|
+
context: i,
|
|
16
|
+
data: s,
|
|
17
|
+
field: d.field,
|
|
18
|
+
node: o,
|
|
19
|
+
rowIndex: o?.rowIndex ?? null,
|
|
20
|
+
rowPinned: o?.rowPinned ?? void 0,
|
|
19
21
|
source: "edit",
|
|
20
22
|
type: "cellValueChanged",
|
|
21
|
-
currentCellUpdate:
|
|
22
|
-
newValue: { [
|
|
23
|
-
oldValue: { [
|
|
24
|
-
value: { [
|
|
23
|
+
currentCellUpdate: l,
|
|
24
|
+
newValue: { [l.valueKey]: { value: l.newValue } },
|
|
25
|
+
oldValue: { [l.valueKey]: { value: a?.[l.valueKey]?.value } },
|
|
26
|
+
value: { [l.valueKey]: { value: l.newValue } }
|
|
25
27
|
};
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
+
o.setDataValue(d.field, { ...a, [l.valueKey]: { value: l.newValue } }), i?.onCellUpdate?.(n);
|
|
29
|
+
}, [u, p, d, m, i, s, o, a]), N = (e) => {
|
|
28
30
|
if (typeof e == "string") {
|
|
29
|
-
const l =
|
|
30
|
-
return
|
|
31
|
+
const l = p?.getGridOption("components");
|
|
32
|
+
return i?.frameworkComponents?.[e] || l?.[e];
|
|
31
33
|
}
|
|
32
34
|
return e;
|
|
33
|
-
},
|
|
35
|
+
}, $ = (e, l) => {
|
|
34
36
|
if (!l) return "--";
|
|
35
37
|
let n = l;
|
|
36
38
|
switch (e?.decimals != null && !isNaN(Number(l)) && (n = Number(l).toFixed(e.decimals)), e.type) {
|
|
@@ -46,44 +48,40 @@ const K = x((y, S) => {
|
|
|
46
48
|
return n;
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ c(
|
|
50
52
|
"div",
|
|
51
53
|
{
|
|
52
|
-
style: { display: "grid", gridTemplateRows: `repeat(${
|
|
53
|
-
children:
|
|
54
|
-
const n = e?.field?.split(".")?.pop(), t = a?.[n]?.value;
|
|
55
|
-
|
|
56
|
-
valueKey: n,
|
|
57
|
-
field: e.field,
|
|
58
|
-
newValue: t
|
|
59
|
-
};
|
|
60
|
-
const b = e?.valueFormatter ? V(e.valueFormatter, t?.toString()) : t?.toString(), v = e.editable ? c.cellEditor : c.cellRenderer ? c.cellRenderer : void 0, w = v ? h(v) : void 0;
|
|
61
|
-
return /* @__PURE__ */ d(
|
|
54
|
+
style: { display: "grid", gridTemplateRows: `repeat(${r?.length}, 1fr)`, height: "100%", width: "100%" },
|
|
55
|
+
children: r?.map((e, l) => {
|
|
56
|
+
const n = e?.field?.split(".")?.pop(), t = a?.[n]?.value, v = s?.valueFormatter ?? e?.valueFormatter ?? null, S = v ? $(v, t?.toString()) : t?.toString(), w = e.editable ? f.cellEditor : f.cellRenderer ? f.cellRenderer : void 0, g = w ? N(w) : void 0;
|
|
57
|
+
return /* @__PURE__ */ c(
|
|
62
58
|
"div",
|
|
63
59
|
{
|
|
64
60
|
className: "flex items-center max-h-full overflow-hidden",
|
|
65
|
-
children:
|
|
66
|
-
|
|
61
|
+
children: g ? /* @__PURE__ */ c(
|
|
62
|
+
g,
|
|
67
63
|
{
|
|
68
|
-
context:
|
|
69
|
-
data:
|
|
64
|
+
context: i,
|
|
65
|
+
data: s,
|
|
70
66
|
value: t,
|
|
71
|
-
onValueChange: (
|
|
72
|
-
|
|
67
|
+
onValueChange: (y) => {
|
|
68
|
+
const C = u.find((K) => K.field === e.field);
|
|
69
|
+
C ? C.newValue = y : b([...u, {
|
|
73
70
|
valueKey: n,
|
|
74
71
|
field: e.field,
|
|
75
|
-
newValue:
|
|
76
|
-
};
|
|
72
|
+
newValue: y
|
|
73
|
+
}]);
|
|
77
74
|
},
|
|
78
|
-
valueFormatted:
|
|
75
|
+
valueFormatted: S,
|
|
79
76
|
colDef: e,
|
|
80
77
|
stopEditing: () => {
|
|
81
|
-
|
|
78
|
+
x(e.field);
|
|
82
79
|
},
|
|
80
|
+
node: o,
|
|
83
81
|
suppressAutoFocus: l !== 0,
|
|
84
|
-
className: l !==
|
|
82
|
+
className: l !== r.length - 1 ? "border-b border-gray-200" : ""
|
|
85
83
|
}
|
|
86
|
-
) : /* @__PURE__ */
|
|
84
|
+
) : /* @__PURE__ */ c(
|
|
87
85
|
"div",
|
|
88
86
|
{
|
|
89
87
|
className: "w-full h-full flex items-center ag-cell-inner-padding overflow-hidden text-ellipsis whitespace-nowrap",
|
|
@@ -97,7 +95,7 @@ const K = x((y, S) => {
|
|
|
97
95
|
}
|
|
98
96
|
);
|
|
99
97
|
});
|
|
100
|
-
|
|
98
|
+
R.displayName = "SplitCellEditor";
|
|
101
99
|
export {
|
|
102
|
-
|
|
100
|
+
R as SplitCellEditor
|
|
103
101
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
const
|
|
4
|
-
const { splits:
|
|
5
|
-
if (!
|
|
6
|
-
const g = (
|
|
7
|
-
if (!
|
|
8
|
-
let
|
|
9
|
-
switch (
|
|
3
|
+
const w = (m) => {
|
|
4
|
+
const { splits: n, commonParams: i, data: s, node: p, api: c, column: u, context: a, value: f } = m;
|
|
5
|
+
if (!n || !Array.isArray(n)) return null;
|
|
6
|
+
const g = (r, e) => {
|
|
7
|
+
if (!e) return "--";
|
|
8
|
+
let t = e;
|
|
9
|
+
switch (r?.decimals != null && !isNaN(Number(e)) && (t = Number(e).toFixed(r.decimals)), r.type) {
|
|
10
10
|
case "currencySymbol": {
|
|
11
|
-
const l =
|
|
12
|
-
return
|
|
11
|
+
const l = r.symbol ?? "$";
|
|
12
|
+
return r.position === "suffix" ? `${t} ${l}` : `${l} ${t}`;
|
|
13
13
|
}
|
|
14
14
|
case "percentage":
|
|
15
|
-
return `${
|
|
15
|
+
return `${t} %`;
|
|
16
16
|
case "number":
|
|
17
|
-
return
|
|
17
|
+
return t;
|
|
18
18
|
default:
|
|
19
|
-
return
|
|
19
|
+
return t;
|
|
20
20
|
}
|
|
21
|
-
}, h = (
|
|
22
|
-
const
|
|
23
|
-
if (typeof
|
|
24
|
-
const
|
|
25
|
-
return
|
|
21
|
+
}, h = (r) => {
|
|
22
|
+
const e = r;
|
|
23
|
+
if (typeof e == "string") {
|
|
24
|
+
const t = c?.getGridOption("components");
|
|
25
|
+
return a?.frameworkComponents?.[e] || t?.[e];
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return e;
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateRows: `repeat(${
|
|
30
|
-
const
|
|
29
|
+
return /* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateRows: `repeat(${n?.length}, 1fr)`, height: "100%", width: "100%" }, children: n?.map((r, e) => {
|
|
30
|
+
const t = f?.[r?.field?.split(".")?.pop()]?.value?.toString(), l = s?.valueFormatter ?? r?.valueFormatter ?? null, y = l ? g(l, t?.toString()) : t, d = i?.cellRenderer && typeof i?.cellRenderer == "string" ? h(i?.cellRenderer) : void 0;
|
|
31
31
|
return /* @__PURE__ */ o(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
className: "flex items-center overflow-hidden",
|
|
35
|
-
"data-split-index":
|
|
36
|
-
children:
|
|
37
|
-
|
|
35
|
+
"data-split-index": e,
|
|
36
|
+
children: d ? /* @__PURE__ */ o(
|
|
37
|
+
d,
|
|
38
38
|
{
|
|
39
39
|
node: p,
|
|
40
|
-
api:
|
|
41
|
-
column:
|
|
42
|
-
context:
|
|
43
|
-
data:
|
|
44
|
-
value:
|
|
45
|
-
colDef:
|
|
46
|
-
valueFormatted:
|
|
47
|
-
className:
|
|
40
|
+
api: c,
|
|
41
|
+
column: u,
|
|
42
|
+
context: a,
|
|
43
|
+
data: s,
|
|
44
|
+
value: t,
|
|
45
|
+
colDef: r,
|
|
46
|
+
valueFormatted: y,
|
|
47
|
+
className: e !== n.length - 1 ? "border-b border-gray-200" : ""
|
|
48
48
|
}
|
|
49
49
|
) : /* @__PURE__ */ o(
|
|
50
50
|
"div",
|
|
@@ -54,11 +54,11 @@ const y = (d) => {
|
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
},
|
|
57
|
-
`${
|
|
57
|
+
`${r.field}-${e}`
|
|
58
58
|
);
|
|
59
59
|
}) });
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
w.displayName = "SplitCellRenderer";
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
w as SplitCellRenderer
|
|
64
64
|
};
|
|
@@ -53,7 +53,7 @@ const E = {
|
|
|
53
53
|
}, w = [
|
|
54
54
|
{ label: "all", value: "AND" },
|
|
55
55
|
{ label: "any", value: "OR" }
|
|
56
|
-
],
|
|
56
|
+
], G = ({
|
|
57
57
|
columnId: h,
|
|
58
58
|
columnLabel: y,
|
|
59
59
|
columnType: n,
|
|
@@ -75,7 +75,7 @@ const E = {
|
|
|
75
75
|
}
|
|
76
76
|
}, o = (e, t) => {
|
|
77
77
|
v(i.map((a) => a.id === e ? { ...a, ...t } : a));
|
|
78
|
-
},
|
|
78
|
+
}, R = (e) => {
|
|
79
79
|
if (e.operator === "empty" || e.operator === "notEmpty")
|
|
80
80
|
return /* @__PURE__ */ l("span", { className: "text-slate-400 italic text-sm", children: "No value needed" });
|
|
81
81
|
if (n === "date")
|
|
@@ -116,7 +116,6 @@ const E = {
|
|
|
116
116
|
Array.isArray(a) ? o(e.id, { value: a.map((r) => r.value) }) : o(e.id, { value: a?.value || "" });
|
|
117
117
|
},
|
|
118
118
|
isMulti: u !== void 0 ? u : !0,
|
|
119
|
-
dropdownZIndex: 320,
|
|
120
119
|
placeholder: u === !1 ? "Select value" : "Select values...",
|
|
121
120
|
className: "w-full",
|
|
122
121
|
menuPortalTarget: document.body
|
|
@@ -153,7 +152,7 @@ const E = {
|
|
|
153
152
|
className: "w-full"
|
|
154
153
|
}
|
|
155
154
|
);
|
|
156
|
-
},
|
|
155
|
+
}, I = (e) => {
|
|
157
156
|
const t = g.find((a) => a.value === e.operator);
|
|
158
157
|
return /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
159
158
|
/* @__PURE__ */ l("div", { className: "w-[120px] shrink-0", children: /* @__PURE__ */ l(
|
|
@@ -165,13 +164,12 @@ const E = {
|
|
|
165
164
|
const r = a;
|
|
166
165
|
r && o(e.id, { operator: r.value });
|
|
167
166
|
},
|
|
168
|
-
dropdownZIndex: 320,
|
|
169
167
|
placeholder: "Operator",
|
|
170
168
|
className: "w-full",
|
|
171
169
|
menuPortalTarget: document.body
|
|
172
170
|
}
|
|
173
171
|
) }),
|
|
174
|
-
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children:
|
|
172
|
+
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: R(e) }),
|
|
175
173
|
/* @__PURE__ */ l(
|
|
176
174
|
m,
|
|
177
175
|
{
|
|
@@ -180,7 +178,7 @@ const E = {
|
|
|
180
178
|
size: "icon",
|
|
181
179
|
"aria-label": "Remove rule",
|
|
182
180
|
disabled: i.length === 1 && !d,
|
|
183
|
-
children: /* @__PURE__ */ l(x, { size:
|
|
181
|
+
children: /* @__PURE__ */ l(x, { size: "xs" })
|
|
184
182
|
}
|
|
185
183
|
)
|
|
186
184
|
] }, e.id);
|
|
@@ -197,7 +195,6 @@ const E = {
|
|
|
197
195
|
const t = e;
|
|
198
196
|
t && S(t.value);
|
|
199
197
|
},
|
|
200
|
-
dropdownZIndex: 320,
|
|
201
198
|
className: "h-8",
|
|
202
199
|
menuPortalTarget: document.body,
|
|
203
200
|
isClearable: !1
|
|
@@ -206,7 +203,7 @@ const E = {
|
|
|
206
203
|
/* @__PURE__ */ l("span", { children: "of the following rules for column" }),
|
|
207
204
|
/* @__PURE__ */ l("span", { className: "font-semibold text-slate-700", children: y })
|
|
208
205
|
] }),
|
|
209
|
-
/* @__PURE__ */ l("div", { className: "flex flex-col gap-3", children: i.map((e) =>
|
|
206
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col gap-3", children: i.map((e) => I(e)) }),
|
|
210
207
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-1", children: [
|
|
211
208
|
/* @__PURE__ */ l(m, { onClick: C, variant: "outline", size: "sm", children: "+ Add Rule" }),
|
|
212
209
|
b && /* @__PURE__ */ s(
|
|
@@ -217,7 +214,7 @@ const E = {
|
|
|
217
214
|
onClick: b,
|
|
218
215
|
className: "text-red-500 hover:text-red-600 hover:bg-red-50 border-red-300",
|
|
219
216
|
children: [
|
|
220
|
-
/* @__PURE__ */ l(x, { size:
|
|
217
|
+
/* @__PURE__ */ l(x, { size: "xs" }),
|
|
221
218
|
"Delete"
|
|
222
219
|
]
|
|
223
220
|
}
|
|
@@ -226,5 +223,5 @@ const E = {
|
|
|
226
223
|
] });
|
|
227
224
|
};
|
|
228
225
|
export {
|
|
229
|
-
|
|
226
|
+
G as ColumnFilterSection
|
|
230
227
|
};
|