@12-apps/ui 6.66.1 → 6.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.js +2 -2
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.parts.js +1 -1
- package/dist/_internal/components/data-display/Avatar/Avatar.js +4 -4
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +7 -7
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +7 -7
- package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
- package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
- package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +31 -28
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +41 -38
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +7 -7
- 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-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-empty.js +5 -3
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +7 -6
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +28 -25
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +11 -5
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +8 -3
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +7 -4
- package/dist/_internal/components/data-display/DataViews/data-views-overflow-fields.js +18 -0
- package/dist/_internal/components/data-display/DataViews/data-views-overflow-fields.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-overflow.js +6 -2
- package/dist/_internal/components/data-display/DataViews/data-views-quick-chip.js +20 -0
- package/dist/_internal/components/data-display/DataViews/data-views-quick-chip.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-quick-types.js +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-quick-types.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.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 +8 -7
- package/dist/_internal/components/data-display/DataViews/data-views-sticky-head.js +21 -0
- package/dist/_internal/components/data-display/DataViews/data-views-sticky-head.js.map +1 -0
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +7 -6
- 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 +3 -3
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/_internal/components/data-display/index.js +21 -21
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.js +4 -4
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.parts.js +3 -3
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +5 -5
- package/dist/_internal/components/feedback/ConfirmAction/with-confirmation.js +4 -4
- package/dist/_internal/components/feedback/index.js +6 -6
- package/dist/_internal/components/index.js +25 -25
- package/dist/_internal/user-avatar/user-avatar.js +5 -5
- package/dist/charts.js +11 -11
- package/dist/{chunk-35L5YMYQ.js → chunk-2QB4WIU5.js} +6 -6
- package/dist/chunk-4IE66GY2.js +89 -0
- package/dist/chunk-4IE66GY2.js.map +1 -0
- package/dist/{chunk-IPCRPGWU.js → chunk-4W6AQFMO.js} +2 -2
- package/dist/{chunk-JYMXYSDP.js → chunk-5CAWRMDX.js} +2 -2
- package/dist/{chunk-UD4R5HMI.js → chunk-5JRAQ4D5.js} +2 -2
- package/dist/{chunk-L7OWFJUU.js → chunk-5RC7WAHH.js} +40 -34
- package/dist/chunk-5RC7WAHH.js.map +1 -0
- package/dist/{chunk-647DEGIU.js → chunk-5WJFCQFN.js} +7 -7
- package/dist/{chunk-FTCJPTDA.js → chunk-62BY4ZUQ.js} +2 -2
- package/dist/{chunk-J4AHFEEV.js → chunk-6QOJEZDH.js} +2 -2
- package/dist/{chunk-K6KBASL2.js → chunk-72L5C74V.js} +2 -2
- package/dist/{chunk-TKLPPAS5.js → chunk-AHNEEFK6.js} +2 -2
- package/dist/chunk-AT6UKTH4.js +129 -0
- package/dist/chunk-AT6UKTH4.js.map +1 -0
- package/dist/{chunk-BI7YMVKZ.js → chunk-B2JSUFDX.js} +2 -2
- package/dist/{chunk-7J5JR33K.js → chunk-BBBHPK2Q.js} +2 -2
- package/dist/{chunk-IQQX3NDO.js → chunk-BGTG7G54.js} +5 -2
- package/dist/chunk-BGTG7G54.js.map +1 -0
- package/dist/{chunk-UZ2CEJOO.js → chunk-CSJ7WNXU.js} +2 -2
- package/dist/{chunk-6QYKZMEE.js → chunk-CSLBRJ7N.js} +40 -25
- package/dist/chunk-CSLBRJ7N.js.map +1 -0
- package/dist/{chunk-LMIOWP6H.js → chunk-D34PZJH3.js} +2 -2
- package/dist/{chunk-SUZLGB5I.js → chunk-E6K2UZGR.js} +3 -3
- package/dist/{chunk-7XSCEHGA.js → chunk-EOQ6EKTS.js} +7 -7
- package/dist/chunk-GCYGVWOI.js +59 -0
- package/dist/chunk-GCYGVWOI.js.map +1 -0
- package/dist/{chunk-7QRUGEGE.js → chunk-GICG3XJK.js} +2 -2
- package/dist/{chunk-AMLHEKSV.js → chunk-HI7JPDD6.js} +5 -5
- package/dist/{chunk-O2P2KTKN.js → chunk-HLYYB4O5.js} +1 -1
- package/dist/chunk-HLYYB4O5.js.map +1 -0
- package/dist/{chunk-KARMRTTM.js → chunk-J2RUDZVJ.js} +7 -7
- package/dist/{chunk-HQCZT6TO.js → chunk-JVOEVTCZ.js} +5 -5
- package/dist/{chunk-VJB63DUM.js → chunk-K3PMMW23.js} +2 -2
- package/dist/{chunk-J6DYHBID.js → chunk-LIN4A2BW.js} +7 -7
- package/dist/{chunk-FXZUVZON.js → chunk-LWZ2K225.js} +6 -6
- package/dist/{chunk-LGCZRKED.js → chunk-NJMAFII4.js} +2 -2
- package/dist/{chunk-FNFDXJWR.js → chunk-P3USTYIO.js} +4 -4
- package/dist/chunk-P3USTYIO.js.map +1 -0
- package/dist/{chunk-MJ6EAND6.js → chunk-Q7BGMLCX.js} +2 -2
- package/dist/{chunk-6ATXOJVQ.js → chunk-QADTI63U.js} +4 -4
- package/dist/{chunk-M6V7Y7CP.js → chunk-QAZLQYSD.js} +3 -3
- package/dist/chunk-QAZLQYSD.js.map +1 -0
- package/dist/{chunk-L6MGAPBX.js → chunk-RCZ4KL2H.js} +5 -3
- package/dist/chunk-RCZ4KL2H.js.map +1 -0
- package/dist/{chunk-SFZHGDRH.js → chunk-RX2XP7V5.js} +2 -2
- package/dist/{chunk-VI6HYB2W.js → chunk-RZCXYKY4.js} +5 -2
- package/dist/chunk-RZCXYKY4.js.map +1 -0
- package/dist/{chunk-YLSSQJZM.js → chunk-T7ZERP7A.js} +30 -2
- package/dist/chunk-T7ZERP7A.js.map +1 -0
- package/dist/{chunk-SB2SEGR6.js → chunk-TIM4PXWN.js} +3 -3
- package/dist/{chunk-Y7YKIIYS.js → chunk-TQXB2OHP.js} +28 -4
- package/dist/chunk-TQXB2OHP.js.map +1 -0
- package/dist/{chunk-3WLS7Z7D.js → chunk-UMOHHWXY.js} +3 -3
- package/dist/{chunk-S4JXSC4D.js → chunk-V6SRBQMN.js} +5 -5
- package/dist/{chunk-JY5YINUH.js → chunk-WQ32YFM5.js} +15 -7
- package/dist/chunk-WQ32YFM5.js.map +1 -0
- package/dist/{chunk-ERA3AEWU.js → chunk-WTGIW7LX.js} +12 -3
- package/dist/chunk-WTGIW7LX.js.map +1 -0
- package/dist/{chunk-2VMIHFMX.js → chunk-WVIJFS5Y.js} +9 -4
- package/dist/chunk-WVIJFS5Y.js.map +1 -0
- package/dist/{chunk-375HTCF2.js → chunk-Y2CCXB7R.js} +18 -2
- package/dist/chunk-Y2CCXB7R.js.map +1 -0
- package/dist/{chunk-33XGC4YU.js → chunk-YEGZIYVM.js} +2 -2
- package/dist/{chunk-TAUCPCNN.js → chunk-YNIOCELQ.js} +2 -2
- package/dist/data-display/AlertDialog.js +2 -2
- package/dist/data-display/Avatar.js +4 -4
- package/dist/data-display/CardKit.js +15 -15
- package/dist/data-display/Carousel.js +2 -2
- package/dist/data-display/Chart.js +11 -11
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +50 -47
- package/dist/feedback/ConfirmAction.js +6 -6
- package/dist/types/components/data-display/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/components/data-display/AlertDialog/AlertDialog.parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts +15 -1
- package/dist/types/components/data-display/DataViews/DataViewsGrid.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts +5 -1
- package/dist/types/components/data-display/DataViews/DataViewsTableBase.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-empty.d.ts +10 -0
- package/dist/types/components/data-display/DataViews/data-views-empty.d.ts.map +1 -1
- 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 +5 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-parts.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-inline-bar.d.ts +4 -1
- package/dist/types/components/data-display/DataViews/data-views-inline-bar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts +10 -1
- package/dist/types/components/data-display/DataViews/data-views-more-fields.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-more-filters.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow-fields.d.ts +56 -0
- package/dist/types/components/data-display/DataViews/data-views-overflow-fields.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts +7 -5
- package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-quick-chip.d.ts +16 -0
- package/dist/types/components/data-display/DataViews/data-views-quick-chip.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-quick-types.d.ts +33 -0
- package/dist/types/components/data-display/DataViews/data-views-quick-types.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-range-types.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-range-types.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts +11 -6
- package/dist/types/components/data-display/DataViews/data-views-shell-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-sticky-head.d.ts +45 -0
- package/dist/types/components/data-display/DataViews/data-views-sticky-head.d.ts.map +1 -0
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts +6 -0
- package/dist/types/components/data-display/DataViews/data-views-toolbar.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-types.d.ts +7 -4
- package/dist/types/components/data-display/DataViews/data-views-types.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/index.d.ts +1 -1
- package/dist/types/components/data-display/DataViews/index.d.ts.map +1 -1
- package/dist/user-avatar.js +5 -5
- package/package.json +1 -1
- package/src/components/data-display/AlertDialog/AlertDialog.parts.tsx +4 -1
- package/src/components/data-display/AlertDialog/AlertDialog.tsx +3 -0
- package/src/components/data-display/DataViews/DataViewsGrid.tsx +15 -0
- package/src/components/data-display/DataViews/DataViewsTableBase.tsx +5 -0
- package/src/components/data-display/DataViews/RESPONSIVE-BEHAVIOUR.md +50 -0
- package/src/components/data-display/DataViews/data-views-empty.tsx +25 -0
- package/src/components/data-display/DataViews/data-views-grid-bodies.tsx +11 -1
- package/src/components/data-display/DataViews/data-views-grid-parts.tsx +27 -15
- package/src/components/data-display/DataViews/data-views-inline-bar.tsx +24 -1
- package/src/components/data-display/DataViews/data-views-more-fields.tsx +34 -1
- package/src/components/data-display/DataViews/data-views-more-filters.tsx +20 -4
- package/src/components/data-display/DataViews/data-views-overflow-fields.ts +110 -0
- package/src/components/data-display/DataViews/data-views-overflow.ts +58 -36
- package/src/components/data-display/DataViews/data-views-quick-chip.tsx +143 -0
- package/src/components/data-display/DataViews/data-views-quick-types.ts +33 -0
- package/src/components/data-display/DataViews/data-views-range-types.ts +2 -0
- package/src/components/data-display/DataViews/data-views-shell-toolbar.tsx +31 -23
- package/src/components/data-display/DataViews/data-views-sticky-head.ts +132 -0
- package/src/components/data-display/DataViews/data-views-toolbar.tsx +9 -0
- package/src/components/data-display/DataViews/data-views-types.ts +7 -11
- package/src/components/data-display/DataViews/index.ts +1 -0
- package/dist/chunk-2VMIHFMX.js.map +0 -1
- package/dist/chunk-375HTCF2.js.map +0 -1
- package/dist/chunk-6QYKZMEE.js.map +0 -1
- package/dist/chunk-ERA3AEWU.js.map +0 -1
- package/dist/chunk-FNFDXJWR.js.map +0 -1
- package/dist/chunk-IQQX3NDO.js.map +0 -1
- package/dist/chunk-JY5YINUH.js.map +0 -1
- package/dist/chunk-L6MGAPBX.js.map +0 -1
- package/dist/chunk-L7OWFJUU.js.map +0 -1
- package/dist/chunk-M6V7Y7CP.js.map +0 -1
- package/dist/chunk-O2P2KTKN.js.map +0 -1
- package/dist/chunk-VI6HYB2W.js.map +0 -1
- package/dist/chunk-Y7YKIIYS.js.map +0 -1
- package/dist/chunk-YLSSQJZM.js.map +0 -1
- /package/dist/{chunk-35L5YMYQ.js.map → chunk-2QB4WIU5.js.map} +0 -0
- /package/dist/{chunk-IPCRPGWU.js.map → chunk-4W6AQFMO.js.map} +0 -0
- /package/dist/{chunk-JYMXYSDP.js.map → chunk-5CAWRMDX.js.map} +0 -0
- /package/dist/{chunk-UD4R5HMI.js.map → chunk-5JRAQ4D5.js.map} +0 -0
- /package/dist/{chunk-647DEGIU.js.map → chunk-5WJFCQFN.js.map} +0 -0
- /package/dist/{chunk-FTCJPTDA.js.map → chunk-62BY4ZUQ.js.map} +0 -0
- /package/dist/{chunk-J4AHFEEV.js.map → chunk-6QOJEZDH.js.map} +0 -0
- /package/dist/{chunk-K6KBASL2.js.map → chunk-72L5C74V.js.map} +0 -0
- /package/dist/{chunk-TKLPPAS5.js.map → chunk-AHNEEFK6.js.map} +0 -0
- /package/dist/{chunk-BI7YMVKZ.js.map → chunk-B2JSUFDX.js.map} +0 -0
- /package/dist/{chunk-7J5JR33K.js.map → chunk-BBBHPK2Q.js.map} +0 -0
- /package/dist/{chunk-UZ2CEJOO.js.map → chunk-CSJ7WNXU.js.map} +0 -0
- /package/dist/{chunk-LMIOWP6H.js.map → chunk-D34PZJH3.js.map} +0 -0
- /package/dist/{chunk-SUZLGB5I.js.map → chunk-E6K2UZGR.js.map} +0 -0
- /package/dist/{chunk-7XSCEHGA.js.map → chunk-EOQ6EKTS.js.map} +0 -0
- /package/dist/{chunk-7QRUGEGE.js.map → chunk-GICG3XJK.js.map} +0 -0
- /package/dist/{chunk-AMLHEKSV.js.map → chunk-HI7JPDD6.js.map} +0 -0
- /package/dist/{chunk-KARMRTTM.js.map → chunk-J2RUDZVJ.js.map} +0 -0
- /package/dist/{chunk-HQCZT6TO.js.map → chunk-JVOEVTCZ.js.map} +0 -0
- /package/dist/{chunk-VJB63DUM.js.map → chunk-K3PMMW23.js.map} +0 -0
- /package/dist/{chunk-J6DYHBID.js.map → chunk-LIN4A2BW.js.map} +0 -0
- /package/dist/{chunk-FXZUVZON.js.map → chunk-LWZ2K225.js.map} +0 -0
- /package/dist/{chunk-LGCZRKED.js.map → chunk-NJMAFII4.js.map} +0 -0
- /package/dist/{chunk-MJ6EAND6.js.map → chunk-Q7BGMLCX.js.map} +0 -0
- /package/dist/{chunk-6ATXOJVQ.js.map → chunk-QADTI63U.js.map} +0 -0
- /package/dist/{chunk-SFZHGDRH.js.map → chunk-RX2XP7V5.js.map} +0 -0
- /package/dist/{chunk-SB2SEGR6.js.map → chunk-TIM4PXWN.js.map} +0 -0
- /package/dist/{chunk-3WLS7Z7D.js.map → chunk-UMOHHWXY.js.map} +0 -0
- /package/dist/{chunk-S4JXSC4D.js.map → chunk-V6SRBQMN.js.map} +0 -0
- /package/dist/{chunk-33XGC4YU.js.map → chunk-YEGZIYVM.js.map} +0 -0
- /package/dist/{chunk-TAUCPCNN.js.map → chunk-YNIOCELQ.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, useRef, 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 { ShellEmpty } 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 { SHELL_PROPS, useStickyBarTop } from \"./data-views-sticky-head\";\nimport { togglePillValues } from \"./data-views-grid-helpers\";\nimport { toggleQuick } from \"./data-views-overflow-fields\";\nimport type {\n DataViewCardSelection,\n FilterFieldConfig,\n QuickFilterConfig,\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 /** Press a quick chip (its field becomes `[value]`), or release the pressed one. */\n onToggleQuick: (quick: QuickFilterConfig) => 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 quickFilters: QuickFilterConfig[];\n}\n\nfunction useGridShellFilters<T extends Record<string, unknown>>({\n c,\n inlineFilters,\n fields,\n rangeFields,\n testIdPrefix,\n alwaysShowSearch,\n hasExport,\n quickFilters,\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, quickFilters),\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 ||\n fields.length > 0 ||\n rangeFields.length > 0 ||\n quickFilters.length > 0 ||\n 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 onToggleQuick: (quick) => c.patch(({ pills }) => ({ pills: toggleQuick(pills, quick) })),\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 /** One-click toggle chips at the head of the bar — see `QuickFilterConfig`. */\n quickFilters?: QuickFilterConfig[];\n /** Pin the toolbar and the table header while the page scrolls. */\n stickyToolbar?: 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 const shellRef = useRef<HTMLDivElement>(null);\n useStickyBarTop(shellRef, props.stickyToolbar === true);\n const body = <ShellEmpty c={c} emptyState={emptyState} testIdPrefix={testIdPrefix} />;\n return (\n <TableFilter\n copy={copy.tableFilter} open={c.filterOpen} onOpenChange={c.setFilterOpen}\n hasActiveFilters={c.activeFilterCount > 0}\n >\n <Stack ref={shellRef} spacing={0} data-testid={dataTestId ? `${dataTestId}-container` : undefined} {...(props.stickyToolbar ? SHELL_PROPS : {})}>\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 sticky={props.stickyToolbar === true}\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 stickyHead={props.stickyToolbar === true}\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 quickFilters: props.quickFilters ?? [],\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,QAAQ,gBAAgB;AA4Q7B,cAwCL,YAxCK;AApNf,SAAS,gBAAmD;AAAA,EAC1D;AACF,GAES;AACP,QAAM,EAAE,OAAO,IAAI,mBAAmB;AACtC,QAAM,SAAS,EAAE,MAAM;AACvB,YAAU,MAAM;AACd,QAAI,WAAW,OAAQ,GAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EAE3C,GAAG,CAAC,QAAQ,MAAM,CAAC;AACnB,SAAO;AACT;AAuCA,SAAS,oBAAuD;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOE;AACA,QAAM,EAAE,MAAM,IAAI;AAGlB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAIlD,QAAM,QAAQ;AAAA,IACZ,iBAAiB,QAAQ,aAAa,YAAY;AAAA,IAClD,MAAM;AAAA,IACN,EAAE;AAAA,IACF,eAAe;AAAA,IACf;AAAA,EACF;AAUA,QAAM,aAAa;AACnB,QAAM,WAAW;AACjB,QAAM,gBACJ,eACC,oBACC,OAAO,SAAS,KAChB,YAAY,SAAS,KACrB,aAAa,SAAS,KACtB,MAAM,WAAW;AACrB,QAAM,cAAqC;AAAA,IACzC;AAAA,IACA,QAAQ,MAAM;AAAA,IACd;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAAA,IACb,QAAQ,EAAE;AAAA,IACV,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,MAAM,CAAC;AAAA;AAAA,IAEpD,cAAc,CAAC,SAAS,OAAO,YAC7B,EAAE,MAAM,CAAC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
} from "./chunk-7D7CJRL7.js";
|
|
7
|
-
import {
|
|
8
|
-
presetsFor
|
|
9
|
-
} from "./chunk-CBOB5AV6.js";
|
|
10
4
|
import {
|
|
11
5
|
isRangeInverted,
|
|
12
6
|
isRangeSet,
|
|
13
7
|
numericRange,
|
|
14
8
|
rangeChipLabel
|
|
15
9
|
} from "./chunk-GCZJH4XL.js";
|
|
10
|
+
import {
|
|
11
|
+
RangePresets
|
|
12
|
+
} from "./chunk-7D7CJRL7.js";
|
|
13
|
+
import {
|
|
14
|
+
presetsFor
|
|
15
|
+
} from "./chunk-CBOB5AV6.js";
|
|
16
16
|
import {
|
|
17
17
|
useDataViewsCopy
|
|
18
18
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -291,4 +291,4 @@ export {
|
|
|
291
291
|
RangePill,
|
|
292
292
|
PanelRangeField
|
|
293
293
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-5WJFCQFN.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-EMYESBIT.js";
|
|
7
7
|
import {
|
|
8
8
|
ConfirmActionDialog
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5JRAQ4D5.js";
|
|
10
10
|
|
|
11
11
|
// src/components/data-display/CardKit/use-remove-confirm.tsx
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -50,4 +50,4 @@ function useRemoveConfirm({
|
|
|
50
50
|
export {
|
|
51
51
|
useRemoveConfirm
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-62BY4ZUQ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-EMYESBIT.js";
|
|
4
4
|
import {
|
|
5
5
|
ConfirmActionDialog
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5JRAQ4D5.js";
|
|
7
7
|
|
|
8
8
|
// src/components/data-display/CardKit/use-row-confirm.tsx
|
|
9
9
|
import { useState } from "react";
|
|
@@ -43,4 +43,4 @@ function useRowConfirm({
|
|
|
43
43
|
export {
|
|
44
44
|
useRowConfirm
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-6QOJEZDH.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DisplayTab,
|
|
6
6
|
SortTab
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YEGZIYVM.js";
|
|
8
8
|
import {
|
|
9
9
|
ViewActions,
|
|
10
10
|
ViewFooter,
|
|
@@ -265,4 +265,4 @@ function DataViewsDisplayPanel({
|
|
|
265
265
|
export {
|
|
266
266
|
DataViewsDisplayPanel
|
|
267
267
|
};
|
|
268
|
-
//# sourceMappingURL=chunk-
|
|
268
|
+
//# sourceMappingURL=chunk-72L5C74V.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RQF4NXDC.js";
|
|
4
4
|
import {
|
|
5
5
|
PanelRangeField
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5WJFCQFN.js";
|
|
7
7
|
import {
|
|
8
8
|
useDataViewsCopy
|
|
9
9
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -157,4 +157,4 @@ export {
|
|
|
157
157
|
GridFilterPanel,
|
|
158
158
|
FilterDialog
|
|
159
159
|
};
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-AHNEEFK6.js.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
default as default2
|
|
3
|
+
} from "./chunk-6DPAWXZ3.js";
|
|
4
|
+
import {
|
|
5
|
+
fieldHeight
|
|
6
|
+
} from "./chunk-RGVNXES5.js";
|
|
7
|
+
import {
|
|
8
|
+
fieldEdge
|
|
9
|
+
} from "./chunk-7ZADLRLP.js";
|
|
10
|
+
import {
|
|
11
|
+
sxRem
|
|
12
|
+
} from "./chunk-YKCAJ2TN.js";
|
|
13
|
+
|
|
14
|
+
// src/components/data-display/DataViews/data-views-quick-chip.tsx
|
|
15
|
+
import Checkbox from "@mui/material/Checkbox/index.js";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function toneColor(theme, tone) {
|
|
18
|
+
return tone ? theme.palette[tone].main : theme.palette.text.secondary;
|
|
19
|
+
}
|
|
20
|
+
function QuickChip({
|
|
21
|
+
quick,
|
|
22
|
+
active,
|
|
23
|
+
onToggle,
|
|
24
|
+
testIdPrefix
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
default2,
|
|
28
|
+
{
|
|
29
|
+
component: "button",
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: onToggle,
|
|
32
|
+
"aria-pressed": active,
|
|
33
|
+
"data-testid": `${testIdPrefix}-quick-${quick.id}`,
|
|
34
|
+
sx: {
|
|
35
|
+
display: "inline-flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
gap: 0.75,
|
|
38
|
+
minHeight: fieldHeight,
|
|
39
|
+
px: 1.5,
|
|
40
|
+
border: 1,
|
|
41
|
+
borderStyle: "solid",
|
|
42
|
+
borderColor: (theme) => active ? theme.palette.text.primary : fieldEdge(theme),
|
|
43
|
+
borderRadius: 999,
|
|
44
|
+
bgcolor: active ? "text.primary" : "background.paper",
|
|
45
|
+
color: active ? "background.paper" : "text.primary",
|
|
46
|
+
cursor: "pointer",
|
|
47
|
+
font: "inherit",
|
|
48
|
+
fontSize: sxRem(13),
|
|
49
|
+
fontWeight: 500,
|
|
50
|
+
whiteSpace: "nowrap",
|
|
51
|
+
"&:hover": { borderColor: "text.primary" },
|
|
52
|
+
"&:focus-visible": {
|
|
53
|
+
outlineWidth: sxRem(2),
|
|
54
|
+
outlineStyle: "solid",
|
|
55
|
+
outlineColor: "primary.main",
|
|
56
|
+
// Inset, as the scope tabs draw theirs: the chip is the bar's full
|
|
57
|
+
// field height, and an outset ring is clipped above and below.
|
|
58
|
+
outlineOffset: sxRem(-2)
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
quick.label,
|
|
63
|
+
quick.count !== void 0 && /* @__PURE__ */ jsx(
|
|
64
|
+
default2,
|
|
65
|
+
{
|
|
66
|
+
component: "span",
|
|
67
|
+
sx: {
|
|
68
|
+
fontWeight: 400,
|
|
69
|
+
fontVariantNumeric: "tabular-nums",
|
|
70
|
+
color: (theme) => active ? "inherit" : toneColor(theme, quick.tone),
|
|
71
|
+
opacity: active ? 0.75 : 1
|
|
72
|
+
},
|
|
73
|
+
children: quick.count
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function QuickRow({
|
|
81
|
+
quick,
|
|
82
|
+
active,
|
|
83
|
+
onToggle,
|
|
84
|
+
testIdPrefix
|
|
85
|
+
}) {
|
|
86
|
+
return /* @__PURE__ */ jsxs(
|
|
87
|
+
default2,
|
|
88
|
+
{
|
|
89
|
+
component: "label",
|
|
90
|
+
"data-testid": `${testIdPrefix}-more-quick-${quick.id}`,
|
|
91
|
+
sx: {
|
|
92
|
+
display: "flex",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
gap: 0.25,
|
|
95
|
+
pr: 1,
|
|
96
|
+
minHeight: fieldHeight,
|
|
97
|
+
cursor: "pointer",
|
|
98
|
+
fontSize: sxRem(13),
|
|
99
|
+
color: active ? "primary.main" : "text.primary"
|
|
100
|
+
},
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Checkbox,
|
|
104
|
+
{
|
|
105
|
+
size: "small",
|
|
106
|
+
checked: active,
|
|
107
|
+
onChange: onToggle,
|
|
108
|
+
inputProps: { "aria-label": quick.label }
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ jsx(default2, { component: "span", sx: { flex: 1 }, children: quick.label }),
|
|
112
|
+
quick.count !== void 0 && /* @__PURE__ */ jsx(
|
|
113
|
+
default2,
|
|
114
|
+
{
|
|
115
|
+
component: "span",
|
|
116
|
+
sx: { fontVariantNumeric: "tabular-nums", color: (theme) => toneColor(theme, quick.tone) },
|
|
117
|
+
children: quick.count
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
QuickChip,
|
|
127
|
+
QuickRow
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=chunk-AT6UKTH4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-quick-chip.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * A QUICK CHIP — the toolbar's one-click filter (see `QuickFilterConfig`).\n *\n * Its own module because it is drawn in two places: on the bar, as a\n * pill-shaped toggle with its count, and inside \"Mais\" when the ladder had no\n * room for it, as a toggle row with the same label and count. Both write the\n * same state through `onToggleQuick`, so where the chip sits never changes what\n * it does.\n *\n * Hand-drawn rather than `Toggle` (MUI ToggleButton), as the range preset chips\n * beside it are: a ToggleButton is a squared group member with its own\n * selected tint, and this is a standalone pill whose pressed state INVERTS —\n * the approved Estoque prototype's chip, pill radius included.\n */\nimport Checkbox from \"@mui/material/Checkbox/index.js\";\nimport type { Theme } from \"@mui/material/styles/index.js\";\n\nimport { Box } from \"../../../mui/Box\";\nimport { fieldHeight } from \"../../../tokens/field-height\";\nimport { fieldEdge } from \"../../../tokens/field-edge\";\nimport { sxRem } from \"../../../tokens/relative\";\n\nimport type { QuickFilterConfig } from \"./data-views-types\";\n\n/** The count's colour: the attention the rows need, or neutral. */\nfunction toneColor(theme: Theme, tone: QuickFilterConfig[\"tone\"]): string {\n return tone ? theme.palette[tone].main : theme.palette.text.secondary;\n}\n\n/** The chip on the toolbar: pressed reads as a filled, inverted pill. */\nexport function QuickChip({\n quick,\n active,\n onToggle,\n testIdPrefix,\n}: {\n quick: QuickFilterConfig;\n active: boolean;\n onToggle: () => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n return (\n <Box\n component=\"button\"\n type=\"button\"\n onClick={onToggle}\n aria-pressed={active}\n data-testid={`${testIdPrefix}-quick-${quick.id}`}\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 0.75,\n minHeight: fieldHeight,\n px: 1.5,\n border: 1,\n borderStyle: \"solid\",\n borderColor: (theme: Theme) => (active ? theme.palette.text.primary : fieldEdge(theme)),\n borderRadius: 999,\n bgcolor: active ? \"text.primary\" : \"background.paper\",\n color: active ? \"background.paper\" : \"text.primary\",\n cursor: \"pointer\",\n font: \"inherit\",\n fontSize: sxRem(13),\n fontWeight: 500,\n whiteSpace: \"nowrap\",\n \"&:hover\": { borderColor: \"text.primary\" },\n \"&:focus-visible\": {\n outlineWidth: sxRem(2),\n outlineStyle: \"solid\",\n outlineColor: \"primary.main\",\n // Inset, as the scope tabs draw theirs: the chip is the bar's full\n // field height, and an outset ring is clipped above and below.\n outlineOffset: sxRem(-2),\n },\n }}\n >\n {quick.label}\n {quick.count !== undefined && (\n <Box\n component=\"span\"\n sx={{\n fontWeight: 400,\n fontVariantNumeric: \"tabular-nums\",\n color: (theme: Theme) => (active ? \"inherit\" : toneColor(theme, quick.tone)),\n opacity: active ? 0.75 : 1,\n }}\n >\n {quick.count}\n </Box>\n )}\n </Box>\n );\n}\n\n/** The same chip inside \"Mais\": a toggle row, label and count. */\nexport function QuickRow({\n quick,\n active,\n onToggle,\n testIdPrefix,\n}: {\n quick: QuickFilterConfig;\n active: boolean;\n onToggle: () => void;\n testIdPrefix: string;\n}): React.JSX.Element {\n return (\n <Box\n component=\"label\"\n data-testid={`${testIdPrefix}-more-quick-${quick.id}`}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 0.25,\n pr: 1,\n minHeight: fieldHeight,\n cursor: \"pointer\",\n fontSize: sxRem(13),\n color: active ? \"primary.main\" : \"text.primary\",\n }}\n >\n <Checkbox\n size=\"small\"\n checked={active}\n onChange={onToggle}\n inputProps={{ \"aria-label\": quick.label }}\n />\n <Box component=\"span\" sx={{ flex: 1 }}>\n {quick.label}\n </Box>\n {quick.count !== undefined && (\n <Box\n component=\"span\"\n sx={{ fontVariantNumeric: \"tabular-nums\", color: (theme: Theme) => toneColor(theme, quick.tone) }}\n >\n {quick.count}\n </Box>\n )}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,OAAO,cAAc;AA4BjB,SAoCI,KApCJ;AAjBJ,SAAS,UAAU,OAAc,MAAyC;AACxE,SAAO,OAAO,MAAM,QAAQ,IAAI,EAAE,OAAO,MAAM,QAAQ,KAAK;AAC9D;AAGO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKsB;AACpB,SACE;AAAA,IAACA;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,MAAK;AAAA,MACL,SAAS;AAAA,MACT,gBAAc;AAAA,MACd,eAAa,GAAG,YAAY,UAAU,MAAM,EAAE;AAAA,MAC9C,IAAI;AAAA,QACF,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,KAAK;AAAA,QACL,WAAW;AAAA,QACX,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,aAAa,CAAC,UAAkB,SAAS,MAAM,QAAQ,KAAK,UAAU,UAAU,KAAK;AAAA,QACrF,cAAc;AAAA,QACd,SAAS,SAAS,iBAAiB;AAAA,QACnC,OAAO,SAAS,qBAAqB;AAAA,QACrC,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,UAAU,MAAM,EAAE;AAAA,QAClB,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,WAAW,EAAE,aAAa,eAAe;AAAA,QACzC,mBAAmB;AA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;AAAA;AAAA,QACT;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["default"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
coerceViewState,
|
|
6
6
|
emptyViewState
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HLYYB4O5.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-B2JSUFDX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DENSITY_ROW_PADDING
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5CAWRMDX.js";
|
|
4
4
|
import {
|
|
5
5
|
GroupGrid
|
|
6
6
|
} from "./chunk-U3HEYECF.js";
|
|
@@ -133,4 +133,4 @@ export {
|
|
|
133
133
|
cellRailCount,
|
|
134
134
|
ListCardGroup
|
|
135
135
|
};
|
|
136
|
-
//# sourceMappingURL=chunk-
|
|
136
|
+
//# sourceMappingURL=chunk-BBBHPK2Q.js.map
|
|
@@ -15,7 +15,10 @@ var StyledDialogActions = styled(DialogActions, {
|
|
|
15
15
|
flexWrap: "wrap-reverse",
|
|
16
16
|
columnGap: theme.spacing(2),
|
|
17
17
|
rowGap: theme.spacing(1),
|
|
18
|
-
|
|
18
|
+
// A 40px tap target, the floor the kit's own Button keeps (FUT-3269): MUI's
|
|
19
|
+
// medium button is 37px, short of it on a phone.
|
|
20
|
+
"& > .MuiButton-root": { minHeight: rem(theme, 40) },
|
|
21
|
+
...fill && { "& > .MuiButton-root": { flexGrow: 1, minHeight: rem(theme, 40) } }
|
|
19
22
|
}));
|
|
20
23
|
var confirmButtonColor = (variant) => variant === "destructive" ? "error" : "primary";
|
|
21
24
|
var buttonLooks = (emphasis, variant) => emphasis === "cancel" ? {
|
|
@@ -93,4 +96,4 @@ function AlertDialogFooter({
|
|
|
93
96
|
export {
|
|
94
97
|
AlertDialogFooter
|
|
95
98
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-BGTG7G54.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/AlertDialog/AlertDialog.parts.tsx"],"sourcesContent":["/**\n * The AlertDialog's action row, kept apart from the dialog shell so each stays\n * inside the complexity budget: which button is filled, where each one sits,\n * and how the row wraps.\n */\nimport type { ButtonProps } from '@mui/material/Button/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport CircularProgress from '@mui/material/CircularProgress/index.js';\nimport DialogActions from '@mui/material/DialogActions/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { rem } from '../../../tokens/relative';\n\nimport type { AlertDialogProps } from './AlertDialog.types';\n\n/**\n * The action row WRAPS WHOLE BUTTONS; it never breaks a label inside one. A pair\n * that did not fit side by side used to squeeze the longer label onto two\n * lines, so one button stood twice as tall as its neighbour. Now the row breaks\n * instead. `wrap-reverse` puts the LAST button — the primary, whichever\n * `emphasis` picks — on top when it stacks, the same slot it holds on the right\n * when the row fits. A pair that fits is laid out exactly as before: natural\n * widths, pushed to the right.\n *\n * `fill` — set only by `emphasis=\"cancel\"` — lets the buttons grow to share the\n * row, and so to take the full width of their line once it stacks. It is not\n * the default because growing also stretches a pair that fits, which would\n * redraw every existing dialog's footer.\n *\n * Rendered with `disableSpacing`: MUI's own spacing is a left margin on every\n * button after the first, which would indent a button that wrapped onto a line\n * of its own. The gaps below replace it, at the same 16px across.\n */\nconst StyledDialogActions = styled(DialogActions, {\n shouldForwardProp: (prop) => prop !== 'fill',\n})<{ fill: boolean }>(({ theme, fill }) => ({\n padding: theme.spacing(2, 3, 3, 3),\n flexWrap: 'wrap-reverse',\n columnGap: theme.spacing(2),\n rowGap: theme.spacing(1),\n // A 40px tap target, the floor the kit's own Button keeps (FUT-3269): MUI's\n // medium button is 37px, short of it on a phone.\n '& > .MuiButton-root': { minHeight: rem(theme, 40) },\n ...(fill && { '& > .MuiButton-root': { flexGrow: 1, minHeight: rem(theme, 40) } }),\n}));\n\nconst confirmButtonColor = (variant: AlertDialogProps['variant']): 'error' | 'primary' =>\n variant === 'destructive' ? 'error' : 'primary';\n\ninterface ButtonLook {\n variant: ButtonProps['variant'];\n color: ButtonProps['color'];\n}\n\n/**\n * How each button is drawn, by `emphasis`: the emphasised one is filled, the\n * other a NEUTRAL outline. Primary / neutral both ways round — a confirm that\n * steps down drops the variant's colour too, so the one filled button is the\n * only coloured thing in the row and the eye has a single place to land.\n */\nconst buttonLooks = (\n emphasis: AlertDialogProps['emphasis'],\n variant: AlertDialogProps['variant'],\n): { cancel: ButtonLook; confirm: ButtonLook } =>\n emphasis === 'cancel'\n ? {\n cancel: { variant: 'contained', color: 'primary' },\n confirm: { variant: 'outlined', color: 'inherit' },\n }\n : {\n cancel: { variant: 'outlined', color: 'inherit' },\n confirm: { variant: 'contained', color: confirmButtonColor(variant) },\n };\n\n/**\n * The emphasis that applies: `cancel` only while the cancel is shown. A hidden\n * cancel with the confirm stepped down would leave a dialog with no primary.\n */\nconst effectiveEmphasis = (\n emphasis: AlertDialogProps['emphasis'],\n showCancel: boolean,\n): NonNullable<AlertDialogProps['emphasis']> =>\n emphasis === 'cancel' && showCancel ? 'cancel' : 'confirm';\n\n/**\n * Whether the cancel owns focus on open: what `initialFocus` says, and when it\n * says nothing, the emphasised button — so Enter on a steered question keeps\n * the work instead of completing the loss.\n */\nconst focusesCancel = (\n initialFocus: AlertDialogProps['initialFocus'],\n emphasis: NonNullable<AlertDialogProps['emphasis']>,\n): boolean => (initialFocus ?? emphasis) === 'cancel';\n\n/** The two buttons in slot order: the emphasised one LAST, the primary slot. */\nconst inSlotOrder = (\n emphasis: AlertDialogProps['emphasis'],\n cancel: React.ReactNode,\n confirm: React.ReactNode,\n): React.ReactNode[] => (emphasis === 'cancel' ? [confirm, cancel] : [cancel, confirm]);\n\n/**\n * Action row: the optional cancel button and the (variant-coloured) confirm,\n * with the emphasised one LAST — the primary slot, on the right or, once the\n * row stacks, on top. DOM order is the tab order, so it follows the same rule.\n */\nexport function AlertDialogFooter({\n variant,\n cancelText = 'Cancel',\n confirmText = 'Confirm',\n showCancel = true,\n loading = false,\n confirmDisabled = false,\n initialFocus,\n emphasis: asked,\n onCancel,\n onConfirm,\n dataTestId,\n}: Pick<\n AlertDialogProps,\n | 'variant'\n | 'cancelText'\n | 'confirmText'\n | 'showCancel'\n | 'loading'\n | 'confirmDisabled'\n | 'initialFocus'\n | 'emphasis'\n> & {\n onCancel: () => void;\n onConfirm: () => void;\n dataTestId: string;\n}): React.ReactElement {\n const theme = useTheme();\n const emphasis = effectiveEmphasis(asked, showCancel);\n const look = buttonLooks(emphasis, variant);\n const cancelFocused = focusesCancel(initialFocus, emphasis);\n const cancel = showCancel && (\n <Button\n key=\"cancel\"\n onClick={onCancel}\n variant={look.cancel.variant}\n color={look.cancel.color}\n disabled={loading}\n autoFocus={cancelFocused}\n data-testid={`${dataTestId}-cancel-button`}\n >\n {cancelText}\n </Button>\n );\n const confirm = (\n <Button\n key=\"confirm\"\n onClick={onConfirm}\n variant={look.confirm.variant}\n color={look.confirm.color}\n disabled={confirmDisabled || loading}\n startIcon={\n loading ? (\n <CircularProgress\n size={rem(theme, 16)}\n color=\"inherit\"\n data-testid={`${dataTestId}-loading-spinner`}\n />\n ) : undefined\n }\n autoFocus={!cancelFocused}\n data-testid={`${dataTestId}-confirm-button`}\n >\n {confirmText}\n </Button>\n );\n return (\n <StyledDialogActions\n disableSpacing\n fill={emphasis === 'cancel'}\n data-testid={`${dataTestId}-actions`}\n >\n {inSlotOrder(emphasis, cancel, confirm)}\n </StyledDialogActions>\n );\n}\n"],"mappings":";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ardTail
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-CSJ7WNXU.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
anyApplied,
|
|
3
|
+
isQuickActive,
|
|
4
|
+
keepChipsInOrder
|
|
5
|
+
} from "./chunk-GCYGVWOI.js";
|
|
1
6
|
import {
|
|
2
7
|
RESERVED,
|
|
3
8
|
estimateWidth,
|
|
@@ -18,42 +23,51 @@ import {
|
|
|
18
23
|
// src/components/data-display/DataViews/data-views-overflow.ts
|
|
19
24
|
import { useTheme } from "@mui/material/styles/index.js";
|
|
20
25
|
import { useRef } from "react";
|
|
21
|
-
function toOverflowFields(fields, rangeFields) {
|
|
22
|
-
return [
|
|
23
|
-
...fields.map((pill) => ({ id: pill.id, label: pill.label, group: "pill", pill })),
|
|
24
|
-
...rangeFields.map((range) => ({ id: range.id, label: range.label, group: "range", range }))
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
26
|
function isActiveField(field, pills, ranges) {
|
|
27
|
+
if (field.group === "quick" && field.quick) return isQuickActive(field.quick, pills);
|
|
28
28
|
return field.group === "pill" ? (pills[field.id]?.length ?? 0) > 0 : isRangeSet(ranges[field.id]);
|
|
29
29
|
}
|
|
30
30
|
function fieldWidth(theme, field, pills, ranges) {
|
|
31
|
+
if (field.group === "quick") return estimateWidth(theme, `${field.label} ${field.quick?.count ?? ""}`, -20);
|
|
31
32
|
if (field.group === "pill") return estimateWidth(theme, pillText(field, pills[field.id] ?? []), 0);
|
|
32
33
|
return estimateWidth(theme, field.label, isRangeSet(ranges[field.id]) ? 100 : 0);
|
|
33
34
|
}
|
|
34
35
|
function splitFilters(all, pills, ranges, width, furniture, compact, theme) {
|
|
35
|
-
const
|
|
36
|
-
const
|
|
36
|
+
const pinned = all.filter((field) => field.pinned);
|
|
37
|
+
const candidates = all.filter((field) => !field.pinned);
|
|
38
|
+
const chips = candidates.filter((field) => field.group === "quick");
|
|
39
|
+
const rest = candidates.filter((field) => field.group !== "quick");
|
|
40
|
+
const active = rest.filter((field) => isActiveField(field, pills, ranges));
|
|
41
|
+
const idle = rest.filter((field) => !isActiveField(field, pills, ranges));
|
|
37
42
|
const price = pricesFor(theme);
|
|
43
|
+
const moreCost = compact ? price.overflowButtonCompact : price.overflowButton;
|
|
38
44
|
const gap = remPx(theme, RESERVED.betweenControls);
|
|
39
|
-
const clearCost =
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const clearCost = anyApplied(all, pills, ranges) ? price.clearAll + gap : 0;
|
|
46
|
+
const pinnedCost = pinned.length > 0 ? moreCost + gap : 0;
|
|
47
|
+
const widthOf = (field) => fieldWidth(theme, field, pills, ranges);
|
|
48
|
+
const split = keepChipsInOrder(
|
|
49
|
+
splitToFit(candidates, {
|
|
50
|
+
widthOf,
|
|
51
|
+
keyOf: (field) => field.id,
|
|
52
|
+
gap,
|
|
53
|
+
available: width - furniture - clearCost - pinnedCost,
|
|
54
|
+
overflowCost: pinned.length > 0 ? 0 : moreCost,
|
|
55
|
+
priority: [...chips, ...active, ...idle]
|
|
56
|
+
}),
|
|
57
|
+
chips,
|
|
58
|
+
(field) => widthOf(field) + gap
|
|
59
|
+
);
|
|
60
|
+
return {
|
|
61
|
+
inline: split.inline,
|
|
62
|
+
overflow: [...split.overflow, ...pinned],
|
|
63
|
+
used: split.used + clearCost + pinnedCost
|
|
64
|
+
};
|
|
51
65
|
}
|
|
52
66
|
function computeSplit(all, pills, ranges, width, hasExport, theme) {
|
|
53
67
|
if (width === 0) {
|
|
54
68
|
return {
|
|
55
|
-
inline: all,
|
|
56
|
-
overflow:
|
|
69
|
+
inline: all.filter((field) => !field.pinned),
|
|
70
|
+
overflow: all.filter((field) => field.pinned),
|
|
57
71
|
compactControls: false,
|
|
58
72
|
counterHidden: false,
|
|
59
73
|
searchCollapsed: false,
|
|
@@ -93,7 +107,9 @@ function useFilterOverflow(all, pills, ranges, frozen = false, hasExport = true)
|
|
|
93
107
|
const { ref: barRef, width } = useMeasuredWidth();
|
|
94
108
|
const theme = useTheme();
|
|
95
109
|
const signature = JSON.stringify({
|
|
96
|
-
|
|
110
|
+
// A chip's count and a field's `inMore` change its price or its place
|
|
111
|
+
// without changing its id, so both are part of the key.
|
|
112
|
+
ids: all.map((field) => [field.id, field.quick?.count ?? null, field.pinned === true]),
|
|
97
113
|
pills,
|
|
98
114
|
ranges,
|
|
99
115
|
width,
|
|
@@ -111,7 +127,6 @@ function useFilterOverflow(all, pills, ranges, frozen = false, hasExport = true)
|
|
|
111
127
|
}
|
|
112
128
|
|
|
113
129
|
export {
|
|
114
|
-
toOverflowFields,
|
|
115
130
|
useFilterOverflow
|
|
116
131
|
};
|
|
117
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-CSLBRJ7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/DataViews/data-views-overflow.ts"],"sourcesContent":["\"use client\";\n\nimport { useTheme, type Theme } from \"@mui/material/styles/index.js\";\nimport { useRef } from \"react\";\n\nimport { remPx } from \"../../../tokens/relative\";\nimport { splitToFit, useMeasuredWidth } from \"../../utility/Overflow\";\nimport {\n estimateWidth,\n furnitureCost,\n isRangeSet,\n pillText,\n pricesFor,\n RESERVED,\n rightClusterCost,\n type Prices,\n} from \"./data-views-overflow-costs\";\nimport type { FilterFieldConfig, QuickFilterConfig, RangeFieldConfig, RangeValue } from \"./data-views-types\";\nimport { anyApplied, isQuickActive, keepChipsInOrder } from \"./data-views-overflow-fields\";\n\n// Declaring the controls lives in its own module (size gate); re-exported for its callers.\nexport { isQuickActive, toOverflowFields } from \"./data-views-overflow-fields\";\n\n/**\n * PROGRESSIVE COLLAPSE — which filter controls fit on the toolbar, measured.\n *\n * Two rules, and both come from watching the all-or-nothing version fail:\n *\n * 1. Controls shed ONE AT A TIME into an overflow, never all at once. With four\n * filters and room for three, hiding all four throws away the room that was\n * there.\n * 2. An APPLIED filter is ranked first, not exempt. Applied controls take the\n * visible slots ahead of idle ones, and go into \"Mais\" like anything else\n * when even those slots run out. Exempting them outright — the earlier rule\n * — meant four applied filters on a phone claimed more width than the row\n * had, and the bar painted past its own edge: the pills were reachable only\n * by scrolling the toolbar sideways. Hiding one is safe because \"Mais\" says\n * how many applied filters are behind it; scrolling one off-screen says\n * nothing at all.\n *\n * It MEASURES rather than picking a breakpoint, which is what\n * `FILTERS-CONTRACT.md` asks for: pages declare different numbers of filters\n * with different label lengths, and the same page collapses at a different\n * width in another language. A shared breakpoint is wrong for at least one\n * table by construction.\n *\n * Collapsing is presentation only — nothing here emits a query, drops a filter\n * or changes a rendered row.\n */\n\n/** A filter control on the bar: a multi-select pill, a min/max range or a quick chip. */\nexport interface OverflowField<T extends Record<string, unknown>> {\n id: string;\n label: string;\n /** Which control it is — the caller renders the right one. */\n group: \"pill\" | \"range\" | \"quick\";\n pill?: FilterFieldConfig<T>;\n range?: RangeFieldConfig<T>;\n quick?: QuickFilterConfig;\n /** Declared `inMore`: never on the bar, always behind \"Mais\". */\n pinned?: boolean;\n}\n\n/** What the caller renders inline, and what goes behind \"Mais\". */\nexport interface OverflowSplit<T extends Record<string, unknown>> {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /**\n * Step 2 — Exibir/Exportar drop their text labels and become icons.\n * Cheap: both keep their icon, their tooltip and their position.\n */\n compactControls: boolean;\n /**\n * Step 5, and the LAST resort — the \"N de N\" counter is dropped.\n *\n * Only once every control has already collapsed and the row STILL does not\n * fit, which on a six-filter table is below about 400px. The counter goes\n * last because it is the only thing left that reports rather than does: an\n * operator can act without knowing the total, but not without the search.\n */\n counterHidden: boolean;\n /**\n * Step 4 — the search collapses to a magnifier that expands on click.\n * The most expensive step, so it is taken last: the search is the one\n * control on the bar that cannot be guessed from an icon's position.\n */\n searchCollapsed: boolean;\n /**\n * Step 6, below even the counter — \"Limpar\" leaves the bar.\n *\n * The one control here with a second home: the overflow panel's footer\n * carries \"Limpar todos os filtros\". So it goes before the search icon or\n * \"Mais\", neither of which has anywhere else to be.\n */\n clearAllHidden: boolean;\n /**\n * Expanding the magnifier must take the whole cluster, filters and all.\n *\n * Only on the rungs where what is left over would be too narrow to read —\n * on a large phone the box simply shrinks and the filters stay, which is why\n * this is its own answer rather than `searchCollapsed` reused.\n */\n searchTakeover: boolean;\n /** Attach to the toolbar row being measured. */\n barRef: React.RefObject<HTMLDivElement | null>;\n}\n\n/** Is this control carrying a value the operator set? */\nfunction isActiveField<T extends Record<string, unknown>>(\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): boolean {\n if (field.group === \"quick\" && field.quick) return isQuickActive(field.quick, pills);\n return field.group === \"pill\"\n ? (pills[field.id]?.length ?? 0) > 0\n : isRangeSet(ranges[field.id]);\n}\n\n/** Estimated rendered width of one control at its CURRENT value, in px at `theme`'s scale. */\nfunction fieldWidth<T extends Record<string, unknown>>(\n theme: Theme,\n field: OverflowField<T>,\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n): number {\n // A chip is a pill with its count beside the label and no chevron.\n if (field.group === \"quick\") return estimateWidth(theme, `${field.label} ${field.quick?.count ?? \"\"}`, -20);\n if (field.group === \"pill\") return estimateWidth(theme, pillText(field, pills[field.id] ?? []), 0);\n // A bounded range renders two number inputs (100 design px) beside its label.\n return estimateWidth(theme, field.label, isRangeSet(ranges[field.id]) ? 100 : 0);\n}\n\n/** What one split costs on the bar, so the ladder below can price the next step. */\ntype Split<T extends Record<string, unknown>> = {\n inline: OverflowField<T>[];\n overflow: OverflowField<T>[];\n /** Width the surviving inline controls occupy, incl. the \"Mais\" button. */\n used: number;\n};\n\n/** Step 1 — shed filter controls into the overflow. Pure. */\nfunction splitFilters<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Search + counter + right cluster + chrome, at the rung being considered. */\n furniture: number,\n /** Is the bar already down to icons? \"Mais\" shrinks with everything else. */\n compact: boolean,\n /** Whose type scale every price is read at — the bar's own. */\n theme: Theme,\n): Split<T> {\n // `inMore` fields never compete for the bar: they are behind \"Mais\" from the\n // start, so \"Mais\" is on the bar whatever else fits.\n const pinned = all.filter((field) => field.pinned);\n const candidates = all.filter((field) => !field.pinned);\n const chips = candidates.filter((field) => field.group === \"quick\");\n const rest = candidates.filter((field) => field.group !== \"quick\");\n const active = rest.filter((field) => isActiveField(field, pills, ranges));\n const idle = rest.filter((field) => !isActiveField(field, pills, ranges));\n const price = pricesFor(theme);\n const moreCost = compact ? price.overflowButtonCompact : price.overflowButton;\n const gap = remPx(theme, RESERVED.betweenControls);\n\n // \"Limpar\" rides the end of the cluster whenever anything is applied —\n // ANYTHING, a pinned field and a chip's field included, since the bar draws\n // it on the active count, not on what it can see. Pressing a chip can\n // therefore cost the bar room; chips rank first and stay a prefix (below),\n // so what leaves is an idle pill, or the chips together — never one chip\n // swapped for another.\n const clearCost = anyApplied(all, pills, ranges) ? price.clearAll + gap : 0;\n // APPLIED FIRST, BUT NOT EXEMPT.\n //\n // Applied controls take the visible slots ahead of idle ones — that part was\n // always right. Exempting them from the overflow entirely was not: applying\n // a value LENGTHENS a control (\"Pagamento (1)\"), so on a phone four applied\n // filters claimed more width than the row had and the bar simply painted\n // past its own edge, leaving pills reachable only by scrolling sideways.\n //\n // An applied filter hidden in \"Mais\" is not lost the way it would be if it\n // vanished silently: the trigger goes to the applied tone and says how many\n // are in there (see `MoreTrigger`), which is the same signal the pill itself\n // was carrying. A control you scroll off-screen carries no signal at all.\n //\n // Quick chips come before all of it, in their DECLARED order whatever is\n // pressed: they are the bar's fixed vocabulary, so their slots never move.\n //\n // The keep-what-fits loop is `splitToFit` (`utility/Overflow`). With pinned\n // fields \"Mais\" is always drawn, so its cost is paid up front.\n const pinnedCost = pinned.length > 0 ? moreCost + gap : 0;\n const widthOf = (field: OverflowField<T>): number => fieldWidth(theme, field, pills, ranges);\n const split = keepChipsInOrder(\n splitToFit(candidates, {\n widthOf,\n keyOf: (field) => field.id,\n gap,\n available: width - furniture - clearCost - pinnedCost,\n overflowCost: pinned.length > 0 ? 0 : moreCost,\n priority: [...chips, ...active, ...idle],\n }),\n chips,\n (field) => widthOf(field) + gap,\n );\n return {\n inline: split.inline,\n overflow: [...split.overflow, ...pinned],\n used: split.used + clearCost + pinnedCost,\n };\n}\n\n/**\n * THE DEGRADATION LADDER — cheapest loss first, and each rung taken only if\n * the one before it did not free enough:\n *\n * 1. filter controls move into the \"Mais\" overflow (`splitFilters`)\n * 2. Exibir / Exportar drop their text labels (`compactControls`)\n * 3. the search shrinks toward its minimum (CSS: it is `flex: 1`)\n * 4. the search itself collapses to an icon (`searchCollapsed`)\n *\n * Step 3 needs no flag — the search is a flex child, so it gives up width on\n * its own until it hits `RESERVED.search`. The flags mark the two steps that\n * change what is RENDERED rather than how wide it is.\n *\n * Measured against what is CURRENTLY on the bar, never a breakpoint: a\n * two-filter page and a five-filter page would otherwise collapse at the same\n * width, and only one of them would be right.\n */\nfunction computeSplit<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n width: number,\n /** Does the host render \"Exportar\" beside \"Exibir\"? Half the cluster if not. */\n hasExport: boolean,\n theme: Theme,\n): Omit<OverflowSplit<T>, \"barRef\"> {\n // Unmeasured (SSR, or jsdom without a ResizeObserver) ⇒ degrade nothing.\n if (width === 0) {\n return {\n inline: all.filter((field) => !field.pinned),\n overflow: all.filter((field) => field.pinned),\n compactControls: false,\n counterHidden: false,\n searchCollapsed: false,\n clearAllHidden: false,\n searchTakeover: false,\n };\n }\n const price = pricesFor(theme);\n // Pass 1 prices the furniture at its widest — no rung has been taken yet.\n let budget = furnitureCost(price, UNCOLLAPSED, hasExport);\n let split = splitFilters(all, pills, ranges, width, budget, false, theme);\n let flags = ladderFlags(split, width, hasExport, price);\n // RE-SPEND WHAT THE LATER RUNGS FREED.\n //\n // Rungs 2/4/5 turn 200 + 96 + 216 of furniture into 44 + 0 + 140, and until\n // this loop existed nobody handed those ~330px back to the filters: the\n // split was decided once, against the uncollapsed row, so a phone shed every\n // control and then sat with a band of empty bar beside \"Mais 5\".\n //\n // Settles rather than oscillates, and cannot overfill: a cheaper furniture\n // can only give the filters MORE room, more filter width can only push the\n // ladder FURTHER down, and a further rung can only make the furniture\n // cheaper again — so the budget decreases monotonically and the loop exits\n // the moment it stops moving. The bound is a backstop, not the exit.\n for (let pass = 0; pass < 3; pass += 1) {\n const freed = furnitureCost(price, flags, hasExport);\n if (freed >= budget) break;\n budget = freed;\n split = splitFilters(all, pills, ranges, width, budget, flags.compactControls, theme);\n flags = ladderFlags(split, width, hasExport, price);\n }\n return { inline: split.inline, overflow: split.overflow, ...flags };\n}\n\n/** The widest the furniture ever is — every rung still untaken. */\nconst UNCOLLAPSED = { searchCollapsed: false, counterHidden: false, compactControls: false };\n\n/** Rungs 2 and 4-6, priced against what the filters actually took. */\nfunction ladderFlags<T extends Record<string, unknown>>(\n split: Split<T>,\n width: number,\n hasExport: boolean,\n price: Prices,\n): Omit<OverflowSplit<T>, \"barRef\" | \"inline\" | \"overflow\"> {\n const { overflow, used } = split;\n const base = width - used - price.chrome;\n\n // Would the search still make its minimum with the labels on?\n const compactControls = base - price.counter - rightClusterCost(price, hasExport, false) < price.search;\n const rightCost = rightClusterCost(price, hasExport, compactControls);\n // …and with them off?\n const searchCollapsed = base - price.counter - rightCost < price.search;\n // Everything has collapsed and the row STILL overflows. The controls cannot\n // shrink further — they are `flexShrink: 0` precisely so an over-packed row\n // sheds rather than squeezes — so without this last rung they simply paint\n // outside the toolbar, which is what a narrow phone was doing.\n const counterHidden =\n searchCollapsed && base - price.counter - rightCost < price.searchIcon;\n // Step 6 — below even that, \"Limpar\" leaves the bar. It is the ONLY control\n // here with a second home: the overflow panel's footer carries \"Limpar todos\n // os filtros\", so nothing is lost, which is exactly why it goes before the\n // search icon or \"Mais\" (neither of which has anywhere else to be). Guarded\n // on there BEING an overflow, because with no panel the footer does not\n // exist and dropping this would strand the operator.\n const clearAllHidden = counterHidden && overflow.length > 0;\n // What the keyword box would get if the operator expanded the magnifier.\n // `searchCollapsed` is a different question — it asks whether the box fits at\n // its PREFERRED 200px, and is deliberately pessimistic — so reusing it to\n // decide the takeover evicted the filters on screens where the box had plenty\n // of room to simply shrink.\n //\n // Asked with the inline filters SHED, because shedding them is exactly what\n // expanding the box does: the row re-splits and they go behind \"Mais\".\n // Measuring against the resting row instead made a filter argue for its own\n // eviction — now that a large phone keeps one, its width came out of `base`,\n // pushed the box under `usableSearch`, and tipped a row that had ample space\n // to share into a full takeover.\n const overflowButton = compactControls\n ? price.overflowButtonCompact\n : price.overflowButton;\n const shedRoom = width - price.chrome - (overflow.length > 0 ? overflowButton : 0);\n const searchBoxRoom = shedRoom - (counterHidden ? 0 : price.counter) - rightCost;\n // Below this a box is too narrow to read what you typed into it, and shrinking\n // further buys nothing; that is the only point at which taking the whole\n // cluster is worth losing the filters.\n const searchTakeover = searchCollapsed && searchBoxRoom < price.usableSearch;\n\n return { compactControls, counterHidden, searchCollapsed, clearAllHidden, searchTakeover };\n}\n\n/**\n * Split the declared filter controls into what fits and what goes behind\n * \"Mais\", measured against the live toolbar width.\n *\n * Cached on a SIGNATURE rather than by `useMemo` over the inputs: hosts declare\n * their fields inline, so `all` is a fresh array on every render while the\n * configuration is unchanged, and a reference-keyed memo would never hit.\n */\nexport function useFilterOverflow<T extends Record<string, unknown>>(\n all: OverflowField<T>[],\n pills: Record<string, string[]>,\n ranges: Record<string, RangeValue>,\n /**\n * A filter control is open — hold the current answer until it closes.\n *\n * Applying a filter changes that control's LABEL (\"Valor\" becomes \"Valor: ≥\n * R$ 1\"), which changes its measured width, which re-runs the whole split\n * while its popover is open on top of it. Measured: setting a minimum moved\n * the trigger 192px left, took the popover with it, and pushed two other\n * controls into a newly-appeared \"Mais 2\" — so reaching for the second bound\n * meant chasing the control across the row. Nobody sets a range that way.\n *\n * Frozen only for the duration: closing re-measures against the new labels,\n * so the row still ends up correct, it just does not rearrange under a hand\n * that is mid-edit.\n */\n frozen = false,\n /** Whether \"Exportar\" is on the bar — see `rightClusterCost`. */\n hasExport = true,\n): OverflowSplit<T> {\n // The measurement is `useMeasuredWidth` (`utility/Overflow`): the same\n // ResizeObserver every collapsing cluster in the design system reads, so\n // there is one loop to get right rather than one per bar. `0` until the\n // first measurement lands (and forever under SSR or jsdom), which\n // `computeSplit` reads as \"degrade nothing\".\n const { ref: barRef, width } = useMeasuredWidth<HTMLDivElement>();\n // The prices follow the theme's type scale, so the answer does too.\n const theme = useTheme();\n const signature = JSON.stringify({\n // A chip's count and a field's `inMore` change its price or its place\n // without changing its id, so both are part of the key.\n ids: all.map((field) => [field.id, field.quick?.count ?? null, field.pinned === true]),\n pills,\n ranges,\n width,\n hasExport,\n scale: remPx(theme, 1),\n });\n const cache = useRef<{ signature: string; split: ReturnType<typeof computeSplit<T>> } | null>(null);\n if (cache.current === null || (!frozen && cache.current.signature !== signature)) {\n cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };\n }\n // The cache holds the ARRANGEMENT — which ids sit on the bar, which in \"Mais\"\n // — never the fields themselves. The signature keys on ids, so a field whose\n // options arrive after the first measurement (a category list still loading)\n // does not re-split, and handing back the cached objects served the empty\n // list for good: \"Categoria\" in \"Mais\" rendered a label with no control under\n // it (FUT-2828). Re-reading each field from `all` keeps the slots and the\n // current config.\n const { split } = cache.current;\n const current = new Map(all.map((field) => [field.id, field]));\n const fresh = (fields: OverflowField<T>[]): OverflowField<T>[] =>\n fields.map((field) => current.get(field.id) ?? field);\n return { ...split, inline: fresh(split.inline), overflow: fresh(split.overflow), barRef };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,gBAA4B;AACrC,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AO,MAAM,OAAO,CAAC;AAAA,EACvB,CAAC;AACD,QAAM,QAAQ,OAAgF,IAAI;AAClG,MAAI,MAAM,YAAY,QAAS,CAAC,UAAU,MAAM,QAAQ,cAAc,WAAY;AAChF,UAAM,UAAU,EAAE,WAAW,OAAO,aAAa,KAAK,OAAO,QAAQ,OAAO,WAAW,KAAK,EAAE;AAAA,EAChG;AAQA,QAAM,EAAE,MAAM,IAAI,MAAM;AACxB,QAAM,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;AAC7D,QAAM,QAAQ,CAAC,WACb,OAAO,IAAI,CAAC,UAAU,QAAQ,IAAI,MAAM,EAAE,KAAK,KAAK;AACtD,SAAO,EAAE,GAAG,OAAO,QAAQ,MAAM,MAAM,MAAM,GAAG,UAAU,MAAM,MAAM,QAAQ,GAAG,OAAO;AAC1F;","names":[]}
|
|
@@ -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-HLYYB4O5.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-D34PZJH3.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rowGutters
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UMOHHWXY.js";
|
|
4
4
|
import {
|
|
5
5
|
cellRailsTemplate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BBBHPK2Q.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-E6K2UZGR.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
pulseAnimation,
|
|
3
|
-
rotateAnimation,
|
|
4
|
-
scaleInAnimation,
|
|
5
|
-
shimmerAnimation
|
|
6
|
-
} from "./chunk-MTEQEPNY.js";
|
|
7
1
|
import {
|
|
8
2
|
ACTIVE_SCALE,
|
|
9
3
|
AVATAR_SIZES,
|
|
@@ -23,6 +17,12 @@ import {
|
|
|
23
17
|
SPINNER,
|
|
24
18
|
STATUS_DOT
|
|
25
19
|
} from "./chunk-6ZZGK5DT.js";
|
|
20
|
+
import {
|
|
21
|
+
pulseAnimation,
|
|
22
|
+
rotateAnimation,
|
|
23
|
+
scaleInAnimation,
|
|
24
|
+
shimmerAnimation
|
|
25
|
+
} from "./chunk-MTEQEPNY.js";
|
|
26
26
|
import {
|
|
27
27
|
absoluteInk,
|
|
28
28
|
controlNeutral,
|
|
@@ -277,4 +277,4 @@ function AvatarView(props) {
|
|
|
277
277
|
export {
|
|
278
278
|
AvatarView
|
|
279
279
|
};
|
|
280
|
-
//# sourceMappingURL=chunk-
|
|
280
|
+
//# sourceMappingURL=chunk-EOQ6EKTS.js.map
|