@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,25 +1,37 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as RowSelectableHook, B as TableSelection, D as RowClassHook, E as RowAttrsHook, F as TAsCellTypeComponents, I as TAsTableControls, L as TVueTableActionInfo, N as SelectOn, O as RowDeleteOpt, P as SelectionResetEvent, R as TableActionsState, S as ReactiveTableState, T as RowActionsConfig, b as QueryErrorKind, c as ActionResult, f as ConfirmOptions, m as EnterAction, p as DroppedFieldsReport, u as ColumnMenuConfig, v as NavKeyOptions, w as RowActionsColumnPlacement, x as QuerySelection, y as PresetConfig, z as TableNavBridge } from "./intent-scope-CvD4YOvf.mjs";
|
|
2
2
|
import * as _atscript_ui0 from "@atscript/ui";
|
|
3
3
|
import { ClientFactory, ClientFactory as ClientFactory$1, ColumnDef, SortControl, TableDef, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
4
4
|
import * as vue from "vue";
|
|
5
|
-
import {
|
|
5
|
+
import { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
6
6
|
import * as _atscript_ui_table0 from "@atscript/ui-table";
|
|
7
|
-
import { AppConfData, AppConfData as AppConfData$1, AsPresetEntryRow, AsPresetEntryRow as AsPresetEntryRow$1, ColumnWidthsMap, CsvOptions, CsvOptions as CsvOptions$1, DisplayColumnDef, DisplayColumnDef as DisplayColumnDef$1, ExportAbortError, ExportScalar, ExportScalar as ExportScalar$1, FilterCondition, PRESET_ASPECTS, PresetAspect, PresetAspect as PresetAspect$1, PresetCapabilities, PresetCapabilities as PresetCapabilities$1, PresetData, PresetDraft, PresetSnapshot, PresetSnapshot as PresetSnapshot$1, PresetSnapshotWire, QueryOptions, STANDARD_PRESET_ID as STANDARD_PRESET_ID$1, SYSTEM_PRESET_PREFIX, SelectionMode, SystemPreset, SystemPreset as SystemPreset$1, SystemPresetInput, SystemPresetInput as SystemPresetInput$1, UnsupportedFilter, UrlQuerySync, UrlQuerySync as UrlQuerySync$1, UserConfData, isSystemPresetId as isSystemPresetId$1, resolveSystemPresets as resolveSystemPresets$1 } from "@atscript/ui-table";
|
|
7
|
+
import { AppConfData, AppConfData as AppConfData$1, AsPresetEntryRow, AsPresetEntryRow as AsPresetEntryRow$1, ColumnWidthsMap, CsvOptions, CsvOptions as CsvOptions$1, DisplayColumnDef, DisplayColumnDef as DisplayColumnDef$1, ExportAbortError, ExportScalar, ExportScalar as ExportScalar$1, FilterCondition, PRESET_ASPECTS, PresetAspect, PresetAspect as PresetAspect$1, PresetCapabilities, PresetCapabilities as PresetCapabilities$1, PresetData, PresetDraft, PresetSnapshot, PresetSnapshot as PresetSnapshot$1, PresetSnapshotWire, QueryOptions, STANDARD_PRESET_ID as STANDARD_PRESET_ID$1, SYSTEM_PRESET_PREFIX, SelectionMode, SelectionQuery, SelectionQuery as SelectionQuery$1, SystemPreset, SystemPreset as SystemPreset$1, SystemPresetInput, SystemPresetInput as SystemPresetInput$1, UnsupportedFilter, UrlQueryRecord, UrlQueryRecordInput, UrlQueryRecordOptions, UrlQuerySync, UrlQuerySync as UrlQuerySync$1, UserConfData, isSystemPresetId as isSystemPresetId$1, resolveSystemPresets as resolveSystemPresets$1 } from "@atscript/ui-table";
|
|
8
8
|
import { Client, PageResult } from "@atscript/db-client";
|
|
9
9
|
import { TAsTypeComponents } from "@atscript/vue-form";
|
|
10
10
|
import { FilterExpr, Uniquery } from "@uniqu/core";
|
|
11
11
|
|
|
12
12
|
//#region src/composables/state/create-selection.d.ts
|
|
13
|
-
type Row = Record<string, unknown>;
|
|
13
|
+
type Row$1 = Record<string, unknown>;
|
|
14
14
|
interface SelectionApiOptions {
|
|
15
15
|
/** Extract a unique value from a row for selection tracking. */
|
|
16
|
-
rowValueFn?: (row: Row) => unknown;
|
|
16
|
+
rowValueFn?: (row: Row$1) => unknown;
|
|
17
17
|
/**
|
|
18
18
|
* External ref to back `selectedRows`. When provided the framework reads
|
|
19
19
|
* from and writes to this ref directly (identity preserved); otherwise a
|
|
20
20
|
* local `shallowRef([])` is created.
|
|
21
21
|
*/
|
|
22
22
|
selectedRows?: Ref<unknown[]>;
|
|
23
|
+
/**
|
|
24
|
+
* External ref to back `querySelection` (`v-model:query-selection`).
|
|
25
|
+
* Writers replace the value wholesale. Since 0.1.147.
|
|
26
|
+
*/
|
|
27
|
+
querySelection?: Ref<QuerySelection | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Stable identity of a selection value for a query selection's
|
|
30
|
+
* exclusions. A row object (the default `rowValueFn`) is a new object on
|
|
31
|
+
* every refetch, so exclusions compare by this key, not by reference.
|
|
32
|
+
* Default: the value itself. Since 0.1.147.
|
|
33
|
+
*/
|
|
34
|
+
identityOf?: (value: unknown) => unknown;
|
|
23
35
|
}
|
|
24
36
|
//#endregion
|
|
25
37
|
//#region src/composables/use-local-draft.d.ts
|
|
@@ -193,11 +205,11 @@ interface TableContext {
|
|
|
193
205
|
/** Cell-type → component dispatch map. */
|
|
194
206
|
types?: TAsCellTypeComponents;
|
|
195
207
|
/** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
196
|
-
components?: Record<string, Component
|
|
208
|
+
components?: Record<string, Component>;
|
|
197
209
|
/** Form-type → component dispatch map for the action-form dialog. */
|
|
198
210
|
formTypes?: TAsTypeComponents;
|
|
199
211
|
/** Named form-component overrides for the action-form dialog. */
|
|
200
|
-
formComponents?: Record<string, Component
|
|
212
|
+
formComponents?: Record<string, Component>;
|
|
201
213
|
}
|
|
202
214
|
type QueryFn = (query: Uniquery, page: number, size: number) => Promise<PageResult<Record<string, unknown>>>;
|
|
203
215
|
/** Per-call overrides for `state.buildQuery()`. Since 0.1.134. */
|
|
@@ -223,7 +235,14 @@ interface TableModelRefs {
|
|
|
223
235
|
*/
|
|
224
236
|
ignoreSortersWhenSearched?: Ref<boolean>;
|
|
225
237
|
}
|
|
226
|
-
|
|
238
|
+
interface TableSelectionOptions extends SelectionApiOptions {
|
|
239
|
+
/**
|
|
240
|
+
* Called when the table drops a query selection on its own — the filter,
|
|
241
|
+
* search or index changed under it (`<AsTableRoot>`'s `selection-reset`).
|
|
242
|
+
* Since 0.1.147.
|
|
243
|
+
*/
|
|
244
|
+
onSelectionReset?: (event: SelectionResetEvent) => void;
|
|
245
|
+
}
|
|
227
246
|
interface TableQueryOptions {
|
|
228
247
|
/** Override the default query function. */
|
|
229
248
|
fn?: QueryFn;
|
|
@@ -232,14 +251,22 @@ interface TableQueryOptions {
|
|
|
232
251
|
* App-authored, so never pruned of fields the caller cannot see — keep it
|
|
233
252
|
* to fields every role reads, or the query is rejected.
|
|
234
253
|
*/
|
|
235
|
-
forceFilters?: FilterExpr
|
|
254
|
+
forceFilters?: MaybeRefOrGetter<FilterExpr | undefined>;
|
|
236
255
|
/** Always-applied sorters (prepended before user sorters). Never pruned, like `forceFilters`. */
|
|
237
|
-
forceSorters?: SortControl[]
|
|
256
|
+
forceSorters?: MaybeRefOrGetter<SortControl[] | undefined>;
|
|
238
257
|
/**
|
|
239
258
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
240
259
|
* meta), regardless of which columns are visible. Additive only.
|
|
241
260
|
*/
|
|
242
|
-
alwaysSelected?: string[]
|
|
261
|
+
alwaysSelected?: MaybeRefOrGetter<string[] | undefined>;
|
|
262
|
+
/**
|
|
263
|
+
* The IANA time zone dates are read in — where "today" starts and which
|
|
264
|
+
* instant a day filter means. Read live: a change re-queries when a date
|
|
265
|
+
* filter is set. Default: the browser's zone. Since 0.1.148.
|
|
266
|
+
*/
|
|
267
|
+
timeZone?: MaybeRefOrGetter<string | undefined>;
|
|
268
|
+
/** First day of the week for `week` filters (`1` Monday … `7` Sunday). Default `1`. Since 0.1.148. */
|
|
269
|
+
weekStart?: MaybeRefOrGetter<number | undefined>;
|
|
243
270
|
/**
|
|
244
271
|
* When true, all triggers (query/queryNext/loadRange) early-return. Pass a
|
|
245
272
|
* getter (or a ref) to keep it reactive: when it flips back to `false` the
|
|
@@ -292,6 +319,9 @@ interface TableQueryOptions {
|
|
|
292
319
|
* Since 0.1.140 such pieces are carried as `residualFilters` instead
|
|
293
320
|
* whenever every field they reference is a server-backed column (and
|
|
294
321
|
* `urlQuerySync.residual` is not `false`); only the rest are reported.
|
|
322
|
+
* Since 0.1.147 it also receives each URL segment that does not parse
|
|
323
|
+
* (reason `"syntax"`, the segment in `issue.raw`) — the rest of the URL
|
|
324
|
+
* still applies.
|
|
295
325
|
*/
|
|
296
326
|
onUnsupportedFilter?: (issue: UnsupportedFilter) => void;
|
|
297
327
|
/**
|
|
@@ -403,6 +433,15 @@ interface CreateStaticTableStateOptions {
|
|
|
403
433
|
model?: TableModelRefs;
|
|
404
434
|
/** Auto-query once the synthetic definition is in place (default: true). Since 0.1.134. */
|
|
405
435
|
queryOnMount?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* Supplies each page itself (server-backed values, e.g. the distinct-values
|
|
438
|
+
* picker) instead of slicing `rows` in memory: `rows` is ignored, local
|
|
439
|
+
* search / sort do not run, and the returned `count` sizes the window.
|
|
440
|
+
* Since 0.1.148.
|
|
441
|
+
*/
|
|
442
|
+
remote?: (ctx: {
|
|
443
|
+
searchTerm: string;
|
|
444
|
+
}, page: number, size: number) => Promise<PageResult<Record<string, unknown>>>;
|
|
406
445
|
/**
|
|
407
446
|
* Action settings. Only the client-free parts apply — there is no client to
|
|
408
447
|
* invoke a server action with. Since 0.1.134.
|
|
@@ -497,15 +536,43 @@ interface UseTableOptions {
|
|
|
497
536
|
* this ref directly.
|
|
498
537
|
*/
|
|
499
538
|
selectedRows?: Ref<unknown[]>;
|
|
500
|
-
/**
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
539
|
+
/**
|
|
540
|
+
* External ref for the "every row matching the query" selection
|
|
541
|
+
* (`v-model:query-selection`). Since 0.1.147.
|
|
542
|
+
*/
|
|
543
|
+
querySelection?: Ref<QuerySelection | null>;
|
|
544
|
+
/**
|
|
545
|
+
* Called when the table drops a query selection because its filter,
|
|
546
|
+
* search or index changed. Since 0.1.147.
|
|
547
|
+
*/
|
|
548
|
+
onSelectionReset?: (event: SelectionResetEvent) => void;
|
|
549
|
+
/**
|
|
550
|
+
* Always-applied Uniquery filter expression (AND'd with user filters).
|
|
551
|
+
* Live since 0.1.148: pass a ref or getter and a change re-queries the
|
|
552
|
+
* mounted table on page 1, keeping the user's filters, search, sorters and
|
|
553
|
+
* columns. Compared structurally, so an equal new object is no change.
|
|
554
|
+
*/
|
|
555
|
+
forceFilters?: MaybeRefOrGetter<FilterExpr | undefined>;
|
|
556
|
+
/** Always-applied sorters (prepended before user sorters). Live, like `forceFilters`; keeps the page. */
|
|
557
|
+
forceSorters?: MaybeRefOrGetter<SortControl[] | undefined>;
|
|
504
558
|
/**
|
|
505
559
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
506
|
-
* meta), regardless of which columns are visible. Additive only.
|
|
560
|
+
* meta), regardless of which columns are visible. Additive only. Live, like
|
|
561
|
+
* `forceFilters`.
|
|
507
562
|
*/
|
|
508
|
-
alwaysSelected?: string[]
|
|
563
|
+
alwaysSelected?: MaybeRefOrGetter<string[] | undefined>;
|
|
564
|
+
/**
|
|
565
|
+
* IANA time zone the table reads dates in: where "today" starts, which
|
|
566
|
+
* instant a day filter means. Default: the cell locale's time zone
|
|
567
|
+
* (`provideCellLocale`), else the browser's. Pass a ref or getter to follow
|
|
568
|
+
* a preference. Since 0.1.148.
|
|
569
|
+
*/
|
|
570
|
+
timeZone?: MaybeRefOrGetter<string | undefined>;
|
|
571
|
+
/**
|
|
572
|
+
* First day of the week for `week` filters, `1` = Monday … `7` = Sunday.
|
|
573
|
+
* Default: from the cell locale's language, else Monday. Since 0.1.148.
|
|
574
|
+
*/
|
|
575
|
+
weekStart?: MaybeRefOrGetter<number | undefined>;
|
|
509
576
|
/** Override the default query function. */
|
|
510
577
|
queryFn?: QueryFn;
|
|
511
578
|
/** Auto-query when metadata loads (default: true). */
|
|
@@ -527,14 +594,14 @@ interface UseTableOptions {
|
|
|
527
594
|
/** Cell-type → component dispatch map. Use {@link createDefaultCellTypes} to seed defaults. */
|
|
528
595
|
types?: TAsCellTypeComponents;
|
|
529
596
|
/** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
530
|
-
components?: Record<string, Component
|
|
597
|
+
components?: Record<string, Component>;
|
|
531
598
|
/**
|
|
532
599
|
* Form-type → component dispatch map for the action-form dialog. Defaults to
|
|
533
600
|
* `createDefaultTypes()` from `@atscript/vue-form`.
|
|
534
601
|
*/
|
|
535
602
|
formTypes?: TAsTypeComponents;
|
|
536
603
|
/** Named form-component overrides for the action-form dialog. */
|
|
537
|
-
formComponents?: Record<string, Component
|
|
604
|
+
formComponents?: Record<string, Component>;
|
|
538
605
|
/** Whether to provide table context to the subtree (default: true). */
|
|
539
606
|
provideContext?: boolean;
|
|
540
607
|
/**
|
|
@@ -774,1564 +841,449 @@ declare function useTableSearch(): {
|
|
|
774
841
|
*/
|
|
775
842
|
declare function useTableActions(): TableActionsState;
|
|
776
843
|
//#endregion
|
|
777
|
-
//#region
|
|
778
|
-
//#region src/query.d.ts
|
|
844
|
+
//#region src/composables/use-table-url-query.d.ts
|
|
779
845
|
/**
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
* @example
|
|
784
|
-
* ```
|
|
785
|
-
* ?isNull&isEmpty=&other=other
|
|
786
|
-
* gives
|
|
787
|
-
* `{ isNull: null, isEmpty: '', other: 'other' }`.
|
|
788
|
-
* ```
|
|
789
|
-
*
|
|
790
|
-
* @internal
|
|
846
|
+
* The slice of a router's current route the bridge reads — vue-router's
|
|
847
|
+
* `useRoute()` fits (with or without typed routes).
|
|
848
|
+
* @since 0.1.148
|
|
791
849
|
*/
|
|
792
|
-
|
|
850
|
+
interface TableUrlQueryRoute {
|
|
851
|
+
readonly query: UrlQueryRecordInput;
|
|
852
|
+
}
|
|
793
853
|
/**
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
854
|
+
* The slice of a router the bridge writes through — vue-router's
|
|
855
|
+
* `useRouter()` fits. Structural on purpose: `@atscript/vue-table` has no
|
|
856
|
+
* `vue-router` dependency, and a router with typed-route augmentation is
|
|
857
|
+
* accepted as is.
|
|
858
|
+
* @since 0.1.148
|
|
797
859
|
*/
|
|
798
|
-
|
|
860
|
+
interface TableUrlQueryRouter {
|
|
861
|
+
replace(to: {
|
|
862
|
+
query: UrlQueryRecord;
|
|
863
|
+
}): unknown;
|
|
864
|
+
/** Required only for `mode: "push"` (checked at setup). */
|
|
865
|
+
push?(to: {
|
|
866
|
+
query: UrlQueryRecord;
|
|
867
|
+
}): unknown;
|
|
868
|
+
}
|
|
869
|
+
/** Options for {@link useTableUrlQuery}. */
|
|
870
|
+
interface UseTableUrlQueryOptions {
|
|
871
|
+
/**
|
|
872
|
+
* Navigation mode for outbound writes.
|
|
873
|
+
* - `"replace"` (default) — `router.replace`, no new history entry. Right
|
|
874
|
+
* for tables that emit on every keystroke (search box) so back-button
|
|
875
|
+
* doesn't step through 30 typing-induced URLs.
|
|
876
|
+
* - `"push"` — `router.push`, every state change becomes a discrete
|
|
877
|
+
* history entry. Choose when each filter/sort change should be
|
|
878
|
+
* navigation-recoverable.
|
|
879
|
+
*/
|
|
880
|
+
mode?: "replace" | "push";
|
|
881
|
+
/**
|
|
882
|
+
* Namespace for this table's query keys. With `prefix: "t1"` every key the
|
|
883
|
+
* bridge writes becomes `t1.<key>` (`t1.$skip`, `t1.status`, `t1.total>100`)
|
|
884
|
+
* and only keys under that prefix are read back or removed. Keys with no
|
|
885
|
+
* prefix — or another table's prefix — are foreign and preserved untouched,
|
|
886
|
+
* so two tables can share one route. Since 0.1.133.
|
|
887
|
+
*/
|
|
888
|
+
prefix?: string;
|
|
889
|
+
/**
|
|
890
|
+
* Host keys (wire form) the table never reads, writes or removes — even
|
|
891
|
+
* when a column has the same name. Without it, a host key that is also a
|
|
892
|
+
* column path (`?team=…` on a table with a `team` column) is read as a
|
|
893
|
+
* user filter. A filter the user sets on such a column stays private to the
|
|
894
|
+
* table: it is kept across navigation but never written to the URL, and
|
|
895
|
+
* the host's value is left alone. Pass a list of keys or a predicate. Only
|
|
896
|
+
* matters without a `prefix`. Since 0.1.148.
|
|
897
|
+
*/
|
|
898
|
+
preserveKeys?: UrlQueryRecordOptions["preserveKeys"];
|
|
899
|
+
}
|
|
799
900
|
/**
|
|
800
|
-
*
|
|
901
|
+
* Bridge `<AsTableRoot v-model:url-query>` to a router. Takes the structural
|
|
902
|
+
* {@link TableUrlQueryRoute} / {@link TableUrlQueryRouter} slices, so
|
|
903
|
+
* `@atscript/vue-table` imports nothing from `vue-router`: consumers pass
|
|
904
|
+
* their already-resolved `useRoute()` and `useRouter()` instances.
|
|
801
905
|
*
|
|
802
|
-
*
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
906
|
+
* Scope: the bridge owns **only what the table reads back** (since 0.1.133).
|
|
907
|
+
* A key is the table's iff `urlQueryStringToState` would consume it — see
|
|
908
|
+
* `urlQueryConsumesKey` — or the bridge has written it before. Read and
|
|
909
|
+
* write therefore agree in both directions: a key the parser ignores (a host
|
|
910
|
+
* flag, an unrecognised `$control`) is never removed, and a key the parser
|
|
911
|
+
* reads is the bridge's to remove. Every write merges into the current
|
|
912
|
+
* `route.query`: foreign keys stay where they are, the table's own keys are
|
|
913
|
+
* written as one block in the table's order.
|
|
809
914
|
*
|
|
810
|
-
*
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
|
|
817
|
-
* @internal
|
|
915
|
+
* Without a `prefix` the bridge cannot tell a plain `field=value` filter from
|
|
916
|
+
* a page-owned flag of the same shape: the table reads every unprefixed key,
|
|
917
|
+
* so a host key that is also a column path becomes a user filter. Pass
|
|
918
|
+
* `preserveKeys` to fence such host keys off (or `prefix` to namespace the
|
|
919
|
+
* table, which changes its URLs), and `prefix` when a route carries two
|
|
920
|
+
* tables.
|
|
818
921
|
*
|
|
819
|
-
* @
|
|
820
|
-
*
|
|
922
|
+
* @example
|
|
923
|
+
* ```vue
|
|
924
|
+
* <script setup>
|
|
925
|
+
* import { useRoute, useRouter } from 'vue-router';
|
|
926
|
+
* import { useTableUrlQuery } from '@atscript/vue-table';
|
|
927
|
+
* const urlQuery = useTableUrlQuery(useRoute(), useRouter());
|
|
928
|
+
* // Two tables on one route:
|
|
929
|
+
* // const left = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'a' });
|
|
930
|
+
* // const right = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'b' });
|
|
931
|
+
* </script>
|
|
932
|
+
* <template>
|
|
933
|
+
* <AsTableRoot v-model:url-query="urlQuery" url="/db/products" .../>
|
|
934
|
+
* </template>
|
|
935
|
+
* ```
|
|
821
936
|
*/
|
|
822
|
-
declare function
|
|
937
|
+
declare function useTableUrlQuery(route: TableUrlQueryRoute, router: TableUrlQueryRouter, opts?: UseTableUrlQueryOptions): WritableComputedRef<string>;
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region src/composables/as-presets-app.d.ts
|
|
823
940
|
/**
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
941
|
+
* App-wide injection key for the presets system. The host app calls
|
|
942
|
+
* `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot; every
|
|
943
|
+
* `<AsTableRoot>`, `usePresets`, and `useAppPrefs` call below it pulls the
|
|
944
|
+
* value via `inject(AS_PRESETS_APP)` unless an explicit `app` option
|
|
945
|
+
* overrides it.
|
|
828
946
|
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
947
|
+
* The string identifies the application namespace on the server side —
|
|
948
|
+
* one Moost backend can serve many apps; rows are scoped by `(app,
|
|
949
|
+
* tableKey)`.
|
|
831
950
|
*/
|
|
832
|
-
declare
|
|
833
|
-
//#region src/config.d.ts
|
|
951
|
+
declare const AS_PRESETS_APP: InjectionKey<string>;
|
|
834
952
|
/**
|
|
835
|
-
*
|
|
953
|
+
* Resolve the app name with these precedence rules:
|
|
836
954
|
*
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
*
|
|
840
|
-
* - `beforeRouteUpdate` - Page component option
|
|
841
|
-
* - `beforeRouteLeave` - Page component option
|
|
842
|
-
* - `RouterLink` - RouterLink Component
|
|
843
|
-
* - `RouterView` - RouterView Component
|
|
955
|
+
* 1. `explicit` argument (composable option) — wins.
|
|
956
|
+
* 2. `inject(AS_PRESETS_APP)` from the Vue tree.
|
|
957
|
+
* 3. Throws — composable can't run without an app namespace.
|
|
844
958
|
*
|
|
845
|
-
*
|
|
846
|
-
|
|
847
|
-
interface TypesConfig {} //#endregion
|
|
848
|
-
//#region src/typed-routes/route-map.d.ts
|
|
849
|
-
/**
|
|
850
|
-
* Helper type to define a Typed `RouteRecord`
|
|
851
|
-
* @see {@link RouteRecord}
|
|
959
|
+
* Throws a clear error when neither is available so misconfiguration
|
|
960
|
+
* surfaces at setup time, not when the first network round-trip fails.
|
|
852
961
|
*/
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
962
|
+
declare function injectPresetsApp(explicit?: string): string;
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/composables/use-app-prefs.d.ts
|
|
965
|
+
interface UseAppPrefsOptions {
|
|
966
|
+
/** App namespace; defaults to `inject(AS_PRESETS_APP)`. */
|
|
967
|
+
app?: string;
|
|
968
|
+
/** Presets controller URL, e.g. `"/db/_presets"`. */
|
|
969
|
+
url: string;
|
|
970
|
+
/** Custom client factory (auth-configured). Defaults to `getDefaultClientFactory()`. */
|
|
971
|
+
clientFactory?: ClientFactory;
|
|
972
|
+
/** Auto-load on setup. Default `true`. */
|
|
973
|
+
autoLoad?: boolean;
|
|
974
|
+
/**
|
|
975
|
+
* Cache the most recent prefs in `localStorage` keyed by app, so the
|
|
976
|
+
* next mount paints from cache (no flash of defaults while the network
|
|
977
|
+
* settles) and a failed/denied load still surfaces a usable theme.
|
|
978
|
+
* Server responses always overwrite the cache, so when a different
|
|
979
|
+
* user signs in, their state replaces the previous user's after one
|
|
980
|
+
* round-trip. Default `true` — pass `false` to opt out (e.g. tests,
|
|
981
|
+
* sensitive environments).
|
|
982
|
+
*/
|
|
983
|
+
cache?: boolean;
|
|
984
|
+
}
|
|
985
|
+
interface UseAppPrefsReturn {
|
|
986
|
+
/**
|
|
987
|
+
* Reactive prefs object. Always non-null — defaults to `{}` until the
|
|
988
|
+
* first load resolves. Read-only at the surface; mutate via `save()`.
|
|
989
|
+
*/
|
|
990
|
+
prefs: WritableComputedRef<AppConfData>;
|
|
991
|
+
loading: Ref<boolean>;
|
|
992
|
+
/** Last non-auth error, or `null`. Auth errors flip `available` instead. */
|
|
993
|
+
error: Ref<unknown>;
|
|
994
|
+
/** False on 401/403 from initial load; UI should hide pref-bound controls. */
|
|
995
|
+
available: ComputedRef<boolean>;
|
|
996
|
+
reload(): Promise<void>;
|
|
997
|
+
/**
|
|
998
|
+
* Optimistic shallow-merge save. The local `prefs` is updated immediately
|
|
999
|
+
* for snappy UI; on server error the optimistic write is rolled back and
|
|
1000
|
+
* the error is re-thrown for the caller to surface.
|
|
1001
|
+
*/
|
|
1002
|
+
save(patch: Partial<AppConfData>): Promise<void>;
|
|
1003
|
+
/** Drop in-memory state. Useful from sign-out flows. */
|
|
1004
|
+
reset(): void;
|
|
859
1005
|
}
|
|
860
|
-
type RouteRecordInfoGeneric = RouteRecordInfo<string | symbol, string, RouteParamsRawGeneric, RouteParamsGeneric, string | symbol>;
|
|
861
|
-
/**
|
|
862
|
-
* Convenience type to get the typed RouteMap or a generic one if not provided. It is extracted from the {@link TypesConfig} if it exists, it becomes {@link RouteMapGeneric} otherwise.
|
|
863
|
-
*/
|
|
864
|
-
type RouteMap = TypesConfig extends Record<'RouteNamedMap', infer RouteNamedMap> ? RouteNamedMap : RouteMapGeneric;
|
|
865
|
-
/**
|
|
866
|
-
* Generic version of the `RouteMap`.
|
|
867
|
-
*/
|
|
868
|
-
type RouteMapGeneric = Record<string | symbol, RouteRecordInfoGeneric>; //#endregion
|
|
869
|
-
//#region src/typed-routes/params.d.ts
|
|
870
1006
|
/**
|
|
871
|
-
*
|
|
1007
|
+
* Public dev-facing composable for app-wide user preferences. Independent
|
|
1008
|
+
* of presets / tables — devs can use it on any settings surface to read
|
|
1009
|
+
* and write `appearance`, `language`, `density`, `customJson` etc. for
|
|
1010
|
+
* `(currentUser, app)`.
|
|
1011
|
+
*
|
|
1012
|
+
* Multiple calls with the same `(app, url)` share one underlying instance,
|
|
1013
|
+
* so duplicate widgets (sidebar + page header + /preferences) make a single
|
|
1014
|
+
* `/query?type=appConf` request total.
|
|
872
1015
|
*
|
|
1016
|
+
* @example
|
|
1017
|
+
* ```ts
|
|
1018
|
+
* const { prefs, save } = useAppPrefs({ url: "/db/_presets" })
|
|
1019
|
+
* // prefs.value.appearance is reactive in templates
|
|
1020
|
+
* await save({ appearance: "dark" })
|
|
1021
|
+
* ```
|
|
873
1022
|
*/
|
|
1023
|
+
declare function useAppPrefs(opts: UseAppPrefsOptions): UseAppPrefsReturn;
|
|
874
1024
|
//#endregion
|
|
875
|
-
//#region src/
|
|
876
|
-
/**
|
|
877
|
-
* Creates a union type that still allows autocompletion for strings.
|
|
878
|
-
* @internal
|
|
879
|
-
*/
|
|
880
|
-
type _LiteralUnion<LiteralType, BaseType extends string = string> = LiteralType | (BaseType & Record<never, never>);
|
|
881
|
-
/**
|
|
882
|
-
* Maybe a promise maybe not
|
|
883
|
-
* @internal
|
|
884
|
-
*/
|
|
885
|
-
type _Awaitable<T> = T | PromiseLike<T>;
|
|
1025
|
+
//#region src/composables/use-table-component.d.ts
|
|
886
1026
|
/**
|
|
887
|
-
*
|
|
1027
|
+
* Resolve a single skin-slot component from the injected `controls` map,
|
|
1028
|
+
* falling back to the default. Safe to call outside a table context (e.g.
|
|
1029
|
+
* a default mounted standalone in tests) — the fallback is returned.
|
|
888
1030
|
*/
|
|
1031
|
+
declare function useTableComponent<K extends keyof TAsTableControls>(key: K, fallback: Component): Component;
|
|
889
1032
|
//#endregion
|
|
890
|
-
//#region src/
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
*/
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1033
|
+
//#region src/components/as-table.vue.d.ts
|
|
1034
|
+
type __VLS_Props$2 = {
|
|
1035
|
+
rows?: Record<string, unknown>[];
|
|
1036
|
+
columns?: ColumnDef[];
|
|
1037
|
+
stickyHeader?: boolean;
|
|
1038
|
+
virtualRowHeight?: number;
|
|
1039
|
+
virtualOverscan?: number;
|
|
1040
|
+
columnMenu?: ColumnMenuConfig; /** Allow header drag-and-drop column reorder. Default true. */
|
|
1041
|
+
reorderable?: boolean; /** Allow header drag-resize. Default true. */
|
|
1042
|
+
resizable?: boolean; /** Pixel floor for the resize clamp. Default 48. */
|
|
1043
|
+
columnMinWidth?: number;
|
|
1044
|
+
/**
|
|
1045
|
+
* Selection mode — rendering concern owned by the renderer. `"multi"`
|
|
1046
|
+
* shows a leading checkbox column and turns row clicks into selection
|
|
1047
|
+
* toggles; `"none"` (default) hides the column and routes clicks
|
|
1048
|
+
* through the main-action path. Independent of `state.selectedRows` —
|
|
1049
|
+
* flipping `select` to `"none"` hides the checkbox UI but leaves the
|
|
1050
|
+
* user's selected pks in place, surviving a future re-enable.
|
|
1051
|
+
*/
|
|
1052
|
+
select?: SelectionMode; /** See {@link SelectOn}. Since 0.1.142. */
|
|
1053
|
+
selectOn?: SelectOn;
|
|
1054
|
+
/**
|
|
1055
|
+
* Built-in row-delete: `false` (off, default), `true` (on with defaults),
|
|
1056
|
+
* or a `RowDeleteOpt` overriding label/icon/intent/promptText. The
|
|
1057
|
+
* synthesised `__remove` action only appears when the consumer opts in
|
|
1058
|
+
* AND `tableDef.canRemove === true`. Pushed into `state.rowDelete` via
|
|
1059
|
+
* a watcher — the action set live-updates as the prop flips.
|
|
1060
|
+
*/
|
|
1061
|
+
rowDelete?: boolean | RowDeleteOpt;
|
|
1062
|
+
/**
|
|
1063
|
+
* Synthesised row-actions pseudo-column. `'first'` / `'last'` prepend or
|
|
1064
|
+
* append a fixed `__actions` column rendering `controls.rowActions`.
|
|
1065
|
+
* `'merge-select'` only renders the column when `select === "none"` —
|
|
1066
|
+
* sharing the leading gutter with the multi-select checkbox column so the
|
|
1067
|
+
* row gutter shows a checkbox in `select="multi"` mode and an action
|
|
1068
|
+
* trigger in `select="none"` mode (toggled at the consumer level).
|
|
1069
|
+
*
|
|
1070
|
+
* The column is locked: no header dropdown, no resize, no drag-reorder,
|
|
1071
|
+
* NOT in the `columnNames` v-model. Hidden entirely when
|
|
1072
|
+
* the cell has no action to show (no row / rows-level action, no
|
|
1073
|
+
* `:row-actions` `extra` one — since 0.1.147 rows-level ones count).
|
|
1074
|
+
*
|
|
1075
|
+
* Wrapper-only prop — not forwarded by `<AsTableRoot>`. Raw consumers
|
|
1076
|
+
* compose their own column layout.
|
|
1077
|
+
*/
|
|
1078
|
+
rowActionsColumn?: RowActionsColumnPlacement | false;
|
|
913
1079
|
/**
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
1080
|
+
* Render without a header row. Omits `<thead>` entirely (not
|
|
1081
|
+
* `display:none`); column widths are carried by the `<colgroup>`, so data
|
|
1082
|
+
* columns keep their annotated/seeded widths. Header-driven interactions
|
|
1083
|
+
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
917
1084
|
*/
|
|
918
|
-
|
|
919
|
-
}
|
|
920
|
-
/**
|
|
921
|
-
* Helper to generate a type safe version of the {@link RouteLocation} type.
|
|
922
|
-
*/
|
|
923
|
-
interface RouteLocationTyped<RouteMap$1 extends RouteMapGeneric, Name extends keyof RouteMap$1> extends RouteLocationGeneric {
|
|
924
|
-
name: Extract<Name, string | symbol>;
|
|
925
|
-
params: RouteMap$1[Name]['params'];
|
|
926
|
-
}
|
|
927
|
-
/**
|
|
928
|
-
* List of all possible {@link RouteLocation} indexed by the route name.
|
|
929
|
-
* @internal
|
|
930
|
-
*/
|
|
931
|
-
type RouteLocationTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationTyped<RouteMap$1, N> };
|
|
932
|
-
/**
|
|
933
|
-
* Generic version of {@link RouteLocationNormalized} that is used when no {@link RouteMap} is provided.
|
|
934
|
-
*/
|
|
935
|
-
interface RouteLocationNormalizedGeneric extends _RouteLocationBase {
|
|
936
|
-
name: RouteRecordNameGeneric;
|
|
1085
|
+
headless?: boolean;
|
|
937
1086
|
/**
|
|
938
|
-
*
|
|
1087
|
+
* Per-row selectability. Return `false` — or a string, surfaced as the
|
|
1088
|
+
* disabled reason on the row's selection control — to make a row not
|
|
1089
|
+
* selectable. Enforced on every path: row click, Space/Enter toggle, and
|
|
1090
|
+
* the header select-all (which also stops counting ineligible rows).
|
|
1091
|
+
* Since 0.1.133.
|
|
1092
|
+
*
|
|
1093
|
+
* @example
|
|
1094
|
+
* `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
|
|
939
1095
|
*/
|
|
940
|
-
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* Helper to generate a type safe version of the {@link RouteLocationNormalized} type.
|
|
944
|
-
*/
|
|
945
|
-
interface RouteLocationNormalizedTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationNormalizedGeneric {
|
|
946
|
-
name: Extract<Name, string | symbol>;
|
|
947
|
-
params: RouteMap$1[Name]['params'];
|
|
1096
|
+
rowSelectable?: RowSelectableHook;
|
|
948
1097
|
/**
|
|
949
|
-
*
|
|
1098
|
+
* Extra classes for the row element — string, array, or
|
|
1099
|
+
* `{ class: boolean }` map, merged with the framework's own row classes.
|
|
1100
|
+
* Since 0.1.133.
|
|
950
1101
|
*/
|
|
951
|
-
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
* List of all possible {@link RouteLocationNormalized} indexed by the route name.
|
|
955
|
-
* @internal
|
|
956
|
-
*/
|
|
957
|
-
type RouteLocationNormalizedTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationNormalizedTyped<RouteMap$1, N> };
|
|
958
|
-
/**
|
|
959
|
-
* Generic version of {@link RouteLocationNormalizedLoaded} that is used when no {@link RouteMap} is provided.
|
|
960
|
-
*/
|
|
961
|
-
interface RouteLocationNormalizedLoadedGeneric extends RouteLocationNormalizedGeneric {
|
|
1102
|
+
rowClass?: RowClassHook;
|
|
962
1103
|
/**
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
1104
|
+
* Extra attributes for the row element. The framework's own `id`, `role`,
|
|
1105
|
+
* `aria-*`, `data-*`, `class` and `style` always win, so a hook can
|
|
1106
|
+
* decorate a row but never rewrite its accessibility contract.
|
|
1107
|
+
* Since 0.1.133.
|
|
967
1108
|
*/
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1109
|
+
rowAttrs?: RowAttrsHook;
|
|
1110
|
+
};
|
|
1111
|
+
declare var __VLS_8: {
|
|
1112
|
+
selection: TableSelection;
|
|
1113
|
+
canSelectAllMatching: boolean;
|
|
1114
|
+
selectAllMatching: () => void;
|
|
1115
|
+
clearSelection: () => void;
|
|
1116
|
+
loadedCount: number;
|
|
1117
|
+
}, __VLS_28: string, __VLS_29: any, __VLS_31: {};
|
|
1118
|
+
type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_28>]?: (props: typeof __VLS_29) => any } & {
|
|
1119
|
+
'selection-banner'?: (props: typeof __VLS_8) => any;
|
|
1120
|
+
} & {
|
|
1121
|
+
'query-loading'?: (props: typeof __VLS_31) => any;
|
|
1122
|
+
};
|
|
1123
|
+
declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1124
|
+
"row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
1125
|
+
"row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
1126
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
1127
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
|
|
1128
|
+
"onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
1129
|
+
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
1130
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
1131
|
+
}>, {
|
|
1132
|
+
stickyHeader: boolean;
|
|
1133
|
+
virtualOverscan: number;
|
|
1134
|
+
reorderable: boolean;
|
|
1135
|
+
resizable: boolean;
|
|
1136
|
+
columnMinWidth: number;
|
|
1137
|
+
select: SelectionMode;
|
|
1138
|
+
selectOn: SelectOn;
|
|
1139
|
+
rowDelete: boolean | RowDeleteOpt;
|
|
1140
|
+
rowActionsColumn: RowActionsColumnPlacement | false;
|
|
1141
|
+
headless: boolean;
|
|
1142
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1143
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
1144
|
+
declare const _default$2: typeof __VLS_export$2;
|
|
1145
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
1146
|
+
new (): {
|
|
1147
|
+
$slots: S;
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region src/components/as-window-table.vue.d.ts
|
|
1152
|
+
type Row = Record<string, unknown>;
|
|
1153
|
+
type __VLS_Props$1 = {
|
|
1154
|
+
/** Pixel height of one row. Defaults to `DEFAULT_ROW_HEIGHT_PX`. */rowHeight?: number; /** Number of rows the viewport advances per wheel-tick. */
|
|
1155
|
+
wheelRowsPerTick?: number;
|
|
988
1156
|
/**
|
|
989
|
-
*
|
|
1157
|
+
* Selection mode — rendering concern owned by the renderer. `"multi"`
|
|
1158
|
+
* shows a leading checkbox column and turns row clicks into selection
|
|
1159
|
+
* toggles; `"none"` (default) hides the column and routes clicks
|
|
1160
|
+
* through the main-action path. Independent of `state.selectedRows` —
|
|
1161
|
+
* flipping `select` to `"none"` hides the checkbox UI but leaves the
|
|
1162
|
+
* user's selected pks in place, surviving a future re-enable.
|
|
990
1163
|
*/
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsRelative} type.
|
|
995
|
-
*/
|
|
996
|
-
interface RouteLocationAsRelativeTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationAsRelativeGeneric {
|
|
997
|
-
name?: Extract<Name, string | symbol>;
|
|
998
|
-
params?: RouteMap$1[Name]['paramsRaw'];
|
|
999
|
-
}
|
|
1000
|
-
/**
|
|
1001
|
-
* List of all possible {@link RouteLocationAsRelative} indexed by the route name.
|
|
1002
|
-
* @internal
|
|
1003
|
-
*/
|
|
1004
|
-
type RouteLocationAsRelativeTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsRelativeTyped<RouteMap$1, N> };
|
|
1005
|
-
/**
|
|
1006
|
-
* Generic version of {@link RouteLocationAsPath}. It is used when no {@link RouteMap} is provided.
|
|
1007
|
-
*/
|
|
1008
|
-
interface RouteLocationAsPathGeneric extends RouteQueryAndHash, RouteLocationOptions {
|
|
1164
|
+
select?: SelectionMode; /** See {@link SelectOn}. Since 0.1.142. */
|
|
1165
|
+
selectOn?: SelectOn;
|
|
1009
1166
|
/**
|
|
1010
|
-
*
|
|
1167
|
+
* Force exactly N rows tall. Equivalent to setting both `min-rows` and
|
|
1168
|
+
* `max-rows` to N — overrides both when set. The table reserves N rows
|
|
1169
|
+
* worth of height even when empty.
|
|
1011
1170
|
*/
|
|
1012
|
-
|
|
1013
|
-
}
|
|
1014
|
-
/**
|
|
1015
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsPath} type.
|
|
1016
|
-
*/
|
|
1017
|
-
interface RouteLocationAsPathTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationAsPathGeneric {
|
|
1018
|
-
path: _LiteralUnion<RouteMap$1[Name]['path']>;
|
|
1019
|
-
}
|
|
1020
|
-
/**
|
|
1021
|
-
* List of all possible {@link RouteLocationAsPath} indexed by the route name.
|
|
1022
|
-
* @internal
|
|
1023
|
-
*/
|
|
1024
|
-
type RouteLocationAsPathTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsPathTyped<RouteMap$1, N> };
|
|
1025
|
-
/**
|
|
1026
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsString} type.
|
|
1027
|
-
*/
|
|
1028
|
-
type RouteLocationAsStringTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> = RouteMap$1[Name]['path'];
|
|
1029
|
-
/**
|
|
1030
|
-
* List of all possible {@link RouteLocationAsString} indexed by the route name.
|
|
1031
|
-
* @internal
|
|
1032
|
-
*/
|
|
1033
|
-
type RouteLocationAsStringTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsStringTyped<RouteMap$1, N> };
|
|
1034
|
-
/**
|
|
1035
|
-
* Generic version of {@link RouteLocationResolved}. It is used when no {@link RouteMap} is provided.
|
|
1036
|
-
*/
|
|
1037
|
-
interface RouteLocationResolvedGeneric extends RouteLocationGeneric {
|
|
1171
|
+
rows?: number;
|
|
1038
1172
|
/**
|
|
1039
|
-
*
|
|
1173
|
+
* Minimum row count. The table is at least this tall even when empty
|
|
1174
|
+
* or when fewer rows would fit the available area.
|
|
1040
1175
|
*/
|
|
1041
|
-
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* Helper to generate a type safe version of the {@link RouteLocationResolved} type.
|
|
1045
|
-
*/
|
|
1046
|
-
interface RouteLocationResolvedTyped<RouteMap$1 extends RouteMapGeneric, Name extends keyof RouteMap$1> extends RouteLocationTyped<RouteMap$1, Name> {
|
|
1176
|
+
minRows?: number;
|
|
1047
1177
|
/**
|
|
1048
|
-
*
|
|
1178
|
+
* Maximum row count. The table caps at this many rows tall even if the
|
|
1179
|
+
* available area would fit more. Useful for value-help dialogs.
|
|
1049
1180
|
*/
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
/**
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
* `hash` to conveniently change them.
|
|
1077
|
-
*/
|
|
1078
|
-
type RouteLocationAsRelative<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsRelativeGeneric : RouteLocationAsRelativeTypedList<RouteMap>[Name];
|
|
1079
|
-
/**
|
|
1080
|
-
* Route location resolved with {@link Router | `router.resolve()`}.
|
|
1081
|
-
*/
|
|
1082
|
-
type RouteLocationResolved<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationResolvedGeneric : RouteLocationResolvedTypedList<RouteMap>[Name];
|
|
1083
|
-
/**
|
|
1084
|
-
* Same as {@link RouteLocationAsPath} but as a string literal.
|
|
1085
|
-
*/
|
|
1086
|
-
type RouteLocationAsString<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? string : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string>;
|
|
1087
|
-
/**
|
|
1088
|
-
* Route location as an object with a `path` property.
|
|
1089
|
-
*/
|
|
1090
|
-
type RouteLocationAsPath<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsPathGeneric : RouteLocationAsPathTypedList<RouteMap>[Name];
|
|
1091
|
-
/**
|
|
1092
|
-
* Route location that can be passed to `router.push()` and other user-facing APIs.
|
|
1093
|
-
*/
|
|
1094
|
-
type RouteLocationRaw<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsString | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string> | RouteLocationAsRelativeTypedList<RouteMap>[Name] | RouteLocationAsPathTypedList<RouteMap>[Name]; //#endregion
|
|
1095
|
-
//#region src/typed-routes/navigation-guards.d.ts
|
|
1096
|
-
/**
|
|
1097
|
-
* Return types for a Navigation Guard. Based on `TypesConfig`
|
|
1098
|
-
*
|
|
1099
|
-
* @see {@link TypesConfig}
|
|
1100
|
-
*/
|
|
1101
|
-
type NavigationGuardReturn = void | Error | boolean | RouteLocationRaw;
|
|
1102
|
-
/**
|
|
1103
|
-
* Navigation Guard with a type parameter for `this`.
|
|
1104
|
-
* @see {@link TypesConfig}
|
|
1105
|
-
*/
|
|
1106
|
-
interface NavigationGuardWithThis<T> {
|
|
1107
|
-
(this: T, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Navigation Guard.
|
|
1111
|
-
*/
|
|
1112
|
-
interface NavigationGuard {
|
|
1113
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* Navigation hook triggered after a navigation is settled.
|
|
1117
|
-
*/
|
|
1118
|
-
interface NavigationHookAfter {
|
|
1119
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, failure?: NavigationFailure | void): unknown;
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* `next()` callback passed to navigation guards.
|
|
1123
|
-
*/
|
|
1124
|
-
interface NavigationGuardNext {
|
|
1125
|
-
(): void;
|
|
1126
|
-
(error: Error): void;
|
|
1127
|
-
(location: RouteLocationRaw): void;
|
|
1128
|
-
(valid: boolean | undefined): void;
|
|
1129
|
-
(cb: NavigationGuardNextCallback): void;
|
|
1130
|
-
}
|
|
1131
|
-
/**
|
|
1132
|
-
* Callback that can be passed to `next()` in `beforeRouteEnter()` guards.
|
|
1133
|
-
*/
|
|
1134
|
-
type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => unknown; //#endregion
|
|
1135
|
-
//#region src/matcher/types.d.ts
|
|
1136
|
-
/**
|
|
1137
|
-
* Normalized version of a {@link RouteRecord | route record}.
|
|
1138
|
-
*/
|
|
1139
|
-
interface RouteRecordNormalized {
|
|
1140
|
-
/**
|
|
1141
|
-
* {@inheritDoc _RouteRecordBase.path}
|
|
1142
|
-
*/
|
|
1143
|
-
path: _RouteRecordBase['path'];
|
|
1144
|
-
/**
|
|
1145
|
-
* {@inheritDoc _RouteRecordBase.redirect}
|
|
1146
|
-
*/
|
|
1147
|
-
redirect: _RouteRecordBase['redirect'] | undefined;
|
|
1148
|
-
/**
|
|
1149
|
-
* {@inheritDoc _RouteRecordBase.name}
|
|
1150
|
-
*/
|
|
1151
|
-
name: _RouteRecordBase['name'];
|
|
1152
|
-
/**
|
|
1153
|
-
* {@inheritDoc RouteRecordMultipleViews.components}
|
|
1154
|
-
*/
|
|
1155
|
-
components: RouteRecordMultipleViews['components'] | null | undefined;
|
|
1156
|
-
/**
|
|
1157
|
-
* Contains the original modules for lazy loaded components.
|
|
1158
|
-
* @internal
|
|
1159
|
-
*/
|
|
1160
|
-
mods: Record<string, unknown>;
|
|
1161
|
-
/**
|
|
1162
|
-
* Nested route records.
|
|
1163
|
-
*/
|
|
1164
|
-
children: RouteRecordRaw[];
|
|
1165
|
-
/**
|
|
1166
|
-
* {@inheritDoc _RouteRecordBase.meta}
|
|
1167
|
-
*/
|
|
1168
|
-
meta: Exclude<_RouteRecordBase['meta'], void>;
|
|
1169
|
-
/**
|
|
1170
|
-
* {@inheritDoc RouteRecordMultipleViews.props}
|
|
1171
|
-
*/
|
|
1172
|
-
props: Record<string, _RouteRecordProps>;
|
|
1173
|
-
/**
|
|
1174
|
-
* Registered beforeEnter guards
|
|
1175
|
-
*/
|
|
1176
|
-
beforeEnter: _RouteRecordBase['beforeEnter'];
|
|
1177
|
-
/**
|
|
1178
|
-
* Registered leave guards
|
|
1179
|
-
*
|
|
1180
|
-
* @internal
|
|
1181
|
-
*/
|
|
1182
|
-
leaveGuards: Set<NavigationGuard>;
|
|
1183
|
-
/**
|
|
1184
|
-
* Registered update guards
|
|
1185
|
-
*
|
|
1186
|
-
* @internal
|
|
1187
|
-
*/
|
|
1188
|
-
updateGuards: Set<NavigationGuard>;
|
|
1189
|
-
/**
|
|
1190
|
-
* Registered beforeRouteEnter callbacks passed to `next` or returned in guards
|
|
1191
|
-
*
|
|
1192
|
-
* @internal
|
|
1193
|
-
*/
|
|
1194
|
-
enterCallbacks: Record<string, NavigationGuardNextCallback[]>;
|
|
1195
|
-
/**
|
|
1196
|
-
* Mounted route component instances
|
|
1197
|
-
* Having the instances on the record mean beforeRouteUpdate and
|
|
1198
|
-
* beforeRouteLeave guards can only be invoked with the latest mounted app
|
|
1199
|
-
* instance if there are multiple application instances rendering the same
|
|
1200
|
-
* view, basically duplicating the content on the page, which shouldn't happen
|
|
1201
|
-
* in practice. It will work if multiple apps are rendering different named
|
|
1202
|
-
* views.
|
|
1203
|
-
*/
|
|
1204
|
-
instances: Record<string, ComponentPublicInstance | undefined | null>;
|
|
1205
|
-
/**
|
|
1206
|
-
* Defines if this record is the alias of another one. This property is
|
|
1207
|
-
* `undefined` if the record is the original one.
|
|
1208
|
-
*/
|
|
1209
|
-
aliasOf: RouteRecordNormalized | undefined;
|
|
1210
|
-
}
|
|
1211
|
-
/**
|
|
1212
|
-
* {@inheritDoc RouteRecordNormalized}
|
|
1213
|
-
*/
|
|
1214
|
-
type RouteRecord = RouteRecordNormalized; //#endregion
|
|
1215
|
-
//#region src/matcher/pathParserRanker.d.ts
|
|
1216
|
-
/**
|
|
1217
|
-
* @internal
|
|
1218
|
-
*/
|
|
1219
|
-
interface _PathParserOptions {
|
|
1220
|
-
/**
|
|
1221
|
-
* Makes the RegExp case-sensitive.
|
|
1222
|
-
*
|
|
1223
|
-
* @defaultValue `false`
|
|
1224
|
-
*/
|
|
1225
|
-
sensitive?: boolean;
|
|
1226
|
-
/**
|
|
1227
|
-
* Whether to disallow a trailing slash or not.
|
|
1228
|
-
*
|
|
1229
|
-
* @defaultValue `false`
|
|
1230
|
-
*/
|
|
1231
|
-
strict?: boolean;
|
|
1232
|
-
/**
|
|
1233
|
-
* Should the RegExp match from the beginning by prepending a `^` to it.
|
|
1234
|
-
* @internal
|
|
1235
|
-
*
|
|
1236
|
-
* @defaultValue `true`
|
|
1237
|
-
*/
|
|
1238
|
-
start?: boolean;
|
|
1239
|
-
/**
|
|
1240
|
-
* Should the RegExp match until the end by appending a `$` to it.
|
|
1241
|
-
*
|
|
1242
|
-
* @deprecated this option will alsways be `true` in the future. Open a discussion in vuejs/router if you need this to be `false`
|
|
1243
|
-
*
|
|
1244
|
-
* @defaultValue `true`
|
|
1245
|
-
*/
|
|
1246
|
-
end?: boolean;
|
|
1247
|
-
}
|
|
1248
|
-
type PathParserOptions = Pick<_PathParserOptions, 'end' | 'sensitive' | 'strict'>; //#endregion
|
|
1249
|
-
//#region src/matcher/pathMatcher.d.ts
|
|
1250
|
-
//#endregion
|
|
1251
|
-
//#region src/history/common.d.ts
|
|
1252
|
-
type HistoryLocation = string;
|
|
1253
|
-
/**
|
|
1254
|
-
* Allowed variables in HTML5 history state. Note that pushState clones the state
|
|
1255
|
-
* passed and does not accept everything: e.g.: it doesn't accept symbols, nor
|
|
1256
|
-
* functions as values. It also ignores Symbols as keys.
|
|
1257
|
-
*
|
|
1258
|
-
* @internal
|
|
1259
|
-
*/
|
|
1260
|
-
type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
|
|
1261
|
-
/**
|
|
1262
|
-
* Allowed HTML history.state
|
|
1263
|
-
*/
|
|
1264
|
-
interface HistoryState {
|
|
1265
|
-
[x: number]: HistoryStateValue;
|
|
1266
|
-
[x: string]: HistoryStateValue;
|
|
1267
|
-
}
|
|
1268
|
-
/**
|
|
1269
|
-
* Allowed arrays for history.state.
|
|
1270
|
-
*
|
|
1271
|
-
* @internal
|
|
1272
|
-
*/
|
|
1273
|
-
interface HistoryStateArray extends Array<HistoryStateValue> {}
|
|
1274
|
-
declare enum NavigationType {
|
|
1275
|
-
pop = "pop",
|
|
1276
|
-
push = "push"
|
|
1277
|
-
}
|
|
1278
|
-
declare enum NavigationDirection {
|
|
1279
|
-
back = "back",
|
|
1280
|
-
forward = "forward",
|
|
1281
|
-
unknown = ""
|
|
1282
|
-
}
|
|
1283
|
-
interface NavigationInformation {
|
|
1284
|
-
type: NavigationType;
|
|
1285
|
-
direction: NavigationDirection;
|
|
1286
|
-
delta: number;
|
|
1287
|
-
}
|
|
1288
|
-
interface NavigationCallback {
|
|
1289
|
-
(to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Interface implemented by History implementations that can be passed to the
|
|
1293
|
-
* router as {@link Router.history}
|
|
1294
|
-
*
|
|
1295
|
-
* @alpha
|
|
1296
|
-
*/
|
|
1297
|
-
interface RouterHistory {
|
|
1298
|
-
/**
|
|
1299
|
-
* Base path that is prepended to every url. This allows hosting an SPA at a
|
|
1300
|
-
* sub-folder of a domain like `example.com/sub-folder` by having a `base` of
|
|
1301
|
-
* `/sub-folder`
|
|
1302
|
-
*/
|
|
1303
|
-
readonly base: string;
|
|
1304
|
-
/**
|
|
1305
|
-
* Current History location
|
|
1306
|
-
*/
|
|
1307
|
-
readonly location: HistoryLocation;
|
|
1308
|
-
/**
|
|
1309
|
-
* Current History state
|
|
1310
|
-
*/
|
|
1311
|
-
readonly state: HistoryState;
|
|
1312
|
-
/**
|
|
1313
|
-
* Navigates to a location. In the case of an HTML5 History implementation,
|
|
1314
|
-
* this will call `history.pushState` to effectively change the URL.
|
|
1315
|
-
*
|
|
1316
|
-
* @param to - location to push
|
|
1317
|
-
* @param data - optional {@link HistoryState} to be associated with the
|
|
1318
|
-
* navigation entry
|
|
1319
|
-
*/
|
|
1320
|
-
push(to: HistoryLocation, data?: HistoryState): void;
|
|
1321
|
-
/**
|
|
1322
|
-
* Same as {@link RouterHistory.push} but performs a `history.replaceState`
|
|
1323
|
-
* instead of `history.pushState`
|
|
1324
|
-
*
|
|
1325
|
-
* @param to - location to set
|
|
1326
|
-
* @param data - optional {@link HistoryState} to be associated with the
|
|
1327
|
-
* navigation entry
|
|
1328
|
-
*/
|
|
1329
|
-
replace(to: HistoryLocation, data?: HistoryState): void;
|
|
1330
|
-
/**
|
|
1331
|
-
* Traverses history in a given direction.
|
|
1332
|
-
*
|
|
1333
|
-
* @example
|
|
1334
|
-
* ```js
|
|
1335
|
-
* myHistory.go(-1) // equivalent to window.history.back()
|
|
1336
|
-
* myHistory.go(1) // equivalent to window.history.forward()
|
|
1337
|
-
* ```
|
|
1338
|
-
*
|
|
1339
|
-
* @param delta - distance to travel. If delta is \< 0, it will go back,
|
|
1340
|
-
* if it's \> 0, it will go forward by that amount of entries.
|
|
1341
|
-
* @param triggerListeners - whether this should trigger listeners attached to
|
|
1342
|
-
* the history
|
|
1343
|
-
*/
|
|
1344
|
-
go(delta: number, triggerListeners?: boolean): void;
|
|
1345
|
-
/**
|
|
1346
|
-
* Attach a listener to the History implementation that is triggered when the
|
|
1347
|
-
* navigation is triggered from outside (like the Browser back and forward
|
|
1348
|
-
* buttons) or when passing `true` to {@link RouterHistory.back} and
|
|
1349
|
-
* {@link RouterHistory.forward}
|
|
1350
|
-
*
|
|
1351
|
-
* @param callback - listener to attach
|
|
1352
|
-
* @returns a callback to remove the listener
|
|
1353
|
-
*/
|
|
1354
|
-
listen(callback: NavigationCallback): () => void;
|
|
1355
|
-
/**
|
|
1356
|
-
* Generates the corresponding href to be used in an anchor tag.
|
|
1357
|
-
*
|
|
1358
|
-
* @param location - history location that should create an href
|
|
1359
|
-
*/
|
|
1360
|
-
createHref(location: HistoryLocation): string;
|
|
1361
|
-
/**
|
|
1362
|
-
* Clears any event listener attached by the history implementation.
|
|
1363
|
-
*/
|
|
1364
|
-
destroy(): void;
|
|
1365
|
-
} //#endregion
|
|
1366
|
-
//#region src/types/index.d.ts
|
|
1367
|
-
type Lazy<T> = () => Promise<T>;
|
|
1368
|
-
/**
|
|
1369
|
-
* @internal
|
|
1370
|
-
*/
|
|
1371
|
-
type RouteParamValue = string;
|
|
1372
|
-
/**
|
|
1373
|
-
* @internal
|
|
1374
|
-
*/
|
|
1375
|
-
type RouteParamValueRaw = RouteParamValue | number | null | undefined;
|
|
1376
|
-
type RouteParamsGeneric = Record<string, RouteParamValue | RouteParamValue[]>;
|
|
1377
|
-
type RouteParamsRawGeneric = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
|
|
1378
|
-
/**
|
|
1379
|
-
* @internal
|
|
1380
|
-
*/
|
|
1381
|
-
interface RouteQueryAndHash {
|
|
1382
|
-
query?: LocationQueryRaw;
|
|
1383
|
-
hash?: string;
|
|
1384
|
-
}
|
|
1385
|
-
/**
|
|
1386
|
-
* @internal
|
|
1387
|
-
*/
|
|
1388
|
-
/**
|
|
1389
|
-
* Common options for all navigation methods.
|
|
1390
|
-
*/
|
|
1391
|
-
interface RouteLocationOptions {
|
|
1392
|
-
/**
|
|
1393
|
-
* Replace the entry in the history instead of pushing a new entry
|
|
1394
|
-
*/
|
|
1395
|
-
replace?: boolean;
|
|
1396
|
-
/**
|
|
1397
|
-
* Triggers the navigation even if the location is the same as the current one.
|
|
1398
|
-
* Note this will also add a new entry to the history unless `replace: true`
|
|
1399
|
-
* is passed.
|
|
1400
|
-
*/
|
|
1401
|
-
force?: boolean;
|
|
1402
|
-
/**
|
|
1403
|
-
* State to save using the History API. This cannot contain any reactive
|
|
1404
|
-
* values and some primitives like Symbols are forbidden. More info at
|
|
1405
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/History/state
|
|
1406
|
-
*/
|
|
1407
|
-
state?: HistoryState;
|
|
1408
|
-
}
|
|
1409
|
-
/**
|
|
1410
|
-
* Route Location that can infer the necessary params based on the name.
|
|
1411
|
-
*
|
|
1412
|
-
* @internal
|
|
1413
|
-
*/
|
|
1414
|
-
interface RouteLocationMatched extends RouteRecordNormalized {
|
|
1415
|
-
components: Record<string, RouteComponent> | null | undefined;
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Base properties for a normalized route location.
|
|
1419
|
-
*
|
|
1420
|
-
* @internal
|
|
1421
|
-
*/
|
|
1422
|
-
interface _RouteLocationBase extends Pick<MatcherLocation, 'name' | 'path' | 'params' | 'meta'> {
|
|
1423
|
-
/**
|
|
1424
|
-
* The whole location including the `search` and `hash`. This string is
|
|
1425
|
-
* percentage encoded.
|
|
1426
|
-
*/
|
|
1427
|
-
fullPath: string;
|
|
1428
|
-
/**
|
|
1429
|
-
* Object representation of the `search` property of the current location.
|
|
1430
|
-
*/
|
|
1431
|
-
query: LocationQuery;
|
|
1432
|
-
/**
|
|
1433
|
-
* Hash of the current location. If present, starts with a `#`.
|
|
1434
|
-
*/
|
|
1435
|
-
hash: string;
|
|
1436
|
-
/**
|
|
1437
|
-
* Contains the location we were initially trying to access before ending up
|
|
1438
|
-
* on the current location.
|
|
1439
|
-
*/
|
|
1440
|
-
redirectedFrom: RouteLocation | undefined;
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Allowed Component in {@link RouteLocationMatched}
|
|
1444
|
-
*/
|
|
1445
|
-
type RouteComponent = Component$1 | DefineComponent;
|
|
1446
|
-
/**
|
|
1447
|
-
* Allowed Component definitions in route records provided by the user
|
|
1448
|
-
*/
|
|
1449
|
-
type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
|
|
1450
|
-
/**
|
|
1451
|
-
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
|
|
1452
|
-
*/
|
|
1453
|
-
interface _RouteRecordBase extends PathParserOptions {
|
|
1454
|
-
/**
|
|
1455
|
-
* Path of the record. Should start with `/` unless the record is the child of
|
|
1456
|
-
* another record.
|
|
1457
|
-
*
|
|
1458
|
-
* @example `/users/:id` matches `/users/1` as well as `/users/posva`.
|
|
1459
|
-
*/
|
|
1460
|
-
path: string;
|
|
1461
|
-
/**
|
|
1462
|
-
* Where to redirect if the route is directly matched. The redirection happens
|
|
1463
|
-
* before any navigation guard and triggers a new navigation with the new
|
|
1464
|
-
* target location.
|
|
1465
|
-
*/
|
|
1466
|
-
redirect?: RouteRecordRedirectOption;
|
|
1467
|
-
/**
|
|
1468
|
-
* Aliases for the record. Allows defining extra paths that will behave like a
|
|
1469
|
-
* copy of the record. Allows having paths shorthands like `/users/:id` and
|
|
1470
|
-
* `/u/:id`. All `alias` and `path` values must share the same params.
|
|
1471
|
-
*/
|
|
1472
|
-
alias?: string | string[];
|
|
1473
|
-
/**
|
|
1474
|
-
* Name for the route record. Must be unique.
|
|
1475
|
-
*/
|
|
1476
|
-
name?: RouteRecordNameGeneric;
|
|
1477
|
-
/**
|
|
1478
|
-
* Before Enter guard specific to this record. Note `beforeEnter` has no
|
|
1479
|
-
* effect if the record has a `redirect` property.
|
|
1480
|
-
*/
|
|
1481
|
-
beforeEnter?: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[];
|
|
1482
|
-
/**
|
|
1483
|
-
* Arbitrary data attached to the record.
|
|
1484
|
-
*/
|
|
1485
|
-
meta?: RouteMeta;
|
|
1486
|
-
/**
|
|
1487
|
-
* Array of nested routes.
|
|
1488
|
-
*/
|
|
1489
|
-
children?: RouteRecordRaw[];
|
|
1490
|
-
/**
|
|
1491
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1492
|
-
*/
|
|
1493
|
-
props?: _RouteRecordProps | Record<string, _RouteRecordProps>;
|
|
1494
|
-
}
|
|
1495
|
-
/**
|
|
1496
|
-
* Interface to type `meta` fields in route records.
|
|
1497
|
-
*
|
|
1498
|
-
* @example
|
|
1499
|
-
*
|
|
1500
|
-
* ```ts
|
|
1501
|
-
* // typings.d.ts or router.ts
|
|
1502
|
-
* import 'vue-router';
|
|
1503
|
-
*
|
|
1504
|
-
* declare module 'vue-router' {
|
|
1505
|
-
* interface RouteMeta {
|
|
1506
|
-
* requiresAuth?: boolean
|
|
1507
|
-
* }
|
|
1508
|
-
* }
|
|
1509
|
-
* ```
|
|
1510
|
-
*/
|
|
1511
|
-
interface RouteMeta extends Record<PropertyKey, unknown> {}
|
|
1512
|
-
/**
|
|
1513
|
-
* Route Record defining one single component with the `component` option.
|
|
1514
|
-
*/
|
|
1515
|
-
interface RouteRecordSingleView extends _RouteRecordBase {
|
|
1516
|
-
/**
|
|
1517
|
-
* Component to display when the URL matches this route.
|
|
1518
|
-
*/
|
|
1519
|
-
component: RawRouteComponent;
|
|
1520
|
-
components?: never;
|
|
1521
|
-
children?: never;
|
|
1522
|
-
redirect?: never;
|
|
1523
|
-
/**
|
|
1524
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1525
|
-
*/
|
|
1526
|
-
props?: _RouteRecordProps;
|
|
1527
|
-
}
|
|
1528
|
-
/**
|
|
1529
|
-
* Route Record defining one single component with a nested view. Differently
|
|
1530
|
-
* from {@link RouteRecordSingleView}, this record has children and allows a
|
|
1531
|
-
* `redirect` option.
|
|
1532
|
-
*/
|
|
1533
|
-
interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
|
|
1534
|
-
/**
|
|
1535
|
-
* Component to display when the URL matches this route.
|
|
1536
|
-
*/
|
|
1537
|
-
component?: RawRouteComponent | null | undefined;
|
|
1538
|
-
components?: never;
|
|
1539
|
-
children: RouteRecordRaw[];
|
|
1540
|
-
/**
|
|
1541
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1542
|
-
*/
|
|
1543
|
-
props?: _RouteRecordProps;
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* Route Record defining multiple named components with the `components` option.
|
|
1547
|
-
*/
|
|
1548
|
-
interface RouteRecordMultipleViews extends _RouteRecordBase {
|
|
1549
|
-
/**
|
|
1550
|
-
* Components to display when the URL matches this route. Allow using named views.
|
|
1551
|
-
*/
|
|
1552
|
-
components: Record<string, RawRouteComponent>;
|
|
1553
|
-
component?: never;
|
|
1554
|
-
children?: never;
|
|
1555
|
-
redirect?: never;
|
|
1556
|
-
/**
|
|
1557
|
-
* Allow passing down params as props to the component rendered by
|
|
1558
|
-
* `router-view`. Should be an object with the same keys as `components` or a
|
|
1559
|
-
* boolean to be applied to every component.
|
|
1560
|
-
*/
|
|
1561
|
-
props?: Record<string, _RouteRecordProps> | boolean;
|
|
1562
|
-
}
|
|
1563
|
-
/**
|
|
1564
|
-
* Route Record defining multiple named components with the `components` option and children.
|
|
1565
|
-
*/
|
|
1566
|
-
interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
|
|
1567
|
-
/**
|
|
1568
|
-
* Components to display when the URL matches this route. Allow using named views.
|
|
1569
|
-
*/
|
|
1570
|
-
components?: Record<string, RawRouteComponent> | null | undefined;
|
|
1571
|
-
component?: never;
|
|
1572
|
-
children: RouteRecordRaw[];
|
|
1573
|
-
/**
|
|
1574
|
-
* Allow passing down params as props to the component rendered by
|
|
1575
|
-
* `router-view`. Should be an object with the same keys as `components` or a
|
|
1576
|
-
* boolean to be applied to every component.
|
|
1577
|
-
*/
|
|
1578
|
-
props?: Record<string, _RouteRecordProps> | boolean;
|
|
1579
|
-
}
|
|
1580
|
-
/**
|
|
1581
|
-
* Route Record that defines a redirect. Cannot have `component` or `components`
|
|
1582
|
-
* as it is never rendered.
|
|
1583
|
-
*/
|
|
1584
|
-
interface RouteRecordRedirect extends _RouteRecordBase {
|
|
1585
|
-
redirect: RouteRecordRedirectOption;
|
|
1586
|
-
component?: never;
|
|
1587
|
-
components?: never;
|
|
1588
|
-
props?: never;
|
|
1589
|
-
}
|
|
1590
|
-
type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;
|
|
1591
|
-
/**
|
|
1592
|
-
* Route location that can be passed to the matcher.
|
|
1593
|
-
*/
|
|
1594
|
-
/**
|
|
1595
|
-
* Normalized/resolved Route location that returned by the matcher.
|
|
1596
|
-
*/
|
|
1597
|
-
interface MatcherLocation {
|
|
1598
|
-
/**
|
|
1599
|
-
* Name of the matched record
|
|
1600
|
-
*/
|
|
1601
|
-
name: RouteRecordNameGeneric | null | undefined;
|
|
1602
|
-
/**
|
|
1603
|
-
* Percentage encoded pathname section of the URL.
|
|
1604
|
-
*/
|
|
1605
|
-
path: string;
|
|
1606
|
-
/**
|
|
1607
|
-
* Object of decoded params extracted from the `path`.
|
|
1608
|
-
*/
|
|
1609
|
-
params: RouteParamsGeneric;
|
|
1610
|
-
/**
|
|
1611
|
-
* Merged `meta` properties from all the matched route records.
|
|
1612
|
-
*/
|
|
1613
|
-
meta: RouteMeta;
|
|
1614
|
-
/**
|
|
1615
|
-
* Array of {@link RouteRecord} containing components as they were
|
|
1616
|
-
* passed when adding records. It can also contain redirect records. This
|
|
1617
|
-
* can't be used directly
|
|
1618
|
-
*/
|
|
1619
|
-
matched: RouteRecord[];
|
|
1620
|
-
} //#endregion
|
|
1621
|
-
//#region src/errors.d.ts
|
|
1622
|
-
/**
|
|
1623
|
-
* Flags so we can combine them when checking for multiple errors. This is the internal version of
|
|
1624
|
-
* {@link NavigationFailureType}.
|
|
1625
|
-
*
|
|
1626
|
-
* @internal
|
|
1627
|
-
*/
|
|
1628
|
-
declare const enum ErrorTypes {
|
|
1629
|
-
MATCHER_NOT_FOUND = 1,
|
|
1630
|
-
NAVIGATION_GUARD_REDIRECT = 2,
|
|
1631
|
-
NAVIGATION_ABORTED = 4,
|
|
1632
|
-
NAVIGATION_CANCELLED = 8,
|
|
1633
|
-
NAVIGATION_DUPLICATED = 16
|
|
1634
|
-
}
|
|
1635
|
-
/**
|
|
1636
|
-
* Enumeration with all possible types for navigation failures. Can be passed to
|
|
1637
|
-
* {@link isNavigationFailure} to check for specific failures.
|
|
1638
|
-
*/
|
|
1639
|
-
/**
|
|
1640
|
-
* Extended Error that contains extra information regarding a failed navigation.
|
|
1641
|
-
*/
|
|
1642
|
-
interface NavigationFailure extends Error {
|
|
1643
|
-
/**
|
|
1644
|
-
* Type of the navigation. One of {@link NavigationFailureType}
|
|
1645
|
-
*/
|
|
1646
|
-
type: ErrorTypes.NAVIGATION_CANCELLED | ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED;
|
|
1647
|
-
/**
|
|
1648
|
-
* Route location we were navigating from
|
|
1649
|
-
*/
|
|
1650
|
-
from: RouteLocationNormalized;
|
|
1651
|
-
/**
|
|
1652
|
-
* Route location we were navigating to
|
|
1653
|
-
*/
|
|
1654
|
-
to: RouteLocationNormalized;
|
|
1655
|
-
}
|
|
1656
|
-
/**
|
|
1657
|
-
* Internal error used to detect a redirection.
|
|
1658
|
-
*
|
|
1659
|
-
* @internal
|
|
1660
|
-
*/
|
|
1661
|
-
/**
|
|
1662
|
-
* Internal type to define an ErrorHandler
|
|
1663
|
-
*
|
|
1664
|
-
* @param error - error thrown
|
|
1665
|
-
* @param to - location we were navigating to when the error happened
|
|
1666
|
-
* @param from - location we were navigating from when the error happened
|
|
1667
|
-
* @internal
|
|
1668
|
-
*/
|
|
1669
|
-
interface _ErrorListener {
|
|
1670
|
-
(error: any, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded): any;
|
|
1671
|
-
} //#endregion
|
|
1672
|
-
//#region src/scrollBehavior.d.ts
|
|
1673
|
-
/**
|
|
1674
|
-
* Scroll position similar to
|
|
1675
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions | `ScrollToOptions`}.
|
|
1676
|
-
* Note that not all browsers support `behavior`.
|
|
1677
|
-
*/
|
|
1678
|
-
type ScrollPositionCoordinates = {
|
|
1679
|
-
behavior?: ScrollOptions['behavior'];
|
|
1680
|
-
left?: number;
|
|
1681
|
-
top?: number;
|
|
1682
|
-
};
|
|
1683
|
-
/**
|
|
1684
|
-
* Internal normalized version of {@link ScrollPositionCoordinates} that always
|
|
1685
|
-
* has `left` and `top` coordinates. Must be a type to be assignable to HistoryStateValue.
|
|
1686
|
-
*
|
|
1687
|
-
* @internal
|
|
1688
|
-
*/
|
|
1689
|
-
type _ScrollPositionNormalized = {
|
|
1690
|
-
behavior?: ScrollOptions['behavior'];
|
|
1691
|
-
left: number;
|
|
1692
|
-
top: number;
|
|
1693
|
-
};
|
|
1694
|
-
/**
|
|
1695
|
-
* Type of the `scrollBehavior` option that can be passed to `createRouter`.
|
|
1696
|
-
*/
|
|
1697
|
-
interface RouterScrollBehavior {
|
|
1698
|
-
/**
|
|
1699
|
-
* @param to - Route location where we are navigating to
|
|
1700
|
-
* @param from - Route location where we are navigating from
|
|
1701
|
-
* @param savedPosition - saved position if it exists, `null` otherwise
|
|
1702
|
-
*/
|
|
1703
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, savedPosition: _ScrollPositionNormalized | null): Awaitable<ScrollPosition | false | void>;
|
|
1704
|
-
}
|
|
1705
|
-
interface ScrollPositionElement extends ScrollToOptions {
|
|
1706
|
-
/**
|
|
1707
|
-
* A valid CSS selector. Note some characters must be escaped in id selectors (https://mathiasbynens.be/notes/css-escapes).
|
|
1708
|
-
* @example
|
|
1709
|
-
* Here are a few examples:
|
|
1710
|
-
*
|
|
1711
|
-
* - `.title`
|
|
1712
|
-
* - `.content:first-child`
|
|
1713
|
-
* - `#marker`
|
|
1714
|
-
* - `#marker\~with\~symbols`
|
|
1715
|
-
* - `#marker.with.dot`: selects `class="with dot" id="marker"`, not `id="marker.with.dot"`
|
|
1716
|
-
*
|
|
1717
|
-
*/
|
|
1718
|
-
el: string | Element;
|
|
1719
|
-
}
|
|
1720
|
-
type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;
|
|
1721
|
-
type Awaitable<T> = T | PromiseLike<T>; //#endregion
|
|
1722
|
-
//#region src/experimental/route-resolver/matchers/param-parsers/types.d.ts
|
|
1723
|
-
/**
|
|
1724
|
-
* Defines a parser that can read a param from the url (string-based) and
|
|
1725
|
-
* transform it into a more complex type, or vice versa.
|
|
1726
|
-
*
|
|
1727
|
-
* @see MatcherPattern
|
|
1728
|
-
*/
|
|
1729
|
-
//#endregion
|
|
1730
|
-
//#region src/experimental/router.d.ts
|
|
1731
|
-
/**
|
|
1732
|
-
* Options to initialize a {@link Router} instance.
|
|
1733
|
-
*/
|
|
1734
|
-
interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
|
|
1735
|
-
/**
|
|
1736
|
-
* History implementation used by the router. Most web applications should use
|
|
1737
|
-
* `createWebHistory` but it requires the server to be properly configured.
|
|
1738
|
-
* You can also use a _hash_ based history with `createWebHashHistory` that
|
|
1739
|
-
* does not require any configuration on the server but isn't handled at all
|
|
1740
|
-
* by search engines and does poorly on SEO.
|
|
1741
|
-
*
|
|
1742
|
-
* @example
|
|
1743
|
-
* ```js
|
|
1744
|
-
* createRouter({
|
|
1745
|
-
* history: createWebHistory(),
|
|
1746
|
-
* // other options...
|
|
1747
|
-
* })
|
|
1748
|
-
* ```
|
|
1749
|
-
*/
|
|
1750
|
-
history: RouterHistory;
|
|
1751
|
-
/**
|
|
1752
|
-
* Function to control scrolling when navigating between pages. Can return a
|
|
1753
|
-
* Promise to delay scrolling.
|
|
1754
|
-
*
|
|
1755
|
-
* @see {@link RouterScrollBehavior}.
|
|
1756
|
-
*
|
|
1757
|
-
* @example
|
|
1758
|
-
* ```js
|
|
1759
|
-
* function scrollBehavior(to, from, savedPosition) {
|
|
1760
|
-
* // `to` and `from` are both route locations
|
|
1761
|
-
* // `savedPosition` can be null if there isn't one
|
|
1762
|
-
* }
|
|
1763
|
-
* ```
|
|
1764
|
-
*/
|
|
1765
|
-
scrollBehavior?: RouterScrollBehavior;
|
|
1766
|
-
/**
|
|
1767
|
-
* Custom implementation to parse a query. See its counterpart,
|
|
1768
|
-
* {@link EXPERIMENTAL_RouterOptions_Base.stringifyQuery}.
|
|
1769
|
-
*
|
|
1770
|
-
* @example
|
|
1771
|
-
* Let's say you want to use the [qs package](https://github.com/ljharb/qs)
|
|
1772
|
-
* to parse queries, you can provide both `parseQuery` and `stringifyQuery`:
|
|
1773
|
-
* ```js
|
|
1774
|
-
* import qs from 'qs'
|
|
1775
|
-
*
|
|
1776
|
-
* createRouter({
|
|
1777
|
-
* // other options...
|
|
1778
|
-
* parseQuery: qs.parse,
|
|
1779
|
-
* stringifyQuery: qs.stringify,
|
|
1780
|
-
* })
|
|
1781
|
-
* ```
|
|
1782
|
-
*/
|
|
1783
|
-
parseQuery?: typeof parseQuery;
|
|
1784
|
-
/**
|
|
1785
|
-
* Custom implementation to stringify a query object. Should not prepend a leading `?`.
|
|
1786
|
-
* {@link parseQuery} counterpart to handle query parsing.
|
|
1787
|
-
*/
|
|
1788
|
-
stringifyQuery?: typeof stringifyQuery;
|
|
1789
|
-
/**
|
|
1790
|
-
* Default class applied to active {@link RouterLink}. If none is provided,
|
|
1791
|
-
* `router-link-active` will be applied.
|
|
1792
|
-
*/
|
|
1793
|
-
linkActiveClass?: string;
|
|
1794
|
-
/**
|
|
1795
|
-
* Default class applied to exact active {@link RouterLink}. If none is provided,
|
|
1796
|
-
* `router-link-exact-active` will be applied.
|
|
1797
|
-
*/
|
|
1798
|
-
linkExactActiveClass?: string;
|
|
1799
|
-
}
|
|
1800
|
-
/**
|
|
1801
|
-
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
|
|
1802
|
-
*/
|
|
1803
|
-
/**
|
|
1804
|
-
* Router base instance.
|
|
1805
|
-
*
|
|
1806
|
-
* @experimental This version is not stable, it's meant to replace {@link Router} in the future.
|
|
1807
|
-
*/
|
|
1808
|
-
interface EXPERIMENTAL_Router_Base<TRecord> {
|
|
1809
|
-
/**
|
|
1810
|
-
* Current {@link RouteLocationNormalized}
|
|
1811
|
-
*/
|
|
1812
|
-
readonly currentRoute: ShallowRef<RouteLocationNormalizedLoaded>;
|
|
1813
|
-
/**
|
|
1814
|
-
* Allows turning off the listening of history events. This is a low level api for micro-frontend.
|
|
1815
|
-
*/
|
|
1816
|
-
listening: boolean;
|
|
1817
|
-
/**
|
|
1818
|
-
* Checks if a route with a given name exists
|
|
1819
|
-
*
|
|
1820
|
-
* @param name - Name of the route to check
|
|
1821
|
-
*/
|
|
1822
|
-
hasRoute(name: NonNullable<RouteRecordNameGeneric>): boolean;
|
|
1823
|
-
/**
|
|
1824
|
-
* Get a full list of all the {@link RouteRecord | route records}.
|
|
1825
|
-
*/
|
|
1826
|
-
getRoutes(): TRecord[];
|
|
1827
|
-
/**
|
|
1828
|
-
* Returns the {@link RouteLocation | normalized version} of a
|
|
1829
|
-
* {@link RouteLocationRaw | route location}. Also includes an `href` property
|
|
1830
|
-
* that includes any existing `base`. By default, the `currentLocation` used is
|
|
1831
|
-
* `router.currentRoute` and should only be overridden in advanced use cases.
|
|
1832
|
-
*
|
|
1833
|
-
* @param to - Raw route location to resolve
|
|
1834
|
-
* @param currentLocation - Optional current location to resolve against
|
|
1835
|
-
*/
|
|
1836
|
-
resolve<Name extends keyof RouteMap = keyof RouteMap>(to: RouteLocationAsRelativeTyped<RouteMap, Name>, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved<Name>;
|
|
1837
|
-
resolve(to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved;
|
|
1838
|
-
/**
|
|
1839
|
-
* Programmatically navigate to a new URL by pushing an entry in the history
|
|
1840
|
-
* stack.
|
|
1841
|
-
*
|
|
1842
|
-
* @param to - Route location to navigate to
|
|
1843
|
-
*/
|
|
1844
|
-
push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
|
1845
|
-
/**
|
|
1846
|
-
* Programmatically navigate to a new URL by replacing the current entry in
|
|
1847
|
-
* the history stack.
|
|
1848
|
-
*
|
|
1849
|
-
* @param to - Route location to navigate to
|
|
1850
|
-
*/
|
|
1851
|
-
replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
|
1852
|
-
/**
|
|
1853
|
-
* Go back in history if possible by calling `history.back()`. Equivalent to
|
|
1854
|
-
* `router.go(-1)`.
|
|
1855
|
-
*/
|
|
1856
|
-
back(): void;
|
|
1857
|
-
/**
|
|
1858
|
-
* Go forward in history if possible by calling `history.forward()`.
|
|
1859
|
-
* Equivalent to `router.go(1)`.
|
|
1860
|
-
*/
|
|
1861
|
-
forward(): void;
|
|
1862
|
-
/**
|
|
1863
|
-
* Allows you to move forward or backward through the history. Calls
|
|
1864
|
-
* `history.go()`.
|
|
1865
|
-
*
|
|
1866
|
-
* @param delta - The position in the history to which you want to move,
|
|
1867
|
-
* relative to the current page
|
|
1868
|
-
*/
|
|
1869
|
-
go(delta: number): void;
|
|
1870
|
-
/**
|
|
1871
|
-
* Add a navigation guard that executes before any navigation. Returns a
|
|
1872
|
-
* function that removes the registered guard.
|
|
1181
|
+
maxRows?: number;
|
|
1182
|
+
columnMenu?: ColumnMenuConfig; /** Allow header drag-and-drop column reorder. Default true. */
|
|
1183
|
+
reorderable?: boolean; /** Allow header drag-resize. Default true. */
|
|
1184
|
+
resizable?: boolean; /** Pixel floor for the resize clamp. Default 48. */
|
|
1185
|
+
columnMinWidth?: number;
|
|
1186
|
+
/**
|
|
1187
|
+
* Override Enter-key semantics. Default `"main-action"`. Pass
|
|
1188
|
+
* `"toggle-select"` to make Enter mirror Space (pick/unpick the active
|
|
1189
|
+
* row) — used by value-help dialog tables where Enter shouldn't fire a
|
|
1190
|
+
* main action.
|
|
1191
|
+
*/
|
|
1192
|
+
enterAction?: EnterAction;
|
|
1193
|
+
/**
|
|
1194
|
+
* Built-in row-delete: `false` (off, default), `true` (on with defaults),
|
|
1195
|
+
* or a `RowDeleteOpt` overriding label/icon/intent/promptText. The
|
|
1196
|
+
* synthesised `__remove` action only appears when the consumer opts in
|
|
1197
|
+
* AND `tableDef.canRemove === true`. Pushed into `state.rowDelete` via
|
|
1198
|
+
* a watcher — the action set live-updates as the prop flips.
|
|
1199
|
+
*/
|
|
1200
|
+
rowDelete?: boolean | RowDeleteOpt;
|
|
1201
|
+
/**
|
|
1202
|
+
* Synthesised row-actions pseudo-column, as on `<AsTable>`. `'first'` /
|
|
1203
|
+
* `'last'` prepend or append a fixed `__actions` column rendering
|
|
1204
|
+
* `controls.rowActions` (the `@DbAction` row actions, per-row gated by
|
|
1205
|
+
* `$actions`). `'merge-select'` only renders it when `select === "none"`,
|
|
1206
|
+
* sharing the leading gutter with the checkbox column.
|
|
1873
1207
|
*
|
|
1874
|
-
*
|
|
1208
|
+
* The column is locked: no header dropdown, no resize, no drag-reorder,
|
|
1209
|
+
* NOT in the `columnNames` v-model. Hidden entirely when
|
|
1210
|
+
* the cell has no action to show (no row / rows-level action, no
|
|
1211
|
+
* `:row-actions` `extra` one — since 0.1.147 rows-level ones count).
|
|
1212
|
+
* Since 0.1.138.
|
|
1875
1213
|
*/
|
|
1876
|
-
|
|
1214
|
+
rowActionsColumn?: RowActionsColumnPlacement | false;
|
|
1877
1215
|
/**
|
|
1878
|
-
*
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
1881
|
-
*
|
|
1882
|
-
*
|
|
1883
|
-
* @param guard - navigation guard to add
|
|
1884
|
-
* @returns a function that removes the registered guard
|
|
1885
|
-
*
|
|
1886
|
-
* @example
|
|
1887
|
-
* ```js
|
|
1888
|
-
* router.beforeResolve(to => {
|
|
1889
|
-
* if (to.meta.requiresAuth && !isAuthenticated) return false
|
|
1890
|
-
* })
|
|
1891
|
-
* ```
|
|
1892
|
-
*
|
|
1216
|
+
* Render without a header row. Omits `<thead>` entirely (not
|
|
1217
|
+
* `display:none`); column widths are carried by the `<colgroup>`, so data
|
|
1218
|
+
* columns keep their annotated/seeded widths. Header-driven interactions
|
|
1219
|
+
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
1893
1220
|
*/
|
|
1894
|
-
|
|
1221
|
+
headless?: boolean;
|
|
1895
1222
|
/**
|
|
1896
|
-
*
|
|
1897
|
-
*
|
|
1898
|
-
*
|
|
1899
|
-
*
|
|
1900
|
-
* @returns a function that removes the registered hook
|
|
1223
|
+
* Per-row selectability. Return `false` — or a string, surfaced as the
|
|
1224
|
+
* disabled reason on the row's selection control — to make a row not
|
|
1225
|
+
* selectable. Enforced on every path: row click, Space/Enter toggle, and
|
|
1226
|
+
* the header select-all. Since 0.1.133.
|
|
1901
1227
|
*
|
|
1902
1228
|
* @example
|
|
1903
|
-
*
|
|
1904
|
-
* router.afterEach((to, from, failure) => {
|
|
1905
|
-
* if (isNavigationFailure(failure)) {
|
|
1906
|
-
* console.log('failed navigation', failure)
|
|
1907
|
-
* }
|
|
1908
|
-
* })
|
|
1909
|
-
* ```
|
|
1910
|
-
*/
|
|
1911
|
-
afterEach(guard: NavigationHookAfter): () => void;
|
|
1912
|
-
/**
|
|
1913
|
-
* Adds an error handler that is called every time a non caught error happens
|
|
1914
|
-
* during navigation. This includes errors thrown synchronously and
|
|
1915
|
-
* asynchronously, errors returned or passed to `next` in any navigation
|
|
1916
|
-
* guard, and errors occurred when trying to resolve an async component that
|
|
1917
|
-
* is required to render a route.
|
|
1918
|
-
*
|
|
1919
|
-
* @param handler - error handler to register
|
|
1920
|
-
*/
|
|
1921
|
-
onError(handler: _ErrorListener): () => void;
|
|
1922
|
-
/**
|
|
1923
|
-
* Returns a Promise that resolves when the router has completed the initial
|
|
1924
|
-
* navigation, which means it has resolved all async enter hooks and async
|
|
1925
|
-
* components that are associated with the initial route. If the initial
|
|
1926
|
-
* navigation already happened, the promise resolves immediately.
|
|
1927
|
-
*
|
|
1928
|
-
* This is useful in server-side rendering to ensure consistent output on both
|
|
1929
|
-
* the server and the client. Note that on server side, you need to manually
|
|
1930
|
-
* push the initial location while on client side, the router automatically
|
|
1931
|
-
* picks it up from the URL.
|
|
1932
|
-
*/
|
|
1933
|
-
isReady(): Promise<void>;
|
|
1934
|
-
/**
|
|
1935
|
-
* Called automatically by `app.use(router)`. Should not be called manually by
|
|
1936
|
-
* the user. This will trigger the initial navigation when on client side.
|
|
1937
|
-
*
|
|
1938
|
-
* @internal
|
|
1939
|
-
* @param app - Application that uses the router
|
|
1940
|
-
*/
|
|
1941
|
-
install(app: App): void;
|
|
1942
|
-
}
|
|
1943
|
-
//#endregion
|
|
1944
|
-
//#region ../../node_modules/.pnpm/vue-router@4.6.4_vue@3.5.30_typescript@5.9.3_/node_modules/vue-router/dist/vue-router.d.mts
|
|
1945
|
-
//#endregion
|
|
1946
|
-
//#region src/router.d.ts
|
|
1947
|
-
/**
|
|
1948
|
-
* Options to initialize a {@link Router} instance.
|
|
1949
|
-
*/
|
|
1950
|
-
interface RouterOptions extends EXPERIMENTAL_RouterOptions_Base {
|
|
1951
|
-
/**
|
|
1952
|
-
* Initial list of routes that should be added to the router.
|
|
1953
|
-
*/
|
|
1954
|
-
routes: Readonly<RouteRecordRaw[]>;
|
|
1955
|
-
}
|
|
1956
|
-
/**
|
|
1957
|
-
* Router instance.
|
|
1958
|
-
*/
|
|
1959
|
-
interface Router extends EXPERIMENTAL_Router_Base<RouteRecordNormalized> {
|
|
1960
|
-
/**
|
|
1961
|
-
* Original options object passed to create the Router
|
|
1962
|
-
*/
|
|
1963
|
-
readonly options: RouterOptions;
|
|
1964
|
-
/**
|
|
1965
|
-
* Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
|
|
1966
|
-
*
|
|
1967
|
-
* @param parentName - Parent Route Record where `route` should be appended at
|
|
1968
|
-
* @param route - Route Record to add
|
|
1969
|
-
*/
|
|
1970
|
-
addRoute(parentName: NonNullable<RouteRecordNameGeneric>, route: RouteRecordRaw): () => void;
|
|
1971
|
-
/**
|
|
1972
|
-
* Add a new {@link RouteRecordRaw | route record} to the router.
|
|
1973
|
-
*
|
|
1974
|
-
* @param route - Route Record to add
|
|
1975
|
-
*/
|
|
1976
|
-
addRoute(route: RouteRecordRaw): () => void;
|
|
1977
|
-
/**
|
|
1978
|
-
* Remove an existing route by its name.
|
|
1979
|
-
*
|
|
1980
|
-
* @param name - Name of the route to remove
|
|
1981
|
-
*/
|
|
1982
|
-
removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
|
|
1983
|
-
/**
|
|
1984
|
-
* Delete all routes from the router.
|
|
1985
|
-
*/
|
|
1986
|
-
clearRoutes(): void;
|
|
1987
|
-
}
|
|
1988
|
-
/**
|
|
1989
|
-
* Creates a Router instance that can be used by a Vue app.
|
|
1990
|
-
*
|
|
1991
|
-
* @param options - {@link RouterOptions}
|
|
1992
|
-
*/
|
|
1993
|
-
//#endregion
|
|
1994
|
-
//#region src/RouterLink.d.ts
|
|
1995
|
-
interface RouterLinkOptions {
|
|
1996
|
-
/**
|
|
1997
|
-
* Route Location the link should navigate to when clicked on.
|
|
1998
|
-
*/
|
|
1999
|
-
to: RouteLocationRaw;
|
|
2000
|
-
/**
|
|
2001
|
-
* Calls `router.replace` instead of `router.push`.
|
|
2002
|
-
*/
|
|
2003
|
-
replace?: boolean;
|
|
2004
|
-
}
|
|
2005
|
-
interface RouterLinkProps extends RouterLinkOptions {
|
|
2006
|
-
/**
|
|
2007
|
-
* Whether RouterLink should not wrap its content in an `a` tag. Useful when
|
|
2008
|
-
* using `v-slot` to create a custom RouterLink
|
|
2009
|
-
*/
|
|
2010
|
-
custom?: boolean;
|
|
2011
|
-
/**
|
|
2012
|
-
* Class to apply when the link is active
|
|
1229
|
+
* `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
|
|
2013
1230
|
*/
|
|
2014
|
-
|
|
1231
|
+
rowSelectable?: RowSelectableHook;
|
|
2015
1232
|
/**
|
|
2016
|
-
*
|
|
1233
|
+
* Extra classes for the row element — string, array, or
|
|
1234
|
+
* `{ class: boolean }` map, merged with the framework's own row classes.
|
|
1235
|
+
* Since 0.1.133.
|
|
2017
1236
|
*/
|
|
2018
|
-
|
|
1237
|
+
rowClass?: RowClassHook;
|
|
2019
1238
|
/**
|
|
2020
|
-
*
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
|
|
2024
|
-
ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
|
|
2025
|
-
/**
|
|
2026
|
-
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
|
|
2027
|
-
*/
|
|
2028
|
-
viewTransition?: boolean;
|
|
2029
|
-
}
|
|
2030
|
-
/**
|
|
2031
|
-
* Options passed to {@link useLink}.
|
|
2032
|
-
*/
|
|
2033
|
-
interface UseLinkOptions<Name extends keyof RouteMap = keyof RouteMap> {
|
|
2034
|
-
to: MaybeRef<RouteLocationAsString | RouteLocationAsRelativeTyped<RouteMap, Name> | RouteLocationAsPath | RouteLocationRaw>;
|
|
2035
|
-
replace?: MaybeRef<boolean | undefined>;
|
|
2036
|
-
/**
|
|
2037
|
-
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
|
|
1239
|
+
* Extra attributes for the row element. The framework's own `id`, `role`,
|
|
1240
|
+
* `aria-*`, `data-*`, `class` and `style` always win, so a hook can
|
|
1241
|
+
* decorate a row but never rewrite its accessibility contract.
|
|
1242
|
+
* Since 0.1.133.
|
|
2038
1243
|
*/
|
|
2039
|
-
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
* @internal
|
|
2079
|
-
*/
|
|
2080
|
-
interface _RouterLinkI {
|
|
2081
|
-
new <Custom extends boolean | undefined = boolean | undefined>(): {
|
|
2082
|
-
$props: RouterLinkPropsTyped<Custom>;
|
|
2083
|
-
$slots: {
|
|
2084
|
-
default?: ({
|
|
2085
|
-
route,
|
|
2086
|
-
href,
|
|
2087
|
-
isActive,
|
|
2088
|
-
isExactActive,
|
|
2089
|
-
navigate
|
|
2090
|
-
}: UnwrapRef<UseLinkReturn>) => VNode[];
|
|
2091
|
-
};
|
|
2092
|
-
};
|
|
2093
|
-
/**
|
|
2094
|
-
* Access to `useLink()` without depending on using vue-router
|
|
2095
|
-
*
|
|
2096
|
-
* @internal
|
|
2097
|
-
*/
|
|
2098
|
-
useLink: typeof useLink;
|
|
2099
|
-
} //#endregion
|
|
2100
|
-
//#region src/RouterView.d.ts
|
|
2101
|
-
interface RouterViewProps {
|
|
2102
|
-
name?: string;
|
|
2103
|
-
route?: RouteLocationNormalized;
|
|
2104
|
-
}
|
|
2105
|
-
/**
|
|
2106
|
-
* Component to display the current route the user is at.
|
|
2107
|
-
*/
|
|
2108
|
-
declare const RouterView: {
|
|
1244
|
+
rowAttrs?: RowAttrsHook;
|
|
1245
|
+
};
|
|
1246
|
+
declare var __VLS_10: {
|
|
1247
|
+
selection: TableSelection;
|
|
1248
|
+
canSelectAllMatching: boolean;
|
|
1249
|
+
selectAllMatching: () => void;
|
|
1250
|
+
clearSelection: () => void;
|
|
1251
|
+
loadedCount: number;
|
|
1252
|
+
}, __VLS_24: string, __VLS_25: any, __VLS_27: {};
|
|
1253
|
+
type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any } & {
|
|
1254
|
+
'selection-banner'?: (props: typeof __VLS_10) => any;
|
|
1255
|
+
} & {
|
|
1256
|
+
'query-loading'?: (props: typeof __VLS_27) => any;
|
|
1257
|
+
};
|
|
1258
|
+
declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1259
|
+
"row-click": (row: Row, event: MouseEvent) => any;
|
|
1260
|
+
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
1261
|
+
"main-action": (row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
1262
|
+
error: (error: Error, kind: QueryErrorKind) => any;
|
|
1263
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
1264
|
+
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
1265
|
+
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
1266
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
1267
|
+
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
1268
|
+
}>, {
|
|
1269
|
+
reorderable: boolean;
|
|
1270
|
+
resizable: boolean;
|
|
1271
|
+
columnMinWidth: number;
|
|
1272
|
+
select: SelectionMode;
|
|
1273
|
+
selectOn: SelectOn;
|
|
1274
|
+
rowDelete: boolean | RowDeleteOpt;
|
|
1275
|
+
rowActionsColumn: RowActionsColumnPlacement | false;
|
|
1276
|
+
headless: boolean;
|
|
1277
|
+
rowHeight: number;
|
|
1278
|
+
wheelRowsPerTick: number;
|
|
1279
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1280
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
1281
|
+
declare const _default$1: typeof __VLS_export$1;
|
|
1282
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
2109
1283
|
new (): {
|
|
2110
|
-
$
|
|
2111
|
-
$slots: {
|
|
2112
|
-
default?: ({
|
|
2113
|
-
Component,
|
|
2114
|
-
route
|
|
2115
|
-
}: {
|
|
2116
|
-
Component: VNode;
|
|
2117
|
-
route: RouteLocationNormalizedLoaded;
|
|
2118
|
-
}) => VNode[];
|
|
2119
|
-
};
|
|
1284
|
+
$slots: S;
|
|
2120
1285
|
};
|
|
2121
|
-
};
|
|
2122
|
-
//#region src/useApi.d.ts
|
|
2123
|
-
/**
|
|
2124
|
-
* Returns the router instance. Equivalent to using `$router` inside
|
|
2125
|
-
* templates.
|
|
2126
|
-
*/
|
|
2127
|
-
//#endregion
|
|
2128
|
-
//#region src/index.d.ts
|
|
2129
|
-
declare module 'vue' {
|
|
2130
|
-
interface ComponentCustomOptions {
|
|
2131
|
-
/**
|
|
2132
|
-
* Guard called when the router is navigating to the route that is rendering
|
|
2133
|
-
* this component from a different route. Differently from `beforeRouteUpdate`
|
|
2134
|
-
* and `beforeRouteLeave`, `beforeRouteEnter` does not have access to the
|
|
2135
|
-
* component instance through `this` because it triggers before the component
|
|
2136
|
-
* is even mounted.
|
|
2137
|
-
*
|
|
2138
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2139
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2140
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2141
|
-
* navigation
|
|
2142
|
-
*/
|
|
2143
|
-
beforeRouteEnter?: TypesConfig extends Record<'beforeRouteEnter', infer T> ? T : NavigationGuardWithThis<undefined>;
|
|
2144
|
-
/**
|
|
2145
|
-
* Guard called whenever the route that renders this component has changed, but
|
|
2146
|
-
* it is reused for the new route. This allows you to guard for changes in
|
|
2147
|
-
* params, the query or the hash.
|
|
2148
|
-
*
|
|
2149
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2150
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2151
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2152
|
-
* navigation
|
|
2153
|
-
*/
|
|
2154
|
-
beforeRouteUpdate?: TypesConfig extends Record<'beforeRouteUpdate', infer T> ? T : NavigationGuard;
|
|
2155
|
-
/**
|
|
2156
|
-
* Guard called when the router is navigating away from the current route that
|
|
2157
|
-
* is rendering this component.
|
|
2158
|
-
*
|
|
2159
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2160
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2161
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2162
|
-
* navigation
|
|
2163
|
-
*/
|
|
2164
|
-
beforeRouteLeave?: TypesConfig extends Record<'beforeRouteLeave', infer T> ? T : NavigationGuard;
|
|
2165
|
-
}
|
|
2166
|
-
interface ComponentCustomProperties {
|
|
2167
|
-
/**
|
|
2168
|
-
* Normalized current location. See {@link RouteLocationNormalizedLoaded}.
|
|
2169
|
-
*/
|
|
2170
|
-
$route: TypesConfig extends Record<'$route', infer T> ? T : RouteLocationNormalizedLoaded;
|
|
2171
|
-
/**
|
|
2172
|
-
* {@link Router} instance used by the application.
|
|
2173
|
-
*/
|
|
2174
|
-
$router: TypesConfig extends Record<'$router', infer T> ? T : Router;
|
|
2175
|
-
}
|
|
2176
|
-
interface GlobalComponents {
|
|
2177
|
-
RouterView: TypesConfig extends Record<'RouterView', infer T> ? T : typeof RouterView;
|
|
2178
|
-
RouterLink: TypesConfig extends Record<'RouterLink', infer T> ? T : typeof RouterLink;
|
|
2179
|
-
}
|
|
2180
|
-
} //#endregion
|
|
2181
|
-
//#endregion
|
|
2182
|
-
//#region src/composables/use-table-url-query.d.ts
|
|
2183
|
-
/** Options for {@link useTableUrlQuery}. */
|
|
2184
|
-
interface UseTableUrlQueryOptions {
|
|
2185
|
-
/**
|
|
2186
|
-
* Navigation mode for outbound writes.
|
|
2187
|
-
* - `"replace"` (default) — `router.replace`, no new history entry. Right
|
|
2188
|
-
* for tables that emit on every keystroke (search box) so back-button
|
|
2189
|
-
* doesn't step through 30 typing-induced URLs.
|
|
2190
|
-
* - `"push"` — `router.push`, every state change becomes a discrete
|
|
2191
|
-
* history entry. Choose when each filter/sort change should be
|
|
2192
|
-
* navigation-recoverable.
|
|
2193
|
-
*/
|
|
2194
|
-
mode?: "replace" | "push";
|
|
2195
|
-
/**
|
|
2196
|
-
* Namespace for this table's query keys. With `prefix: "t1"` every key the
|
|
2197
|
-
* bridge writes becomes `t1.<key>` (`t1.$skip`, `t1.status`, `t1.total>100`)
|
|
2198
|
-
* and only keys under that prefix are read back or removed. Keys with no
|
|
2199
|
-
* prefix — or another table's prefix — are foreign and preserved untouched,
|
|
2200
|
-
* so two tables can share one route. Since 0.1.133.
|
|
2201
|
-
*/
|
|
2202
|
-
prefix?: string;
|
|
2203
|
-
}
|
|
2204
|
-
/**
|
|
2205
|
-
* Bridge `<AsTableRoot v-model:url-query>` to vue-router. Uses **type-only**
|
|
2206
|
-
* imports of `Router` and `RouteLocationNormalizedLoaded` — no runtime
|
|
2207
|
-
* dependency on `vue-router` is added to `@atscript/vue-table`. Consumers
|
|
2208
|
-
* pass in their already-resolved `useRoute()` and `useRouter()` instances.
|
|
2209
|
-
*
|
|
2210
|
-
* Scope: the bridge owns **only what the table reads back** (since 0.1.133).
|
|
2211
|
-
* A key is the table's iff `urlQueryStringToState` would consume it — see
|
|
2212
|
-
* `urlQueryConsumesKey` — or the bridge has written it before. Read and
|
|
2213
|
-
* write therefore agree in both directions: a key the parser ignores (a host
|
|
2214
|
-
* flag, an unrecognised `$control`) is never removed, and a key the parser
|
|
2215
|
-
* reads is the bridge's to remove. Every write merges into the current
|
|
2216
|
-
* `route.query`: foreign keys stay where they are, the table's own keys are
|
|
2217
|
-
* written as one block in the table's order.
|
|
2218
|
-
*
|
|
2219
|
-
* Without a `prefix` the bridge cannot tell a plain `field=value` filter from
|
|
2220
|
-
* a page-owned flag of the same shape, so a plain key that was already in the
|
|
2221
|
-
* URL when the bridge mounted counts as foreign until the bridge writes it
|
|
2222
|
-
* itself. Pass `prefix` when a route carries a host key that could collide
|
|
2223
|
-
* with a column path, or when it carries two tables.
|
|
2224
|
-
*
|
|
2225
|
-
* @example
|
|
2226
|
-
* ```vue
|
|
2227
|
-
* <script setup>
|
|
2228
|
-
* import { useRoute, useRouter } from 'vue-router';
|
|
2229
|
-
* import { useTableUrlQuery } from '@atscript/vue-table';
|
|
2230
|
-
* const urlQuery = useTableUrlQuery(useRoute(), useRouter());
|
|
2231
|
-
* // Two tables on one route:
|
|
2232
|
-
* // const left = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'a' });
|
|
2233
|
-
* // const right = useTableUrlQuery(useRoute(), useRouter(), { prefix: 'b' });
|
|
2234
|
-
* </script>
|
|
2235
|
-
* <template>
|
|
2236
|
-
* <AsTableRoot v-model:url-query="urlQuery" url="/db/products" .../>
|
|
2237
|
-
* </template>
|
|
2238
|
-
* ```
|
|
2239
|
-
*/
|
|
2240
|
-
declare function useTableUrlQuery(route: RouteLocationNormalizedLoaded, router: Router, opts?: UseTableUrlQueryOptions): WritableComputedRef<string>;
|
|
2241
|
-
//#endregion
|
|
2242
|
-
//#region src/composables/as-presets-app.d.ts
|
|
2243
|
-
/**
|
|
2244
|
-
* App-wide injection key for the presets system. The host app calls
|
|
2245
|
-
* `app.provide(AS_PRESETS_APP, '<your-app>')` once at boot; every
|
|
2246
|
-
* `<AsTableRoot>`, `usePresets`, and `useAppPrefs` call below it pulls the
|
|
2247
|
-
* value via `inject(AS_PRESETS_APP)` unless an explicit `app` option
|
|
2248
|
-
* overrides it.
|
|
2249
|
-
*
|
|
2250
|
-
* The string identifies the application namespace on the server side —
|
|
2251
|
-
* one Moost backend can serve many apps; rows are scoped by `(app,
|
|
2252
|
-
* tableKey)`.
|
|
2253
|
-
*/
|
|
2254
|
-
declare const AS_PRESETS_APP: InjectionKey<string>;
|
|
2255
|
-
/**
|
|
2256
|
-
* Resolve the app name with these precedence rules:
|
|
2257
|
-
*
|
|
2258
|
-
* 1. `explicit` argument (composable option) — wins.
|
|
2259
|
-
* 2. `inject(AS_PRESETS_APP)` from the Vue tree.
|
|
2260
|
-
* 3. Throws — composable can't run without an app namespace.
|
|
2261
|
-
*
|
|
2262
|
-
* Throws a clear error when neither is available so misconfiguration
|
|
2263
|
-
* surfaces at setup time, not when the first network round-trip fails.
|
|
2264
|
-
*/
|
|
2265
|
-
declare function injectPresetsApp(explicit?: string): string;
|
|
2266
|
-
//#endregion
|
|
2267
|
-
//#region src/composables/use-app-prefs.d.ts
|
|
2268
|
-
interface UseAppPrefsOptions {
|
|
2269
|
-
/** App namespace; defaults to `inject(AS_PRESETS_APP)`. */
|
|
2270
|
-
app?: string;
|
|
2271
|
-
/** Presets controller URL, e.g. `"/db/_presets"`. */
|
|
2272
|
-
url: string;
|
|
2273
|
-
/** Custom client factory (auth-configured). Defaults to `getDefaultClientFactory()`. */
|
|
2274
|
-
clientFactory?: ClientFactory;
|
|
2275
|
-
/** Auto-load on setup. Default `true`. */
|
|
2276
|
-
autoLoad?: boolean;
|
|
2277
|
-
/**
|
|
2278
|
-
* Cache the most recent prefs in `localStorage` keyed by app, so the
|
|
2279
|
-
* next mount paints from cache (no flash of defaults while the network
|
|
2280
|
-
* settles) and a failed/denied load still surfaces a usable theme.
|
|
2281
|
-
* Server responses always overwrite the cache, so when a different
|
|
2282
|
-
* user signs in, their state replaces the previous user's after one
|
|
2283
|
-
* round-trip. Default `true` — pass `false` to opt out (e.g. tests,
|
|
2284
|
-
* sensitive environments).
|
|
2285
|
-
*/
|
|
2286
|
-
cache?: boolean;
|
|
2287
|
-
}
|
|
2288
|
-
interface UseAppPrefsReturn {
|
|
2289
|
-
/**
|
|
2290
|
-
* Reactive prefs object. Always non-null — defaults to `{}` until the
|
|
2291
|
-
* first load resolves. Read-only at the surface; mutate via `save()`.
|
|
2292
|
-
*/
|
|
2293
|
-
prefs: WritableComputedRef<AppConfData>;
|
|
2294
|
-
loading: Ref<boolean>;
|
|
2295
|
-
/** Last non-auth error, or `null`. Auth errors flip `available` instead. */
|
|
2296
|
-
error: Ref<unknown>;
|
|
2297
|
-
/** False on 401/403 from initial load; UI should hide pref-bound controls. */
|
|
2298
|
-
available: ComputedRef<boolean>;
|
|
2299
|
-
reload(): Promise<void>;
|
|
2300
|
-
/**
|
|
2301
|
-
* Optimistic shallow-merge save. The local `prefs` is updated immediately
|
|
2302
|
-
* for snappy UI; on server error the optimistic write is rolled back and
|
|
2303
|
-
* the error is re-thrown for the caller to surface.
|
|
2304
|
-
*/
|
|
2305
|
-
save(patch: Partial<AppConfData>): Promise<void>;
|
|
2306
|
-
/** Drop in-memory state. Useful from sign-out flows. */
|
|
2307
|
-
reset(): void;
|
|
2308
|
-
}
|
|
2309
|
-
/**
|
|
2310
|
-
* Public dev-facing composable for app-wide user preferences. Independent
|
|
2311
|
-
* of presets / tables — devs can use it on any settings surface to read
|
|
2312
|
-
* and write `appearance`, `language`, `density`, `customJson` etc. for
|
|
2313
|
-
* `(currentUser, app)`.
|
|
2314
|
-
*
|
|
2315
|
-
* Multiple calls with the same `(app, url)` share one underlying instance,
|
|
2316
|
-
* so duplicate widgets (sidebar + page header + /preferences) make a single
|
|
2317
|
-
* `/query?type=appConf` request total.
|
|
2318
|
-
*
|
|
2319
|
-
* @example
|
|
2320
|
-
* ```ts
|
|
2321
|
-
* const { prefs, save } = useAppPrefs({ url: "/db/_presets" })
|
|
2322
|
-
* // prefs.value.appearance is reactive in templates
|
|
2323
|
-
* await save({ appearance: "dark" })
|
|
2324
|
-
* ```
|
|
2325
|
-
*/
|
|
2326
|
-
declare function useAppPrefs(opts: UseAppPrefsOptions): UseAppPrefsReturn;
|
|
2327
|
-
//#endregion
|
|
2328
|
-
//#region src/composables/use-table-component.d.ts
|
|
2329
|
-
/**
|
|
2330
|
-
* Resolve a single skin-slot component from the injected `controls` map,
|
|
2331
|
-
* falling back to the default. Safe to call outside a table context (e.g.
|
|
2332
|
-
* a default mounted standalone in tests) — the fallback is returned.
|
|
2333
|
-
*/
|
|
2334
|
-
declare function useTableComponent<K extends keyof TAsTableControls>(key: K, fallback: Component$1): Component$1;
|
|
1286
|
+
};
|
|
2335
1287
|
//#endregion
|
|
2336
1288
|
//#region src/composables/create-default-controls.d.ts
|
|
2337
1289
|
/**
|
|
@@ -2432,24 +1384,34 @@ type __VLS_Props = {
|
|
|
2432
1384
|
clientFactory?: ClientFactory; /** Skin-slot overrides for table chrome — header cells, filter dialog, column menu, etc. Use {@link createDefaultControls} to seed defaults. */
|
|
2433
1385
|
controls?: TAsTableControls; /** Cell-type → component dispatch map. Use {@link createDefaultCellTypes} to seed defaults. */
|
|
2434
1386
|
types?: TAsCellTypeComponents; /** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
2435
|
-
components?: Record<string, Component
|
|
1387
|
+
components?: Record<string, Component>;
|
|
2436
1388
|
/**
|
|
2437
1389
|
* Form-type → component dispatch map for the built-in action-form dialog.
|
|
2438
1390
|
* Defaults to `createDefaultTypes()` from `@atscript/vue-form`.
|
|
2439
1391
|
*/
|
|
2440
1392
|
formTypes?: TAsTypeComponents; /** Named form-component overrides for the action-form dialog. */
|
|
2441
|
-
formComponents?: Record<string, Component
|
|
1393
|
+
formComponents?: Record<string, Component>;
|
|
2442
1394
|
limit?: number;
|
|
1395
|
+
/**
|
|
1396
|
+
* IANA time zone the table reads dates in — where "today" starts and which
|
|
1397
|
+
* instant a day filter means. Cells, date filters and their chips all use
|
|
1398
|
+
* it (it is also provided to the subtree as the cell locale's time zone).
|
|
1399
|
+
* Default: the surrounding cell locale's, else the browser's. Since 0.1.148.
|
|
1400
|
+
*/
|
|
1401
|
+
timeZone?: string;
|
|
2443
1402
|
/**
|
|
2444
1403
|
* Always-applied filter. App-authored: unlike presets and URLs it is
|
|
2445
1404
|
* never pruned of fields the caller cannot see — keep it to fields every
|
|
2446
|
-
* role reads.
|
|
1405
|
+
* role reads. Live since 0.1.148: a changed value re-queries the mounted
|
|
1406
|
+
* table on page 1 (compared structurally — an equal new object does
|
|
1407
|
+
* nothing); user filters, search, sorters and columns are kept. Pair with
|
|
1408
|
+
* `blockQuery` to hold the fetch until the scope is known.
|
|
2447
1409
|
*/
|
|
2448
|
-
forceFilters?: FilterExpr; /** Always-applied sorters. Never pruned, like `forceFilters`. */
|
|
1410
|
+
forceFilters?: FilterExpr; /** Always-applied sorters. Never pruned, like `forceFilters`. Live; keeps the page. */
|
|
2449
1411
|
forceSorters?: SortControl[];
|
|
2450
1412
|
/**
|
|
2451
1413
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
2452
|
-
* meta), regardless of which columns are visible. Additive only.
|
|
1414
|
+
* meta), regardless of which columns are visible. Additive only. Live.
|
|
2453
1415
|
*/
|
|
2454
1416
|
alwaysSelected?: string[];
|
|
2455
1417
|
queryOnMount?: boolean;
|
|
@@ -2462,7 +1424,17 @@ type __VLS_Props = {
|
|
|
2462
1424
|
* - `"trim"` (default) — keep PKs that survive the new result set.
|
|
2463
1425
|
* - `"persist"` — never write to `selectedRows`; full consumer ownership.
|
|
2464
1426
|
*/
|
|
2465
|
-
selectionPersistence?: SelectionPersistence;
|
|
1427
|
+
selectionPersistence?: SelectionPersistence;
|
|
1428
|
+
/**
|
|
1429
|
+
* Offer "Select all N matching" — a selection of every row matching the
|
|
1430
|
+
* current filter / search, not just the loaded ones (default `false`).
|
|
1431
|
+
* Shown by `<AsTable>` / `<AsWindowTable>` in `select="multi"` once every
|
|
1432
|
+
* loaded row is picked, for a server-backed table (no `queryFn`) whose
|
|
1433
|
+
* row actions include one that takes a query target (`queryTarget` in
|
|
1434
|
+
* `/meta`). The selection is bound by `v-model:query-selection`; see
|
|
1435
|
+
* `state.querySelection`. Since 0.1.147.
|
|
1436
|
+
*/
|
|
1437
|
+
selectAllMatching?: boolean; /** Page-alignment unit for `loadRange` and `queryNext` extension. */
|
|
2466
1438
|
blockSize?: number; /** Debounce window for the topIndex/viewportRowCount watcher. */
|
|
2467
1439
|
dragReleaseDebounceMs?: number;
|
|
2468
1440
|
/**
|
|
@@ -2508,6 +1480,11 @@ type __VLS_ModelProps = {
|
|
|
2508
1480
|
*/
|
|
2509
1481
|
"ignoreSortersWhenSearched"?: boolean;
|
|
2510
1482
|
"selectedRows"?: unknown[];
|
|
1483
|
+
/**
|
|
1484
|
+
* The "every row matching the query" selection (`state.querySelection`):
|
|
1485
|
+
* `null` while the selection is `selectedRows`. Since 0.1.147.
|
|
1486
|
+
*/
|
|
1487
|
+
"querySelection"?: QuerySelection | null;
|
|
2511
1488
|
/**
|
|
2512
1489
|
* Bidirectional URL bridge bound via `v-model:url-query`. When unbound the
|
|
2513
1490
|
* feature is off (zero overhead); when bound the first query is gated on
|
|
@@ -2540,6 +1517,10 @@ declare var __VLS_1: {
|
|
|
2540
1517
|
ignoreSortersWhenSearched: boolean;
|
|
2541
1518
|
selectedRows: unknown[];
|
|
2542
1519
|
selectedCount: number;
|
|
1520
|
+
selection: TableSelection;
|
|
1521
|
+
canSelectAllMatching: boolean;
|
|
1522
|
+
selectAllMatching: () => void;
|
|
1523
|
+
clearSelection: () => void;
|
|
2543
1524
|
navBridge: TableNavBridge;
|
|
2544
1525
|
query: (opts?: _atscript_ui_table0.QueryOptions) => void;
|
|
2545
1526
|
queryNext: () => void;
|
|
@@ -2569,16 +1550,19 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
|
|
|
2569
1550
|
"update:sorters": (value: SortControl[]) => any;
|
|
2570
1551
|
"update:ignoreSortersWhenSearched": (value: boolean) => any;
|
|
2571
1552
|
"update:selectedRows": (value: unknown[]) => any;
|
|
1553
|
+
"update:querySelection": (value: QuerySelection | null) => any;
|
|
2572
1554
|
"update:urlQuery": (value: string | undefined) => any;
|
|
2573
1555
|
} & {
|
|
2574
1556
|
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
2575
1557
|
action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
|
|
2576
1558
|
"unsupported-filter": (issue: UnsupportedFilter) => any;
|
|
1559
|
+
"selection-reset": (event: SelectionResetEvent) => any;
|
|
2577
1560
|
"fields-dropped": (report: DroppedFieldsReport) => any;
|
|
2578
1561
|
}, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
2579
1562
|
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
2580
1563
|
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
|
|
2581
1564
|
"onUnsupported-filter"?: ((issue: UnsupportedFilter) => any) | undefined;
|
|
1565
|
+
"onSelection-reset"?: ((event: SelectionResetEvent) => any) | undefined;
|
|
2582
1566
|
"onFields-dropped"?: ((report: DroppedFieldsReport) => any) | undefined;
|
|
2583
1567
|
"onUpdate:filterFields"?: ((value: string[]) => any) | undefined;
|
|
2584
1568
|
"onUpdate:columnNames"?: ((value: string[]) => any) | undefined;
|
|
@@ -2586,6 +1570,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
|
|
|
2586
1570
|
"onUpdate:sorters"?: ((value: SortControl[]) => any) | undefined;
|
|
2587
1571
|
"onUpdate:ignoreSortersWhenSearched"?: ((value: boolean) => any) | undefined;
|
|
2588
1572
|
"onUpdate:selectedRows"?: ((value: unknown[]) => any) | undefined;
|
|
1573
|
+
"onUpdate:querySelection"?: ((value: QuerySelection | null) => any) | undefined;
|
|
2589
1574
|
"onUpdate:urlQuery"?: ((value: string | undefined) => any) | undefined;
|
|
2590
1575
|
}>, {
|
|
2591
1576
|
localSort: boolean;
|
|
@@ -2601,4 +1586,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
2601
1586
|
};
|
|
2602
1587
|
};
|
|
2603
1588
|
//#endregion
|
|
2604
|
-
export {
|
|
1589
|
+
export { ExportProgress as $, getColumnWidth as A, UseAppPrefsReturn as B, getDefaultClientFactory as C, UsePresetsOptions as Ct, setDefaultClientFactory as D, UseLocalDraftOptions as Dt, resolveSystemPresets$1 as E, StorageLike as Et, createDefaultControls as F, TableUrlQueryRouter as G, AS_PRESETS_APP as H, _default$1 as I, useTableActions as J, UseTableUrlQueryOptions as K, _default$2 as L, provideCellLocale as M, useCellLocale as N, formatCellValue as O, UseLocalDraftReturn as Ot, createDefaultCellTypes as P, ExportCellFormatter as Q, useTableComponent as R, UserConfData as S, ActivePresetView as St, resetDefaultClientFactory as T, usePresets as Tt, injectPresetsApp as U, useAppPrefs as V, TableUrlQueryRoute as W, useTableFilter as X, useTableSearch as Y, useTableNavBridge as Z, SYSTEM_PRESET_PREFIX as _, createStaticTableState as _t, CsvOptions$1 as a, UseTableOptions as at, SystemPresetInput$1 as b, useTableContext as bt, ExportScalar$1 as c, SelectionPersistence as ct, PresetCapabilities$1 as d, CreateStaticTableStateOptions as dt, ExportResult as et, PresetData as f, CreateTableStateOptions as ft, STANDARD_PRESET_ID$1 as g, TableStateInternals as gt, QueryOptions as h, TableModelRefs as ht, ClientFactory$1 as i, useTableExport as it, CellLocale as j, getCellValue as k, useLocalDraft as kt, PRESET_ASPECTS as l, useTableSelection as lt, PresetSnapshotWire as m, TableContext as mt, AppConfData$1 as n, UseTableExportReturn as nt, DisplayColumnDef$1 as o, clearTableCache as ot, PresetSnapshot$1 as p, QueryFn as pt, useTableUrlQuery as q, AsPresetEntryRow$1 as r, downloadExport as rt, ExportAbortError as s, useTable as st, _default as t, ExportRowsOptions as tt, PresetAspect$1 as u, BuildQueryOptions as ut, SelectionQuery$1 as v, createTableState as vt, isSystemPresetId$1 as w, UsePresetsReturn as wt, UrlQuerySync$1 as x, useTableContextOptional as xt, SystemPreset$1 as y, provideTableContext as yt, UseAppPrefsOptions as z };
|