@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,37 +1,9 @@
|
|
|
1
1
|
import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
|
|
2
2
|
import { Component, ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
|
|
3
|
-
import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, DroppedFields, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
|
|
4
|
-
import { ClientError, PageResult, TDbActionInfo, TDbActionProcessor, TDbDeleteResult } from "@atscript/db-client";
|
|
3
|
+
import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, DroppedFields, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SelectionQuery, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
|
|
4
|
+
import { ClientError, PageResult, TDbActionInfo, TDbActionProcessor, TDbActionTargetSummary, TDbDeleteResult, TDbQueryTarget } from "@atscript/db-client";
|
|
5
5
|
import { FilterExpr, Uniquery } from "@uniqu/core";
|
|
6
6
|
|
|
7
|
-
//#region src/composables/state/intent-scope.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Per-action verdict of a gate: `true` keeps the action as is, `false` drops
|
|
10
|
-
* it (hidden), a non-empty string keeps it DISABLED with that string as the
|
|
11
|
-
* reason (`""` counts as `true`).
|
|
12
|
-
*/
|
|
13
|
-
type ActionVerdict = boolean | string;
|
|
14
|
-
type ActionGate = (a: TVueTableActionInfo) => ActionVerdict;
|
|
15
|
-
interface ActionBuckets {
|
|
16
|
-
default: TVueTableActionInfo | undefined;
|
|
17
|
-
others: TVueTableActionInfo[];
|
|
18
|
-
rows: TVueTableActionInfo[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build the identifier object to forward to `client.action` / `client.remove`.
|
|
22
|
-
*
|
|
23
|
-
* Per `@atscript/db-client` invariant #11, identifier bodies are object-only
|
|
24
|
-
* — never bare scalars, even for single-field PK tables. This helper accepts:
|
|
25
|
-
* - a row-shaped object (default `rowValueFn`) → picks `preferredId` fields;
|
|
26
|
-
* - a scalar value when `preferredId` has exactly one field (consumers that
|
|
27
|
-
* override `rowValueFn` to return the PK scalar) → wraps it.
|
|
28
|
-
*
|
|
29
|
-
* Returns `undefined` when no `preferredId` is declared, the source is
|
|
30
|
-
* `null`/`undefined`, or a scalar can't be paired with a single-field
|
|
31
|
-
* identifier.
|
|
32
|
-
*/
|
|
33
|
-
declare function extractIdentifier(source: unknown, preferredId: readonly string[]): Record<string, unknown> | undefined;
|
|
34
|
-
//#endregion
|
|
35
7
|
//#region src/composables/state/row-actions-config.d.ts
|
|
36
8
|
/**
|
|
37
9
|
* A {@link RowActionsConfig} compiled into the two passes a surface runs per
|
|
@@ -117,6 +89,65 @@ interface InvokeOpts {
|
|
|
117
89
|
* Since 0.1.134.
|
|
118
90
|
*/
|
|
119
91
|
row?: Record<string, unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Run a `'rows'` action on every row matching this query instead of on
|
|
94
|
+
* `pk` (pass `pk` as `undefined`): `client.actionOnQuery`. The action's
|
|
95
|
+
* `/meta` entry must carry `queryTarget`. Since 0.1.147.
|
|
96
|
+
*/
|
|
97
|
+
target?: ActionQueryTarget;
|
|
98
|
+
/**
|
|
99
|
+
* With `target`: the match count the user confirmed. The server answers
|
|
100
|
+
* `TARGET_CHANGED` when the query matches a different number of rows by
|
|
101
|
+
* the time it runs. Since 0.1.147.
|
|
102
|
+
*/
|
|
103
|
+
expectCount?: number;
|
|
104
|
+
/**
|
|
105
|
+
* With `target` + `expectCount`: asked once with the new count when the
|
|
106
|
+
* server answers `TARGET_CHANGED`. Resolve `true` to run again on the new
|
|
107
|
+
* count; `false` settles the action as that error. Since 0.1.147.
|
|
108
|
+
*/
|
|
109
|
+
confirmTargetChange?: (matched: number) => Promise<boolean>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* "Every row matching this query, minus `exclude`" — the target of a
|
|
113
|
+
* query-targeted action run (`InvokeOpts.target`). The `filter` / `search`
|
|
114
|
+
* / `index` of the table's query, never its sorting or paging. Since 0.1.147.
|
|
115
|
+
*/
|
|
116
|
+
type ActionQueryTarget = Pick<TDbQueryTarget, "filter" | "search" | "index" | "exclude" | "maxRows">;
|
|
117
|
+
/**
|
|
118
|
+
* A symbolic selection of every row matching the table's query (the "Select
|
|
119
|
+
* all N matching" banner), held in `state.querySelection`. Since 0.1.147.
|
|
120
|
+
*/
|
|
121
|
+
interface QuerySelection {
|
|
122
|
+
/** The filter / search / index the selection was made over. */
|
|
123
|
+
query: SelectionQuery;
|
|
124
|
+
/** `selectionSignature(query)` — a change of the live one drops the selection. */
|
|
125
|
+
signature: string;
|
|
126
|
+
/** `rowValueFn` values the user unticked after selecting all. */
|
|
127
|
+
excluded: unknown[];
|
|
128
|
+
/** Rows the query matched (`totalCount`), refreshed on same-scope refetches. */
|
|
129
|
+
total: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The selection as one value (`state.selection`): explicit row values, or
|
|
133
|
+
* every row matching a query minus the excluded ones. `count` is what the
|
|
134
|
+
* selection covers in both modes. Since 0.1.147.
|
|
135
|
+
*/
|
|
136
|
+
type TableSelection = {
|
|
137
|
+
mode: "ids";
|
|
138
|
+
ids: unknown[];
|
|
139
|
+
count: number;
|
|
140
|
+
} | {
|
|
141
|
+
mode: "query";
|
|
142
|
+
query: SelectionQuery;
|
|
143
|
+
excluded: unknown[];
|
|
144
|
+
total: number;
|
|
145
|
+
count: number;
|
|
146
|
+
};
|
|
147
|
+
/** Why the table dropped a selection on its own (`selection-reset`). Since 0.1.147. */
|
|
148
|
+
interface SelectionResetEvent {
|
|
149
|
+
/** `"scope"` — the filter, search or index changed under a query selection. */
|
|
150
|
+
reason: "scope";
|
|
120
151
|
}
|
|
121
152
|
/**
|
|
122
153
|
* A row action the APP owns — it has no server counterpart, so the backend
|
|
@@ -185,6 +216,15 @@ type ActionResult = {
|
|
|
185
216
|
kind: "backend";
|
|
186
217
|
data: unknown;
|
|
187
218
|
message?: string;
|
|
219
|
+
/**
|
|
220
|
+
* A query-targeted run (`InvokeOpts.target`): how many rows the query
|
|
221
|
+
* matched, and the handler's `TDbActionTargetSummary` when it returned
|
|
222
|
+
* one (a delegated action always does). Since 0.1.147.
|
|
223
|
+
*/
|
|
224
|
+
target?: {
|
|
225
|
+
matched: number;
|
|
226
|
+
summary?: TDbActionTargetSummary;
|
|
227
|
+
};
|
|
188
228
|
} | {
|
|
189
229
|
ok: true;
|
|
190
230
|
kind: "navigate";
|
|
@@ -235,6 +275,14 @@ interface TableActionsState {
|
|
|
235
275
|
* `{ id: '...' }`.
|
|
236
276
|
*/
|
|
237
277
|
invoke: (action: TVueTableActionInfo, pk?: Record<string, unknown> | Record<string, unknown>[], opts?: InvokeOpts) => Promise<ActionResult>;
|
|
278
|
+
/**
|
|
279
|
+
* How many rows a query-targeted run of `action` would cover right now
|
|
280
|
+
* (`client.countActionTarget` — a dry run, the handler does not run).
|
|
281
|
+
* Resolves `undefined` when the count failed; that failure is settled as
|
|
282
|
+
* the action's error result (`lastResult` + the `@action` emit), like an
|
|
283
|
+
* invoke. Since 0.1.147.
|
|
284
|
+
*/
|
|
285
|
+
countTarget: (action: TVueTableActionInfo, target: ActionQueryTarget, event?: KeyboardEvent | MouseEvent) => Promise<number | undefined>;
|
|
238
286
|
/** Set of action names with an in-flight invoke. */
|
|
239
287
|
invoking: ShallowRef<Set<string>>;
|
|
240
288
|
/** Latest result keyed by action name. */
|
|
@@ -305,6 +353,11 @@ interface ActionFormRequest {
|
|
|
305
353
|
/** Identifier objects for the targeted rows (used by `$1`/`$N` substitution in dialog copy). */
|
|
306
354
|
identifiers: Record<string, unknown>[];
|
|
307
355
|
preferredId: readonly string[];
|
|
356
|
+
/**
|
|
357
|
+
* A query-targeted run: how many rows it covers (`identifiers` is empty
|
|
358
|
+
* then). The dialog shows it in the title. Since 0.1.147.
|
|
359
|
+
*/
|
|
360
|
+
count?: number;
|
|
308
361
|
/** Internal — the dialog never calls this directly; use accept/dismiss. */
|
|
309
362
|
resolve: (input: unknown) => void;
|
|
310
363
|
}
|
|
@@ -533,6 +586,19 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
533
586
|
* when present, otherwise type+`@expect.maxLen`-derived (see `computeDefaultColumnWidth`).
|
|
534
587
|
*/
|
|
535
588
|
columnWidths: Ref<ColumnWidthsMap>;
|
|
589
|
+
/**
|
|
590
|
+
* The app-authored `forceFilters` scope, read live. For chrome such as a
|
|
591
|
+
* "scoped to ..." badge. Since 0.1.148.
|
|
592
|
+
*/
|
|
593
|
+
forceFilters: ComputedRef<FilterExpr | undefined>;
|
|
594
|
+
/** The app-authored `forceSorters`, read live (empty when none). Since 0.1.148. */
|
|
595
|
+
forceSorters: ComputedRef<SortControl[]>;
|
|
596
|
+
/**
|
|
597
|
+
* The IANA time zone the table reads dates in (`undefined` = the browser's):
|
|
598
|
+
* the `timeZone` option, else the cell locale's. Date filters, their chips
|
|
599
|
+
* and their inputs all follow it. Since 0.1.148.
|
|
600
|
+
*/
|
|
601
|
+
timeZone: ComputedRef<string | undefined>;
|
|
536
602
|
filterFields: ShallowRef<string[]>;
|
|
537
603
|
filters: ShallowRef<FieldFilters>;
|
|
538
604
|
/**
|
|
@@ -693,15 +759,62 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
693
759
|
deselectAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
694
760
|
/**
|
|
695
761
|
* The header checkbox's action over `rows`: deselect them when every
|
|
696
|
-
* eligible one is selected, otherwise select them.
|
|
762
|
+
* eligible one is selected, otherwise select them. In a query selection
|
|
763
|
+
* a fully selected `rows` ends it. `indexOf` as in `selectAll` (since
|
|
764
|
+
* 0.1.147). Since 0.1.142.
|
|
697
765
|
*/
|
|
698
|
-
toggleAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
766
|
+
toggleAll: (rows: readonly Record<string, unknown>[], indexOf?: (position: number) => number) => void;
|
|
699
767
|
/**
|
|
700
768
|
* Empty the selection — every pk, whether or not its row is loaded or
|
|
701
769
|
* eligible. The header checkbox only ever acts on loaded rows; this is the
|
|
702
|
-
* real clear. Since 0.1.142.
|
|
770
|
+
* real clear. Ends a query selection too. Since 0.1.142.
|
|
703
771
|
*/
|
|
704
772
|
clearSelection: () => void;
|
|
773
|
+
/**
|
|
774
|
+
* The symbolic "every row matching the query" selection, or `null` while
|
|
775
|
+
* the selection is the explicit `selectedRows` (bound by
|
|
776
|
+
* `v-model:query-selection` on `<AsTableRoot>`). While set, `selectedRows`
|
|
777
|
+
* is empty, row toggles edit `excluded`, `isPkSelected` is "not excluded"
|
|
778
|
+
* and `selectedCount` is `total − excluded.length`. Dropped (with a
|
|
779
|
+
* `selection-reset` `{ reason: "scope" }`) as soon as the filter, search
|
|
780
|
+
* or index changes — sorting, columns, paging and scrolling keep it. A
|
|
781
|
+
* successful query-targeted action clears it. Since 0.1.147.
|
|
782
|
+
*/
|
|
783
|
+
querySelection: Ref<QuerySelection | null>;
|
|
784
|
+
/** The selection as one value, in either mode — see {@link TableSelection}. Since 0.1.147. */
|
|
785
|
+
selection: ComputedRef<TableSelection>;
|
|
786
|
+
/**
|
|
787
|
+
* Opt-in for selecting every row matching the query — writable ref owned
|
|
788
|
+
* by `<AsTableRoot>`'s `select-all-matching` prop (default `false`).
|
|
789
|
+
* Since 0.1.147.
|
|
790
|
+
*/
|
|
791
|
+
allowSelectAllMatching: Ref<boolean>;
|
|
792
|
+
/**
|
|
793
|
+
* The renderer's `select` mode — writable ref pushed by `<AsTable>` /
|
|
794
|
+
* `<AsWindowTable>` (default `"none"`). Since 0.1.147.
|
|
795
|
+
*/
|
|
796
|
+
selectMode: Ref<SelectionMode>;
|
|
797
|
+
/**
|
|
798
|
+
* `rowValueFn` values of the LOADED rows the `rowSelectable` predicate
|
|
799
|
+
* lets through — the set "all rows on this page" covers (every cached row
|
|
800
|
+
* in window mode). Since 0.1.147.
|
|
801
|
+
*/
|
|
802
|
+
loadedEligiblePks: ComputedRef<unknown[]>;
|
|
803
|
+
/** How many of `loadedEligiblePks` are selected. Since 0.1.147. */
|
|
804
|
+
loadedSelectedCount: ComputedRef<number>;
|
|
805
|
+
/**
|
|
806
|
+
* Whether "Select all N matching" can be offered: `allowSelectAllMatching`
|
|
807
|
+
* ∧ `selectMode === "multi"` ∧ a server-backed table (no custom query
|
|
808
|
+
* function, not local mode) ∧ more matching rows than loaded ones
|
|
809
|
+
* ∧ at least one `'rows'` action that takes a query target. Since 0.1.147.
|
|
810
|
+
*/
|
|
811
|
+
canSelectAllMatching: ComputedRef<boolean>;
|
|
812
|
+
/**
|
|
813
|
+
* Select every row matching the current query (filter, search, index —
|
|
814
|
+
* force filters and custom filter conditions included). A no-op unless
|
|
815
|
+
* {@link canSelectAllMatching}. Since 0.1.147.
|
|
816
|
+
*/
|
|
817
|
+
selectAllMatching: () => void;
|
|
705
818
|
/** Column currently open in the filter dialog (null when closed). */
|
|
706
819
|
filterDialogColumn: Ref<ColumnDef | null>;
|
|
707
820
|
/** Absolute index of the keyboard-active row. -1 = nothing active. */
|
|
@@ -793,7 +906,8 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
793
906
|
*/
|
|
794
907
|
requestActionInput: (action: TVueTableActionInfo, ctx: {
|
|
795
908
|
identifiers: Record<string, unknown>[];
|
|
796
|
-
preferredId: readonly string[];
|
|
909
|
+
preferredId: readonly string[]; /** A query-targeted run's row count (since 0.1.147). */
|
|
910
|
+
count?: number;
|
|
797
911
|
}) => Promise<unknown>;
|
|
798
912
|
/** Resolve the active form request with `input`. Internal — used by the dialog. */
|
|
799
913
|
acceptActionForm: (input: unknown) => void;
|
|
@@ -1012,4 +1126,70 @@ interface PresetSurface {
|
|
|
1012
1126
|
lastError: Ref<Error | null>;
|
|
1013
1127
|
}
|
|
1014
1128
|
//#endregion
|
|
1015
|
-
|
|
1129
|
+
//#region src/composables/state/intent-scope.d.ts
|
|
1130
|
+
/**
|
|
1131
|
+
* Per-action verdict of a gate: `true` keeps the action as is, `false` drops
|
|
1132
|
+
* it (hidden), a non-empty string keeps it DISABLED with that string as the
|
|
1133
|
+
* reason (`""` counts as `true`).
|
|
1134
|
+
*/
|
|
1135
|
+
type ActionVerdict = boolean | string;
|
|
1136
|
+
type ActionGate = (a: TVueTableActionInfo) => ActionVerdict;
|
|
1137
|
+
interface ActionBuckets {
|
|
1138
|
+
default: TVueTableActionInfo | undefined;
|
|
1139
|
+
others: TVueTableActionInfo[];
|
|
1140
|
+
rows: TVueTableActionInfo[];
|
|
1141
|
+
}
|
|
1142
|
+
/** Disabled reason of a non-query-target action in a query selection. Since 0.1.147. */
|
|
1143
|
+
declare const QUERY_TARGET_UNSUPPORTED_REASON = "Not available for all matching rows \u2014 select rows individually";
|
|
1144
|
+
/**
|
|
1145
|
+
* The gate a query selection ("every row matching the query") puts on the
|
|
1146
|
+
* `'rows'` actions: enabled iff the action takes a query target
|
|
1147
|
+
* (`queryTarget`) of at least `count` rows; otherwise kept DISABLED with the
|
|
1148
|
+
* reason ({@link QUERY_TARGET_UNSUPPORTED_REASON}, or "At most {max} rows").
|
|
1149
|
+
* The loaded rows' `$actions` are deliberately not consulted — a sample of
|
|
1150
|
+
* the matching rows cannot speak for the rest; the server gates every row
|
|
1151
|
+
* when the action runs. Since 0.1.147.
|
|
1152
|
+
*/
|
|
1153
|
+
declare function queryTargetGate(count: number): ActionGate;
|
|
1154
|
+
/**
|
|
1155
|
+
* The fields an action identifier is built from — `tableDef.identifierFields`
|
|
1156
|
+
* (`preferredId` plus every delegated action's `idMap` path), falling back to
|
|
1157
|
+
* `preferredId` for a hand-built `TableDef` without it. Since 0.1.147.
|
|
1158
|
+
*/
|
|
1159
|
+
declare function identifierFieldsOf(def: TableDef | null | undefined): readonly string[];
|
|
1160
|
+
/**
|
|
1161
|
+
* Build the identifier object to forward to `client.action` / `client.remove`.
|
|
1162
|
+
*
|
|
1163
|
+
* Per `@atscript/db-client` invariant #11, identifier bodies are object-only
|
|
1164
|
+
* — never bare scalars, even for single-field PK tables. This helper accepts:
|
|
1165
|
+
* - a row-shaped object (default `rowValueFn`) → picks the `fields` (a dot
|
|
1166
|
+
* path keeps the row's nesting: `ref.key` → `{ ref: { key } }`);
|
|
1167
|
+
* - a scalar value when `fields` has exactly one entry (consumers that
|
|
1168
|
+
* override `rowValueFn` to return the PK scalar) → wraps it.
|
|
1169
|
+
*
|
|
1170
|
+
* `fields` is usually `identifierFields` (see {@link identifierFieldsOf}), so
|
|
1171
|
+
* the identifier carries what a delegated action maps from; each action then
|
|
1172
|
+
* takes the part it needs ({@link actionIdentifiers}).
|
|
1173
|
+
*
|
|
1174
|
+
* Returns `undefined` when `fields` is empty, the source is
|
|
1175
|
+
* `null`/`undefined`, or a scalar can't be paired with a single field.
|
|
1176
|
+
*/
|
|
1177
|
+
declare function extractIdentifier(source: unknown, fields: readonly string[]): Record<string, unknown> | undefined;
|
|
1178
|
+
/**
|
|
1179
|
+
* The identifiers `action` is sent, from the table's identifiers (built
|
|
1180
|
+
* from `identifierFields`): a delegated action (`idMap`) keeps exactly its
|
|
1181
|
+
* map's paths — the client maps them to the owner's identification — any
|
|
1182
|
+
* other action exactly the `preferredId` fields, the identification the
|
|
1183
|
+
* server validates. No fields → no identifiers. Identifiers already in that
|
|
1184
|
+
* shape come back as the same array. Since 0.1.147.
|
|
1185
|
+
*/
|
|
1186
|
+
declare function actionIdentifiers(action: Pick<TVueTableActionInfo, "idMap">, ids: Record<string, unknown>[], preferredId: readonly string[]): Record<string, unknown>[];
|
|
1187
|
+
/**
|
|
1188
|
+
* The query a query selection targets, with the excluded rows' identifiers
|
|
1189
|
+
* (built from `identifierFields`) — see `PromptCtx.target`. Since 0.1.147.
|
|
1190
|
+
*/
|
|
1191
|
+
type PromptTarget = SelectionQuery & {
|
|
1192
|
+
exclude: Record<string, unknown>[];
|
|
1193
|
+
};
|
|
1194
|
+
//#endregion
|
|
1195
|
+
export { RowSelectableHook as A, TableSelection as B, ResolvedRowActions as C, RowClassHook as D, RowAttrsHook as E, TAsCellTypeComponents as F, TAsTableControls as I, TVueTableActionInfo as L, SelectAllState as M, SelectOn as N, RowDeleteOpt as O, SelectionResetEvent as P, TableActionsState as R, ReactiveTableState as S, RowActionsConfig as T, resolveRowActions as V, MainActionRequest as _, identifierFieldsOf as a, QueryErrorKind as b, ActionResult as c, ConfigTab as d, ConfirmOptions as f, LocalRowAction as g, InvokeOpts as h, extractIdentifier as i, RowSelectableVerdict as j, RowHookContext as k, ApplyUrlQueryOptions as l, EnterAction as m, QUERY_TARGET_UNSUPPORTED_REASON as n, queryTargetGate as o, DroppedFieldsReport as p, actionIdentifiers as r, ActionQueryTarget as s, PromptTarget as t, ColumnMenuConfig as u, NavKeyOptions as v, RowActionsColumnPlacement as w, QuerySelection as x, PresetConfig as y, TableNavBridge as z };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { n as useCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { formatColumnCondition, formatColumnValue, formatFilterCondition } from "@atscript/ui-table";
|
|
4
|
+
//#region src/composables/use-condition-format.ts
|
|
5
|
+
/**
|
|
6
|
+
* Chip wording for filter conditions, in the table's time zone and the cell
|
|
7
|
+
* locale: "Last 7 days", "on Oct 5, 2026", "after Oct 5, 2026, 14:30" on date
|
|
8
|
+
* columns, the operator symbols elsewhere. Reads reactive sources, so call the
|
|
9
|
+
* returned functions inside `computed` / templates.
|
|
10
|
+
*
|
|
11
|
+
* Call in `setup` (it injects the cell locale).
|
|
12
|
+
*/
|
|
13
|
+
function useConditionFormat(state) {
|
|
14
|
+
const { locale } = useCellLocale();
|
|
15
|
+
const opts = () => ({
|
|
16
|
+
locale: locale.value,
|
|
17
|
+
timeZone: state.timeZone.value
|
|
18
|
+
});
|
|
19
|
+
const columns = computed(() => new Map(state.allColumns.value.map((c) => [c.path, c])));
|
|
20
|
+
return {
|
|
21
|
+
formatCondition(column, cond) {
|
|
22
|
+
return column ? formatColumnCondition(column, cond, opts()) : formatFilterCondition(cond);
|
|
23
|
+
},
|
|
24
|
+
formatValue(path, value) {
|
|
25
|
+
const column = columns.value.get(path);
|
|
26
|
+
return column ? formatColumnValue(column, value, opts()) : void 0;
|
|
27
|
+
},
|
|
28
|
+
labelOf(path) {
|
|
29
|
+
return columns.value.get(path)?.label;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { useConditionFormat as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_use_cell_locale = require("./use-cell-locale-Dv514-Al.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
let _atscript_ui_table = require("@atscript/ui-table");
|
|
4
|
+
//#region src/composables/use-condition-format.ts
|
|
5
|
+
/**
|
|
6
|
+
* Chip wording for filter conditions, in the table's time zone and the cell
|
|
7
|
+
* locale: "Last 7 days", "on Oct 5, 2026", "after Oct 5, 2026, 14:30" on date
|
|
8
|
+
* columns, the operator symbols elsewhere. Reads reactive sources, so call the
|
|
9
|
+
* returned functions inside `computed` / templates.
|
|
10
|
+
*
|
|
11
|
+
* Call in `setup` (it injects the cell locale).
|
|
12
|
+
*/
|
|
13
|
+
function useConditionFormat(state) {
|
|
14
|
+
const { locale } = require_use_cell_locale.useCellLocale();
|
|
15
|
+
const opts = () => ({
|
|
16
|
+
locale: locale.value,
|
|
17
|
+
timeZone: state.timeZone.value
|
|
18
|
+
});
|
|
19
|
+
const columns = (0, vue.computed)(() => new Map(state.allColumns.value.map((c) => [c.path, c])));
|
|
20
|
+
return {
|
|
21
|
+
formatCondition(column, cond) {
|
|
22
|
+
return column ? (0, _atscript_ui_table.formatColumnCondition)(column, cond, opts()) : (0, _atscript_ui_table.formatFilterCondition)(cond);
|
|
23
|
+
},
|
|
24
|
+
formatValue(path, value) {
|
|
25
|
+
const column = columns.value.get(path);
|
|
26
|
+
return column ? (0, _atscript_ui_table.formatColumnValue)(column, value, opts()) : void 0;
|
|
27
|
+
},
|
|
28
|
+
labelOf(path) {
|
|
29
|
+
return columns.value.get(path)?.label;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, "useConditionFormat", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function() {
|
|
37
|
+
return useConditionFormat;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-
|
|
2
|
-
import { n as useTableSelection } from "./use-table-selection-
|
|
1
|
+
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
|
+
import { n as useTableSelection } from "./use-table-selection-CdaOPo1d.mjs";
|
|
3
|
+
import { n as useCellLocale } from "./use-cell-locale-BTJZ6UcP.mjs";
|
|
3
4
|
import { createTableDef, getMetaEntry, resetMetaCache } from "@atscript/ui";
|
|
4
|
-
import { computed, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
|
|
5
|
+
import { computed, getCurrentInstance, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
|
|
5
6
|
import { PresetsClient, STANDARD_PRESET_ID, debounce, deserializeDraft, isEmptyDraft, isSystemPresetId, isUnavailableError, resolveSystemPresets, serializeDraft, stableStringify } from "@atscript/ui-table";
|
|
6
7
|
//#region src/composables/as-presets-app.ts
|
|
7
8
|
/**
|
|
@@ -33,6 +34,23 @@ function injectPresetsApp(explicit) {
|
|
|
33
34
|
throw new Error("[vue-table] AS_PRESETS_APP not provided. Call `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot, or pass `app` to the composable.");
|
|
34
35
|
}
|
|
35
36
|
//#endregion
|
|
37
|
+
//#region src/utils/week-start.ts
|
|
38
|
+
/**
|
|
39
|
+
* The first day of the week for a locale, `1` = Monday … `7` = Sunday, from
|
|
40
|
+
* `Intl.Locale#getWeekInfo` where the runtime has it; `undefined` otherwise
|
|
41
|
+
* (callers then default to Monday).
|
|
42
|
+
*/
|
|
43
|
+
function weekStartOf(locale) {
|
|
44
|
+
if (!locale) return void 0;
|
|
45
|
+
try {
|
|
46
|
+
const l = new Intl.Locale(locale);
|
|
47
|
+
const day = (l.getWeekInfo?.() ?? l.weekInfo)?.firstDay;
|
|
48
|
+
return typeof day === "number" && day >= 1 && day <= 7 ? day : void 0;
|
|
49
|
+
} catch {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
36
54
|
//#region src/composables/use-local-draft.ts
|
|
37
55
|
const DEFAULT_DEBOUNCE_MS = 300;
|
|
38
56
|
/**
|
|
@@ -395,6 +413,7 @@ function useTable(url, opts) {
|
|
|
395
413
|
if (!entry.tableDef) entry.tableDef = Promise.all([entry.meta, entry.type]).then(([meta, type]) => createTableDef(meta, type));
|
|
396
414
|
const { client } = entry;
|
|
397
415
|
const defPromise = entry.tableDef;
|
|
416
|
+
const cellLocale = getCurrentInstance() ? useCellLocale() : void 0;
|
|
398
417
|
const preset = opts?.preset;
|
|
399
418
|
const presetsHandle = preset ? usePresets({
|
|
400
419
|
url: preset.url,
|
|
@@ -415,7 +434,9 @@ function useTable(url, opts) {
|
|
|
415
434
|
limit: opts?.limit,
|
|
416
435
|
selection: {
|
|
417
436
|
rowValueFn: opts?.rowValueFn,
|
|
418
|
-
selectedRows: opts?.selectedRows
|
|
437
|
+
selectedRows: opts?.selectedRows,
|
|
438
|
+
querySelection: opts?.querySelection,
|
|
439
|
+
onSelectionReset: opts?.onSelectionReset
|
|
419
440
|
},
|
|
420
441
|
model: {
|
|
421
442
|
filterFields: opts?.filterFields,
|
|
@@ -429,6 +450,8 @@ function useTable(url, opts) {
|
|
|
429
450
|
forceFilters: opts?.forceFilters,
|
|
430
451
|
forceSorters: opts?.forceSorters,
|
|
431
452
|
alwaysSelected: opts?.alwaysSelected,
|
|
453
|
+
timeZone: () => toValue(opts?.timeZone) ?? cellLocale?.timezone.value,
|
|
454
|
+
weekStart: () => toValue(opts?.weekStart) ?? weekStartOf(cellLocale?.locale.value),
|
|
432
455
|
blockQuery: opts?.blockQuery,
|
|
433
456
|
queryOnMount: opts?.queryOnMount,
|
|
434
457
|
ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_use_table_selection = require("./use-table-selection-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
|
+
const require_use_table_selection = require("./use-table-selection-Cs7-gjHg.cjs");
|
|
3
|
+
const require_use_cell_locale = require("./use-cell-locale-Dv514-Al.cjs");
|
|
3
4
|
let _atscript_ui = require("@atscript/ui");
|
|
4
5
|
let vue = require("vue");
|
|
5
6
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
@@ -33,6 +34,23 @@ function injectPresetsApp(explicit) {
|
|
|
33
34
|
throw new Error("[vue-table] AS_PRESETS_APP not provided. Call `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot, or pass `app` to the composable.");
|
|
34
35
|
}
|
|
35
36
|
//#endregion
|
|
37
|
+
//#region src/utils/week-start.ts
|
|
38
|
+
/**
|
|
39
|
+
* The first day of the week for a locale, `1` = Monday … `7` = Sunday, from
|
|
40
|
+
* `Intl.Locale#getWeekInfo` where the runtime has it; `undefined` otherwise
|
|
41
|
+
* (callers then default to Monday).
|
|
42
|
+
*/
|
|
43
|
+
function weekStartOf(locale) {
|
|
44
|
+
if (!locale) return void 0;
|
|
45
|
+
try {
|
|
46
|
+
const l = new Intl.Locale(locale);
|
|
47
|
+
const day = (l.getWeekInfo?.() ?? l.weekInfo)?.firstDay;
|
|
48
|
+
return typeof day === "number" && day >= 1 && day <= 7 ? day : void 0;
|
|
49
|
+
} catch {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
36
54
|
//#region src/composables/use-local-draft.ts
|
|
37
55
|
const DEFAULT_DEBOUNCE_MS = 300;
|
|
38
56
|
/**
|
|
@@ -395,6 +413,7 @@ function useTable(url, opts) {
|
|
|
395
413
|
if (!entry.tableDef) entry.tableDef = Promise.all([entry.meta, entry.type]).then(([meta, type]) => (0, _atscript_ui.createTableDef)(meta, type));
|
|
396
414
|
const { client } = entry;
|
|
397
415
|
const defPromise = entry.tableDef;
|
|
416
|
+
const cellLocale = (0, vue.getCurrentInstance)() ? require_use_cell_locale.useCellLocale() : void 0;
|
|
398
417
|
const preset = opts?.preset;
|
|
399
418
|
const presetsHandle = preset ? usePresets({
|
|
400
419
|
url: preset.url,
|
|
@@ -415,7 +434,9 @@ function useTable(url, opts) {
|
|
|
415
434
|
limit: opts?.limit,
|
|
416
435
|
selection: {
|
|
417
436
|
rowValueFn: opts?.rowValueFn,
|
|
418
|
-
selectedRows: opts?.selectedRows
|
|
437
|
+
selectedRows: opts?.selectedRows,
|
|
438
|
+
querySelection: opts?.querySelection,
|
|
439
|
+
onSelectionReset: opts?.onSelectionReset
|
|
419
440
|
},
|
|
420
441
|
model: {
|
|
421
442
|
filterFields: opts?.filterFields,
|
|
@@ -429,6 +450,8 @@ function useTable(url, opts) {
|
|
|
429
450
|
forceFilters: opts?.forceFilters,
|
|
430
451
|
forceSorters: opts?.forceSorters,
|
|
431
452
|
alwaysSelected: opts?.alwaysSelected,
|
|
453
|
+
timeZone: () => (0, vue.toValue)(opts?.timeZone) ?? cellLocale?.timezone.value,
|
|
454
|
+
weekStart: () => (0, vue.toValue)(opts?.weekStart) ?? weekStartOf(cellLocale?.locale.value),
|
|
432
455
|
blockQuery: opts?.blockQuery,
|
|
433
456
|
queryOnMount: opts?.queryOnMount,
|
|
434
457
|
ignoreSortersWhenSearched: typeof opts?.ignoreSortersWhenSearched === "boolean" ? opts.ignoreSortersWhenSearched : void 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BQchKxUr.cjs");
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-CIoWhwTD.mjs";
|
|
2
2
|
//#region src/composables/use-table-nav-bridge.ts
|
|
3
3
|
function isPassthroughKey(event) {
|
|
4
4
|
const key = event.key;
|
|
@@ -7,7 +7,9 @@ import { trimSelection } from "@atscript/ui-table";
|
|
|
7
7
|
* clean; other transitions are no-ops (`'none' → 'multi'` already has an
|
|
8
8
|
* empty selection, `'multi' → 'multi'` doesn't change semantics). The
|
|
9
9
|
* getter is invoked once per change — NOT immediate, so the mount-time
|
|
10
|
-
* default `'none'` doesn't clobber externally-seeded selections.
|
|
10
|
+
* default `'none'` doesn't clobber externally-seeded selections. Also pushes
|
|
11
|
+
* the mode into `state.selectMode` (immediately), and dropping into `'none'`
|
|
12
|
+
* ends a query selection too.
|
|
11
13
|
*
|
|
12
14
|
* Lives outside `useTableSelection` because selection mode is a renderer
|
|
13
15
|
* concern (a prop, not state) — both `<AsTable>` and `<AsWindowTable>`
|
|
@@ -15,8 +17,11 @@ import { trimSelection } from "@atscript/ui-table";
|
|
|
15
17
|
*/
|
|
16
18
|
function useSelectModeReset(state, selectGetter) {
|
|
17
19
|
watch(selectGetter, (next, prev) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
state.selectMode.value = next;
|
|
21
|
+
if (prev === void 0) return;
|
|
22
|
+
if (next === "none" && prev !== "none") state.clearSelection();
|
|
23
|
+
else if (next !== "multi" && state.querySelection.value) state.querySelection.value = null;
|
|
24
|
+
}, { immediate: true });
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Wire up selection reconciliation on results change.
|
|
@@ -7,7 +7,9 @@ let _atscript_ui_table = require("@atscript/ui-table");
|
|
|
7
7
|
* clean; other transitions are no-ops (`'none' → 'multi'` already has an
|
|
8
8
|
* empty selection, `'multi' → 'multi'` doesn't change semantics). The
|
|
9
9
|
* getter is invoked once per change — NOT immediate, so the mount-time
|
|
10
|
-
* default `'none'` doesn't clobber externally-seeded selections.
|
|
10
|
+
* default `'none'` doesn't clobber externally-seeded selections. Also pushes
|
|
11
|
+
* the mode into `state.selectMode` (immediately), and dropping into `'none'`
|
|
12
|
+
* ends a query selection too.
|
|
11
13
|
*
|
|
12
14
|
* Lives outside `useTableSelection` because selection mode is a renderer
|
|
13
15
|
* concern (a prop, not state) — both `<AsTable>` and `<AsWindowTable>`
|
|
@@ -15,8 +17,11 @@ let _atscript_ui_table = require("@atscript/ui-table");
|
|
|
15
17
|
*/
|
|
16
18
|
function useSelectModeReset(state, selectGetter) {
|
|
17
19
|
(0, vue.watch)(selectGetter, (next, prev) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
state.selectMode.value = next;
|
|
21
|
+
if (prev === void 0) return;
|
|
22
|
+
if (next === "none" && prev !== "none") state.clearSelection();
|
|
23
|
+
else if (next !== "multi" && state.querySelection.value) state.querySelection.value = null;
|
|
24
|
+
}, { immediate: true });
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Wire up selection reconciliation on results change.
|