impact-nova 0.1.13 → 1.1.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/date-display-renderer.js +32 -21
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
- 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 +93 -93
- package/dist/components/ui/date-picker/date-range-picker.js +142 -133
- package/dist/components/ui/date-picker/month-picker.js +96 -93
- package/dist/components/ui/date-picker/month-range-picker.js +144 -134
- package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
- package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
- package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
- package/dist/components/ui/date-picker/week-picker.js +119 -109
- package/dist/components/ui/date-picker/week-range-picker.js +170 -147
- 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/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.js +29 -13
- 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,30 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { defaultDropAnimationSideEffects as Ue } from "@dnd-kit/core";
|
|
1
|
+
import { jsx as I, jsxs as te } from "react/jsx-runtime";
|
|
2
|
+
import se, { useMemo as D, useCallback as T } from "react";
|
|
4
3
|
import { SortableItem as _e } from "./components/SortableItem.js";
|
|
5
|
-
import { SelectionMode as
|
|
6
|
-
import { useNestedListDragDrop as
|
|
7
|
-
import { useNestedListSelectAll as
|
|
8
|
-
import { useNestedListState as
|
|
9
|
-
import { useNestedListHandlers as
|
|
10
|
-
import { NestedListHeader as
|
|
11
|
-
import { NestedListCategoryFilters as
|
|
12
|
-
import { NestedListContent as
|
|
13
|
-
import { NestedListApplyDiscardButtons as
|
|
14
|
-
import { cn as
|
|
15
|
-
const
|
|
16
|
-
if (!t || typeof t != "string") return
|
|
4
|
+
import { SelectionMode as U } from "../types/nested-list.types.js";
|
|
5
|
+
import { useNestedListDragDrop as ye } from "./hooks/useNestedListDragDrop.js";
|
|
6
|
+
import { useNestedListSelectAll as He } from "./hooks/useNestedListSelectAll.js";
|
|
7
|
+
import { useNestedListState as We } from "./hooks/useNestedListState.js";
|
|
8
|
+
import { useNestedListHandlers as je } from "./hooks/useNestedListHandlers.js";
|
|
9
|
+
import { NestedListHeader as Be } from "./components/NestedListHeader.js";
|
|
10
|
+
import { NestedListCategoryFilters as Fe } from "./components/NestedListCategoryFilters.js";
|
|
11
|
+
import { NestedListContent as Je } from "./components/NestedListContent.js";
|
|
12
|
+
import { NestedListApplyDiscardButtons as qe } from "./components/NestedListApplyDiscardButtons.js";
|
|
13
|
+
import { cn as Ke } from "../../../lib/utils.js";
|
|
14
|
+
const re = (d, t) => {
|
|
15
|
+
if (!t || typeof t != "string") return d;
|
|
17
16
|
const o = t.toLowerCase(), c = [];
|
|
18
|
-
return
|
|
19
|
-
const l = s.label.toLowerCase().includes(o),
|
|
20
|
-
(l ||
|
|
17
|
+
return d.forEach((s) => {
|
|
18
|
+
const l = s.label.toLowerCase().includes(o), f = s.children ? re(s.children, t) : void 0;
|
|
19
|
+
(l || f && f.length > 0) && c.push({
|
|
21
20
|
...s,
|
|
22
|
-
children:
|
|
21
|
+
children: f || s.children
|
|
23
22
|
});
|
|
24
23
|
}), c;
|
|
25
|
-
},
|
|
24
|
+
}, ne = (d) => d.map((t) => {
|
|
26
25
|
if (t.children && t.children.length > 0) {
|
|
27
|
-
const o =
|
|
26
|
+
const o = ne(t.children), c = o.every((s) => s.checked);
|
|
28
27
|
return {
|
|
29
28
|
...t,
|
|
30
29
|
checked: c,
|
|
@@ -32,141 +31,134 @@ const se = (i, t) => {
|
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
33
|
return t;
|
|
35
|
-
}),
|
|
34
|
+
}), Qe = (d, t) => {
|
|
36
35
|
const o = /* @__PURE__ */ new Set(), c = (s) => {
|
|
37
36
|
s.forEach((l) => {
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
const f = t ? t(l) : l.category;
|
|
38
|
+
f && o.add(f), l.children && c(l.children);
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
|
-
return c(
|
|
43
|
-
},
|
|
44
|
-
if (t.size === 0) return
|
|
41
|
+
return c(d), Array.from(o).sort();
|
|
42
|
+
}, le = (d, t, o) => {
|
|
43
|
+
if (t.size === 0) return d;
|
|
45
44
|
const c = [];
|
|
46
|
-
return
|
|
47
|
-
const l = o ? o(s) : s.category,
|
|
48
|
-
(
|
|
45
|
+
return d.forEach((s) => {
|
|
46
|
+
const l = o ? o(s) : s.category, f = l && t.has(l), S = s.children ? le(s.children, t, o) : void 0;
|
|
47
|
+
(f || S && S.length > 0) && c.push({
|
|
49
48
|
...s,
|
|
50
|
-
children:
|
|
49
|
+
children: S
|
|
51
50
|
});
|
|
52
51
|
}), c;
|
|
53
|
-
},
|
|
52
|
+
}, oe = (d, t, o, c = 0) => {
|
|
54
53
|
const s = [];
|
|
55
|
-
return
|
|
54
|
+
return d.forEach((l) => {
|
|
56
55
|
s.push({ item: l, level: c }), !t[l.id] && l.children && l.children.length > 0 && l.id !== o && s.push(
|
|
57
|
-
...
|
|
56
|
+
...oe(l.children, t, o, c + 1)
|
|
58
57
|
);
|
|
59
58
|
}), s;
|
|
60
|
-
},
|
|
61
|
-
items:
|
|
59
|
+
}, ot = ({
|
|
60
|
+
items: d,
|
|
62
61
|
onChange: t,
|
|
63
62
|
onSubmit: o,
|
|
64
63
|
onCancel: c,
|
|
65
64
|
onItemToggle: s,
|
|
66
65
|
onDragEnd: l,
|
|
67
|
-
enableSearch:
|
|
68
|
-
enableDragDrop:
|
|
69
|
-
enableSelectAll:
|
|
66
|
+
enableSearch: f = !0,
|
|
67
|
+
enableDragDrop: S = !0,
|
|
68
|
+
enableSelectAll: ce = !0,
|
|
70
69
|
enableGroupBy: k = !1,
|
|
71
70
|
getCategory: C,
|
|
72
|
-
searchPlaceholder:
|
|
71
|
+
searchPlaceholder: de = "Search...",
|
|
73
72
|
className: ie = "",
|
|
74
|
-
groupLabel:
|
|
73
|
+
groupLabel: ae,
|
|
75
74
|
enableApplyDiscard: p = !1,
|
|
76
|
-
enableCollapse:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
enableCollapse: F = !0,
|
|
76
|
+
enableGlobalCollapse: he = !0,
|
|
77
|
+
submitButtonLabel: ue = "Apply",
|
|
78
|
+
cancelButtonLabel: fe = "Reset",
|
|
79
|
+
selectionMode: N = U.CASCADE_DOWN
|
|
80
80
|
}) => {
|
|
81
81
|
const {
|
|
82
82
|
items: a,
|
|
83
83
|
setItems: g,
|
|
84
|
-
savedItems:
|
|
84
|
+
savedItems: w,
|
|
85
85
|
setSavedItems: J,
|
|
86
|
-
isUserChangeRef:
|
|
86
|
+
isUserChangeRef: A,
|
|
87
87
|
searchText: x,
|
|
88
|
-
setSearchText:
|
|
88
|
+
setSearchText: pe,
|
|
89
89
|
collapsedItems: R,
|
|
90
|
-
setCollapsedItems:
|
|
91
|
-
isListCollapsed:
|
|
92
|
-
setIsListCollapsed:
|
|
93
|
-
activeId:
|
|
90
|
+
setCollapsedItems: Se,
|
|
91
|
+
isListCollapsed: z,
|
|
92
|
+
setIsListCollapsed: me,
|
|
93
|
+
activeId: v,
|
|
94
94
|
setActiveId: _,
|
|
95
|
-
setOverId:
|
|
96
|
-
selectedCategories:
|
|
97
|
-
setSelectedCategories:
|
|
95
|
+
setOverId: y,
|
|
96
|
+
selectedCategories: O,
|
|
97
|
+
setSelectedCategories: Ce,
|
|
98
98
|
itemsToBlink: q,
|
|
99
|
-
setItemsToBlink:
|
|
99
|
+
setItemsToBlink: H,
|
|
100
100
|
// Normalized state helpers (for optimized operations)
|
|
101
|
-
isNormalized:
|
|
102
|
-
normalizedState:
|
|
103
|
-
batchUpdateItems:
|
|
104
|
-
} =
|
|
105
|
-
initialItems:
|
|
101
|
+
isNormalized: Ne,
|
|
102
|
+
normalizedState: ge,
|
|
103
|
+
batchUpdateItems: ve
|
|
104
|
+
} = We({
|
|
105
|
+
initialItems: d,
|
|
106
106
|
enableApplyDiscard: p,
|
|
107
107
|
// Enable normalized state for large datasets (can be made configurable via props)
|
|
108
|
-
enableNormalizedState:
|
|
109
|
-
}), [
|
|
110
|
-
sensors:
|
|
111
|
-
handleDragEnd:
|
|
108
|
+
enableNormalizedState: d.length > 1e3
|
|
109
|
+
}), [P, K] = se.useState(0), [V, Ie] = se.useState(0), {
|
|
110
|
+
sensors: ke,
|
|
111
|
+
handleDragEnd: Ee,
|
|
112
112
|
isValidDrop: Q
|
|
113
|
-
} =
|
|
113
|
+
} = ye({
|
|
114
114
|
items: a,
|
|
115
115
|
onDragEnd: l
|
|
116
|
-
}),
|
|
117
|
-
() => k ?
|
|
116
|
+
}), Le = D(
|
|
117
|
+
() => k ? Qe(a, C) : [],
|
|
118
118
|
[a, k, C]
|
|
119
|
-
),
|
|
119
|
+
), m = D(() => {
|
|
120
120
|
let e = a;
|
|
121
|
-
return k &&
|
|
122
|
-
}, [a, x, k,
|
|
123
|
-
() =>
|
|
124
|
-
[
|
|
125
|
-
), { allChecked: E, someChecked:
|
|
121
|
+
return k && O.size > 0 && (e = le(e, O, C)), x && (e = re(e, x)), e;
|
|
122
|
+
}, [a, x, k, O, C]), De = D(
|
|
123
|
+
() => oe(m, R, v),
|
|
124
|
+
[m, R, v]
|
|
125
|
+
), { allChecked: E, someChecked: Te } = D(() => {
|
|
126
126
|
let e = !0, r = !1;
|
|
127
|
-
const n = (
|
|
128
|
-
for (const h of
|
|
127
|
+
const n = (u) => {
|
|
128
|
+
for (const h of u)
|
|
129
129
|
if (h.children && h.children.length > 0 ? n(h.children) : h.checked ? r = !0 : e = !1, r && !e) return;
|
|
130
130
|
};
|
|
131
|
-
return n(
|
|
132
|
-
}, [
|
|
131
|
+
return n(m), { allChecked: e && r, someChecked: r };
|
|
132
|
+
}, [m]), we = Te && !E, W = (e, r) => {
|
|
133
133
|
for (const n of e) {
|
|
134
134
|
if (n.id === r) return n;
|
|
135
135
|
if (n.children) {
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
136
|
+
const u = W(n.children, r);
|
|
137
|
+
if (u) return u;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
return null;
|
|
141
|
-
},
|
|
142
|
-
sideEffects: Ue({
|
|
143
|
-
styles: {
|
|
144
|
-
active: {
|
|
145
|
-
opacity: "0.4"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
})
|
|
149
|
-
}, Te = D(
|
|
141
|
+
}, Ae = T(
|
|
150
142
|
(e, r) => {
|
|
151
|
-
if (N ===
|
|
143
|
+
if (N === U.INDEPENDENT)
|
|
152
144
|
return e;
|
|
153
|
-
const n = (h,
|
|
154
|
-
(L) => n(L,
|
|
155
|
-
) : !1,
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
158
|
-
if (
|
|
159
|
-
const L =
|
|
160
|
-
let
|
|
161
|
-
return N ===
|
|
162
|
-
...
|
|
163
|
-
checked:
|
|
145
|
+
const n = (h, i) => h.id === i ? !0 : h.children ? h.children.some(
|
|
146
|
+
(L) => n(L, i)
|
|
147
|
+
) : !1, u = (h) => h.map((i) => {
|
|
148
|
+
if (i.id === r)
|
|
149
|
+
return i;
|
|
150
|
+
if (i.children && n(i, r)) {
|
|
151
|
+
const L = u(i.children);
|
|
152
|
+
let j;
|
|
153
|
+
return N === U.CASCADE_UP_DOWN ? j = L.some((B) => B.checked) : j = L.every((B) => B.checked), {
|
|
154
|
+
...i,
|
|
155
|
+
checked: j,
|
|
164
156
|
children: L
|
|
165
157
|
};
|
|
166
158
|
}
|
|
167
|
-
return
|
|
159
|
+
return i;
|
|
168
160
|
});
|
|
169
|
-
return
|
|
161
|
+
return u(e);
|
|
170
162
|
},
|
|
171
163
|
[N]
|
|
172
164
|
), X = (e) => {
|
|
@@ -177,57 +169,57 @@ const se = (i, t) => {
|
|
|
177
169
|
}, {
|
|
178
170
|
handleToggle: Y,
|
|
179
171
|
handleToggleCollapse: Z,
|
|
180
|
-
handleCollapseAll:
|
|
181
|
-
handleToggleCategory:
|
|
182
|
-
} =
|
|
172
|
+
handleCollapseAll: xe,
|
|
173
|
+
handleToggleCategory: Re
|
|
174
|
+
} = je({
|
|
183
175
|
setItems: g,
|
|
184
|
-
findItemById:
|
|
185
|
-
updateParentsUpward:
|
|
176
|
+
findItemById: W,
|
|
177
|
+
updateParentsUpward: Ae,
|
|
186
178
|
onChange: (e) => {
|
|
187
179
|
K((r) => r + 1), t(e);
|
|
188
180
|
},
|
|
189
181
|
onItemToggle: s,
|
|
190
182
|
getCategory: C,
|
|
191
|
-
setCollapsedItems:
|
|
192
|
-
setIsListCollapsed:
|
|
193
|
-
setSelectedCategories:
|
|
194
|
-
isUserChangeRef:
|
|
183
|
+
setCollapsedItems: Se,
|
|
184
|
+
setIsListCollapsed: me,
|
|
185
|
+
setSelectedCategories: Ce,
|
|
186
|
+
isUserChangeRef: A,
|
|
195
187
|
selectionMode: N,
|
|
196
188
|
// Pass normalized state helpers for optimized operations
|
|
197
|
-
isNormalized:
|
|
198
|
-
normalizedState:
|
|
199
|
-
batchUpdateItems:
|
|
189
|
+
isNormalized: Ne,
|
|
190
|
+
normalizedState: ge,
|
|
191
|
+
batchUpdateItems: ve
|
|
200
192
|
}), {
|
|
201
193
|
collectVisibleItemIds: $,
|
|
202
|
-
findItemsNotSelected:
|
|
203
|
-
collectVisibleItemsForCallback:
|
|
194
|
+
findItemsNotSelected: b,
|
|
195
|
+
collectVisibleItemsForCallback: M,
|
|
204
196
|
updateVisibleItems: G
|
|
205
|
-
} =
|
|
206
|
-
findItemById:
|
|
197
|
+
} = He({
|
|
198
|
+
findItemById: W,
|
|
207
199
|
getCategory: C
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
const r = $(
|
|
211
|
-
|
|
200
|
+
}), ze = T(() => {
|
|
201
|
+
A.current = !0, g((e) => {
|
|
202
|
+
const r = $(m), n = b(
|
|
203
|
+
m,
|
|
212
204
|
e,
|
|
213
205
|
r
|
|
214
206
|
);
|
|
215
207
|
if (n.size > 0) {
|
|
216
|
-
const
|
|
217
|
-
|
|
208
|
+
const i = new Set(n);
|
|
209
|
+
H(i), setTimeout(() => H(/* @__PURE__ */ new Set()), 600);
|
|
218
210
|
}
|
|
219
|
-
const
|
|
211
|
+
const u = G(
|
|
220
212
|
e,
|
|
221
213
|
r,
|
|
222
214
|
!E
|
|
223
|
-
), h = N ===
|
|
215
|
+
), h = N === U.INDEPENDENT ? u : ne(u);
|
|
224
216
|
if (t(h), s) {
|
|
225
|
-
const
|
|
217
|
+
const i = M(
|
|
226
218
|
e,
|
|
227
219
|
r,
|
|
228
220
|
!E
|
|
229
221
|
);
|
|
230
|
-
s(
|
|
222
|
+
s(i);
|
|
231
223
|
}
|
|
232
224
|
return h;
|
|
233
225
|
});
|
|
@@ -235,19 +227,19 @@ const se = (i, t) => {
|
|
|
235
227
|
E,
|
|
236
228
|
t,
|
|
237
229
|
s,
|
|
238
|
-
|
|
230
|
+
m,
|
|
239
231
|
$,
|
|
240
|
-
M,
|
|
241
232
|
b,
|
|
233
|
+
M,
|
|
242
234
|
G,
|
|
243
|
-
|
|
235
|
+
A,
|
|
244
236
|
g,
|
|
245
|
-
|
|
237
|
+
H,
|
|
246
238
|
N
|
|
247
|
-
]),
|
|
239
|
+
]), Oe = T(
|
|
248
240
|
(e, r) => {
|
|
249
|
-
const n =
|
|
250
|
-
return /* @__PURE__ */
|
|
241
|
+
const n = v ? Q(v, e.id) : !1, u = q.has(e.id);
|
|
242
|
+
return /* @__PURE__ */ I(
|
|
251
243
|
_e,
|
|
252
244
|
{
|
|
253
245
|
item: e,
|
|
@@ -255,11 +247,11 @@ const se = (i, t) => {
|
|
|
255
247
|
isCollapsed: R[e.id] || !1,
|
|
256
248
|
onToggle: Y,
|
|
257
249
|
onToggleCollapse: Z,
|
|
258
|
-
isAnyDragging:
|
|
250
|
+
isAnyDragging: v !== null,
|
|
259
251
|
isValidDrop: n,
|
|
260
|
-
enableDragDrop:
|
|
261
|
-
enableCollapse:
|
|
262
|
-
shouldBlink:
|
|
252
|
+
enableDragDrop: S,
|
|
253
|
+
enableCollapse: F,
|
|
254
|
+
shouldBlink: u
|
|
263
255
|
},
|
|
264
256
|
e.id
|
|
265
257
|
);
|
|
@@ -268,90 +260,91 @@ const se = (i, t) => {
|
|
|
268
260
|
R,
|
|
269
261
|
Y,
|
|
270
262
|
Z,
|
|
271
|
-
|
|
263
|
+
v,
|
|
272
264
|
Q,
|
|
273
|
-
|
|
265
|
+
S,
|
|
274
266
|
q,
|
|
275
|
-
|
|
267
|
+
F
|
|
276
268
|
]
|
|
277
|
-
),
|
|
278
|
-
p && (J(a),
|
|
279
|
-
}, [p, a, o, J,
|
|
280
|
-
p && (g(
|
|
281
|
-
}, [p,
|
|
282
|
-
return /* @__PURE__ */
|
|
269
|
+
), Pe = X(a).length > 0, ee = D(() => p ? a.length > 1e3 ? P !== V : JSON.stringify(a) !== JSON.stringify(w) : !1, [p, a, w, P, V]), Ve = T(() => {
|
|
270
|
+
p && (J(a), Ie(P), o?.(a));
|
|
271
|
+
}, [p, a, o, J, P]), Ue = T(() => {
|
|
272
|
+
p && (g(w), K(V), c?.());
|
|
273
|
+
}, [p, w, c, g, V]);
|
|
274
|
+
return /* @__PURE__ */ te(
|
|
283
275
|
"div",
|
|
284
276
|
{
|
|
285
|
-
className:
|
|
286
|
-
"data-
|
|
277
|
+
className: Ke("flex flex-col", ie),
|
|
278
|
+
"data-component": "nested-list",
|
|
279
|
+
"data-has-changes": ee ? "" : void 0,
|
|
280
|
+
"data-list-collapsed": z ? "" : void 0,
|
|
287
281
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
|
|
282
|
+
/* @__PURE__ */ te("div", { className: "flex-shrink-0", children: [
|
|
283
|
+
/* @__PURE__ */ I(
|
|
284
|
+
Be,
|
|
291
285
|
{
|
|
292
|
-
hasItemsWithChildren:
|
|
293
|
-
isListCollapsed:
|
|
294
|
-
onCollapseAll:
|
|
295
|
-
enableSearch:
|
|
296
|
-
enableSelectAll:
|
|
297
|
-
groupLabel:
|
|
286
|
+
hasItemsWithChildren: Pe,
|
|
287
|
+
isListCollapsed: z,
|
|
288
|
+
onCollapseAll: xe,
|
|
289
|
+
enableSearch: f,
|
|
290
|
+
enableSelectAll: ce,
|
|
291
|
+
groupLabel: ae,
|
|
298
292
|
allChecked: E,
|
|
299
|
-
isIndeterminate:
|
|
300
|
-
onSelectAll:
|
|
293
|
+
isIndeterminate: we,
|
|
294
|
+
onSelectAll: ze,
|
|
301
295
|
searchText: x,
|
|
302
296
|
onSearchChange: (e) => {
|
|
303
|
-
|
|
297
|
+
pe(e.target.value);
|
|
304
298
|
},
|
|
305
|
-
searchPlaceholder:
|
|
306
|
-
enableCollapse:
|
|
299
|
+
searchPlaceholder: de,
|
|
300
|
+
enableCollapse: he
|
|
307
301
|
}
|
|
308
302
|
),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
303
|
+
/* @__PURE__ */ I(
|
|
304
|
+
Fe,
|
|
311
305
|
{
|
|
312
|
-
isListCollapsed:
|
|
306
|
+
isListCollapsed: z,
|
|
313
307
|
enableGroupBy: k,
|
|
314
|
-
categories:
|
|
315
|
-
selectedCategories:
|
|
316
|
-
onToggleCategory:
|
|
308
|
+
categories: Le,
|
|
309
|
+
selectedCategories: O,
|
|
310
|
+
onToggleCategory: Re
|
|
317
311
|
}
|
|
318
312
|
)
|
|
319
313
|
] }),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
314
|
+
/* @__PURE__ */ I("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ I(
|
|
315
|
+
Je,
|
|
322
316
|
{
|
|
323
|
-
isListCollapsed:
|
|
324
|
-
enableDragDrop:
|
|
325
|
-
sensors:
|
|
326
|
-
items:
|
|
327
|
-
renderItem:
|
|
328
|
-
dropAnimationConfig: De,
|
|
317
|
+
isListCollapsed: z,
|
|
318
|
+
enableDragDrop: S,
|
|
319
|
+
sensors: ke,
|
|
320
|
+
items: De,
|
|
321
|
+
renderItem: Oe,
|
|
329
322
|
onDragStart: (e) => {
|
|
330
323
|
_(e.active.id);
|
|
331
324
|
},
|
|
332
325
|
onDragOver: (e) => {
|
|
333
|
-
|
|
326
|
+
y(e.over?.id);
|
|
334
327
|
},
|
|
335
328
|
onDragEnd: (e) => {
|
|
336
|
-
_(null),
|
|
329
|
+
_(null), y(null), A.current = !0, Ee(e, (r) => {
|
|
337
330
|
const n = r(a);
|
|
338
331
|
g(n), t(n);
|
|
339
332
|
});
|
|
340
333
|
},
|
|
341
334
|
onDragCancel: () => {
|
|
342
|
-
_(null),
|
|
335
|
+
_(null), y(null);
|
|
343
336
|
}
|
|
344
337
|
}
|
|
345
338
|
) }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
339
|
+
/* @__PURE__ */ I(
|
|
340
|
+
qe,
|
|
348
341
|
{
|
|
349
342
|
enableApplyDiscard: p,
|
|
350
|
-
hasChanges:
|
|
351
|
-
onDiscard:
|
|
343
|
+
hasChanges: ee,
|
|
344
|
+
onDiscard: Ue,
|
|
352
345
|
onApply: Ve,
|
|
353
|
-
cancelButtonLabel:
|
|
354
|
-
submitButtonLabel:
|
|
346
|
+
cancelButtonLabel: fe,
|
|
347
|
+
submitButtonLabel: ue
|
|
355
348
|
}
|
|
356
349
|
)
|
|
357
350
|
]
|
|
@@ -359,5 +352,5 @@ const se = (i, t) => {
|
|
|
359
352
|
);
|
|
360
353
|
};
|
|
361
354
|
export {
|
|
362
|
-
|
|
355
|
+
ot as NestedList
|
|
363
356
|
};
|
|
@@ -3,24 +3,26 @@ import m from "react";
|
|
|
3
3
|
import { cn as a } from "../../../lib/utils.js";
|
|
4
4
|
import { Checkbox as u } from "../checkbox.js";
|
|
5
5
|
const y = ({
|
|
6
|
-
children:
|
|
6
|
+
children: e,
|
|
7
7
|
className: t,
|
|
8
|
-
read:
|
|
8
|
+
read: o,
|
|
9
9
|
selected: i,
|
|
10
|
-
onSelect:
|
|
10
|
+
onSelect: c,
|
|
11
11
|
selectable: r,
|
|
12
|
-
...
|
|
12
|
+
...s
|
|
13
13
|
}) => /* @__PURE__ */ f(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
|
+
"data-component": "notification-item",
|
|
17
|
+
"data-read": o ? "true" : "false",
|
|
16
18
|
className: a(
|
|
17
19
|
"group relative flex w-full gap-2 p-3 items-start rounded-xl transition-all border-l-[3px] border-transparent",
|
|
18
20
|
"bg-[#f8f9fb]",
|
|
19
|
-
!
|
|
21
|
+
!o && "border-[#4259ee]",
|
|
20
22
|
i && "bg-[#eceefd]",
|
|
21
23
|
t
|
|
22
24
|
),
|
|
23
|
-
...
|
|
25
|
+
...s,
|
|
24
26
|
children: [
|
|
25
27
|
r && /* @__PURE__ */ n("div", { className: a(
|
|
26
28
|
"absolute left-3 top-3 z-10 flex h-[30px] w-[30px] items-center justify-center transition-all duration-200",
|
|
@@ -29,7 +31,7 @@ const y = ({
|
|
|
29
31
|
u,
|
|
30
32
|
{
|
|
31
33
|
checked: i,
|
|
32
|
-
onCheckedChange:
|
|
34
|
+
onCheckedChange: c,
|
|
33
35
|
className: "translate-y-0"
|
|
34
36
|
}
|
|
35
37
|
) }),
|
|
@@ -38,14 +40,14 @@ const y = ({
|
|
|
38
40
|
r && "[&_[data-role=notification-icon]]:transition-opacity [&_[data-role=notification-icon]]:duration-200",
|
|
39
41
|
r && "group-hover:[&_[data-role=notification-icon]]:opacity-0",
|
|
40
42
|
r && i && "[&_[data-role=notification-icon]]:opacity-0"
|
|
41
|
-
), children:
|
|
43
|
+
), children: e })
|
|
42
44
|
]
|
|
43
45
|
}
|
|
44
|
-
), v = ({ className:
|
|
45
|
-
const [
|
|
46
|
-
return
|
|
47
|
-
l && !
|
|
48
|
-
l && !
|
|
46
|
+
), v = ({ className: e, children: t, ...o }) => /* @__PURE__ */ n("div", { "data-role": "notification-icon", className: a("flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full transition-opacity duration-200", e), ...o, children: t }), b = ({ className: e, children: t, ...o }) => /* @__PURE__ */ n("div", { className: a("flex flex-col flex-1 min-w-0 gap-1", e), ...o, children: t }), k = ({ className: e, children: t, ml: o, ...i }) => /* @__PURE__ */ n("h4", { className: a("text-sm font-bold text-[#0d152c] leading-snug break-words", o && "ml-2", e), ...i, children: t }), w = ({ className: e, children: t, isTime: o, ...i }) => {
|
|
47
|
+
const [c, r] = m.useState(!1), s = typeof t == "string" ? t : "", l = !o && s.length > 150;
|
|
48
|
+
return o ? /* @__PURE__ */ n("p", { className: a("text-xs text-[#5f6673] mt-0.5", e), ...i, children: t }) : /* @__PURE__ */ n("div", { className: a("text-sm font-medium text-[#394960] break-words leading-5", e), children: /* @__PURE__ */ f("p", { ...i, children: [
|
|
49
|
+
l && !c ? `${s.slice(0, 150)}` : t,
|
|
50
|
+
l && !c && /* @__PURE__ */ f(d, { children: [
|
|
49
51
|
"... ",
|
|
50
52
|
/* @__PURE__ */ n(
|
|
51
53
|
"span",
|
|
@@ -59,7 +61,7 @@ const y = ({
|
|
|
59
61
|
}
|
|
60
62
|
)
|
|
61
63
|
] }),
|
|
62
|
-
l &&
|
|
64
|
+
l && c && /* @__PURE__ */ n(
|
|
63
65
|
"span",
|
|
64
66
|
{
|
|
65
67
|
role: "button",
|
|
@@ -71,10 +73,10 @@ const y = ({
|
|
|
71
73
|
}
|
|
72
74
|
)
|
|
73
75
|
] }) });
|
|
74
|
-
}, I = ({ className:
|
|
76
|
+
}, I = ({ className: e, children: t, alwaysVisible: o = !0, ...i }) => /* @__PURE__ */ n("div", { className: a(
|
|
75
77
|
"flex items-center gap-1 shrink-0 ml-2 self-start transition-opacity focus-within:opacity-100",
|
|
76
|
-
!
|
|
77
|
-
|
|
78
|
+
!o && "opacity-0 group-hover:opacity-100",
|
|
79
|
+
e
|
|
78
80
|
), ...i, children: t });
|
|
79
81
|
export {
|
|
80
82
|
y as NotificationItem,
|