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.
Files changed (120) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
  6. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
  7. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  9. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  10. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  11. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  12. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  13. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  14. package/dist/components/ui/alert-dialog.js +45 -40
  15. package/dist/components/ui/alert.d.ts +21 -4
  16. package/dist/components/ui/alert.js +45 -25
  17. package/dist/components/ui/avatar.js +19 -16
  18. package/dist/components/ui/badge.js +8 -1
  19. package/dist/components/ui/breadcrumb.js +1 -0
  20. package/dist/components/ui/button-group.d.ts +1 -1
  21. package/dist/components/ui/button-group.js +27 -32
  22. package/dist/components/ui/button-variants.d.ts +1 -1
  23. package/dist/components/ui/button.d.ts +11 -0
  24. package/dist/components/ui/button.js +11 -9
  25. package/dist/components/ui/calendar.d.ts +14 -2
  26. package/dist/components/ui/calendar.js +443 -376
  27. package/dist/components/ui/card.js +7 -6
  28. package/dist/components/ui/checkbox.js +64 -48
  29. package/dist/components/ui/chips.d.ts +1 -0
  30. package/dist/components/ui/chips.js +27 -19
  31. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  32. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  33. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  34. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  35. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  36. package/dist/components/ui/data-table/data-table.js +21 -20
  37. package/dist/components/ui/date-picker/date-picker.js +93 -93
  38. package/dist/components/ui/date-picker/date-range-picker.js +142 -133
  39. package/dist/components/ui/date-picker/month-picker.js +96 -93
  40. package/dist/components/ui/date-picker/month-range-picker.js +144 -134
  41. package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
  42. package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
  43. package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
  44. package/dist/components/ui/date-picker/week-picker.js +119 -109
  45. package/dist/components/ui/date-picker/week-range-picker.js +170 -147
  46. package/dist/components/ui/dialog.js +15 -6
  47. package/dist/components/ui/drawer.js +16 -13
  48. package/dist/components/ui/dropdown-menu.js +4 -2
  49. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  50. package/dist/components/ui/dynamic-layout.js +18 -15
  51. package/dist/components/ui/empty-container.js +69 -64
  52. package/dist/components/ui/file-upload.js +113 -106
  53. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  54. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  55. package/dist/components/ui/header.js +26 -25
  56. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  57. package/dist/components/ui/hover-card.js +6 -5
  58. package/dist/components/ui/input.d.ts +1 -1
  59. package/dist/components/ui/input.js +79 -68
  60. package/dist/components/ui/loader.d.ts +1 -0
  61. package/dist/components/ui/loader.js +23 -13
  62. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  63. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  64. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  65. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  66. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  67. package/dist/components/ui/nested-list/nested-list.js +182 -189
  68. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  69. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  70. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  71. package/dist/components/ui/popover.js +37 -34
  72. package/dist/components/ui/progress.js +12 -10
  73. package/dist/components/ui/prompt.js +29 -27
  74. package/dist/components/ui/radio-group.js +55 -46
  75. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  76. package/dist/components/ui/select/components/Submenu.js +52 -48
  77. package/dist/components/ui/select/select.js +321 -324
  78. package/dist/components/ui/sheet.js +18 -15
  79. package/dist/components/ui/sidebar.d.ts +2 -2
  80. package/dist/components/ui/sidebar.js +3 -3
  81. package/dist/components/ui/skeleton.d.ts +2 -1
  82. package/dist/components/ui/skeleton.js +12 -11
  83. package/dist/components/ui/slider.js +39 -12
  84. package/dist/components/ui/smart-input.js +44 -39
  85. package/dist/components/ui/stepper.js +33 -29
  86. package/dist/components/ui/switch.js +6 -4
  87. package/dist/components/ui/tabs.js +50 -45
  88. package/dist/components/ui/tag-group.d.ts +2 -1
  89. package/dist/components/ui/tag-group.js +29 -25
  90. package/dist/components/ui/tag.d.ts +1 -0
  91. package/dist/components/ui/tag.js +26 -20
  92. package/dist/components/ui/textarea.js +18 -17
  93. package/dist/components/ui/toast.d.ts +1 -1
  94. package/dist/components/ui/toast.js +47 -41
  95. package/dist/components/ui/toaster.js +42 -42
  96. package/dist/components/ui/tooltip.js +18 -16
  97. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  98. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  99. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  100. package/dist/components/ui/types/select.types.d.ts +0 -1
  101. package/dist/icons/assets/bookmark.svg.js +4 -0
  102. package/dist/icons/assets/bookmark.svg2.js +5 -0
  103. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  104. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  105. package/dist/icons/assets/download.svg.js +4 -0
  106. package/dist/icons/assets/download.svg2.js +5 -0
  107. package/dist/icons/index.d.ts +20 -6
  108. package/dist/icons/index.js +398 -370
  109. package/dist/impact-nova.css +1 -1
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +318 -314
  112. package/dist/lib/fiscal-calendar.d.ts +62 -0
  113. package/dist/lib/fiscal-calendar.js +99 -0
  114. package/dist/lib/utils.d.ts +2 -1
  115. package/dist/lib/utils.js +29 -13
  116. package/package.json +5 -5
  117. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  118. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  119. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  120. 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 Breadcrumb component
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 FilterStrip component
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
- * Main content (e.g. <Outlet /> or page content)
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 o, jsx as r } from "react/jsx-runtime";
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: t,
10
+ sections: l,
11
11
  onChange: d,
12
12
  onSubmit: h,
13
13
  onCancel: m,
14
- enableApplyDiscard: g = !0,
15
- submitButtonLabel: N = "Apply",
16
- cancelButtonLabel: C = "Reset",
17
- className: v = "",
14
+ enableApplyDiscard: N = !0,
15
+ submitButtonLabel: g = "Apply",
16
+ cancelButtonLabel: v = "Reset",
17
+ className: C = "",
18
18
  enableSearch: S = !0,
19
- enableDragDrop: y = !0,
20
- enableSelectAll: b = !0,
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: n = !0,
25
+ isMultiExpanded: t = !0,
26
26
  defaultCollapseAll: j = !1,
27
- validateApply: i
27
+ validateApply: o
28
28
  }) => {
29
29
  const {
30
- currentSections: l,
31
- hasChanges: c,
30
+ currentSections: n,
31
+ hasChanges: a,
32
32
  setCurrentSection: u,
33
33
  saveAllSections: f,
34
34
  discardAllSections: p
35
- } = J({ sections: t }), [L, w] = W(() => j ? n ? [] : "" : t.length > 0 ? n ? [t[0].id] : t[0].id : n ? [] : ""), B = D ?? L, I = V ?? w, M = s(
36
- (e, a) => {
37
- u(e, a), d?.(e, a);
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?.(l);
42
- }, [l, h, f]), R = s(() => {
41
+ f(), h?.(n);
42
+ }, [n, h, f]), R = s(() => {
43
43
  p(), m?.();
44
- }, [p, m]), T = _(() => c ? i ? i(l) : !0 : !1, [c, i, l]);
45
- return /* @__PURE__ */ o(
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", v),
49
- "data-testid": "accordion-nested-list-container",
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: n ? "multiple" : "single",
55
+ type: t ? "multiple" : "single",
55
56
  value: B,
56
57
  onValueChange: I,
57
58
  className: "space-y-4",
58
- children: t.map((e) => /* @__PURE__ */ o(z, { value: e.id, 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: l[e.id] || [],
64
- onChange: (a) => M(e.id, a),
64
+ items: n[e.id] || [],
65
+ onChange: (i) => M(e.id, i),
65
66
  enableApplyDiscard: !1,
66
67
  enableSearch: S,
67
- enableDragDrop: y,
68
- enableSelectAll: b,
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
- g && /* @__PURE__ */ o("div", { className: "flex-shrink-0 flex justify-end gap-2 pt-4 border-t mt-4", children: [
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: !c,
84
- "data-testid": "discard-changes",
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
- "data-testid": "apply-changes",
95
- children: N
94
+ children: g
96
95
  }
97
96
  )
98
97
  ] })
@@ -1,49 +1,51 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import * as e from "@radix-ui/react-accordion";
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 d } from "../../lib/utils.js";
6
- const v = e.Root, f = s.forwardRef(({ className: r, ...o }, a) => /* @__PURE__ */ t(
7
- e.Item,
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: a,
10
- className: d("border-b rounded-lg bg-white overflow-hidden border-b-[#D9DDE7]", r),
11
- ...o
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 = s.forwardRef(({ className: r, children: o, badge: a, rightActions: i, ...c }, m) => /* @__PURE__ */ t(e.Header, { className: "flex", children: /* @__PURE__ */ n(
16
- e.Trigger,
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: d(
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__ */ t("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__ */ t(l, { className: "h-4 w-4 transition-transform duration-200" }) }),
26
- /* @__PURE__ */ n("div", { className: "flex flex-1 items-center justify-between", children: [
27
- /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
28
- o,
29
- a
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 = e.Trigger.displayName;
37
- const x = s.forwardRef(({ className: r, children: o, ...a }, i) => /* @__PURE__ */ t(
38
- e.Content,
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
- ...a,
43
- children: /* @__PURE__ */ t("div", { className: d("px-4 pb-4 pt-2", r), children: o })
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 = e.Content.displayName;
48
+ x.displayName = t.Content.displayName;
47
49
  export {
48
50
  v as Accordion,
49
51
  x as AccordionContent,
@@ -1,50 +1,61 @@
1
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
- import { CalendarDays as m } from "lucide-react";
3
- const f = (e, i) => {
4
- if (e == null || e === "") return "";
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import "lucide-react";
3
+ const u = (t, r) => {
4
+ if (t == null || t === "") return "";
5
5
  try {
6
- const t = e instanceof Date ? e : new Date(String(e));
7
- return isNaN(t.getTime()) ? String(e) : i === "time" ? t.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) : i === "datetime-local" ? t.toLocaleString(void 0, {
6
+ const i = t instanceof Date ? t : new Date(String(t));
7
+ return isNaN(i.getTime()) ? String(t) : r === "time" ? i.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) : r === "datetime-local" ? i.toLocaleString(void 0, {
8
8
  year: "numeric",
9
9
  month: "short",
10
10
  day: "numeric",
11
11
  hour: "2-digit",
12
12
  minute: "2-digit"
13
- }) : t.toLocaleDateString(void 0, {
13
+ }) : i.toLocaleDateString(void 0, {
14
14
  year: "numeric",
15
15
  month: "short",
16
16
  day: "numeric"
17
17
  });
18
18
  } catch {
19
- return String(e);
19
+ return String(t);
20
20
  }
21
- }, h = (e) => {
21
+ }, m = (t) => {
22
22
  const {
23
- valueFormatted: i,
24
- value: t,
25
- dateType: d = "date",
26
- placeholder: l = "Select date...",
23
+ valueFormatted: r,
24
+ value: i,
25
+ dateType: s = "date",
26
+ placeholder: h = "Select date...",
27
27
  disabled: n,
28
- colDef: s
29
- } = e, c = !n && s?.editable === !0, a = i ?? f(t, d), o = !a;
30
- return /* @__PURE__ */ r(
28
+ colDef: l
29
+ } = t, c = !n && l?.editable === !0, a = r ?? u(i, s), d = !a;
30
+ return /* @__PURE__ */ e(
31
31
  "div",
32
32
  {
33
33
  className: `w-full h-full flex items-center ag-cell-inner-padding ${n ? "opacity-60 cursor-not-allowed" : c ? "in-ag-editable-cell-highlight" : ""}`,
34
- children: /* @__PURE__ */ u(
34
+ children: /* @__PURE__ */ o(
35
35
  "div",
36
36
  {
37
37
  className: "flex w-full items-center justify-between rounded-[8px] bg-white px-1.5 h-7 cursor-pointer",
38
38
  children: [
39
- /* @__PURE__ */ r("span", { className: `truncate text-sm font-medium text-[#1f2b4d] ${o ? "text-[#dfe2e7]" : ""}`, children: o ? l : a }),
40
- /* @__PURE__ */ r(m, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
39
+ /* @__PURE__ */ e("span", { className: `truncate text-sm font-medium text-[#1f2b4d] ${d ? "text-[#dfe2e7]" : ""}`, children: d ? h : a }),
40
+ /* @__PURE__ */ e("span", { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground", children: /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
41
+ /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
42
+ /* @__PURE__ */ e("path", { d: "M16 2v4" }),
43
+ /* @__PURE__ */ e("path", { d: "M8 2v4" }),
44
+ /* @__PURE__ */ e("path", { d: "M3 10h18" }),
45
+ /* @__PURE__ */ e("path", { d: "M8 14h.01" }),
46
+ /* @__PURE__ */ e("path", { d: "M12 14h.01" }),
47
+ /* @__PURE__ */ e("path", { d: "M16 14h.01" }),
48
+ /* @__PURE__ */ e("path", { d: "M8 18h.01" }),
49
+ /* @__PURE__ */ e("path", { d: "M12 18h.01" }),
50
+ /* @__PURE__ */ e("path", { d: "M16 18h.01" })
51
+ ] }) })
41
52
  ]
42
53
  }
43
54
  )
44
55
  }
45
56
  );
46
57
  };
47
- h.displayName = "DateDisplayRenderer";
58
+ m.displayName = "DateDisplayRenderer";
48
59
  export {
49
- h as DateDisplayRenderer
60
+ m as DateDisplayRenderer
50
61
  };
@@ -8,15 +8,13 @@ export interface DateCellEditorProps extends ICellEditorParams {
8
8
  max?: string;
9
9
  }
10
10
  /**
11
- * DateCellEditor - AG Grid popup cell editor with a native date input.
11
+ * DateCellEditor - AG Grid popup cell editor using the project's Calendar component.
12
12
  *
13
- * Uses the browser's native date picker for reliable cross-browser support.
14
- * Mounted by AG Grid as a popup editor (requires `cellEditorPopup: true`).
13
+ * Opens the Calendar directly on mount so the user sees the calendar popup
14
+ * immediately on click no extra interaction needed.
15
15
  *
16
16
  * Returns an ISO string on commit, which AG Grid stores as the cell value.
17
17
  *
18
- * Only holds a single piece of state: the current date string.
19
- *
20
18
  * Usage in colDef:
21
19
  * ```ts
22
20
  * {
@@ -1,30 +1,26 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as h, useRef as y, useState as S, useImperativeHandle as b, useCallback as u } from "react";
3
- const w = (e, n) => {
4
- if (e == null || e === "") return "";
5
- try {
6
- const t = e instanceof Date ? e : new Date(String(e));
7
- return isNaN(t.getTime()) ? "" : n === "date" ? t.toISOString().split("T")[0] : n === "datetime-local" ? t.toISOString().slice(0, 16) : n === "time" ? t.toISOString().slice(11, 16) : "";
8
- } catch {
9
- return "";
10
- }
11
- }, C = h((e, n) => {
1
+ import { jsx as S } from "react/jsx-runtime";
2
+ import { forwardRef as M, useState as b, useImperativeHandle as y, useEffect as N, useCallback as c } from "react";
3
+ import { Calendar as P } from "../../../calendar.js";
4
+ const d = (t) => {
5
+ if (!(t == null || t === ""))
6
+ try {
7
+ const n = t instanceof Date ? t : new Date(String(t));
8
+ return isNaN(n.getTime()) ? void 0 : n;
9
+ } catch {
10
+ return;
11
+ }
12
+ }, I = M((t, n) => {
12
13
  const {
13
- value: t,
14
- dateType: a = "date",
15
- min: l,
16
- max: d,
17
- stopEditing: s
18
- } = e, i = y(null), [o, f] = S(w(t, a));
19
- b(n, () => ({
14
+ value: l,
15
+ min: u,
16
+ max: p,
17
+ node: i,
18
+ column: m,
19
+ stopEditing: f
20
+ } = t, g = d(l), [C, h] = b(g), [v, D] = b(g || /* @__PURE__ */ new Date());
21
+ y(n, () => ({
20
22
  getValue() {
21
- if (!o) return null;
22
- if (a === "time") return o;
23
- try {
24
- return new Date(o).toISOString();
25
- } catch {
26
- return o;
27
- }
23
+ return l;
28
24
  },
29
25
  isCancelBeforeStart() {
30
26
  return !1;
@@ -34,40 +30,46 @@ const w = (e, n) => {
34
30
  },
35
31
  isPopup() {
36
32
  return !0;
37
- },
38
- afterGuiAttached() {
39
- if (i.current) {
40
- i.current.focus();
41
- try {
42
- i.current.showPicker?.();
43
- } catch {
44
- }
45
- }
46
33
  }
47
- }));
48
- const p = u((r) => {
49
- f(r.target.value);
50
- }, []), m = u((r) => {
51
- r.key === "Enter" || r.key === "Escape" || r.key === "Tab" || r.stopPropagation();
52
- }, []), g = u(() => {
53
- s();
54
- }, [s]);
55
- return /* @__PURE__ */ c("div", { className: "p-1 bg-white border border-primary rounded-md shadow-lg", children: /* @__PURE__ */ c(
56
- "input",
34
+ })), N(() => {
35
+ const e = "ag-custom-component-popup", a = (o) => {
36
+ o instanceof HTMLElement && o.hasAttribute("data-radix-popper-content-wrapper") && o.classList.add(e);
37
+ }, s = new MutationObserver((o) => {
38
+ for (const L of o)
39
+ L.addedNodes.forEach(a);
40
+ });
41
+ return s.observe(document.body, { childList: !0, subtree: !0 }), document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach((o) => {
42
+ o.classList.add(e);
43
+ }), () => s.disconnect();
44
+ }, []);
45
+ const r = c((e) => {
46
+ const a = m?.getColId();
47
+ if (a && i) {
48
+ const s = e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : null;
49
+ i.setDataValue(a, s);
50
+ }
51
+ f();
52
+ }, [m, i, f]), w = c((e) => {
53
+ h(e), r(e);
54
+ }, [r]), E = c(() => {
55
+ h(void 0), r(void 0);
56
+ }, [r]), A = u ? d(u) : void 0, x = p ? d(p) : void 0;
57
+ return /* @__PURE__ */ S("div", { className: "ag-custom-component-popup bg-white border border-input rounded-md shadow-lg", children: /* @__PURE__ */ S(
58
+ P,
57
59
  {
58
- ref: i,
59
- type: a,
60
- value: o,
61
- onChange: p,
62
- onKeyDown: m,
63
- onBlur: g,
64
- min: l,
65
- max: d,
66
- className: "px-2 py-1.5 text-sm font-medium bg-white border border-input rounded focus:outline-none focus:border-primary cursor-pointer"
60
+ mode: "single",
61
+ selected: C,
62
+ onSelect: w,
63
+ month: v,
64
+ onMonthChange: D,
65
+ disabled: { before: A, after: x },
66
+ showFooter: !1,
67
+ onClear: E,
68
+ captionLayout: "dropdown"
67
69
  }
68
70
  ) });
69
71
  });
70
- C.displayName = "DateCellEditor";
72
+ I.displayName = "DateCellEditor";
71
73
  export {
72
- C as DateCellEditor
74
+ I as DateCellEditor
73
75
  };
@@ -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 d } from "react/jsx-runtime";
2
- import { forwardRef as x, useRef as N, useCallback as $ } from "react";
3
- const K = x((y, S) => {
4
- const { splits: s, commonParams: c, data: f, node: r, api: m, column: p, context: o, value: a, colDef: u, metaData: E } = y, i = N({
5
- valueKey: null,
6
- field: null,
7
- newValue: null
8
- }), g = $(() => {
9
- const e = i.current, l = {
10
- api: m,
11
- colDef: u,
12
- column: p,
13
- context: o,
14
- data: f,
15
- field: u.field,
16
- node: r,
17
- rowIndex: r?.rowIndex ?? null,
18
- rowPinned: r?.rowPinned ?? void 0,
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: i.current,
22
- newValue: { [e.valueKey]: { value: e.newValue } },
23
- oldValue: { [e.valueKey]: { value: a?.[e.valueKey]?.value } },
24
- value: { [e.valueKey]: { value: e.newValue } }
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
- r.setDataValue(u.field, { ...a, [e.valueKey]: { value: e.newValue } }), o?.onCellUpdate?.(l);
27
- }, [m, u, p, o, f, r, a]), h = (e) => {
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 = m?.getGridOption("components");
30
- return o?.frameworkComponents?.[e] || l?.[e];
31
+ const l = p?.getGridOption("components");
32
+ return i?.frameworkComponents?.[e] || l?.[e];
31
33
  }
32
34
  return e;
33
- }, V = (e, l) => {
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__ */ d(
51
+ return /* @__PURE__ */ c(
50
52
  "div",
51
53
  {
52
- style: { display: "grid", gridTemplateRows: `repeat(${s?.length}, 1fr)`, height: "100%", width: "100%" },
53
- children: s?.map((e, l) => {
54
- const n = e?.field?.split(".")?.pop(), t = a?.[n]?.value;
55
- i.current = {
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: w ? /* @__PURE__ */ d(
66
- w,
61
+ children: g ? /* @__PURE__ */ c(
62
+ g,
67
63
  {
68
- context: o,
69
- data: f,
64
+ context: i,
65
+ data: s,
70
66
  value: t,
71
- onValueChange: (C) => {
72
- i.current = {
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: C
76
- };
72
+ newValue: y
73
+ }]);
77
74
  },
78
- valueFormatted: b,
75
+ valueFormatted: S,
79
76
  colDef: e,
80
77
  stopEditing: () => {
81
- g();
78
+ x(e.field);
82
79
  },
80
+ node: o,
83
81
  suppressAutoFocus: l !== 0,
84
- className: l !== s.length - 1 ? "border-b border-gray-200" : ""
82
+ className: l !== r.length - 1 ? "border-b border-gray-200" : ""
85
83
  }
86
- ) : /* @__PURE__ */ d(
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
- K.displayName = "SplitCellEditor";
98
+ R.displayName = "SplitCellEditor";
101
99
  export {
102
- K as SplitCellEditor
100
+ R as SplitCellEditor
103
101
  };
@@ -1,4 +1,4 @@
1
- import { ICellRendererParams } from 'ag-grid-community';
1
+ import { ICellRendererParams } from 'ag-grid-enterprise';
2
2
  export interface InputDisplayRendererProps extends ICellRendererParams {
3
3
  /** Placeholder text shown when value is empty */
4
4
  placeholder?: string;