impact-nova 2.5.7 → 2.5.9

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 (159) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +2 -2
  2. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
  3. package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
  4. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
  5. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
  7. package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
  8. package/dist/components/data-display/calendar/calendar-config.js +31 -20
  9. package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
  10. package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
  11. package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
  12. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
  13. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
  14. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
  15. package/dist/components/data-display/calendar/calendar-day-picker-components.js +196 -102
  16. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
  17. package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
  18. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
  19. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
  20. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +16 -0
  21. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +41 -0
  22. package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
  23. package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
  24. package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
  25. package/dist/components/data-display/calendar/calendar-footer.js +88 -66
  26. package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
  27. package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
  28. package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
  29. package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
  30. package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
  31. package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
  32. package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
  33. package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
  34. package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
  35. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
  36. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
  37. package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
  38. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
  39. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
  40. package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
  41. package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
  42. package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
  43. package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
  44. package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
  45. package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
  46. package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
  47. package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
  48. package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
  49. package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
  50. package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
  51. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
  52. package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
  53. package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
  54. package/dist/components/data-display/calendar/calendar-selection.js +31 -0
  55. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
  56. package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
  57. package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
  58. package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
  59. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
  60. package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
  61. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
  62. package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
  63. package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
  64. package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
  65. package/dist/components/data-display/calendar/calendar.d.ts +1 -1
  66. package/dist/components/data-display/calendar/calendar.js +303 -181
  67. package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
  68. package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
  69. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
  70. package/dist/components/data-display/calendar/index.d.ts +1 -1
  71. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
  72. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
  73. package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
  74. package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
  75. package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
  76. package/dist/components/data-display/calendar/use-fiscal-calendar.js +25 -0
  77. package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
  78. package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
  79. package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
  80. package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
  81. package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
  82. package/dist/components/forms/date-picker/date-picker.js +187 -167
  83. package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
  84. package/dist/components/forms/date-picker/date-range-picker.js +273 -224
  85. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
  86. package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
  87. package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
  88. package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
  89. package/dist/components/forms/date-picker/index.d.ts +12 -0
  90. package/dist/components/forms/date-picker/index.js +19 -7
  91. package/dist/components/forms/date-picker/month-picker.js +225 -182
  92. package/dist/components/forms/date-picker/month-range-picker.js +134 -110
  93. package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
  94. package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
  95. package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
  96. package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
  97. package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
  98. package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
  99. package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
  100. package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
  101. package/dist/components/forms/date-picker/quarter-picker.js +176 -0
  102. package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
  103. package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
  104. package/dist/components/forms/date-picker/week-picker.js +148 -137
  105. package/dist/components/forms/date-picker/week-range-picker.js +216 -205
  106. package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
  107. package/dist/components/forms/date-picker/year-picker.js +176 -0
  108. package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
  109. package/dist/components/forms/date-picker/year-range-picker.js +179 -0
  110. package/dist/components/forms/smart-input/smart-input.js +106 -85
  111. package/dist/components/forms/smart-input/smart-input.types.d.ts +5 -0
  112. package/dist/components/forms/textarea/textarea.js +29 -28
  113. package/dist/components/forms/textarea/textarea.types.d.ts +1 -0
  114. package/dist/form-react/Fields/DateInputField.js +63 -58
  115. package/dist/form-react/Fields/DateRangeField.js +42 -37
  116. package/dist/form-react/Fields/MonthRangeField.js +50 -45
  117. package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
  118. package/dist/form-react/Fields/TextField.js +25 -24
  119. package/dist/form-react/Fields/WeekRangePicker.js +44 -45
  120. package/dist/form-react/components/FieldRenderer.js +21 -23
  121. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
  122. package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
  123. package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
  124. package/dist/form-react/registry/resolveFieldComponent.js +9 -133
  125. package/dist/form-react/types/fields.types.d.ts +25 -4
  126. package/dist/form-react/utils/date.utils.d.ts +1 -1
  127. package/dist/form-react/utils/date.utils.js +38 -38
  128. package/dist/i18n/defaultMessages.d.ts +19 -1
  129. package/dist/i18n/defaultMessages.js +37 -20
  130. package/dist/i18n/locales/de.js +18 -1
  131. package/dist/i18n/locales/es.js +18 -1
  132. package/dist/i18n/locales/hi.js +18 -1
  133. package/dist/i18n/locales/kn.js +18 -1
  134. package/dist/impact-nova-components.css +379 -3
  135. package/dist/impact-nova.css +1 -1
  136. package/dist/index.js +528 -516
  137. package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
  138. package/dist/lib/fiscal-calendar/build-year.js +173 -0
  139. package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
  140. package/dist/lib/fiscal-calendar/civil-date.js +94 -0
  141. package/dist/lib/fiscal-calendar/index.d.ts +10 -0
  142. package/dist/lib/fiscal-calendar/index.js +40 -0
  143. package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
  144. package/dist/lib/fiscal-calendar/lookup.js +70 -0
  145. package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
  146. package/dist/lib/fiscal-calendar/presets.js +99 -0
  147. package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
  148. package/dist/lib/fiscal-calendar/selection.js +32 -0
  149. package/dist/lib/fiscal-calendar/types.d.ts +145 -0
  150. package/dist/lib/fiscal-calendar/types.js +10 -0
  151. package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
  152. package/dist/lib/fiscal-calendar/week-selection.js +107 -0
  153. package/dist/llms/rules/best-practices.js +1 -1
  154. package/dist/llms/rules/installation.js +1 -1
  155. package/dist/llms/rules/real-world-patterns.js +1 -1
  156. package/dist/llms/rules/requirements.js +1 -1
  157. package/package.json +5 -1
  158. package/dist/lib/fiscal-calendar.d.ts +0 -62
  159. package/dist/lib/fiscal-calendar.js +0 -99
@@ -46,9 +46,9 @@ export interface ExtendedHeaderComponentParams extends Partial<IHeaderParams> {
46
46
  dateDisplayFormat?: string;
47
47
  /** Fiscal calendar configuration for week/month picker */
48
48
  fiscalConfig?: {
49
- calendarType?: 'calendar' | 'fiscal';
49
+ calendarKind?: 'gregorian' | 'fiscal';
50
50
  fiscalMode?: 'basic' | 'advanced' | 'custom';
51
- selectionMode?: 'week' | 'fiscalMonth';
51
+ granularity?: 'day' | 'week' | 'period' | 'quarter' | 'year';
52
52
  fiscalMonthPattern?: number[];
53
53
  fiscalYearStartMonth?: number;
54
54
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
@@ -1,12 +1,14 @@
1
1
  import { default as React } from 'react';
2
2
  export type DatePickerVariant = 'date' | 'month' | 'week';
3
3
  export interface FiscalConfig {
4
- calendarType?: 'calendar' | 'fiscal';
4
+ calendarKind?: 'gregorian' | 'fiscal';
5
5
  fiscalMode?: 'basic' | 'advanced' | 'custom';
6
- selectionMode?: 'week' | 'fiscalMonth';
6
+ granularity?: 'day' | 'week' | 'period' | 'quarter' | 'year';
7
7
  fiscalMonthPattern?: number[];
8
8
  fiscalYearStartMonth?: number;
9
9
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
10
+ fiscalConfig?: import('../../../../../lib/fiscal-calendar').FiscalCalendarConfig;
11
+ showPresets?: boolean;
10
12
  }
11
13
  export interface DateFilterPickerProps {
12
14
  variant: DatePickerVariant;
@@ -1,18 +1,18 @@
1
1
  import { jsxs as y, jsx as r } from "react/jsx-runtime";
2
- import { useRef as Le, useCallback as X, useState as _e } from "react";
3
- import { Filter as Ue, Cross as j } from "impact-nova-icons";
4
- import { cn as Je } from "../../../../lib/utils.js";
2
+ import { useRef as Ve, useCallback as X, useState as Le } from "react";
3
+ import { Filter as _e, Cross as j } from "impact-nova-icons";
4
+ import { cn as Ue } from "../../../../lib/utils.js";
5
5
  import { DatePicker as Te } from "../../../forms/date-picker/date-picker.js";
6
6
  import { MonthPicker as De } from "../../../forms/date-picker/month-picker.js";
7
7
  import { WeekPicker as Ne } from "../../../forms/date-picker/week-picker.js";
8
8
  import { Input as q } from "../../../forms/input/input.js";
9
9
  import { Select as Pe } from "../../../forms/select/select.js";
10
- import { Popover as Ke, PopoverTrigger as Qe, PopoverContent as Xe, PopoverHeader as Ze, PopoverTitle as $e, PopoverBody as et } from "../../../feedback/popover/popover.js";
10
+ import { Popover as Je, PopoverTrigger as Qe, PopoverContent as Xe, PopoverHeader as Ze, PopoverTitle as $e, PopoverBody as et } from "../../../feedback/popover/popover.js";
11
11
  import { useImpactNovaI18n as tt } from "../../../../i18n/use-impact-nova-i18n.js";
12
12
  import { useGridHeader as rt } from "./context/grid-header-context.js";
13
13
  import { getMultiFilterIndices as H, parseInputPattern as we, mapOperatorToAgGrid as ke } from "./utils/filter-utils.js";
14
14
  import { DEFAULT_DATE_DISPLAY_FORMAT as lt, serializeWeek as nt, serializeMonth as at, serializeDate as ot, displayDateToIso as Z } from "./utils/date-utils.js";
15
- import { useHeaderSearchEditingState as st } from "./use-header-search-editing-state.js";
15
+ import { useHeaderSearchEditingState as it } from "./use-header-search-editing-state.js";
16
16
  const Tt = ({
17
17
  column: P,
18
18
  api: F,
@@ -32,27 +32,27 @@ const Tt = ({
32
32
  enableBooleanParsing: Be = !1,
33
33
  enableDateParsing: Ie = !1
34
34
  }) => {
35
- const { t: i } = tt(), l = P.getColDef(), d = P.getColId(), G = l?.filter || "agTextColumnFilter", M = G === "agDateColumnFilter", V = G === "agSetColumnFilter" || Y && Y.length > 0 || l?.cellDataType === "boolean", L = l?.headerComponentParams?.datePickerVariant || "date", z = M && L === "month", B = M && L === "week", c = l?.headerComponentParams?.fiscalConfig, x = l?.headerComponentParams?.dateDisplayFormat || lt, oe = rt(), _ = Le(null), {
36
- searchText: U,
35
+ const { t: s } = tt(), l = P.getColDef(), d = P.getColId(), G = l?.filter || "agTextColumnFilter", M = G === "agDateColumnFilter", K = G === "agSetColumnFilter" || Y && Y.length > 0 || l?.cellDataType === "boolean", V = l?.headerComponentParams?.datePickerVariant || "date", z = M && V === "month", B = M && V === "week", c = l?.headerComponentParams?.fiscalConfig, x = l?.headerComponentParams?.dateDisplayFormat || lt, oe = rt(), L = Ve(null), {
36
+ searchText: _,
37
37
  dateDisplayString: I,
38
- selectedDate: se,
39
- selectedMonth: ie,
38
+ selectedDate: ie,
39
+ selectedMonth: se,
40
40
  selectedWeek: ce,
41
41
  updateDraft: w,
42
42
  handleFocus: p,
43
43
  handleBlur: h,
44
44
  clearEditingOverlay: Oe
45
- } = st({
45
+ } = it({
46
46
  api: F,
47
47
  colId: d,
48
48
  colDef: l,
49
49
  isDateFilter: M,
50
50
  isMonthVariant: z,
51
51
  isWeekVariant: B,
52
- datePickerVariant: L,
52
+ datePickerVariant: V,
53
53
  dateDisplayFormat: x
54
54
  }), D = (e, t) => {
55
- const n = (a) => a.replace(/[^0-9.\-+eE]/g, ""), s = (a, R) => {
55
+ const n = (a) => a.replace(/[^0-9.\-+eE]/g, ""), i = (a, R) => {
56
56
  const S = we(
57
57
  a,
58
58
  ze,
@@ -123,11 +123,11 @@ const Tt = ({
123
123
  }
124
124
  else {
125
125
  const a = l.filter === "agMultiColumnFilter" ? H(l) : null, R = a ? a.text !== -1 ? "text" : "number" : G === "agNumberColumnFilter" ? "number" : "text";
126
- o = s(String(e), R);
126
+ o = i(String(e), R);
127
127
  }
128
128
  const f = l.filter === "agMultiColumnFilter" ? H(l) : null, T = f ? t === "text" ? f.text !== -1 ? f.text : f.number : t === "set" ? f.set : f.date : 0;
129
- K(o, T);
130
- }, J = (e) => {
129
+ J(o, T);
130
+ }, U = (e) => {
131
131
  if (ee) {
132
132
  ee(Array.isArray(e) ? e.join(",") : e);
133
133
  return;
@@ -135,9 +135,9 @@ const Tt = ({
135
135
  D(e, M ? "date" : "text");
136
136
  }, de = (e) => {
137
137
  const t = e.target.value;
138
- w({ searchText: t }), J(t);
138
+ w({ searchText: t }), U(t);
139
139
  }, ue = (e) => {
140
- w({ selectedDate: e }), J(e);
140
+ w({ selectedDate: e }), U(e);
141
141
  }, fe = (e) => {
142
142
  w({ selectedMonth: e }), D(e || null, "date");
143
143
  }, pe = (e) => {
@@ -168,33 +168,33 @@ const Tt = ({
168
168
  };
169
169
  if (t.conditions.length === 1)
170
170
  return n(t.conditions[0]);
171
- const s = t.conditions.map(n).filter((o) => o !== null);
172
- return s.length === 0 ? null : s.length === 1 ? s[0] : {
171
+ const i = t.conditions.map(n).filter((o) => o !== null);
172
+ return i.length === 0 ? null : i.length === 1 ? i[0] : {
173
173
  filterType: "date",
174
174
  operator: t.logic,
175
- conditions: s
175
+ conditions: i
176
176
  };
177
- }, K = X(
177
+ }, J = X(
178
178
  (e, t) => {
179
- const n = F.getFilterModel(), s = { ...n };
179
+ const n = F.getFilterModel(), i = { ...n };
180
180
  if (l.filter === "agMultiColumnFilter") {
181
181
  if (t === -1) return;
182
182
  const o = n[d], v = o && o.filterType === "multi" ? [...o.filterModels || []] : Array(l.filterParams?.filters?.length || 1).fill(null);
183
- v[t] = e, v.every((f) => f === null) ? delete s[d] : s[d] = {
183
+ v[t] = e, v.every((f) => f === null) ? delete i[d] : i[d] = {
184
184
  filterType: "multi",
185
185
  filterModels: v
186
186
  };
187
187
  } else
188
- e ? s[d] = e : delete s[d];
189
- F.setFilterModel(s);
188
+ e ? i[d] = e : delete i[d];
189
+ F.setFilterModel(i);
190
190
  },
191
191
  [F, d, l]
192
192
  ), he = X(
193
193
  (e) => {
194
194
  const t = l.filter === "agMultiColumnFilter" ? H(l).date : 0;
195
- K(e, t);
195
+ J(e, t);
196
196
  },
197
- [l, K]
197
+ [l, J]
198
198
  ), me = (e) => {
199
199
  const t = e.target.value.replace(/[^0-9/\-!=><+,~]/g, "");
200
200
  if (w({ dateDisplayString: t }), !t.trim()) {
@@ -204,21 +204,21 @@ const Tt = ({
204
204
  const n = We(t);
205
205
  n && he(n);
206
206
  }, Q = () => {
207
- Oe(), J(""), te && te();
207
+ Oe(), U(""), te && te();
208
208
  }, O = (e) => {
209
209
  D(e, "set");
210
210
  }, W = Y || (l?.cellDataType === "boolean" ? [
211
- { label: i("gridHeader.true"), value: "true" },
212
- { label: i("gridHeader.false"), value: "false" }
211
+ { label: s("gridHeader.true"), value: "true" },
212
+ { label: s("gridHeader.false"), value: "false" }
213
213
  ] : []), ge = X(() => {
214
214
  const e = F.getFilterModel()[d];
215
215
  if (!e) return [];
216
216
  if ("filterType" in e && e.filterType === "multi" && e.filterModels) {
217
217
  const n = H(P.getColDef()).set;
218
218
  if (n !== -1) {
219
- const s = e.filterModels[n];
220
- if (s?.filterType === "set" && s.values)
221
- return s.values.filter((o) => o != null);
219
+ const i = e.filterModels[n];
220
+ if (i?.filterType === "set" && i.values)
221
+ return i.values.filter((o) => o != null);
222
222
  }
223
223
  } else {
224
224
  if (e.filterType === "set" && "values" in e)
@@ -227,7 +227,7 @@ const Tt = ({
227
227
  return [String(e.filter)];
228
228
  }
229
229
  return [];
230
- }, [F, d, P]), [E, k] = _e(null), ve = () => {
230
+ }, [F, d, P]), [E, k] = Le(null), ve = () => {
231
231
  const e = E !== null ? E : ge();
232
232
  return C ? W.filter((t) => e.includes(t.value)) : W.find((t) => e.includes(t.value)) || null;
233
233
  }, ye = (e) => {
@@ -261,7 +261,7 @@ const Tt = ({
261
261
  width: "18",
262
262
  height: "18",
263
263
  onClick: (e) => {
264
- e.stopPropagation(), _.current && _.current.blur(), re ? re(P) : le ? le(d) : oe && oe.openAdvancedFilter(d);
264
+ e.stopPropagation(), L.current && L.current.blur(), re ? re(P) : le ? le(d) : oe && oe.openAdvancedFilter(d);
265
265
  },
266
266
  children: /* @__PURE__ */ r("path", { d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z" })
267
267
  }
@@ -274,8 +274,8 @@ const Tt = ({
274
274
  }
275
275
  ), N = l.filter === "agMultiColumnFilter", m = H(l);
276
276
  let g = "text";
277
- N ? g = m.set !== -1 ? "set" : m.date !== -1 ? "date" : "text" : V ? g = "set" : M && (g = "date");
278
- const Ge = N ? m.text !== -1 || m.number !== -1 : !M && !V, xe = N ? m.set !== -1 : V, be = N ? m.date !== -1 : M, Ve = F.getFilterModel()[d], Fe = N && Ve?.filterModels?.some((e, t) => {
277
+ N ? g = m.set !== -1 ? "set" : m.date !== -1 ? "date" : "text" : K ? g = "set" : M && (g = "date");
278
+ const Ge = N ? m.text !== -1 || m.number !== -1 : !M && !K, xe = N ? m.set !== -1 : K, be = N ? m.date !== -1 : M, Ke = F.getFilterModel()[d], Fe = N && Ke?.filterModels?.some((e, t) => {
279
279
  const n = t === m.text || t === m.number ? "text" : t === m.set ? "set" : "date";
280
280
  return e !== null && n !== g;
281
281
  });
@@ -287,7 +287,7 @@ const Tt = ({
287
287
  value: ve(),
288
288
  onChange: ye,
289
289
  isMulti: C !== void 0 ? C : l?.cellDataType !== "boolean",
290
- placeholder: i("filter.select"),
290
+ placeholder: s("filter.select"),
291
291
  className: "w-full bg-canvas-elevated",
292
292
  parentClassName: "flex-1 min-w-0",
293
293
  menuWidth: "200px",
@@ -307,7 +307,7 @@ const Tt = ({
307
307
  {
308
308
  value: I,
309
309
  onChange: me,
310
- placeholder: i("filter.search"),
310
+ placeholder: s("filter.search"),
311
311
  className: "w-full bg-canvas-elevated",
312
312
  autoFocus: !0,
313
313
  onFocus: p,
@@ -328,15 +328,15 @@ const Tt = ({
328
328
  {
329
329
  value: ce || void 0,
330
330
  onChange: (e) => pe(e || null),
331
- placeholder: i("datePicker.selectWeek"),
331
+ placeholder: s("datePicker.selectWeek"),
332
332
  format: x,
333
333
  minDate: /* @__PURE__ */ new Date("2000-01-01"),
334
334
  maxDate: /* @__PURE__ */ new Date("2100-12-31"),
335
335
  className: "w-full bg-canvas-elevated",
336
336
  showFooter: !1,
337
- calendarType: c?.calendarType,
337
+ calendarKind: c?.calendarKind,
338
338
  fiscalMode: c?.fiscalMode,
339
- selectionMode: c?.selectionMode,
339
+ granularity: c?.granularity,
340
340
  fiscalMonthPattern: c?.fiscalMonthPattern,
341
341
  fiscalYearStartMonth: c?.fiscalYearStartMonth,
342
342
  weekStartsOn: c?.weekStartsOn
@@ -344,9 +344,9 @@ const Tt = ({
344
344
  ) : z ? /* @__PURE__ */ r(
345
345
  De,
346
346
  {
347
- value: ie || void 0,
347
+ value: se || void 0,
348
348
  onChange: (e) => fe(e || null),
349
- placeholder: i("datePicker.selectMonth"),
349
+ placeholder: s("datePicker.selectMonth"),
350
350
  minDate: /* @__PURE__ */ new Date("2000-01-01"),
351
351
  maxDate: /* @__PURE__ */ new Date("2100-12-31"),
352
352
  className: "w-full bg-canvas-elevated",
@@ -357,9 +357,9 @@ const Tt = ({
357
357
  ) : /* @__PURE__ */ r(
358
358
  Te,
359
359
  {
360
- value: se || void 0,
360
+ value: ie || void 0,
361
361
  onChange: (e) => ue(e || null),
362
- placeholder: i("filter.selectDate"),
362
+ placeholder: s("filter.selectDate"),
363
363
  format: x,
364
364
  minDate: /* @__PURE__ */ new Date("2000-01-01"),
365
365
  maxDate: /* @__PURE__ */ new Date("2100-12-31"),
@@ -371,15 +371,15 @@ const Tt = ({
371
371
  ) : /* @__PURE__ */ r(
372
372
  q,
373
373
  {
374
- value: U,
374
+ value: _,
375
375
  onChange: de,
376
- placeholder: i("filter.search"),
376
+ placeholder: s("filter.search"),
377
377
  type: "text",
378
378
  autoFocus: !0,
379
- ref: _,
379
+ ref: L,
380
380
  onFocus: p,
381
381
  onBlur: h,
382
- suffix: U && /* @__PURE__ */ r(
382
+ suffix: _ && /* @__PURE__ */ r(
383
383
  "button",
384
384
  {
385
385
  onClick: (e) => {
@@ -392,19 +392,19 @@ const Tt = ({
392
392
  }
393
393
  ),
394
394
  /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5 shrink-0", children: [
395
- N && /* @__PURE__ */ y(Ke, { children: [
395
+ N && /* @__PURE__ */ y(Je, { children: [
396
396
  /* @__PURE__ */ r(Qe, { asChild: !0, children: /* @__PURE__ */ y(
397
397
  "button",
398
398
  {
399
399
  type: "button",
400
- "aria-label": i("gridHeader.activeFilters"),
400
+ "aria-label": s("gridHeader.activeFilters"),
401
401
  className: "relative group p-1 hover:bg-brand-tint rounded-md transition-colors cursor-pointer bg-transparent border-none",
402
402
  children: [
403
403
  /* @__PURE__ */ r(
404
- Ue,
404
+ _e,
405
405
  {
406
406
  size: "md",
407
- className: Je(
407
+ className: Ue(
408
408
  "text-content-tertiary group-hover:text-brand-variant-hover",
409
409
  Fe && "text-brand-variant-hover"
410
410
  )
@@ -415,16 +415,16 @@ const Tt = ({
415
415
  }
416
416
  ) }),
417
417
  /* @__PURE__ */ y(Xe, { align: "end", className: "w-[300px]", children: [
418
- /* @__PURE__ */ r(Ze, { children: /* @__PURE__ */ r($e, { children: i("gridHeader.activeFilters") }) }),
418
+ /* @__PURE__ */ r(Ze, { children: /* @__PURE__ */ r($e, { children: s("gridHeader.activeFilters") }) }),
419
419
  /* @__PURE__ */ y(et, { className: "flex flex-col gap-4", children: [
420
420
  g !== "text" && Ge && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
421
- /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: i("gridHeader.textSearch") }),
421
+ /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: s("gridHeader.textSearch") }),
422
422
  /* @__PURE__ */ r(
423
423
  q,
424
424
  {
425
- value: U,
425
+ value: _,
426
426
  onChange: de,
427
- placeholder: i("filter.searchPlaceholder"),
427
+ placeholder: s("filter.searchPlaceholder"),
428
428
  className: "bg-canvas-elevated",
429
429
  onFocus: p,
430
430
  onBlur: h
@@ -432,7 +432,7 @@ const Tt = ({
432
432
  )
433
433
  ] }),
434
434
  g !== "set" && xe && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
435
- /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: i("gridHeader.selectionFilter") }),
435
+ /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: s("gridHeader.selectionFilter") }),
436
436
  /* @__PURE__ */ r(
437
437
  Pe,
438
438
  {
@@ -440,7 +440,7 @@ const Tt = ({
440
440
  value: ve(),
441
441
  onChange: ye,
442
442
  isMulti: C !== void 0 ? C : l?.cellDataType !== "boolean",
443
- placeholder: i("filter.select"),
443
+ placeholder: s("filter.select"),
444
444
  className: "w-full bg-canvas-elevated",
445
445
  isLoading: ae,
446
446
  onFocus: p,
@@ -449,7 +449,7 @@ const Tt = ({
449
449
  )
450
450
  ] }),
451
451
  g !== "date" && be && /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
452
- /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: i("gridHeader.dateFilter") }),
452
+ /* @__PURE__ */ r("span", { className: "text-xs font-semibold text-content-tertiary", children: s("gridHeader.dateFilter") }),
453
453
  I ? /* @__PURE__ */ r(
454
454
  q,
455
455
  {
@@ -477,9 +477,9 @@ const Tt = ({
477
477
  format: x,
478
478
  className: "w-full bg-canvas-elevated",
479
479
  showFooter: !1,
480
- calendarType: c?.calendarType,
480
+ calendarKind: c?.calendarKind,
481
481
  fiscalMode: c?.fiscalMode,
482
- selectionMode: c?.selectionMode,
482
+ granularity: c?.granularity,
483
483
  fiscalMonthPattern: c?.fiscalMonthPattern,
484
484
  fiscalYearStartMonth: c?.fiscalYearStartMonth,
485
485
  weekStartsOn: c?.weekStartsOn
@@ -487,7 +487,7 @@ const Tt = ({
487
487
  ) : z ? /* @__PURE__ */ r(
488
488
  De,
489
489
  {
490
- value: ie || void 0,
490
+ value: se || void 0,
491
491
  onChange: (e) => fe(e || null),
492
492
  className: "w-full bg-canvas-elevated",
493
493
  showFooter: !1,
@@ -497,7 +497,7 @@ const Tt = ({
497
497
  ) : /* @__PURE__ */ r(
498
498
  Te,
499
499
  {
500
- value: se || void 0,
500
+ value: ie || void 0,
501
501
  onChange: (e) => ue(e || null),
502
502
  format: x,
503
503
  className: "w-full bg-canvas-elevated",
@@ -1,86 +1,93 @@
1
- import { parse as s, isValid as u, format as l } from "date-fns";
2
- const c = "MM/dd/yyyy";
3
- function D(t) {
4
- const e = t.year, n = t.month + 1, r = new Date(e, n, 0).getDate(), a = String(n).padStart(2, "0");
1
+ import { parse as c, isValid as f, format as g } from "date-fns";
2
+ const D = "MM/dd/yyyy";
3
+ function d(t) {
4
+ if (t.start && t.end) {
5
+ const s = t.start, u = t.end, o = (p) => String(p).padStart(2, "0");
6
+ return {
7
+ dateFrom: `${s.getFullYear()}-${o(s.getMonth() + 1)}-${o(s.getDate())}`,
8
+ dateTo: `${u.getFullYear()}-${o(u.getMonth() + 1)}-${o(u.getDate())}`
9
+ };
10
+ }
11
+ const n = t.year, e = t.month + 1, r = new Date(n, e, 0).getDate(), a = String(e).padStart(2, "0");
5
12
  return {
6
- dateFrom: `${e}-${a}-01`,
7
- dateTo: `${e}-${a}-${String(r).padStart(2, "0")}`
13
+ dateFrom: `${n}-${a}-01`,
14
+ dateTo: `${n}-${a}-${String(r).padStart(2, "0")}`
8
15
  };
9
16
  }
10
- function y(t) {
17
+ function $(t) {
11
18
  if (!t || typeof t != "string") return null;
12
- const e = t.split(" ")[0].split("T")[0], [n, r] = e.split("-").map(Number);
13
- return isNaN(n) || isNaN(r) ? null : { year: n, month: r - 1 };
19
+ const n = t.split(" ")[0].split("T")[0], [e, r] = n.split("-").map(Number);
20
+ return isNaN(e) || isNaN(r) ? null : { year: e, month: r - 1 };
14
21
  }
15
22
  function i(t) {
16
23
  if (!t) return null;
17
- const e = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
18
- return `${e}-${n}-${r}`;
24
+ const n = t.getFullYear(), e = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
25
+ return `${n}-${e}-${r}`;
19
26
  }
20
- function o(t) {
27
+ function l(t) {
21
28
  if (!t || typeof t != "string") return null;
22
- const e = t.split(" ")[0].split("T")[0], [n, r, a] = e.split("-").map(Number);
23
- return isNaN(n) || isNaN(r) || isNaN(a) ? null : new Date(n, r - 1, a);
29
+ const n = t.split(" ")[0].split("T")[0], [e, r, a] = n.split("-").map(Number);
30
+ return isNaN(e) || isNaN(r) || isNaN(a) ? null : new Date(e, r - 1, a);
24
31
  }
25
- function g() {
32
+ function M() {
26
33
  return i(/* @__PURE__ */ new Date());
27
34
  }
28
- function p() {
35
+ function m() {
29
36
  const t = /* @__PURE__ */ new Date();
30
37
  return t.setDate(t.getDate() - 1), i(t);
31
38
  }
32
- function d(t, e = c) {
39
+ function N(t, n = D) {
33
40
  if (!t || typeof t != "string") return null;
34
- const n = s(t, e, /* @__PURE__ */ new Date());
35
- return u(n) ? l(n, "yyyy-MM-dd") : null;
41
+ const e = c(t, n, /* @__PURE__ */ new Date());
42
+ return f(e) ? g(e, "yyyy-MM-dd") : null;
36
43
  }
37
- function m(t, e = c) {
44
+ function T(t, n = D) {
38
45
  if (!t || typeof t != "string") return "";
39
- const n = t.split(" ")[0].split("T")[0], r = s(n, "yyyy-MM-dd", /* @__PURE__ */ new Date());
40
- return u(r) ? l(r, e) : "";
46
+ const e = t.split(" ")[0].split("T")[0], r = c(e, "yyyy-MM-dd", /* @__PURE__ */ new Date());
47
+ return f(r) ? g(r, n) : "";
41
48
  }
42
- function $(t) {
49
+ function h(t) {
43
50
  return {
44
51
  from: `${t}-01-01`,
45
52
  to: `${t}-12-31`
46
53
  };
47
54
  }
48
- function M(t, e) {
49
- const n = new Date(e, t, 0).getDate(), r = String(t).padStart(2, "0");
55
+ function S(t, n) {
56
+ const e = new Date(n, t, 0).getDate(), r = String(t).padStart(2, "0");
50
57
  return {
51
- from: `${e}-${r}-01`,
52
- to: `${e}-${r}-${n}`
58
+ from: `${n}-${r}-01`,
59
+ to: `${n}-${r}-${e}`
53
60
  };
54
61
  }
55
- function N(t) {
62
+ function F(t) {
56
63
  return {
57
64
  dateFrom: i(t.startDate),
58
65
  dateTo: i(t.endDate)
59
66
  };
60
67
  }
61
- function h(t, e) {
62
- if (!t || !e) return null;
63
- const n = o(t), r = o(e);
64
- return !n || !r ? null : {
65
- year: n.getFullYear(),
66
- month: n.getMonth(),
67
- weekOfMonth: Math.ceil(n.getDate() / 7),
68
- startDate: n,
68
+ function w(t, n) {
69
+ if (!t || !n) return null;
70
+ const e = l(t), r = l(n);
71
+ return !e || !r ? null : {
72
+ year: e.getFullYear(),
73
+ month: e.getMonth(),
74
+ weekOfMonth: Math.ceil(e.getDate() / 7),
75
+ startDate: e,
69
76
  endDate: r
70
77
  };
71
78
  }
72
79
  export {
73
- c as DEFAULT_DATE_DISPLAY_FORMAT,
74
- o as deserializeDate,
75
- y as deserializeMonth,
76
- h as deserializeWeek,
77
- d as displayDateToIso,
78
- M as getMonthRange,
79
- g as getTodayStr,
80
- $ as getYearRange,
81
- p as getYesterdayStr,
82
- m as isoToDisplay,
80
+ D as DEFAULT_DATE_DISPLAY_FORMAT,
81
+ l as deserializeDate,
82
+ $ as deserializeMonth,
83
+ w as deserializeWeek,
84
+ N as displayDateToIso,
85
+ S as getMonthRange,
86
+ M as getTodayStr,
87
+ h as getYearRange,
88
+ m as getYesterdayStr,
89
+ T as isoToDisplay,
83
90
  i as serializeDate,
84
- D as serializeMonth,
85
- N as serializeWeek
91
+ d as serializeMonth,
92
+ F as serializeWeek
86
93
  };
@@ -1,10 +1,12 @@
1
1
  import { DateRange } from 'react-day-picker';
2
- import { MonthRange, MonthSelection, WeekRange, WeekSelection } from './calendar.types';
2
+ import { MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekSelection, YearRange, YearSelection } from './calendar.types';
3
3
  export declare function isCalendarApplyDisabled(params: {
4
4
  showFooter: boolean;
5
- pickerType: "date" | "week" | "month";
5
+ pickerType: "date" | "week" | "month" | "quarter" | "year";
6
6
  disabled?: unknown;
7
7
  pendingSelection?: Date | Date[] | DateRange;
8
8
  pendingWeekSelection?: WeekSelection | WeekSelection[] | WeekRange;
9
9
  pendingMonthSelection?: MonthSelection | MonthSelection[] | MonthRange;
10
+ pendingQuarterSelection?: QuarterSelection | QuarterSelection[] | QuarterRange;
11
+ pendingYearSelection?: YearSelection | YearSelection[] | YearRange;
10
12
  }): boolean;