@12-apps/ui 6.13.0 → 6.13.1
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/DataViews/DataViewsGrid.js +12 -12
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +14 -14
- package/dist/_internal/components/data-display/DataViews/base-card.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +5 -5
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +3 -3
- 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 +10 -10
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-types.js +1 -1
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +3 -3
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +2 -2
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/{chunk-QRKBBOSY.js → chunk-4KSOSI3U.js} +4 -4
- package/dist/{chunk-WXHJG2UU.js → chunk-6U7NA74A.js} +2 -2
- package/dist/{chunk-FZHKKLOO.js → chunk-AWTERXCW.js} +2 -2
- package/dist/{chunk-TOUSE63W.js → chunk-BV5XTGKB.js} +3 -3
- package/dist/chunk-BV5XTGKB.js.map +1 -0
- package/dist/{chunk-YQJMVUBG.js → chunk-CZPU5TW3.js} +2 -2
- package/dist/{chunk-BMAOQDVY.js → chunk-DEOC5OI7.js} +3 -3
- package/dist/{chunk-ZQPG57GA.js → chunk-EICVL6GS.js} +2 -2
- package/dist/{chunk-P55UFXYW.js → chunk-HGBZZDP6.js} +2 -2
- package/dist/{chunk-WIEXYVMU.js → chunk-HR7YTBR7.js} +2 -2
- package/dist/{chunk-JHBQZZHT.js → chunk-JKLWHENB.js} +3 -3
- package/dist/{chunk-QEPGWTJT.js → chunk-LHHAYZ55.js} +1 -1
- package/dist/chunk-LHHAYZ55.js.map +1 -0
- package/dist/{chunk-E2H7MBPM.js → chunk-OGGHD64H.js} +2 -2
- package/dist/{chunk-XIYPVNEB.js → chunk-QQE2PVLO.js} +3 -3
- package/dist/{chunk-XYRS4JOF.js → chunk-RDYBS45D.js} +4 -4
- package/dist/{chunk-YRFKPRV2.js → chunk-SCGVB7DS.js} +2 -2
- package/dist/{chunk-W3UM2KEW.js → chunk-T4BFDZGU.js} +7 -6
- package/dist/chunk-T4BFDZGU.js.map +1 -0
- package/dist/{chunk-WKRSVGT6.js → chunk-WXBBWSNU.js} +2 -2
- package/dist/{chunk-ZIPCGZA3.js → chunk-ZPIMPOHV.js} +2 -2
- package/dist/data-display/DataViews.js +18 -18
- 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-types.d.ts +8 -0
- package/dist/types/components/data-display/DataViews/data-views-types.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/use-data-views-state.d.ts +10 -2
- package/dist/types/components/data-display/DataViews/use-data-views-state.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +2 -1
- package/src/components/data-display/DataViews/data-views-types.ts +11 -0
- package/src/components/data-display/DataViews/use-data-views-state.ts +13 -3
- package/dist/chunk-QEPGWTJT.js.map +0 -1
- package/dist/chunk-TOUSE63W.js.map +0 -1
- package/dist/chunk-W3UM2KEW.js.map +0 -1
- /package/dist/{chunk-QRKBBOSY.js.map → chunk-4KSOSI3U.js.map} +0 -0
- /package/dist/{chunk-WXHJG2UU.js.map → chunk-6U7NA74A.js.map} +0 -0
- /package/dist/{chunk-FZHKKLOO.js.map → chunk-AWTERXCW.js.map} +0 -0
- /package/dist/{chunk-YQJMVUBG.js.map → chunk-CZPU5TW3.js.map} +0 -0
- /package/dist/{chunk-BMAOQDVY.js.map → chunk-DEOC5OI7.js.map} +0 -0
- /package/dist/{chunk-ZQPG57GA.js.map → chunk-EICVL6GS.js.map} +0 -0
- /package/dist/{chunk-P55UFXYW.js.map → chunk-HGBZZDP6.js.map} +0 -0
- /package/dist/{chunk-WIEXYVMU.js.map → chunk-HR7YTBR7.js.map} +0 -0
- /package/dist/{chunk-JHBQZZHT.js.map → chunk-JKLWHENB.js.map} +0 -0
- /package/dist/{chunk-E2H7MBPM.js.map → chunk-OGGHD64H.js.map} +0 -0
- /package/dist/{chunk-XIYPVNEB.js.map → chunk-QQE2PVLO.js.map} +0 -0
- /package/dist/{chunk-XYRS4JOF.js.map → chunk-RDYBS45D.js.map} +0 -0
- /package/dist/{chunk-YRFKPRV2.js.map → chunk-SCGVB7DS.js.map} +0 -0
- /package/dist/{chunk-WKRSVGT6.js.map → chunk-WXBBWSNU.js.map} +0 -0
- /package/dist/{chunk-ZIPCGZA3.js.map → chunk-ZPIMPOHV.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DisplayTab,
|
|
6
6
|
SortTab
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SCGVB7DS.js";
|
|
8
8
|
import {
|
|
9
9
|
ViewActions,
|
|
10
10
|
ViewFooter,
|
|
@@ -261,4 +261,4 @@ function DataViewsDisplayPanel({
|
|
|
261
261
|
export {
|
|
262
262
|
DataViewsDisplayPanel
|
|
263
263
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-HGBZZDP6.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
coerceViewState,
|
|
6
6
|
emptyViewState
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LHHAYZ55.js";
|
|
8
8
|
import {
|
|
9
9
|
useDataViewsCopy
|
|
10
10
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -96,4 +96,4 @@ function useSavedViewsController(persistence, router, columnIds, views, initialV
|
|
|
96
96
|
export {
|
|
97
97
|
useSavedViewsController
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-HR7YTBR7.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GridShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T4BFDZGU.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BV5XTGKB.js";
|
|
7
7
|
|
|
8
8
|
// src/components/data-display/DataViews/DataViewsGrid.tsx
|
|
9
9
|
import { useEffect, useRef } from "react";
|
|
@@ -27,4 +27,4 @@ function DataViewsGrid(props) {
|
|
|
27
27
|
export {
|
|
28
28
|
DataViewsGrid
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-JKLWHENB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-types.ts"],"sourcesContent":["import type { GridColumn, GridSort } from \"../DataGrid\";\nimport type { DropdownMenuItem } from \"../../navigation/DropdownMenu\";\n// A re-export does not bring the name into local scope, and the state/query\n// types below are written in terms of it.\nimport type { RangeValue } from \"./data-views-range-types\";\n\n/**\n * Shared types for the reusable admin \"DataViews\" table (FUT-88): a filter bar\n * (search-across-all + typed multi-select pills + column visibility) whose full\n * state — filters + sort + visible columns — a saved view (FUT-89) can capture\n * and restore. Each table declares its own columns + filter fields.\n */\n\n/**\n * A single, reusable row action. ONE definition drives BOTH the per-row \"⋮\"\n * kebab menu and the bulk-actions menu (tabwoah model): `onSelect` receives the\n * affected rows — `[row]` from a kebab, the whole selection from the bulk menu.\n * Single-item-only actions (e.g. \"Editar\") set `bulk: false` so they never\n * appear in the bulk menu.\n */\nexport interface RowAction<T extends Record<string, unknown>> {\n /** Stable id (also the `data-testid` suffix). */\n id: string;\n /** Menu label. In the kebab, `rowLabel` overrides it per row when provided. */\n label: string;\n /** Menu-item colour (e.g. `\"error\"` for destructive). */\n color?: DropdownMenuItem[\"color\"];\n /**\n * Runs on the affected rows: `[row]` from the kebab, all selected from bulk.\n * May be async — the bulk menu awaits it and only clears the selection once it\n * settles (keeping the selection on failure so the user can retry).\n */\n onSelect: (rows: T[]) => void | Promise<void>;\n /** Include in the bulk menu (2+ selected). Defaults to `true`. */\n bulk?: boolean;\n /** Include in the per-row kebab. Defaults to `true`. */\n row?: boolean;\n /** Per-row kebab label (e.g. `row.active ? \"Inativar\" : \"Ativar\"`). */\n rowLabel?: (row: T) => string;\n /**\n * Per-row applicability (e.g. state-machine guards). `false` hides the\n * kebab item for that row; in bulk the action runs only on the passing\n * rows and is dropped when none pass. Defaults to applicable.\n */\n isVisible?: (row: T) => boolean;\n}\n\n/** Selection state handed to a card renderer so it can drive its own checkbox. */\nexport interface DataViewCardSelection {\n selected: boolean;\n onToggleSelect: () => void;\n /**\n * Card SIZE multiplier from the toolbar zoom slider. The grid sizes the card's\n * width to `base × scale`; a card passes this to {@link BaseCard} `scale` so its\n * padding + typography grow by the same factor — the whole card scales together\n * (scale 2 → ~2× size). The proportion (aspect ratio) stays constant.\n */\n scale: number;\n}\n\n/**\n * The fixed proportions a {@link BaseCard} tile can take. The tile keeps this\n * ratio and grows in BOTH width and height as the zoom slider widens its grid\n * track, so a grid of cards stays visually uniform.\n */\nexport type CardAspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"9:16\" | \"3:4\" | \"3:1\";\n\n/** Numeric width/height factor for each {@link CardAspectRatio} (CSS `aspect-ratio`). */\nexport const CARD_ASPECT_RATIOS: Record<CardAspectRatio, number> = {\n \"1:1\": 1,\n \"4:3\": 4 / 3,\n \"16:9\": 16 / 9,\n \"9:16\": 9 / 16,\n \"3:4\": 3 / 4,\n /**\n * The BANNER tile: too short for media, sized for two lines of text.\n *\n * Every other ratio here is picture-shaped, because they were added for cards\n * built around a thumbnail. A card whose subject is a NAME and a NUMBER — a\n * cart, an order, anything triaged rather than browsed — spends most of a 4:3\n * tile on an icon that repeats down the whole grid and says nothing.\n */\n \"3:1\": 3,\n};\n\n/** One selectable value inside a filter pill. */\nexport interface FilterOption {\n value: string;\n label: string;\n /**\n * Parent option's `value`, for a hierarchical field (`control: \"category\"`).\n * Ignored by the flat controls, so one option list serves both.\n */\n parentId?: string | null;\n}\n\n/** A typed, multi-select filter pill's configuration for a table. */\nexport interface FilterFieldConfig<T extends Record<string, unknown>> {\n /** Stable id; also the default row key when no `accessor` is given. */\n id: string;\n label: string;\n options: FilterOption[];\n /**\n * How the field renders in the filter panel. `checkboxes` (default) is best for\n * a few fixed options; `multiselect` is a compact dropdown for long option\n * lists; `category` is the hierarchical picker, for an option set that nests\n * via {@link FilterOption.parentId} — it renders parents as headings and\n * their children as the selectable rows, rather than flattening the tree into\n * one indistinguishable list.\n */\n control?: \"checkboxes\" | \"multiselect\" | \"category\";\n /**\n * Lets a `control: \"category\"` pill select a PARENT category, not just its\n * children. Off by default, which keeps the leaf-only reading: the parent is\n * a heading and its subcategories are the rows you tick.\n *\n * Turn it on where \"the whole category\" is a filter a user would reach for —\n * selecting a parent then selects every subcategory under it, and the chip\n * tray collapses that back to one chip bearing the category's name.\n *\n * A category with NO children is selectable either way: it is itself the\n * leaf, so the flag has nothing to gate there.\n */\n allowParentSelection?: boolean;\n /**\n * Forces this filter to render as a searchable multi-select dropdown with the\n * search box always shown, regardless of how many options are currently\n * loaded. Use it when the option set can grow unbounded (e.g. a filter backed\n * by a relation such as Roles or Categories). Omit it for a closed value set\n * (an enum), which keeps the plain checkbox / \"search only when long\"\n * behavior.\n */\n searchEnabled?: boolean;\n /**\n * Reads the row's value(s) for this field. A row matches the pill when any of\n * its values is selected. Defaults to `String(row[id])`.\n */\n accessor?: (row: T) => string | string[];\n}\n\n/**\n * The range types live in `data-views-range-types` (this file outgrew the\n * size gate); they are re-exported here so `data-views-types` stays the one\n * name every consumer imports the model from.\n */\nexport type {\n DayRangeFieldConfig,\n NumberRangeFieldConfig,\n RangeFieldConfig,\n RangeFieldKind,\n RangePreset,\n RangeValue,\n} from \"./data-views-range-types\";\n\n/** A grid column that can join the search scan and the column-visibility menu. */\nexport interface DataViewColumn<T extends Record<string, unknown>> extends GridColumn<T> {\n /** Included in \"search across all columns\" (needs a resolvable value). */\n searchable?: boolean;\n /** Toggleable in the column-visibility menu. Defaults to true; set false for\n * structural columns (image thumbnail, actions kebab) that must always show. */\n hideable?: boolean;\n}\n\n/**\n * The DataViews layout (view type): the dense \"Tabela\" grid, the \"Grade\" of\n * cards, the \"Lista\" of full-width rows, or the \"Quadro\" board of state columns.\n * Lives with the state types rather than with the toggle because a saved view\n * CAPTURES it — see {@link DataViewState.layout}.\n */\nexport type DataViewsLayout = \"cards\" | \"list\" | \"board\" | \"table\";\n\n/** The full, serializable state a view captures. */\n/**\n * A view-state patch: the fields to merge, or an updater given the CURRENT\n * state. Use the updater whenever the patch derives from state it also changes\n * — a render-scoped snapshot would let two calls in one tick read the same\n * `prev` and the second overwrite the first, which is exactly what a control\n * emitting one call per changed value does.\n */\nexport type DataViewStatePatch =\n | Partial<DataViewState>\n | ((prev: DataViewState) => Partial<DataViewState>);\n\nexport interface DataViewState {\n /** Free text matched across every `searchable` column. */\n search: string;\n /** fieldId → selected option values (empty/absent = no constraint). */\n pills: Record<string, string[]>;\n /** fieldId → selected numeric range (min/max). Absent/empty = no constraint. */\n ranges?: Record<string, RangeValue>;\n sortBy: GridSort[];\n /** Column ids kept visible; a hideable column not listed here is hidden. */\n visibleColumns: string[];\n /**\n * Column ids in READING ORDER. Absent ⇒ the order the table declared them in.\n *\n * Order is view state for the same reason visibility is: reordering columns is\n * an operator deciding what to read FIRST, and a saved view that restored the\n * columns but not their order would restore half a decision. Ids the table no\n * longer declares are ignored at render, and ids missing from a stale list\n * fall in after it — so a column added since the view was saved appears rather\n * than disappearing.\n */\n order?: string[];\n /**\n * The active SCOPE id — the page-level partition the scope tabs select (see\n * `ScopeConfig`). Optional, so a table that declares no scopes is untouched\n * and no view persisted before scopes existed breaks.\n *\n * Stored raw and RESOLVED at read time: the declared scopes change underneath\n * a saved view, and a view naming a scope that has since been removed must\n * fall back at render rather than break.\n */\n scope?: string;\n /**\n * The layout the view was saved in. Optional — absent means \"whatever the user\n * is currently using\", which is the pre-existing behaviour.\n *\n * A LAYOUT FALLBACK IS NOT A LAYOUT CHANGE: a table rendered as stacked rows\n * on a phone still has `\"table\"` stored here, so the view round-trips the\n * stored layout regardless of the device that opened it.\n */\n layout?: DataViewsLayout;\n}\n\n/** A pristine view state showing every given column and no filters/sort. */\nexport function emptyViewState(visibleColumns: string[]): DataViewState {\n return { search: \"\", pills: {}, ranges: {}, sortBy: [], visibleColumns };\n}\n\n/**\n * The URL-driven slice of {@link DataViewState} — the controls a server-mode host\n * mirrors from the address bar (search / pills / ranges / sort), WITHOUT\n * `visibleColumns`. Supplying it re-applies those controls when its reference\n * changes (e.g. browser back/forward or a deep-link on the same route), merging\n * over the current state so a user's show/hide column choices are preserved —\n * unlike `appliedState`, which fully replaces the state to apply a saved view.\n */\nexport type DataViewSyncState = Pick<\n DataViewState,\n \"search\" | \"pills\" | \"ranges\" | \"sortBy\" | \"scope\"\n>;\n\n/**\n * The query a SERVER-mode table emits whenever its filter/sort/page changes\n * (FUT-180). The host translates this into a backend request (see\n * `@12-apps/shared-helpers/search`) — in server mode the grid never filters,\n * sorts, or paginates in the browser; it renders exactly the page the server\n * returned. `page` is 1-based to match the backend contract.\n */\nexport interface DataViewQuery {\n search: string;\n pills: Record<string, string[]>;\n ranges: Record<string, RangeValue>;\n sortBy: GridSort[];\n /**\n * The RESOLVED active scope (see `resolveScope`), when the table declares\n * scopes. The KEY IS ABSENT for a table that declares none — not present-and-\n * undefined — so a host that never opted in sees a byte-identical query.\n *\n * It carries the resolved id, never the stored one: a deep link or a saved\n * view naming a scope the table no longer declares must not put that id on the\n * wire, where the backend would reject it and replace the page with an error.\n */\n scope?: string;\n page: number;\n pageSize: number;\n}\n\n/**\n * Server-mode wiring for a DataViews table. Its PRESENCE flips the table from\n * in-browser filtering/sorting/pagination to backend-driven: the rows handed in\n * are already the current page, `totalCount` is the unpaginated total, and\n * `onQueryChange` fires (search debounced by the host) whenever the user changes\n * a filter, the sort, or the page. This is the ONLY way an admin list should run\n * (see the app-side `DataViewsTable` wrapper, which requires it).\n */\nexport interface DataViewServer {\n /** Total matched rows across all pages (drives the counter + page count). */\n totalCount: number;\n /** Current 1-based page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Fired when the effective query changes; the host re-fetches the page. */\n onQueryChange: (query: DataViewQuery) => void;\n /**\n * Per-scope totals for the scope tabs: `scopeId → count`. THE ONLY PIECE OF\n * THIS CONTRACT THAT CANNOT BE DONE CLIENT-SIDE — a count computed from the\n * loaded page is wrong the moment there is a second page, which is the\n * concrete bug scopes exist to fix.\n *\n * Compute it over search + pills + ranges while IGNORING the active scope.\n * Computed WITH the scope applied, every inactive tab reads zero, which is\n * worse than no counts at all.\n *\n * Omit it and the tabs render with no numbers. Nothing is ever invented from\n * the loaded rows to fill the gap.\n */\n scopeCounts?: Record<string, number>;\n}\n\n/**\n * Coerce an opaque persisted state (a saved view's JSON) into a valid\n * DataViewState, filling any missing part with a sane default. Guards against\n * legacy/older shapes so applying a saved view never renders an empty grid.\n */\nexport function coerceViewState(raw: unknown, allColumnIds: string[]): DataViewState {\n const value = (raw ?? {}) as Partial<DataViewState>;\n return {\n search: typeof value.search === \"string\" ? value.search : \"\",\n pills: asRecord<string[]>(value.pills),\n ranges: asRecord<RangeValue>(value.ranges),\n sortBy: Array.isArray(value.sortBy) ? value.sortBy : [],\n visibleColumns: Array.isArray(value.visibleColumns) ? value.visibleColumns : allColumnIds,\n order: Array.isArray(value.order) ? value.order : undefined,\n // Carried through UNVALIDATED against the declared scopes on purpose: a view\n // written before scopes existed has none (⇒ undefined ⇒ the first declared\n // scope at render), and one naming a since-removed scope keeps its stored id\n // here and falls back at READ time. Resolving here would rewrite the view.\n scope: typeof value.scope === \"string\" ? value.scope : undefined,\n layout: isLayout(value.layout) ? value.layout : undefined,\n };\n}\n\n/** Every layout this build knows how to render — the guard's single source. */\nexport const DATA_VIEWS_LAYOUTS: readonly DataViewsLayout[] = [\"cards\", \"list\", \"board\", \"table\"];\n\n/** Is this a layout this build knows how to render? Guards persisted JSON. */\nfunction isLayout(value: unknown): value is DataViewsLayout {\n return DATA_VIEWS_LAYOUTS.includes(value as DataViewsLayout);\n}\n\n/** A persisted map, or an empty one — persisted JSON can hold anything. */\nfunction asRecord<V>(value: unknown): Record<string, V> {\n return value !== null && typeof value === \"object\" ? (value as Record<string, V>) : {};\n}\n\n/** A saved view as consumed by the DataViews UI (FUT-89), with ownership flag. */\nexport interface SavedViewSummary {\n id: string;\n name: string;\n description: string | null;\n state: DataViewState;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n /** True when the current user owns the view (may edit/delete/pin/share it). */\n isOwner: boolean;\n}\n\n/** A saved-view repository record (opaque `state`), as returned to server pages. */\ninterface SavedViewRecordLike {\n id: string;\n name: string;\n description: string | null;\n state: unknown;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n isOwner: boolean;\n}\n\n/** Map a repository record to the client summary (opaque state → DataViewState). */\nexport function toSavedViewSummary(record: SavedViewRecordLike): SavedViewSummary {\n return { ...record, state: (record.state ?? {}) as DataViewState };\n}\n\n/**\n * Dependency-injection contracts for the framework-agnostic DataViewsTableBase:\n * the host app supplies saved-view persistence + router side-effects so the ui\n * component imports neither a backend (server actions) nor a framework router.\n */\n\n/** A saved view's editable fields, as the host persists them. */\nexport interface DataViewSaveInput {\n name: string;\n description: string;\n state: DataViewState;\n shared: boolean;\n pinned: boolean;\n isDefault: boolean;\n}\n\n/** Result of a persistence call — mirrors the app's `Result` without importing it. */\nexport type DataViewMutationResult = { ok: true } | { ok: false; error: string };\n\n/** Injected saved-view persistence (create/update/delete), wired by the host. */\nexport interface DataViewPersistence {\n create: (input: DataViewSaveInput) => Promise<DataViewMutationResult>;\n update: (id: string, input: DataViewSaveInput) => Promise<DataViewMutationResult>;\n remove: (id: string) => Promise<DataViewMutationResult>;\n}\n\n/** Injected router side-effects: sync the `?view=` param and re-fetch on change. */\nexport interface DataViewRouter {\n syncViewParam: (viewId: string | null) => void;\n refresh: () => void;\n}\n"],"mappings":";AAoEO,IAAM,qBAAsD;AAAA,EACjE,OAAO;AAAA,EACP,OAAO,IAAI;AAAA,EACX,QAAQ,KAAK;AAAA,EACb,QAAQ,IAAI;AAAA,EACZ,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASX,OAAO;AACT;AA+IO,SAAS,eAAe,gBAAyC;AACtE,SAAO,EAAE,QAAQ,IAAI,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,eAAe;AACzE;AA+EO,SAAS,gBAAgB,KAAc,cAAuC;AACnF,QAAM,QAAS,OAAO,CAAC;AACvB,SAAO;AAAA,IACL,QAAQ,OAAO,MAAM,WAAW,WAAW,MAAM,SAAS;AAAA,IAC1D,OAAO,SAAmB,MAAM,KAAK;AAAA,IACrC,QAAQ,SAAqB,MAAM,MAAM;AAAA,IACzC,QAAQ,MAAM,QAAQ,MAAM,MAAM,IAAI,MAAM,SAAS,CAAC;AAAA,IACtD,gBAAgB,MAAM,QAAQ,MAAM,cAAc,IAAI,MAAM,iBAAiB;AAAA,IAC7E,OAAO,MAAM,QAAQ,MAAM,KAAK,IAAI,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,IAKlD,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,IACvD,QAAQ,SAAS,MAAM,MAAM,IAAI,MAAM,SAAS;AAAA,EAClD;AACF;AAGO,IAAM,qBAAiD,CAAC,SAAS,QAAQ,SAAS,OAAO;AAGhG,SAAS,SAAS,OAA0C;AAC1D,SAAO,mBAAmB,SAAS,KAAwB;AAC7D;AAGA,SAAS,SAAY,OAAmC;AACtD,SAAO,UAAU,QAAQ,OAAO,UAAU,WAAY,QAA8B,CAAC;AACvF;AA4BO,SAAS,mBAAmB,QAA+C;AAChF,SAAO,EAAE,GAAG,QAAQ,OAAQ,OAAO,SAAS,CAAC,EAAoB;AACnE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDataViewsLayout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZPIMPOHV.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsScopeTabs
|
|
6
6
|
} from "./chunk-LYKV3C7B.js";
|
|
@@ -34,4 +34,4 @@ function ScopeTabsSlot({
|
|
|
34
34
|
export {
|
|
35
35
|
ScopeTabsSlot
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-OGGHD64H.js.map
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-2I5B5NNT.js";
|
|
7
7
|
import {
|
|
8
8
|
ListCardGroup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CZPU5TW3.js";
|
|
10
10
|
import {
|
|
11
11
|
DENSITY_BOARD_SCALE,
|
|
12
12
|
DENSITY_ROW_PADDING,
|
|
13
13
|
cardScaleForZoom,
|
|
14
14
|
cardTargetWidthFor,
|
|
15
15
|
useDataViewsLayout
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZPIMPOHV.js";
|
|
17
17
|
import {
|
|
18
18
|
cardGridTracks
|
|
19
19
|
} from "./chunk-5VZPVDUF.js";
|
|
@@ -264,4 +264,4 @@ function GridMain(props) {
|
|
|
264
264
|
export {
|
|
265
265
|
GridMain
|
|
266
266
|
};
|
|
267
|
-
//# sourceMappingURL=chunk-
|
|
267
|
+
//# sourceMappingURL=chunk-QQE2PVLO.js.map
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
metaShape,
|
|
9
9
|
rowStyles,
|
|
10
10
|
useRowShell
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4KSOSI3U.js";
|
|
12
12
|
import {
|
|
13
13
|
ListCardActions,
|
|
14
14
|
ListCardCaption,
|
|
15
15
|
ListCardMeta,
|
|
16
16
|
ListCardTail
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EICVL6GS.js";
|
|
18
18
|
import {
|
|
19
19
|
useDisclosure
|
|
20
20
|
} from "./chunk-2JCRNWHE.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-JCJGJX7V.js";
|
|
24
24
|
import {
|
|
25
25
|
cellRailsTemplate
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CZPU5TW3.js";
|
|
27
27
|
import {
|
|
28
28
|
ListCardCells,
|
|
29
29
|
cellTracks,
|
|
@@ -179,4 +179,4 @@ function BaseListCard(props) {
|
|
|
179
179
|
export {
|
|
180
180
|
BaseListCard
|
|
181
181
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-RDYBS45D.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-SNR537TI.js";
|
|
9
9
|
import {
|
|
10
10
|
useDataViewsLayout
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZPIMPOHV.js";
|
|
12
12
|
import {
|
|
13
13
|
useDataViewsCopy
|
|
14
14
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -243,4 +243,4 @@ export {
|
|
|
243
243
|
SortTab,
|
|
244
244
|
DisplayTab
|
|
245
245
|
};
|
|
246
|
-
//# sourceMappingURL=chunk-
|
|
246
|
+
//# sourceMappingURL=chunk-SCGVB7DS.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-WLCVOQCJ.js";
|
|
11
11
|
import {
|
|
12
12
|
GridMain
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QQE2PVLO.js";
|
|
14
14
|
import {
|
|
15
15
|
DataViewsPagination
|
|
16
16
|
} from "./chunk-VR5HDUBK.js";
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
} from "./chunk-TQ6FPOPD.js";
|
|
21
21
|
import {
|
|
22
22
|
ScopeTabsSlot
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OGGHD64H.js";
|
|
24
24
|
import {
|
|
25
25
|
ShellToolbar
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-AWTERXCW.js";
|
|
27
27
|
import {
|
|
28
28
|
DataViewsLayoutProvider,
|
|
29
29
|
useDataViewsLayout
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZPIMPOHV.js";
|
|
31
31
|
import {
|
|
32
32
|
togglePillValues
|
|
33
33
|
} from "./chunk-5VZPVDUF.js";
|
|
@@ -114,7 +114,8 @@ function useGridShellFilters({
|
|
|
114
114
|
pills: state.pills,
|
|
115
115
|
ranges: c.ranges,
|
|
116
116
|
onSearchChange: (value) => c.patch({ search: value }),
|
|
117
|
-
|
|
117
|
+
// Updater, never the render's `state` — see {@link DataViewStatePatch}.
|
|
118
|
+
onTogglePill: (fieldId, value, checked) => c.patch(({ pills }) => ({ pills: { ...pills, [fieldId]: togglePillValues(pills[fieldId], value, checked) } })),
|
|
118
119
|
onChangeRange: (fieldId, range) => c.patch({ ranges: { ...c.ranges, [fieldId]: range } }),
|
|
119
120
|
onClearField: (fieldId) => c.patch({ pills: { ...state.pills, [fieldId]: [] } }),
|
|
120
121
|
onClearAll: () => c.patch({ search: "", pills: {}, ranges: {} })
|
|
@@ -260,4 +261,4 @@ function GridShell(props) {
|
|
|
260
261
|
export {
|
|
261
262
|
GridShell
|
|
262
263
|
};
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-T4BFDZGU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-grid-parts.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { TableFilter } from \"../../layout/TableFilter\";\nimport { Text } from \"../../typography/Text\";\nimport { Box } from \"../../../mui/Box\";\nimport { Stack } from \"../../../mui/Stack\";\n\nimport {\n DataViewsLayoutProvider,\n useDataViewsLayout,\n type DataViewsLayout,\n} from \"./data-views-layout-context\";\nimport { FilterDialog, GridFilterPanel } from \"./data-views-filter-panel\";\nimport { GridMain } from \"./data-views-grid-bodies\";\nimport type { ListGroupConfig } from \"./list-card-rails\";\nimport { InlineFilterControls } from \"./data-views-inline-bar\";\nimport { toOverflowFields, useFilterOverflow, type OverflowSplit } from \"./data-views-overflow\";\nimport { ShellToolbar } from \"./data-views-shell-toolbar\";\nimport type { DisplayPanelView } from \"./data-views-display-panel\";\nimport type { DataViewExport } from \"./data-views-export\";\nimport { useDataViewsCopy } from \"./data-views-copy-context\";\nimport { DataViewsEmpty } from \"./data-views-empty\";\nimport { DataViewsPagination } from \"./data-views-pagination\";\nimport type { BoardConfig } from \"./DataViewsBoard\";\nimport { type ScopeConfig } from \"./data-views-scopes\";\nimport { ScopeTabsSlot } from \"./data-views-scope-tabs\";\nimport { togglePillValues } from \"./data-views-grid-helpers\";\nimport type {\n DataViewCardSelection,\n FilterFieldConfig,\n RangeFieldConfig,\n RangeValue,\n RowAction,\n} from \"./data-views-types\";\nimport type { DataViewsController } from \"./use-data-views-state\";\n\n/* ── Header row ──────────────────────────────────────────────────────────── */\n\n/**\n * The grid's own header row: the page title on the left, the primary page\n * actions on the right.\n *\n * `title` and `headerActions` were DECLARED on `DataViewsGridProps` and\n * `DataViewsTableBaseProps` but never destructured or forwarded — dead props\n * whose types lied to every caller that set them. Wired here rather than\n * deleted: a table that carries its own title keeps the title, the scope tabs\n * and the toolbar as one block, instead of the page having to space them.\n *\n * Renders NOTHING when neither is supplied, so no existing table gains a row.\n */\nfunction GridHeaderRow({\n title,\n headerActions,\n testIdPrefix,\n}: {\n title?: string;\n headerActions?: React.ReactNode;\n testIdPrefix: string;\n}): React.JSX.Element | null {\n if (!title && !headerActions) return null;\n return (\n <Box\n data-testid={`${testIdPrefix}-header`}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 2,\n flexWrap: \"wrap\",\n pb: 1.5,\n }}\n >\n {title ? (\n <Text variant=\"heading\" size=\"lg\" as=\"h2\">\n {title}\n </Text>\n ) : (\n <Box />\n )}\n {headerActions && <Box sx={{ display: \"flex\", alignItems: \"center\", gap: 1 }}>{headerActions}</Box>}\n </Box>\n );\n}\n\n/* ── Layout ⇄ view-state mirror ──────────────────────────────────────────── */\n\n/**\n * Mirrors the LIVE layout back into the view state, so saving a view captures\n * the layout the user is actually looking at.\n *\n * A component rather than a callback prop because only something INSIDE the\n * provider can read the layout, and only the controller can write the state.\n * The `stored !== layout` guard is what makes it idempotent: `c` is rebuilt on\n * every render, so an unguarded effect here would patch → re-render → patch.\n *\n * It re-fires when `stored` changes too, which is the case that matters after\n * applying a saved view: `appliedState` REPLACES the state, so a view saved\n * before layouts were captured clears `state.layout`, and the mirror puts the\n * current one back rather than leaving the next save with nothing to store.\n */\nfunction LayoutStateSync<T extends Record<string, unknown>>({\n c,\n}: {\n c: DataViewsController<T>;\n}): null {\n const { layout } = useDataViewsLayout();\n const stored = c.state.layout;\n useEffect(() => {\n if (stored !== layout) c.patch({ layout });\n // `c` is intentionally out of the deps — see the guard above.\n }, [layout, stored]);\n return null;\n}\n\n/* ── Shell (composes toolbar + body + panel) ─────────────────────────────── */\n\n/** The shared filter-surface props consumed by the inline bar, panel, and modal. */\ninterface FilterSurfaceProps<T extends Record<string, unknown>> {\n testIdPrefix: string;\n search: string;\n fields: FilterFieldConfig<T>[];\n rangeFields: RangeFieldConfig<T>[];\n pills: Record<string, string[]>;\n ranges: Record<string, RangeValue>;\n onSearchChange: (value: string) => void;\n onTogglePill: (fieldId: string, value: string, checked: boolean) => void;\n onChangeRange: (fieldId: string, range: RangeValue) => void;\n onClearField: (fieldId: string) => void;\n onClearAll: () => void;\n}\n\n/**\n * Derives the responsive filter state (which surface to show at this width) and\n * the filter-mutation handlers from the controller — pulled out of `GridShell`\n * so the component body stays under the size/complexity budget.\n */\n/** Grouped rather than positional: the list had grown past readability. */\ninterface GridShellFiltersArgs<T extends Record<string, unknown>> {\n c: DataViewsController<T>;\n inlineFilters: boolean;\n fields: FilterFieldConfig<T>[];\n rangeFields: RangeFieldConfig<T>[];\n testIdPrefix: string;\n alwaysShowSearch: boolean;\n /** Is \"Exportar\" on the bar? Half the right cluster's cost when it is not. */\n hasExport: boolean;\n}\n\nfunction useGridShellFilters<T extends Record<string, unknown>>({\n c,\n inlineFilters,\n fields,\n rangeFields,\n testIdPrefix,\n alwaysShowSearch,\n hasExport,\n}: GridShellFiltersArgs<T>): {\n showInline: boolean;\n useModal: boolean;\n inlineVisible: boolean;\n filterProps: FilterSurfaceProps<T>;\n split: OverflowSplit<T>;\n onControlOpenChange: (open: boolean) => void;\n} {\n const { state } = c;\n // How many filter controls are open. A COUNT, not a flag: closing one popover\n // by opening another overlaps, and a boolean would unfreeze mid-handover.\n const [openControls, setOpenControls] = useState(0);\n // ONE measurement for the whole shell: the filter row decides which controls\n // it can keep, and the TOOLBAR needs the same answer to drop its labels.\n // Measuring twice would let the two disagree at the crossover width.\n const split = useFilterOverflow(\n toOverflowFields(fields, rangeFields),\n state.pills,\n c.ranges,\n openControls > 0,\n hasExport,\n );\n // THE BAR RENDERS AT EVERY WIDTH. It used to be swapped for a full-screen\n // filter MODAL below `lg`, which was the responsive strategy before the\n // measured ladder existed — and the two now do the same job, badly together:\n // the modal took the bar away at 1199px, and with it the very degradation\n // (labels off, search collapsed, filters into \"Mais\") that exists to make a\n // narrow bar work. So a 900px window got no bar and no ladder, and the\n // operator lost the search entirely rather than gaining a compact one.\n //\n // The ladder is measured, so it already covers every width the modal did.\n const showInline = inlineFilters;\n const useModal = false;\n const inlineVisible =\n showInline &&\n (alwaysShowSearch || fields.length > 0 || rangeFields.length > 0 || state.search !== \"\");\n const filterProps: FilterSurfaceProps<T> = {\n testIdPrefix,\n search: state.search,\n fields,\n rangeFields,\n pills: state.pills,\n ranges: c.ranges,\n onSearchChange: (value) => c.patch({ search: value }),\n // Updater, never the render's `state` — see {@link DataViewStatePatch}.\n onTogglePill: (fieldId, value, checked) =>\n c.patch(({ pills }) => ({ pills: { ...pills, [fieldId]: togglePillValues(pills[fieldId], value, checked) } })),\n onChangeRange: (fieldId, range) => c.patch({ ranges: { ...c.ranges, [fieldId]: range } }),\n onClearField: (fieldId) => c.patch({ pills: { ...state.pills, [fieldId]: [] } }),\n onClearAll: () => c.patch({ search: \"\", pills: {}, ranges: {} }),\n };\n return {\n showInline,\n useModal,\n inlineVisible,\n filterProps,\n split,\n onControlOpenChange: (open) =>\n setOpenControls((count) => Math.max(0, count + (open ? 1 : -1))),\n };\n}\n\ninterface GridShellProps<T extends Record<string, unknown>> {\n c: DataViewsController<T>;\n rows: T[];\n fields: FilterFieldConfig<T>[];\n rangeFields: RangeFieldConfig<T>[];\n getRowId: (row: T) => string | number;\n testIdPrefix: string;\n dataTestId?: string;\n emptyState?: React.ReactNode;\n toolbarRightSlot?: React.ReactNode;\n rowActions?: RowAction<T>[];\n bulkActions?: (selectedRows: T[], clearSelection: () => void) => React.ReactNode;\n /** Opt-in \"Grade\" (cards) layout: renders each row as an entity-supplied card.\n * Omit ⇒ table only (no layout toggle). */\n renderCard?: (row: T, selection: DataViewCardSelection) => React.ReactNode;\n /**\n * Opt-in \"Quadro\" (board) layout. Needs `renderCard` too — the board reuses\n * the entity's card, so a board config without one simply offers no board\n * rather than failing: that is a config gap, not a runtime error.\n */\n board?: BoardConfig<T>;\n /** Opt-in \"Lista\" layout: one full-width, entity-rendered row per record. */\n renderListRow?: (row: T, selection: DataViewCardSelection) => React.ReactNode;\n /** The Lista's shared columns, so its rows line up by construction. */\n listGroup?: ListGroupConfig<T>;\n /** The page-level partition rendered as tabs under the toolbar. */\n scopes?: ScopeConfig[];\n /**\n * The row field the scopes partition by. Compared against the board's\n * `groupBy` so the two are not shown as the same partition twice.\n */\n scopeFieldId?: string;\n /** Per-sort-field value kind, so directions read in the column's own terms. */\n sortKinds?: Record<string, string>;\n /** The saved-view chrome bracketing the Exibir panel. */\n displayView?: DisplayPanelView;\n /** Injected export — the host re-queries; the grid never fetches. */\n exportConfig?: DataViewExport;\n /** Page title in the grid's own header row, above the scopes + toolbar. */\n title?: string;\n /** Primary page actions rendered at the header row's right. */\n headerActions?: React.ReactNode;\n /** Which layout to show first when the user has expressed no preference (default \"table\"). */\n defaultLayout?: DataViewsLayout;\n /** Pin to `defaultLayout`, ignoring the remembered preference (stories/docs). */\n ignoreStoredLayout?: boolean;\n /**\n * Opt into the responsive inline filter UX: a collapsible filter row below the\n * toolbar on wide screens and a modal on narrow ones. When false (default),\n * keep the classic slide-in filter panel opened by the \"Filtros\" button.\n */\n inlineFilters?: boolean;\n /**\n * Keep the inline search box on screen even with no filter fields and no\n * active search. Without it a grid whose only filter IS the search (`fields`\n * empty) can never OFFER one: the row renders only once a search exists, so\n * the operator would have to hand-edit the URL to start one. Default false —\n * every grid that ships filter fields already shows the row.\n */\n alwaysShowSearch?: boolean;\n}\n\n/** The scrollable content region: scope tabs, toolbar, filter bar, body, pager. */\nfunction ShellStack<T extends Record<string, unknown>>({\n props,\n filters,\n}: {\n props: GridShellProps<T>;\n filters: ReturnType<typeof useGridShellFilters<T>>;\n}): React.JSX.Element {\n const copy = useDataViewsCopy();\n const { c, testIdPrefix, dataTestId, scopes = [], emptyState, inlineFilters = false } = props;\n const { showInline, useModal, inlineVisible, filterProps, split, onControlOpenChange } = filters;\n // The grid renders the FILTERED empty state itself — it is the only party\n // that knows a filter is applied. See {@link DataViewsEmpty}.\n const body = (\n <DataViewsEmpty\n filtered={c.activeFilterCount > 0 || c.state.search !== \"\"}\n onClearFilters={() => c.patch({ search: \"\", pills: {}, ranges: {} })}\n emptyState={emptyState}\n testIdPrefix={testIdPrefix}\n />\n );\n return (\n <TableFilter\n copy={copy.tableFilter} open={c.filterOpen} onOpenChange={c.setFilterOpen}\n hasActiveFilters={c.activeFilterCount > 0}\n >\n <Stack spacing={0} data-testid={dataTestId ? `${dataTestId}-container` : undefined}>\n <GridHeaderRow title={props.title} headerActions={props.headerActions} testIdPrefix={testIdPrefix} />\n <ShellToolbar\n c={c}\n rows={props.rows}\n sortKinds={props.sortKinds}\n displayView={props.displayView}\n exportConfig={props.exportConfig}\n filterControls={\n inlineVisible ? (\n <InlineFilterControls\n {...filterProps} split={split} activeFilterCount={c.activeFilterCount}\n onControlOpenChange={onControlOpenChange}\n />\n ) : undefined\n }\n barRef={split.barRef}\n testIdPrefix={testIdPrefix}\n rowActions={props.rowActions}\n bulkActions={props.bulkActions}\n toolbarRightSlot={props.toolbarRightSlot}\n compactControls={showInline && split.compactControls}\n counterHidden={showInline && split.counterHidden}\n showInline={showInline}\n />\n <ScopeTabsSlot\n scopes={scopes} scopeFieldId={props.scopeFieldId} board={props.board}\n value={c.scope} onChange={c.setScope} counts={c.scopeCounts}\n testIdPrefix={testIdPrefix}\n />\n <TableFilter.Layout>\n <TableFilter.Main>\n <GridMain\n c={c}\n getRowId={props.getRowId}\n renderCard={props.renderCard}\n renderListRow={props.renderListRow}\n listGroup={props.listGroup}\n board={props.board}\n dataTestId={dataTestId}\n testIdPrefix={testIdPrefix}\n emptyState={body}\n />\n <DataViewsPagination c={c} testIdPrefix={testIdPrefix} />\n </TableFilter.Main>\n {inlineFilters ? null : <GridFilterPanel {...filterProps} />}\n </TableFilter.Layout>\n {useModal && <FilterDialog open={c.filterOpen} onClose={() => c.setFilterOpen(false)} {...filterProps} />}\n </Stack>\n </TableFilter>\n );\n}\n\nexport function GridShell<T extends Record<string, unknown>>(props: GridShellProps<T>): React.JSX.Element {\n const {\n c,\n fields,\n rangeFields,\n testIdPrefix,\n renderCard,\n renderListRow,\n board,\n defaultLayout,\n ignoreStoredLayout,\n inlineFilters = false,\n alwaysShowSearch = false,\n } = props;\n const filters = useGridShellFilters({\n c,\n inlineFilters,\n fields,\n rangeFields,\n testIdPrefix,\n alwaysShowSearch,\n hasExport: props.exportConfig !== undefined,\n });\n return (\n <DataViewsLayoutProvider\n canUseCards={Boolean(renderCard)}\n canUseList={Boolean(renderListRow)}\n // The board reuses the entity's card, so it needs BOTH — a `board` with no\n // `renderCard` offers no board rather than throwing.\n canUseBoard={Boolean(board && renderCard)}\n defaultLayout={defaultLayout}\n ignoreStoredLayout={ignoreStoredLayout}\n viewLayout={c.state.layout}\n >\n <LayoutStateSync c={c} />\n <ShellStack props={props} filters={filters} />\n </DataViewsLayoutProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAW,gBAAgB;AA6DhC,SAYI,KAZJ;AAXJ,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACF,GAI6B;AAC3B,MAAI,CAAC,SAAS,CAAC,cAAe,QAAO;AACrC,SACE;AAAA,IAACA;AAAA,IAAA;AAAA,MACC,eAAa,GAAG,YAAY;AAAA,MAC5B,IAAI;AAAA,QACF,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,KAAK;AAAA,QACL,UAAU;AAAA,QACV,IAAI;AAAA,MACN;AAAA,MAEC;AAAA,gBACC,oBAAC,QAAK,SAAQ,WAAU,MAAK,MAAK,IAAG,MAClC,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,EACF;AAEJ;AAEO,SAAS,UAA6C,OAA6C;AACxG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,EACrB,IAAI;AACJ,QAAM,UAAU,oBAAoB;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,MAAM,iBAAiB;AAAA,EACpC,CAAC;AACD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAa,QAAQ,UAAU;AAAA,MAC/B,YAAY,QAAQ,aAAa;AAAA,MAGjC,aAAa,QAAQ,SAAS,UAAU;AAAA,MACxC;AAAA,MACA;AAAA,MACA,YAAY,EAAE,MAAM;AAAA,MAEtB;AAAA,4BAAC,mBAAgB,GAAM;AAAA,QACvB,oBAAC,cAAW,OAAc,SAAkB;AAAA;AAAA;AAAA,EAC5C;AAEJ;","names":["default"]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-NQCYVYP3.js";
|
|
4
4
|
import {
|
|
5
5
|
DataViewsDisplayPanel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HGBZZDP6.js";
|
|
7
7
|
import {
|
|
8
8
|
renderBulkActions
|
|
9
9
|
} from "./chunk-5VZPVDUF.js";
|
|
@@ -132,4 +132,4 @@ function GridToolbar(props) {
|
|
|
132
132
|
export {
|
|
133
133
|
GridToolbar
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-WXBBWSNU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DATA_VIEWS_LAYOUTS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LHHAYZ55.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsCopy
|
|
6
6
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -184,4 +184,4 @@ export {
|
|
|
184
184
|
useDataViewsLayout,
|
|
185
185
|
DataViewsZoomSlider
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-ZPIMPOHV.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataViewsTableBase
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DEOC5OI7.js";
|
|
4
4
|
import "../chunk-LS42VJAI.js";
|
|
5
5
|
import {
|
|
6
6
|
DataViewsGrid
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-JKLWHENB.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseListCard
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-RDYBS45D.js";
|
|
11
11
|
import "../chunk-UNF65XZW.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-4KSOSI3U.js";
|
|
13
|
+
import "../chunk-EICVL6GS.js";
|
|
14
14
|
import "../chunk-2JCRNWHE.js";
|
|
15
15
|
import {
|
|
16
16
|
BaseCard
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-6U7NA74A.js";
|
|
18
18
|
import "../chunk-MQUU2XZB.js";
|
|
19
19
|
import {
|
|
20
20
|
DragContainerProvider,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
useDragItem
|
|
23
23
|
} from "../chunk-JCJGJX7V.js";
|
|
24
24
|
import "../chunk-ZOLAYP2D.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-T4BFDZGU.js";
|
|
26
26
|
import "../chunk-IN642YHK.js";
|
|
27
27
|
import "../chunk-S7CAXRRP.js";
|
|
28
28
|
import "../chunk-WLCVOQCJ.js";
|
|
@@ -30,7 +30,7 @@ import "../chunk-5WNQJ5KS.js";
|
|
|
30
30
|
import "../chunk-ECIGNYSI.js";
|
|
31
31
|
import "../chunk-ZHPKFV7Y.js";
|
|
32
32
|
import "../chunk-NC2AATCC.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-QQE2PVLO.js";
|
|
34
34
|
import {
|
|
35
35
|
DataViewsBoard
|
|
36
36
|
} from "../chunk-3DQP6OPC.js";
|
|
@@ -43,13 +43,13 @@ import "../chunk-IAGOUTI6.js";
|
|
|
43
43
|
import "../chunk-FV36LFPX.js";
|
|
44
44
|
import "../chunk-2I5B5NNT.js";
|
|
45
45
|
import "../chunk-A7Q5AQVD.js";
|
|
46
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-OGGHD64H.js";
|
|
47
47
|
import "../chunk-GCZJH4XL.js";
|
|
48
48
|
import {
|
|
49
49
|
DEFAULT_RAILS,
|
|
50
50
|
ListCardGroup,
|
|
51
51
|
RAIL_COUNT
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-CZPU5TW3.js";
|
|
53
53
|
import {
|
|
54
54
|
DEFAULT_CELL_WIDTH
|
|
55
55
|
} from "../chunk-6VP2L3DJ.js";
|
|
@@ -57,21 +57,21 @@ import "../chunk-XPS7FWZS.js";
|
|
|
57
57
|
import "../chunk-U7SO3N42.js";
|
|
58
58
|
import "../chunk-UHXNEXOC.js";
|
|
59
59
|
import "../chunk-5M4TYFR3.js";
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
60
|
+
import "../chunk-AWTERXCW.js";
|
|
61
|
+
import "../chunk-WXBBWSNU.js";
|
|
62
62
|
import "../chunk-NQCYVYP3.js";
|
|
63
|
-
import "../chunk-
|
|
63
|
+
import "../chunk-HGBZZDP6.js";
|
|
64
64
|
import "../chunk-2PPWKCMW.js";
|
|
65
|
-
import "../chunk-
|
|
65
|
+
import "../chunk-SCGVB7DS.js";
|
|
66
66
|
import "../chunk-SNR537TI.js";
|
|
67
67
|
import {
|
|
68
68
|
cardMinWidthForZoom,
|
|
69
69
|
cardScaleForZoom
|
|
70
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-ZPIMPOHV.js";
|
|
71
71
|
import "../chunk-QTPKACVO.js";
|
|
72
|
-
import "../chunk-
|
|
72
|
+
import "../chunk-HR7YTBR7.js";
|
|
73
73
|
import "../chunk-DZEC6RFM.js";
|
|
74
|
-
import "../chunk-
|
|
74
|
+
import "../chunk-BV5XTGKB.js";
|
|
75
75
|
import "../chunk-4QQVIGRG.js";
|
|
76
76
|
import "../chunk-YGQX7BNI.js";
|
|
77
77
|
import "../chunk-IMLIIW77.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
CARD_ASPECT_RATIOS,
|
|
87
87
|
DATA_VIEWS_LAYOUTS,
|
|
88
88
|
toSavedViewSummary
|
|
89
|
-
} from "../chunk-
|
|
89
|
+
} from "../chunk-LHHAYZ55.js";
|
|
90
90
|
import "../chunk-T4SM36XC.js";
|
|
91
91
|
import {
|
|
92
92
|
DataViewsCopyProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-views-grid-parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-grid-parts.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAEhB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-views-grid-parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-grid-parts.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAEhB,SAAS,EACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAwLlE,UAAU,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,UAAU,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EA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,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsCxG"}
|
|
@@ -135,6 +135,14 @@ export interface DataViewColumn<T extends Record<string, unknown>> extends GridC
|
|
|
135
135
|
*/
|
|
136
136
|
export type DataViewsLayout = "cards" | "list" | "board" | "table";
|
|
137
137
|
/** The full, serializable state a view captures. */
|
|
138
|
+
/**
|
|
139
|
+
* A view-state patch: the fields to merge, or an updater given the CURRENT
|
|
140
|
+
* state. Use the updater whenever the patch derives from state it also changes
|
|
141
|
+
* — a render-scoped snapshot would let two calls in one tick read the same
|
|
142
|
+
* `prev` and the second overwrite the first, which is exactly what a control
|
|
143
|
+
* emitting one call per changed value does.
|
|
144
|
+
*/
|
|
145
|
+
export type DataViewStatePatch = Partial<DataViewState> | ((prev: DataViewState) => Partial<DataViewState>);
|
|
138
146
|
export interface DataViewState {
|
|
139
147
|
/** Free text matched across every `searchable` column. */
|
|
140
148
|
search: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-views-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAA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M,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
1
|
+
{"version":3,"file":"data-views-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/data-views-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,uEAAuE;IACvE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,K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AkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,gBAAgB,CAEhF;AAED;;;;GAIG;AAEH,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,sFAAsF;AACtF,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACtE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAClF,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACzD;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -2,7 +2,7 @@ import { type GridColumn } from "../DataGrid";
|
|
|
2
2
|
import { type SortFieldDefinition } from "../../layout/ContentToolbar";
|
|
3
3
|
import { type HideableColumn } from "./data-views-columns";
|
|
4
4
|
import { type ScopeConfig } from "./data-views-scopes";
|
|
5
|
-
import { type DataViewColumn, type DataViewServer, type DataViewState, type DataViewSyncState, type FilterFieldConfig, type RangeFieldConfig, type DataViewQuery, type RangeValue, type RowAction } from "./data-views-types";
|
|
5
|
+
import { type DataViewColumn, type DataViewServer, type DataViewState, type DataViewStatePatch, type DataViewSyncState, type FilterFieldConfig, type RangeFieldConfig, type DataViewQuery, type RangeValue, type RowAction } from "./data-views-types";
|
|
6
6
|
export type { HideableColumn };
|
|
7
7
|
/** Inputs the hook needs to own the view state + derived data. */
|
|
8
8
|
interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
|
|
@@ -46,7 +46,15 @@ interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
|
|
|
46
46
|
export interface DataViewsController<T extends Record<string, unknown>> {
|
|
47
47
|
state: DataViewState;
|
|
48
48
|
ranges: Record<string, RangeValue>;
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Merge a partial into the view state.
|
|
51
|
+
*
|
|
52
|
+
* The UPDATER form is the one to reach for when the patch is derived from
|
|
53
|
+
* state you are also changing — successive calls within one tick each see the
|
|
54
|
+
* previous call's result, where the object form would have every caller build
|
|
55
|
+
* its patch from the same render-scoped snapshot and the last write would win.
|
|
56
|
+
*/
|
|
57
|
+
patch: (next: DataViewStatePatch) => void;
|
|
50
58
|
matched: T[];
|
|
51
59
|
gridColumns: GridColumn<T>[];
|
|
52
60
|
/** Columns eligible for the show/hide menu (hideable, with a text header). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-data-views-state.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/use-data-views-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG3F,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAi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AW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpE,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,KAAK,EAAE,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"use-data-views-state.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/DataViews/use-data-views-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG3F,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,kEAAkE;AAClE,UAAU,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IA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EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,MAAW,EACX,YAAY,GACb,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CA6DnD"}
|
package/package.json
CHANGED
|
@@ -200,8 +200,9 @@ function useGridShellFilters<T extends Record<string, unknown>>({
|
|
|
200
200
|
pills: state.pills,
|
|
201
201
|
ranges: c.ranges,
|
|
202
202
|
onSearchChange: (value) => c.patch({ search: value }),
|
|
203
|
+
// Updater, never the render's `state` — see {@link DataViewStatePatch}.
|
|
203
204
|
onTogglePill: (fieldId, value, checked) =>
|
|
204
|
-
c.patch({ pills: { ...
|
|
205
|
+
c.patch(({ pills }) => ({ pills: { ...pills, [fieldId]: togglePillValues(pills[fieldId], value, checked) } })),
|
|
205
206
|
onChangeRange: (fieldId, range) => c.patch({ ranges: { ...c.ranges, [fieldId]: range } }),
|
|
206
207
|
onClearField: (fieldId) => c.patch({ pills: { ...state.pills, [fieldId]: [] } }),
|
|
207
208
|
onClearAll: () => c.patch({ search: "", pills: {}, ranges: {} }),
|
|
@@ -170,6 +170,17 @@ export interface DataViewColumn<T extends Record<string, unknown>> extends GridC
|
|
|
170
170
|
export type DataViewsLayout = "cards" | "list" | "board" | "table";
|
|
171
171
|
|
|
172
172
|
/** The full, serializable state a view captures. */
|
|
173
|
+
/**
|
|
174
|
+
* A view-state patch: the fields to merge, or an updater given the CURRENT
|
|
175
|
+
* state. Use the updater whenever the patch derives from state it also changes
|
|
176
|
+
* — a render-scoped snapshot would let two calls in one tick read the same
|
|
177
|
+
* `prev` and the second overwrite the first, which is exactly what a control
|
|
178
|
+
* emitting one call per changed value does.
|
|
179
|
+
*/
|
|
180
|
+
export type DataViewStatePatch =
|
|
181
|
+
| Partial<DataViewState>
|
|
182
|
+
| ((prev: DataViewState) => Partial<DataViewState>);
|
|
183
|
+
|
|
173
184
|
export interface DataViewState {
|
|
174
185
|
/** Free text matched across every `searchable` column. */
|
|
175
186
|
search: string;
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
type DataViewColumn,
|
|
21
21
|
type DataViewServer,
|
|
22
22
|
type DataViewState,
|
|
23
|
+
type DataViewStatePatch,
|
|
23
24
|
type DataViewSyncState,
|
|
24
25
|
type FilterFieldConfig,
|
|
25
26
|
type RangeFieldConfig,
|
|
@@ -73,7 +74,15 @@ interface UseDataViewsStateArgs<T extends Record<string, unknown>> {
|
|
|
73
74
|
export interface DataViewsController<T extends Record<string, unknown>> {
|
|
74
75
|
state: DataViewState;
|
|
75
76
|
ranges: Record<string, RangeValue>;
|
|
76
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Merge a partial into the view state.
|
|
79
|
+
*
|
|
80
|
+
* The UPDATER form is the one to reach for when the patch is derived from
|
|
81
|
+
* state you are also changing — successive calls within one tick each see the
|
|
82
|
+
* previous call's result, where the object form would have every caller build
|
|
83
|
+
* its patch from the same render-scoped snapshot and the last write would win.
|
|
84
|
+
*/
|
|
85
|
+
patch: (next: DataViewStatePatch) => void;
|
|
77
86
|
matched: T[];
|
|
78
87
|
gridColumns: GridColumn<T>[];
|
|
79
88
|
/** Columns eligible for the show/hide menu (hideable, with a text header). */
|
|
@@ -229,7 +238,7 @@ function seedState(
|
|
|
229
238
|
* same reason changing any other part of the query clears it.
|
|
230
239
|
*/
|
|
231
240
|
function makeSetScope(
|
|
232
|
-
patch: (next:
|
|
241
|
+
patch: (next: DataViewStatePatch) => void,
|
|
233
242
|
clearSelection: () => void,
|
|
234
243
|
): (id: string) => void {
|
|
235
244
|
return (id) => {
|
|
@@ -327,7 +336,8 @@ export function useDataViewsState<T extends Record<string, unknown>>({
|
|
|
327
336
|
|
|
328
337
|
useStateSyncEffects(appliedState, syncState, state, onStateChange, setState);
|
|
329
338
|
|
|
330
|
-
const patch = (next:
|
|
339
|
+
const patch = (next: DataViewStatePatch): void =>
|
|
340
|
+
setState((prev) => ({ ...prev, ...(typeof next === "function" ? next(prev) : next) }));
|
|
331
341
|
const matched = useMatchedRows(server, rows, columns, fields, rangeFields, state);
|
|
332
342
|
// Resolved at READ time, every render: a stale deep link or a saved view naming
|
|
333
343
|
// a scope that has since been removed falls back to the first declared scope
|