impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.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 +6 -0
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
- package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +109 -100
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +93 -21
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
- package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
- package/dist/components/data/data-table/data-table-saved-views.js +37 -37
- package/dist/components/data/data-table/data-table.js +78 -73
- package/dist/components/data/data-table/data-table.types.d.ts +7 -1
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +20 -17
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
- package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
- package/dist/components/feedback/dialog/dialog.js +3 -3
- package/dist/components/feedback/drawer/drawer.js +32 -32
- package/dist/components/feedback/sheet/sheet.js +8 -8
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +245 -258
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-summary.js +41 -41
- package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
- package/dist/components/flows/wizard/wizard.js +32 -32
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +70 -70
- package/dist/components/forms/date-picker/date-picker.js +31 -30
- package/dist/components/forms/file-upload/file-upload.js +146 -168
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +123 -120
- package/dist/components/forms/select/select.types.d.ts +95 -204
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +113 -116
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/sidebar/sidebar.js +5 -5
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/kbd/kbd.variants.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova-base.scss +8 -5
- package/dist/impact-nova-components.css +2 -2
- package/dist/impact-nova-tokens.scss +346 -189
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +505 -499
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- 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/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +22 -254
- package/tailwind.config.js +10 -229
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import { IndicatorType } from './column-indicator';
|
|
2
|
+
export type IndicatorLegendEntry = {
|
|
3
|
+
type: IndicatorType;
|
|
4
|
+
/** Override the default i18n label for this entry */
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
export interface IndicatorLegendProps {
|
|
8
|
+
/** Legend entries; defaults to sort + filter */
|
|
9
|
+
entries?: IndicatorLegendEntry[];
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
|
-
* Legend showing the meaning of
|
|
12
|
+
* Legend showing the meaning of column indicator badge colors.
|
|
3
13
|
* Displayed in the Frozen Columns section header.
|
|
4
14
|
*
|
|
5
15
|
* @example
|
|
6
16
|
* <IndicatorLegend />
|
|
17
|
+
* <IndicatorLegend entries={[{ type: 'sort' }, { type: 'filter' }, { type: 'nonSavable' }]} />
|
|
7
18
|
*/
|
|
8
|
-
export declare const IndicatorLegend: React.FC
|
|
19
|
+
export declare const IndicatorLegend: React.FC<IndicatorLegendProps>;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useImpactNovaI18n as
|
|
3
|
-
import { ColumnIndicator as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useImpactNovaI18n as r } from "../../../i18n/use-impact-nova-i18n.js";
|
|
3
|
+
import { ColumnIndicator as i } from "./column-indicator.js";
|
|
4
|
+
const c = [
|
|
5
|
+
{ type: "sort" },
|
|
6
|
+
{ type: "filter" }
|
|
7
|
+
], d = {
|
|
8
|
+
sort: "indicatorSort",
|
|
9
|
+
filter: "indicatorSearch",
|
|
10
|
+
nonSavable: "indicatorNonSavable"
|
|
11
|
+
}, s = ({
|
|
12
|
+
entries: a = c
|
|
13
|
+
}) => {
|
|
14
|
+
const { t: o } = r();
|
|
15
|
+
return /* @__PURE__ */ t("div", { className: "flex items-center gap-3 text-[10px] text-secondary-foreground", "data-component": "indicator-legend", children: a.map((e) => /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
16
|
+
/* @__PURE__ */ t(i, { type: e.type }),
|
|
17
|
+
/* @__PURE__ */ t("span", { children: e.label ?? o(`dataTable.${d[e.type]}`) })
|
|
18
|
+
] }, e.type)) });
|
|
16
19
|
};
|
|
17
|
-
|
|
20
|
+
s.displayName = "IndicatorLegend";
|
|
18
21
|
export {
|
|
19
|
-
|
|
22
|
+
s as IndicatorLegend
|
|
20
23
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as s } from "react";
|
|
3
3
|
import { cn as n } from "../../../lib/utils.js";
|
|
4
|
-
import { Pin as
|
|
5
|
-
import { useImpactNovaI18n as
|
|
4
|
+
import { Pin as d } from "impact-nova-icons";
|
|
5
|
+
import { useImpactNovaI18n as w } from "../../../i18n/use-impact-nova-i18n.js";
|
|
6
6
|
const u = ({
|
|
7
7
|
value: e,
|
|
8
8
|
onChange: r,
|
|
9
9
|
disabled: t = !1,
|
|
10
10
|
className: l
|
|
11
11
|
}) => {
|
|
12
|
-
const { t:
|
|
12
|
+
const { t: c } = w(), o = s(() => {
|
|
13
13
|
t || r(e === "left" ? "right" : "left");
|
|
14
14
|
}, [t, e, r]), f = s(
|
|
15
15
|
(a) => {
|
|
16
|
-
t || (a.key === " " || a.key === "Enter") && (a.preventDefault(),
|
|
16
|
+
t || (a.key === " " || a.key === "Enter") && (a.preventDefault(), o());
|
|
17
17
|
},
|
|
18
|
-
[t,
|
|
19
|
-
), p = () =>
|
|
18
|
+
[t, o]
|
|
19
|
+
), p = () => c(e === "left" ? "dataTable.pinSwitchPinnedLeft" : e === "right" ? "dataTable.pinSwitchPinnedRight" : "dataTable.pinSwitchNotPinned"), h = e === "right";
|
|
20
20
|
return /* @__PURE__ */ m("div", { className: n("inline-flex items-center gap-2", l), "data-component": "pin-switch", children: [
|
|
21
21
|
/* @__PURE__ */ i(
|
|
22
22
|
"span",
|
|
@@ -37,7 +37,7 @@ const u = ({
|
|
|
37
37
|
"aria-label": p(),
|
|
38
38
|
"aria-disabled": t,
|
|
39
39
|
tabIndex: t ? -1 : 0,
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: o,
|
|
41
41
|
onKeyDown: f,
|
|
42
42
|
disabled: t,
|
|
43
43
|
className: n(
|
|
@@ -49,10 +49,10 @@ const u = ({
|
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
51
|
className: n(
|
|
52
|
-
"absolute flex w-5 h-5 p-0.5 justify-center items-center rounded bg-
|
|
52
|
+
"absolute flex w-5 h-5 p-0.5 justify-center items-center rounded bg-canvas-elevated shadow-elevation-pin-switch transition-all duration-200 ease-in-out",
|
|
53
53
|
e === "right" ? "left-[calc(100%-22px)]" : "left-0.5"
|
|
54
54
|
),
|
|
55
|
-
children: /* @__PURE__ */ i(
|
|
55
|
+
children: /* @__PURE__ */ i(d, { className: "w-3 h-3 text-content" })
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
}
|
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
import { useState as O, useRef as h, useCallback as a, useEffect as x } from "react";
|
|
2
2
|
import { mergePartialOrderedColumnState as N } from "./data-table-column-state.js";
|
|
3
|
-
import { afterSynchronousColumnApply as
|
|
3
|
+
import { afterSynchronousColumnApply as v, normalizeColumnPinned as q, GRID_AUTO_UNPIN_WAIT_MS as J, alignColumnTreePinMetadata as L, EXTERNAL_SYNC_DEBOUNCE_MS as Q, readGridColumnPinned as Z } from "./data-table-column-apply.js";
|
|
4
4
|
import { buildColumnTreeFromGrid as $ } from "./build-column-tree-from-grid.js";
|
|
5
5
|
import { computeColumnListSyncFingerprints as z, resolveColumnListSyncMode as A } from "./data-table-column-list-sync.js";
|
|
6
6
|
import { subscribeGridApiEvent as j } from "../ag-grid-react/grid-api-event-subscription.js";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { subscribeColumnIndicatorSync as ee } from "../ag-grid-react/column-indicator-sync-bus.js";
|
|
8
|
+
function ie({
|
|
9
|
+
gridApi: o,
|
|
9
10
|
frozenColumnsLabel: D,
|
|
10
11
|
scrollableColumnsLabel: U
|
|
11
12
|
}) {
|
|
12
|
-
const [K,
|
|
13
|
+
const [K, R] = O([]), [V, W] = O(!1), [_, B] = O(!1), i = h(!1), E = h(null), S = h(0), y = h(""), G = h(""), C = a(() => !o || i.current ? null : $(o, {
|
|
13
14
|
frozenColumns: D,
|
|
14
15
|
scrollableColumns: U
|
|
15
|
-
}), [
|
|
16
|
-
(
|
|
17
|
-
const
|
|
18
|
-
y.current = l.structural, G.current = l.indicators,
|
|
16
|
+
}), [o, D, U]), I = a(
|
|
17
|
+
(n, e) => {
|
|
18
|
+
const r = y.current, l = z(n);
|
|
19
|
+
y.current = l.structural, G.current = l.indicators, R(n), W(!0), e === "structural" && r !== "" && B((t) => !t);
|
|
19
20
|
},
|
|
20
21
|
[]
|
|
21
|
-
),
|
|
22
|
+
), f = a(
|
|
22
23
|
() => {
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const n = C();
|
|
25
|
+
n && I(n, "structural");
|
|
25
26
|
},
|
|
26
27
|
[I, C]
|
|
27
28
|
), k = a(
|
|
28
29
|
() => {
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
30
|
+
const n = C();
|
|
31
|
+
if (!n) return;
|
|
31
32
|
const e = A(
|
|
32
|
-
|
|
33
|
+
n,
|
|
33
34
|
y.current,
|
|
34
35
|
G.current
|
|
35
36
|
);
|
|
36
37
|
if (e !== "skip") {
|
|
37
38
|
if (e === "structural") {
|
|
38
|
-
const
|
|
39
|
+
const r = E.current?.querySelector(
|
|
39
40
|
'[data-component="nested-list"] .overflow-y-auto'
|
|
40
41
|
);
|
|
41
|
-
|
|
42
|
+
r && (S.current = r.scrollTop);
|
|
42
43
|
}
|
|
43
|
-
I(
|
|
44
|
+
I(n, e);
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
47
|
[I, C]
|
|
47
48
|
);
|
|
48
49
|
x(() => {
|
|
49
|
-
if (!
|
|
50
|
-
queueMicrotask(() =>
|
|
51
|
-
const
|
|
50
|
+
if (!o) return;
|
|
51
|
+
queueMicrotask(() => f());
|
|
52
|
+
const n = [
|
|
52
53
|
"columnVisible",
|
|
53
54
|
"columnPinned",
|
|
54
55
|
"columnMoved",
|
|
@@ -65,127 +66,129 @@ function se({
|
|
|
65
66
|
"newColumnsLoaded"
|
|
66
67
|
];
|
|
67
68
|
let e = null;
|
|
68
|
-
const
|
|
69
|
+
const r = () => {
|
|
69
70
|
i.current || (e && clearTimeout(e), e = setTimeout(() => {
|
|
70
|
-
e = null, !(i.current ||
|
|
71
|
+
e = null, !(i.current || o.isDestroyed()) && k();
|
|
71
72
|
}, Q));
|
|
72
|
-
}, l =
|
|
73
|
-
(
|
|
74
|
-
|
|
73
|
+
}, l = n.map(
|
|
74
|
+
(t) => j(o, t, () => {
|
|
75
|
+
r();
|
|
75
76
|
})
|
|
76
|
-
)
|
|
77
|
+
), u = ee(() => {
|
|
78
|
+
r();
|
|
79
|
+
});
|
|
77
80
|
return () => {
|
|
78
|
-
e && clearTimeout(e), l.forEach((
|
|
81
|
+
e && clearTimeout(e), l.forEach((t) => t()), u();
|
|
79
82
|
};
|
|
80
|
-
}, [
|
|
83
|
+
}, [o, f, k]), x(() => {
|
|
81
84
|
if (S.current === 0) return;
|
|
82
|
-
const
|
|
85
|
+
const n = requestAnimationFrame(() => {
|
|
83
86
|
const e = E.current?.querySelector(
|
|
84
87
|
'[data-component="nested-list"] .overflow-y-auto'
|
|
85
88
|
);
|
|
86
89
|
e && (e.scrollTop = S.current, S.current = 0);
|
|
87
90
|
});
|
|
88
|
-
return () => cancelAnimationFrame(
|
|
91
|
+
return () => cancelAnimationFrame(n);
|
|
89
92
|
}, [_]);
|
|
90
93
|
const w = a(
|
|
91
|
-
(
|
|
92
|
-
const e = [],
|
|
93
|
-
l.forEach((
|
|
94
|
-
if (
|
|
95
|
-
|
|
94
|
+
(n) => {
|
|
95
|
+
const e = [], r = (l, u) => {
|
|
96
|
+
l.forEach((t) => {
|
|
97
|
+
if (t.id === "root-frozen") {
|
|
98
|
+
t.children && r(t.children, "left");
|
|
96
99
|
return;
|
|
97
100
|
}
|
|
98
|
-
if (
|
|
99
|
-
|
|
101
|
+
if (t.id === "root-scrollable") {
|
|
102
|
+
t.children && r(t.children, null);
|
|
100
103
|
return;
|
|
101
104
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
105
|
+
if (t.category === "group" || t.children && t.children.length > 0)
|
|
106
|
+
t.children && r(t.children, u);
|
|
104
107
|
else {
|
|
105
108
|
let c;
|
|
106
109
|
if (u === null)
|
|
107
110
|
c = null;
|
|
108
111
|
else {
|
|
109
|
-
const d =
|
|
112
|
+
const d = t.data?.pinned;
|
|
110
113
|
c = d === "left" || d === "right" ? d : u;
|
|
111
114
|
}
|
|
112
115
|
e.push({
|
|
113
|
-
colId:
|
|
116
|
+
colId: t.id,
|
|
114
117
|
pinned: c,
|
|
115
|
-
hide: !
|
|
118
|
+
hide: !t.checked
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
});
|
|
119
122
|
};
|
|
120
|
-
return
|
|
123
|
+
return r(n, null), e;
|
|
121
124
|
},
|
|
122
125
|
[]
|
|
123
126
|
), g = a(
|
|
124
|
-
(
|
|
125
|
-
if (!
|
|
127
|
+
(n) => {
|
|
128
|
+
if (!o) return;
|
|
126
129
|
i.current = !0;
|
|
127
|
-
const e = w(
|
|
130
|
+
const e = w(n);
|
|
128
131
|
if (e.length === 0) {
|
|
129
|
-
|
|
132
|
+
v(() => {
|
|
130
133
|
i.current = !1;
|
|
131
134
|
});
|
|
132
135
|
return;
|
|
133
136
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
),
|
|
137
|
+
const r = o.getColumnState(), l = N(r, e), u = new Set(
|
|
138
|
+
r.filter((s) => q(s.pinned)).map((s) => s.colId)
|
|
139
|
+
), t = l.filter(
|
|
137
140
|
(s) => q(s.pinned) && !u.has(s.colId)
|
|
138
|
-
), p = new Set(
|
|
139
|
-
|
|
141
|
+
), p = new Set(t.map((s) => s.colId));
|
|
142
|
+
o.applyColumnState({ state: l, applyOrder: !0 });
|
|
140
143
|
const c = () => {
|
|
141
|
-
i.current = !1,
|
|
144
|
+
i.current = !1, f();
|
|
142
145
|
};
|
|
143
146
|
if (p.size === 0) {
|
|
144
|
-
|
|
147
|
+
v(c);
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
|
-
let
|
|
148
|
-
P = j(
|
|
149
|
-
if (
|
|
150
|
-
const s =
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
153
|
-
return
|
|
150
|
+
let b = !1, d = null, P = null;
|
|
151
|
+
P = j(o, "columnPinned", () => {
|
|
152
|
+
if (b || o.isDestroyed()) return;
|
|
153
|
+
const s = o.getColumnState();
|
|
154
|
+
if (t.filter((T) => {
|
|
155
|
+
const m = s.find((F) => F.colId === T.colId);
|
|
156
|
+
return m && !m.pinned;
|
|
154
157
|
}).length > 0) {
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
(
|
|
158
|
+
b = !0, d && clearTimeout(d), P?.();
|
|
159
|
+
const T = l.filter(
|
|
160
|
+
(m) => m.pinned && !p.has(m.colId)
|
|
158
161
|
);
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
(M) => M.colId ===
|
|
162
|
+
if (T.length > 0) {
|
|
163
|
+
const m = T[0], F = l.map(
|
|
164
|
+
(M) => M.colId === m.colId ? { ...M, pinned: null } : M
|
|
162
165
|
);
|
|
163
|
-
|
|
166
|
+
o.applyColumnState({ state: F, applyOrder: !0 });
|
|
164
167
|
}
|
|
165
|
-
|
|
168
|
+
v(c);
|
|
166
169
|
}
|
|
167
170
|
}), d = setTimeout(() => {
|
|
168
|
-
P?.(),
|
|
171
|
+
P?.(), b || c();
|
|
169
172
|
}, J);
|
|
170
173
|
},
|
|
171
|
-
[
|
|
174
|
+
[o, w, f]
|
|
172
175
|
), X = a(
|
|
173
|
-
(
|
|
174
|
-
g(L(
|
|
176
|
+
(n) => {
|
|
177
|
+
g(L(n));
|
|
175
178
|
},
|
|
176
179
|
[g]
|
|
177
180
|
), Y = a(
|
|
178
|
-
(
|
|
179
|
-
const
|
|
180
|
-
e || g(
|
|
181
|
-
const l = z(
|
|
181
|
+
(n, e) => {
|
|
182
|
+
const r = L(n);
|
|
183
|
+
e || g(r), R(r);
|
|
184
|
+
const l = z(r);
|
|
182
185
|
y.current = l.structural, G.current = l.indicators;
|
|
183
186
|
},
|
|
184
187
|
[g]
|
|
185
188
|
), H = a(
|
|
186
|
-
(
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
+
(n, e) => {
|
|
190
|
+
if (R((u) => {
|
|
191
|
+
const t = (p) => p.map((c) => c.id === n ? {
|
|
189
192
|
...c,
|
|
190
193
|
data: {
|
|
191
194
|
...c.data,
|
|
@@ -193,19 +196,19 @@ function se({
|
|
|
193
196
|
}
|
|
194
197
|
} : c.children ? {
|
|
195
198
|
...c,
|
|
196
|
-
children:
|
|
199
|
+
children: t(c.children)
|
|
197
200
|
} : c);
|
|
198
|
-
return
|
|
199
|
-
}), !
|
|
201
|
+
return t(u);
|
|
202
|
+
}), !o) return;
|
|
200
203
|
i.current = !0;
|
|
201
|
-
const
|
|
202
|
-
{ colId:
|
|
204
|
+
const r = o.getColumnState(), l = N(r, [
|
|
205
|
+
{ colId: n, pinned: e }
|
|
203
206
|
]);
|
|
204
|
-
|
|
205
|
-
i.current = !1, Z(
|
|
207
|
+
o.applyColumnState({ state: l, applyOrder: !0 }), v(() => {
|
|
208
|
+
i.current = !1, Z(o, n) !== e && f();
|
|
206
209
|
});
|
|
207
210
|
},
|
|
208
|
-
[
|
|
211
|
+
[o, f]
|
|
209
212
|
);
|
|
210
213
|
return {
|
|
211
214
|
items: K,
|
|
@@ -218,5 +221,5 @@ function se({
|
|
|
218
221
|
};
|
|
219
222
|
}
|
|
220
223
|
export {
|
|
221
|
-
|
|
224
|
+
ie as useDataTableColumnListSync
|
|
222
225
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NestedListItem } from './nested-list.types';
|
|
2
|
+
/** Above this count, apply/discard uses O(1) revision tracking instead of JSON comparison. */
|
|
3
|
+
export declare const NESTED_LIST_REVISION_THRESHOLD = 1000;
|
|
4
|
+
export declare function shouldUseNestedListRevisionTracking(itemCount: number): boolean;
|
|
5
|
+
export declare function computeNestedListHasChanges(options: {
|
|
6
|
+
enableApplyDiscard: boolean;
|
|
7
|
+
items: NestedListItem[];
|
|
8
|
+
savedItems: NestedListItem[];
|
|
9
|
+
revision: number;
|
|
10
|
+
savedRevision: number;
|
|
11
|
+
}): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const S = 1e3;
|
|
2
|
+
function o(e) {
|
|
3
|
+
return e > 1e3;
|
|
4
|
+
}
|
|
5
|
+
function a(e) {
|
|
6
|
+
const { enableApplyDiscard: i, items: s, savedItems: n, revision: t, savedRevision: r } = e;
|
|
7
|
+
return i ? o(s.length) ? t !== r : JSON.stringify(s) !== JSON.stringify(n) : !1;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
S as NESTED_LIST_REVISION_THRESHOLD,
|
|
11
|
+
a as computeNestedListHasChanges,
|
|
12
|
+
o as shouldUseNestedListRevisionTracking
|
|
13
|
+
};
|