@12-apps/ui 6.65.0 → 6.66.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/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +4 -4
- package/dist/_internal/components/data-display/Chart/SpecChart.js +5 -5
- 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/DataViews/DataViewsBoard.js +1 -1
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +14 -13
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +16 -15
- 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-layout.js +6 -6
- 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 +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-card-body.js +35 -0
- package/dist/_internal/components/data-display/DataViews/data-views-card-body.js.map +1 -0
- 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 +6 -5
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +12 -11
- 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/_internal/components/data-display/Sheet/Sheet.body.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.parts.js +1 -1
- package/dist/_internal/components/data-display/index.js +10 -10
- package/dist/_internal/components/index.js +18 -18
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +4 -4
- 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 +13 -13
- package/dist/charts.js +5 -5
- package/dist/{chunk-FL2DRDTS.js → chunk-2VMIHFMX.js} +2 -2
- package/dist/{chunk-OR6JKOQ5.js → chunk-33XGC4YU.js} +2 -2
- package/dist/{chunk-BQNYX3VM.js → chunk-35L5YMYQ.js} +2 -2
- package/dist/{chunk-LDCHE6QS.js → chunk-3WLS7Z7D.js} +3 -3
- package/dist/{chunk-VUVPEKDE.js → chunk-5MMAV7XK.js} +2 -2
- package/dist/{chunk-RNLLDK5L.js → chunk-67XUBKJC.js} +3 -3
- package/dist/{chunk-CZVAVX5L.js → chunk-6ATXOJVQ.js} +2 -2
- package/dist/{chunk-GLBK6X5Z.js → chunk-7J5JR33K.js} +2 -2
- package/dist/{chunk-NHHWNA5W.js → chunk-7TCOYCD7.js} +2 -2
- package/dist/chunk-7TCOYCD7.js.map +1 -0
- package/dist/{chunk-ANJAAGN3.js → chunk-AKGXNC4R.js} +2 -2
- package/dist/{chunk-5357QUVE.js → chunk-AMLHEKSV.js} +5 -5
- package/dist/{chunk-HR7YTBR7.js → chunk-BI7YMVKZ.js} +2 -2
- package/dist/{chunk-OZGKIHAA.js → chunk-BRBQNPM2.js} +2 -2
- package/dist/{chunk-YOEZTW4T.js → chunk-FNFDXJWR.js} +3 -3
- package/dist/chunk-FNFDXJWR.js.map +1 -0
- package/dist/{chunk-ULBOCFST.js → chunk-J6DYHBID.js} +7 -7
- package/dist/{chunk-H5OVOWHY.js → chunk-JKNKGGOG.js} +5 -3
- package/dist/{chunk-H5OVOWHY.js.map → chunk-JKNKGGOG.js.map} +1 -1
- package/dist/{chunk-MQNL5UME.js → chunk-JXW6DZDN.js} +2 -2
- package/dist/{chunk-GVEWFA3Z.js → chunk-JY5YINUH.js} +21 -53
- package/dist/chunk-JY5YINUH.js.map +1 -0
- package/dist/{chunk-MO52X5WW.js → chunk-JYMXYSDP.js} +2 -2
- package/dist/{chunk-PEHYS7TU.js → chunk-K6KBASL2.js} +2 -2
- package/dist/{chunk-EMHG2ZQN.js → chunk-KDQEJAKH.js} +2 -2
- package/dist/{chunk-T3SZYWWN.js → chunk-L6MGAPBX.js} +2 -2
- package/dist/{chunk-YLBZ3SKU.js → chunk-L7OWFJUU.js} +6 -5
- package/dist/chunk-L7OWFJUU.js.map +1 -0
- package/dist/{chunk-5YDTSJNY.js → chunk-LMIOWP6H.js} +2 -2
- package/dist/{chunk-GGG6TDET.js → chunk-M6V7Y7CP.js} +3 -3
- package/dist/chunk-M6V7Y7CP.js.map +1 -0
- package/dist/{chunk-6DO672AG.js → chunk-N5PVD4J5.js} +7 -7
- package/dist/{chunk-LHHAYZ55.js → chunk-O2P2KTKN.js} +1 -1
- package/dist/chunk-O2P2KTKN.js.map +1 -0
- package/dist/{chunk-NMGNKIXF.js → chunk-QQWW6T4Q.js} +2 -2
- package/dist/{chunk-R52N5UCS.js → chunk-SB2SEGR6.js} +2 -2
- package/dist/{chunk-OT5JBIBT.js → chunk-SUZLGB5I.js} +3 -3
- package/dist/chunk-SZSS5KKX.js +51 -0
- package/dist/chunk-SZSS5KKX.js.map +1 -0
- package/dist/{chunk-JG733RMP.js → chunk-TZC6KIK2.js} +5 -5
- package/dist/{chunk-B7PKBFA4.js → chunk-UZ2CEJOO.js} +2 -2
- package/dist/{chunk-HG7MCNRR.js → chunk-V45JGJ3W.js} +4 -4
- package/dist/{chunk-HG7MCNRR.js.map → chunk-V45JGJ3W.js.map} +1 -1
- package/dist/{chunk-E2VVEXEX.js → chunk-VJB63DUM.js} +2 -2
- package/dist/{chunk-CJ7KAM3S.js → chunk-XBTSKYYY.js} +4 -4
- package/dist/{chunk-IZBQL4HZ.js → chunk-ZDT4ZGP4.js} +3 -3
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +3 -3
- package/dist/data-display/Chart.js +5 -5
- package/dist/data-display/DataViews.js +22 -21
- package/dist/data-display/Sheet.js +3 -3
- package/dist/navigation/AppHeader.js +4 -4
- package/dist/navigation/SectionNav.js +9 -9
- package/dist/types/components/data-display/DataViews/DataViewsBoard.d.ts +2 -1
- package/dist/types/components/data-display/DataViews/DataViewsBoard.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts +10 -0
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts +7 -0
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-card-body.d.ts +26 -0
- package/dist/types/components/data-display/DataViews/data-views-card-body.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-grid-bodies.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-grid-bodies.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts +2 -0
- 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 +2 -1
- package/dist/types/components/data-display/DataViews/data-views-types.d.ts.map +1 -1
- package/dist/types/components/data-display/Sheet/Sheet.parts.d.ts.map +1 -1
- package/dist/types/components/data-display/Sheet/Sheet.types.d.ts +2 -0
- package/dist/types/components/data-display/Sheet/Sheet.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/DataViews/DataViewsBoard.tsx +4 -3
- package/src/components/data-display/DataViews/DataViewsGrid.tsx +10 -0
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +7 -0
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +27 -1
- package/src/components/data-display/DataViews/data-views-card-body.tsx +73 -0
- package/src/components/data-display/DataViews/data-views-grid-bodies.tsx +29 -77
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +3 -1
- package/src/components/data-display/DataViews/data-views-types.ts +2 -1
- package/src/components/data-display/Sheet/Sheet.md +1 -1
- package/src/components/data-display/Sheet/Sheet.parts.tsx +4 -2
- package/src/components/data-display/Sheet/Sheet.tsx +1 -1
- package/src/components/data-display/Sheet/Sheet.types.ts +2 -0
- package/dist/chunk-GGG6TDET.js.map +0 -1
- package/dist/chunk-GVEWFA3Z.js.map +0 -1
- package/dist/chunk-LHHAYZ55.js.map +0 -1
- package/dist/chunk-NHHWNA5W.js.map +0 -1
- package/dist/chunk-YLBZ3SKU.js.map +0 -1
- package/dist/chunk-YOEZTW4T.js.map +0 -1
- /package/dist/{chunk-FL2DRDTS.js.map → chunk-2VMIHFMX.js.map} +0 -0
- /package/dist/{chunk-OR6JKOQ5.js.map → chunk-33XGC4YU.js.map} +0 -0
- /package/dist/{chunk-BQNYX3VM.js.map → chunk-35L5YMYQ.js.map} +0 -0
- /package/dist/{chunk-LDCHE6QS.js.map → chunk-3WLS7Z7D.js.map} +0 -0
- /package/dist/{chunk-VUVPEKDE.js.map → chunk-5MMAV7XK.js.map} +0 -0
- /package/dist/{chunk-RNLLDK5L.js.map → chunk-67XUBKJC.js.map} +0 -0
- /package/dist/{chunk-CZVAVX5L.js.map → chunk-6ATXOJVQ.js.map} +0 -0
- /package/dist/{chunk-GLBK6X5Z.js.map → chunk-7J5JR33K.js.map} +0 -0
- /package/dist/{chunk-ANJAAGN3.js.map → chunk-AKGXNC4R.js.map} +0 -0
- /package/dist/{chunk-5357QUVE.js.map → chunk-AMLHEKSV.js.map} +0 -0
- /package/dist/{chunk-HR7YTBR7.js.map → chunk-BI7YMVKZ.js.map} +0 -0
- /package/dist/{chunk-OZGKIHAA.js.map → chunk-BRBQNPM2.js.map} +0 -0
- /package/dist/{chunk-ULBOCFST.js.map → chunk-J6DYHBID.js.map} +0 -0
- /package/dist/{chunk-MQNL5UME.js.map → chunk-JXW6DZDN.js.map} +0 -0
- /package/dist/{chunk-MO52X5WW.js.map → chunk-JYMXYSDP.js.map} +0 -0
- /package/dist/{chunk-PEHYS7TU.js.map → chunk-K6KBASL2.js.map} +0 -0
- /package/dist/{chunk-EMHG2ZQN.js.map → chunk-KDQEJAKH.js.map} +0 -0
- /package/dist/{chunk-T3SZYWWN.js.map → chunk-L6MGAPBX.js.map} +0 -0
- /package/dist/{chunk-5YDTSJNY.js.map → chunk-LMIOWP6H.js.map} +0 -0
- /package/dist/{chunk-6DO672AG.js.map → chunk-N5PVD4J5.js.map} +0 -0
- /package/dist/{chunk-NMGNKIXF.js.map → chunk-QQWW6T4Q.js.map} +0 -0
- /package/dist/{chunk-R52N5UCS.js.map → chunk-SB2SEGR6.js.map} +0 -0
- /package/dist/{chunk-OT5JBIBT.js.map → chunk-SUZLGB5I.js.map} +0 -0
- /package/dist/{chunk-JG733RMP.js.map → chunk-TZC6KIK2.js.map} +0 -0
- /package/dist/{chunk-B7PKBFA4.js.map → chunk-UZ2CEJOO.js.map} +0 -0
- /package/dist/{chunk-E2VVEXEX.js.map → chunk-VJB63DUM.js.map} +0 -0
- /package/dist/{chunk-CJ7KAM3S.js.map → chunk-XBTSKYYY.js.map} +0 -0
- /package/dist/{chunk-IZBQL4HZ.js.map → chunk-ZDT4ZGP4.js.map} +0 -0
|
@@ -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 { 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 { GridHeaderRow } from \"./data-views-header-row\";\nimport { allOnPageSelected, resolveSelectionExtra, type SelectionExtraRender } from \"./data-views-selection-extra\";\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 { DataViewRowDetail } from \"./data-views-row-detail\";\nimport type { DataViewsController } from \"./use-data-views-state\";\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 /** A widening control beside the selection count — see `resolveSelectionExtra`. */\n selectionExtra?: SelectionExtraRender<T>;\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 /** Opt-in expandable rows, drawn by the table layout only. */\n rowDetail?: DataViewRowDetail<T>;\n /** Row selection, on by default. False ⇒ no checkboxes in any layout, no select-all. */\n selectable?: boolean;\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 selectionExtra={resolveSelectionExtra(props)}\n allOnPageSelected={allOnPageSelected(c, props.getRowId)}\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 rowDetail={props.rowDetail} selectable={props.selectable !== false}\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":"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","names":["default"]}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-K4EKTMTC.js";
|
|
12
12
|
import {
|
|
13
13
|
CARD_ASPECT_RATIOS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O2P2KTKN.js";
|
|
15
15
|
import {
|
|
16
16
|
useDataViewsCopy
|
|
17
17
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -268,4 +268,4 @@ function BaseCard(props) {
|
|
|
268
268
|
export {
|
|
269
269
|
BaseCard
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-LMIOWP6H.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GridShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L7OWFJUU.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-35L5YMYQ.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-M6V7Y7CP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/DataViewsGrid.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nimport { type SortFieldDefinition } from \"../../layout/ContentToolbar\";\n\nimport { GridShell } from \"./data-views-grid-parts\";\nimport type { SelectionExtraRender } from \"./data-views-selection-extra\";\nimport type { ListGroupConfig } from \"./list-card-rails\";\nimport type { DisplayPanelView } from \"./data-views-display-panel\";\nimport type { BoardConfig } from \"./DataViewsBoard\";\nimport type { DataViewExport } from \"./data-views-export\";\nimport type { ScopeConfig } from \"./data-views-scopes\";\nimport type { DataViewCardSelection } from \"./data-views-types\";\nimport {\n type DataViewColumn,\n type DataViewsLayout,\n type DataViewServer,\n type DataViewState,\n type DataViewSyncState,\n type FilterFieldConfig,\n type RangeFieldConfig,\n type RowAction,\n} from \"./data-views-types\";\nimport type { DataViewRowDetail } from \"./data-views-row-detail\";\nimport { useDataViewsState } from \"./use-data-views-state\";\n\ninterface DataViewsGridProps<T extends Record<string, unknown>> {\n rows: T[];\n columns: DataViewColumn<T>[];\n fields: FilterFieldConfig<T>[];\n /** Optional numeric min/max range filters (advanced \"filter by amount\"). */\n rangeFields?: RangeFieldConfig<T>[];\n getRowId: (row: T) => string | number;\n /** Row click opens the row; clicks in the actions column are ignored. */\n onRowClick?: (row: T) => void;\n emptyState?: React.ReactNode;\n dataTestId?: string;\n testIdPrefix?: string;\n /** Seed/replace the view state. A NEW reference re-applies (used to apply a saved view). */\n appliedState?: DataViewState;\n /**\n * URL-driven controls (search/pills/ranges/sort) that RE-APPLY on reference\n * change while preserving column visibility — for server-mode lists that keep\n * their filter/sort/page in the address bar (see {@link DataViewSyncState}).\n */\n syncState?: DataViewSyncState;\n /** Notified on every view-state change (so a save-view modal can read it). */\n onStateChange?: (state: DataViewState) => void;\n /**\n * Notified with the currently-visible (search + filter matched) rows whenever\n * they change — so a page-level Export exports what the user sees, not the\n * full dataset.\n */\n onVisibleRowsChange?: (rows: T[]) => void;\n /** Saved-views UI injected into the toolbar (FUT-89). */\n toolbarRightSlot?: React.ReactNode;\n /**\n * The saved-view chrome for the Exibir panel: its VISÃO header (with the\n * views dropdown) and its Redefinir / Salvar visão footer. Supplied by\n * `DataViewsTableBase`; without it the panel is tabs only.\n */\n displayView?: DisplayPanelView;\n /** Big page title in the header row (next to the funnel + gear). */\n title?: string;\n /** Primary page actions rendered at the header's right. */\n headerActions?: React.ReactNode;\n /**\n * Sort options for the toolbar's \"Sort By\" dropdown. Defaults to the sortable\n * columns (asc/desc each) when omitted.\n */\n sortFields?: SortFieldDefinition[];\n /**\n * Per-sort-field VALUE KIND (`\"currency\" | \"number\" | \"date\" | \"text\"`), so the\n * Exibir panel phrases the direction in that column's own terms. \"Crescente\"\n * on a currency column is a puzzle; \"Menor → maior\" is not. Defaults to text.\n */\n sortKinds?: Record<string, string>;\n /**\n * Opt-in \"Exportar\" control. The grid hands the host the current query,\n * UNPAGINATED, and the host re-queries — the grid never fetches, and an\n * export therefore follows the filters rather than the loaded page.\n */\n exportConfig?: DataViewExport;\n /**\n * A single, reusable list of row actions that drives BOTH the per-row \"⋮\"\n * kebab AND the bulk-actions menu (tabwoah model). When provided, the grid\n * appends a kebab actions column automatically (unless the page already\n * defines one) and shows an \"Ações\" bulk menu when rows are selected.\n */\n rowActions?: RowAction<T>[];\n /**\n * Extra leading control rendered in the auto kebab column, before the \"⋮\"\n * (e.g. a favourite star). Only used when `rowActions` is set.\n */\n rowActionsLeading?: (row: T) => React.ReactNode;\n /**\n * Low-level override for the selection bulk control. Prefer `rowActions`.\n * Receives the selected rows + a `clearSelection` callback.\n */\n bulkActions?: (selectedRows: T[], clearSelection: () => void) => React.ReactNode;\n /**\n * A control rendered beside the \"N selected\" count, for changing WHAT is\n * selected rather than what happens to it — a \"select all N matching the\n * filter\" widening, above all.\n *\n * Called only while something is selected, and handed\n * {@link SelectionExtraContext.allOnPageSelected} so the control can follow\n * the convention operators already know: the widening appears once the whole\n * page is ticked, and not before.\n */\n selectionExtra?: SelectionExtraRender<T>;\n /**\n * Render a bespoke per-row menu in the actions column instead of the auto\n * kebab — typically an entity's self-contained 3-dots menu that owns its own\n * popups, so the SAME menu component drives both the table row and the card.\n * `rowActions`/`bulkActions` still drive the multi-row bulk menu.\n */\n renderRowMenu?: (row: T) => React.ReactNode;\n /**\n * Row selection — on by default. `false` opts the grid out entirely: no\n * checkbox column in the table (and no width reserved for one), no checkbox\n * or checkbox gutter on cards and list rows, no select-all strip and no\n * count. With nothing selectable, the toolbar's selection mode never takes\n * over the search, the filter pills and Exportar. For a grid with no bulk\n * action, where a selection could only hide the toolbar. Row click and the\n * row menu are unaffected.\n */\n selectable?: boolean;\n /**\n * Opt-in expandable rows (table layout only): a chevron in a leading column\n * opens `render(row)` under the row. See {@link DataViewRowDetail}.\n */\n rowDetail?: DataViewRowDetail<T>;\n /**\n * Opt-in \"Grade\" (cards) layout. When provided, a Grade/Tabela toggle appears in\n * the toolbar and the cards body renders each visible row via this function\n * (reusing the same search/filter/sort). Omit ⇒ table only (unchanged).\n */\n renderCard?: (row: T, selection: DataViewCardSelection) => React.ReactNode;\n /**\n * Opt-in \"Quadro\" (board) layout: the loaded page laid out as columns of one\n * grouping field. Reuses `renderCard`, so supplying a board WITHOUT one simply\n * offers no board. Best when the groups are states in a state machine — derive\n * these groups and `scopes` from ONE definition so the two cannot drift.\n */\n board?: BoardConfig<T>;\n /**\n * Opt-in \"Lista\" layout (FUT-733): one FULL-WIDTH row per record, rendered by\n * the entity — a marker, a title, a subtitle and a value on the right. Sits\n * between the table (compare columns) and the cards (browse); omit ⇒ not\n * offered, exactly as `renderCard` gates the cards.\n */\n renderListRow?: (row: T, selection: DataViewCardSelection) => React.ReactNode;\n /**\n * The Lista's SHARED COLUMNS — declared once for the list, obeyed by every row.\n *\n * This is what makes a list line up by construction rather than by convention.\n * Omit it and each row still resolves its own tracks from its own config,\n * which agrees with its neighbours right up until one row carries an unusually\n * wide value.\n */\n listGroup?: ListGroupConfig<T>;\n /**\n * The page-level partition rendered as an exclusive tab strip above the\n * toolbar, with server-supplied counts. Requires `server`: a scope is applied\n * at the backend, never in the browser.\n */\n scopes?: ScopeConfig[];\n /** The row field the scopes partition by — used only to reject a pill over the same field. */\n scopeFieldId?: string;\n /** Which layout to show first when the user has expressed no preference (default \"table\"). */\n defaultLayout?: DataViewsLayout;\n /**\n * Ignore the remembered cross-screen layout preference and pin to\n * `defaultLayout`. For tables that exist to SHOW a layout — stories, docs,\n * screenshots — not for real screens.\n */\n ignoreStoredLayout?: boolean;\n /**\n * Opt into the responsive inline filter UX (collapsible filter row on wide\n * screens, modal on narrow). Default `false` keeps the classic slide-in panel.\n */\n inlineFilters?: boolean;\n /** Keep the inline search visible with no filter fields and no active search. */\n alwaysShowSearch?: boolean;\n /** Server-mode wiring; when set the grid is backend-driven (no client filter/sort/paginate). */\n server?: DataViewServer;\n}\n\n/**\n * Surface the visible (filtered) rows so a page-level Export matches the view.\n *\n * Pages pass inline column/field arrays, so `matched` is a fresh reference on\n * every render even when its contents are unchanged. The guard is a signature\n * over the rows' *contents* (not just their ids), so the callback — and the\n * parent `useState` it usually drives — fires only when the visible data\n * actually changes. Ids alone are not enough: a server refresh can change a\n * visible row's values while keeping its id, and the export must reflect them.\n * Content-equal renders keep the same signature, so this never loops.\n */\nfunction useVisibleRowsNotifier<T>(matched: T[], onVisibleRowsChange?: (rows: T[]) => void): void {\n const visibleSignature = JSON.stringify(matched);\n const lastSignature = useRef<string | null>(null);\n useEffect(() => {\n if (lastSignature.current === visibleSignature) return;\n lastSignature.current = visibleSignature;\n onVisibleRowsChange?.(matched);\n }, [visibleSignature, matched, onVisibleRowsChange]);\n}\n\n/**\n * The reusable admin DataViews table (FUT-88): the shared ContentToolbar +\n * TableFilter panel over `@12-apps/ui` DataGrid. State + derived data live in\n * {@link useDataViewsState}; the render lives in `GridShell`. This component just\n * connects the two. Reused across every admin list page.\n */\nexport function DataViewsGrid<T extends Record<string, unknown>>(\n props: DataViewsGridProps<T>,\n): React.JSX.Element {\n // Forwarded as a whole rather than restated name-by-name twice: this component\n // only ADDS the controller, and a 25-name destructure repeated in the JSX is\n // where a newly added prop silently stops being passed on.\n const { rangeFields = [], testIdPrefix = \"table\" } = props;\n const controller = useDataViewsState({ ...props, rangeFields, testIdPrefix });\n useVisibleRowsNotifier(controller.matched, props.onVisibleRowsChange);\n return <GridShell {...props} c={controller} rangeFields={rangeFields} testIdPrefix={testIdPrefix} />;\n}\n"],"mappings":";;;;;;;;AAEA,SAAS,WAAW,cAAc;AAgOzB;AAzBT,SAAS,uBAA0B,SAAc,qBAAiD;AAChG,QAAM,mBAAmB,KAAK,UAAU,OAAO;AAC/C,QAAM,gBAAgB,OAAsB,IAAI;AAChD,YAAU,MAAM;AACd,QAAI,cAAc,YAAY,iBAAkB;AAChD,kBAAc,UAAU;AACxB,0BAAsB,OAAO;AAAA,EAC/B,GAAG,CAAC,kBAAkB,SAAS,mBAAmB,CAAC;AACrD;AAQO,SAAS,cACd,OACmB;AAInB,QAAM,EAAE,cAAc,CAAC,GAAG,eAAe,QAAQ,IAAI;AACrD,QAAM,aAAa,kBAAkB,EAAE,GAAG,OAAO,aAAa,aAAa,CAAC;AAC5E,yBAAuB,WAAW,SAAS,MAAM,mBAAmB;AACpE,SAAO,oBAAC,aAAW,GAAG,OAAO,GAAG,YAAY,aAA0B,cAA4B;AACpG;","names":[]}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
badgeContentOf,
|
|
3
|
+
definedAria,
|
|
4
|
+
formatCount,
|
|
5
|
+
resolveBadgeProps
|
|
6
|
+
} from "./chunk-6C5D6O3D.js";
|
|
1
7
|
import {
|
|
2
8
|
buildBadgeContent
|
|
3
9
|
} from "./chunk-ZNCYCE7L.js";
|
|
@@ -5,12 +11,6 @@ import {
|
|
|
5
11
|
badgeStyles,
|
|
6
12
|
getAnchorOrigin
|
|
7
13
|
} from "./chunk-2L3VRVRE.js";
|
|
8
|
-
import {
|
|
9
|
-
badgeContentOf,
|
|
10
|
-
definedAria,
|
|
11
|
-
formatCount,
|
|
12
|
-
resolveBadgeProps
|
|
13
|
-
} from "./chunk-6C5D6O3D.js";
|
|
14
14
|
import {
|
|
15
15
|
CLOSE_DELAY_MS,
|
|
16
16
|
MOUNT_ANIMATION_MS
|
|
@@ -180,4 +180,4 @@ Badge.displayName = "Badge";
|
|
|
180
180
|
export {
|
|
181
181
|
Badge
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-N5PVD4J5.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 /** Absent when the grid is `selectable={false}`: pass it on as-is, and no checkbox is drawn. */\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":";AAqEO,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":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CountedIcon,
|
|
5
5
|
controlProps,
|
|
6
6
|
focusRing
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JXW6DZDN.js";
|
|
8
8
|
import {
|
|
9
9
|
Drawer,
|
|
10
10
|
DrawerContent,
|
|
@@ -175,4 +175,4 @@ function SectionNavSheet({
|
|
|
175
175
|
export {
|
|
176
176
|
SectionNavSheet
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-QQWW6T4Q.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Chart
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AMLHEKSV.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-SB2SEGR6.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rowGutters
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3WLS7Z7D.js";
|
|
4
4
|
import {
|
|
5
5
|
cellRailsTemplate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7J5JR33K.js";
|
|
7
7
|
import {
|
|
8
8
|
cellTracks,
|
|
9
9
|
compactCellTracks,
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
useRowLayout,
|
|
56
56
|
StandaloneContainer
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-SUZLGB5I.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cardGridTracks
|
|
3
|
+
} from "./chunk-XZE5FIRB.js";
|
|
4
|
+
import {
|
|
5
|
+
default as default2
|
|
6
|
+
} from "./chunk-6DPAWXZ3.js";
|
|
7
|
+
|
|
8
|
+
// src/components/data-display/DataViews/data-views-card-body.tsx
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function CardBody({
|
|
11
|
+
rows,
|
|
12
|
+
renderCard,
|
|
13
|
+
getRowId,
|
|
14
|
+
selectedIds,
|
|
15
|
+
onToggleId,
|
|
16
|
+
targetCardWidth,
|
|
17
|
+
cardScale,
|
|
18
|
+
dataTestId,
|
|
19
|
+
emptyState
|
|
20
|
+
}) {
|
|
21
|
+
if (rows.length === 0) {
|
|
22
|
+
return /* @__PURE__ */ jsx(default2, { sx: { mt: 1.5 }, children: emptyState });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
default2,
|
|
26
|
+
{
|
|
27
|
+
sx: {
|
|
28
|
+
mt: 1.5,
|
|
29
|
+
display: "grid",
|
|
30
|
+
// Fixed inter-card gap — deliberately NOT scaled by the zoom slider, so
|
|
31
|
+
// only the cards grow while the space between them stays constant.
|
|
32
|
+
gap: 1.5,
|
|
33
|
+
...cardGridTracks(targetCardWidth)
|
|
34
|
+
},
|
|
35
|
+
"data-testid": dataTestId ? `${dataTestId}-cards` : "data-views-cards",
|
|
36
|
+
children: rows.map((row) => {
|
|
37
|
+
const id = getRowId(row);
|
|
38
|
+
return /* @__PURE__ */ jsx(default2, { children: renderCard(row, {
|
|
39
|
+
selected: selectedIds.has(id),
|
|
40
|
+
onToggleSelect: onToggleId && (() => onToggleId(id)),
|
|
41
|
+
scale: cardScale
|
|
42
|
+
}) }, id);
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
CardBody
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-SZSS5KKX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-card-body.tsx"],"sourcesContent":["\"use client\";\n\nimport { Box } from \"../../../mui/Box\";\n\nimport { cardGridTracks } from \"./data-views-grid-helpers\";\nimport type { DataViewCardSelection } from \"./data-views-types\";\n\n/* ── Body (cards) — split out of `data-views-grid-bodies` for its line budget ── */\n\ninterface CardBodyProps<T extends Record<string, unknown>> {\n rows: T[];\n renderCard: (row: T, selection: DataViewCardSelection) => React.ReactNode;\n getRowId: (row: T) => string | number;\n selectedIds: Set<string | number>;\n /** Absent on a grid that is not selectable: the card is handed no toggle. */\n onToggleId?: (id: string | number) => void;\n /** The width each card asks for; `auto-fill` turns it into a column count. */\n targetCardWidth: number;\n /** Content scale (padding + type) handed to each card, from the zoom slider. */\n cardScale: number;\n dataTestId?: string;\n emptyState?: React.ReactNode;\n}\n\n/**\n * The \"Grade\" layout: the filtered/sorted rows rendered as an auto-filling grid\n * of entity-supplied cards. Reuses `rows` (= `c.matched`), so search/filter/sort\n * apply; the column width comes from the zoom slider, and each card is handed its\n * selection state so it can drive its own checkbox (BaseCard) — the same\n * selection model as the table. On a grid that is not selectable the toggle is\n * left out, which is what hides the card's checkbox.\n */\nexport function CardBody<T extends Record<string, unknown>>({\n rows,\n renderCard,\n getRowId,\n selectedIds,\n onToggleId,\n targetCardWidth,\n cardScale,\n dataTestId,\n emptyState,\n}: CardBodyProps<T>): React.JSX.Element {\n if (rows.length === 0) {\n return <Box sx={{ mt: 1.5 }}>{emptyState}</Box>;\n }\n return (\n <Box\n sx={{\n mt: 1.5,\n display: \"grid\",\n // Fixed inter-card gap — deliberately NOT scaled by the zoom slider, so\n // only the cards grow while the space between them stays constant.\n gap: 1.5,\n ...cardGridTracks(targetCardWidth),\n }}\n data-testid={dataTestId ? `${dataTestId}-cards` : \"data-views-cards\"}\n >\n {rows.map((row) => {\n const id = getRowId(row);\n return (\n <Box key={id}>\n {renderCard(row, {\n selected: selectedIds.has(id),\n onToggleSelect: onToggleId && (() => onToggleId(id)),\n scale: cardScale,\n })}\n </Box>\n );\n })}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;AA4CW;AAZJ,SAAS,SAA4C;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwC;AACtC,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,oBAACA,UAAA,EAAI,IAAI,EAAE,IAAI,IAAI,GAAI,sBAAW;AAAA,EAC3C;AACA,SACE;AAAA,IAACA;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,SAAS;AAAA;AAAA;AAAA,QAGT,KAAK;AAAA,QACL,GAAG,eAAe,eAAe;AAAA,MACnC;AAAA,MACA,eAAa,aAAa,GAAG,UAAU,WAAW;AAAA,MAEjD,eAAK,IAAI,CAAC,QAAQ;AACjB,cAAM,KAAK,SAAS,GAAG;AACvB,eACE,oBAACA,UAAA,EACE,qBAAW,KAAK;AAAA,UACf,UAAU,YAAY,IAAI,EAAE;AAAA,UAC5B,gBAAgB,eAAe,MAAM,WAAW,EAAE;AAAA,UAClD,OAAO;AAAA,QACT,CAAC,KALO,EAMV;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;","names":["default"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveAxisConfig,
|
|
3
|
-
resolveBarGeometry
|
|
4
|
-
} from "./chunk-SOHQPPYJ.js";
|
|
5
1
|
import {
|
|
6
2
|
getAxisStyles,
|
|
7
3
|
getDefaultColors,
|
|
8
4
|
getSizeStyles,
|
|
9
5
|
resolveSeries
|
|
10
6
|
} from "./chunk-TCWISGSS.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveAxisConfig,
|
|
9
|
+
resolveBarGeometry
|
|
10
|
+
} from "./chunk-SOHQPPYJ.js";
|
|
11
11
|
import {
|
|
12
12
|
remPx
|
|
13
13
|
} from "./chunk-YKCAJ2TN.js";
|
|
@@ -73,4 +73,4 @@ function marginPx(theme, margin) {
|
|
|
73
73
|
export {
|
|
74
74
|
buildChartContext
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-TZC6KIK2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RAIL_GAP_PX
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7J5JR33K.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPACT_BREAK,
|
|
6
6
|
META_BREAK
|
|
@@ -257,4 +257,4 @@ export {
|
|
|
257
257
|
ListCardActions,
|
|
258
258
|
ListCardTail
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-UZ2CEJOO.js.map
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from "./chunk-LYVTJLCF.js";
|
|
8
8
|
import {
|
|
9
9
|
SheetBody
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5MMAV7XK.js";
|
|
11
11
|
import {
|
|
12
12
|
SheetOverlay
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JKNKGGOG.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_DRAG_RESISTANCE,
|
|
16
16
|
DEFAULT_VELOCITY_THRESHOLD,
|
|
@@ -126,7 +126,7 @@ var Sheet = (props) => {
|
|
|
126
126
|
);
|
|
127
127
|
const isSwipeable = swipeable && !orientation.isDraggableVariant;
|
|
128
128
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
-
showOverlay && isOpen && /* @__PURE__ */ jsx(SheetOverlay, { open: isOpen, onClick: handleOverlayClick, blur: variant === "glass" }),
|
|
129
|
+
showOverlay && isOpen && /* @__PURE__ */ jsx(SheetOverlay, { open: isOpen, onClick: handleOverlayClick, blur: variant === "glass", animated: resolved.animated }),
|
|
130
130
|
isSwipeable ? /* @__PURE__ */ jsx(
|
|
131
131
|
SwipeableDrawer,
|
|
132
132
|
{
|
|
@@ -143,4 +143,4 @@ var Sheet = (props) => {
|
|
|
143
143
|
export {
|
|
144
144
|
Sheet
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-V45JGJ3W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Sheet/Sheet.tsx"],"sourcesContent":["import Drawer from '@mui/material/Drawer/index.js';\nimport SwipeableDrawer from '@mui/material/SwipeableDrawer/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport type { BackdropProps } from '@mui/material/Backdrop/index.js';\nimport React from 'react';\n\nimport { withDefaults } from '../../../utils/withDefaults';\n\nimport {\n DEFAULT_DRAG_RESISTANCE,\n DEFAULT_VELOCITY_THRESHOLD,\n SPRING_CONFIG,\n} from './Sheet.animations';\nimport { SheetBody } from './Sheet.body';\nimport { useSheetDrag, useSheetOpen } from './Sheet.hooks';\nimport { SheetOverlay } from './Sheet.parts';\nimport { panelSx } from './Sheet.styles';\nimport type { SheetProps } from './Sheet.types';\n\nexport { SheetContent, SheetFooter, SheetHeader, SheetOverlay } from './Sheet.parts';\n\nconst DEFAULTS = {\n open: false,\n position: 'bottom',\n variant: 'default',\n size: 'md',\n color: 'primary',\n glow: false,\n pulse: false,\n glass: false,\n gradient: false,\n loading: false,\n disabled: false,\n showOverlay: true,\n closeOnOverlayClick: true,\n closeOnEscape: true,\n showCloseButton: true,\n showHandle: true,\n swipeable: true,\n snapPoints: [0.25, 0.5, 0.75, 1],\n defaultSnapPoint: 0.5,\n minSnapPoint: 0,\n maxSnapPoint: 1,\n velocityThreshold: DEFAULT_VELOCITY_THRESHOLD,\n dragResistance: DEFAULT_DRAG_RESISTANCE,\n animationConfig: SPRING_CONFIG,\n persistent: false,\n fullHeight: false,\n rounded: true,\n elevation: 16,\n dataTestId: 'sheet',\n} satisfies Partial<SheetProps>;\n\n/**\n * The props with every defaulted key now guaranteed present. Without this the\n * component would need a `?? fallback` at each use site, and each of those is a\n * branch the complexity gate counts.\n */\ntype ResolvedSheetProps = SheetProps & Required<Pick<SheetProps, keyof typeof DEFAULTS>>;\n\n/**\n * The drawer's own backdrop, made invisible: it only CATCHES the tap.\n *\n * The visible veil is {@link SheetOverlay}, which knows about the `glass`\n * blur. But the drawer's modal root covers the whole viewport above that veil,\n * so with no backdrop at all a tap on the veil landed on the bare root, which\n * handles nothing — and no sheet ever closed on an outside tap. This one sits\n * under the panel, paints nothing, and hands the tap to the drawer's\n * `onClose('backdropClick')`, which the sheet routes through its own\n * `closeOnOverlayClick` / `persistent` rules.\n *\n * Defined at module scope: a component built inside a render is a new type on\n * every pass, which remounts the subtree it belongs to.\n */\nconst ClickCatcher = React.forwardRef<HTMLDivElement, BackdropProps & { 'data-testid'?: string }>(\n ({ onClick, 'data-testid': testId }, ref) => (\n <div\n ref={ref}\n aria-hidden\n onClick={onClick}\n data-testid={testId}\n style={{ position: 'fixed', inset: 0, backgroundColor: 'transparent' }}\n />\n ),\n) as React.ComponentType<BackdropProps>;\nClickCatcher.displayName = 'SheetClickCatcher';\n\n/**\n * Which way the sheet is anchored. Four flags rather than four repeated\n * comparisons, and the only thing the hooks and styles need to know about\n * `position` and `variant`.\n */\nconst orientationOf = ({ position, variant }: ResolvedSheetProps) => {\n const isBottomSheet = position === 'bottom';\n const isTopSheet = position === 'top';\n\n return {\n isBottomSheet,\n isTopSheet,\n isVerticalSheet: isBottomSheet || isTopSheet,\n isDraggableVariant: variant === 'draggable',\n };\n};\n\nexport const Sheet: React.FC<SheetProps> = (props) => {\n const resolved = withDefaults(props, DEFAULTS) as ResolvedSheetProps;\n const { position, variant, showOverlay, swipeable, className, dataTestId } = resolved;\n\n const theme = useTheme();\n const orientation = orientationOf(resolved);\n\n // Support both the dataTestId prop and a plain data-testid attribute.\n const testId = (resolved as { 'data-testid'?: string })['data-testid'] || dataTestId;\n\n const { sheetRef, currentHeight, isDragging, isAnimating, handleDragStart, resetToDefaultSnapPoint } =\n useSheetDrag({ ...resolved, ...orientation });\n\n const { isOpen, handleClose, handleOverlayClick, handleSwipeOpen } = useSheetOpen({\n ...resolved,\n ...orientation,\n resetToDefaultSnapPoint,\n });\n\n const drawerProps = {\n anchor: position,\n open: isOpen,\n className,\n ...(resolved.animated === false ? { transitionDuration: 0 } : {}),\n // A tap outside obeys `closeOnOverlayClick`. A swipe-to-dismiss (no\n // reason: SwipeableDrawer calls `onClose()` bare) closes. Escape is the\n // hook's own listener alone, which honours `closeOnEscape` — the modal's\n // is switched off below so the key never closes twice or past the flag.\n onClose: (_event?: object, reason?: 'backdropClick' | 'escapeKeyDown') =>\n reason === 'backdropClick' ? handleOverlayClick() : handleClose(),\n PaperProps: {\n ref: sheetRef,\n sx: panelSx({ ...resolved, ...orientation, theme, currentHeight, isDragging, isAnimating }),\n },\n ModalProps: {\n keepMounted: true,\n disableEscapeKeyDown: true,\n BackdropComponent: ClickCatcher,\n BackdropProps: { 'data-testid': testId ? `${testId}-click-catcher` : undefined } as Partial<BackdropProps>,\n },\n };\n\n const body = (\n <SheetBody\n {...resolved}\n {...orientation}\n testId={testId}\n isDragging={isDragging}\n onClose={handleClose}\n onDragStart={handleDragStart}\n />\n );\n\n // The draggable variant drives the panel's height itself; MUI's swipe handling\n // would be a second thing moving it.\n const isSwipeable = swipeable && !orientation.isDraggableVariant;\n\n return (\n <>\n {showOverlay && isOpen && (\n <SheetOverlay open={isOpen} onClick={handleOverlayClick} blur={variant === 'glass'} />\n )}\n\n {isSwipeable ? (\n <SwipeableDrawer\n {...drawerProps}\n onOpen={handleSwipeOpen}\n disableSwipeToOpen={false}\n swipeAreaWidth={20}\n >\n {body}\n </SwipeableDrawer>\n ) : (\n <Drawer {...drawerProps}>{body}</Drawer>\n )}\n </>\n );\n};\n"],"mappings":"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
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/Sheet/Sheet.tsx"],"sourcesContent":["import Drawer from '@mui/material/Drawer/index.js';\nimport SwipeableDrawer from '@mui/material/SwipeableDrawer/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport type { BackdropProps } from '@mui/material/Backdrop/index.js';\nimport React from 'react';\n\nimport { withDefaults } from '../../../utils/withDefaults';\n\nimport {\n DEFAULT_DRAG_RESISTANCE,\n DEFAULT_VELOCITY_THRESHOLD,\n SPRING_CONFIG,\n} from './Sheet.animations';\nimport { SheetBody } from './Sheet.body';\nimport { useSheetDrag, useSheetOpen } from './Sheet.hooks';\nimport { SheetOverlay } from './Sheet.parts';\nimport { panelSx } from './Sheet.styles';\nimport type { SheetProps } from './Sheet.types';\n\nexport { SheetContent, SheetFooter, SheetHeader, SheetOverlay } from './Sheet.parts';\n\nconst DEFAULTS = {\n open: false,\n position: 'bottom',\n variant: 'default',\n size: 'md',\n color: 'primary',\n glow: false,\n pulse: false,\n glass: false,\n gradient: false,\n loading: false,\n disabled: false,\n showOverlay: true,\n closeOnOverlayClick: true,\n closeOnEscape: true,\n showCloseButton: true,\n showHandle: true,\n swipeable: true,\n snapPoints: [0.25, 0.5, 0.75, 1],\n defaultSnapPoint: 0.5,\n minSnapPoint: 0,\n maxSnapPoint: 1,\n velocityThreshold: DEFAULT_VELOCITY_THRESHOLD,\n dragResistance: DEFAULT_DRAG_RESISTANCE,\n animationConfig: SPRING_CONFIG,\n persistent: false,\n fullHeight: false,\n rounded: true,\n elevation: 16,\n dataTestId: 'sheet',\n} satisfies Partial<SheetProps>;\n\n/**\n * The props with every defaulted key now guaranteed present. Without this the\n * component would need a `?? fallback` at each use site, and each of those is a\n * branch the complexity gate counts.\n */\ntype ResolvedSheetProps = SheetProps & Required<Pick<SheetProps, keyof typeof DEFAULTS>>;\n\n/**\n * The drawer's own backdrop, made invisible: it only CATCHES the tap.\n *\n * The visible veil is {@link SheetOverlay}, which knows about the `glass`\n * blur. But the drawer's modal root covers the whole viewport above that veil,\n * so with no backdrop at all a tap on the veil landed on the bare root, which\n * handles nothing — and no sheet ever closed on an outside tap. This one sits\n * under the panel, paints nothing, and hands the tap to the drawer's\n * `onClose('backdropClick')`, which the sheet routes through its own\n * `closeOnOverlayClick` / `persistent` rules.\n *\n * Defined at module scope: a component built inside a render is a new type on\n * every pass, which remounts the subtree it belongs to.\n */\nconst ClickCatcher = React.forwardRef<HTMLDivElement, BackdropProps & { 'data-testid'?: string }>(\n ({ onClick, 'data-testid': testId }, ref) => (\n <div\n ref={ref}\n aria-hidden\n onClick={onClick}\n data-testid={testId}\n style={{ position: 'fixed', inset: 0, backgroundColor: 'transparent' }}\n />\n ),\n) as React.ComponentType<BackdropProps>;\nClickCatcher.displayName = 'SheetClickCatcher';\n\n/**\n * Which way the sheet is anchored. Four flags rather than four repeated\n * comparisons, and the only thing the hooks and styles need to know about\n * `position` and `variant`.\n */\nconst orientationOf = ({ position, variant }: ResolvedSheetProps) => {\n const isBottomSheet = position === 'bottom';\n const isTopSheet = position === 'top';\n\n return {\n isBottomSheet,\n isTopSheet,\n isVerticalSheet: isBottomSheet || isTopSheet,\n isDraggableVariant: variant === 'draggable',\n };\n};\n\nexport const Sheet: React.FC<SheetProps> = (props) => {\n const resolved = withDefaults(props, DEFAULTS) as ResolvedSheetProps;\n const { position, variant, showOverlay, swipeable, className, dataTestId } = resolved;\n\n const theme = useTheme();\n const orientation = orientationOf(resolved);\n\n // Support both the dataTestId prop and a plain data-testid attribute.\n const testId = (resolved as { 'data-testid'?: string })['data-testid'] || dataTestId;\n\n const { sheetRef, currentHeight, isDragging, isAnimating, handleDragStart, resetToDefaultSnapPoint } =\n useSheetDrag({ ...resolved, ...orientation });\n\n const { isOpen, handleClose, handleOverlayClick, handleSwipeOpen } = useSheetOpen({\n ...resolved,\n ...orientation,\n resetToDefaultSnapPoint,\n });\n\n const drawerProps = {\n anchor: position,\n open: isOpen,\n className,\n ...(resolved.animated === false ? { transitionDuration: 0 } : {}),\n // A tap outside obeys `closeOnOverlayClick`. A swipe-to-dismiss (no\n // reason: SwipeableDrawer calls `onClose()` bare) closes. Escape is the\n // hook's own listener alone, which honours `closeOnEscape` — the modal's\n // is switched off below so the key never closes twice or past the flag.\n onClose: (_event?: object, reason?: 'backdropClick' | 'escapeKeyDown') =>\n reason === 'backdropClick' ? handleOverlayClick() : handleClose(),\n PaperProps: {\n ref: sheetRef,\n sx: panelSx({ ...resolved, ...orientation, theme, currentHeight, isDragging, isAnimating }),\n },\n ModalProps: {\n keepMounted: true,\n disableEscapeKeyDown: true,\n BackdropComponent: ClickCatcher,\n BackdropProps: { 'data-testid': testId ? `${testId}-click-catcher` : undefined } as Partial<BackdropProps>,\n },\n };\n\n const body = (\n <SheetBody\n {...resolved}\n {...orientation}\n testId={testId}\n isDragging={isDragging}\n onClose={handleClose}\n onDragStart={handleDragStart}\n />\n );\n\n // The draggable variant drives the panel's height itself; MUI's swipe handling\n // would be a second thing moving it.\n const isSwipeable = swipeable && !orientation.isDraggableVariant;\n\n return (\n <>\n {showOverlay && isOpen && (\n <SheetOverlay open={isOpen} onClick={handleOverlayClick} blur={variant === 'glass'} animated={resolved.animated} />\n )}\n\n {isSwipeable ? (\n <SwipeableDrawer\n {...drawerProps}\n onOpen={handleSwipeOpen}\n disableSwipeToOpen={false}\n swipeAreaWidth={20}\n >\n {body}\n </SwipeableDrawer>\n ) : (\n <Drawer {...drawerProps}>{body}</Drawer>\n )}\n </>\n );\n};\n"],"mappings":"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","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-PL2AB5HJ.js";
|
|
4
4
|
import {
|
|
5
5
|
useDataViewsLayout
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JYMXYSDP.js";
|
|
7
7
|
|
|
8
8
|
// src/components/data-display/DataViews/data-views-scope-tabs.tsx
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -34,4 +34,4 @@ function ScopeTabsSlot({
|
|
|
34
34
|
export {
|
|
35
35
|
ScopeTabsSlot
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-VJB63DUM.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SectionNavSheet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QQWW6T4Q.js";
|
|
4
4
|
import {
|
|
5
5
|
RaisedActionButton
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KDQEJAKH.js";
|
|
7
7
|
import {
|
|
8
8
|
Box,
|
|
9
9
|
CONTROL_RESET,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
controlProps,
|
|
14
14
|
destinationControl,
|
|
15
15
|
focusRing
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JXW6DZDN.js";
|
|
17
17
|
import {
|
|
18
18
|
barSlots,
|
|
19
19
|
destinationState,
|
|
@@ -291,4 +291,4 @@ export {
|
|
|
291
291
|
sectionNavBarInset,
|
|
292
292
|
SectionNavBar
|
|
293
293
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-XBTSKYYY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RailCreateMenu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AKGXNC4R.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-JXW6DZDN.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-ZDT4ZGP4.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "../chunk-5AK2EZG5.js";
|
|
2
2
|
import {
|
|
3
3
|
Badge
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-N5PVD4J5.js";
|
|
5
|
+
import "../chunk-6C5D6O3D.js";
|
|
5
6
|
import "../chunk-ZNCYCE7L.js";
|
|
6
7
|
import "../chunk-2L3VRVRE.js";
|
|
7
8
|
import "../chunk-BJE3XHD4.js";
|
|
8
|
-
import "../chunk-6C5D6O3D.js";
|
|
9
9
|
import "../chunk-3UIDKLML.js";
|
|
10
10
|
import "../chunk-PYC4CWCQ.js";
|
|
11
11
|
import "../chunk-TYJR4GOF.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRowConfirm
|
|
3
|
+
} from "../chunk-J4AHFEEV.js";
|
|
1
4
|
import {
|
|
2
5
|
useRemoveConfirm
|
|
3
6
|
} from "../chunk-FTCJPTDA.js";
|
|
@@ -18,9 +21,6 @@ import {
|
|
|
18
21
|
import {
|
|
19
22
|
CardKebab
|
|
20
23
|
} from "../chunk-P4LR2GLN.js";
|
|
21
|
-
import {
|
|
22
|
-
useRowConfirm
|
|
23
|
-
} from "../chunk-J4AHFEEV.js";
|
|
24
24
|
import "../chunk-WVML3ENZ.js";
|
|
25
25
|
import "../chunk-AY5GKCH7.js";
|
|
26
26
|
import "../chunk-XCBQXSTR.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-5KLSLD72.js";
|
|
2
2
|
import {
|
|
3
3
|
SpecChart
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-SB2SEGR6.js";
|
|
5
5
|
import {
|
|
6
6
|
Chart
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-AMLHEKSV.js";
|
|
8
8
|
import {
|
|
9
9
|
CHART_SEMANTIC_COLORS,
|
|
10
10
|
ChartSpecError,
|
|
@@ -20,8 +20,9 @@ import {
|
|
|
20
20
|
getRegisteredChartSpecTypes,
|
|
21
21
|
registerChartSpecRenderer
|
|
22
22
|
} from "../chunk-WKUA6P3W.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-6ATXOJVQ.js";
|
|
24
|
+
import "../chunk-TZC6KIK2.js";
|
|
25
|
+
import "../chunk-TCWISGSS.js";
|
|
25
26
|
import "../chunk-SOHQPPYJ.js";
|
|
26
27
|
import {
|
|
27
28
|
ChartContainer,
|
|
@@ -30,7 +31,6 @@ import {
|
|
|
30
31
|
ChartTooltip,
|
|
31
32
|
ChartTooltipContent
|
|
32
33
|
} from "../chunk-RIRTW5EU.js";
|
|
33
|
-
import "../chunk-TCWISGSS.js";
|
|
34
34
|
import "../chunk-B7ZHEOQQ.js";
|
|
35
35
|
import "../chunk-BRHRK7BK.js";
|
|
36
36
|
import "../chunk-25MSGLNU.js";
|