impact-nova 2.5.21 → 2.5.22
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/data-table/build-column-tree-from-grid.d.ts +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +52 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +1 -0
- package/dist/components/data/data-table/column-picker-authority.js +61 -59
- package/dist/components/data/data-table/column-savability.d.ts +3 -0
- package/dist/components/data/data-table/column-savability.js +10 -0
- package/dist/components/data/data-table/data-table-column-list.js +117 -89
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +1 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +23 -22
- package/dist/components/data/data-table/index.d.ts +2 -0
- package/dist/components/data/data-table/index.js +32 -28
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +14 -13
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data-display/calendar/calendar-year-panes.js +68 -58
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +13 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +60 -51
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/index.js +273 -269
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getSectionIdFromDroppable as S } from "../nested-list/nested-list-drop-engine.js";
|
|
2
2
|
import { NESTED_LIST_ROOT_FROZEN_ID as d, NESTED_LIST_ROOT_SCROLLABLE_ID as u } from "../nested-list/nested-list-constants.js";
|
|
3
|
-
import { updateColumnPin as
|
|
3
|
+
import { updateColumnPin as b, reorderColumn as k } from "./column-picker-authority.js";
|
|
4
4
|
function g(e) {
|
|
5
5
|
const n = [], t = [];
|
|
6
6
|
for (const l of e.orderedColumnIds)
|
|
7
7
|
e.pinByColumnId.get(l) ? n.push(l) : t.push(l);
|
|
8
8
|
return { frozenColumnIds: n, scrollableColumnIds: t };
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function h(e, n, t) {
|
|
11
11
|
const l = t.trim().toLowerCase();
|
|
12
12
|
return l === "" ? [...n] : n.filter((r) => (e.labelByColumnId.get(r) ?? r).toLowerCase().includes(l));
|
|
13
13
|
}
|
|
@@ -23,7 +23,7 @@ function C(e, n) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function D(e, n, t) {
|
|
26
|
-
const l = t.searchQuery ?? "", { frozenColumnIds: r, scrollableColumnIds: c } = g(e), s =
|
|
26
|
+
const l = t.searchQuery ?? "", { frozenColumnIds: r, scrollableColumnIds: c } = g(e), s = h(e, r, l), o = h(e, c, l), i = C(s, e), m = C(o, e), f = [
|
|
27
27
|
{
|
|
28
28
|
kind: "structure",
|
|
29
29
|
sectionId: d,
|
|
@@ -34,21 +34,21 @@ function D(e, n, t) {
|
|
|
34
34
|
}
|
|
35
35
|
];
|
|
36
36
|
for (const a of s)
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
f.push({ kind: "column", columnId: a, sectionId: d });
|
|
38
|
+
f.push({
|
|
39
39
|
kind: "structure",
|
|
40
40
|
sectionId: u,
|
|
41
41
|
label: n.scrollableColumns,
|
|
42
|
-
checked:
|
|
43
|
-
indeterminate:
|
|
42
|
+
checked: m.checked,
|
|
43
|
+
indeterminate: m.indeterminate,
|
|
44
44
|
hasVirtualColumnChildren: o.length > 0
|
|
45
45
|
});
|
|
46
46
|
for (const a of o)
|
|
47
|
-
|
|
48
|
-
return
|
|
47
|
+
f.push({ kind: "column", columnId: a, sectionId: u });
|
|
48
|
+
return f;
|
|
49
49
|
}
|
|
50
50
|
function z(e, n, t) {
|
|
51
|
-
const l = e.pinByColumnId.get(n) ?? null, r = e.visibilityByColumnId.get(n) ?? !0, c = e.labelByColumnId.get(n) ?? n, s = t.sortAppliedByColumnId?.get(n) ?? !1, o = t.filterAppliedByColumnId?.get(n) ?? !1;
|
|
51
|
+
const l = e.pinByColumnId.get(n) ?? null, r = e.visibilityByColumnId.get(n) ?? !0, c = e.labelByColumnId.get(n) ?? n, s = t.sortAppliedByColumnId?.get(n) ?? !1, o = t.filterAppliedByColumnId?.get(n) ?? !1, i = t.nonSavableByColumnId?.get(n) ?? !1;
|
|
52
52
|
return {
|
|
53
53
|
item: {
|
|
54
54
|
id: n,
|
|
@@ -57,6 +57,7 @@ function z(e, n, t) {
|
|
|
57
57
|
data: {
|
|
58
58
|
hasSortApplied: s,
|
|
59
59
|
hasFilterApplied: o,
|
|
60
|
+
isNonSavable: i,
|
|
60
61
|
pinned: l
|
|
61
62
|
}
|
|
62
63
|
},
|
|
@@ -64,7 +65,7 @@ function z(e, n, t) {
|
|
|
64
65
|
indentLevel: 1
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function B(e) {
|
|
68
69
|
return {
|
|
69
70
|
item: {
|
|
70
71
|
id: e.sectionId,
|
|
@@ -80,7 +81,7 @@ function F(e) {
|
|
|
80
81
|
indentLevel: 0
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function L(e, n, t = {}) {
|
|
84
85
|
const l = D(e, n, t), r = /* @__PURE__ */ new Map();
|
|
85
86
|
for (let o = 0; o < l.length; o += 1) {
|
|
86
87
|
const i = l[o];
|
|
@@ -95,7 +96,7 @@ function v(e, n, t = {}) {
|
|
|
95
96
|
const i = l[o];
|
|
96
97
|
if (!i)
|
|
97
98
|
throw new RangeError(`Flat column virtual row index out of bounds: ${o}`);
|
|
98
|
-
return i.kind === "structure" ?
|
|
99
|
+
return i.kind === "structure" ? B(i) : z(e, i.columnId, t);
|
|
99
100
|
},
|
|
100
101
|
getColumnIdAt: (o) => {
|
|
101
102
|
const i = l[o];
|
|
@@ -137,16 +138,16 @@ function V(e, n) {
|
|
|
137
138
|
}
|
|
138
139
|
return !0;
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
+
function F(e, n) {
|
|
141
142
|
const t = e.pinByColumnId.get(n);
|
|
142
143
|
return t === "left" || t === "right";
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function A(e, n) {
|
|
145
146
|
if (n === d)
|
|
146
147
|
return 0;
|
|
147
148
|
for (let t = 0; t < e.orderedColumnIds.length; t += 1) {
|
|
148
149
|
const l = e.orderedColumnIds[t];
|
|
149
|
-
if (!
|
|
150
|
+
if (!F(e, l))
|
|
150
151
|
return t;
|
|
151
152
|
}
|
|
152
153
|
return e.orderedColumnIds.length;
|
|
@@ -163,7 +164,7 @@ function R(e, n, t, l) {
|
|
|
163
164
|
const i = l ? o + 1 : o;
|
|
164
165
|
return s.splice(i, 0, n), r === i ? e : k(e, r, i);
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function v(e, n) {
|
|
167
168
|
const t = S(e);
|
|
168
169
|
return t === d || t === u ? t : e === d || e === u ? e : n.frozenColumnIds.includes(e) ? d : n.scrollableColumnIds.includes(e) ? u : null;
|
|
169
170
|
}
|
|
@@ -171,15 +172,15 @@ function _(e, n, t) {
|
|
|
171
172
|
const { draggedColumnId: l, overId: r, insertAfter: c } = t;
|
|
172
173
|
if (l === r || !e.orderedColumnIds.includes(l))
|
|
173
174
|
return null;
|
|
174
|
-
const s =
|
|
175
|
+
const s = v(r, n);
|
|
175
176
|
if (s) {
|
|
176
177
|
if (S(r) !== null || r === d || r === u) {
|
|
177
|
-
const I =
|
|
178
|
+
const I = b(e, l, s === d ? "left" : null), x = A(I, s), p = I.orderedColumnIds.indexOf(l);
|
|
178
179
|
return p === -1 ? null : k(I, p, x);
|
|
179
180
|
}
|
|
180
|
-
const i = n.frozenColumnIds.includes(l),
|
|
181
|
+
const i = n.frozenColumnIds.includes(l), m = s === d ? "left" : null, f = i === (m === "left") ? e : b(e, l, m);
|
|
181
182
|
return R(
|
|
182
|
-
|
|
183
|
+
f,
|
|
183
184
|
l,
|
|
184
185
|
r,
|
|
185
186
|
c
|
|
@@ -190,6 +191,6 @@ function _(e, n, t) {
|
|
|
190
191
|
export {
|
|
191
192
|
_ as applyFlatVirtualDropToAuthority,
|
|
192
193
|
P as buildAuthorityFlatShellItems,
|
|
193
|
-
|
|
194
|
+
L as buildFlatColumnVirtualRowModel,
|
|
194
195
|
V as isFlatLargeColumnPicker
|
|
195
196
|
};
|
|
@@ -12,4 +12,6 @@ export * from './data-table-saved-views';
|
|
|
12
12
|
export * from './pin-switch';
|
|
13
13
|
export * from './column-indicator';
|
|
14
14
|
export * from './indicator-legend';
|
|
15
|
+
export * from './column-savability';
|
|
16
|
+
export { mergePartialOrderedColumnState } from './data-table-column-state';
|
|
15
17
|
export type { SavedTableViewItem, TableViewTypeOption, DataTableSavedViewsProps, DataTableSavedViewsActionContext, DataTableSavedViewsCancelContext, } from '../data-table/data-table-saved-views.types';
|
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
import { DataTable as t, DataTableContent as
|
|
2
|
-
import { deferColumnRuntimeStateGuard as
|
|
3
|
-
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as
|
|
4
|
-
import { DataTableColumnList as
|
|
5
|
-
import { DataTableContext as
|
|
1
|
+
import { DataTable as t, DataTableContent as r, DataTableToolbar as o } from "./data-table.js";
|
|
2
|
+
import { deferColumnRuntimeStateGuard as T, isColumnRuntimeStateGuardDeferred as n, isColumnRuntimeStateGuardUpdating as S, rebuildColumnTreeCacheFromGrid as D, scheduleColumnRuntimeStateGuard as b } from "./column-runtime-state-guard.js";
|
|
3
|
+
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as i, DATA_TABLE_SHEET_SLIDE_TRANSITION_MS as u, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as p } from "./data-table-constants.js";
|
|
4
|
+
import { DataTableColumnList as x } from "./data-table-column-list.js";
|
|
5
|
+
import { DataTableContext as h, DataTableSheetPortalStoreContext as s, useDataTable as C, useDataTableSheetPortal as _, useDataTableSheetPortalStore as E } from "./data-table-context.js";
|
|
6
6
|
import { DataTableFormatOptions as L } from "./data-table-format-options.js";
|
|
7
|
-
import { DataTableSheet as
|
|
8
|
-
import { DataTableSheetBody as M, DataTableSheetSection as c, DataTableSheetTabPanel as G, DataTableSheetTabs as
|
|
9
|
-
import { useDataTableSheet as N, useDataTableSheetApi as
|
|
10
|
-
import { DataTableViewMenuContent as
|
|
7
|
+
import { DataTableSheet as I, DataTableSheetContent as g, DataTableSheetHeader as w, DataTableSheetTrigger as V } from "./data-table-sheet.js";
|
|
8
|
+
import { DataTableSheetBody as M, DataTableSheetSection as c, DataTableSheetTabPanel as G, DataTableSheetTabs as O, DataTableSheetTabsList as R } from "./data-table-sheet-layout.js";
|
|
9
|
+
import { useDataTableSheet as N, useDataTableSheetApi as v } from "./data-table-sheet-context.js";
|
|
10
|
+
import { DataTableViewMenuContent as F, DataTableViewMenuDensity as X, DataTableViewMenuSettingsItem as U, DataTableViewMenuTrigger as W, DataTableViewMenuViewportExpand as j } from "./data-table-view-menu.js";
|
|
11
11
|
import { DataTableSavedViews as q } from "./data-table-saved-views.js";
|
|
12
12
|
import { PinSwitch as J } from "./pin-switch.js";
|
|
13
13
|
import { ColumnIndicator as Q } from "./column-indicator.js";
|
|
14
14
|
import { IndicatorLegend as Z } from "./indicator-legend.js";
|
|
15
|
+
import { resolveColumnSavability as ee } from "./column-savability.js";
|
|
16
|
+
import { mergePartialOrderedColumnState as te } from "./data-table-column-state.js";
|
|
15
17
|
export {
|
|
16
18
|
Q as ColumnIndicator,
|
|
17
|
-
|
|
19
|
+
i as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
|
|
18
20
|
u as DATA_TABLE_SHEET_SLIDE_TRANSITION_MS,
|
|
19
21
|
t as DataTable,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
x as DataTableColumnList,
|
|
23
|
+
r as DataTableContent,
|
|
24
|
+
h as DataTableContext,
|
|
23
25
|
L as DataTableFormatOptions,
|
|
24
26
|
q as DataTableSavedViews,
|
|
25
|
-
|
|
27
|
+
I as DataTableSheet,
|
|
26
28
|
M as DataTableSheetBody,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
g as DataTableSheetContent,
|
|
30
|
+
w as DataTableSheetHeader,
|
|
29
31
|
s as DataTableSheetPortalStoreContext,
|
|
30
32
|
c as DataTableSheetSection,
|
|
31
33
|
G as DataTableSheetTabPanel,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
O as DataTableSheetTabs,
|
|
35
|
+
R as DataTableSheetTabsList,
|
|
36
|
+
V as DataTableSheetTrigger,
|
|
37
|
+
o as DataTableToolbar,
|
|
38
|
+
F as DataTableViewMenuContent,
|
|
39
|
+
X as DataTableViewMenuDensity,
|
|
38
40
|
U as DataTableViewMenuSettingsItem,
|
|
39
41
|
W as DataTableViewMenuTrigger,
|
|
40
42
|
j as DataTableViewMenuViewportExpand,
|
|
41
43
|
Z as IndicatorLegend,
|
|
42
44
|
J as PinSwitch,
|
|
43
45
|
p as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
|
|
44
|
-
|
|
46
|
+
T as deferColumnRuntimeStateGuard,
|
|
45
47
|
n as isColumnRuntimeStateGuardDeferred,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
S as isColumnRuntimeStateGuardUpdating,
|
|
49
|
+
te as mergePartialOrderedColumnState,
|
|
50
|
+
D as rebuildColumnTreeCacheFromGrid,
|
|
51
|
+
ee as resolveColumnSavability,
|
|
48
52
|
b as scheduleColumnRuntimeStateGuard,
|
|
49
|
-
|
|
53
|
+
C as useDataTable,
|
|
50
54
|
N as useDataTableSheet,
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
v as useDataTableSheetApi,
|
|
56
|
+
_ as useDataTableSheetPortal,
|
|
53
57
|
E as useDataTableSheetPortalStore
|
|
54
58
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
function p(l) {
|
|
2
|
-
const o = l.getGridOption("context"), r = typeof o?.activeSearchColumnId == "string" ? o.activeSearchColumnId : null,
|
|
2
|
+
const o = l.getGridOption("context"), r = typeof o?.activeSearchColumnId == "string" ? o.activeSearchColumnId : null, a = /* @__PURE__ */ new Map();
|
|
3
3
|
for (const n of l.getColumnState())
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
for (const n of
|
|
4
|
+
a.set(n.colId, !!n.sort);
|
|
5
|
+
const s = /* @__PURE__ */ new Map(), i = l.getAllGridColumns?.() ?? l.getColumns?.() ?? [];
|
|
6
|
+
for (const n of i) {
|
|
7
7
|
const c = n.getColId();
|
|
8
|
-
|
|
8
|
+
s.set(
|
|
9
9
|
c,
|
|
10
10
|
n.isFilterActive() === !0 || r === c
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
return { sortAppliedByColumnId:
|
|
13
|
+
return { sortAppliedByColumnId: a, filterAppliedByColumnId: s };
|
|
14
14
|
}
|
|
15
15
|
function I(l, o) {
|
|
16
|
-
const r = o.getGridOption("context"),
|
|
16
|
+
const r = o.getGridOption("context"), a = typeof r?.activeSearchColumnId == "string" ? r.activeSearchColumnId : null, s = new Map(
|
|
17
17
|
o.getColumnState().map((e) => [e.colId, e])
|
|
18
|
-
),
|
|
19
|
-
|
|
18
|
+
), i = o.getAllGridColumns?.() ?? o.getColumns?.() ?? [], n = new Map(
|
|
19
|
+
i.map((e) => [e.getColId(), e])
|
|
20
20
|
), c = (e) => e.map((t) => {
|
|
21
21
|
if ((t.category === "group" || t.children && t.children.length > 0) && t.children)
|
|
22
22
|
return {
|
|
23
23
|
...t,
|
|
24
24
|
children: c(t.children)
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const m = n.get(t.id), d = s.get(t.id), u = t.data;
|
|
27
27
|
return {
|
|
28
28
|
...t,
|
|
29
29
|
data: {
|
|
30
|
-
...
|
|
31
|
-
hasSortApplied: !!
|
|
32
|
-
hasFilterApplied:
|
|
30
|
+
...u,
|
|
31
|
+
hasSortApplied: !!d?.sort,
|
|
32
|
+
hasFilterApplied: m?.isFilterActive() === !0 || a === t.id,
|
|
33
|
+
isNonSavable: u?.isNonSavable
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
});
|
|
@@ -3,7 +3,8 @@ import { Badge as s } from "../../data-display/badge/badge.js";
|
|
|
3
3
|
import { FilterPopoverContent as u } from "../../flows/filter-strip/filter-tag-list.js";
|
|
4
4
|
import { Popover as b, PopoverTrigger as f } from "../../feedback/popover/popover.js";
|
|
5
5
|
import { Tooltip as g, TooltipTrigger as v, TooltipContent as x } from "../../feedback/tooltip/tooltip.js";
|
|
6
|
-
|
|
6
|
+
import "react";
|
|
7
|
+
function I({
|
|
7
8
|
tags: o,
|
|
8
9
|
title: l = "Attributes",
|
|
9
10
|
maxVisibleTags: n = 4,
|
|
@@ -70,5 +71,5 @@ function w({
|
|
|
70
71
|
);
|
|
71
72
|
}
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
I as ExpandableListItemAttributes
|
|
74
75
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { ScrollOverflowAffordance as o } from "../../layout/horizontal-scroller/scroll-overflow-affordance.js";
|
|
3
|
+
import "react";
|
|
3
4
|
import { OverflowTooltip as r } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
4
5
|
const m = 128;
|
|
5
|
-
function
|
|
6
|
+
function f({
|
|
6
7
|
columns: i,
|
|
7
8
|
sectionId: l = "metrics"
|
|
8
9
|
}) {
|
|
@@ -50,5 +51,5 @@ function x({
|
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
+
f as ExpandableListItemMetrics
|
|
54
55
|
};
|
|
@@ -1,64 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { CalendarPeriodCell as
|
|
6
|
-
import { PERIOD_RANGE_GRID_CLASSNAME as
|
|
7
|
-
import { getYearRangeProps as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
pickerYear:
|
|
11
|
-
resolvedStartYear:
|
|
12
|
-
resolvedEndYear:
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight as u } from "impact-nova-icons";
|
|
3
|
+
import { cn as S } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as x } from "../../primitives/button/button.js";
|
|
5
|
+
import { CalendarPeriodCell as Y } from "./calendar-period-cell.js";
|
|
6
|
+
import { PERIOD_RANGE_GRID_CLASSNAME as Z } from "./calendar-selection-appearance.js";
|
|
7
|
+
import { getYearPageYears as D, yearPageHasSelectableYear as E, getYearRangeProps as W, isYearRangeSelection as q } from "./calendar-year-utils.js";
|
|
8
|
+
const F = 12, J = 6, K = "w-[320px] min-w-[320px] max-w-[320px]";
|
|
9
|
+
function ot({
|
|
10
|
+
pickerYear: A,
|
|
11
|
+
resolvedStartYear: c,
|
|
12
|
+
resolvedEndYear: a,
|
|
13
13
|
previousYearLabel: R,
|
|
14
|
-
nextYearLabel:
|
|
15
|
-
yearLabels:
|
|
14
|
+
nextYearLabel: _,
|
|
15
|
+
yearLabels: l,
|
|
16
16
|
yearCaptions: p,
|
|
17
17
|
showFooter: v = !0,
|
|
18
|
-
pendingYearSelection:
|
|
19
|
-
selectedYear:
|
|
20
|
-
isYearSelected:
|
|
21
|
-
isYearDisabled:
|
|
22
|
-
onYearPageChange:
|
|
23
|
-
onYearClick:
|
|
18
|
+
pendingYearSelection: P,
|
|
19
|
+
selectedYear: w,
|
|
20
|
+
isYearSelected: C,
|
|
21
|
+
isYearDisabled: r,
|
|
22
|
+
onYearPageChange: g,
|
|
23
|
+
onYearClick: B
|
|
24
24
|
}) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const s = !!p, t = s ? J : F, n = Math.floor(A / t) * t, G = n + t - 1, i = D(n, t), h = i[0] ?? n, f = i[i.length - 1] ?? G, d = v ? P : w, N = q(d) ? d : void 0, I = E({
|
|
26
|
+
pageStart: n - t,
|
|
27
|
+
pageSize: t,
|
|
28
|
+
resolvedStartYear: c,
|
|
29
|
+
resolvedEndYear: a,
|
|
30
|
+
isYearDisabled: r
|
|
31
|
+
}), b = E({
|
|
32
|
+
pageStart: n + t,
|
|
33
|
+
pageSize: t,
|
|
34
|
+
resolvedStartYear: c,
|
|
35
|
+
resolvedEndYear: a,
|
|
36
|
+
isYearDisabled: r
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ m(
|
|
29
39
|
"div",
|
|
30
40
|
{
|
|
31
41
|
"data-slot": "year-panes",
|
|
32
|
-
className:
|
|
42
|
+
className: S("flex flex-col gap-4 overflow-hidden p-3", K),
|
|
33
43
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
|
|
35
45
|
/* @__PURE__ */ e(
|
|
36
|
-
|
|
46
|
+
x,
|
|
37
47
|
{
|
|
38
48
|
variant: "ghost",
|
|
39
49
|
size: "icon",
|
|
40
50
|
className: "h-7 w-7 shrink-0",
|
|
41
51
|
"aria-label": R,
|
|
42
|
-
disabled:
|
|
43
|
-
onClick: () =>
|
|
44
|
-
children: /* @__PURE__ */ e(
|
|
52
|
+
disabled: !I,
|
|
53
|
+
onClick: () => g(n - t),
|
|
54
|
+
children: /* @__PURE__ */ e(u, { size: 16, className: "rotate-180" })
|
|
45
55
|
}
|
|
46
56
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
57
|
+
/* @__PURE__ */ m("div", { className: "text-sm font-medium text-content", children: [
|
|
58
|
+
l?.(h) ?? h,
|
|
49
59
|
" – ",
|
|
50
|
-
|
|
60
|
+
l?.(f) ?? f
|
|
51
61
|
] }),
|
|
52
62
|
/* @__PURE__ */ e(
|
|
53
|
-
|
|
63
|
+
x,
|
|
54
64
|
{
|
|
55
65
|
variant: "ghost",
|
|
56
66
|
size: "icon",
|
|
57
67
|
className: "h-7 w-7",
|
|
58
|
-
"aria-label":
|
|
59
|
-
disabled:
|
|
60
|
-
onClick: () =>
|
|
61
|
-
children: /* @__PURE__ */ e(
|
|
68
|
+
"aria-label": _,
|
|
69
|
+
disabled: !b,
|
|
70
|
+
onClick: () => g(n + t),
|
|
71
|
+
children: /* @__PURE__ */ e(u, { className: "h-4 w-4" })
|
|
62
72
|
}
|
|
63
73
|
)
|
|
64
74
|
] }),
|
|
@@ -66,26 +76,26 @@ function V({
|
|
|
66
76
|
"div",
|
|
67
77
|
{
|
|
68
78
|
"data-period-grid": "",
|
|
69
|
-
className:
|
|
70
|
-
children:
|
|
71
|
-
const
|
|
79
|
+
className: S(Z, s ? "grid-cols-2" : "grid-cols-3"),
|
|
80
|
+
children: i.map((o) => {
|
|
81
|
+
const z = o < c || o > a || r(o), k = C(o), O = !!N, { isStart: j, isEnd: M, isMiddle: H } = W(o, d), T = p?.(o);
|
|
72
82
|
return /* @__PURE__ */ e(
|
|
73
|
-
|
|
83
|
+
Y,
|
|
74
84
|
{
|
|
75
|
-
selected:
|
|
85
|
+
selected: k,
|
|
76
86
|
disabled: z,
|
|
77
|
-
isRange:
|
|
78
|
-
isStart:
|
|
79
|
-
isEnd:
|
|
80
|
-
isMiddle:
|
|
81
|
-
hasRangeEnd: !!
|
|
82
|
-
size:
|
|
83
|
-
columns:
|
|
84
|
-
onClick: () =>
|
|
85
|
-
caption:
|
|
86
|
-
children:
|
|
87
|
+
isRange: O,
|
|
88
|
+
isStart: j,
|
|
89
|
+
isEnd: M,
|
|
90
|
+
isMiddle: H,
|
|
91
|
+
hasRangeEnd: !!N?.to,
|
|
92
|
+
size: s ? "year-caption" : "year",
|
|
93
|
+
columns: s ? 2 : 3,
|
|
94
|
+
onClick: () => B(o),
|
|
95
|
+
caption: T,
|
|
96
|
+
children: l?.(o) ?? String(o)
|
|
87
97
|
},
|
|
88
|
-
|
|
98
|
+
o
|
|
89
99
|
);
|
|
90
100
|
})
|
|
91
101
|
}
|
|
@@ -95,8 +105,8 @@ function V({
|
|
|
95
105
|
);
|
|
96
106
|
}
|
|
97
107
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
ot as CalendarYearPanes,
|
|
109
|
+
J as YEAR_CAPTION_PAGE_SIZE,
|
|
110
|
+
F as YEAR_PAGE_SIZE,
|
|
111
|
+
K as YEAR_PANE_WIDTH_CLASS
|
|
102
112
|
};
|
|
@@ -11,6 +11,19 @@ export declare function getYearRangeProps(year: number, currentSelection: YearSe
|
|
|
11
11
|
};
|
|
12
12
|
export declare function nextYearSelection(selection: YearSelection, prev: YearSelection | YearSelection[] | YearRange | undefined, yearMode: "single" | "multiple" | "range" | "multi-range"): YearSelection | YearSelection[] | YearRange | undefined;
|
|
13
13
|
export declare function isYearSelectedForSelection(year: number, currentSelection: YearSelection | YearSelection[] | YearRange | undefined): boolean;
|
|
14
|
+
/** Full page of years (never shrink the grid when bounds are tight). */
|
|
15
|
+
export declare function getYearPageYears(pageStart: number, pageSize: number): number[];
|
|
16
|
+
/**
|
|
17
|
+
* Prev/next stay enabled only when the target page has at least one selectable year.
|
|
18
|
+
* Disabled / out-of-nav years still render on the current page.
|
|
19
|
+
*/
|
|
20
|
+
export declare function yearPageHasSelectableYear(options: {
|
|
21
|
+
pageStart: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
resolvedStartYear: number;
|
|
24
|
+
resolvedEndYear: number;
|
|
25
|
+
isYearDisabled: (year: number) => boolean;
|
|
26
|
+
}): boolean;
|
|
14
27
|
export declare function isYearDisabledForBounds(year: number, disabled?: unknown, options?: {
|
|
15
28
|
calendarKind?: "gregorian" | "fiscal";
|
|
16
29
|
fiscalConfig?: FiscalCalendarConfig;
|
|
@@ -1,75 +1,84 @@
|
|
|
1
1
|
import { localDateFromCivil as d } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
-
import { buildFiscalYear as
|
|
3
|
-
import { isDateIntervalDisabled as
|
|
4
|
-
function
|
|
2
|
+
import { buildFiscalYear as u } from "../../../lib/fiscal-calendar/build-year.js";
|
|
3
|
+
import { isDateIntervalDisabled as m } from "./calendar-month-utils.js";
|
|
4
|
+
function A(r) {
|
|
5
5
|
return r ? new Date(r.fy ?? r.year, 0, 1) : /* @__PURE__ */ new Date();
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function e(r) {
|
|
8
8
|
return r.fy ?? r.year;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function o(r, s) {
|
|
11
|
+
return e(r) === e(s);
|
|
12
12
|
}
|
|
13
13
|
function l(r) {
|
|
14
14
|
return !!(r && !Array.isArray(r) && ("from" in r || "to" in r));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!l(
|
|
16
|
+
function E(r, s) {
|
|
17
|
+
if (!l(s))
|
|
18
18
|
return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
if (!
|
|
22
|
-
return { isStart: !1, isEnd: t ?
|
|
23
|
-
const
|
|
24
|
-
if (!t) return { isStart: r ===
|
|
25
|
-
const
|
|
19
|
+
const f = s.from, t = s.to;
|
|
20
|
+
if (!f && !t) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
21
|
+
if (!f)
|
|
22
|
+
return { isStart: !1, isEnd: t ? e(t) === r : !1, isMiddle: !1 };
|
|
23
|
+
const n = e(f);
|
|
24
|
+
if (!t) return { isStart: r === n, isEnd: !1, isMiddle: !1 };
|
|
25
|
+
const i = e(t);
|
|
26
26
|
return {
|
|
27
|
-
isStart: r ===
|
|
28
|
-
isEnd: r ===
|
|
29
|
-
isMiddle: r >
|
|
27
|
+
isStart: r === n,
|
|
28
|
+
isEnd: r === i,
|
|
29
|
+
isMiddle: r > n && r < i
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
return
|
|
32
|
+
function b(r, s, f) {
|
|
33
|
+
if (f === "single") return r;
|
|
34
|
+
if (f === "multiple") {
|
|
35
|
+
const n = Array.isArray(s) ? s : [];
|
|
36
|
+
return n.some((a) => o(a, r)) ? n.filter((a) => !o(a, r)) : [...n, r];
|
|
37
37
|
}
|
|
38
|
-
const t =
|
|
39
|
-
return !t?.from || t.to ? { from: r } :
|
|
38
|
+
const t = s;
|
|
39
|
+
return !t?.from || t.to ? { from: r } : o(r, t.from) ? t : e(r) < e(t.from) ? { from: r, to: t.from } : { from: t.from, to: r };
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
if (Array.isArray(
|
|
45
|
-
return
|
|
46
|
-
if (l(
|
|
47
|
-
const t =
|
|
48
|
-
if (!t) return
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const a = n
|
|
52
|
-
return r >=
|
|
41
|
+
function w(r, s) {
|
|
42
|
+
if (!s) return !1;
|
|
43
|
+
const f = { year: r, fy: r };
|
|
44
|
+
if (Array.isArray(s))
|
|
45
|
+
return s.some((t) => e(t) === r);
|
|
46
|
+
if (l(s)) {
|
|
47
|
+
const t = s.from, n = s.to;
|
|
48
|
+
if (!t) return n ? e(n) === r : !1;
|
|
49
|
+
const i = e(t);
|
|
50
|
+
if (!n) return r === i;
|
|
51
|
+
const a = e(n);
|
|
52
|
+
return r >= i && r <= a;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return o(s, f) || s.year === r;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
function c(r, s) {
|
|
57
|
+
return Array.from({ length: s }, (f, t) => r + t);
|
|
58
|
+
}
|
|
59
|
+
function F(r) {
|
|
60
|
+
const { pageStart: s, pageSize: f, resolvedStartYear: t, resolvedEndYear: n, isYearDisabled: i } = r;
|
|
61
|
+
return c(s, f).some((a) => a < t || a > n ? !1 : !i(a));
|
|
62
|
+
}
|
|
63
|
+
function M(r, s, f) {
|
|
64
|
+
let t = new Date(r, 0, 1), n = new Date(r, 11, 31, 23, 59, 59, 999);
|
|
65
|
+
if (f?.calendarKind === "fiscal" && f.fiscalConfig)
|
|
59
66
|
try {
|
|
60
|
-
const
|
|
61
|
-
t = d(
|
|
67
|
+
const i = u(f.fiscalConfig, r);
|
|
68
|
+
t = d(i.start), n = d(i.end);
|
|
62
69
|
} catch {
|
|
63
70
|
}
|
|
64
|
-
return
|
|
71
|
+
return m(t, n, s);
|
|
65
72
|
}
|
|
66
73
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
c as getYearPageYears,
|
|
75
|
+
E as getYearRangeProps,
|
|
76
|
+
o as isSameYear,
|
|
77
|
+
M as isYearDisabledForBounds,
|
|
70
78
|
l as isYearRangeSelection,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
w as isYearSelectedForSelection,
|
|
80
|
+
b as nextYearSelection,
|
|
81
|
+
A as viewMonthFromYear,
|
|
82
|
+
e as yearKey,
|
|
83
|
+
F as yearPageHasSelectableYear
|
|
75
84
|
};
|