@12-apps/ui 6.57.0 → 6.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/Avatar/Avatar.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +4 -4
- package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
- package/dist/_internal/components/data-display/Chart/chart-context.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +3 -3
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +18 -18
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +20 -19
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +5 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +45 -0
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +5 -4
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +17 -17
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-selection-extra.js +3 -1
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-url-echo.js +13 -0
- package/dist/_internal/components/data-display/DataViews/data-views-url-echo.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +1 -1
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +1 -1
- package/dist/_internal/components/data-display/index.js +14 -14
- package/dist/_internal/components/index.js +22 -22
- package/dist/_internal/components/layout/ContentToolbar/ContentToolbar.js +1 -1
- package/dist/_internal/components/layout/index.js +1 -1
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +6 -6
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +9 -9
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +5 -5
- package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +4 -4
- package/dist/_internal/components/navigation/index.js +9 -9
- package/dist/_internal/en-US.data-display.js +1 -1
- package/dist/_internal/pt-BR.data-display.js +1 -1
- package/dist/_internal/user-avatar/user-avatar.js +3 -3
- package/dist/charts.js +6 -6
- package/dist/{chunk-MKAA3YIJ.js → chunk-3K7WN2PO.js} +3 -3
- package/dist/{chunk-573XC4HK.js → chunk-4QKS5Y35.js} +2 -2
- package/dist/{chunk-KX75HM5U.js → chunk-5YDS6HO3.js} +7 -2
- package/dist/{chunk-KX75HM5U.js.map → chunk-5YDS6HO3.js.map} +1 -1
- package/dist/{chunk-N4MR4EMC.js → chunk-6D2PFC5C.js} +2 -2
- package/dist/{chunk-LJKWWXZD.js → chunk-6OSUK2C7.js} +28 -22
- package/dist/chunk-6OSUK2C7.js.map +1 -0
- package/dist/{chunk-ICSXPZXT.js → chunk-6QBT5TPS.js} +2 -2
- package/dist/{chunk-C67FDYG7.js → chunk-7CWZI6MQ.js} +5 -5
- package/dist/{chunk-JL77BSOL.js → chunk-AQI3UK6P.js} +2 -2
- package/dist/{chunk-A6EUQDRK.js → chunk-ARJIKW56.js} +4 -2
- package/dist/chunk-ARJIKW56.js.map +1 -0
- package/dist/{chunk-GI24X7XA.js → chunk-DZIRCD2W.js} +2 -2
- package/dist/{chunk-53ACGKBW.js → chunk-EDBP62WG.js} +3 -3
- package/dist/{chunk-YXIVQFNW.js → chunk-EWIKSTJV.js} +4 -4
- package/dist/{chunk-LWZ2K225.js → chunk-FXZUVZON.js} +6 -6
- package/dist/chunk-G6EJLEVV.js +75 -0
- package/dist/chunk-G6EJLEVV.js.map +1 -0
- package/dist/{chunk-IK2ZVV3M.js → chunk-GK7JNSMK.js} +2 -2
- package/dist/{chunk-HFBQCJNP.js → chunk-HCYRCU4W.js} +2 -2
- package/dist/{chunk-BJMNAPKH.js → chunk-HH7PM5HT.js} +10 -22
- package/dist/chunk-HH7PM5HT.js.map +1 -0
- package/dist/{chunk-7AAJYWC3.js → chunk-HPO7PB4F.js} +2 -2
- package/dist/{chunk-WF3P7GE5.js → chunk-I3CQBEKS.js} +2 -2
- package/dist/{chunk-RREWYOKS.js → chunk-IL4FCC54.js} +2 -2
- package/dist/{chunk-7M3DRP7Q.js → chunk-ILNO4ZJ6.js} +3 -3
- package/dist/{chunk-2CJZLL5Y.js → chunk-NHVL2QPG.js} +2 -1
- package/dist/{chunk-2CJZLL5Y.js.map → chunk-NHVL2QPG.js.map} +1 -1
- package/dist/{chunk-45PGSVOH.js → chunk-NTJUAPJM.js} +10 -8
- package/dist/chunk-NTJUAPJM.js.map +1 -0
- package/dist/{chunk-EUPUEMFX.js → chunk-PC4H5LVB.js} +7 -7
- package/dist/{chunk-KEKOPD43.js → chunk-PQ7RWH7L.js} +4 -2
- package/dist/chunk-PQ7RWH7L.js.map +1 -0
- package/dist/{chunk-HRMB72E4.js → chunk-QHP5PZNC.js} +2 -1
- package/dist/{chunk-HRMB72E4.js.map → chunk-QHP5PZNC.js.map} +1 -1
- package/dist/{chunk-GNBCSTXF.js → chunk-QKAYXAQE.js} +6 -6
- package/dist/{chunk-GNBCSTXF.js.map → chunk-QKAYXAQE.js.map} +1 -1
- package/dist/{chunk-TZFBJ47T.js → chunk-SFLNHCA2.js} +39 -15
- package/dist/chunk-SFLNHCA2.js.map +1 -0
- package/dist/{chunk-OBMPE6PW.js → chunk-SSDYEOU4.js} +5 -5
- package/dist/{chunk-I6ESCBY3.js → chunk-TF27Z27K.js} +2 -2
- package/dist/{chunk-JF5LQOGB.js → chunk-U47KRLEW.js} +57 -45
- package/dist/chunk-U47KRLEW.js.map +1 -0
- package/dist/{chunk-RBHBJDOZ.js → chunk-UEU5NSIG.js} +4 -4
- package/dist/chunk-V4V2N6YJ.js +55 -0
- package/dist/chunk-V4V2N6YJ.js.map +1 -0
- package/dist/{chunk-G76BNXWE.js → chunk-XW5SEW3H.js} +6 -6
- package/dist/{chunk-46ZATLQV.js → chunk-YIKFYWKD.js} +3 -3
- package/dist/{chunk-4JBS6NOT.js → chunk-ZWBGQYVO.js} +35 -6
- package/dist/chunk-ZWBGQYVO.js.map +1 -0
- package/dist/{chunk-VWW2EXH7.js → chunk-ZYJZHXFU.js} +4 -4
- package/dist/data-display/Avatar.js +2 -2
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +10 -10
- package/dist/data-display/Carousel.js +2 -2
- package/dist/data-display/Chart.js +6 -6
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +25 -23
- package/dist/en-US.js +1 -1
- package/dist/layout/ContentToolbar.js +1 -1
- package/dist/locales.js +2 -2
- package/dist/navigation/SectionNav.js +9 -9
- package/dist/pt-BR.js +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-geometry.d.ts +29 -1
- package/dist/types/components/data-display/DataViews/base-list-card-geometry.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card-layout.d.ts +46 -0
- package/dist/types/components/data-display/DataViews/base-list-card-layout.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/base-list-card-slots.d.ts +5 -2
- package/dist/types/components/data-display/DataViews/base-list-card-slots.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/base-list-card.d.ts +10 -1
- package/dist/types/components/data-display/DataViews/base-list-card.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts +7 -0
- package/dist/types/components/data-display/DataViews/data-views-copy.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-selection-extra.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-selection-extra.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts +3 -1
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-url-echo.d.ts +47 -0
- package/dist/types/components/data-display/DataViews/data-views-url-echo.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts +17 -2
- package/dist/types/components/data-display/DataViews/list-card-rails.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.d.ts +3 -2
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.d.ts.map +1 -1
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts +14 -0
- package/dist/types/components/layout/ContentToolbar/ContentToolbar.types.d.ts.map +1 -1
- package/dist/types/en-US.data-display.d.ts.map +1 -1
- package/dist/types/pt-BR.data-display.d.ts.map +1 -1
- package/dist/user-avatar.js +3 -3
- package/package.json +1 -1
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +7 -36
- package/src/components/data-display/DataViews/base-list-card-geometry.tsx +114 -40
- package/src/components/data-display/DataViews/base-list-card-layout.tsx +104 -0
- package/src/components/data-display/DataViews/base-list-card-slots.tsx +47 -3
- package/src/components/data-display/DataViews/base-list-card.tsx +65 -68
- package/src/components/data-display/DataViews/data-views-copy.ts +7 -0
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +2 -1
- package/src/components/data-display/DataViews/data-views-selection-extra.ts +10 -1
- package/src/components/data-display/DataViews/data-views-shell-toolbar.tsx +4 -0
- package/src/components/data-display/DataViews/data-views-toolbar.tsx +4 -0
- package/src/components/data-display/DataViews/data-views-url-echo.ts +134 -0
- package/src/components/data-display/DataViews/list-card-rails.tsx +22 -6
- package/src/components/layout/ContentToolbar/ContentToolbar.md +5 -2
- package/src/components/layout/ContentToolbar/ContentToolbar.tsx +51 -10
- package/src/components/layout/ContentToolbar/ContentToolbar.types.ts +14 -0
- package/src/en-US.data-display.ts +1 -0
- package/src/pt-BR.data-display.ts +1 -0
- package/dist/chunk-45PGSVOH.js.map +0 -1
- package/dist/chunk-4JBS6NOT.js.map +0 -1
- package/dist/chunk-A6EUQDRK.js.map +0 -1
- package/dist/chunk-BJMNAPKH.js.map +0 -1
- package/dist/chunk-JF5LQOGB.js.map +0 -1
- package/dist/chunk-KEKOPD43.js.map +0 -1
- package/dist/chunk-LJKWWXZD.js.map +0 -1
- package/dist/chunk-TZFBJ47T.js.map +0 -1
- /package/dist/{chunk-MKAA3YIJ.js.map → chunk-3K7WN2PO.js.map} +0 -0
- /package/dist/{chunk-573XC4HK.js.map → chunk-4QKS5Y35.js.map} +0 -0
- /package/dist/{chunk-N4MR4EMC.js.map → chunk-6D2PFC5C.js.map} +0 -0
- /package/dist/{chunk-ICSXPZXT.js.map → chunk-6QBT5TPS.js.map} +0 -0
- /package/dist/{chunk-C67FDYG7.js.map → chunk-7CWZI6MQ.js.map} +0 -0
- /package/dist/{chunk-JL77BSOL.js.map → chunk-AQI3UK6P.js.map} +0 -0
- /package/dist/{chunk-GI24X7XA.js.map → chunk-DZIRCD2W.js.map} +0 -0
- /package/dist/{chunk-53ACGKBW.js.map → chunk-EDBP62WG.js.map} +0 -0
- /package/dist/{chunk-YXIVQFNW.js.map → chunk-EWIKSTJV.js.map} +0 -0
- /package/dist/{chunk-LWZ2K225.js.map → chunk-FXZUVZON.js.map} +0 -0
- /package/dist/{chunk-IK2ZVV3M.js.map → chunk-GK7JNSMK.js.map} +0 -0
- /package/dist/{chunk-HFBQCJNP.js.map → chunk-HCYRCU4W.js.map} +0 -0
- /package/dist/{chunk-7AAJYWC3.js.map → chunk-HPO7PB4F.js.map} +0 -0
- /package/dist/{chunk-WF3P7GE5.js.map → chunk-I3CQBEKS.js.map} +0 -0
- /package/dist/{chunk-RREWYOKS.js.map → chunk-IL4FCC54.js.map} +0 -0
- /package/dist/{chunk-7M3DRP7Q.js.map → chunk-ILNO4ZJ6.js.map} +0 -0
- /package/dist/{chunk-EUPUEMFX.js.map → chunk-PC4H5LVB.js.map} +0 -0
- /package/dist/{chunk-OBMPE6PW.js.map → chunk-SSDYEOU4.js.map} +0 -0
- /package/dist/{chunk-I6ESCBY3.js.map → chunk-TF27Z27K.js.map} +0 -0
- /package/dist/{chunk-RBHBJDOZ.js.map → chunk-UEU5NSIG.js.map} +0 -0
- /package/dist/{chunk-G76BNXWE.js.map → chunk-XW5SEW3H.js.map} +0 -0
- /package/dist/{chunk-46ZATLQV.js.map → chunk-YIKFYWKD.js.map} +0 -0
- /package/dist/{chunk-VWW2EXH7.js.map → chunk-ZYJZHXFU.js.map} +0 -0
package/dist/charts.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./chunk-5KLSLD72.js";
|
|
2
2
|
import {
|
|
3
3
|
SpecChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DZIRCD2W.js";
|
|
5
5
|
import {
|
|
6
6
|
Chart
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AQI3UK6P.js";
|
|
8
8
|
import {
|
|
9
9
|
CHART_SEMANTIC_COLORS,
|
|
10
10
|
ChartSpecError,
|
|
@@ -16,7 +16,9 @@ import {
|
|
|
16
16
|
getRegisteredChartSpecTypes,
|
|
17
17
|
registerChartSpecRenderer
|
|
18
18
|
} from "./chunk-WKUA6P3W.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-UEU5NSIG.js";
|
|
20
|
+
import "./chunk-7CWZI6MQ.js";
|
|
21
|
+
import "./chunk-SOHQPPYJ.js";
|
|
20
22
|
import {
|
|
21
23
|
ChartContainer,
|
|
22
24
|
ChartLegend,
|
|
@@ -24,13 +26,11 @@ import {
|
|
|
24
26
|
ChartTooltip,
|
|
25
27
|
ChartTooltipContent
|
|
26
28
|
} from "./chunk-RIRTW5EU.js";
|
|
29
|
+
import "./chunk-FIMSPRKX.js";
|
|
27
30
|
import {
|
|
28
31
|
chartValueFormatter,
|
|
29
32
|
formatChartValue
|
|
30
33
|
} from "./chunk-QVWNK4JO.js";
|
|
31
|
-
import "./chunk-C67FDYG7.js";
|
|
32
|
-
import "./chunk-FIMSPRKX.js";
|
|
33
|
-
import "./chunk-SOHQPPYJ.js";
|
|
34
34
|
import "./chunk-B7ZHEOQQ.js";
|
|
35
35
|
import "./chunk-BRHRK7BK.js";
|
|
36
36
|
import "./chunk-25MSGLNU.js";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-QLJU7UUI.js";
|
|
5
5
|
import {
|
|
6
6
|
MoreFilters
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HCYRCU4W.js";
|
|
8
8
|
import {
|
|
9
9
|
PillControl
|
|
10
10
|
} from "./chunk-GWUJIO6Z.js";
|
|
11
11
|
import {
|
|
12
12
|
RangePill
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EWIKSTJV.js";
|
|
14
14
|
import {
|
|
15
15
|
CollapsedSearch,
|
|
16
16
|
InlineKeyword
|
|
@@ -220,4 +220,4 @@ function FilterSlots({
|
|
|
220
220
|
export {
|
|
221
221
|
InlineFilterControls
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-3K7WN2PO.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-GWUJIO6Z.js";
|
|
4
4
|
import {
|
|
5
5
|
RangeBounds
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EWIKSTJV.js";
|
|
7
7
|
import {
|
|
8
8
|
isRangeSet
|
|
9
9
|
} from "./chunk-GCZJH4XL.js";
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
fieldClearing,
|
|
200
200
|
MoreGroup
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-4QKS5Y35.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// src/components/data-display/DataViews/data-views-selection-extra.ts
|
|
2
|
+
function allOnPageSelected(c, getRowId) {
|
|
3
|
+
const page = c.matched;
|
|
4
|
+
return page.length > 0 && page.every((row) => c.selectedIds.has(getRowId(row)));
|
|
5
|
+
}
|
|
2
6
|
function resolveSelectionExtra({
|
|
3
7
|
c,
|
|
4
8
|
getRowId,
|
|
@@ -9,12 +13,13 @@ function resolveSelectionExtra({
|
|
|
9
13
|
return selectionExtra({
|
|
10
14
|
selectedRows: c.selectedRows,
|
|
11
15
|
clearSelection: c.clearSelection,
|
|
12
|
-
allOnPageSelected:
|
|
16
|
+
allOnPageSelected: allOnPageSelected(c, getRowId),
|
|
13
17
|
pageRowCount: page.length
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
export {
|
|
22
|
+
allOnPageSelected,
|
|
18
23
|
resolveSelectionExtra
|
|
19
24
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-5YDS6HO3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-selection-extra.ts"],"sourcesContent":["/**\n * The selection-WIDENING slot: what a paginated grid needs so an operator can\n * act on \"everything matching the filter\" rather than on the page in front of\n * them.\n *\n * It is a slot of its own rather than a share of the bulk-actions menu because\n * the two answer different questions — `actions` is what HAPPENS to the\n * selection, this is what the selection IS. Folding a widening into the actions\n * menu files \"change what I picked\" under \"do this to what I picked\", where\n * every entry is expected to write something.\n */\nimport type { DataViewsController } from \"./use-data-views-state\";\n\n/**\n * What a widening control gets to decide with.\n *\n * `allOnPageSelected` is the one thing a host cannot compute for itself, and\n * the whole reason this is a context rather than a bare node: the grid owns\n * which rows the page is currently rendering — server mode pages at the\n * backend, so the host's `rows` prop and the page can differ mid-fetch — and\n * \"every row here is ticked\" is the trigger a select-all-matching control\n * hangs on. Deriving it host-side would be a second, slightly different answer\n * to the question the grid already answers to draw its own header checkbox.\n */\nexport interface SelectionExtraContext<T extends Record<string, unknown>> {\n /** The selected rows, off-page ones included. */\n selectedRows: T[];\n /** Drop the whole selection. */\n clearSelection: () => void;\n /** Every row the page is rendering is selected — and the page is not empty. */\n allOnPageSelected: boolean;\n /** How many rows the page is rendering. */\n pageRowCount: number;\n}\n\n/** The host's widening control, called only while something is selected. */\nexport type SelectionExtraRender<T extends Record<string, unknown>> = (\n context: SelectionExtraContext<T>,\n) => React.ReactNode;\n\n/**\n * Resolve the host's control against the page on screen.\n *\n * Measured against `c.matched` — which in server mode IS the page — rather than\n * the `rows` prop, so the answer cannot lag a page change.\n *\n * Returns `undefined` with nothing selected, so the toolbar renders no empty\n * slot: a widening with nothing to widen is not a control.\n */\nexport function resolveSelectionExtra<T extends Record<string, unknown>>({\n c,\n getRowId,\n selectionExtra,\n}: {\n c: DataViewsController<T>;\n getRowId: (row: T) => string | number;\n selectionExtra?: SelectionExtraRender<T>;\n}): React.ReactNode {\n if (selectionExtra === undefined || c.selectedRows.length === 0) return undefined;\n const page = c.matched;\n return selectionExtra({\n selectedRows: c.selectedRows,\n clearSelection: c.clearSelection,\n allOnPageSelected:
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-selection-extra.ts"],"sourcesContent":["/**\n * The selection-WIDENING slot: what a paginated grid needs so an operator can\n * act on \"everything matching the filter\" rather than on the page in front of\n * them.\n *\n * It is a slot of its own rather than a share of the bulk-actions menu because\n * the two answer different questions — `actions` is what HAPPENS to the\n * selection, this is what the selection IS. Folding a widening into the actions\n * menu files \"change what I picked\" under \"do this to what I picked\", where\n * every entry is expected to write something.\n */\nimport type { DataViewsController } from \"./use-data-views-state\";\n\n/**\n * What a widening control gets to decide with.\n *\n * `allOnPageSelected` is the one thing a host cannot compute for itself, and\n * the whole reason this is a context rather than a bare node: the grid owns\n * which rows the page is currently rendering — server mode pages at the\n * backend, so the host's `rows` prop and the page can differ mid-fetch — and\n * \"every row here is ticked\" is the trigger a select-all-matching control\n * hangs on. Deriving it host-side would be a second, slightly different answer\n * to the question the grid already answers to draw its own header checkbox.\n */\nexport interface SelectionExtraContext<T extends Record<string, unknown>> {\n /** The selected rows, off-page ones included. */\n selectedRows: T[];\n /** Drop the whole selection. */\n clearSelection: () => void;\n /** Every row the page is rendering is selected — and the page is not empty. */\n allOnPageSelected: boolean;\n /** How many rows the page is rendering. */\n pageRowCount: number;\n}\n\n/** The host's widening control, called only while something is selected. */\nexport type SelectionExtraRender<T extends Record<string, unknown>> = (\n context: SelectionExtraContext<T>,\n) => React.ReactNode;\n\n/**\n * Resolve the host's control against the page on screen.\n *\n * Measured against `c.matched` — which in server mode IS the page — rather than\n * the `rows` prop, so the answer cannot lag a page change.\n *\n * Returns `undefined` with nothing selected, so the toolbar renders no empty\n * slot: a widening with nothing to widen is not a control.\n */\n/** Every row the page is rendering is selected — and the page is not empty. */\nexport function allOnPageSelected<T extends Record<string, unknown>>(\n c: DataViewsController<T>,\n getRowId: (row: T) => string | number,\n): boolean {\n const page = c.matched;\n return page.length > 0 && page.every((row) => c.selectedIds.has(getRowId(row)));\n}\n\nexport function resolveSelectionExtra<T extends Record<string, unknown>>({\n c,\n getRowId,\n selectionExtra,\n}: {\n c: DataViewsController<T>;\n getRowId: (row: T) => string | number;\n selectionExtra?: SelectionExtraRender<T>;\n}): React.ReactNode {\n if (selectionExtra === undefined || c.selectedRows.length === 0) return undefined;\n const page = c.matched;\n return selectionExtra({\n selectedRows: c.selectedRows,\n clearSelection: c.clearSelection,\n allOnPageSelected: allOnPageSelected(c, getRowId),\n pageRowCount: page.length,\n });\n}\n"],"mappings":";AAkDO,SAAS,kBACd,GACA,UACS;AACT,QAAM,OAAO,EAAE;AACf,SAAO,KAAK,SAAS,KAAK,KAAK,MAAM,CAAC,QAAQ,EAAE,YAAY,IAAI,SAAS,GAAG,CAAC,CAAC;AAChF;AAEO,SAAS,sBAAyD;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AACF,GAIoB;AAClB,MAAI,mBAAmB,UAAa,EAAE,aAAa,WAAW,EAAG,QAAO;AACxE,QAAM,OAAO,EAAE;AACf,SAAO,eAAe;AAAA,IACpB,cAAc,EAAE;AAAA,IAChB,gBAAgB,EAAE;AAAA,IAClB,mBAAmB,kBAAkB,GAAG,QAAQ;AAAA,IAChD,cAAc,KAAK;AAAA,EACrB,CAAC;AACH;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-GWUJIO6Z.js";
|
|
4
4
|
import {
|
|
5
5
|
PanelRangeField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EWIKSTJV.js";
|
|
7
7
|
import {
|
|
8
8
|
useDataViewsCopy
|
|
9
9
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
GridFilterPanel,
|
|
158
158
|
FilterDialog
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-6D2PFC5C.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StandaloneContainer,
|
|
3
|
+
useRowLayout
|
|
4
|
+
} from "./chunk-V4V2N6YJ.js";
|
|
1
5
|
import {
|
|
2
6
|
DiscloseSlot,
|
|
3
7
|
DragSlot,
|
|
@@ -8,13 +12,13 @@ import {
|
|
|
8
12
|
metaShape,
|
|
9
13
|
rowStyles,
|
|
10
14
|
useRowShell
|
|
11
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-U47KRLEW.js";
|
|
12
16
|
import {
|
|
13
17
|
ListCardActions,
|
|
14
18
|
ListCardCaption,
|
|
15
19
|
ListCardMeta,
|
|
16
20
|
ListCardTail
|
|
17
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZWBGQYVO.js";
|
|
18
22
|
import {
|
|
19
23
|
useDisclosure
|
|
20
24
|
} from "./chunk-2JCRNWHE.js";
|
|
@@ -22,12 +26,7 @@ import {
|
|
|
22
26
|
DropIndicator
|
|
23
27
|
} from "./chunk-K4EKTMTC.js";
|
|
24
28
|
import {
|
|
25
|
-
|
|
26
|
-
} from "./chunk-GNBCSTXF.js";
|
|
27
|
-
import {
|
|
28
|
-
ListCardCells,
|
|
29
|
-
cellTracks,
|
|
30
|
-
useCellConfig
|
|
29
|
+
ListCardCells
|
|
31
30
|
} from "./chunk-COYGTEN5.js";
|
|
32
31
|
import {
|
|
33
32
|
default as default2
|
|
@@ -39,20 +38,14 @@ import {
|
|
|
39
38
|
// src/components/data-display/DataViews/base-list-card.tsx
|
|
40
39
|
import Collapse from "@mui/material/Collapse/index.js";
|
|
41
40
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
42
|
-
function useResolvedCells(props, inGroup) {
|
|
43
|
-
const groupCells = useCellConfig();
|
|
44
|
-
const cells = groupCells ?? props.cells ?? null;
|
|
45
|
-
const configured = cells != null && cells.length > 0 && props.row != null;
|
|
46
|
-
const cellTemplate = configured && !inGroup ? cellRailsTemplate(cellTracks(cells)) : null;
|
|
47
|
-
return { cells, configured, cellTemplate };
|
|
48
|
-
}
|
|
49
41
|
function RowContent({
|
|
50
42
|
card,
|
|
51
43
|
cells,
|
|
52
44
|
configured,
|
|
53
45
|
slot,
|
|
54
46
|
actionable,
|
|
55
|
-
meta
|
|
47
|
+
meta,
|
|
48
|
+
opens
|
|
56
49
|
}) {
|
|
57
50
|
if (configured && cells != null) {
|
|
58
51
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -63,6 +56,7 @@ function RowContent({
|
|
|
63
56
|
actions: actionable ? card.actions : void 0,
|
|
64
57
|
alwaysVisible: card.actionsAlwaysVisible,
|
|
65
58
|
menu: card.menu,
|
|
59
|
+
opens,
|
|
66
60
|
testId: slot
|
|
67
61
|
}
|
|
68
62
|
)
|
|
@@ -88,6 +82,7 @@ function RowContent({
|
|
|
88
82
|
actions: actionable ? card.actions : void 0,
|
|
89
83
|
actionsAlwaysVisible: card.actionsAlwaysVisible,
|
|
90
84
|
menu: card.menu,
|
|
85
|
+
opens,
|
|
91
86
|
testId: slot
|
|
92
87
|
}
|
|
93
88
|
)
|
|
@@ -131,8 +126,8 @@ function BaseListCard(props) {
|
|
|
131
126
|
const { actionable, selectable, slot, drag, reserve, pad, padY, acts } = shell;
|
|
132
127
|
const meta = metaShape(props);
|
|
133
128
|
const disclosure = useDisclosure(props);
|
|
134
|
-
const { cells, configured, cellTemplate } =
|
|
135
|
-
return /* @__PURE__ */ jsxs(
|
|
129
|
+
const { cells, configured, cellTemplate, opens, stack } = useRowLayout(props, shell, disclosure.expandable);
|
|
130
|
+
return /* @__PURE__ */ jsx(StandaloneContainer, { inGroup: shell.group != null, children: /* @__PURE__ */ jsxs(
|
|
136
131
|
Card,
|
|
137
132
|
{
|
|
138
133
|
variant: "outlined",
|
|
@@ -143,7 +138,7 @@ function BaseListCard(props) {
|
|
|
143
138
|
onContextMenu: props.onContextMenu,
|
|
144
139
|
...acts ? actionProps(onClick) : {},
|
|
145
140
|
...drag.itemProps,
|
|
146
|
-
sx: rowStyles(props, shell, cellTemplate),
|
|
141
|
+
sx: rowStyles(props, shell, cellTemplate, stack),
|
|
147
142
|
children: [
|
|
148
143
|
drag.dropEdge != null && /* @__PURE__ */ jsx(DropIndicator, { edge: drag.dropEdge }),
|
|
149
144
|
/* @__PURE__ */ jsx(
|
|
@@ -169,14 +164,25 @@ function BaseListCard(props) {
|
|
|
169
164
|
}
|
|
170
165
|
),
|
|
171
166
|
/* @__PURE__ */ jsx(default2, { "data-slot": "leading", sx: { display: "flex", alignItems: "center" }, children: props.leading }),
|
|
172
|
-
/* @__PURE__ */ jsx(
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
RowContent,
|
|
169
|
+
{
|
|
170
|
+
card: props,
|
|
171
|
+
cells,
|
|
172
|
+
configured,
|
|
173
|
+
slot,
|
|
174
|
+
actionable,
|
|
175
|
+
meta,
|
|
176
|
+
opens
|
|
177
|
+
}
|
|
178
|
+
),
|
|
173
179
|
/* @__PURE__ */ jsx(ExpandableBody, { disclosure, padY, pad, children: props.children })
|
|
174
180
|
]
|
|
175
181
|
}
|
|
176
|
-
);
|
|
182
|
+
) });
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
export {
|
|
180
186
|
BaseListCard
|
|
181
187
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-6OSUK2C7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/base-list-card.tsx"],"sourcesContent":["\"use client\";\n\nimport Collapse from \"@mui/material/Collapse/index.js\";\nimport { type ReactNode } from \"react\";\n\nimport { Card } from \"../../layout/Card\";\nimport type { DescriptionItemProps } from \"../DescriptionItem\";\nimport { Box } from \"../../../mui/Box\";\n\nimport { type CardSurfaceProps } from \"./card-surface\";\nimport { DropIndicator } from \"./data-views-drag\";\nimport { useDisclosure } from \"./base-list-card-disclosure\";\nimport { actionProps, metaShape, rowStyles, useRowShell } from \"./base-list-card-geometry\";\nimport { StandaloneContainer, useRowLayout } from \"./base-list-card-layout\";\nimport { DiscloseSlot, DragSlot, SelectSlot } from \"./base-list-card-gutters\";\nimport { type DataViewsDensity } from \"./data-views-layout-context\";\nimport { ListCardCells, type ListCardCellConfig } from \"./list-card-cells\";\nimport {\n ListCardActions,\n ListCardCaption,\n ListCardMeta,\n ListCardTail,\n} from \"./base-list-card-slots\";\n\n/**\n * THE \"LISTA\" LAYOUT'S CARD — {@link BaseCard}'s horizontal sibling.\n *\n * `ListBody` always described the shape it wanted (\"a marker, a title, a\n * subtitle and a value on the right\") and never provided it, so every host\n * hand-rolled a `<Box>` flex row: a tint for selection with no checkbox, fixed\n * `minWidth` columns that ignored density and never collapsed, no hover, no\n * focus ring, and a `borderBottom` fighting the gap between rows.\n *\n * THE LIST OWNS THE COLUMNS. Inside a {@link ListCardGroup} this card is\n * `grid-template-columns: subgrid` across the group's rails, so the value sits\n * on its own edge and cannot be shunted about by the width of the status chip\n * beside it. Standalone it falls back to the same template on its own. See\n * `list-card-rails`.\n *\n * IT ANSWERS ITS OWN WIDTH, not the viewport — a container query, because the\n * same row renders full-bleed on a phone, in a 300px board column, and beside a\n * filter panel that opens and closes. Below `STACK_BREAK` it leaves the shared\n * rails entirely and goes two-line, which is the standard mobile transaction\n * row and beats truncating everything: the title (with its subtitle) on line\n * 1, the value under it at the right edge.\n * A CONFIGURED row keeps the same two facts — its first cell in the title's\n * place, its `strong` (else last) cell in the value's — and drops the rest\n * into the expandable body's job. Standalone, the card renders inside a\n * wrapper that is the query container, since a row cannot query itself.\n *\n * A row that OPENS something (a click handler, or a link it renders) ends in a\n * chevron saying so, at every width — unless it expands, where the disclosure\n * chevron is the only arrow it carries.\n */\n\nexport interface BaseListCardProps extends CardSurfaceProps {\n /** A marker: avatar, thumbnail or status glyph. Earn the pixels — a generic\n * icon repeated down fifty rows is noise. */\n leading?: ReactNode;\n /** First-class title. Rendered as the link when `href` is set. */\n title?: ReactNode;\n /** Secondary line under the title. */\n subtitle?: ReactNode;\n /**\n * Middle columns as labelled pairs — {@link DescriptionItem}s, not free-form\n * nodes, so a screen reader reads \"Data, 05/08/2026\" rather than four\n * unrelated strings. Stacked (label above value) by default.\n *\n * The FIRST rung of the collapse ladder: the only slot whose absence does not\n * stop the row being identified or acted on.\n */\n meta?: DescriptionItemProps[];\n /** Escape hatch for a middle section these pairs cannot express. */\n metaSlot?: ReactNode;\n /** The number this row is about. Its own rail, tabular figures, never truncated. */\n value?: ReactNode;\n /**\n * Inline actions — the one or two things done often enough to deserve a\n * button. Revealed on hover and `:focus-within` by default, so fifty rows of\n * buttons are not the resting state of the page.\n */\n actions?: ReactNode;\n /** Always show the inline actions, rather than on hover/focus. */\n actionsAlwaysVisible?: boolean;\n /** The 3-dots overflow menu, pinned to the end. Also opens on right-click. */\n menu?: ReactNode;\n /** What opens the overflow menu on right-click / long-press. */\n onContextMenu?: (event: React.MouseEvent) => void;\n /**\n * THE EXPANDABLE BODY — and the whole reason this is a card and not a table\n * row.\n *\n * A summary row of labelled columns is a table row with a border round it: it\n * restates what the table already says and gives nobody a reason to switch to\n * it. What a card can do that a table cell cannot is OPEN — carry the record's\n * own detail underneath its summary, in whatever shape that record wants.\n *\n * So this container makes no claim about what goes in here. It spans every\n * rail and imposes nothing: an order puts its line items and a totals ledger\n * here, a cart adds its recovery actions, a role lists its permissions. The\n * design of that area belongs entirely to the consumer, and none of it is the\n * envelope's business.\n *\n * ABSENT ⇒ NO CHEVRON. A row given nothing to reveal renders no disclosure\n * control at all, rather than one that opens onto an empty box, so a column of\n * chevrons is a truthful index of which rows have more behind them.\n */\n children?: ReactNode;\n /** Open on first render, for an uncontrolled card. Ignored when `expanded` is set. */\n defaultExpanded?: boolean;\n /**\n * Open state, when the LIST wants to own it.\n *\n * Left unset the card keeps its own, and rows open independently — several at\n * once, which is what comparing two records requires. Pass this (with\n * `onExpandedChange`) to impose something else, an accordion being the usual\n * reason.\n */\n expanded?: boolean;\n /** Fired with the state the card is asking to move to. */\n onExpandedChange?: (expanded: boolean) => void;\n /** Toggle this row's selection. Receives the raw event so a list can range-select. */\n onToggleSelect?: (event?: React.MouseEvent) => void;\n /** How much air the row gets. Vertical only — a full-width row cannot narrow. */\n density?: DataViewsDensity;\n /**\n * Fine-grained size multiplier on top of `density` (1 = base).\n *\n * Applied as `zoom`, so it scales EVERYTHING the row draws — type, gutters,\n * gaps, padding, the checkbox, the grip, the chip and the menu — not just the\n * handful of font sizes it once multiplied.\n */\n scale?: number;\n /** Flush style: a bottom rule instead of an outline. Row-only. */\n divider?: boolean;\n /** This row's id for drag purposes. Inert outside a `DragContainerProvider`. */\n dragId?: string | number;\n /**\n * The record this row is about, read by the list's cell config.\n *\n * Required only when cells are configured — the config's `primary`/`secondary`\n * are functions of the row, so without one there is nothing to render them\n * from and the card falls back to its named slots.\n */\n row?: Record<string, unknown>;\n /**\n * A cell config for a STANDALONE card.\n *\n * Inside a `ListCardGroup` the list's config wins and this is ignored: one\n * declaration of the list's shape is the whole point, and a row permitted to\n * override it could put its columns somewhere no other row has them.\n */\n cells?: readonly ListCardCellConfig<never>[];\n}\n\n\n/**\n * The row's middle: either the list's configured cells, or the named slots.\n *\n * Split out because the branch is the only conditional shape the card has, and\n * inlined it pushed `BaseListCard` past both the line and the complexity gate.\n */\nfunction RowContent({\n card,\n cells,\n configured,\n slot,\n actionable,\n meta,\n opens,\n}: {\n card: BaseListCardProps;\n cells: readonly ListCardCellConfig<never>[] | null;\n configured: boolean;\n slot: (name: string) => string | undefined;\n actionable: boolean;\n meta: { columns: number; present: boolean };\n /** Whether the row ends in the \"this opens\" chevron. */\n opens: boolean;\n}): React.JSX.Element {\n if (configured && cells != null) {\n return (\n <>\n {/* The list's columns, rendered from this row. */}\n <ListCardCells cells={cells} row={card.row as never} />\n {/* THE MENU IS NOT PART OF THE CONFIG and never optional: it is where a\n * row's actions live, and a list that folded it into a cell would have\n * nowhere left to put them. So it brackets the cells on its own rail,\n * exactly as the gutters do at the other end. */}\n <ListCardActions\n actions={actionable ? card.actions : undefined}\n alwaysVisible={card.actionsAlwaysVisible}\n menu={card.menu}\n opens={opens}\n testId={slot}\n />\n </>\n );\n }\n return (\n <>\n <ListCardCaption\n title={card.title}\n subtitle={card.subtitle}\n href={card.href}\n target={card.target}\n testId={slot(\"title\")}\n />\n <ListCardMeta meta={card.meta} metaSlot={card.metaSlot} trailingRule={card.value != null} />\n <ListCardTail\n value={card.value}\n separated={meta.present}\n actions={actionable ? card.actions : undefined}\n actionsAlwaysVisible={card.actionsAlwaysVisible}\n menu={card.menu}\n opens={opens}\n testId={slot}\n />\n </>\n );\n}\n\n/**\n * The revealed body, and the rule that separates it from the summary.\n *\n * `gridColumn: 1 / -1` so it spans every rail: the summary's columns are the\n * LIST's, and nothing about them should constrain a detail area whose design\n * belongs to the consumer.\n *\n * Collapse rather than an unmount, so the body animates open and keeps its own\n * state between peeks — a consumer putting a form or a scrolled table in here\n * would otherwise have it reset on every toggle. `unmountOnExit` is deliberately\n * NOT set: fifty closed rows pay for fifty hidden subtrees, which is the trade\n * taken because the alternative re-runs every consumer's effects per toggle.\n */\nfunction ExpandableBody({\n disclosure,\n padY,\n pad,\n children,\n}: {\n disclosure: { expandable: boolean; expanded: boolean; regionId: string };\n padY: number;\n pad: number;\n children: ReactNode;\n}): React.JSX.Element {\n if (!disclosure.expandable) return <></>;\n return (\n <Box sx={{ gridColumn: \"1 / -1\", minWidth: 0 }}>\n <Collapse in={disclosure.expanded} timeout={150}>\n <Box\n id={disclosure.regionId}\n role=\"region\"\n sx={{\n minWidth: 0,\n // `padY`, not a fraction of the horizontal padding. The card's own\n // `py` wraps the summary AND the body, so once the body is in flow\n // the summary has no bottom padding of its own — at `comfortable`\n // the row visibly lost the height it had while closed.\n mt: padY,\n pt: padY,\n // A RULE BETWEEN SUMMARY AND BODY, bled through the row's horizontal\n // padding so it spans the card edge to edge. Inset, it reads as a\n // border around the content rather than a division of the card.\n borderTop: 1,\n borderColor: \"divider\",\n mx: -pad,\n px: pad,\n }}\n >\n {children}\n </Box>\n </Collapse>\n </Box>\n );\n}\n\nexport function BaseListCard(props: BaseListCardProps): React.JSX.Element {\n const { selected = false, onClick } = props;\n const shell = useRowShell(props);\n const { actionable, selectable, slot, drag, reserve, pad, padY, acts } = shell;\n const meta = metaShape(props);\n const disclosure = useDisclosure(props);\n const { cells, configured, cellTemplate, opens, stack } = useRowLayout(props, shell, disclosure.expandable);\n\n return (\n <StandaloneContainer inGroup={shell.group != null}>\n <Card\n variant=\"outlined\"\n className={props.className}\n dataTestId={props.testId}\n aria-label={props[\"aria-label\"]}\n aria-disabled={actionable ? undefined : true}\n onContextMenu={props.onContextMenu}\n {...(acts ? actionProps(onClick) : {})}\n {...drag.itemProps}\n // A PLAIN OBJECT: `Card` merges by spreading, so a function sx vanishes.\n sx={rowStyles(props, shell, cellTemplate, stack)}\n >\n {drag.dropEdge != null && <DropIndicator edge={drag.dropEdge} />}\n <DiscloseSlot\n expandable={disclosure.expandable}\n expanded={disclosure.expanded}\n reserve={reserve}\n onToggle={disclosure.toggle}\n controls={disclosure.regionId}\n testId={slot(\"disclose\")}\n />\n <DragSlot drag={drag} reserve={reserve} testId={slot(\"drag\")} />\n <SelectSlot\n selectable={selectable}\n selected={selected}\n reserve={reserve}\n onToggleSelect={props.onToggleSelect}\n testId={slot(\"checkbox\")}\n />\n <Box data-slot=\"leading\" sx={{ display: \"flex\", alignItems: \"center\" }}>\n {props.leading}\n </Box>\n <RowContent\n card={props}\n cells={cells}\n configured={configured}\n slot={slot}\n actionable={actionable}\n meta={meta}\n opens={opens}\n />\n <ExpandableBody disclosure={disclosure} padY={padY} pad={pad}>\n {props.children}\n </ExpandableBody>\n </Card>\n </StandaloneContainer>\n );\n}\n\nexport { META_BREAK, STACK_BREAK } from \"./base-list-card-slots\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,cAAc;AAoLf,mBAEE,KAFF;AApBN,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASsB;AACpB,MAAI,cAAc,SAAS,MAAM;AAC/B,WACE,iCAEE;AAAA,0BAAC,iBAAc,OAAc,KAAK,KAAK,KAAc;AAAA,MAKrD;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,aAAa,KAAK,UAAU;AAAA,UACrC,eAAe,KAAK;AAAA,UACpB,MAAM,KAAK;AAAA,UACX;AAAA,UACA,QAAQ;AAAA;AAAA,MACV;AAAA,OACF;AAAA,EAEJ;AACA,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,KAAK;AAAA,QACZ,UAAU,KAAK;AAAA,QACf,MAAM,KAAK;AAAA,QACX,QAAQ,KAAK;AAAA,QACb,QAAQ,KAAK,OAAO;AAAA;AAAA,IACtB;AAAA,IACA,oBAAC,gBAAa,MAAM,KAAK,MAAM,UAAU,KAAK,UAAU,cAAc,KAAK,SAAS,MAAM;AAAA,IAC1F;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK;AAAA,QAChB,SAAS,aAAa,KAAK,UAAU;AAAA,QACrC,sBAAsB,KAAK;AAAA,QAC3B,MAAM,KAAK;AAAA,QACX;AAAA,QACA,QAAQ;AAAA;AAAA,IACV;AAAA,KACF;AAEJ;AAeA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKsB;AACpB,MAAI,CAAC,WAAW,WAAY,QAAO,gCAAE;AACrC,SACE,oBAACA,UAAA,EAAI,IAAI,EAAE,YAAY,UAAU,UAAU,EAAE,GAC3C,8BAAC,YAAS,IAAI,WAAW,UAAU,SAAS,KAC1C;AAAA,IAACA;AAAA,IAAA;AAAA,MACC,IAAI,WAAW;AAAA,MACf,MAAK;AAAA,MACL,IAAI;AAAA,QACF,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,QAKV,IAAI;AAAA,QACJ,IAAI;AAAA;AAAA;AAAA;AAAA,QAIJ,WAAW;AAAA,QACX,aAAa;AAAA,QACb,IAAI,CAAC;AAAA,QACL,IAAI;AAAA,MACN;AAAA,MAEC;AAAA;AAAA,EACH,GACF,GACF;AAEJ;AAEO,SAAS,aAAa,OAA6C;AACxE,QAAM,EAAE,WAAW,OAAO,QAAQ,IAAI;AACtC,QAAM,QAAQ,YAAY,KAAK;AAC/B,QAAM,EAAE,YAAY,YAAY,MAAM,MAAM,SAAS,KAAK,MAAM,KAAK,IAAI;AACzE,QAAM,OAAO,UAAU,KAAK;AAC5B,QAAM,aAAa,cAAc,KAAK;AACtC,QAAM,EAAE,OAAO,YAAY,cAAc,OAAO,MAAM,IAAI,aAAa,OAAO,OAAO,WAAW,UAAU;AAE1G,SACE,oBAAC,uBAAoB,SAAS,MAAM,SAAS,MAC3C;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAW,MAAM;AAAA,MACjB,YAAY,MAAM;AAAA,MAClB,cAAY,MAAM,YAAY;AAAA,MAC9B,iBAAe,aAAa,SAAY;AAAA,MACxC,eAAe,MAAM;AAAA,MACpB,GAAI,OAAO,YAAY,OAAO,IAAI,CAAC;AAAA,MACnC,GAAG,KAAK;AAAA,MAET,IAAI,UAAU,OAAO,OAAO,cAAc,KAAK;AAAA,MAE9C;AAAA,aAAK,YAAY,QAAQ,oBAAC,iBAAc,MAAM,KAAK,UAAU;AAAA,QAC9D;AAAA,UAAC;AAAA;AAAA,YACC,YAAY,WAAW;AAAA,YACvB,UAAU,WAAW;AAAA,YACrB;AAAA,YACA,UAAU,WAAW;AAAA,YACrB,UAAU,WAAW;AAAA,YACrB,QAAQ,KAAK,UAAU;AAAA;AAAA,QACzB;AAAA,QACA,oBAAC,YAAS,MAAY,SAAkB,QAAQ,KAAK,MAAM,GAAG;AAAA,QAC9D;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,gBAAgB,MAAM;AAAA,YACtB,QAAQ,KAAK,UAAU;AAAA;AAAA,QACzB;AAAA,QACA,oBAACA,UAAA,EAAI,aAAU,WAAU,IAAI,EAAE,SAAS,QAAQ,YAAY,SAAS,GAClE,gBAAM,SACT;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QACA,oBAAC,kBAAe,YAAwB,MAAY,KACjD,gBAAM,UACT;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":["default"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GridShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NTJUAPJM.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsState
|
|
6
6
|
} from "./chunk-2W2MWEP2.js";
|
|
@@ -27,4 +27,4 @@ function DataViewsGrid(props) {
|
|
|
27
27
|
export {
|
|
28
28
|
DataViewsGrid
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-6QBT5TPS.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveAxisConfig,
|
|
3
|
+
resolveBarGeometry
|
|
4
|
+
} from "./chunk-SOHQPPYJ.js";
|
|
1
5
|
import {
|
|
2
6
|
getAxisStyles,
|
|
3
7
|
getDefaultColors,
|
|
4
8
|
getSizeStyles,
|
|
5
9
|
resolveSeries
|
|
6
10
|
} from "./chunk-FIMSPRKX.js";
|
|
7
|
-
import {
|
|
8
|
-
resolveAxisConfig,
|
|
9
|
-
resolveBarGeometry
|
|
10
|
-
} from "./chunk-SOHQPPYJ.js";
|
|
11
11
|
import {
|
|
12
12
|
remPx
|
|
13
13
|
} from "./chunk-YKCAJ2TN.js";
|
|
@@ -63,4 +63,4 @@ function marginPx(theme, margin) {
|
|
|
63
63
|
export {
|
|
64
64
|
buildChartContext
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-7CWZI6MQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderChartByType
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UEU5NSIG.js";
|
|
4
4
|
import {
|
|
5
5
|
ChartContainer
|
|
6
6
|
} from "./chunk-RIRTW5EU.js";
|
|
@@ -111,4 +111,4 @@ var Chart = (props) => {
|
|
|
111
111
|
export {
|
|
112
112
|
Chart
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-AQI3UK6P.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GridToolbar
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PQ7RWH7L.js";
|
|
4
4
|
|
|
5
5
|
// src/components/data-display/DataViews/data-views-shell-toolbar.tsx
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -11,6 +11,7 @@ function ShellToolbar({
|
|
|
11
11
|
rowActions,
|
|
12
12
|
bulkActions,
|
|
13
13
|
selectionExtra,
|
|
14
|
+
allOnPageSelected,
|
|
14
15
|
toolbarRightSlot,
|
|
15
16
|
showInline,
|
|
16
17
|
compactControls,
|
|
@@ -44,6 +45,7 @@ function ShellToolbar({
|
|
|
44
45
|
rowActions,
|
|
45
46
|
bulkActions,
|
|
46
47
|
selectionExtra,
|
|
48
|
+
allOnPageSelected,
|
|
47
49
|
sortFields: c.resolvedSortFields,
|
|
48
50
|
activeSortField: c.activeSortField,
|
|
49
51
|
activeSortOrder: c.activeSortOrder,
|
|
@@ -64,4 +66,4 @@ function ShellToolbar({
|
|
|
64
66
|
export {
|
|
65
67
|
ShellToolbar
|
|
66
68
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-ARJIKW56.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-shell-toolbar.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * The toolbar band, fed from the controller — ~25 props of pure forwarding and\n * nothing else, which is why it lives in its own file rather than in the shell.\n */\nimport { type ColumnVisibilityOption } from \"../../layout/ContentToolbar\";\n\nimport type { DisplayPanelView } from \"./data-views-display-panel\";\nimport type { DataViewExport } from \"./data-views-export\";\nimport { GridToolbar } from \"./data-views-toolbar\";\nimport type { RowAction } from \"./data-views-types\";\nimport type { DataViewsController } from \"./use-data-views-state\";\n\n/**\n * The toolbar band, fed from the controller. Split out of `GridShell` for that\n * function's size budget — it is ~25 props of pure forwarding and nothing else.\n */\nexport function ShellToolbar<T extends Record<string, unknown>>({\n c,\n rows,\n testIdPrefix,\n rowActions,\n bulkActions,\n selectionExtra,\n allOnPageSelected,\n toolbarRightSlot,\n showInline,\n compactControls,\n counterHidden,\n sortKinds,\n displayView,\n exportConfig,\n filterControls,\n barRef,\n}: {\n c: DataViewsController<T>;\n rows: T[];\n testIdPrefix: string;\n sortKinds?: Record<string, string>;\n displayView?: DisplayPanelView;\n exportConfig?: DataViewExport;\n rowActions?: RowAction<T>[];\n bulkActions?: (selectedRows: T[], clearSelection: () => void) => React.ReactNode;\n /** Already resolved by the shell, which is the party that knows the page. */\n selectionExtra?: React.ReactNode;\n /** Every row on the page is ticked: the select-all box reads checked, else partial. */\n allOnPageSelected?: boolean;\n toolbarRightSlot?: React.ReactNode;\n /** Search + filters, rendered on the toolbar line (see `GridToolbar`). */\n filterControls?: React.ReactNode;\n barRef?: React.Ref<HTMLDivElement>;\n showInline: boolean;\n /** Step 2 of the ladder: Exibir/Exportar as icons only. */\n compactControls?: boolean;\n /** Step 5, last resort: drop the counter so the row still fits one line. */\n counterHidden?: boolean;\n}): React.JSX.Element {\n const columnOptions: ColumnVisibilityOption[] = c.hideableColumns.map((col) => ({\n id: col.id,\n label: col.label,\n visible: c.state.visibleColumns.includes(col.id),\n }));\n return (\n <GridToolbar\n c={c}\n sortKinds={sortKinds}\n displayView={displayView}\n exportConfig={exportConfig}\n filterControls={filterControls}\n barRef={barRef}\n compactControls={compactControls}\n counterHidden={counterHidden}\n testIdPrefix={testIdPrefix}\n selectedRows={c.selectedRows}\n selectAll={c.selectAll}\n clearSelection={c.clearSelection}\n rowActions={rowActions}\n bulkActions={bulkActions}\n selectionExtra={selectionExtra}\n allOnPageSelected={allOnPageSelected}\n sortFields={c.resolvedSortFields}\n activeSortField={c.activeSortField}\n activeSortOrder={c.activeSortOrder}\n onChangeSort={(field, order) => c.patch({ sortBy: [{ id: field, dir: order }] })}\n matchedCount={c.matched.length}\n totalCount={c.serverMode ? c.serverTotalCount : rows.length}\n toolbarRightSlot={toolbarRightSlot}\n columnOptions={columnOptions}\n onToggleColumn={c.toggleColumn}\n filterOpen={c.filterOpen}\n setFilterOpen={c.setFilterOpen}\n activeFilterCount={c.activeFilterCount}\n showFilterTrigger={!showInline}\n />\n );\n}\n\n/** Wires the controller into the shared toolbar + filter panel + grid/cards body. */\n"],"mappings":";;;;;AAgEI;AA9CG,SAAS,aAAgD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAsBsB;AACpB,QAAM,gBAA0C,EAAE,gBAAgB,IAAI,CAAC,SAAS;AAAA,IAC9E,IAAI,IAAI;AAAA,IACR,OAAO,IAAI;AAAA,IACX,SAAS,EAAE,MAAM,eAAe,SAAS,IAAI,EAAE;AAAA,EACjD,EAAE;AACF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc,EAAE;AAAA,MAChB,WAAW,EAAE;AAAA,MACb,gBAAgB,EAAE;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,EAAE;AAAA,MACd,iBAAiB,EAAE;AAAA,MACnB,iBAAiB,EAAE;AAAA,MACnB,cAAc,CAAC,OAAO,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,OAAO,KAAK,MAAM,CAAC,EAAE,CAAC;AAAA,MAC/E,cAAc,EAAE,QAAQ;AAAA,MACxB,YAAY,EAAE,aAAa,EAAE,mBAAmB,KAAK;AAAA,MACrD;AAAA,MACA;AAAA,MACA,gBAAgB,EAAE;AAAA,MAClB,YAAY,EAAE;AAAA,MACd,eAAe,EAAE;AAAA,MACjB,mBAAmB,EAAE;AAAA,MACrB,mBAAmB,CAAC;AAAA;AAAA,EACtB;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Chart
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AQI3UK6P.js";
|
|
4
4
|
import {
|
|
5
5
|
CHART_SEMANTIC_COLORS,
|
|
6
6
|
specToChartProps
|
|
@@ -46,4 +46,4 @@ var SpecChart = ({
|
|
|
46
46
|
export {
|
|
47
47
|
SpecChart
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-DZIRCD2W.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RailCreateMenu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IL4FCC54.js";
|
|
4
4
|
import {
|
|
5
5
|
Box,
|
|
6
6
|
CONTROL_RESET,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
controlProps,
|
|
11
11
|
destinationControl,
|
|
12
12
|
focusRing
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GK7JNSMK.js";
|
|
14
14
|
import {
|
|
15
15
|
destinationState,
|
|
16
16
|
isMenu
|
|
@@ -245,4 +245,4 @@ function SectionNavRail({
|
|
|
245
245
|
export {
|
|
246
246
|
SectionNavRail
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-EDBP62WG.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RangePresets
|
|
3
3
|
} from "./chunk-7D7CJRL7.js";
|
|
4
|
+
import {
|
|
5
|
+
presetsFor
|
|
6
|
+
} from "./chunk-CBOB5AV6.js";
|
|
4
7
|
import {
|
|
5
8
|
NumberBoundInput
|
|
6
9
|
} from "./chunk-FJ3UZ4RC.js";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
numericRange,
|
|
11
14
|
rangeChipLabel
|
|
12
15
|
} from "./chunk-GCZJH4XL.js";
|
|
13
|
-
import {
|
|
14
|
-
presetsFor
|
|
15
|
-
} from "./chunk-CBOB5AV6.js";
|
|
16
16
|
import {
|
|
17
17
|
useDataViewsCopy
|
|
18
18
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -291,4 +291,4 @@ export {
|
|
|
291
291
|
RangePill,
|
|
292
292
|
PanelRangeField
|
|
293
293
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-EWIKSTJV.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataGridEmpty,
|
|
3
|
+
DataGridError,
|
|
4
|
+
DataGridLoading
|
|
5
|
+
} from "./chunk-EARWC6PD.js";
|
|
1
6
|
import {
|
|
2
7
|
useDataGridModel
|
|
3
8
|
} from "./chunk-LDROG4QI.js";
|
|
@@ -5,11 +10,6 @@ import {
|
|
|
5
10
|
GridBody,
|
|
6
11
|
GridHeader
|
|
7
12
|
} from "./chunk-ZFXTRPQO.js";
|
|
8
|
-
import {
|
|
9
|
-
DataGridEmpty,
|
|
10
|
-
DataGridError,
|
|
11
|
-
DataGridLoading
|
|
12
|
-
} from "./chunk-EARWC6PD.js";
|
|
13
13
|
|
|
14
14
|
// src/components/data-display/DataGrid/DataGrid.tsx
|
|
15
15
|
import Paper from "@mui/material/Paper/index.js";
|
|
@@ -120,4 +120,4 @@ export {
|
|
|
120
120
|
DataGrid,
|
|
121
121
|
GRID_ONLY_PROPS
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-FXZUVZON.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/components/data-display/DataViews/data-views-url-echo.ts
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
function bounds(range) {
|
|
4
|
+
const set = (value) => value !== void 0 && value !== "";
|
|
5
|
+
const kept = {
|
|
6
|
+
...set(range.min) ? { min: range.min } : {},
|
|
7
|
+
...set(range.max) ? { max: range.max } : {}
|
|
8
|
+
};
|
|
9
|
+
return Object.keys(kept).length > 0 ? kept : null;
|
|
10
|
+
}
|
|
11
|
+
var byKey = ([a], [b]) => a.localeCompare(b);
|
|
12
|
+
function urlSliceKey(slice) {
|
|
13
|
+
const pills = Object.entries(slice.pills ?? {}).filter(([, values]) => values.length > 0).sort(byKey);
|
|
14
|
+
const ranges = Object.entries(slice.ranges ?? {}).map(([id, range]) => [id, bounds(range)]).filter(([, range]) => range !== null).sort(byKey);
|
|
15
|
+
return JSON.stringify({
|
|
16
|
+
q: slice.search ?? "",
|
|
17
|
+
pills,
|
|
18
|
+
ranges,
|
|
19
|
+
sort: slice.sortBy ?? [],
|
|
20
|
+
scope: slice.scope ?? null
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
var MAX_PENDING = 20;
|
|
24
|
+
function useUrlEchoGuard(server) {
|
|
25
|
+
const pending = useRef([]);
|
|
26
|
+
const recorded = server && {
|
|
27
|
+
...server,
|
|
28
|
+
onQueryChange: (query) => {
|
|
29
|
+
pending.current = [...pending.current, urlSliceKey(query)].slice(-MAX_PENDING);
|
|
30
|
+
server.onQueryChange(query);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const consumeEcho = (slice) => {
|
|
34
|
+
const at = pending.current.lastIndexOf(urlSliceKey(slice));
|
|
35
|
+
pending.current = at === -1 ? [] : pending.current.slice(at + 1);
|
|
36
|
+
return at !== -1;
|
|
37
|
+
};
|
|
38
|
+
return { server: recorded, consumeEcho };
|
|
39
|
+
}
|
|
40
|
+
function syncFrom(serverMode, initialState) {
|
|
41
|
+
if (!serverMode || !initialState) return void 0;
|
|
42
|
+
return {
|
|
43
|
+
search: initialState.search,
|
|
44
|
+
pills: initialState.pills,
|
|
45
|
+
ranges: initialState.ranges,
|
|
46
|
+
sortBy: initialState.sortBy,
|
|
47
|
+
// The scope belongs in the URL-driven slice alongside them: a
|
|
48
|
+
// `?view=recusados`-style deep link and browser back/forward must move the
|
|
49
|
+
// tab strip, and they must do it WITHOUT resetting the user's hidden
|
|
50
|
+
// columns — which is the whole reason this is a merging `syncState` and
|
|
51
|
+
// not a replacing `appliedState`.
|
|
52
|
+
scope: initialState.scope
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function useUrlSyncState(server, initialState, consumeEcho) {
|
|
56
|
+
const serverMode = server !== void 0;
|
|
57
|
+
const [syncState, setSyncState] = useState(() => syncFrom(serverMode, initialState));
|
|
58
|
+
const seen = useRef({ serverMode, initialState });
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const last = seen.current;
|
|
61
|
+
if (last.serverMode === serverMode && last.initialState === initialState) return;
|
|
62
|
+
seen.current = { serverMode, initialState };
|
|
63
|
+
const next = syncFrom(serverMode, initialState);
|
|
64
|
+
if (next && consumeEcho(next)) return;
|
|
65
|
+
setSyncState(next);
|
|
66
|
+
}, [serverMode, initialState]);
|
|
67
|
+
return syncState;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
urlSliceKey,
|
|
72
|
+
useUrlEchoGuard,
|
|
73
|
+
useUrlSyncState
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=chunk-G6EJLEVV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-url-echo.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { RangeValue } from \"./data-views-range-types\";\nimport type { DataViewServer, DataViewState, DataViewSyncState } from \"./data-views-types\";\n\n/**\n * A server-mode grid's URL round trip, and the echo it must not re-apply.\n *\n * A server-mode host mirrors the grid's query into its URL and hands it back as\n * `initialState`, which the base turns into `syncState` and MERGES over the live\n * state, so browser back/forward moves the controls. But the browser shows the\n * new URL before React renders it. An edit made in that window, such as\n * clearing a date bound right after typing it, is overwritten when the render\n * carrying the PREVIOUS query lands. The grid then re-emits that stale query,\n * and the cleared filter comes back and sticks in the URL (FUT-3182, the\n * audit trail's \"De\" bound).\n *\n * So the base records every query it emits. An `initialState` matching one\n * still pending is the host echoing it back, not a navigation, and it is not\n * merged. Anything else (back/forward, a deep link, a host-side reset) still is.\n * A host whose round trip changes the slice's shape never matches, and keeps\n * the old behaviour rather than losing a navigation.\n */\n\n/** The URL-carried part of a grid state or query. */\ntype UrlSlice = Pick<DataViewState, \"search\" | \"pills\" | \"ranges\" | \"sortBy\" | \"scope\">;\n\n/** Hosts drop unset bounds on the way through the URL, so the key drops them too. */\nfunction bounds(range: RangeValue): RangeValue | null {\n const set = (value: number | string | undefined): boolean => value !== undefined && value !== \"\";\n const kept: RangeValue = {\n ...(set(range.min) ? { min: range.min } : {}),\n ...(set(range.max) ? { max: range.max } : {}),\n };\n return Object.keys(kept).length > 0 ? kept : null;\n}\n\nconst byKey = ([a]: [string, unknown], [b]: [string, unknown]): number => a.localeCompare(b);\n\n/** One comparable string for a URL slice: empty pills and unbounded ranges left out. */\nexport function urlSliceKey(slice: UrlSlice): string {\n const pills = Object.entries(slice.pills ?? {})\n .filter(([, values]) => values.length > 0)\n .sort(byKey);\n const ranges = Object.entries(slice.ranges ?? {})\n .map(([id, range]): [string, RangeValue | null] => [id, bounds(range)])\n .filter(([, range]) => range !== null)\n .sort(byKey);\n return JSON.stringify({\n q: slice.search ?? \"\",\n pills,\n ranges,\n sort: slice.sortBy ?? [],\n scope: slice.scope ?? null,\n });\n}\n\n/** Enough to cover a burst of edits; older entries can no longer echo. */\nconst MAX_PENDING = 20;\n\n/**\n * Record what the grid emits, and recognise it coming back.\n *\n * `consumeEcho` answers whether a URL slice is one of the queries still in\n * flight. A match drops it and every older one, since the host has caught up to\n * at least that far; a miss is a navigation and clears the list.\n */\nexport function useUrlEchoGuard(server: DataViewServer | undefined): {\n server: DataViewServer | undefined;\n consumeEcho: (slice: UrlSlice) => boolean;\n} {\n const pending = useRef<string[]>([]);\n const recorded: DataViewServer | undefined = server && {\n ...server,\n onQueryChange: (query) => {\n pending.current = [...pending.current, urlSliceKey(query)].slice(-MAX_PENDING);\n server.onQueryChange(query);\n },\n };\n const consumeEcho = (slice: UrlSlice): boolean => {\n const at = pending.current.lastIndexOf(urlSliceKey(slice));\n pending.current = at === -1 ? [] : pending.current.slice(at + 1);\n return at !== -1;\n };\n return { server: recorded, consumeEcho };\n}\n\nfunction syncFrom(serverMode: boolean, initialState: DataViewState | undefined): DataViewSyncState | undefined {\n if (!serverMode || !initialState) return undefined;\n return {\n search: initialState.search,\n pills: initialState.pills,\n ranges: initialState.ranges,\n sortBy: initialState.sortBy,\n // The scope belongs in the URL-driven slice alongside them: a\n // `?view=recusados`-style deep link and browser back/forward must move the\n // tab strip, and they must do it WITHOUT resetting the user's hidden\n // columns — which is the whole reason this is a merging `syncState` and\n // not a replacing `appliedState`.\n scope: initialState.scope,\n };\n}\n\n/**\n * Derive the grid's reactive `syncState` from the URL-seeded `initialState` in\n * server mode, so browser back/forward RE-APPLIES the search/pills/sort controls\n * (merging over live state, preserving hidden columns — see\n * {@link DataViewSyncState}). Client-mode tables (no `server`) get `undefined`.\n *\n * Seeded on the first render, so a deep link shows on mount. After that a new\n * `initialState` reference is re-applied unless it is the grid's own query\n * coming back (`consumeEcho`), which would overwrite an edit made since.\n */\nexport function useUrlSyncState(\n server: DataViewServer | undefined,\n initialState: DataViewState | undefined,\n consumeEcho: (slice: UrlSlice) => boolean,\n): DataViewSyncState | undefined {\n const serverMode = server !== undefined;\n const [syncState, setSyncState] = useState(() => syncFrom(serverMode, initialState));\n const seen = useRef({ serverMode, initialState });\n useEffect(() => {\n const last = seen.current;\n if (last.serverMode === serverMode && last.initialState === initialState) return;\n seen.current = { serverMode, initialState };\n const next = syncFrom(serverMode, initialState);\n if (next && consumeEcho(next)) return;\n setSyncState(next);\n // `consumeEcho` reads a ref; only a new URL seed or a mode change re-runs this.\n }, [serverMode, initialState]);\n return syncState;\n}\n"],"mappings":";AAEA,SAAS,WAAW,QAAQ,gBAAgB;AA4B5C,SAAS,OAAO,OAAsC;AACpD,QAAM,MAAM,CAAC,UAAgD,UAAU,UAAa,UAAU;AAC9F,QAAM,OAAmB;AAAA,IACvB,GAAI,IAAI,MAAM,GAAG,IAAI,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;AAAA,IAC3C,GAAI,IAAI,MAAM,GAAG,IAAI,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;AAAA,EAC7C;AACA,SAAO,OAAO,KAAK,IAAI,EAAE,SAAS,IAAI,OAAO;AAC/C;AAEA,IAAM,QAAQ,CAAC,CAAC,CAAC,GAAsB,CAAC,CAAC,MAAiC,EAAE,cAAc,CAAC;AAGpF,SAAS,YAAY,OAAyB;AACnD,QAAM,QAAQ,OAAO,QAAQ,MAAM,SAAS,CAAC,CAAC,EAC3C,OAAO,CAAC,CAAC,EAAE,MAAM,MAAM,OAAO,SAAS,CAAC,EACxC,KAAK,KAAK;AACb,QAAM,SAAS,OAAO,QAAQ,MAAM,UAAU,CAAC,CAAC,EAC7C,IAAI,CAAC,CAAC,IAAI,KAAK,MAAmC,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,EACrE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,IAAI,EACpC,KAAK,KAAK;AACb,SAAO,KAAK,UAAU;AAAA,IACpB,GAAG,MAAM,UAAU;AAAA,IACnB;AAAA,IACA;AAAA,IACA,MAAM,MAAM,UAAU,CAAC;AAAA,IACvB,OAAO,MAAM,SAAS;AAAA,EACxB,CAAC;AACH;AAGA,IAAM,cAAc;AASb,SAAS,gBAAgB,QAG9B;AACA,QAAM,UAAU,OAAiB,CAAC,CAAC;AACnC,QAAM,WAAuC,UAAU;AAAA,IACrD,GAAG;AAAA,IACH,eAAe,CAAC,UAAU;AACxB,cAAQ,UAAU,CAAC,GAAG,QAAQ,SAAS,YAAY,KAAK,CAAC,EAAE,MAAM,CAAC,WAAW;AAC7E,aAAO,cAAc,KAAK;AAAA,IAC5B;AAAA,EACF;AACA,QAAM,cAAc,CAAC,UAA6B;AAChD,UAAM,KAAK,QAAQ,QAAQ,YAAY,YAAY,KAAK,CAAC;AACzD,YAAQ,UAAU,OAAO,KAAK,CAAC,IAAI,QAAQ,QAAQ,MAAM,KAAK,CAAC;AAC/D,WAAO,OAAO;AAAA,EAChB;AACA,SAAO,EAAE,QAAQ,UAAU,YAAY;AACzC;AAEA,SAAS,SAAS,YAAqB,cAAwE;AAC7G,MAAI,CAAC,cAAc,CAAC,aAAc,QAAO;AACzC,SAAO;AAAA,IACL,QAAQ,aAAa;AAAA,IACrB,OAAO,aAAa;AAAA,IACpB,QAAQ,aAAa;AAAA,IACrB,QAAQ,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMrB,OAAO,aAAa;AAAA,EACtB;AACF;AAYO,SAAS,gBACd,QACA,cACA,aAC+B;AAC/B,QAAM,aAAa,WAAW;AAC9B,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,MAAM,SAAS,YAAY,YAAY,CAAC;AACnF,QAAM,OAAO,OAAO,EAAE,YAAY,aAAa,CAAC;AAChD,YAAU,MAAM;AACd,UAAM,OAAO,KAAK;AAClB,QAAI,KAAK,eAAe,cAAc,KAAK,iBAAiB,aAAc;AAC1E,SAAK,UAAU,EAAE,YAAY,aAAa;AAC1C,UAAM,OAAO,SAAS,YAAY,YAAY;AAC9C,QAAI,QAAQ,YAAY,IAAI,EAAG;AAC/B,iBAAa,IAAI;AAAA,EAEnB,GAAG,CAAC,YAAY,YAAY,CAAC;AAC7B,SAAO;AACT;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-P3GBXE73.js";
|
|
4
4
|
import {
|
|
5
5
|
Badge
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PC4H5LVB.js";
|
|
7
7
|
import {
|
|
8
8
|
rem
|
|
9
9
|
} from "./chunk-YKCAJ2TN.js";
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
SlotIcon,
|
|
100
100
|
CONTROL_RESET
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-GK7JNSMK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MoreGroup,
|
|
3
3
|
fieldClearing
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4QKS5Y35.js";
|
|
5
5
|
import {
|
|
6
6
|
useDataViewsCopy
|
|
7
7
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -184,4 +184,4 @@ function MoreFilters({
|
|
|
184
184
|
export {
|
|
185
185
|
MoreFilters
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-HCYRCU4W.js.map
|