impact-nova 1.7.30 → 1.7.32

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.
Files changed (21) hide show
  1. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +2 -0
  2. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +69 -67
  3. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -0
  4. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +107 -71
  5. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +277 -213
  6. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +11 -1
  7. package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +34 -20
  8. package/dist/components/ui/ag-grid-react/index.js +16 -15
  9. package/dist/components/ui/date-picker/date-range-picker.js +182 -165
  10. package/dist/components/ui/date-picker/month-range-picker.js +221 -166
  11. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +98 -93
  12. package/dist/components/ui/nested-list/components/SortableItem.d.ts +1 -0
  13. package/dist/components/ui/nested-list/components/SortableItem.js +37 -36
  14. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +2 -1
  15. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +173 -160
  16. package/dist/components/ui/nested-list/nested-list.js +200 -196
  17. package/dist/components/ui/types/ag-grid.types.d.ts +2 -0
  18. package/dist/components/ui/types/horizontal-scroller.types.d.ts +4 -0
  19. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  20. package/dist/impact-nova.css +1 -1
  21. package/package.json +1 -1
@@ -1,156 +1,160 @@
1
- import { jsxs as c, jsx as t, Fragment as O } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { ChevronRight as T } from "lucide-react";
4
- import { useVirtualizer as $ } from "@tanstack/react-virtual";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { ChevronRight as j } from "lucide-react";
4
+ import { useVirtualizer as I } from "@tanstack/react-virtual";
5
5
  import { cn as h } from "../../../lib/utils.js";
6
- import { Button as A } from "../button.js";
7
- import { useImpactNovaI18n as D } from "../../../i18n/ImpactNovaI18nContext.js";
8
- const F = a.forwardRef(
6
+ import { Button as O } from "../button.js";
7
+ import { useImpactNovaI18n as T } from "../../../i18n/ImpactNovaI18nContext.js";
8
+ const $ = o.forwardRef(
9
9
  ({
10
10
  className: N,
11
- items: u,
12
- renderItem: R,
13
- scrollStep: g = 200,
14
- hideScrollbar: p = !0,
15
- controlsPosition: s = "right",
16
- renderPrevious: v,
17
- renderNext: b,
18
- maxWidth: L = "100%",
11
+ items: d,
12
+ renderItem: C,
13
+ scrollStep: p = 200,
14
+ hideScrollbar: u = !0,
15
+ controlsPosition: v = "right",
16
+ renderPrevious: x,
17
+ renderNext: g,
18
+ maxWidth: R = "100%",
19
19
  estimateSize: m = 200,
20
- overscan: k = 5,
21
- ...C
22
- }, B) => {
23
- const { t: x } = D(), l = a.useRef(null), [n, E] = a.useState(!1), [o, H] = a.useState(!1);
24
- a.useImperativeHandle(B, () => l.current);
25
- const i = $({
26
- count: u.length,
27
- getScrollElement: () => l.current,
20
+ overscan: L = 5,
21
+ ...B
22
+ }, E) => {
23
+ const { t: b } = T(), r = o.useRef(null), [n, H] = o.useState(!1), [s, V] = o.useState(!1);
24
+ o.useImperativeHandle(E, () => r.current);
25
+ const c = I({
26
+ count: d.length,
27
+ getScrollElement: () => r.current,
28
28
  estimateSize: typeof m == "function" ? m : () => m,
29
29
  horizontal: !0,
30
- overscan: k
31
- }), V = i.getTotalSize(), d = a.useCallback(() => {
32
- const e = l.current;
33
- e && (E(e.scrollLeft > 0), H(Math.ceil(e.scrollLeft + e.clientWidth) < e.scrollWidth));
30
+ overscan: L
31
+ }), W = c.getTotalSize(), f = o.useCallback(() => {
32
+ const e = r.current;
33
+ e && (H(e.scrollLeft > 0), V(Math.ceil(e.scrollLeft + e.clientWidth) < e.scrollWidth));
34
34
  }, []);
35
- a.useEffect(() => {
36
- const e = l.current;
35
+ o.useEffect(() => {
36
+ const e = r.current;
37
37
  if (!e) return;
38
- d();
39
- const r = () => d();
40
- e.addEventListener("scroll", r);
41
- const f = new ResizeObserver(() => {
42
- d();
38
+ f();
39
+ const l = () => f();
40
+ e.addEventListener("scroll", l);
41
+ const i = new ResizeObserver(() => {
42
+ f();
43
43
  });
44
- return f.observe(e), () => {
45
- e.removeEventListener("scroll", r), f.disconnect();
44
+ return i.observe(e), () => {
45
+ e.removeEventListener("scroll", l), i.disconnect();
46
46
  };
47
- }, [d, u, V]);
48
- const z = () => {
49
- l.current?.scrollBy({ left: -g, behavior: "smooth" });
50
- }, y = () => {
51
- l.current?.scrollBy({ left: g, behavior: "smooth" });
52
- }, w = ({
47
+ }, [f, d, W]);
48
+ const w = () => {
49
+ r.current?.scrollBy({ left: -p, behavior: "smooth" });
50
+ }, z = () => {
51
+ r.current?.scrollBy({ left: p, behavior: "smooth" });
52
+ }, y = ({
53
53
  direction: e,
54
- onClick: r,
55
- disabled: f
54
+ onClick: l,
55
+ disabled: i
56
56
  }) => {
57
- if (f) return null;
58
- const S = x(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
59
- return /* @__PURE__ */ c(
60
- A,
57
+ if (i) return null;
58
+ const k = b(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
59
+ return /* @__PURE__ */ a(
60
+ O,
61
61
  {
62
62
  variant: "ghost",
63
63
  size: "icon",
64
64
  className: h(
65
65
  "h-8 w-8 rounded-md bg-canvas-muted text-content-tertiary hover:bg-brand-tint hover:text-brand"
66
66
  ),
67
- onClick: r,
68
- disabled: f,
69
- "aria-label": S,
67
+ onClick: l,
68
+ disabled: i,
69
+ "aria-label": k,
70
70
  "data-component": e === "left" ? "horizontal-scroller-prev" : "horizontal-scroller-next",
71
71
  children: [
72
72
  /* @__PURE__ */ t(
73
- T,
73
+ j,
74
74
  {
75
75
  className: h("h-4 w-4", e === "left" && "rotate-180")
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ t("span", { className: "sr-only", children: S })
78
+ /* @__PURE__ */ t("span", { className: "sr-only", children: k })
79
79
  ]
80
80
  }
81
81
  );
82
- }, W = () => {
83
- const e = v ? v({ onClick: z, disabled: !n }) : /* @__PURE__ */ t(
84
- w,
82
+ }, S = (() => {
83
+ const e = x ? x({ onClick: w, disabled: !n }) : /* @__PURE__ */ t(
84
+ y,
85
85
  {
86
86
  direction: "left",
87
- onClick: z,
87
+ onClick: w,
88
88
  disabled: !n
89
89
  }
90
- ), r = b ? b({ onClick: y, disabled: !o }) : /* @__PURE__ */ t(
91
- w,
90
+ ), l = g ? g({ onClick: z, disabled: !s }) : /* @__PURE__ */ t(
91
+ y,
92
92
  {
93
93
  direction: "right",
94
- onClick: y,
95
- disabled: !o
94
+ onClick: z,
95
+ disabled: !s
96
96
  }
97
97
  );
98
- return s === "split" ? /* @__PURE__ */ c(O, { children: [
99
- /* @__PURE__ */ t("div", { className: "absolute left-0 top-1/2 z-20 -translate-y-1/2", children: e }),
100
- /* @__PURE__ */ t("div", { className: "absolute right-0 top-1/2 z-20 -translate-y-1/2", children: r })
101
- ] }) : s === "left" ? /* @__PURE__ */ c("div", { className: "absolute left-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
102
- e,
103
- r
104
- ] }) : /* @__PURE__ */ c("div", { className: "absolute right-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
105
- e,
106
- r
107
- ] });
108
- }, j = () => s === "left" ? n && o ? "pl-20" : n || o ? "pl-12" : "" : s === "split" && n ? "pl-12" : "", I = () => s === "right" ? n && o ? "pr-20" : n || o ? "pr-12" : "" : s === "split" && o ? "pr-12" : "";
109
- return /* @__PURE__ */ c(
98
+ return v === "split" ? {
99
+ left: n ? /* @__PURE__ */ t("div", { className: "flex-shrink-0", children: e }) : null,
100
+ right: s ? /* @__PURE__ */ t("div", { className: "flex-shrink-0", children: l }) : null
101
+ } : v === "left" ? {
102
+ left: n || s ? /* @__PURE__ */ a("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
103
+ e,
104
+ l
105
+ ] }) : null,
106
+ right: null
107
+ } : {
108
+ left: null,
109
+ right: n || s ? /* @__PURE__ */ a("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
110
+ e,
111
+ l
112
+ ] }) : null
113
+ };
114
+ })();
115
+ return /* @__PURE__ */ a(
110
116
  "div",
111
117
  {
112
118
  className: h(
113
- "relative group min-w-0 w-full bg-transparent",
114
- j(),
115
- I(),
119
+ "flex items-center gap-2 min-w-0 w-full bg-transparent",
116
120
  N
117
121
  ),
118
- style: { maxWidth: L },
122
+ style: { maxWidth: R },
119
123
  "data-component": "horizontal-scroller",
120
- ...C,
124
+ ...B,
121
125
  children: [
122
- W(),
126
+ S.left,
123
127
  /* @__PURE__ */ t(
124
128
  "div",
125
129
  {
126
- ref: l,
130
+ ref: r,
127
131
  className: h(
128
- "flex w-full overflow-x-auto overflow-y-hidden whitespace-nowrap",
129
- p && "scrollbar-hide",
132
+ "flex flex-1 min-w-0 overflow-x-auto overflow-y-hidden whitespace-nowrap",
133
+ u && "scrollbar-hide",
130
134
  "scroll-smooth"
131
135
  ),
132
136
  style: {
133
- scrollbarWidth: p ? "none" : "auto",
134
- msOverflowStyle: p ? "none" : "auto"
137
+ scrollbarWidth: u ? "none" : "auto",
138
+ msOverflowStyle: u ? "none" : "auto"
135
139
  },
136
140
  "data-component": "horizontal-scroller-viewport",
137
- children: /* @__PURE__ */ c(
141
+ children: /* @__PURE__ */ a(
138
142
  "div",
139
143
  {
140
144
  style: {
141
- width: `${i.getTotalSize()}px`,
145
+ width: `${c.getTotalSize()}px`,
142
146
  display: "flex",
143
147
  position: "relative"
144
148
  },
145
149
  children: [
146
- /* @__PURE__ */ t("div", { style: { width: `${i.getVirtualItems()[0]?.start ?? 0}px`, flexShrink: 0 } }),
147
- i.getVirtualItems().map((e) => /* @__PURE__ */ t(
150
+ /* @__PURE__ */ t("div", { style: { width: `${c.getVirtualItems()[0]?.start ?? 0}px`, flexShrink: 0 } }),
151
+ c.getVirtualItems().map((e) => /* @__PURE__ */ t(
148
152
  "div",
149
153
  {
150
- ref: i.measureElement,
154
+ ref: c.measureElement,
151
155
  "data-index": e.index,
152
156
  className: "flex-shrink-0",
153
- children: R(u[e.index], e.index)
157
+ children: C(d[e.index], e.index)
154
158
  },
155
159
  e.key
156
160
  ))
@@ -158,13 +162,14 @@ const F = a.forwardRef(
158
162
  }
159
163
  )
160
164
  }
161
- )
165
+ ),
166
+ S.right
162
167
  ]
163
168
  }
164
169
  );
165
170
  }
166
171
  );
167
- F.displayName = "HorizontalScroller";
172
+ $.displayName = "HorizontalScroller";
168
173
  export {
169
- F as default
174
+ $ as default
170
175
  };
@@ -12,6 +12,7 @@ interface SortableItemProps {
12
12
  enableDragDrop?: boolean;
13
13
  enableCollapse?: boolean;
14
14
  shouldBlink?: boolean;
15
+ isDragDisabled?: boolean;
15
16
  }
16
17
  export declare const SortableItem: React.NamedExoticComponent<SortableItemProps>;
17
18
  export {};
@@ -1,19 +1,19 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
- import C, { useMemo as I } from "react";
3
- import { useSortable as D } from "@dnd-kit/sortable";
4
- import { useDroppable as L } from "@dnd-kit/core";
5
- import { Checkbox as R } from "../../checkbox.js";
6
- import { ChevronRight as S, Drag as w } from "../../../../icons/index.js";
2
+ import I, { useMemo as L } from "react";
3
+ import { useSortable as R } from "@dnd-kit/sortable";
4
+ import { useDroppable as S } from "@dnd-kit/core";
5
+ import { Checkbox as w } from "../../checkbox.js";
6
+ import { ChevronRight as z, Drag as D } from "../../../../icons/index.js";
7
7
  import { cn as d } from "../../../../lib/utils.js";
8
- import { useImpactNovaI18n as m } from "../../../../i18n/ImpactNovaI18nContext.js";
9
- const z = (e, o) => {
8
+ import { useImpactNovaI18n as f } from "../../../../i18n/ImpactNovaI18nContext.js";
9
+ const H = (e, o) => {
10
10
  const t = "flex items-center gap-1 py-[3px] px-2 rounded transition-colors duration-150";
11
11
  return e ? d(t, "opacity-40 bg-canvas-muted") : o ? d(t, "bg-feedback-error-surface border border-destructive animate-pulse") : d(t, "hover:bg-canvas-muted");
12
- }, H = ({ item: e, isAnyDragging: o }) => {
13
- const { t } = m(), n = !e.children || e.children.length === 0, {
12
+ }, P = ({ item: e, isAnyDragging: o }) => {
13
+ const { t } = f(), n = !e.children || e.children.length === 0, {
14
14
  setNodeRef: c,
15
15
  isOver: s
16
- } = L({
16
+ } = S({
17
17
  id: `droppable-${e.id}`,
18
18
  data: { sectionId: e.id },
19
19
  disabled: !n
@@ -44,41 +44,42 @@ const z = (e, o) => {
44
44
  }
45
45
  )
46
46
  ] });
47
- }, P = ({
47
+ }, _ = ({
48
48
  item: e,
49
49
  level: o,
50
50
  isCollapsed: t,
51
51
  onToggle: n,
52
52
  onToggleCollapse: c,
53
53
  isAnyDragging: s = !1,
54
- isOver: _ = !1,
55
- isValidDrop: $ = !1,
56
- enableDragDrop: f = !0,
54
+ isOver: $ = !1,
55
+ isValidDrop: j = !1,
56
+ enableDragDrop: x = !0,
57
57
  enableCollapse: b = !0,
58
- shouldBlink: x = !1
58
+ shouldBlink: v = !1,
59
+ isDragDisabled: h = !1
59
60
  }) => {
60
- const { t: h } = m(), u = e.category === "structure", i = e.children && e.children.length > 0, v = I(() => !e.children || e.children.length === 0 || e.children.every((l) => l.checked) ? !1 : e.children.some((l) => l.checked), [e.children]), {
61
- attributes: g,
62
- listeners: k,
63
- setNodeRef: N,
64
- isDragging: y,
61
+ const { t: u } = f(), m = e.category === "structure", i = e.children && e.children.length > 0, g = L(() => !e.children || e.children.length === 0 || e.children.every((l) => l.checked) ? !1 : e.children.some((l) => l.checked), [e.children]), {
62
+ attributes: k,
63
+ listeners: N,
64
+ setNodeRef: y,
65
+ isDragging: C,
65
66
  // transform and transition intentionally not applied — we use a custom
66
67
  // FloatingClone and manual insertion line instead of dnd-kit's built-in animations.
67
- transform: j,
68
- transition: E
69
- } = D({
68
+ transform: E,
69
+ transition: O
70
+ } = R({
70
71
  id: e.id,
71
72
  data: {
72
73
  level: o,
73
74
  hasChildren: i,
74
75
  isExpanded: !t
75
76
  },
76
- disabled: u || e.disabled
77
+ disabled: m || e.disabled || h
77
78
  });
78
- return u ? /* @__PURE__ */ r(H, { item: e, isAnyDragging: s }) : /* @__PURE__ */ r(
79
+ return m ? /* @__PURE__ */ r(P, { item: e, isAnyDragging: s }) : /* @__PURE__ */ r(
79
80
  "div",
80
81
  {
81
- ref: N,
82
+ ref: y,
82
83
  className: "relative",
83
84
  "data-item-id": e.id,
84
85
  "data-level": o,
@@ -88,7 +89,7 @@ const z = (e, o) => {
88
89
  children: /* @__PURE__ */ p(
89
90
  "div",
90
91
  {
91
- className: z(y, x),
92
+ className: H(C, v),
92
93
  style: {
93
94
  paddingLeft: `${8 + o * 20}px`
94
95
  },
@@ -102,9 +103,9 @@ const z = (e, o) => {
102
103
  },
103
104
  onMouseDown: (a) => a.stopPropagation(),
104
105
  className: "p-1 hover:bg-muted rounded-full transition-colors flex items-center text-content-icon hover:text-brand",
105
- "aria-label": h(t ? "nestedList.expand" : "nestedList.collapse"),
106
+ "aria-label": u(t ? "nestedList.expand" : "nestedList.collapse"),
106
107
  children: /* @__PURE__ */ r(
107
- S,
108
+ z,
108
109
  {
109
110
  size: "16px",
110
111
  className: d("transition-transform", !t && "rotate-90")
@@ -114,19 +115,19 @@ const z = (e, o) => {
114
115
  ),
115
116
  (!b || !i) && /* @__PURE__ */ r("div", { className: "w-6" }),
116
117
  /* @__PURE__ */ r(
117
- R,
118
+ w,
118
119
  {
119
120
  id: `checkbox-${e.id}`,
120
- checked: v ? "indeterminate" : e.checked,
121
+ checked: g ? "indeterminate" : e.checked,
121
122
  onCheckedChange: () => n(e.id),
122
123
  disabled: e.disabled
123
124
  }
124
125
  ),
125
- f && /* @__PURE__ */ r(
126
+ x && !h && /* @__PURE__ */ r(
126
127
  "div",
127
128
  {
128
- ...g,
129
129
  ...k,
130
+ ...N,
130
131
  className: "cursor-grab active:cursor-grabbing p-0 hover:bg-muted rounded flex items-center",
131
132
  style: {
132
133
  pointerEvents: "auto",
@@ -137,7 +138,7 @@ const z = (e, o) => {
137
138
  onPointerDown: (a) => {
138
139
  a.stopPropagation();
139
140
  },
140
- children: /* @__PURE__ */ r(w, { size: "14px", className: "text-content-icon" })
141
+ children: /* @__PURE__ */ r(D, { size: "14px", className: "text-content-icon" })
141
142
  }
142
143
  ),
143
144
  /* @__PURE__ */ r(
@@ -153,7 +154,7 @@ const z = (e, o) => {
153
154
  )
154
155
  }
155
156
  );
156
- }, K = C.memo(P);
157
+ }, Q = I.memo(_);
157
158
  export {
158
- K as SortableItem
159
+ Q as SortableItem
159
160
  };
@@ -16,8 +16,9 @@ interface UseNestedListDragDropProps {
16
16
  items: NestedListItem[];
17
17
  onDragEnd?: (activeId: string, overId: string | null) => void;
18
18
  collapsedItems?: Record<string, boolean>;
19
+ canDrag?: (item: NestedListItem, level: number) => boolean;
19
20
  }
20
- export declare const useNestedListDragDrop: ({ items, onDragEnd, collapsedItems, }: UseNestedListDragDropProps) => {
21
+ export declare const useNestedListDragDrop: ({ items, onDragEnd, collapsedItems, canDrag, }: UseNestedListDragDropProps) => {
21
22
  sensors: import('@dnd-kit/core').SensorDescriptor<import('@dnd-kit/core').SensorOptions>[];
22
23
  handleDragEnd: (event: DragEndEvent, setItems: (updater: (prevItems: NestedListItem[]) => NestedListItem[]) => void) => void;
23
24
  isValidDrop: (activeItemId: string | null, overItemId: string | null) => boolean;