impact-nova 2.5.6 → 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +2 -2
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +82 -51
- package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
- package/dist/components/data-display/calendar/calendar-config.js +31 -20
- package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
- package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
- package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +199 -98
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +12 -4
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +139 -92
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
- package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
- package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
- package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
- package/dist/components/data-display/calendar/calendar-footer.js +88 -66
- package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
- package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
- package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
- package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
- package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
- package/dist/components/data-display/calendar/calendar-selection.js +31 -0
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
- package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
- package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +50 -42
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +303 -181
- package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
- package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
- package/dist/components/data-display/calendar/index.d.ts +1 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +32 -12
- package/dist/components/data-display/calendar/use-calendar-state.js +371 -164
- package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +24 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
- package/dist/components/flows/guidance/guidance-error-boundary.js +22 -14
- package/dist/components/flows/guidance/guidance-layer.js +34 -32
- package/dist/components/flows/guidance/help-center/assets/whats-new-guide-icon.svg.js +4 -0
- package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +10 -7
- package/dist/components/flows/guidance/help-center/guide-catalog-section.d.ts +7 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-section.js +24 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.d.ts +3 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.js +19 -0
- package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/guide-catalog.js +89 -79
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.d.ts +6 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.js +33 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.d.ts +12 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.js +57 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.d.ts +9 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.js +114 -0
- package/dist/components/flows/guidance/help-center/help-center-header.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center-header.js +20 -16
- package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center.constants.js +1 -1
- package/dist/components/flows/guidance/help-center/help-center.d.ts +3 -1
- package/dist/components/flows/guidance/help-center/help-center.js +74 -51
- package/dist/components/flows/guidance/help-center/help-center.types.d.ts +9 -1
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.d.ts +4 -0
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.js +18 -0
- package/dist/components/flows/guidance/help-center.d.ts +4 -2
- package/dist/components/flows/guidance/help-center.js +23 -14
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +19 -17
- package/dist/components/flows/guidance/index.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +20 -12
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +9 -11
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +124 -177
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +57 -72
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +23 -23
- package/dist/components/flows/wizard/wizard.js +41 -38
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
- package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
- package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
- package/dist/components/forms/date-picker/date-picker.js +187 -167
- package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
- package/dist/components/forms/date-picker/date-range-picker.js +273 -224
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
- package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
- package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
- package/dist/components/forms/date-picker/index.d.ts +12 -0
- package/dist/components/forms/date-picker/index.js +19 -7
- package/dist/components/forms/date-picker/month-picker.js +225 -182
- package/dist/components/forms/date-picker/month-range-picker.js +134 -110
- package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
- package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
- package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
- package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
- package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
- package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-picker.js +176 -0
- package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
- package/dist/components/forms/date-picker/week-picker.js +148 -137
- package/dist/components/forms/date-picker/week-range-picker.js +216 -205
- package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-picker.js +176 -0
- package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-range-picker.js +179 -0
- package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +35 -53
- package/dist/form-react/Fields/DateInputField.js +63 -58
- package/dist/form-react/Fields/DateRangeField.js +42 -37
- package/dist/form-react/Fields/MonthRangeField.js +50 -45
- package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
- package/dist/form-react/Fields/WeekRangePicker.js +44 -45
- package/dist/form-react/components/FieldRenderer.js +21 -23
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +11 -12
- package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
- package/dist/form-react/registry/resolveFieldComponent.js +9 -133
- package/dist/form-react/types/fields.types.d.ts +22 -7
- package/dist/form-react/utils/date.utils.d.ts +3 -1
- package/dist/form-react/utils/date.utils.js +82 -53
- package/dist/i18n/defaultMessages.d.ts +29 -1
- package/dist/i18n/defaultMessages.js +54 -27
- package/dist/i18n/locales/de.js +31 -4
- package/dist/i18n/locales/es.js +31 -4
- package/dist/i18n/locales/hi.js +31 -4
- package/dist/i18n/locales/kn.js +31 -4
- package/dist/impact-nova-components.css +379 -3
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +528 -516
- package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
- package/dist/lib/fiscal-calendar/build-year.js +173 -0
- package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
- package/dist/lib/fiscal-calendar/civil-date.js +94 -0
- package/dist/lib/fiscal-calendar/index.d.ts +10 -0
- package/dist/lib/fiscal-calendar/index.js +40 -0
- package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
- package/dist/lib/fiscal-calendar/lookup.js +70 -0
- package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
- package/dist/lib/fiscal-calendar/presets.js +99 -0
- package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
- package/dist/lib/fiscal-calendar/selection.js +32 -0
- package/dist/lib/fiscal-calendar/types.d.ts +145 -0
- package/dist/lib/fiscal-calendar/types.js +10 -0
- package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
- package/dist/lib/fiscal-calendar/week-selection.js +107 -0
- package/dist/lib/guidance/engine/guidance-engine.d.ts +7 -5
- package/dist/lib/guidance/engine/guidance-engine.js +115 -47
- package/dist/lib/guidance/triggers/trigger-registry.js +6 -6
- package/dist/lib/guidance/types/guidance.types.d.ts +11 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
- package/dist/lib/fiscal-calendar.d.ts +0 -62
- 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
|
-
|
|
49
|
+
calendarKind?: 'gregorian' | 'fiscal';
|
|
50
50
|
fiscalMode?: 'basic' | 'advanced' | 'custom';
|
|
51
|
-
|
|
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
|
-
|
|
4
|
+
calendarKind?: 'gregorian' | 'fiscal';
|
|
5
5
|
fiscalMode?: 'basic' | 'advanced' | 'custom';
|
|
6
|
-
|
|
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
|
|
3
|
-
import { Filter as
|
|
4
|
-
import { cn as
|
|
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
|
|
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
|
|
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:
|
|
36
|
-
searchText:
|
|
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:
|
|
39
|
-
selectedMonth:
|
|
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
|
-
} =
|
|
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:
|
|
52
|
+
datePickerVariant: V,
|
|
53
53
|
dateDisplayFormat: x
|
|
54
54
|
}), D = (e, t) => {
|
|
55
|
-
const n = (a) => a.replace(/[^0-9.\-+eE]/g, ""),
|
|
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 =
|
|
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
|
-
|
|
130
|
-
},
|
|
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 }),
|
|
138
|
+
w({ searchText: t }), U(t);
|
|
139
139
|
}, ue = (e) => {
|
|
140
|
-
w({ selectedDate: 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
|
|
172
|
-
return
|
|
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:
|
|
175
|
+
conditions: i
|
|
176
176
|
};
|
|
177
|
-
},
|
|
177
|
+
}, J = X(
|
|
178
178
|
(e, t) => {
|
|
179
|
-
const n = F.getFilterModel(),
|
|
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
|
|
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 ?
|
|
189
|
-
F.setFilterModel(
|
|
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
|
-
|
|
195
|
+
J(e, t);
|
|
196
196
|
},
|
|
197
|
-
[l,
|
|
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(),
|
|
207
|
+
Oe(), U(""), te && te();
|
|
208
208
|
}, O = (e) => {
|
|
209
209
|
D(e, "set");
|
|
210
210
|
}, W = Y || (l?.cellDataType === "boolean" ? [
|
|
211
|
-
{ label:
|
|
212
|
-
{ label:
|
|
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
|
|
220
|
-
if (
|
|
221
|
-
return
|
|
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] =
|
|
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(),
|
|
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" :
|
|
278
|
-
const Ge = N ? m.text !== -1 || m.number !== -1 : !M && !
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
337
|
+
calendarKind: c?.calendarKind,
|
|
338
338
|
fiscalMode: c?.fiscalMode,
|
|
339
|
-
|
|
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:
|
|
347
|
+
value: se || void 0,
|
|
348
348
|
onChange: (e) => fe(e || null),
|
|
349
|
-
placeholder:
|
|
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:
|
|
360
|
+
value: ie || void 0,
|
|
361
361
|
onChange: (e) => ue(e || null),
|
|
362
|
-
placeholder:
|
|
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:
|
|
374
|
+
value: _,
|
|
375
375
|
onChange: de,
|
|
376
|
-
placeholder:
|
|
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:
|
|
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(
|
|
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":
|
|
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
|
-
|
|
404
|
+
_e,
|
|
405
405
|
{
|
|
406
406
|
size: "md",
|
|
407
|
-
className:
|
|
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:
|
|
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:
|
|
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:
|
|
425
|
+
value: _,
|
|
426
426
|
onChange: de,
|
|
427
|
-
placeholder:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
480
|
+
calendarKind: c?.calendarKind,
|
|
481
481
|
fiscalMode: c?.fiscalMode,
|
|
482
|
-
|
|
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:
|
|
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:
|
|
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
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
|
|
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: `${
|
|
7
|
-
dateTo: `${
|
|
13
|
+
dateFrom: `${n}-${a}-01`,
|
|
14
|
+
dateTo: `${n}-${a}-${String(r).padStart(2, "0")}`
|
|
8
15
|
};
|
|
9
16
|
}
|
|
10
|
-
function
|
|
17
|
+
function $(t) {
|
|
11
18
|
if (!t || typeof t != "string") return null;
|
|
12
|
-
const
|
|
13
|
-
return isNaN(
|
|
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
|
|
18
|
-
return `${
|
|
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
|
|
27
|
+
function l(t) {
|
|
21
28
|
if (!t || typeof t != "string") return null;
|
|
22
|
-
const
|
|
23
|
-
return isNaN(
|
|
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
|
|
32
|
+
function M() {
|
|
26
33
|
return i(/* @__PURE__ */ new Date());
|
|
27
34
|
}
|
|
28
|
-
function
|
|
35
|
+
function m() {
|
|
29
36
|
const t = /* @__PURE__ */ new Date();
|
|
30
37
|
return t.setDate(t.getDate() - 1), i(t);
|
|
31
38
|
}
|
|
32
|
-
function
|
|
39
|
+
function N(t, n = D) {
|
|
33
40
|
if (!t || typeof t != "string") return null;
|
|
34
|
-
const
|
|
35
|
-
return
|
|
41
|
+
const e = c(t, n, /* @__PURE__ */ new Date());
|
|
42
|
+
return f(e) ? g(e, "yyyy-MM-dd") : null;
|
|
36
43
|
}
|
|
37
|
-
function
|
|
44
|
+
function T(t, n = D) {
|
|
38
45
|
if (!t || typeof t != "string") return "";
|
|
39
|
-
const
|
|
40
|
-
return
|
|
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
|
|
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
|
|
49
|
-
const
|
|
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: `${
|
|
52
|
-
to: `${
|
|
58
|
+
from: `${n}-${r}-01`,
|
|
59
|
+
to: `${n}-${r}-${e}`
|
|
53
60
|
};
|
|
54
61
|
}
|
|
55
|
-
function
|
|
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
|
|
62
|
-
if (!t || !
|
|
63
|
-
const
|
|
64
|
-
return !
|
|
65
|
-
year:
|
|
66
|
-
month:
|
|
67
|
-
weekOfMonth: Math.ceil(
|
|
68
|
-
startDate:
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
85
|
-
|
|
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;
|