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,168 +1,218 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { arrayMove as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useCallback as a } from "react";
|
|
2
|
+
import { useSensors as W, useSensor as F, MouseSensor as X, TouchSensor as j, closestCorners as q } from "@dnd-kit/core";
|
|
3
|
+
import { arrayMove as M } from "@dnd-kit/sortable";
|
|
4
|
+
const Y = "droppable-", L = /* @__PURE__ */ new Set(["root-frozen", "root-scrollable"]);
|
|
5
|
+
function g(f) {
|
|
6
|
+
if (f.startsWith(Y)) {
|
|
7
|
+
const c = f.slice(Y.length);
|
|
8
|
+
if (L.has(c)) return c;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const Q = (f) => {
|
|
13
|
+
const c = q(f), x = c.filter(
|
|
14
|
+
(s) => !L.has(s.id)
|
|
15
|
+
);
|
|
16
|
+
return x.length > 0 ? x : c;
|
|
17
|
+
};
|
|
18
|
+
function b(f, c) {
|
|
19
|
+
for (const x of f) {
|
|
20
|
+
if (x.id === c) return x;
|
|
21
|
+
if (x.children) {
|
|
22
|
+
const s = b(x.children, c);
|
|
23
|
+
if (s) return s;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const U = ({
|
|
28
|
+
items: f,
|
|
29
|
+
onDragEnd: c
|
|
7
30
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
(
|
|
13
|
-
for (const n of
|
|
14
|
-
if (n.id ===
|
|
31
|
+
const x = W(
|
|
32
|
+
F(X),
|
|
33
|
+
F(j)
|
|
34
|
+
), s = a(
|
|
35
|
+
(t, r, o = 0) => {
|
|
36
|
+
for (const n of t) {
|
|
37
|
+
if (n.id === r) return o;
|
|
15
38
|
if (n.children) {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
39
|
+
const e = s(n.children, r, o + 1);
|
|
40
|
+
if (e !== null) return e;
|
|
18
41
|
}
|
|
19
42
|
}
|
|
20
43
|
return null;
|
|
21
44
|
},
|
|
22
45
|
[]
|
|
23
|
-
),
|
|
24
|
-
(
|
|
25
|
-
for (const n of
|
|
26
|
-
if (n.id ===
|
|
46
|
+
), h = a(
|
|
47
|
+
(t, r, o = null) => {
|
|
48
|
+
for (const n of t) {
|
|
49
|
+
if (n.id === r) return o;
|
|
27
50
|
if (n.children) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
51
|
+
const e = h(n.children, r, n.id);
|
|
52
|
+
if (e !== null) return e;
|
|
30
53
|
}
|
|
31
54
|
}
|
|
32
55
|
return null;
|
|
33
56
|
},
|
|
34
57
|
[]
|
|
35
|
-
),
|
|
36
|
-
(
|
|
58
|
+
), T = a(
|
|
59
|
+
(t, r, o) => t.map((n) => {
|
|
37
60
|
if (n.children && n.children.length > 0) {
|
|
38
|
-
const
|
|
39
|
-
(
|
|
40
|
-
),
|
|
41
|
-
(
|
|
61
|
+
const e = n.children.findIndex(
|
|
62
|
+
(l) => l.id === r
|
|
63
|
+
), i = n.children.findIndex(
|
|
64
|
+
(l) => l.id === o
|
|
42
65
|
);
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
66
|
+
if (e !== -1 && i !== -1) {
|
|
67
|
+
const l = M(n.children, e, i);
|
|
45
68
|
return {
|
|
46
69
|
...n,
|
|
47
|
-
children:
|
|
70
|
+
children: l
|
|
48
71
|
};
|
|
49
72
|
}
|
|
50
73
|
return {
|
|
51
74
|
...n,
|
|
52
|
-
children:
|
|
75
|
+
children: T(n.children, r, o)
|
|
53
76
|
};
|
|
54
77
|
}
|
|
55
78
|
return n;
|
|
56
79
|
}),
|
|
57
80
|
[]
|
|
58
|
-
),
|
|
59
|
-
(
|
|
60
|
-
const n =
|
|
81
|
+
), N = a(
|
|
82
|
+
(t, r, o) => {
|
|
83
|
+
const n = h(t, o);
|
|
61
84
|
if (!n) return null;
|
|
62
|
-
const
|
|
63
|
-
(
|
|
64
|
-
),
|
|
65
|
-
(
|
|
85
|
+
const e = t.findIndex(
|
|
86
|
+
(l) => l.id === n
|
|
87
|
+
), i = t.findIndex(
|
|
88
|
+
(l) => l.id === r
|
|
66
89
|
);
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
90
|
+
if (e !== -1 && i !== -1) {
|
|
91
|
+
const l = M(
|
|
92
|
+
t,
|
|
93
|
+
i,
|
|
94
|
+
e
|
|
72
95
|
);
|
|
73
|
-
return
|
|
96
|
+
return c?.(r, n), l;
|
|
74
97
|
}
|
|
75
98
|
return null;
|
|
76
99
|
},
|
|
77
|
-
[
|
|
78
|
-
),
|
|
79
|
-
(
|
|
80
|
-
const n =
|
|
81
|
-
if (n !== -1 &&
|
|
82
|
-
const
|
|
83
|
-
return
|
|
100
|
+
[h, c]
|
|
101
|
+
), _ = a(
|
|
102
|
+
(t, r, o) => {
|
|
103
|
+
const n = t.findIndex((i) => i.id === r), e = t.findIndex((i) => i.id === o);
|
|
104
|
+
if (n !== -1 && e !== -1) {
|
|
105
|
+
const i = M(t, n, e);
|
|
106
|
+
return c?.(r, o), i;
|
|
84
107
|
}
|
|
85
108
|
return null;
|
|
86
109
|
},
|
|
87
|
-
[
|
|
88
|
-
),
|
|
89
|
-
(
|
|
90
|
-
const n =
|
|
91
|
-
return
|
|
110
|
+
[c]
|
|
111
|
+
), y = a(
|
|
112
|
+
(t, r, o) => {
|
|
113
|
+
const n = T(t, r, o);
|
|
114
|
+
return c?.(r, o), n;
|
|
92
115
|
},
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
(
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (u.children) {
|
|
103
|
-
const x = t(u.children);
|
|
104
|
-
if (x) return x;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
if (o = t(l), !o) return null;
|
|
109
|
-
const a = l.map((d) => {
|
|
110
|
-
if (d.id === n)
|
|
116
|
+
[T, c]
|
|
117
|
+
), A = a(
|
|
118
|
+
(t, r, o, n = !1) => {
|
|
119
|
+
const e = h(t, r), i = h(t, o);
|
|
120
|
+
if (!e || !i) return null;
|
|
121
|
+
const l = b(t, r);
|
|
122
|
+
if (!l) return null;
|
|
123
|
+
const P = t.map((u) => {
|
|
124
|
+
if (u.id === e)
|
|
111
125
|
return {
|
|
112
|
-
...
|
|
113
|
-
children:
|
|
126
|
+
...u,
|
|
127
|
+
children: u.children ? u.children.filter((d) => d.id !== r) : []
|
|
114
128
|
};
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
(
|
|
129
|
+
if (u.id === i) {
|
|
130
|
+
const d = u.children ? [...u.children] : [], C = d.findIndex(
|
|
131
|
+
(S) => S.id === o
|
|
118
132
|
);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
if (C !== -1) {
|
|
134
|
+
const S = n ? C + 1 : C;
|
|
135
|
+
d.splice(S, 0, l);
|
|
136
|
+
} else
|
|
137
|
+
d.push(l);
|
|
138
|
+
return {
|
|
139
|
+
...u,
|
|
140
|
+
children: d
|
|
122
141
|
};
|
|
123
142
|
}
|
|
124
|
-
return
|
|
143
|
+
return u;
|
|
125
144
|
});
|
|
126
|
-
return
|
|
145
|
+
return c?.(r, o), P;
|
|
127
146
|
},
|
|
128
|
-
[
|
|
129
|
-
),
|
|
130
|
-
(
|
|
131
|
-
const
|
|
132
|
-
!n
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
147
|
+
[h, c]
|
|
148
|
+
), O = a(
|
|
149
|
+
(t, r, o) => {
|
|
150
|
+
const n = b(t, r);
|
|
151
|
+
if (!n) return t;
|
|
152
|
+
const e = t.map((i) => {
|
|
153
|
+
let l = i.children ? i.children.filter((P) => P.id !== r) : [];
|
|
154
|
+
return i.id === o && (l = [n, ...l]), { ...i, children: l };
|
|
155
|
+
});
|
|
156
|
+
return c?.(r, o), e;
|
|
157
|
+
},
|
|
158
|
+
[c]
|
|
159
|
+
), k = a(
|
|
160
|
+
(t, r) => {
|
|
161
|
+
const { active: o, over: n } = t;
|
|
162
|
+
!n || o.id === n.id || r((e) => {
|
|
163
|
+
const i = o.id, l = n.id, P = g(l);
|
|
164
|
+
if (P)
|
|
165
|
+
return O(e, i, P);
|
|
166
|
+
const u = s(e, i), d = s(e, l), C = h(e, i), S = h(e, l);
|
|
167
|
+
if (L.has(l) && u !== null && u > 0)
|
|
168
|
+
return O(e, i, l);
|
|
169
|
+
if (u === 0 && d !== null && d > 0)
|
|
170
|
+
return N(
|
|
171
|
+
e,
|
|
172
|
+
i,
|
|
173
|
+
l
|
|
174
|
+
) || e;
|
|
175
|
+
if (u === null || d === null || u !== d)
|
|
176
|
+
return e;
|
|
177
|
+
if (u > 0 && C !== S) {
|
|
178
|
+
const R = o.rect.current.translated, w = n.rect;
|
|
179
|
+
let B = !1;
|
|
180
|
+
if (R && w) {
|
|
181
|
+
const H = R.top + R.height / 2, V = w.top + w.height / 2;
|
|
182
|
+
B = H > V;
|
|
183
|
+
}
|
|
184
|
+
return A(e, i, l, B) || e;
|
|
185
|
+
}
|
|
186
|
+
return u === 0 ? _(e, i, l) || e : y(e, i, l);
|
|
139
187
|
});
|
|
140
188
|
},
|
|
141
189
|
[
|
|
190
|
+
s,
|
|
142
191
|
h,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
192
|
+
N,
|
|
193
|
+
_,
|
|
194
|
+
y,
|
|
195
|
+
A,
|
|
196
|
+
O
|
|
148
197
|
]
|
|
149
|
-
),
|
|
150
|
-
(
|
|
151
|
-
if (!
|
|
198
|
+
), z = a(
|
|
199
|
+
(t, r) => {
|
|
200
|
+
if (!t || !r || t === r)
|
|
152
201
|
return !1;
|
|
153
|
-
const
|
|
154
|
-
return
|
|
202
|
+
const o = t ? s(f, t) : null, n = r ? s(f, r) : null;
|
|
203
|
+
return g(r) !== null || L.has(r) ? !0 : o === null || n === null ? !1 : o === 0 && n > 0 || o === n;
|
|
155
204
|
},
|
|
156
|
-
[
|
|
205
|
+
[f, s]
|
|
157
206
|
);
|
|
158
207
|
return {
|
|
159
|
-
sensors:
|
|
160
|
-
handleDragEnd:
|
|
161
|
-
isValidDrop:
|
|
162
|
-
findItemLevel:
|
|
163
|
-
findParentId:
|
|
208
|
+
sensors: x,
|
|
209
|
+
handleDragEnd: k,
|
|
210
|
+
isValidDrop: z,
|
|
211
|
+
findItemLevel: s,
|
|
212
|
+
findParentId: h
|
|
164
213
|
};
|
|
165
214
|
};
|
|
166
215
|
export {
|
|
167
|
-
|
|
216
|
+
Q as customCollisionDetection,
|
|
217
|
+
U as useNestedListDragDrop
|
|
168
218
|
};
|