@atscript/vue-table 0.1.146 → 0.1.148
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/as-action-form-dialog.cjs +3 -2
- package/dist/as-action-form-dialog.mjs +3 -2
- package/dist/{as-action-menu-content-DoZnQP0I.mjs → as-action-menu-content-BBwL1YZU.mjs} +1 -1
- package/dist/{as-action-menu-content-FQ2miGid.cjs → as-action-menu-content-DAOjkslC.cjs} +1 -1
- package/dist/{as-cell-array-CCZ0Ajj9.cjs → as-cell-array-CB4Nt6Fo.cjs} +3 -2
- package/dist/{as-cell-array-Bgc4GYZf.mjs → as-cell-array-CnoVd9ps.mjs} +4 -3
- package/dist/as-cell-array.cjs +1 -1
- package/dist/as-cell-array.d.cts +1 -1
- package/dist/as-cell-array.d.mts +1 -1
- package/dist/as-cell-array.mjs +1 -1
- package/dist/{as-cell-date-RU5JPJhI.cjs → as-cell-date-DrnhvCr4.cjs} +3 -14
- package/dist/{as-cell-date-B9mu0OOD.mjs → as-cell-date-dhIM7hWA.mjs} +2 -13
- package/dist/as-cell-date.cjs +1 -1
- package/dist/as-cell-date.d.cts +1 -1
- package/dist/as-cell-date.d.mts +1 -1
- package/dist/as-cell-date.mjs +1 -1
- package/dist/{as-cell-json-ByEGYRST.mjs → as-cell-json-ChN_NDhO.mjs} +1 -1
- package/dist/{as-cell-json-w5YJxNuF.cjs → as-cell-json-CzHTpkjS.cjs} +1 -1
- package/dist/as-cell-json.cjs +1 -1
- package/dist/as-cell-json.d.cts +1 -1
- package/dist/as-cell-json.d.mts +1 -1
- package/dist/as-cell-json.mjs +1 -1
- package/dist/{as-cell-number-DGJCTXDf.cjs → as-cell-number-C4JMqvqa.cjs} +1 -1
- package/dist/{as-cell-number-CNDT6gfw.mjs → as-cell-number-D-mSaE_G.mjs} +1 -1
- package/dist/as-cell-number.cjs +1 -1
- package/dist/as-cell-number.d.cts +1 -1
- package/dist/as-cell-number.d.mts +1 -1
- package/dist/as-cell-number.mjs +1 -1
- package/dist/{as-cell-union-DMnoa7RM.mjs → as-cell-union-C9Bbnkrg.mjs} +1 -1
- package/dist/{as-cell-union-LOGvhPeK.cjs → as-cell-union-DpCEHLzN.cjs} +1 -1
- package/dist/as-cell-union.cjs +1 -1
- package/dist/as-cell-union.d.cts +1 -1
- package/dist/as-cell-union.d.mts +1 -1
- package/dist/as-cell-union.mjs +1 -1
- package/dist/as-column-menu.d.cts +1 -1
- package/dist/as-column-menu.d.mts +1 -1
- package/dist/{as-column-menu.vue-ByTECTbX.d.cts → as-column-menu.vue-4zJmC_M6.d.mts} +2 -2
- package/dist/{as-column-menu.vue-TChT482i.d.mts → as-column-menu.vue-CS_8jHG3.d.cts} +2 -2
- package/dist/{as-config-dialog-CpW1Qemf.cjs → as-config-dialog-CnIvMsK0.cjs} +10 -5
- package/dist/{as-config-dialog-ObHtungs.mjs → as-config-dialog-ZKMnfirD.mjs} +10 -5
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.d.cts +1 -1
- package/dist/as-config-dialog.d.mts +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-zg7jmS3u.mjs → as-confirm-dialog-DMiGquH1.mjs} +1 -1
- package/dist/{as-confirm-dialog-D3Vu1Rb_.cjs → as-confirm-dialog-cSEHVFBq.cjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.d.cts +1 -1
- package/dist/as-confirm-dialog.d.mts +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-CWy0mjZl.mjs → as-filter-dialog-DNFR30fV.mjs} +61 -38
- package/dist/{as-filter-dialog-C4EyRr2_.cjs → as-filter-dialog-KjvJdaMg.cjs} +60 -37
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.d.cts +1 -1
- package/dist/as-filter-dialog.d.mts +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-BQ9UlV0y.cjs → as-filter-field-BsucQwbm.cjs} +247 -35
- package/dist/{as-filter-field-CW1_GHZT.mjs → as-filter-field-DE6MJMx7.mjs} +227 -39
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.d.cts +1 -1
- package/dist/as-filter-field.d.mts +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/as-filter-input-ChJ8JE6-.cjs +254 -0
- package/dist/as-filter-input-DmOW_jzK.mjs +249 -0
- package/dist/as-filter-input.cjs +1 -1
- package/dist/as-filter-input.d.cts +1 -1
- package/dist/as-filter-input.d.mts +1 -1
- package/dist/as-filter-input.mjs +1 -1
- package/dist/{as-filter-input.vue-CFZ33B--.d.mts → as-filter-input.vue-BLTzA2Iy.d.cts} +10 -1
- package/dist/{as-filter-input.vue-CS4nOk_Q.d.cts → as-filter-input.vue-CmWQGQCv.d.mts} +10 -1
- package/dist/{as-filters-DUfFkXAo.cjs → as-filters-CYC_SXaA.cjs} +4 -4
- package/dist/{as-filters-BLFSS_VP.mjs → as-filters-DErM2bFq.mjs} +4 -4
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.d.mts +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-preset-dialog-CI2Hw8vi.mjs → as-preset-dialog-CY5dPfZa.mjs} +2 -2
- package/dist/{as-preset-dialog-BlXqTZiT.cjs → as-preset-dialog-tM-jrQgs.cjs} +2 -2
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.d.cts +1 -1
- package/dist/as-preset-dialog.d.mts +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-CVgyZBG7.cjs → as-preset-picker-CjSXtx83.cjs} +2 -2
- package/dist/{as-preset-picker-CbZDGPaf.mjs → as-preset-picker-DkZ7sinz.mjs} +2 -2
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.d.mts +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-residual-filter-CUTouIn5.mjs → as-residual-filter-DHfbtTQj.mjs} +4 -5
- package/dist/{as-residual-filter-C8n7kdGW.cjs → as-residual-filter-XkXnMQNu.cjs} +4 -5
- package/dist/as-residual-filter.cjs +1 -1
- package/dist/as-residual-filter.d.cts +1 -1
- package/dist/as-residual-filter.d.mts +1 -1
- package/dist/as-residual-filter.mjs +1 -1
- package/dist/{as-row-actions-ed1P6GEJ.mjs → as-row-actions-BNQ7jrie.mjs} +7 -5
- package/dist/{as-row-actions-DfUL9sYB.cjs → as-row-actions-q_oMmUz1.cjs} +7 -5
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.cts +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-row-actions.vue-Ba3VO9W-.d.cts → as-row-actions.vue-BB8ATWBY.d.mts} +1 -1
- package/dist/{as-row-actions.vue-CKOnE0eb.d.mts → as-row-actions.vue-CnjcRD0P.d.cts} +1 -1
- package/dist/{as-select-cell-DwMfqBMV.cjs → as-select-cell-Dc3lArvR.cjs} +11 -6
- package/dist/{as-select-cell-BMptU5sQ.mjs → as-select-cell-DjcPorVb.mjs} +11 -6
- package/dist/as-selection-banner-Ca9DWVdW.mjs +189 -0
- package/dist/as-selection-banner-CxPXBztW.cjs +206 -0
- package/dist/as-table-BIAkCI4g.cjs +215 -0
- package/dist/as-table-Bcz-WOTS.mjs +210 -0
- package/dist/{as-table-actions-DQco4pGu.mjs → as-table-actions-DPq5SrGa.mjs} +32 -6
- package/dist/{as-table-actions-DplblFlK.cjs → as-table-actions-TaI-NeVv.cjs} +32 -6
- package/dist/as-table-actions.cjs +1 -1
- package/dist/as-table-actions.d.cts +1 -1
- package/dist/as-table-actions.d.mts +1 -1
- package/dist/as-table-actions.mjs +1 -1
- package/dist/{as-table-actions.vue-BYphfAe2.d.cts → as-table-actions.vue-C2szPEXd.d.mts} +8 -1
- package/dist/{as-table-actions.vue-C6hzRtS7.d.mts → as-table-actions.vue-CBD_tEpe.d.cts} +8 -1
- package/dist/{as-table-base-lfyjPgsO.mjs → as-table-base-CsK79vYe.mjs} +3 -3
- package/dist/{as-table-base-CNAn-vpa.cjs → as-table-base-Dvey_Gie.cjs} +3 -3
- package/dist/{as-table-cell-value-DoH8Mieo.mjs → as-table-cell-value-D-S127gr.mjs} +13 -2
- package/dist/{as-table-cell-value-COyZnwUj.cjs → as-table-cell-value-VWlXc5dA.cjs} +12 -1
- package/dist/as-table-cell-value.cjs +1 -1
- package/dist/as-table-cell-value.d.cts +1 -1
- package/dist/as-table-cell-value.d.mts +1 -1
- package/dist/as-table-cell-value.mjs +1 -1
- package/dist/{as-table-header-cell-BwaOPYwI.cjs → as-table-header-cell-DB7Cdskr.cjs} +1 -1
- package/dist/{as-table-header-cell-Csv1KQDa.mjs → as-table-header-cell-ahzAeHXj.mjs} +1 -1
- package/dist/as-table-header-cell.cjs +1 -1
- package/dist/as-table-header-cell.d.cts +1 -1
- package/dist/as-table-header-cell.d.mts +1 -1
- package/dist/as-table-header-cell.mjs +1 -1
- package/dist/{as-table-header-cell.vue-DU5h-2C_.d.cts → as-table-header-cell.vue-D2s9YLSJ.d.cts} +1 -1
- package/dist/{as-table-header-cell.vue-KkANwimG.d.mts → as-table-header-cell.vue-DfDNma_Z.d.mts} +1 -1
- package/dist/{as-table-root-BreMYhnv.mjs → as-table-root-BnkF5-rh.mjs} +78 -11
- package/dist/{as-table-root-DXewWV9h.cjs → as-table-root-Nsk-9XaH.cjs} +77 -10
- package/dist/as-table-root.cjs +1 -1
- package/dist/as-table-root.d.cts +1 -1
- package/dist/as-table-root.d.mts +1 -1
- package/dist/as-table-root.mjs +1 -1
- package/dist/{as-table-root.vue-XtDgUjO2.d.mts → as-table-root.vue-D56WcudY.d.mts} +515 -1530
- package/dist/{as-table-root.vue-Bjzp8TJl.d.cts → as-table-root.vue-DXXcBPu_.d.cts} +511 -1526
- package/dist/as-table.cjs +1 -1
- package/dist/as-table.d.cts +1 -1
- package/dist/as-table.d.mts +1 -1
- package/dist/as-table.mjs +1 -1
- package/dist/{as-window-table-JOTOi_Nm.mjs → as-window-table-DjplqWzr.mjs} +100 -54
- package/dist/{as-window-table-Bj1dXOS6.cjs → as-window-table-ubm2u8_i.cjs} +102 -56
- package/dist/as-window-table.cjs +1 -1
- package/dist/as-window-table.d.cts +1 -1
- package/dist/as-window-table.d.mts +1 -1
- package/dist/as-window-table.mjs +1 -1
- package/dist/index.cjs +73 -91
- package/dist/index.d.cts +19 -21
- package/dist/index.d.mts +21 -23
- package/dist/index.mjs +71 -93
- package/dist/{types-D1NxhrpW.d.cts → intent-scope-CGch9yhy.d.cts} +215 -35
- package/dist/{types-BEZ4_erB.d.mts → intent-scope-CvD4YOvf.d.mts} +215 -35
- package/dist/use-condition-format-5LcuInDy.mjs +34 -0
- package/dist/use-condition-format-DrgfX6xL.cjs +39 -0
- package/dist/{use-table-BTsNGBVx.mjs → use-table-BYNBpLJt.mjs} +27 -4
- package/dist/{use-table-W0KmaJ6L.cjs → use-table-C9qI-TL6.cjs} +26 -3
- package/dist/{use-table-component-BvAC82_c.cjs → use-table-component-CsdvdGJT.cjs} +1 -1
- package/dist/{use-table-component-DRMXTk9M.mjs → use-table-component-Dy397695.mjs} +1 -1
- package/dist/{use-table-nav-bridge-Bw0NFDSf.mjs → use-table-nav-bridge-CJBERyPB.mjs} +1 -1
- package/dist/{use-table-nav-bridge-CPI1tql6.cjs → use-table-nav-bridge-Gm4ZfOjJ.cjs} +1 -1
- package/dist/{use-table-selection-ULbKT2xW.mjs → use-table-selection-CdaOPo1d.mjs} +8 -3
- package/dist/{use-table-selection-DtCV3rhu.cjs → use-table-selection-Cs7-gjHg.cjs} +8 -3
- package/dist/{use-table-state-Ddr2UZzB.cjs → use-table-state-BQchKxUr.cjs} +499 -43
- package/dist/{use-table-state-DuY-Mf8e.mjs → use-table-state-CIoWhwTD.mjs} +466 -46
- package/package.json +11 -10
- package/dist/as-filter-input-BM23TNeh.mjs +0 -101
- package/dist/as-filter-input-DJu2k9gO.cjs +0 -106
- package/dist/as-table-BjKzKB0a.cjs +0 -207
- package/dist/as-table-DGWfzV4w.mjs +0 -202
- package/dist/as-table.vue-BULJe49x.d.cts +0 -115
- package/dist/as-table.vue-DgCtlV4u.d.mts +0 -115
- package/dist/as-window-table.vue-CYFgK10g.d.mts +0 -132
- package/dist/as-window-table.vue-ijutqrJ0.d.cts +0 -132
- package/dist/use-table-column-handlers-BitvioH4.mjs +0 -85
- package/dist/use-table-column-handlers-DksXpbON.cjs +0 -96
- /package/dist/{as-cell-array.vue-pFs5GcCR.d.cts → as-cell-array.vue-C4BTM8YW.d.cts} +0 -0
- /package/dist/{as-cell-array.vue-ow34clSF.d.mts → as-cell-array.vue-D4vS7C_D.d.mts} +0 -0
- /package/dist/{as-cell-date.vue-BBSps2B2.d.cts → as-cell-date.vue-BcMgxBfm.d.cts} +0 -0
- /package/dist/{as-cell-date.vue-B4JCr1qP.d.mts → as-cell-date.vue-Chs7WTZ9.d.mts} +0 -0
- /package/dist/{as-cell-json-popover-Dkdv5Y9E.mjs → as-cell-json-popover-CH5bAcLE.mjs} +0 -0
- /package/dist/{as-cell-json-popover-BM2QLgfk.cjs → as-cell-json-popover-vty5vMjW.cjs} +0 -0
- /package/dist/{as-cell-json.vue-B-T3TuFj.d.mts → as-cell-json.vue-C0_LDvQw.d.mts} +0 -0
- /package/dist/{as-cell-json.vue-C6wg4ARZ.d.cts → as-cell-json.vue-pwE9uJdv.d.cts} +0 -0
- /package/dist/{as-cell-number.vue-CNH2fbCB.d.mts → as-cell-number.vue-BBF0OuU8.d.mts} +0 -0
- /package/dist/{as-cell-number.vue-CJ2K5zeM.d.cts → as-cell-number.vue-pbgVCIWT.d.cts} +0 -0
- /package/dist/{as-cell-union.vue-CslPM_c2.d.cts → as-cell-union.vue-BK_M7opL.d.cts} +0 -0
- /package/dist/{as-cell-union.vue-CZwN81H4.d.mts → as-cell-union.vue-CL-Lf-Rm.d.mts} +0 -0
- /package/dist/{as-config-dialog.vue-BKo2GpzN.d.mts → as-config-dialog.vue-BvFZZRuY.d.mts} +0 -0
- /package/dist/{as-config-dialog.vue-DvvJi3xx.d.cts → as-config-dialog.vue-C-Jw_rb7.d.cts} +0 -0
- /package/dist/{as-confirm-dialog.vue-BN_yzu3h.d.mts → as-confirm-dialog.vue-Cz52-v6c.d.mts} +0 -0
- /package/dist/{as-confirm-dialog.vue-CXxLpzbu.d.cts → as-confirm-dialog.vue-D8hJ5qPY.d.cts} +0 -0
- /package/dist/{as-filter-dialog.vue-BV2J8PgZ.d.cts → as-filter-dialog.vue-CyD6qtuX.d.cts} +0 -0
- /package/dist/{as-filter-dialog.vue-Bl8OIKOf.d.mts → as-filter-dialog.vue-likNLqzF.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-DD0IZXS1.d.mts → as-filter-field.vue-BbXLhd6O.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-ByQ8xIGq.d.cts → as-filter-field.vue-ajAFhraz.d.cts} +0 -0
- /package/dist/{as-filters.vue-dHbGmcbr.d.mts → as-filters.vue-Bu4wK0iD.d.mts} +0 -0
- /package/dist/{as-preset-dialog.vue-ChM7H7B4.d.mts → as-preset-dialog.vue-BEM-L4BY.d.cts} +0 -0
- /package/dist/{as-preset-dialog.vue-DP9fy00Y.d.cts → as-preset-dialog.vue-BRjjfPty.d.mts} +0 -0
- /package/dist/{as-preset-picker.vue-OaAV2v9z.d.mts → as-preset-picker.vue-DAUZOlOD.d.mts} +0 -0
- /package/dist/{as-residual-filter.vue-Dfw1l2wS.d.cts → as-residual-filter.vue-CGXCipEn.d.cts} +0 -0
- /package/dist/{as-residual-filter.vue-N89YqlCz.d.mts → as-residual-filter.vue-DbeOOtR7.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-DphckGq-.d.mts → as-table-cell-value.vue-BXIH_yfq.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-C0VR9GRK.d.cts → as-table-cell-value.vue-UkAuJanv.d.cts} +0 -0
- /package/dist/{error-message-CfKpn_5w.cjs → error-message-CoUcpWal.cjs} +0 -0
- /package/dist/{error-message-gNEXnnbb.mjs → error-message-rziSiSjs.mjs} +0 -0
- /package/dist/{use-cell-locale-MQXoONh5.mjs → use-cell-locale-BTJZ6UcP.mjs} +0 -0
- /package/dist/{use-cell-locale-BGBRQB7s.cjs → use-cell-locale-Dv514-Al.cjs} +0 -0
- /package/dist/{use-has-emit-listener-DrBbsLHQ.mjs → use-has-emit-listener-CsF2w9iT.mjs} +0 -0
- /package/dist/{use-has-emit-listener-BaGFZDyM.cjs → use-has-emit-listener-gD1aWp6N.cjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as useTableContext, d as ASPECT_LABELS, f as ownerNameOf, p as readPresetLabel, u as ASPECT_ICONS } from "./use-table-state-
|
|
2
|
-
import { t as errorMessage } from "./error-message-
|
|
1
|
+
import { a as useTableContext, d as ASPECT_LABELS, f as ownerNameOf, p as readPresetLabel, u as ASPECT_ICONS } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { t as errorMessage } from "./error-message-rziSiSjs.mjs";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, nextTick, normalizeClass, onScopeDispose, openBlock, ref, renderList, shallowRef, toDisplayString, unref, vModelCheckbox, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
4
|
import { isSystemPresetId } from "@atscript/ui-table";
|
|
5
5
|
import { DropdownMenuContent, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuTrigger } from "reka-ui";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_preset_picker = require("./as-preset-picker-
|
|
1
|
+
const require_as_preset_picker = require("./as-preset-picker-CjSXtx83.cjs");
|
|
2
2
|
module.exports = require_as_preset_picker.as_preset_picker_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-preset-picker.vue-
|
|
1
|
+
import { t as _default } from "./as-preset-picker.vue-DAUZOlOD.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_preset_picker_default } from "./as-preset-picker-
|
|
1
|
+
import { t as as_preset_picker_default } from "./as-preset-picker-DkZ7sinz.mjs";
|
|
2
2
|
export { as_preset_picker_default as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as useTableContext } from "./use-table-state-
|
|
1
|
+
import { a as useTableContext } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { t as useConditionFormat } from "./use-condition-format-5LcuInDy.mjs";
|
|
2
3
|
import { computed, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref } from "vue";
|
|
3
4
|
import { formatFilterExpr } from "@atscript/ui-table";
|
|
4
5
|
//#region src/components/defaults/as-residual-filter.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -21,10 +22,8 @@ var as_residual_filter_default = /* @__PURE__ */ defineComponent({
|
|
|
21
22
|
setup(__props) {
|
|
22
23
|
const props = __props;
|
|
23
24
|
const { state } = useTableContext();
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
return formatFilterExpr(props.expr, (path) => labels.get(path));
|
|
27
|
-
});
|
|
25
|
+
const { formatValue, labelOf } = useConditionFormat(state);
|
|
26
|
+
const text = computed(() => formatFilterExpr(props.expr, labelOf, formatValue));
|
|
28
27
|
return (_ctx, _cache) => {
|
|
29
28
|
return openBlock(), createElementBlock("div", {
|
|
30
29
|
class: "as-residual-filter",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
|
+
const require_use_condition_format = require("./use-condition-format-DrgfX6xL.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
4
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
4
5
|
//#region src/components/defaults/as-residual-filter.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -21,10 +22,8 @@ var as_residual_filter_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
21
22
|
setup(__props) {
|
|
22
23
|
const props = __props;
|
|
23
24
|
const { state } = require_use_table_state.useTableContext();
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
return (0, _atscript_ui_table.formatFilterExpr)(props.expr, (path) => labels.get(path));
|
|
27
|
-
});
|
|
25
|
+
const { formatValue, labelOf } = require_use_condition_format.useConditionFormat(state);
|
|
26
|
+
const text = (0, vue.computed)(() => (0, _atscript_ui_table.formatFilterExpr)(props.expr, labelOf, formatValue));
|
|
28
27
|
return (_ctx, _cache) => {
|
|
29
28
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
30
29
|
class: "as-residual-filter",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_residual_filter = require("./as-residual-filter-
|
|
1
|
+
const require_as_residual_filter = require("./as-residual-filter-XkXnMQNu.cjs");
|
|
2
2
|
module.exports = require_as_residual_filter.as_residual_filter_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-residual-filter.vue-
|
|
1
|
+
import { t as _default } from "./as-residual-filter.vue-CGXCipEn.cjs";
|
|
2
2
|
export = _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-residual-filter.vue-
|
|
1
|
+
import { t as _default } from "./as-residual-filter.vue-DbeOOtR7.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_residual_filter_default } from "./as-residual-filter-
|
|
1
|
+
import { t as as_residual_filter_default } from "./as-residual-filter-DHfbtTQj.mjs";
|
|
2
2
|
export { as_residual_filter_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as as_action_menu_content_default } from "./as-action-menu-content-
|
|
1
|
+
import { A as intentClass, D as createNavigateGestures, O as extractIdentifier, R as triggerAction, a as useTableContext, k as identifierFieldsOf, v as resolveRowActions, y as rowActionHref, z as triggerBindings } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { t as as_action_menu_content_default } from "./as-action-menu-content-BBwL1YZU.mjs";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, resolveDynamicComponent, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
4
4
|
import { DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger } from "reka-ui";
|
|
5
5
|
//#region src/components/defaults/as-row-actions.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -40,10 +40,12 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
setup(__props) {
|
|
41
41
|
const props = __props;
|
|
42
42
|
const { state } = useTableContext();
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The row's identifier — the `pk` prop when given, else extracted from the
|
|
45
|
+
* row (`identifierFields`: what a delegated action maps from rides along).
|
|
46
|
+
*/
|
|
44
47
|
function identifierOf() {
|
|
45
|
-
|
|
46
|
-
return props.pk !== void 0 ? props.pk : extractIdentifier(props.row, preferredId);
|
|
48
|
+
return props.pk !== void 0 ? props.pk : extractIdentifier(props.row, identifierFieldsOf(state.tableDef.value));
|
|
47
49
|
}
|
|
48
50
|
function promptCtx() {
|
|
49
51
|
const id = identifierOf();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_as_action_menu_content = require("./as-action-menu-content-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
|
+
const require_as_action_menu_content = require("./as-action-menu-content-DAOjkslC.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let reka_ui = require("reka-ui");
|
|
5
5
|
//#region src/components/defaults/as-row-actions.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -40,10 +40,12 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
40
40
|
setup(__props) {
|
|
41
41
|
const props = __props;
|
|
42
42
|
const { state } = require_use_table_state.useTableContext();
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The row's identifier — the `pk` prop when given, else extracted from the
|
|
45
|
+
* row (`identifierFields`: what a delegated action maps from rides along).
|
|
46
|
+
*/
|
|
44
47
|
function identifierOf() {
|
|
45
|
-
|
|
46
|
-
return props.pk !== void 0 ? props.pk : require_use_table_state.extractIdentifier(props.row, preferredId);
|
|
48
|
+
return props.pk !== void 0 ? props.pk : require_use_table_state.extractIdentifier(props.row, require_use_table_state.identifierFieldsOf(state.tableDef.value));
|
|
47
49
|
}
|
|
48
50
|
function promptCtx() {
|
|
49
51
|
const id = identifierOf();
|
package/dist/as-row-actions.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_row_actions = require("./as-row-actions-
|
|
1
|
+
const require_as_row_actions = require("./as-row-actions-q_oMmUz1.cjs");
|
|
2
2
|
module.exports = require_as_row_actions.as_row_actions_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-row-actions.vue-
|
|
1
|
+
import { t as _default } from "./as-row-actions.vue-CnjcRD0P.cjs";
|
|
2
2
|
export = _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-row-actions.vue-
|
|
1
|
+
import { t as _default } from "./as-row-actions.vue-BB8ATWBY.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-row-actions.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
1
|
+
import { t as as_row_actions_default } from "./as-row-actions-BNQ7jrie.mjs";
|
|
2
2
|
export { as_row_actions_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_use_table_component = require("./use-table-component-
|
|
3
|
-
const require_as_table_header_cell = require("./as-table-header-cell-
|
|
4
|
-
const require_as_row_actions = require("./as-row-actions-
|
|
5
|
-
const require_as_table_cell_value = require("./as-table-cell-value-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
|
+
const require_use_table_component = require("./use-table-component-CsdvdGJT.cjs");
|
|
3
|
+
const require_as_table_header_cell = require("./as-table-header-cell-DB7Cdskr.cjs");
|
|
4
|
+
const require_as_row_actions = require("./as-row-actions-q_oMmUz1.cjs");
|
|
5
|
+
const require_as_table_cell_value = require("./as-table-cell-value-VWlXc5dA.cjs");
|
|
6
6
|
let _atscript_ui = require("@atscript/ui");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
//#region src/composables/use-cell-resolver.ts
|
|
@@ -486,6 +486,8 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
486
486
|
const HeaderCell = require_use_table_component.useTableComponent("headerCell", require_as_table_header_cell.as_table_header_cell_default);
|
|
487
487
|
const props = __props;
|
|
488
488
|
const emit = __emit;
|
|
489
|
+
const tableState = require_use_table_state.useTableContextOptional()?.state;
|
|
490
|
+
const NO_OP = () => {};
|
|
489
491
|
const sortMap = (0, vue.computed)(() => {
|
|
490
492
|
const map = {};
|
|
491
493
|
for (const s of props.sorters) map[s.field] = s.direction;
|
|
@@ -557,7 +559,10 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
557
559
|
__props.hasSelectColumn ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_1$2, [(0, vue.renderSlot)(_ctx.$slots, "header-__select", {
|
|
558
560
|
state: __props.selectAllState,
|
|
559
561
|
toggle: toggleSelectAll,
|
|
560
|
-
selectedCount: __props.selectedCount ?? 0
|
|
562
|
+
selectedCount: __props.selectedCount ?? 0,
|
|
563
|
+
mode: (0, vue.unref)(tableState)?.querySelection.value ? "query" : "ids",
|
|
564
|
+
canSelectAllMatching: (0, vue.unref)(tableState)?.canSelectAllMatching.value ?? false,
|
|
565
|
+
selectAllMatching: (0, vue.unref)(tableState)?.selectAllMatching ?? NO_OP
|
|
561
566
|
}, () => [__props.selectAllState ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
562
567
|
key: 0,
|
|
563
568
|
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as toggleRowAt, h as onSelectControlKeydown, o as useTableContextOptional } from "./use-table-state-
|
|
2
|
-
import { t as useTableComponent } from "./use-table-component-
|
|
3
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
4
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
5
|
-
import { t as as_table_cell_value_default } from "./as-table-cell-value-
|
|
1
|
+
import { g as toggleRowAt, h as onSelectControlKeydown, o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { t as useTableComponent } from "./use-table-component-Dy397695.mjs";
|
|
3
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-ahzAeHXj.mjs";
|
|
4
|
+
import { t as as_row_actions_default } from "./as-row-actions-BNQ7jrie.mjs";
|
|
5
|
+
import { t as as_table_cell_value_default } from "./as-table-cell-value-D-S127gr.mjs";
|
|
6
6
|
import { UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_STYLES, UI_TABLE_STYLES, getFieldMeta, parseStaticAttrs, resolveAttrs, resolveFieldProp } from "@atscript/ui";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
8
8
|
//#region src/composables/use-cell-resolver.ts
|
|
@@ -486,6 +486,8 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
486
486
|
const HeaderCell = useTableComponent("headerCell", as_table_header_cell_default);
|
|
487
487
|
const props = __props;
|
|
488
488
|
const emit = __emit;
|
|
489
|
+
const tableState = useTableContextOptional()?.state;
|
|
490
|
+
const NO_OP = () => {};
|
|
489
491
|
const sortMap = computed(() => {
|
|
490
492
|
const map = {};
|
|
491
493
|
for (const s of props.sorters) map[s.field] = s.direction;
|
|
@@ -557,7 +559,10 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
557
559
|
__props.hasSelectColumn ? (openBlock(), createElementBlock("th", _hoisted_1$2, [renderSlot(_ctx.$slots, "header-__select", {
|
|
558
560
|
state: __props.selectAllState,
|
|
559
561
|
toggle: toggleSelectAll,
|
|
560
|
-
selectedCount: __props.selectedCount ?? 0
|
|
562
|
+
selectedCount: __props.selectedCount ?? 0,
|
|
563
|
+
mode: unref(tableState)?.querySelection.value ? "query" : "ids",
|
|
564
|
+
canSelectAllMatching: unref(tableState)?.canSelectAllMatching.value ?? false,
|
|
565
|
+
selectAllMatching: unref(tableState)?.selectAllMatching ?? NO_OP
|
|
561
566
|
}, () => [__props.selectAllState ? (openBlock(), createElementBlock("span", {
|
|
562
567
|
key: 0,
|
|
563
568
|
class: normalizeClass(["as-table-checkbox", {
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { B as ROW_ACTIONS_PATH, V as ROW_ACTIONS_TYPE, a as useTableContext, v as resolveRowActions } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, nextTick, normalizeClass, openBlock, ref, renderSlot, toDisplayString, unref, watch } from "vue";
|
|
3
|
+
import { reorderColumnNames } from "@atscript/ui-table";
|
|
4
|
+
//#region src/composables/use-row-actions-column.ts
|
|
5
|
+
/**
|
|
6
|
+
* The synthesised row-actions pseudo-column, shared by `<AsTable>` and
|
|
7
|
+
* `<AsWindowTable>`. Returns the renderer's effective column list — the base
|
|
8
|
+
* columns with a fixed `__actions` column prepended / appended per
|
|
9
|
+
* `placement` — and opts the table into per-row `$actions` while the column
|
|
10
|
+
* is shown.
|
|
11
|
+
*/
|
|
12
|
+
function useRowActionsColumn(state, opts) {
|
|
13
|
+
const cellActions = computed(() => {
|
|
14
|
+
const r = resolveRowActions(state, void 0);
|
|
15
|
+
return [
|
|
16
|
+
...r.default ? [r.default] : [],
|
|
17
|
+
...r.others,
|
|
18
|
+
...r.rows,
|
|
19
|
+
...r.extra
|
|
20
|
+
];
|
|
21
|
+
});
|
|
22
|
+
watch(() => {
|
|
23
|
+
const placement = opts.placement();
|
|
24
|
+
if (!placement) return false;
|
|
25
|
+
if (placement === "merge-select" && opts.select() !== "none") return false;
|
|
26
|
+
return cellActions.value.length > 0;
|
|
27
|
+
}, (on) => {
|
|
28
|
+
state.includeActions.value = on;
|
|
29
|
+
}, { immediate: true });
|
|
30
|
+
const actionsCol = computed(() => {
|
|
31
|
+
const acts = cellActions.value;
|
|
32
|
+
return {
|
|
33
|
+
path: ROW_ACTIONS_PATH,
|
|
34
|
+
label: "",
|
|
35
|
+
type: ROW_ACTIONS_TYPE,
|
|
36
|
+
sortable: false,
|
|
37
|
+
filterable: false,
|
|
38
|
+
nullable: false,
|
|
39
|
+
order: 0,
|
|
40
|
+
fixed: true,
|
|
41
|
+
width: acts.length === 1 && !acts[0].icon ? "8em" : "4em"
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return computed(() => {
|
|
45
|
+
const base = opts.columns();
|
|
46
|
+
const placement = opts.placement();
|
|
47
|
+
if (placement === false || placement === void 0) return base;
|
|
48
|
+
if (cellActions.value.length === 0) return base;
|
|
49
|
+
if (placement === "first") return [actionsCol.value, ...base];
|
|
50
|
+
if (placement === "last") return [...base, actionsCol.value];
|
|
51
|
+
if (opts.select() === "none") return [actionsCol.value, ...base];
|
|
52
|
+
return base;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/composables/use-table-column-handlers.ts
|
|
57
|
+
/**
|
|
58
|
+
* Pure pass-through handlers shared between the pagination renderer
|
|
59
|
+
* (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
|
|
60
|
+
* and row-mouse handlers stay in their owning components because their
|
|
61
|
+
* semantics diverge meaningfully (window has no "all" state; standalone
|
|
62
|
+
* vs Reka renderModes need different gating).
|
|
63
|
+
*/
|
|
64
|
+
function useTableColumnHandlers(state) {
|
|
65
|
+
return {
|
|
66
|
+
onSort(column, direction) {
|
|
67
|
+
state.sorters.value = direction === null ? [] : [{
|
|
68
|
+
field: column.path,
|
|
69
|
+
direction
|
|
70
|
+
}];
|
|
71
|
+
},
|
|
72
|
+
onHide(column) {
|
|
73
|
+
state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
|
|
74
|
+
},
|
|
75
|
+
onFilter(column) {
|
|
76
|
+
state.openFilterDialog(column);
|
|
77
|
+
},
|
|
78
|
+
onFiltersOff(column) {
|
|
79
|
+
state.removeFieldFilter(column.path);
|
|
80
|
+
},
|
|
81
|
+
onResetWidth(column) {
|
|
82
|
+
state.resetColumnWidth(column.path);
|
|
83
|
+
},
|
|
84
|
+
onReorder(fromPath, toPath, position) {
|
|
85
|
+
state.columnNames.value = reorderColumnNames(state.columnNames.value, fromPath, toPath, position);
|
|
86
|
+
},
|
|
87
|
+
onClearFilters() {
|
|
88
|
+
state.resetFilters();
|
|
89
|
+
if (state.searchTerm.value) state.searchTerm.value = "";
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/internal/as-selection-banner.vue?vue&type=script&setup=true&lang.ts
|
|
95
|
+
const _hoisted_1 = ["data-kind"];
|
|
96
|
+
const _hoisted_2 = { class: "as-selection-banner-text" };
|
|
97
|
+
const _hoisted_3 = { class: "as-selection-banner-text" };
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/internal/as-selection-banner.vue
|
|
100
|
+
var as_selection_banner_default = /* @__PURE__ */ defineComponent({
|
|
101
|
+
__name: "as-selection-banner",
|
|
102
|
+
props: { scope: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: true
|
|
105
|
+
} },
|
|
106
|
+
setup(__props) {
|
|
107
|
+
const props = __props;
|
|
108
|
+
const { state } = useTableContext();
|
|
109
|
+
const kind = computed(() => {
|
|
110
|
+
if (state.selectMode.value !== "multi") return null;
|
|
111
|
+
if (state.querySelection.value) return "query";
|
|
112
|
+
if (!state.canSelectAllMatching.value) return null;
|
|
113
|
+
const loaded = state.loadedEligiblePks.value.length;
|
|
114
|
+
return loaded > 0 && state.loadedSelectedCount.value === loaded ? "offer" : null;
|
|
115
|
+
});
|
|
116
|
+
const loadedCount = computed(() => state.loadedEligiblePks.value.length);
|
|
117
|
+
const offerText = computed(() => {
|
|
118
|
+
const n = loadedCount.value;
|
|
119
|
+
const where = props.scope === "page" ? "on this page" : "loaded";
|
|
120
|
+
return n === 1 ? `The 1 row ${where} is selected.` : `All ${n} rows ${where} are selected.`;
|
|
121
|
+
});
|
|
122
|
+
const queryText = computed(() => {
|
|
123
|
+
const n = state.selectedCount.value;
|
|
124
|
+
return n === 1 ? "1 matching row is selected." : `All ${n} matching rows are selected.`;
|
|
125
|
+
});
|
|
126
|
+
const rootRef = ref(null);
|
|
127
|
+
const btnRef = ref(null);
|
|
128
|
+
/**
|
|
129
|
+
* Keep keyboard focus when the banner's button is swapped — on the new
|
|
130
|
+
* button, or, once the banner is gone, on the table's select-all checkbox.
|
|
131
|
+
*/
|
|
132
|
+
async function refocus(hadFocus) {
|
|
133
|
+
if (!hadFocus) return;
|
|
134
|
+
await nextTick();
|
|
135
|
+
if (btnRef.value) {
|
|
136
|
+
btnRef.value.focus();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
rootRef.value?.parentElement?.querySelector(".as-th-select [role=checkbox][tabindex]")?.focus();
|
|
140
|
+
}
|
|
141
|
+
function hasFocus() {
|
|
142
|
+
return !!btnRef.value && btnRef.value === document.activeElement;
|
|
143
|
+
}
|
|
144
|
+
/** Run a banner action, keeping focus on the banner's button (see `refocus`). */
|
|
145
|
+
function keepingFocus(fn) {
|
|
146
|
+
return () => {
|
|
147
|
+
const focused = hasFocus();
|
|
148
|
+
fn();
|
|
149
|
+
refocus(focused);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const selectAllMatching = keepingFocus(() => state.selectAllMatching());
|
|
153
|
+
const clearSelection = keepingFocus(() => state.clearSelection());
|
|
154
|
+
return (_ctx, _cache) => {
|
|
155
|
+
return unref(state).selectMode.value === "multi" ? (openBlock(), createElementBlock("div", {
|
|
156
|
+
key: 0,
|
|
157
|
+
ref_key: "rootRef",
|
|
158
|
+
ref: rootRef,
|
|
159
|
+
role: "status",
|
|
160
|
+
"aria-live": "polite",
|
|
161
|
+
class: normalizeClass(kind.value ? "as-selection-banner" : "sr-only"),
|
|
162
|
+
"data-kind": kind.value ?? void 0
|
|
163
|
+
}, [kind.value ? renderSlot(_ctx.$slots, "default", {
|
|
164
|
+
key: 0,
|
|
165
|
+
selection: unref(state).selection.value,
|
|
166
|
+
canSelectAllMatching: unref(state).canSelectAllMatching.value,
|
|
167
|
+
selectAllMatching: unref(selectAllMatching),
|
|
168
|
+
clearSelection: unref(clearSelection),
|
|
169
|
+
loadedCount: loadedCount.value
|
|
170
|
+
}, () => [kind.value === "offer" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", _hoisted_2, toDisplayString(offerText.value), 1), createElementVNode("button", {
|
|
171
|
+
ref_key: "btnRef",
|
|
172
|
+
ref: btnRef,
|
|
173
|
+
type: "button",
|
|
174
|
+
class: "as-selection-banner-btn",
|
|
175
|
+
"data-select-all-matching": "",
|
|
176
|
+
onClick: _cache[0] || (_cache[0] = (...args) => unref(selectAllMatching) && unref(selectAllMatching)(...args))
|
|
177
|
+
}, " Select all " + toDisplayString(unref(state).totalCount.value) + " matching ", 513)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_3, toDisplayString(queryText.value), 1), createElementVNode("button", {
|
|
178
|
+
ref_key: "btnRef",
|
|
179
|
+
ref: btnRef,
|
|
180
|
+
type: "button",
|
|
181
|
+
class: "as-selection-banner-btn",
|
|
182
|
+
"data-clear-selection": "",
|
|
183
|
+
onClick: _cache[1] || (_cache[1] = (...args) => unref(clearSelection) && unref(clearSelection)(...args))
|
|
184
|
+
}, " Clear selection ", 512)], 64))]) : createCommentVNode("v-if", true)], 10, _hoisted_1)) : createCommentVNode("v-if", true);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
//#endregion
|
|
189
|
+
export { useTableColumnHandlers as n, useRowActionsColumn as r, as_selection_banner_default as t };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
let _atscript_ui_table = require("@atscript/ui-table");
|
|
4
|
+
//#region src/composables/use-row-actions-column.ts
|
|
5
|
+
/**
|
|
6
|
+
* The synthesised row-actions pseudo-column, shared by `<AsTable>` and
|
|
7
|
+
* `<AsWindowTable>`. Returns the renderer's effective column list — the base
|
|
8
|
+
* columns with a fixed `__actions` column prepended / appended per
|
|
9
|
+
* `placement` — and opts the table into per-row `$actions` while the column
|
|
10
|
+
* is shown.
|
|
11
|
+
*/
|
|
12
|
+
function useRowActionsColumn(state, opts) {
|
|
13
|
+
const cellActions = (0, vue.computed)(() => {
|
|
14
|
+
const r = require_use_table_state.resolveRowActions(state, void 0);
|
|
15
|
+
return [
|
|
16
|
+
...r.default ? [r.default] : [],
|
|
17
|
+
...r.others,
|
|
18
|
+
...r.rows,
|
|
19
|
+
...r.extra
|
|
20
|
+
];
|
|
21
|
+
});
|
|
22
|
+
(0, vue.watch)(() => {
|
|
23
|
+
const placement = opts.placement();
|
|
24
|
+
if (!placement) return false;
|
|
25
|
+
if (placement === "merge-select" && opts.select() !== "none") return false;
|
|
26
|
+
return cellActions.value.length > 0;
|
|
27
|
+
}, (on) => {
|
|
28
|
+
state.includeActions.value = on;
|
|
29
|
+
}, { immediate: true });
|
|
30
|
+
const actionsCol = (0, vue.computed)(() => {
|
|
31
|
+
const acts = cellActions.value;
|
|
32
|
+
return {
|
|
33
|
+
path: require_use_table_state.ROW_ACTIONS_PATH,
|
|
34
|
+
label: "",
|
|
35
|
+
type: require_use_table_state.ROW_ACTIONS_TYPE,
|
|
36
|
+
sortable: false,
|
|
37
|
+
filterable: false,
|
|
38
|
+
nullable: false,
|
|
39
|
+
order: 0,
|
|
40
|
+
fixed: true,
|
|
41
|
+
width: acts.length === 1 && !acts[0].icon ? "8em" : "4em"
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return (0, vue.computed)(() => {
|
|
45
|
+
const base = opts.columns();
|
|
46
|
+
const placement = opts.placement();
|
|
47
|
+
if (placement === false || placement === void 0) return base;
|
|
48
|
+
if (cellActions.value.length === 0) return base;
|
|
49
|
+
if (placement === "first") return [actionsCol.value, ...base];
|
|
50
|
+
if (placement === "last") return [...base, actionsCol.value];
|
|
51
|
+
if (opts.select() === "none") return [actionsCol.value, ...base];
|
|
52
|
+
return base;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/composables/use-table-column-handlers.ts
|
|
57
|
+
/**
|
|
58
|
+
* Pure pass-through handlers shared between the pagination renderer
|
|
59
|
+
* (`<AsTable>`) and the window renderer (`<AsWindowTableBase>`). Selection
|
|
60
|
+
* and row-mouse handlers stay in their owning components because their
|
|
61
|
+
* semantics diverge meaningfully (window has no "all" state; standalone
|
|
62
|
+
* vs Reka renderModes need different gating).
|
|
63
|
+
*/
|
|
64
|
+
function useTableColumnHandlers(state) {
|
|
65
|
+
return {
|
|
66
|
+
onSort(column, direction) {
|
|
67
|
+
state.sorters.value = direction === null ? [] : [{
|
|
68
|
+
field: column.path,
|
|
69
|
+
direction
|
|
70
|
+
}];
|
|
71
|
+
},
|
|
72
|
+
onHide(column) {
|
|
73
|
+
state.columnNames.value = state.columnNames.value.filter((n) => n !== column.path);
|
|
74
|
+
},
|
|
75
|
+
onFilter(column) {
|
|
76
|
+
state.openFilterDialog(column);
|
|
77
|
+
},
|
|
78
|
+
onFiltersOff(column) {
|
|
79
|
+
state.removeFieldFilter(column.path);
|
|
80
|
+
},
|
|
81
|
+
onResetWidth(column) {
|
|
82
|
+
state.resetColumnWidth(column.path);
|
|
83
|
+
},
|
|
84
|
+
onReorder(fromPath, toPath, position) {
|
|
85
|
+
state.columnNames.value = (0, _atscript_ui_table.reorderColumnNames)(state.columnNames.value, fromPath, toPath, position);
|
|
86
|
+
},
|
|
87
|
+
onClearFilters() {
|
|
88
|
+
state.resetFilters();
|
|
89
|
+
if (state.searchTerm.value) state.searchTerm.value = "";
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/internal/as-selection-banner.vue?vue&type=script&setup=true&lang.ts
|
|
95
|
+
const _hoisted_1 = ["data-kind"];
|
|
96
|
+
const _hoisted_2 = { class: "as-selection-banner-text" };
|
|
97
|
+
const _hoisted_3 = { class: "as-selection-banner-text" };
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/internal/as-selection-banner.vue
|
|
100
|
+
var as_selection_banner_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
101
|
+
__name: "as-selection-banner",
|
|
102
|
+
props: { scope: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: true
|
|
105
|
+
} },
|
|
106
|
+
setup(__props) {
|
|
107
|
+
const props = __props;
|
|
108
|
+
const { state } = require_use_table_state.useTableContext();
|
|
109
|
+
const kind = (0, vue.computed)(() => {
|
|
110
|
+
if (state.selectMode.value !== "multi") return null;
|
|
111
|
+
if (state.querySelection.value) return "query";
|
|
112
|
+
if (!state.canSelectAllMatching.value) return null;
|
|
113
|
+
const loaded = state.loadedEligiblePks.value.length;
|
|
114
|
+
return loaded > 0 && state.loadedSelectedCount.value === loaded ? "offer" : null;
|
|
115
|
+
});
|
|
116
|
+
const loadedCount = (0, vue.computed)(() => state.loadedEligiblePks.value.length);
|
|
117
|
+
const offerText = (0, vue.computed)(() => {
|
|
118
|
+
const n = loadedCount.value;
|
|
119
|
+
const where = props.scope === "page" ? "on this page" : "loaded";
|
|
120
|
+
return n === 1 ? `The 1 row ${where} is selected.` : `All ${n} rows ${where} are selected.`;
|
|
121
|
+
});
|
|
122
|
+
const queryText = (0, vue.computed)(() => {
|
|
123
|
+
const n = state.selectedCount.value;
|
|
124
|
+
return n === 1 ? "1 matching row is selected." : `All ${n} matching rows are selected.`;
|
|
125
|
+
});
|
|
126
|
+
const rootRef = (0, vue.ref)(null);
|
|
127
|
+
const btnRef = (0, vue.ref)(null);
|
|
128
|
+
/**
|
|
129
|
+
* Keep keyboard focus when the banner's button is swapped — on the new
|
|
130
|
+
* button, or, once the banner is gone, on the table's select-all checkbox.
|
|
131
|
+
*/
|
|
132
|
+
async function refocus(hadFocus) {
|
|
133
|
+
if (!hadFocus) return;
|
|
134
|
+
await (0, vue.nextTick)();
|
|
135
|
+
if (btnRef.value) {
|
|
136
|
+
btnRef.value.focus();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
rootRef.value?.parentElement?.querySelector(".as-th-select [role=checkbox][tabindex]")?.focus();
|
|
140
|
+
}
|
|
141
|
+
function hasFocus() {
|
|
142
|
+
return !!btnRef.value && btnRef.value === document.activeElement;
|
|
143
|
+
}
|
|
144
|
+
/** Run a banner action, keeping focus on the banner's button (see `refocus`). */
|
|
145
|
+
function keepingFocus(fn) {
|
|
146
|
+
return () => {
|
|
147
|
+
const focused = hasFocus();
|
|
148
|
+
fn();
|
|
149
|
+
refocus(focused);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const selectAllMatching = keepingFocus(() => state.selectAllMatching());
|
|
153
|
+
const clearSelection = keepingFocus(() => state.clearSelection());
|
|
154
|
+
return (_ctx, _cache) => {
|
|
155
|
+
return (0, vue.unref)(state).selectMode.value === "multi" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
156
|
+
key: 0,
|
|
157
|
+
ref_key: "rootRef",
|
|
158
|
+
ref: rootRef,
|
|
159
|
+
role: "status",
|
|
160
|
+
"aria-live": "polite",
|
|
161
|
+
class: (0, vue.normalizeClass)(kind.value ? "as-selection-banner" : "sr-only"),
|
|
162
|
+
"data-kind": kind.value ?? void 0
|
|
163
|
+
}, [kind.value ? (0, vue.renderSlot)(_ctx.$slots, "default", {
|
|
164
|
+
key: 0,
|
|
165
|
+
selection: (0, vue.unref)(state).selection.value,
|
|
166
|
+
canSelectAllMatching: (0, vue.unref)(state).canSelectAllMatching.value,
|
|
167
|
+
selectAllMatching: (0, vue.unref)(selectAllMatching),
|
|
168
|
+
clearSelection: (0, vue.unref)(clearSelection),
|
|
169
|
+
loadedCount: loadedCount.value
|
|
170
|
+
}, () => [kind.value === "offer" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("span", _hoisted_2, (0, vue.toDisplayString)(offerText.value), 1), (0, vue.createElementVNode)("button", {
|
|
171
|
+
ref_key: "btnRef",
|
|
172
|
+
ref: btnRef,
|
|
173
|
+
type: "button",
|
|
174
|
+
class: "as-selection-banner-btn",
|
|
175
|
+
"data-select-all-matching": "",
|
|
176
|
+
onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(selectAllMatching) && (0, vue.unref)(selectAllMatching)(...args))
|
|
177
|
+
}, " Select all " + (0, vue.toDisplayString)((0, vue.unref)(state).totalCount.value) + " matching ", 513)], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createElementVNode)("span", _hoisted_3, (0, vue.toDisplayString)(queryText.value), 1), (0, vue.createElementVNode)("button", {
|
|
178
|
+
ref_key: "btnRef",
|
|
179
|
+
ref: btnRef,
|
|
180
|
+
type: "button",
|
|
181
|
+
class: "as-selection-banner-btn",
|
|
182
|
+
"data-clear-selection": "",
|
|
183
|
+
onClick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(clearSelection) && (0, vue.unref)(clearSelection)(...args))
|
|
184
|
+
}, " Clear selection ", 512)], 64))]) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_1)) : (0, vue.createCommentVNode)("v-if", true);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
//#endregion
|
|
189
|
+
Object.defineProperty(exports, "as_selection_banner_default", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return as_selection_banner_default;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "useRowActionsColumn", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function() {
|
|
198
|
+
return useRowActionsColumn;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "useTableColumnHandlers", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return useTableColumnHandlers;
|
|
205
|
+
}
|
|
206
|
+
});
|