impact-nova 1.2.4 → 1.5.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 (123) hide show
  1. package/README.md +49 -0
  2. package/dist/components/layout/dashboard-layout.d.ts +15 -1
  3. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +65 -64
  4. package/dist/components/ui/accordion.js +38 -34
  5. package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +1 -1
  6. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.d.ts +58 -0
  7. package/dist/components/ui/ag-grid-react/cell-renderers/cell-renderer-utils.js +104 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +62 -54
  9. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +4 -6
  10. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +54 -68
  11. package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +3 -1
  12. package/dist/components/ui/ag-grid-react/cell-renderers/index.js +33 -27
  13. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +3 -0
  14. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +28 -12
  15. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +1 -1
  16. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.d.ts +4 -6
  17. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +23 -37
  18. package/dist/components/ui/ag-grid-react/cell-renderers/types.d.ts +33 -17
  19. package/dist/components/ui/ag-grid-react/editable-utils.d.ts +27 -0
  20. package/dist/components/ui/ag-grid-react/editable-utils.js +62 -0
  21. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +99 -98
  22. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +110 -143
  23. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +72 -69
  24. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +36 -35
  25. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +14 -12
  26. package/dist/components/ui/ag-grid-react/headers/custom-header.js +111 -110
  27. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +204 -203
  28. package/dist/components/ui/alert.d.ts +1 -1
  29. package/dist/components/ui/alert.js +76 -60
  30. package/dist/components/ui/breadcrumb.js +81 -74
  31. package/dist/components/ui/calendar.js +355 -354
  32. package/dist/components/ui/chart/chart.js +63 -62
  33. package/dist/components/ui/chips.js +42 -38
  34. package/dist/components/ui/command-palette/command-palette-context.d.ts +52 -0
  35. package/dist/components/ui/command-palette/command-palette-context.js +110 -0
  36. package/dist/components/ui/command-palette/command-palette.d.ts +67 -0
  37. package/dist/components/ui/command-palette/command-palette.js +402 -0
  38. package/dist/components/ui/command-palette/index.d.ts +23 -0
  39. package/dist/components/ui/command-palette/index.js +44 -0
  40. package/dist/components/ui/command-palette/kbd.d.ts +28 -0
  41. package/dist/components/ui/command-palette/kbd.js +52 -0
  42. package/dist/components/ui/command-palette/shortcut-registry.d.ts +68 -0
  43. package/dist/components/ui/command-palette/shortcut-registry.js +183 -0
  44. package/dist/components/ui/command-palette/shortcut-scope-provider.d.ts +55 -0
  45. package/dist/components/ui/command-palette/shortcut-scope-provider.js +55 -0
  46. package/dist/components/ui/command-palette/shortcut-settings.d.ts +27 -0
  47. package/dist/components/ui/command-palette/shortcut-settings.js +266 -0
  48. package/dist/components/ui/command-palette/use-browser-shortcuts.d.ts +32 -0
  49. package/dist/components/ui/command-palette/use-browser-shortcuts.js +48 -0
  50. package/dist/components/ui/command-palette/use-global-shortcut.d.ts +3 -0
  51. package/dist/components/ui/command-palette/use-global-shortcut.js +7 -0
  52. package/dist/components/ui/command-palette/use-shortcut.d.ts +47 -0
  53. package/dist/components/ui/command-palette/use-shortcut.js +49 -0
  54. package/dist/components/ui/command-palette/utils.d.ts +119 -0
  55. package/dist/components/ui/command-palette/utils.js +248 -0
  56. package/dist/components/ui/data-table/data-table-column-list.js +87 -86
  57. package/dist/components/ui/data-table/data-table-format-options.js +45 -44
  58. package/dist/components/ui/data-table/data-table-view-options.js +39 -38
  59. package/dist/components/ui/date-picker/date-picker.js +89 -87
  60. package/dist/components/ui/date-picker/date-range-picker.js +140 -138
  61. package/dist/components/ui/date-picker/month-picker.js +82 -81
  62. package/dist/components/ui/date-picker/month-range-picker.js +108 -105
  63. package/dist/components/ui/date-picker/multi-date-picker.js +68 -66
  64. package/dist/components/ui/date-picker/multi-month-picker.js +59 -58
  65. package/dist/components/ui/date-picker/multi-week-picker.js +80 -78
  66. package/dist/components/ui/date-picker/week-picker.js +117 -115
  67. package/dist/components/ui/date-picker/week-range-picker.js +166 -164
  68. package/dist/components/ui/dialog.js +78 -73
  69. package/dist/components/ui/drawer.js +71 -66
  70. package/dist/components/ui/file-upload.js +131 -127
  71. package/dist/components/ui/filter-panel/filter-panel.js +98 -94
  72. package/dist/components/ui/filter-strip/filter-strip.js +95 -91
  73. package/dist/components/ui/filter-strip/filter-summary.js +91 -90
  74. package/dist/components/ui/header.js +57 -53
  75. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +78 -76
  76. package/dist/components/ui/loader.js +17 -16
  77. package/dist/components/ui/nested-list/components/NestedListHeader.d.ts +1 -0
  78. package/dist/components/ui/nested-list/components/NestedListHeader.js +51 -48
  79. package/dist/components/ui/nested-list/components/SortableItem.js +60 -59
  80. package/dist/components/ui/nested-list/nested-list.js +184 -182
  81. package/dist/components/ui/notification-panel/notification-panel.js +60 -53
  82. package/dist/components/ui/popover.js +45 -40
  83. package/dist/components/ui/prompt.js +90 -85
  84. package/dist/components/ui/select/select.js +225 -229
  85. package/dist/components/ui/sheet.d.ts +1 -0
  86. package/dist/components/ui/sheet.js +50 -48
  87. package/dist/components/ui/sidebar.js +273 -267
  88. package/dist/components/ui/stepper.js +75 -63
  89. package/dist/components/ui/tabs.d.ts +11 -1
  90. package/dist/components/ui/tabs.js +79 -54
  91. package/dist/components/ui/tag.js +48 -44
  92. package/dist/components/ui/toast.js +46 -41
  93. package/dist/i18n/ImpactNovaI18nContext.d.ts +21 -0
  94. package/dist/i18n/ImpactNovaI18nContext.js +76 -0
  95. package/dist/i18n/defaultMessages.d.ts +231 -0
  96. package/dist/i18n/defaultMessages.js +206 -0
  97. package/dist/i18n/getDateFnsLocale.d.ts +11 -0
  98. package/dist/i18n/getDateFnsLocale.js +21 -0
  99. package/dist/i18n/index.d.ts +5 -0
  100. package/dist/i18n/locales/de.d.ts +2 -0
  101. package/dist/i18n/locales/de.js +206 -0
  102. package/dist/i18n/locales/es.d.ts +2 -0
  103. package/dist/i18n/locales/es.js +206 -0
  104. package/dist/i18n/locales/hi.d.ts +2 -0
  105. package/dist/i18n/locales/hi.js +206 -0
  106. package/dist/i18n/locales/index.d.ts +4 -0
  107. package/dist/i18n/locales/kn.d.ts +2 -0
  108. package/dist/i18n/locales/kn.js +206 -0
  109. package/dist/icons/assets/boxAdd.svg.js +5 -0
  110. package/dist/icons/assets/boxed.svg.js +5 -0
  111. package/dist/icons/assets/trolley.svg.js +5 -0
  112. package/dist/icons/assets/unlocked.svg.js +5 -0
  113. package/dist/icons/assets/webp/delete-3d.webp.js +4 -0
  114. package/dist/icons/assets/webp/info-3d.webp.js +4 -0
  115. package/dist/icons/assets/webp/success-3d.webp.js +4 -0
  116. package/dist/icons/assets/webp/warning-3d.webp.js +4 -0
  117. package/dist/icons/index.d.ts +8 -0
  118. package/dist/icons/index.js +197 -181
  119. package/dist/impact-nova.css +1 -1
  120. package/dist/index.d.ts +4 -0
  121. package/dist/index.js +260 -199
  122. package/package.json +36 -4
  123. package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
@@ -1,221 +1,188 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import "react";
3
- import { Button as m } from "../../../button.js";
4
- import { Input as c } from "../../../input.js";
5
- import { DatePicker as T } from "../../../date-picker/date-picker.js";
6
- import { DateRangePicker as A } from "../../../date-picker/date-range-picker.js";
1
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as w } from "react";
3
+ import { Button as u } from "../../../button.js";
4
+ import { Input as v } from "../../../input.js";
5
+ import { DatePicker as P } from "../../../date-picker/date-picker.js";
6
+ import { DateRangePicker as T } from "../../../date-picker/date-range-picker.js";
7
7
  import p from "../../../select/select.js";
8
- import { Bin as x } from "../../../../../icons/index.js";
9
- import { createEmptyRule as N } from "../utils/filter-utils.js";
10
- const E = {
11
- text: [
12
- { label: "Contains", value: "contains" },
13
- { label: "Not contains", value: "notContains" },
14
- { label: "Equals", value: "equals" },
15
- { label: "Not equal", value: "notEqual" },
16
- { label: "Starts with", value: "startsWith" },
17
- { label: "Ends with", value: "endsWith" },
18
- { label: "Empty", value: "empty" },
19
- { label: "Not Empty", value: "notEmpty" }
20
- ],
21
- number: [
22
- { label: "Equals", value: "equals" },
23
- { label: "Not equal", value: "notEqual" },
24
- { label: "Greater than", value: "greaterThan" },
25
- { label: "≥", value: "greaterThanOrEqual" },
26
- { label: "Less than", value: "lessThan" },
27
- { label: "≤", value: "lessThanOrEqual" },
28
- { label: "In range", value: "inRange" },
29
- { label: "Empty", value: "empty" },
30
- { label: "Not Empty", value: "notEmpty" }
31
- ],
32
- date: [
33
- { label: "Equals", value: "equals" },
34
- { label: "Not equal", value: "notEqual" },
35
- { label: "After", value: "greaterThan" },
36
- { label: "Before", value: "lessThan" },
37
- { label: "Between", value: "inRange" }
38
- ],
39
- select: [
40
- { label: "In Set", value: "equals" }
41
- // agSetColumnFilter only supports inclusion (Set model)
42
- ],
43
- multi: [
44
- { label: "Contains", value: "contains" },
45
- { label: "Not contains", value: "notContains" },
46
- { label: "Starts with", value: "startsWith" },
47
- { label: "Ends with", value: "endsWith" },
48
- { label: "In Set", value: "equals" },
49
- { label: "Not In Set", value: "notEqual" },
50
- { label: "Empty", value: "empty" },
51
- { label: "Not Empty", value: "notEmpty" }
52
- ]
53
- }, w = [
54
- { label: "all", value: "AND" },
55
- { label: "any", value: "OR" }
56
- ], G = ({
8
+ import { Bin as E } from "../../../../../icons/index.js";
9
+ import { createEmptyRule as q } from "../utils/filter-utils.js";
10
+ import { useImpactNovaI18n as I } from "../../../../../i18n/ImpactNovaI18nContext.js";
11
+ const C = {
12
+ text: ["contains", "notContains", "equals", "notEqual", "startsWith", "endsWith", "empty", "notEmpty"],
13
+ number: ["equals", "notEqual", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual", "inRange", "empty", "notEmpty"],
14
+ date: ["equals", "notEqual", "greaterThan", "lessThan", "inRange"],
15
+ select: ["equals"],
16
+ multi: ["contains", "notContains", "startsWith", "endsWith", "equals", "notEqual", "empty", "notEmpty"]
17
+ }, $ = ({
57
18
  columnId: h,
58
- columnLabel: y,
19
+ columnLabel: R,
59
20
  columnType: n,
60
- selectOptions: f,
61
- isMultiSelect: u,
62
- rules: i,
63
- logic: q,
64
- onLogicChange: S,
65
- onRulesChange: v,
66
- canDeleteLastRule: d = !1,
67
- onDeleteColumnFilter: b
21
+ selectOptions: g,
22
+ isMultiSelect: c,
23
+ rules: s,
24
+ logic: y,
25
+ onLogicChange: O,
26
+ onRulesChange: m,
27
+ canDeleteLastRule: f = !1,
28
+ onDeleteColumnFilter: x
68
29
  }) => {
69
- const g = E[n] || E.text, C = () => {
70
- v([...i, N(h, n)]);
71
- }, O = (e) => {
72
- if (i.length > 1 || d) {
73
- const t = i.filter((a) => a.id !== e);
74
- t.length === 0 && d ? v([]) : v(t.length > 0 ? t : [N(h, n)]);
30
+ const { t: r } = I(), b = w(() => (C[n] ?? C.text).map((l) => ({ label: r(`filter.operators.${n === "date" && l === "greaterThan" ? "after" : n === "date" && l === "lessThan" ? "before" : n === "date" && l === "inRange" ? "between" : l}`), value: l })), [n, r]), N = w(
31
+ () => [
32
+ { label: r("filter.logicAll"), value: "AND" },
33
+ { label: r("filter.logicAny"), value: "OR" }
34
+ ],
35
+ [r]
36
+ ), A = () => {
37
+ m([...s, q(h, n)]);
38
+ }, F = (e) => {
39
+ if (s.length > 1 || f) {
40
+ const l = s.filter((t) => t.id !== e);
41
+ l.length === 0 && f ? m([]) : m(l.length > 0 ? l : [q(h, n)]);
75
42
  }
76
- }, o = (e, t) => {
77
- v(i.map((a) => a.id === e ? { ...a, ...t } : a));
78
- }, R = (e) => {
43
+ }, i = (e, l) => {
44
+ m(s.map((t) => t.id === e ? { ...t, ...l } : t));
45
+ }, S = (e) => {
79
46
  if (e.operator === "empty" || e.operator === "notEmpty")
80
- return /* @__PURE__ */ l("span", { className: "text-slate-400 italic text-sm", children: "No value needed" });
47
+ return /* @__PURE__ */ a("span", { className: "text-slate-400 italic text-sm", children: r("advancedFilter.noValueNeeded") });
81
48
  if (n === "date")
82
- return e.operator === "inRange" ? /* @__PURE__ */ l(
83
- A,
49
+ return e.operator === "inRange" ? /* @__PURE__ */ a(
50
+ T,
84
51
  {
85
52
  value: {
86
53
  from: e.value ? new Date(e.value) : void 0,
87
54
  to: e.valueTo ? new Date(e.valueTo) : void 0
88
55
  },
89
- onChange: (a) => {
90
- o(e.id, {
91
- value: a?.from?.toISOString() || "",
92
- valueTo: a?.to?.toISOString() || ""
56
+ onChange: (t) => {
57
+ i(e.id, {
58
+ value: t?.from?.toISOString() || "",
59
+ valueTo: t?.to?.toISOString() || ""
93
60
  });
94
61
  },
95
62
  showFooter: !0
96
63
  }
97
- ) : /* @__PURE__ */ l(
98
- T,
64
+ ) : /* @__PURE__ */ a(
65
+ P,
99
66
  {
100
67
  value: e.value ? new Date(e.value) : void 0,
101
- onChange: (a) => o(e.id, { value: a?.toISOString() || "" }),
102
- placeholder: "Select Date",
68
+ onChange: (t) => i(e.id, { value: t?.toISOString() || "" }),
69
+ placeholder: r("filter.selectDate"),
103
70
  showFooter: !0
104
71
  }
105
72
  );
106
- const t = e.operator === "equals" || e.operator === "notEqual";
107
- return n === "select" || n === "multi" && t ? /* @__PURE__ */ l(
73
+ const l = e.operator === "equals" || e.operator === "notEqual";
74
+ return n === "select" || n === "multi" && l ? /* @__PURE__ */ a(
108
75
  p,
109
76
  {
110
- options: f || [],
77
+ options: g || [],
111
78
  value: (() => {
112
- const a = (f || []).filter((r) => Array.isArray(e.value) ? e.value.includes(r.value) : String(e.value) === String(r.value));
113
- return a.length === 0 ? null : u !== !1 ? a : a[0];
79
+ const t = (g || []).filter((o) => Array.isArray(e.value) ? e.value.includes(o.value) : String(e.value) === String(o.value));
80
+ return t.length === 0 ? null : c !== !1 ? t : t[0];
114
81
  })(),
115
- onChange: (a) => {
116
- Array.isArray(a) ? o(e.id, { value: a.map((r) => r.value) }) : o(e.id, { value: a?.value || "" });
82
+ onChange: (t) => {
83
+ Array.isArray(t) ? i(e.id, { value: t.map((o) => o.value) }) : i(e.id, { value: t?.value || "" });
117
84
  },
118
- isMulti: u !== void 0 ? u : !0,
119
- placeholder: u === !1 ? "Select value" : "Select values...",
85
+ isMulti: c !== void 0 ? c : !0,
86
+ placeholder: r(c === !1 ? "filter.selectValue" : "filter.selectValues"),
120
87
  className: "w-full",
121
88
  menuPortalTarget: document.body
122
89
  }
123
- ) : e.operator === "inRange" ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 w-full", children: [
124
- /* @__PURE__ */ l(
125
- c,
90
+ ) : e.operator === "inRange" ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2 w-full", children: [
91
+ /* @__PURE__ */ a(
92
+ v,
126
93
  {
127
94
  value: e.value,
128
- onChange: (a) => o(e.id, { value: a.target.value }),
129
- placeholder: "From",
95
+ onChange: (t) => i(e.id, { value: t.target.value }),
96
+ placeholder: r("filter.from"),
130
97
  type: n === "number" ? "number" : "text",
131
98
  className: "flex-1"
132
99
  }
133
100
  ),
134
- /* @__PURE__ */ l("span", { className: "text-slate-400 shrink-0", children: "to" }),
135
- /* @__PURE__ */ l(
136
- c,
101
+ /* @__PURE__ */ a("span", { className: "text-slate-400 shrink-0", children: r("filter.to") }),
102
+ /* @__PURE__ */ a(
103
+ v,
137
104
  {
138
105
  value: e.valueTo || "",
139
- onChange: (a) => o(e.id, { valueTo: a.target.value }),
140
- placeholder: "To",
106
+ onChange: (t) => i(e.id, { valueTo: t.target.value }),
107
+ placeholder: r("filter.to"),
141
108
  type: n === "number" ? "number" : "text",
142
109
  className: "flex-1"
143
110
  }
144
111
  )
145
- ] }) : /* @__PURE__ */ l(
146
- c,
112
+ ] }) : /* @__PURE__ */ a(
113
+ v,
147
114
  {
148
115
  value: e.value,
149
- onChange: (a) => o(e.id, { value: a.target.value }),
150
- placeholder: "Enter value",
116
+ onChange: (t) => i(e.id, { value: t.target.value }),
117
+ placeholder: r("filter.enterValue"),
151
118
  type: n === "number" ? "number" : "text",
152
119
  className: "w-full"
153
120
  }
154
121
  );
155
- }, I = (e) => {
156
- const t = g.find((a) => a.value === e.operator);
157
- return /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
158
- /* @__PURE__ */ l("div", { className: "w-[120px] shrink-0", children: /* @__PURE__ */ l(
122
+ }, k = (e) => {
123
+ const l = b.find((t) => t.value === e.operator);
124
+ return /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
125
+ /* @__PURE__ */ a("div", { className: "w-[120px] shrink-0", children: /* @__PURE__ */ a(
159
126
  p,
160
127
  {
161
- options: g,
162
- value: t || null,
163
- onChange: (a) => {
164
- const r = a;
165
- r && o(e.id, { operator: r.value });
128
+ options: b,
129
+ value: l || null,
130
+ onChange: (t) => {
131
+ const o = t;
132
+ o && i(e.id, { operator: o.value });
166
133
  },
167
- placeholder: "Operator",
134
+ placeholder: r("filter.operator"),
168
135
  className: "w-full",
169
136
  menuPortalTarget: document.body
170
137
  }
171
138
  ) }),
172
- /* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: R(e) }),
173
- /* @__PURE__ */ l(
174
- m,
139
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: S(e) }),
140
+ /* @__PURE__ */ a(
141
+ u,
175
142
  {
176
- onClick: () => O(e.id),
143
+ onClick: () => F(e.id),
177
144
  variant: "tertiary",
178
145
  size: "icon",
179
- "aria-label": "Remove rule",
180
- disabled: i.length === 1 && !d,
181
- children: /* @__PURE__ */ l(x, { size: "xs" })
146
+ "aria-label": r("aria.removeRule"),
147
+ disabled: s.length === 1 && !f,
148
+ children: /* @__PURE__ */ a(E, { size: "xs" })
182
149
  }
183
150
  )
184
151
  ] }, e.id);
185
152
  };
186
- return /* @__PURE__ */ s("div", { className: "flex flex-col gap-4", children: [
187
- /* @__PURE__ */ s("div", { className: "text-slate-500 text-sm flex items-center gap-2 flex-wrap", children: [
188
- /* @__PURE__ */ l("span", { children: "Match" }),
189
- /* @__PURE__ */ l("div", { className: "w-[80px]", children: /* @__PURE__ */ l(
153
+ return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4", children: [
154
+ /* @__PURE__ */ d("div", { className: "text-slate-500 text-sm flex items-center gap-2 flex-wrap", children: [
155
+ /* @__PURE__ */ a("span", { children: r("advancedFilter.match") }),
156
+ /* @__PURE__ */ a("div", { className: "w-[80px]", children: /* @__PURE__ */ a(
190
157
  p,
191
158
  {
192
- options: w,
193
- value: w.find((e) => e.value === q),
159
+ options: N,
160
+ value: N.find((e) => e.value === y),
194
161
  onChange: (e) => {
195
- const t = e;
196
- t && S(t.value);
162
+ const l = e;
163
+ l && O(l.value);
197
164
  },
198
165
  className: "h-8",
199
166
  menuPortalTarget: document.body,
200
167
  isClearable: !1
201
168
  }
202
169
  ) }),
203
- /* @__PURE__ */ l("span", { children: "of the following rules for column" }),
204
- /* @__PURE__ */ l("span", { className: "font-semibold text-slate-700", children: y })
170
+ /* @__PURE__ */ a("span", { children: r("advancedFilter.ofTheFollowingRulesForColumn") }),
171
+ /* @__PURE__ */ a("span", { className: "font-semibold text-slate-700", children: R })
205
172
  ] }),
206
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-3", children: i.map((e) => I(e)) }),
207
- /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-1", children: [
208
- /* @__PURE__ */ l(m, { onClick: C, variant: "outline", size: "sm", children: "+ Add Rule" }),
209
- b && /* @__PURE__ */ s(
210
- m,
173
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: s.map((e) => k(e)) }),
174
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between mt-1", children: [
175
+ /* @__PURE__ */ a(u, { onClick: A, variant: "outline", size: "sm", children: r("advancedFilter.addRule") }),
176
+ x && /* @__PURE__ */ d(
177
+ u,
211
178
  {
212
179
  variant: "outline",
213
180
  size: "sm",
214
- onClick: b,
181
+ onClick: x,
215
182
  className: "text-red-500 hover:text-red-600 hover:bg-red-50 border-red-300",
216
183
  children: [
217
- /* @__PURE__ */ l(x, { size: "xs" }),
218
- "Delete"
184
+ /* @__PURE__ */ a(E, { size: "xs" }),
185
+ r("advancedFilter.deleteColumn")
219
186
  ]
220
187
  }
221
188
  )
@@ -223,5 +190,5 @@ const E = {
223
190
  ] });
224
191
  };
225
192
  export {
226
- G as ColumnFilterSection
193
+ $ as ColumnFilterSection
227
194
  };
@@ -1,108 +1,111 @@
1
- import { jsxs as n, jsx as e, Fragment as j } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as e, Fragment as j } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Settings as T, Checkmark as d, Search as L } from "../../../../../icons/index.js";
4
- import { DropdownMenu as _, DropdownMenuTrigger as E, DropdownMenuContent as G, DropdownMenuLabel as k, DropdownMenuSeparator as z, DropdownMenuSub as m, DropdownMenuSubTrigger as p, DropdownMenuSubContent as f, DropdownMenuItem as s } from "../../../dropdown-menu.js";
5
- import { useGridHeader as H } from "../context/grid-header-context.js";
6
- const K = ({
3
+ import { Settings as F, Checkmark as h, Search as _ } from "../../../../../icons/index.js";
4
+ import { DropdownMenu as E, DropdownMenuTrigger as G, DropdownMenuContent as L, DropdownMenuLabel as k, DropdownMenuSeparator as z, DropdownMenuSub as p, DropdownMenuSubTrigger as f, DropdownMenuSubContent as g, DropdownMenuItem as a } from "../../../dropdown-menu.js";
5
+ import { useGridHeader as R } from "../context/grid-header-context.js";
6
+ import { useImpactNovaI18n as B } from "../../../../../i18n/ImpactNovaI18nContext.js";
7
+ const U = ({
7
8
  isOpen: O,
8
- onClose: a,
9
- columnId: i,
10
- gridApi: r,
9
+ onClose: c,
10
+ columnId: l,
11
+ gridApi: i,
11
12
  anchor: A
12
13
  }) => {
13
- const S = H(), o = r.getColumn(i);
14
- if (!o) return null;
15
- const l = o.getColDef(), C = o.getSort(), g = o.getPinned(), M = l?.sortable !== !1, x = l?.filter || "agTextColumnFilter", w = x === "agNumberColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("numericColumn") : l?.type === "numericColumn"), D = x === "agDateColumnFilter" || (Array.isArray(l?.type) ? l.type.includes("dateColumn") : l?.type === "dateColumn"), h = (t) => {
16
- r.applyColumnState({
17
- state: [{ colId: i, sort: t }],
14
+ const { t: n } = B(), C = R(), d = i.getColumn(l);
15
+ if (!d) return null;
16
+ const s = d.getColDef(), x = d.getSort(), S = d.getPinned(), M = s?.sortable !== !1, D = s?.filter || "agTextColumnFilter", H = D === "agNumberColumnFilter" || (Array.isArray(s?.type) ? s.type.includes("numericColumn") : s?.type === "numericColumn"), b = D === "agDateColumnFilter" || (Array.isArray(s?.type) ? s.type.includes("dateColumn") : s?.type === "dateColumn"), u = (t) => {
17
+ i.applyColumnState({
18
+ state: [{ colId: l, sort: t }],
18
19
  defaultState: { sort: null }
19
- }), a();
20
- }, u = (t) => {
21
- r.applyColumnState({
22
- state: [{ colId: i, pinned: t }],
20
+ }), c();
21
+ }, m = (t) => {
22
+ i.applyColumnState({
23
+ state: [{ colId: l, pinned: t }],
23
24
  defaultState: { pinned: null }
24
- }), a();
25
- }, b = (t) => {
26
- t ? r.autoSizeAllColumns() : r.autoSizeColumns([i]), a();
25
+ }), c();
26
+ }, w = (t) => {
27
+ t ? i.autoSizeAllColumns() : i.autoSizeColumns([l]), c();
27
28
  }, P = () => {
28
- const t = r.getGridOption("context") || {};
29
- r.setGridOption("context", { ...t, activeSearchColumnId: i }), r.refreshHeader(), a();
30
- }, F = () => {
31
- const t = l?.headerComponentParams;
32
- t?.onAdvanceSearchClick ? t.onAdvanceSearchClick(o) : t?.toggleAdvanceSearch ? t.toggleAdvanceSearch(i) : S && S.openAdvancedFilter(i), a();
33
- }, c = A?.getBoundingClientRect(), y = l?.headerComponentParams, N = y?.isSearchable, v = y?.advanceSearchEnabled;
34
- return /* @__PURE__ */ n(_, { open: O, onOpenChange: (t) => !t && a(), children: [
35
- c && /* @__PURE__ */ e(E, { asChild: !0, children: /* @__PURE__ */ e(
29
+ const t = i.getGridOption("context") || {};
30
+ i.setGridOption("context", { ...t, activeSearchColumnId: l }), i.refreshHeader(), c();
31
+ }, T = () => {
32
+ const t = s?.headerComponentParams;
33
+ t?.onAdvanceSearchClick ? t.onAdvanceSearchClick(d) : t?.toggleAdvanceSearch ? t.toggleAdvanceSearch(l) : C && C.openAdvancedFilter(l), c();
34
+ }, o = A?.getBoundingClientRect(), y = s?.headerComponentParams, N = y?.isSearchable, v = y?.advanceSearchEnabled;
35
+ return /* @__PURE__ */ r(E, { open: O, onOpenChange: (t) => !t && c(), children: [
36
+ o && /* @__PURE__ */ e(G, { asChild: !0, children: /* @__PURE__ */ e(
36
37
  "div",
37
38
  {
38
39
  style: {
39
40
  position: "fixed",
40
- left: c.left,
41
- top: c.top,
42
- width: c.width,
43
- height: c.height,
41
+ left: o.left,
42
+ top: o.top,
43
+ width: o.width,
44
+ height: o.height,
44
45
  pointerEvents: "none",
45
46
  visibility: "hidden"
46
47
  }
47
48
  }
48
49
  ) }),
49
50
  /* @__PURE__ */ e(
50
- G,
51
+ L,
51
52
  {
52
53
  align: "end",
53
54
  side: "bottom",
54
55
  sideOffset: 5,
55
56
  className: "w-[200px] p-2 rounded-[8px] border-none !shadow-[0px_0px_2px_0px_rgba(0,0,0,0.25)]",
56
57
  onCloseAutoFocus: (t) => t.preventDefault(),
57
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
58
- /* @__PURE__ */ n(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
59
- /* @__PURE__ */ e(T, { size: "xs" }),
60
- " Column Settings"
58
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5", children: [
59
+ /* @__PURE__ */ r(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
60
+ /* @__PURE__ */ e(F, { size: "xs" }),
61
+ " ",
62
+ n("gridHeader.columnSettings")
61
63
  ] }),
62
64
  /* @__PURE__ */ e(z, {}),
63
- M && /* @__PURE__ */ n(m, { children: [
64
- /* @__PURE__ */ e(p, { inset: !0, children: "Sort" }),
65
- /* @__PURE__ */ n(f, { sideOffset: 10, alignOffset: -5, children: [
66
- /* @__PURE__ */ e(s, { onClick: () => h("asc"), children: /* @__PURE__ */ n("span", { className: "flex items-center w-full justify-between", children: [
67
- /* @__PURE__ */ e("span", { children: w ? "Sort Smallest to Largest" : D ? "Sort Oldest to Newest" : "Sort A to Z" }),
68
- C === "asc" && /* @__PURE__ */ e(d, { size: "sm", className: "ml-2 text-[#60697D]" })
65
+ M && /* @__PURE__ */ r(p, { children: [
66
+ /* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.sort") }),
67
+ /* @__PURE__ */ r(g, { sideOffset: 10, alignOffset: -5, children: [
68
+ /* @__PURE__ */ e(a, { onClick: () => u("asc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
69
+ /* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortAscNumber" : b ? "gridHeader.sortAscDate" : "gridHeader.sortAscText") }),
70
+ x === "asc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
69
71
  ] }) }),
70
- /* @__PURE__ */ e(s, { onClick: () => h("desc"), children: /* @__PURE__ */ n("span", { className: "flex items-center w-full justify-between", children: [
71
- /* @__PURE__ */ e("span", { children: w ? "Sort Largest to Smallest" : D ? "Sort Newest to Oldest" : "Sort Z to A" }),
72
- C === "desc" && /* @__PURE__ */ e(d, { size: "sm", className: "ml-2 text-[#60697D]" })
72
+ /* @__PURE__ */ e(a, { onClick: () => u("desc"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
73
+ /* @__PURE__ */ e("span", { children: n(H ? "gridHeader.sortDescNumber" : b ? "gridHeader.sortDescDate" : "gridHeader.sortDescText") }),
74
+ x === "desc" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
73
75
  ] }) }),
74
- /* @__PURE__ */ e(s, { onClick: () => h(null), children: /* @__PURE__ */ e("span", { children: "Reset" }) })
76
+ /* @__PURE__ */ e(a, { onClick: () => u(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.reset") }) })
75
77
  ] })
76
78
  ] }),
77
- /* @__PURE__ */ n(m, { children: [
78
- /* @__PURE__ */ e(p, { inset: !0, children: "Freeze Column" }),
79
- /* @__PURE__ */ n(f, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
80
- /* @__PURE__ */ e(s, { onClick: () => u("left"), children: /* @__PURE__ */ n("span", { className: "flex items-center w-full justify-between", children: [
81
- /* @__PURE__ */ e("span", { children: "Pin Left" }),
82
- g === "left" && /* @__PURE__ */ e(d, { size: "sm", className: "ml-2 text-[#60697D]" })
79
+ /* @__PURE__ */ r(p, { children: [
80
+ /* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.freezeColumn") }),
81
+ /* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
82
+ /* @__PURE__ */ e(a, { onClick: () => m("left"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
83
+ /* @__PURE__ */ e("span", { children: n("gridHeader.pinLeft") }),
84
+ S === "left" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
83
85
  ] }) }),
84
- /* @__PURE__ */ e(s, { onClick: () => u("right"), children: /* @__PURE__ */ n("span", { className: "flex items-center w-full justify-between", children: [
85
- /* @__PURE__ */ e("span", { children: "Pin Right" }),
86
- g === "right" && /* @__PURE__ */ e(d, { size: "sm", className: "ml-2 text-[#60697D]" })
86
+ /* @__PURE__ */ e(a, { onClick: () => m("right"), children: /* @__PURE__ */ r("span", { className: "flex items-center w-full justify-between", children: [
87
+ /* @__PURE__ */ e("span", { children: n("gridHeader.pinRight") }),
88
+ S === "right" && /* @__PURE__ */ e(h, { size: "sm", className: "ml-2 text-[#60697D]" })
87
89
  ] }) }),
88
- /* @__PURE__ */ e(s, { onClick: () => u(null), children: /* @__PURE__ */ e("span", { children: "No Pin" }) })
90
+ /* @__PURE__ */ e(a, { onClick: () => m(null), children: /* @__PURE__ */ e("span", { children: n("gridHeader.noPin") }) })
89
91
  ] })
90
92
  ] }),
91
- /* @__PURE__ */ n(m, { children: [
92
- /* @__PURE__ */ e(p, { inset: !0, children: "Column width" }),
93
- /* @__PURE__ */ n(f, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
94
- /* @__PURE__ */ e(s, { onClick: () => b(!1), children: "Autosize This Column" }),
95
- /* @__PURE__ */ e(s, { onClick: () => b(!0), children: "Autosize All Columns" })
93
+ /* @__PURE__ */ r(p, { children: [
94
+ /* @__PURE__ */ e(f, { inset: !0, children: n("gridHeader.columnWidth") }),
95
+ /* @__PURE__ */ r(g, { className: "z-[120]", sideOffset: 10, alignOffset: -5, children: [
96
+ /* @__PURE__ */ e(a, { onClick: () => w(!1), children: n("gridHeader.autosizeThisColumn") }),
97
+ /* @__PURE__ */ e(a, { onClick: () => w(!0), children: n("gridHeader.autosizeAllColumns") })
96
98
  ] })
97
99
  ] }),
98
- (N || v) && /* @__PURE__ */ n(j, { children: [
100
+ (N || v) && /* @__PURE__ */ r(j, { children: [
99
101
  /* @__PURE__ */ e(z, {}),
100
- /* @__PURE__ */ n(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
101
- /* @__PURE__ */ e(L, { size: "xs" }),
102
- " Search Options"
102
+ /* @__PURE__ */ r(k, { className: "flex items-center gap-2 text-[#60697D]", children: [
103
+ /* @__PURE__ */ e(_, { size: "xs" }),
104
+ " ",
105
+ n("gridHeader.searchOptions")
103
106
  ] }),
104
- N && /* @__PURE__ */ e(s, { inset: !0, onClick: P, children: "Search" }),
105
- v && /* @__PURE__ */ e(s, { inset: !0, onClick: F, children: "Advance Search" })
107
+ N && /* @__PURE__ */ e(a, { inset: !0, onClick: P, children: n("gridHeader.search") }),
108
+ v && /* @__PURE__ */ e(a, { inset: !0, onClick: T, children: n("gridHeader.advanceSearch") })
106
109
  ] })
107
110
  ] })
108
111
  }
@@ -110,5 +113,5 @@ const K = ({
110
113
  ] });
111
114
  };
112
115
  export {
113
- K as ColumnSettingsMenu
116
+ U as ColumnSettingsMenu
114
117
  };