@atscript/vue-table 0.1.147 → 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 +1 -1
- package/dist/as-action-form-dialog.mjs +1 -1
- package/dist/{as-action-menu-content-35yQWbLF.mjs → as-action-menu-content-BBwL1YZU.mjs} +1 -1
- package/dist/{as-action-menu-content-BJ0tn6jq.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.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.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.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.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.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-B6iuKmIj.d.cts → as-column-menu.vue-4zJmC_M6.d.mts} +2 -2
- package/dist/{as-column-menu.vue-wxb2f92k.d.mts → as-column-menu.vue-CS_8jHG3.d.cts} +2 -2
- package/dist/{as-config-dialog-BJkBzaku.cjs → as-config-dialog-CnIvMsK0.cjs} +10 -5
- package/dist/{as-config-dialog-D503Ek_m.mjs → as-config-dialog-ZKMnfirD.mjs} +10 -5
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.d.mts +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-CJfDnaiU.mjs → as-confirm-dialog-DMiGquH1.mjs} +1 -1
- package/dist/{as-confirm-dialog-C5xPbkox.cjs → as-confirm-dialog-cSEHVFBq.cjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.d.mts +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-CxjO-Ge5.mjs → as-filter-dialog-DNFR30fV.mjs} +61 -38
- package/dist/{as-filter-dialog-Co0WfWOe.cjs → as-filter-dialog-KjvJdaMg.cjs} +60 -37
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.d.mts +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-FTrxFkTw.cjs → as-filter-field-BsucQwbm.cjs} +247 -35
- package/dist/{as-filter-field-ByPlGyWz.mjs → as-filter-field-DE6MJMx7.mjs} +227 -39
- package/dist/as-filter-field.cjs +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-CksJOtqw.d.cts → as-filter-input.vue-BLTzA2Iy.d.cts} +9 -0
- package/dist/{as-filter-input.vue-DMwr0ArL.d.mts → as-filter-input.vue-CmWQGQCv.d.mts} +9 -0
- package/dist/{as-filters-W3iMELuL.cjs → as-filters-CYC_SXaA.cjs} +4 -4
- package/dist/{as-filters-CJZJiOXb.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-CLOVEpWZ.mjs → as-preset-dialog-CY5dPfZa.mjs} +2 -2
- package/dist/{as-preset-dialog-Dvvx0jmU.cjs → as-preset-dialog-tM-jrQgs.cjs} +2 -2
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.d.mts +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-DFLhbm59.cjs → as-preset-picker-CjSXtx83.cjs} +2 -2
- package/dist/{as-preset-picker-CwFObhME.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-BRsEs8oe.mjs → as-residual-filter-DHfbtTQj.mjs} +4 -5
- package/dist/{as-residual-filter-sZlsFPDS.cjs → as-residual-filter-XkXnMQNu.cjs} +4 -5
- package/dist/as-residual-filter.cjs +1 -1
- package/dist/as-residual-filter.d.mts +1 -1
- package/dist/as-residual-filter.mjs +1 -1
- package/dist/{as-row-actions-DyjIXePd.mjs → as-row-actions-BNQ7jrie.mjs} +2 -2
- package/dist/{as-row-actions-DFv2cSrP.cjs → as-row-actions-q_oMmUz1.cjs} +2 -2
- 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-BHrZBXVU.d.cts → as-row-actions.vue-BB8ATWBY.d.mts} +1 -1
- package/dist/{as-row-actions.vue-D4MylwCW.d.mts → as-row-actions.vue-CnjcRD0P.d.cts} +1 -1
- package/dist/{as-select-cell-CoQJjhnq.cjs → as-select-cell-Dc3lArvR.cjs} +5 -5
- package/dist/{as-select-cell-Dl8fohIj.mjs → as-select-cell-DjcPorVb.mjs} +5 -5
- package/dist/{as-selection-banner-DBtLjulh.mjs → as-selection-banner-Ca9DWVdW.mjs} +1 -1
- package/dist/{as-selection-banner-BI5gKHqW.cjs → as-selection-banner-CxPXBztW.cjs} +1 -1
- package/dist/{as-table-B1FowaPF.cjs → as-table-BIAkCI4g.cjs} +4 -4
- package/dist/{as-table-Cpvfv9zA.mjs → as-table-Bcz-WOTS.mjs} +4 -4
- package/dist/{as-table-actions-BlbAps1h.mjs → as-table-actions-DPq5SrGa.mjs} +2 -2
- package/dist/{as-table-actions-B0xaicfv.cjs → as-table-actions-TaI-NeVv.cjs} +2 -2
- 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-7ml3JiOO.d.mts → as-table-actions.vue-C2szPEXd.d.mts} +2 -2
- package/dist/{as-table-actions.vue-BKRqHprR.d.cts → as-table-actions.vue-CBD_tEpe.d.cts} +2 -2
- package/dist/{as-table-base-EzKaChOp.mjs → as-table-base-CsK79vYe.mjs} +2 -2
- package/dist/{as-table-base-LZ26YlWp.cjs → as-table-base-Dvey_Gie.cjs} +2 -2
- 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.mts +1 -1
- package/dist/as-table-cell-value.mjs +1 -1
- package/dist/{as-table-header-cell-gHhCdxJX.cjs → as-table-header-cell-DB7Cdskr.cjs} +1 -1
- package/dist/{as-table-header-cell-DrVzYaof.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-BCk4NPYT.d.cts → as-table-header-cell.vue-D2s9YLSJ.d.cts} +1 -1
- package/dist/{as-table-header-cell.vue-BZU8s9CT.d.mts → as-table-header-cell.vue-DfDNma_Z.d.mts} +1 -1
- package/dist/{as-table-root-BYHXuNPI.mjs → as-table-root-BnkF5-rh.mjs} +49 -9
- package/dist/{as-table-root-K6fWKHtF.cjs → as-table-root-Nsk-9XaH.cjs} +48 -8
- 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-Bm2DxAqU.d.mts → as-table-root.vue-D56WcudY.d.mts} +313 -1638
- package/dist/{as-table-root.vue-CF03c4vu.d.cts → as-table-root.vue-DXXcBPu_.d.cts} +313 -1638
- 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-CygDqZMU.mjs → as-window-table-DjplqWzr.mjs} +4 -4
- package/dist/{as-window-table-_flc8o64.cjs → as-window-table-ubm2u8_i.cjs} +4 -4
- 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 +68 -90
- package/dist/index.d.cts +8 -8
- package/dist/index.d.mts +21 -21
- package/dist/index.mjs +69 -91
- package/dist/{intent-scope-BXPEN5kJ.d.cts → intent-scope-CGch9yhy.d.cts} +13 -0
- package/dist/{intent-scope-Ck7RZ0dK.d.mts → intent-scope-CvD4YOvf.d.mts} +13 -0
- package/dist/use-condition-format-5LcuInDy.mjs +34 -0
- package/dist/use-condition-format-DrgfX6xL.cjs +39 -0
- package/dist/{use-table-DP6Y0kbl.mjs → use-table-BYNBpLJt.mjs} +23 -2
- package/dist/{use-table-CydIJZbx.cjs → use-table-C9qI-TL6.cjs} +22 -1
- package/dist/{use-table-component-aqfGzECx.cjs → use-table-component-CsdvdGJT.cjs} +1 -1
- package/dist/{use-table-component-DNGUvhf7.mjs → use-table-component-Dy397695.mjs} +1 -1
- package/dist/{use-table-nav-bridge-BhOPIT2R.mjs → use-table-nav-bridge-CJBERyPB.mjs} +1 -1
- package/dist/{use-table-nav-bridge-B7A30yja.cjs → use-table-nav-bridge-Gm4ZfOjJ.cjs} +1 -1
- package/dist/{use-table-state-sDnqOi3b.cjs → use-table-state-BQchKxUr.cjs} +53 -6
- package/dist/{use-table-state-1OZfdhQi.mjs → use-table-state-CIoWhwTD.mjs} +54 -7
- package/package.json +11 -11
- package/dist/as-filter-input-BM23TNeh.mjs +0 -101
- package/dist/as-filter-input-DJu2k9gO.cjs +0 -106
- /package/dist/{as-cell-array.vue-Dj3nZop3.d.mts → as-cell-array.vue-D4vS7C_D.d.mts} +0 -0
- /package/dist/{as-cell-date.vue-BPuyH7q3.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-D8J7YwVV.d.mts → as-cell-json.vue-C0_LDvQw.d.mts} +0 -0
- /package/dist/{as-cell-number.vue-sUoZvuat.d.mts → as-cell-number.vue-BBF0OuU8.d.mts} +0 -0
- /package/dist/{as-cell-union.vue-DZBejMxR.d.mts → as-cell-union.vue-CL-Lf-Rm.d.mts} +0 -0
- /package/dist/{as-config-dialog.vue-D2AVR1a5.d.mts → as-config-dialog.vue-BvFZZRuY.d.mts} +0 -0
- /package/dist/{as-confirm-dialog.vue-BxAaCuYf.d.mts → as-confirm-dialog.vue-Cz52-v6c.d.mts} +0 -0
- /package/dist/{as-filter-dialog.vue-WYXGtymZ.d.mts → as-filter-dialog.vue-likNLqzF.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-DTpuDkHh.d.mts → as-filter-field.vue-BbXLhd6O.d.mts} +0 -0
- /package/dist/{as-filters.vue-dHbGmcbr.d.mts → as-filters.vue-Bu4wK0iD.d.mts} +0 -0
- /package/dist/{as-preset-dialog.vue-BrnvBWxJ.d.mts → 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-Cev_8Wy7.d.mts → as-residual-filter.vue-DbeOOtR7.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-kfNgVhzn.d.mts → as-table-cell-value.vue-BXIH_yfq.d.mts} +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,10 +1,10 @@
|
|
|
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-
|
|
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, SelectionQuery, SelectionQuery as SelectionQuery$1, 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";
|
|
@@ -205,11 +205,11 @@ interface TableContext {
|
|
|
205
205
|
/** Cell-type → component dispatch map. */
|
|
206
206
|
types?: TAsCellTypeComponents;
|
|
207
207
|
/** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
208
|
-
components?: Record<string, Component
|
|
208
|
+
components?: Record<string, Component>;
|
|
209
209
|
/** Form-type → component dispatch map for the action-form dialog. */
|
|
210
210
|
formTypes?: TAsTypeComponents;
|
|
211
211
|
/** Named form-component overrides for the action-form dialog. */
|
|
212
|
-
formComponents?: Record<string, Component
|
|
212
|
+
formComponents?: Record<string, Component>;
|
|
213
213
|
}
|
|
214
214
|
type QueryFn = (query: Uniquery, page: number, size: number) => Promise<PageResult<Record<string, unknown>>>;
|
|
215
215
|
/** Per-call overrides for `state.buildQuery()`. Since 0.1.134. */
|
|
@@ -251,14 +251,22 @@ interface TableQueryOptions {
|
|
|
251
251
|
* App-authored, so never pruned of fields the caller cannot see — keep it
|
|
252
252
|
* to fields every role reads, or the query is rejected.
|
|
253
253
|
*/
|
|
254
|
-
forceFilters?: FilterExpr
|
|
254
|
+
forceFilters?: MaybeRefOrGetter<FilterExpr | undefined>;
|
|
255
255
|
/** Always-applied sorters (prepended before user sorters). Never pruned, like `forceFilters`. */
|
|
256
|
-
forceSorters?: SortControl[]
|
|
256
|
+
forceSorters?: MaybeRefOrGetter<SortControl[] | undefined>;
|
|
257
257
|
/**
|
|
258
258
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
259
259
|
* meta), regardless of which columns are visible. Additive only.
|
|
260
260
|
*/
|
|
261
|
-
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>;
|
|
262
270
|
/**
|
|
263
271
|
* When true, all triggers (query/queryNext/loadRange) early-return. Pass a
|
|
264
272
|
* getter (or a ref) to keep it reactive: when it flips back to `false` the
|
|
@@ -425,6 +433,15 @@ interface CreateStaticTableStateOptions {
|
|
|
425
433
|
model?: TableModelRefs;
|
|
426
434
|
/** Auto-query once the synthetic definition is in place (default: true). Since 0.1.134. */
|
|
427
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>>>;
|
|
428
445
|
/**
|
|
429
446
|
* Action settings. Only the client-free parts apply — there is no client to
|
|
430
447
|
* invoke a server action with. Since 0.1.134.
|
|
@@ -529,15 +546,33 @@ interface UseTableOptions {
|
|
|
529
546
|
* search or index changed. Since 0.1.147.
|
|
530
547
|
*/
|
|
531
548
|
onSelectionReset?: (event: SelectionResetEvent) => void;
|
|
532
|
-
/**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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>;
|
|
536
558
|
/**
|
|
537
559
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
538
|
-
* meta), regardless of which columns are visible. Additive only.
|
|
560
|
+
* meta), regardless of which columns are visible. Additive only. Live, like
|
|
561
|
+
* `forceFilters`.
|
|
539
562
|
*/
|
|
540
|
-
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>;
|
|
541
576
|
/** Override the default query function. */
|
|
542
577
|
queryFn?: QueryFn;
|
|
543
578
|
/** Auto-query when metadata loads (default: true). */
|
|
@@ -557,1661 +592,280 @@ interface UseTableOptions {
|
|
|
557
592
|
/** Skin-slot overrides for table chrome (header cells, filter dialog, column menu, etc.). */
|
|
558
593
|
controls?: TAsTableControls;
|
|
559
594
|
/** Cell-type → component dispatch map. Use {@link createDefaultCellTypes} to seed defaults. */
|
|
560
|
-
types?: TAsCellTypeComponents;
|
|
561
|
-
/** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
562
|
-
components?: Record<string, Component
|
|
563
|
-
/**
|
|
564
|
-
* Form-type → component dispatch map for the action-form dialog. Defaults to
|
|
565
|
-
* `createDefaultTypes()` from `@atscript/vue-form`.
|
|
566
|
-
*/
|
|
567
|
-
formTypes?: TAsTypeComponents;
|
|
568
|
-
/** Named form-component overrides for the action-form dialog. */
|
|
569
|
-
formComponents?: Record<string, Component$1>;
|
|
570
|
-
/** Whether to provide table context to the subtree (default: true). */
|
|
571
|
-
provideContext?: boolean;
|
|
572
|
-
/**
|
|
573
|
-
* Refetch policy for `state.actions.invoke`. When `true` (default),
|
|
574
|
-
* successful `'backend'` / `'__remove'` invocations call `state.query()`.
|
|
575
|
-
*/
|
|
576
|
-
refreshOnAction?: () => boolean;
|
|
577
|
-
/**
|
|
578
|
-
* Maps a navigate action's href before it is used as an anchor `href` /
|
|
579
|
-
* mod-click `window.open` target (e.g. `router.resolve(url).href` under a
|
|
580
|
-
* base path). Never applied on the plain-left-click invoke path. Default:
|
|
581
|
-
* identity.
|
|
582
|
-
*/
|
|
583
|
-
resolveHref?: (url: string) => string;
|
|
584
|
-
/** Bridge for `<AsTableRoot>`'s `@action` emit; see `TableActionsOptions.onResolved`. */
|
|
585
|
-
onActionResolved?: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent) => void;
|
|
586
|
-
/**
|
|
587
|
-
* Gate the initial `scheduleQuery("initial")` until this ref is `true`.
|
|
588
|
-
* `<AsTableRoot>` sets it `false` while it hydrates from `v-model:urlQuery`
|
|
589
|
-
* so the first fetch composes URL + defaults into one request. Omit when
|
|
590
|
-
* not using the URL bridge — the gate stays implicitly open.
|
|
591
|
-
*/
|
|
592
|
-
urlQueryReady?: Ref<boolean>;
|
|
593
|
-
/**
|
|
594
|
-
* Called whenever a state mutation produces a new URL query string.
|
|
595
|
-
* Omitting it disables the URL emitter — the feature is opt-in.
|
|
596
|
-
*/
|
|
597
|
-
onUrlQueryChange?: (urlString: string) => void;
|
|
598
|
-
/**
|
|
599
|
-
* Per-aspect opt-in/out for the URL bridge — gate filters / sorters /
|
|
600
|
-
* search / pagination independently. Static; captured once at setup.
|
|
601
|
-
* Default (omitted): full sync.
|
|
602
|
-
*/
|
|
603
|
-
urlQuerySync?: UrlQuerySync;
|
|
604
|
-
/**
|
|
605
|
-
* Receives each piece of a restored URL's filter that was left out because
|
|
606
|
-
* field filters cannot express it — see `TableQueryOptions.onUnsupportedFilter`.
|
|
607
|
-
* Since 0.1.139.
|
|
608
|
-
*/
|
|
609
|
-
onUnsupportedFilter?: (issue: UnsupportedFilter) => void;
|
|
610
|
-
/**
|
|
611
|
-
* Receives what the table left out because it names a field this caller
|
|
612
|
-
* cannot use — see `TableQueryOptions.onFieldsDropped`. Since 0.1.141.
|
|
613
|
-
*/
|
|
614
|
-
onFieldsDropped?: (report: DroppedFieldsReport) => void;
|
|
615
|
-
/**
|
|
616
|
-
* Preset feature config — opt-in. Omit to disable presets entirely
|
|
617
|
-
* (`<AsPresetPicker>` / `<AsPresetDialog>` render nothing). When set,
|
|
618
|
-
* `url` and `tableKey` are required.
|
|
619
|
-
*/
|
|
620
|
-
preset?: PresetConfig;
|
|
621
|
-
/**
|
|
622
|
-
* Client-owned columns merged into the server's column list — see
|
|
623
|
-
* {@link DisplayColumnDef}. Captured once at setup. Since 0.1.134.
|
|
624
|
-
*/
|
|
625
|
-
displayColumns?: readonly DisplayColumnDef[];
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Main entry composable for table setup.
|
|
629
|
-
*
|
|
630
|
-
* @param url — Table endpoint URL (e.g. "/db/tables/products")
|
|
631
|
-
*/
|
|
632
|
-
declare function useTable(url: string, opts?: UseTableOptions): ReactiveTableState;
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/composables/use-table-export.d.ts
|
|
635
|
-
/** Per-cell formatter override. Return `undefined` to fall back to the default. */
|
|
636
|
-
type ExportCellFormatter = (value: unknown, column: ColumnDef, row: Record<string, unknown>) => ExportScalar | undefined;
|
|
637
|
-
interface ExportRowsOptions {
|
|
638
|
-
/**
|
|
639
|
-
* `'visible'` (default) exports the visible columns in their current display
|
|
640
|
-
* order, minus the client-owned ([display](/tables/customization)) ones —
|
|
641
|
-
* nothing on the server backs them, so they would export as an empty column
|
|
642
|
-
* unless a `formatters` entry fills them in. An array of column paths
|
|
643
|
-
* exports exactly those, in that order, display columns included.
|
|
644
|
-
*/
|
|
645
|
-
columns?: "visible" | string[];
|
|
646
|
-
/** `'csv'` (default) renders a CSV string; `'rows'` returns scalar arrays. */
|
|
647
|
-
format?: "csv" | "rows";
|
|
648
|
-
/** Rows per request while paging. Default 500. */
|
|
649
|
-
pageSize?: number;
|
|
650
|
-
/** Stop the run between pages; the promise rejects with an `AbortError`. */
|
|
651
|
-
signal?: AbortSignal;
|
|
652
|
-
/** Called after each settled page. `total` is the first page's `count`, when the endpoint reports one. */
|
|
653
|
-
onProgress?: (done: number, total?: number) => void;
|
|
654
|
-
/** Global cell formatter, applied to every column that has no `formatters` entry. */
|
|
655
|
-
formatCell?: ExportCellFormatter;
|
|
656
|
-
/** Per-column formatters keyed by column path. Win over `formatCell`. */
|
|
657
|
-
formatters?: Record<string, ExportCellFormatter>;
|
|
658
|
-
/** File name for `format: 'csv'`. `.csv` is appended when missing. Default `"export.csv"`. */
|
|
659
|
-
filename?: string;
|
|
660
|
-
/**
|
|
661
|
-
* CSV writer settings — `bom`, `escapeFormulas`, `delimiter`. Ignored by
|
|
662
|
-
* `format: 'rows'`.
|
|
663
|
-
*/
|
|
664
|
-
csv?: CsvOptions;
|
|
665
|
-
/** Hard ceiling on exported rows. */
|
|
666
|
-
maxRows?: number;
|
|
667
|
-
}
|
|
668
|
-
interface ExportResultBase {
|
|
669
|
-
/** Header labels, in export order. */
|
|
670
|
-
columns: string[];
|
|
671
|
-
/** Column paths, in export order. */
|
|
672
|
-
columnPaths: string[];
|
|
673
|
-
/** How many data rows the run collected. */
|
|
674
|
-
rowCount: number;
|
|
675
|
-
/** Total the endpoint reported for the query, when it reported one. */
|
|
676
|
-
total?: number;
|
|
677
|
-
}
|
|
678
|
-
/** A finished export. `format` discriminates the payload. */
|
|
679
|
-
type ExportResult = (ExportResultBase & {
|
|
680
|
-
format: "csv";
|
|
681
|
-
csv: string;
|
|
682
|
-
filename: string;
|
|
683
|
-
}) | (ExportResultBase & {
|
|
684
|
-
format: "rows";
|
|
685
|
-
rows: ExportScalar[][];
|
|
686
|
-
});
|
|
687
|
-
/** Progress of the run in flight: rows collected so far, and the reported total. */
|
|
688
|
-
interface ExportProgress {
|
|
689
|
-
done: number;
|
|
690
|
-
total?: number;
|
|
691
|
-
}
|
|
692
|
-
interface UseTableExportReturn {
|
|
693
|
-
/**
|
|
694
|
-
* Run an export against the table's CURRENT query. Rejects when a run is
|
|
695
|
-
* already in flight — one handle runs one export at a time.
|
|
696
|
-
*/
|
|
697
|
-
exportRows: (opts?: ExportRowsOptions) => Promise<ExportResult>;
|
|
698
|
-
/** `true` while an `exportRows` call is in flight. */
|
|
699
|
-
exporting: ComputedRef<boolean>;
|
|
700
|
-
/** Progress of the in-flight run, or `null` while idle. */
|
|
701
|
-
progress: Ref<ExportProgress | null>;
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Export the table's data as it is queried right now.
|
|
705
|
-
*
|
|
706
|
-
* The export snapshots the table's own query at call time — the same filters,
|
|
707
|
-
* sorters, search term, force-filters and `$select` projection the on-screen
|
|
708
|
-
* fetch uses (`state.buildQuery()`), through the same fetch path
|
|
709
|
-
* (`state.fetchPage()`, so a custom `queryFn` is honoured) — then pages
|
|
710
|
-
* through every result instead of one page. The primary key(s) are appended
|
|
711
|
-
* to the sort as a tiebreaker so pages never overlap or skip.
|
|
712
|
-
*
|
|
713
|
-
* Values come out of the same column metadata the cells read: union/enum keys
|
|
714
|
-
* become their labels, dates become ISO strings, arrays join. Override per
|
|
715
|
-
* column with `formatters`, or globally with `formatCell`.
|
|
716
|
-
*
|
|
717
|
-
* ```ts
|
|
718
|
-
* const { exportRows } = useTableExport()
|
|
719
|
-
* downloadExport(await exportRows({ filename: "orders.csv", csv: { bom: true } }))
|
|
720
|
-
* ```
|
|
721
|
-
*
|
|
722
|
-
* Since 0.1.134.
|
|
723
|
-
*/
|
|
724
|
-
declare function useTableExport(ctx?: TableContext): UseTableExportReturn;
|
|
725
|
-
/**
|
|
726
|
-
* Hand a finished CSV export to the browser as a file download. Returns
|
|
727
|
-
* `false` without doing anything when there is no DOM (SSR / a worker), so a
|
|
728
|
-
* server render can call it unguarded.
|
|
729
|
-
*
|
|
730
|
-
* Since 0.1.134.
|
|
731
|
-
*/
|
|
732
|
-
declare function downloadExport(result: ExportResult): boolean;
|
|
733
|
-
//#endregion
|
|
734
|
-
//#region src/composables/use-table-nav-bridge.d.ts
|
|
735
|
-
interface UseTableNavBridgeOptions extends Omit<NavKeyOptions, "mode"> {
|
|
736
|
-
/**
|
|
737
|
-
* Selection mode source. Pass a function (`() => selectMode.value`) so
|
|
738
|
-
* the bridge re-reads on every dispatch — Enter semantics depend on mode,
|
|
739
|
-
* but selection mode lives on the renderer's `:select` prop, not state.
|
|
740
|
-
* Default `"none"` (Enter only fires main-action).
|
|
741
|
-
*/
|
|
742
|
-
mode?: SelectionMode | (() => SelectionMode);
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Construct a keyboard-bridge for an external `<input>` to drive table nav
|
|
746
|
-
* without losing focus. Without args, injects the nearest `<as-table-root>`
|
|
747
|
-
* context's state. With an explicit `state`, binds to that state. With
|
|
748
|
-
* `opts.enterAction`, the returned bridge's `onKeydown` defaults to that
|
|
749
|
-
* enter-action (per-call options still win).
|
|
750
|
-
*
|
|
751
|
-
* Each call returns a fresh bridge object — callers that need stable
|
|
752
|
-
* identity should bind once at setup and reuse the binding.
|
|
753
|
-
*/
|
|
754
|
-
declare function useTableNavBridge(state?: ReactiveTableState, opts?: UseTableNavBridgeOptions): TableNavBridge;
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region src/composables/use-table-filter.d.ts
|
|
757
|
-
/**
|
|
758
|
-
* Per-field filter state composable.
|
|
759
|
-
*
|
|
760
|
-
* Creates a working copy of filter conditions (cancel-safe dialog model).
|
|
761
|
-
* Call `apply()` to commit, `reset()` to revert, `clear()` to remove.
|
|
762
|
-
*
|
|
763
|
-
* Accepts `state` directly rather than injecting — safe to call outside `setup`.
|
|
764
|
-
*/
|
|
765
|
-
declare function useTableFilter(column: ColumnDef, state: ReactiveTableState): {
|
|
766
|
-
filterType: _atscript_ui_table0.ColumnFilterType;
|
|
767
|
-
availableConditions: readonly _atscript_ui_table0.FilterConditionType[];
|
|
768
|
-
defaultCondition: _atscript_ui_table0.FilterConditionType;
|
|
769
|
-
conditions: vue.Ref<{
|
|
770
|
-
type: _atscript_ui_table0.FilterConditionType;
|
|
771
|
-
value: (string | number | boolean)[];
|
|
772
|
-
}[], FilterCondition[] | {
|
|
773
|
-
type: _atscript_ui_table0.FilterConditionType;
|
|
774
|
-
value: (string | number | boolean)[];
|
|
775
|
-
}[]>;
|
|
776
|
-
filledCount: vue.ComputedRef<number>;
|
|
777
|
-
addCondition: () => void;
|
|
778
|
-
removeCondition: (index: number) => void;
|
|
779
|
-
updateCondition: (index: number, update: Partial<FilterCondition>) => void;
|
|
780
|
-
apply: () => void;
|
|
781
|
-
clear: () => void;
|
|
782
|
-
reset: () => void;
|
|
783
|
-
};
|
|
784
|
-
//#endregion
|
|
785
|
-
//#region src/composables/use-table-search.d.ts
|
|
786
|
-
/**
|
|
787
|
-
* Convenience composable for wiring a search input to the table.
|
|
788
|
-
* Must be called inside an `<AsTableRoot>` subtree.
|
|
789
|
-
*
|
|
790
|
-
* Returns the reactive `searchTerm` ref and an `onSearchInput` handler.
|
|
791
|
-
* The central filter/search watcher debounces the auto-query.
|
|
792
|
-
*/
|
|
793
|
-
declare function useTableSearch(): {
|
|
794
|
-
searchTerm: vue.Ref<string, string>;
|
|
795
|
-
onSearchInput: (event: Event) => void;
|
|
796
|
-
};
|
|
797
|
-
//#endregion
|
|
798
|
-
//#region src/composables/use-table-actions.d.ts
|
|
799
|
-
/**
|
|
800
|
-
* Inject the table-actions namespace from the closest `<AsTableRoot>` ancestor.
|
|
801
|
-
* Returns `state.actions` directly — no wrapping. Throws when called outside
|
|
802
|
-
* the provider tree (delegated to `useTableContext`).
|
|
803
|
-
*
|
|
804
|
-
* Useful for consumers that want the model without the chrome (custom
|
|
805
|
-
* toolbars, headless action buttons, programmatic invoke).
|
|
806
|
-
*/
|
|
807
|
-
declare function useTableActions(): TableActionsState;
|
|
808
|
-
//#endregion
|
|
809
|
-
//#region ../../node_modules/.pnpm/vue-router@4.6.4_vue@3.5.30_typescript@5.9.3_/node_modules/vue-router/dist/router-CWoNjPRp.d.mts
|
|
810
|
-
//#region src/query.d.ts
|
|
811
|
-
/**
|
|
812
|
-
* Possible values in normalized {@link LocationQuery}. `null` renders the query
|
|
813
|
-
* param but without an `=`.
|
|
814
|
-
*
|
|
815
|
-
* @example
|
|
816
|
-
* ```
|
|
817
|
-
* ?isNull&isEmpty=&other=other
|
|
818
|
-
* gives
|
|
819
|
-
* `{ isNull: null, isEmpty: '', other: 'other' }`.
|
|
820
|
-
* ```
|
|
821
|
-
*
|
|
822
|
-
* @internal
|
|
823
|
-
*/
|
|
824
|
-
type LocationQueryValue = string | null;
|
|
825
|
-
/**
|
|
826
|
-
* Possible values when defining a query. `undefined` allows to remove a value.
|
|
827
|
-
*
|
|
828
|
-
* @internal
|
|
829
|
-
*/
|
|
830
|
-
type LocationQueryValueRaw = LocationQueryValue | number | undefined;
|
|
831
|
-
/**
|
|
832
|
-
* Normalized query object that appears in {@link RouteLocationNormalized}
|
|
833
|
-
*
|
|
834
|
-
* @public
|
|
835
|
-
*/
|
|
836
|
-
type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
|
|
837
|
-
/**
|
|
838
|
-
* Loose {@link LocationQuery} object that can be passed to functions like
|
|
839
|
-
* {@link Router.push} and {@link Router.replace} or anywhere when creating a
|
|
840
|
-
* {@link RouteLocationRaw}
|
|
841
|
-
*
|
|
842
|
-
* @public
|
|
843
|
-
*/
|
|
844
|
-
type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
|
|
845
|
-
/**
|
|
846
|
-
* Transforms a queryString into a {@link LocationQuery} object. Accept both, a
|
|
847
|
-
* version with the leading `?` and without Should work as URLSearchParams
|
|
848
|
-
|
|
849
|
-
* @internal
|
|
850
|
-
*
|
|
851
|
-
* @param search - search string to parse
|
|
852
|
-
* @returns a query object
|
|
853
|
-
*/
|
|
854
|
-
declare function parseQuery(search: string): LocationQuery;
|
|
855
|
-
/**
|
|
856
|
-
* Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
|
|
857
|
-
* doesn't prepend a `?`
|
|
858
|
-
*
|
|
859
|
-
* @internal
|
|
860
|
-
*
|
|
861
|
-
* @param query - query object to stringify
|
|
862
|
-
* @returns string version of the query without the leading `?`
|
|
863
|
-
*/
|
|
864
|
-
declare function stringifyQuery(query: LocationQueryRaw | undefined): string; //#endregion
|
|
865
|
-
//#region src/config.d.ts
|
|
866
|
-
/**
|
|
867
|
-
* Allows customizing existing types of the router that are used globally like `$router`, `<RouterLink>`, etc. **ONLY FOR INTERNAL USAGE**.
|
|
868
|
-
*
|
|
869
|
-
* - `$router` - the router instance
|
|
870
|
-
* - `$route` - the current route location
|
|
871
|
-
* - `beforeRouteEnter` - Page component option
|
|
872
|
-
* - `beforeRouteUpdate` - Page component option
|
|
873
|
-
* - `beforeRouteLeave` - Page component option
|
|
874
|
-
* - `RouterLink` - RouterLink Component
|
|
875
|
-
* - `RouterView` - RouterView Component
|
|
876
|
-
*
|
|
877
|
-
* @internal
|
|
878
|
-
*/
|
|
879
|
-
interface TypesConfig {} //#endregion
|
|
880
|
-
//#region src/typed-routes/route-map.d.ts
|
|
881
|
-
/**
|
|
882
|
-
* Helper type to define a Typed `RouteRecord`
|
|
883
|
-
* @see {@link RouteRecord}
|
|
884
|
-
*/
|
|
885
|
-
interface RouteRecordInfo<Name extends string | symbol = string, Path extends string = string, ParamsRaw extends RouteParamsRawGeneric = RouteParamsRawGeneric, Params extends RouteParamsGeneric = RouteParamsGeneric, ChildrenNames extends string | symbol = never> {
|
|
886
|
-
name: Name;
|
|
887
|
-
path: Path;
|
|
888
|
-
paramsRaw: ParamsRaw;
|
|
889
|
-
params: Params;
|
|
890
|
-
childrenNames: ChildrenNames;
|
|
891
|
-
}
|
|
892
|
-
type RouteRecordInfoGeneric = RouteRecordInfo<string | symbol, string, RouteParamsRawGeneric, RouteParamsGeneric, string | symbol>;
|
|
893
|
-
/**
|
|
894
|
-
* 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.
|
|
895
|
-
*/
|
|
896
|
-
type RouteMap = TypesConfig extends Record<'RouteNamedMap', infer RouteNamedMap> ? RouteNamedMap : RouteMapGeneric;
|
|
897
|
-
/**
|
|
898
|
-
* Generic version of the `RouteMap`.
|
|
899
|
-
*/
|
|
900
|
-
type RouteMapGeneric = Record<string | symbol, RouteRecordInfoGeneric>; //#endregion
|
|
901
|
-
//#region src/typed-routes/params.d.ts
|
|
902
|
-
/**
|
|
903
|
-
* Utility type for raw and non raw params like :id+
|
|
904
|
-
*
|
|
905
|
-
*/
|
|
906
|
-
//#endregion
|
|
907
|
-
//#region src/types/utils.d.ts
|
|
908
|
-
/**
|
|
909
|
-
* Creates a union type that still allows autocompletion for strings.
|
|
910
|
-
* @internal
|
|
911
|
-
*/
|
|
912
|
-
type _LiteralUnion<LiteralType, BaseType extends string = string> = LiteralType | (BaseType & Record<never, never>);
|
|
913
|
-
/**
|
|
914
|
-
* Maybe a promise maybe not
|
|
915
|
-
* @internal
|
|
916
|
-
*/
|
|
917
|
-
type _Awaitable<T> = T | PromiseLike<T>;
|
|
918
|
-
/**
|
|
919
|
-
* @internal
|
|
920
|
-
*/
|
|
921
|
-
//#endregion
|
|
922
|
-
//#region src/typed-routes/route-records.d.ts
|
|
923
|
-
/**
|
|
924
|
-
* @internal
|
|
925
|
-
*/
|
|
926
|
-
type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation, from: RouteLocationNormalizedLoaded) => RouteLocationRaw);
|
|
927
|
-
/**
|
|
928
|
-
* Generic version of {@link RouteRecordName}.
|
|
929
|
-
*/
|
|
930
|
-
type RouteRecordNameGeneric = string | symbol | undefined;
|
|
931
|
-
/**
|
|
932
|
-
* Possible values for a route record **after normalization**
|
|
933
|
-
*
|
|
934
|
-
* NOTE: since `RouteRecordName` is a type, it evaluates too early and it's often the generic version {@link RouteRecordNameGeneric}. If you need a typed version of all of the names of routes, use {@link RouteMap | `keyof RouteMap`}
|
|
935
|
-
*/
|
|
936
|
-
/**
|
|
937
|
-
* @internal
|
|
938
|
-
*/
|
|
939
|
-
type _RouteRecordProps<Name extends keyof RouteMap = keyof RouteMap> = boolean | Record<string, any> | ((to: RouteLocationNormalized<Name>) => Record<string, any>); //#endregion
|
|
940
|
-
//#region src/typed-routes/route-location.d.ts
|
|
941
|
-
/**
|
|
942
|
-
* Generic version of {@link RouteLocation}. It is used when no {@link RouteMap} is provided.
|
|
943
|
-
*/
|
|
944
|
-
interface RouteLocationGeneric extends _RouteLocationBase, RouteLocationOptions {
|
|
945
|
-
/**
|
|
946
|
-
* Array of {@link RouteRecord} containing components as they were
|
|
947
|
-
* passed when adding records. It can also contain redirect records. This
|
|
948
|
-
* can't be used directly. **This property is non-enumerable**.
|
|
949
|
-
*/
|
|
950
|
-
matched: RouteRecord[];
|
|
951
|
-
}
|
|
952
|
-
/**
|
|
953
|
-
* Helper to generate a type safe version of the {@link RouteLocation} type.
|
|
954
|
-
*/
|
|
955
|
-
interface RouteLocationTyped<RouteMap$1 extends RouteMapGeneric, Name extends keyof RouteMap$1> extends RouteLocationGeneric {
|
|
956
|
-
name: Extract<Name, string | symbol>;
|
|
957
|
-
params: RouteMap$1[Name]['params'];
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* List of all possible {@link RouteLocation} indexed by the route name.
|
|
961
|
-
* @internal
|
|
962
|
-
*/
|
|
963
|
-
type RouteLocationTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationTyped<RouteMap$1, N> };
|
|
964
|
-
/**
|
|
965
|
-
* Generic version of {@link RouteLocationNormalized} that is used when no {@link RouteMap} is provided.
|
|
966
|
-
*/
|
|
967
|
-
interface RouteLocationNormalizedGeneric extends _RouteLocationBase {
|
|
968
|
-
name: RouteRecordNameGeneric;
|
|
969
|
-
/**
|
|
970
|
-
* Array of {@link RouteRecordNormalized}
|
|
971
|
-
*/
|
|
972
|
-
matched: RouteRecordNormalized[];
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Helper to generate a type safe version of the {@link RouteLocationNormalized} type.
|
|
976
|
-
*/
|
|
977
|
-
interface RouteLocationNormalizedTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationNormalizedGeneric {
|
|
978
|
-
name: Extract<Name, string | symbol>;
|
|
979
|
-
params: RouteMap$1[Name]['params'];
|
|
980
|
-
/**
|
|
981
|
-
* Array of {@link RouteRecordNormalized}
|
|
982
|
-
*/
|
|
983
|
-
matched: RouteRecordNormalized[];
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* List of all possible {@link RouteLocationNormalized} indexed by the route name.
|
|
987
|
-
* @internal
|
|
988
|
-
*/
|
|
989
|
-
type RouteLocationNormalizedTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationNormalizedTyped<RouteMap$1, N> };
|
|
990
|
-
/**
|
|
991
|
-
* Generic version of {@link RouteLocationNormalizedLoaded} that is used when no {@link RouteMap} is provided.
|
|
992
|
-
*/
|
|
993
|
-
interface RouteLocationNormalizedLoadedGeneric extends RouteLocationNormalizedGeneric {
|
|
994
|
-
/**
|
|
995
|
-
* Array of {@link RouteLocationMatched} containing only plain components (any
|
|
996
|
-
* lazy-loaded components have been loaded and were replaced inside the
|
|
997
|
-
* `components` object) so it can be directly used to display routes. It
|
|
998
|
-
* cannot contain redirect records either. **This property is non-enumerable**.
|
|
999
|
-
*/
|
|
1000
|
-
matched: RouteLocationMatched[];
|
|
1001
|
-
}
|
|
1002
|
-
/**
|
|
1003
|
-
* Helper to generate a type safe version of the {@link RouteLocationNormalizedLoaded} type.
|
|
1004
|
-
*/
|
|
1005
|
-
interface RouteLocationNormalizedLoadedTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationNormalizedLoadedGeneric {
|
|
1006
|
-
name: Extract<Name, string | symbol>;
|
|
1007
|
-
params: RouteMap$1[Name]['params'];
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* List of all possible {@link RouteLocationNormalizedLoaded} indexed by the route name.
|
|
1011
|
-
* @internal
|
|
1012
|
-
*/
|
|
1013
|
-
type RouteLocationNormalizedLoadedTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationNormalizedLoadedTyped<RouteMap$1, N> };
|
|
1014
|
-
/**
|
|
1015
|
-
* Generic version of {@link RouteLocationAsRelative}. It is used when no {@link RouteMap} is provided.
|
|
1016
|
-
*/
|
|
1017
|
-
interface RouteLocationAsRelativeGeneric extends RouteQueryAndHash, RouteLocationOptions {
|
|
1018
|
-
name?: RouteRecordNameGeneric;
|
|
1019
|
-
params?: RouteParamsRawGeneric;
|
|
1020
|
-
/**
|
|
1021
|
-
* A relative path to the current location. This property should be removed
|
|
1022
|
-
*/
|
|
1023
|
-
path?: undefined;
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsRelative} type.
|
|
1027
|
-
*/
|
|
1028
|
-
interface RouteLocationAsRelativeTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationAsRelativeGeneric {
|
|
1029
|
-
name?: Extract<Name, string | symbol>;
|
|
1030
|
-
params?: RouteMap$1[Name]['paramsRaw'];
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* List of all possible {@link RouteLocationAsRelative} indexed by the route name.
|
|
1034
|
-
* @internal
|
|
1035
|
-
*/
|
|
1036
|
-
type RouteLocationAsRelativeTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsRelativeTyped<RouteMap$1, N> };
|
|
1037
|
-
/**
|
|
1038
|
-
* Generic version of {@link RouteLocationAsPath}. It is used when no {@link RouteMap} is provided.
|
|
1039
|
-
*/
|
|
1040
|
-
interface RouteLocationAsPathGeneric extends RouteQueryAndHash, RouteLocationOptions {
|
|
1041
|
-
/**
|
|
1042
|
-
* Percentage encoded pathname section of the URL.
|
|
1043
|
-
*/
|
|
1044
|
-
path: string;
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsPath} type.
|
|
1048
|
-
*/
|
|
1049
|
-
interface RouteLocationAsPathTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> extends RouteLocationAsPathGeneric {
|
|
1050
|
-
path: _LiteralUnion<RouteMap$1[Name]['path']>;
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* List of all possible {@link RouteLocationAsPath} indexed by the route name.
|
|
1054
|
-
* @internal
|
|
1055
|
-
*/
|
|
1056
|
-
type RouteLocationAsPathTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsPathTyped<RouteMap$1, N> };
|
|
1057
|
-
/**
|
|
1058
|
-
* Helper to generate a type safe version of the {@link RouteLocationAsString} type.
|
|
1059
|
-
*/
|
|
1060
|
-
type RouteLocationAsStringTyped<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap$1 = keyof RouteMap$1> = RouteMap$1[Name]['path'];
|
|
1061
|
-
/**
|
|
1062
|
-
* List of all possible {@link RouteLocationAsString} indexed by the route name.
|
|
1063
|
-
* @internal
|
|
1064
|
-
*/
|
|
1065
|
-
type RouteLocationAsStringTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationAsStringTyped<RouteMap$1, N> };
|
|
1066
|
-
/**
|
|
1067
|
-
* Generic version of {@link RouteLocationResolved}. It is used when no {@link RouteMap} is provided.
|
|
1068
|
-
*/
|
|
1069
|
-
interface RouteLocationResolvedGeneric extends RouteLocationGeneric {
|
|
1070
|
-
/**
|
|
1071
|
-
* Resolved `href` for the route location that will be set on the `<a href="...">`.
|
|
1072
|
-
*/
|
|
1073
|
-
href: string;
|
|
1074
|
-
}
|
|
1075
|
-
/**
|
|
1076
|
-
* Helper to generate a type safe version of the {@link RouteLocationResolved} type.
|
|
1077
|
-
*/
|
|
1078
|
-
interface RouteLocationResolvedTyped<RouteMap$1 extends RouteMapGeneric, Name extends keyof RouteMap$1> extends RouteLocationTyped<RouteMap$1, Name> {
|
|
1079
|
-
/**
|
|
1080
|
-
* Resolved `href` for the route location that will be set on the `<a href="...">`.
|
|
1081
|
-
*/
|
|
1082
|
-
href: string;
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* List of all possible {@link RouteLocationResolved} indexed by the route name.
|
|
1086
|
-
* @internal
|
|
1087
|
-
*/
|
|
1088
|
-
type RouteLocationResolvedTypedList<RouteMap$1 extends RouteMapGeneric = RouteMapGeneric> = { [N in keyof RouteMap$1]: RouteLocationResolvedTyped<RouteMap$1, N> };
|
|
1089
|
-
/**
|
|
1090
|
-
* Type safe versions of types that are exposed by vue-router. We have to use a generic check to allow for names to be `undefined` when no `RouteMap` is provided.
|
|
1091
|
-
*/
|
|
1092
|
-
/**
|
|
1093
|
-
* {@link RouteLocationRaw} resolved using the matcher
|
|
1094
|
-
*/
|
|
1095
|
-
type RouteLocation<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationGeneric : RouteLocationTypedList<RouteMap>[Name];
|
|
1096
|
-
/**
|
|
1097
|
-
* Similar to {@link RouteLocation} but its
|
|
1098
|
-
* {@link RouteLocationNormalizedTyped.matched | `matched` property} cannot contain redirect records
|
|
1099
|
-
*/
|
|
1100
|
-
type RouteLocationNormalized<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedGeneric : RouteLocationNormalizedTypedList<RouteMap>[Name];
|
|
1101
|
-
/**
|
|
1102
|
-
* Similar to {@link RouteLocationNormalized} but its `components` do not contain any function to lazy load components.
|
|
1103
|
-
* In other words, it's ready to be rendered by `<RouterView>`.
|
|
1104
|
-
*/
|
|
1105
|
-
type RouteLocationNormalizedLoaded<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedLoadedGeneric : RouteLocationNormalizedLoadedTypedList<RouteMap>[Name];
|
|
1106
|
-
/**
|
|
1107
|
-
* Route location relative to the current location. It accepts other properties than `path` like `params`, `query` and
|
|
1108
|
-
* `hash` to conveniently change them.
|
|
1109
|
-
*/
|
|
1110
|
-
type RouteLocationAsRelative<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsRelativeGeneric : RouteLocationAsRelativeTypedList<RouteMap>[Name];
|
|
1111
|
-
/**
|
|
1112
|
-
* Route location resolved with {@link Router | `router.resolve()`}.
|
|
1113
|
-
*/
|
|
1114
|
-
type RouteLocationResolved<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationResolvedGeneric : RouteLocationResolvedTypedList<RouteMap>[Name];
|
|
1115
|
-
/**
|
|
1116
|
-
* Same as {@link RouteLocationAsPath} but as a string literal.
|
|
1117
|
-
*/
|
|
1118
|
-
type RouteLocationAsString<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? string : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string>;
|
|
1119
|
-
/**
|
|
1120
|
-
* Route location as an object with a `path` property.
|
|
1121
|
-
*/
|
|
1122
|
-
type RouteLocationAsPath<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsPathGeneric : RouteLocationAsPathTypedList<RouteMap>[Name];
|
|
1123
|
-
/**
|
|
1124
|
-
* Route location that can be passed to `router.push()` and other user-facing APIs.
|
|
1125
|
-
*/
|
|
1126
|
-
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
|
|
1127
|
-
//#region src/typed-routes/navigation-guards.d.ts
|
|
1128
|
-
/**
|
|
1129
|
-
* Return types for a Navigation Guard. Based on `TypesConfig`
|
|
1130
|
-
*
|
|
1131
|
-
* @see {@link TypesConfig}
|
|
1132
|
-
*/
|
|
1133
|
-
type NavigationGuardReturn = void | Error | boolean | RouteLocationRaw;
|
|
1134
|
-
/**
|
|
1135
|
-
* Navigation Guard with a type parameter for `this`.
|
|
1136
|
-
* @see {@link TypesConfig}
|
|
1137
|
-
*/
|
|
1138
|
-
interface NavigationGuardWithThis<T> {
|
|
1139
|
-
(this: T, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Navigation Guard.
|
|
1143
|
-
*/
|
|
1144
|
-
interface NavigationGuard {
|
|
1145
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
|
|
1146
|
-
}
|
|
1147
|
-
/**
|
|
1148
|
-
* Navigation hook triggered after a navigation is settled.
|
|
1149
|
-
*/
|
|
1150
|
-
interface NavigationHookAfter {
|
|
1151
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, failure?: NavigationFailure | void): unknown;
|
|
1152
|
-
}
|
|
1153
|
-
/**
|
|
1154
|
-
* `next()` callback passed to navigation guards.
|
|
1155
|
-
*/
|
|
1156
|
-
interface NavigationGuardNext {
|
|
1157
|
-
(): void;
|
|
1158
|
-
(error: Error): void;
|
|
1159
|
-
(location: RouteLocationRaw): void;
|
|
1160
|
-
(valid: boolean | undefined): void;
|
|
1161
|
-
(cb: NavigationGuardNextCallback): void;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Callback that can be passed to `next()` in `beforeRouteEnter()` guards.
|
|
1165
|
-
*/
|
|
1166
|
-
type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => unknown; //#endregion
|
|
1167
|
-
//#region src/matcher/types.d.ts
|
|
1168
|
-
/**
|
|
1169
|
-
* Normalized version of a {@link RouteRecord | route record}.
|
|
1170
|
-
*/
|
|
1171
|
-
interface RouteRecordNormalized {
|
|
1172
|
-
/**
|
|
1173
|
-
* {@inheritDoc _RouteRecordBase.path}
|
|
1174
|
-
*/
|
|
1175
|
-
path: _RouteRecordBase['path'];
|
|
1176
|
-
/**
|
|
1177
|
-
* {@inheritDoc _RouteRecordBase.redirect}
|
|
1178
|
-
*/
|
|
1179
|
-
redirect: _RouteRecordBase['redirect'] | undefined;
|
|
1180
|
-
/**
|
|
1181
|
-
* {@inheritDoc _RouteRecordBase.name}
|
|
1182
|
-
*/
|
|
1183
|
-
name: _RouteRecordBase['name'];
|
|
1184
|
-
/**
|
|
1185
|
-
* {@inheritDoc RouteRecordMultipleViews.components}
|
|
1186
|
-
*/
|
|
1187
|
-
components: RouteRecordMultipleViews['components'] | null | undefined;
|
|
1188
|
-
/**
|
|
1189
|
-
* Contains the original modules for lazy loaded components.
|
|
1190
|
-
* @internal
|
|
1191
|
-
*/
|
|
1192
|
-
mods: Record<string, unknown>;
|
|
1193
|
-
/**
|
|
1194
|
-
* Nested route records.
|
|
1195
|
-
*/
|
|
1196
|
-
children: RouteRecordRaw[];
|
|
1197
|
-
/**
|
|
1198
|
-
* {@inheritDoc _RouteRecordBase.meta}
|
|
1199
|
-
*/
|
|
1200
|
-
meta: Exclude<_RouteRecordBase['meta'], void>;
|
|
1201
|
-
/**
|
|
1202
|
-
* {@inheritDoc RouteRecordMultipleViews.props}
|
|
1203
|
-
*/
|
|
1204
|
-
props: Record<string, _RouteRecordProps>;
|
|
1205
|
-
/**
|
|
1206
|
-
* Registered beforeEnter guards
|
|
1207
|
-
*/
|
|
1208
|
-
beforeEnter: _RouteRecordBase['beforeEnter'];
|
|
1209
|
-
/**
|
|
1210
|
-
* Registered leave guards
|
|
1211
|
-
*
|
|
1212
|
-
* @internal
|
|
1213
|
-
*/
|
|
1214
|
-
leaveGuards: Set<NavigationGuard>;
|
|
1215
|
-
/**
|
|
1216
|
-
* Registered update guards
|
|
1217
|
-
*
|
|
1218
|
-
* @internal
|
|
1219
|
-
*/
|
|
1220
|
-
updateGuards: Set<NavigationGuard>;
|
|
1221
|
-
/**
|
|
1222
|
-
* Registered beforeRouteEnter callbacks passed to `next` or returned in guards
|
|
1223
|
-
*
|
|
1224
|
-
* @internal
|
|
1225
|
-
*/
|
|
1226
|
-
enterCallbacks: Record<string, NavigationGuardNextCallback[]>;
|
|
1227
|
-
/**
|
|
1228
|
-
* Mounted route component instances
|
|
1229
|
-
* Having the instances on the record mean beforeRouteUpdate and
|
|
1230
|
-
* beforeRouteLeave guards can only be invoked with the latest mounted app
|
|
1231
|
-
* instance if there are multiple application instances rendering the same
|
|
1232
|
-
* view, basically duplicating the content on the page, which shouldn't happen
|
|
1233
|
-
* in practice. It will work if multiple apps are rendering different named
|
|
1234
|
-
* views.
|
|
1235
|
-
*/
|
|
1236
|
-
instances: Record<string, ComponentPublicInstance | undefined | null>;
|
|
1237
|
-
/**
|
|
1238
|
-
* Defines if this record is the alias of another one. This property is
|
|
1239
|
-
* `undefined` if the record is the original one.
|
|
1240
|
-
*/
|
|
1241
|
-
aliasOf: RouteRecordNormalized | undefined;
|
|
1242
|
-
}
|
|
1243
|
-
/**
|
|
1244
|
-
* {@inheritDoc RouteRecordNormalized}
|
|
1245
|
-
*/
|
|
1246
|
-
type RouteRecord = RouteRecordNormalized; //#endregion
|
|
1247
|
-
//#region src/matcher/pathParserRanker.d.ts
|
|
1248
|
-
/**
|
|
1249
|
-
* @internal
|
|
1250
|
-
*/
|
|
1251
|
-
interface _PathParserOptions {
|
|
1252
|
-
/**
|
|
1253
|
-
* Makes the RegExp case-sensitive.
|
|
1254
|
-
*
|
|
1255
|
-
* @defaultValue `false`
|
|
1256
|
-
*/
|
|
1257
|
-
sensitive?: boolean;
|
|
1258
|
-
/**
|
|
1259
|
-
* Whether to disallow a trailing slash or not.
|
|
1260
|
-
*
|
|
1261
|
-
* @defaultValue `false`
|
|
1262
|
-
*/
|
|
1263
|
-
strict?: boolean;
|
|
1264
|
-
/**
|
|
1265
|
-
* Should the RegExp match from the beginning by prepending a `^` to it.
|
|
1266
|
-
* @internal
|
|
1267
|
-
*
|
|
1268
|
-
* @defaultValue `true`
|
|
1269
|
-
*/
|
|
1270
|
-
start?: boolean;
|
|
1271
|
-
/**
|
|
1272
|
-
* Should the RegExp match until the end by appending a `$` to it.
|
|
1273
|
-
*
|
|
1274
|
-
* @deprecated this option will alsways be `true` in the future. Open a discussion in vuejs/router if you need this to be `false`
|
|
1275
|
-
*
|
|
1276
|
-
* @defaultValue `true`
|
|
1277
|
-
*/
|
|
1278
|
-
end?: boolean;
|
|
1279
|
-
}
|
|
1280
|
-
type PathParserOptions = Pick<_PathParserOptions, 'end' | 'sensitive' | 'strict'>; //#endregion
|
|
1281
|
-
//#region src/matcher/pathMatcher.d.ts
|
|
1282
|
-
//#endregion
|
|
1283
|
-
//#region src/history/common.d.ts
|
|
1284
|
-
type HistoryLocation = string;
|
|
1285
|
-
/**
|
|
1286
|
-
* Allowed variables in HTML5 history state. Note that pushState clones the state
|
|
1287
|
-
* passed and does not accept everything: e.g.: it doesn't accept symbols, nor
|
|
1288
|
-
* functions as values. It also ignores Symbols as keys.
|
|
1289
|
-
*
|
|
1290
|
-
* @internal
|
|
1291
|
-
*/
|
|
1292
|
-
type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
|
|
1293
|
-
/**
|
|
1294
|
-
* Allowed HTML history.state
|
|
1295
|
-
*/
|
|
1296
|
-
interface HistoryState {
|
|
1297
|
-
[x: number]: HistoryStateValue;
|
|
1298
|
-
[x: string]: HistoryStateValue;
|
|
1299
|
-
}
|
|
1300
|
-
/**
|
|
1301
|
-
* Allowed arrays for history.state.
|
|
1302
|
-
*
|
|
1303
|
-
* @internal
|
|
1304
|
-
*/
|
|
1305
|
-
interface HistoryStateArray extends Array<HistoryStateValue> {}
|
|
1306
|
-
declare enum NavigationType {
|
|
1307
|
-
pop = "pop",
|
|
1308
|
-
push = "push"
|
|
1309
|
-
}
|
|
1310
|
-
declare enum NavigationDirection {
|
|
1311
|
-
back = "back",
|
|
1312
|
-
forward = "forward",
|
|
1313
|
-
unknown = ""
|
|
1314
|
-
}
|
|
1315
|
-
interface NavigationInformation {
|
|
1316
|
-
type: NavigationType;
|
|
1317
|
-
direction: NavigationDirection;
|
|
1318
|
-
delta: number;
|
|
1319
|
-
}
|
|
1320
|
-
interface NavigationCallback {
|
|
1321
|
-
(to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;
|
|
1322
|
-
}
|
|
1323
|
-
/**
|
|
1324
|
-
* Interface implemented by History implementations that can be passed to the
|
|
1325
|
-
* router as {@link Router.history}
|
|
1326
|
-
*
|
|
1327
|
-
* @alpha
|
|
1328
|
-
*/
|
|
1329
|
-
interface RouterHistory {
|
|
1330
|
-
/**
|
|
1331
|
-
* Base path that is prepended to every url. This allows hosting an SPA at a
|
|
1332
|
-
* sub-folder of a domain like `example.com/sub-folder` by having a `base` of
|
|
1333
|
-
* `/sub-folder`
|
|
1334
|
-
*/
|
|
1335
|
-
readonly base: string;
|
|
1336
|
-
/**
|
|
1337
|
-
* Current History location
|
|
1338
|
-
*/
|
|
1339
|
-
readonly location: HistoryLocation;
|
|
1340
|
-
/**
|
|
1341
|
-
* Current History state
|
|
1342
|
-
*/
|
|
1343
|
-
readonly state: HistoryState;
|
|
1344
|
-
/**
|
|
1345
|
-
* Navigates to a location. In the case of an HTML5 History implementation,
|
|
1346
|
-
* this will call `history.pushState` to effectively change the URL.
|
|
1347
|
-
*
|
|
1348
|
-
* @param to - location to push
|
|
1349
|
-
* @param data - optional {@link HistoryState} to be associated with the
|
|
1350
|
-
* navigation entry
|
|
1351
|
-
*/
|
|
1352
|
-
push(to: HistoryLocation, data?: HistoryState): void;
|
|
1353
|
-
/**
|
|
1354
|
-
* Same as {@link RouterHistory.push} but performs a `history.replaceState`
|
|
1355
|
-
* instead of `history.pushState`
|
|
1356
|
-
*
|
|
1357
|
-
* @param to - location to set
|
|
1358
|
-
* @param data - optional {@link HistoryState} to be associated with the
|
|
1359
|
-
* navigation entry
|
|
1360
|
-
*/
|
|
1361
|
-
replace(to: HistoryLocation, data?: HistoryState): void;
|
|
1362
|
-
/**
|
|
1363
|
-
* Traverses history in a given direction.
|
|
1364
|
-
*
|
|
1365
|
-
* @example
|
|
1366
|
-
* ```js
|
|
1367
|
-
* myHistory.go(-1) // equivalent to window.history.back()
|
|
1368
|
-
* myHistory.go(1) // equivalent to window.history.forward()
|
|
1369
|
-
* ```
|
|
1370
|
-
*
|
|
1371
|
-
* @param delta - distance to travel. If delta is \< 0, it will go back,
|
|
1372
|
-
* if it's \> 0, it will go forward by that amount of entries.
|
|
1373
|
-
* @param triggerListeners - whether this should trigger listeners attached to
|
|
1374
|
-
* the history
|
|
1375
|
-
*/
|
|
1376
|
-
go(delta: number, triggerListeners?: boolean): void;
|
|
1377
|
-
/**
|
|
1378
|
-
* Attach a listener to the History implementation that is triggered when the
|
|
1379
|
-
* navigation is triggered from outside (like the Browser back and forward
|
|
1380
|
-
* buttons) or when passing `true` to {@link RouterHistory.back} and
|
|
1381
|
-
* {@link RouterHistory.forward}
|
|
1382
|
-
*
|
|
1383
|
-
* @param callback - listener to attach
|
|
1384
|
-
* @returns a callback to remove the listener
|
|
1385
|
-
*/
|
|
1386
|
-
listen(callback: NavigationCallback): () => void;
|
|
1387
|
-
/**
|
|
1388
|
-
* Generates the corresponding href to be used in an anchor tag.
|
|
1389
|
-
*
|
|
1390
|
-
* @param location - history location that should create an href
|
|
1391
|
-
*/
|
|
1392
|
-
createHref(location: HistoryLocation): string;
|
|
1393
|
-
/**
|
|
1394
|
-
* Clears any event listener attached by the history implementation.
|
|
1395
|
-
*/
|
|
1396
|
-
destroy(): void;
|
|
1397
|
-
} //#endregion
|
|
1398
|
-
//#region src/types/index.d.ts
|
|
1399
|
-
type Lazy<T> = () => Promise<T>;
|
|
1400
|
-
/**
|
|
1401
|
-
* @internal
|
|
1402
|
-
*/
|
|
1403
|
-
type RouteParamValue = string;
|
|
1404
|
-
/**
|
|
1405
|
-
* @internal
|
|
1406
|
-
*/
|
|
1407
|
-
type RouteParamValueRaw = RouteParamValue | number | null | undefined;
|
|
1408
|
-
type RouteParamsGeneric = Record<string, RouteParamValue | RouteParamValue[]>;
|
|
1409
|
-
type RouteParamsRawGeneric = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
|
|
1410
|
-
/**
|
|
1411
|
-
* @internal
|
|
1412
|
-
*/
|
|
1413
|
-
interface RouteQueryAndHash {
|
|
1414
|
-
query?: LocationQueryRaw;
|
|
1415
|
-
hash?: string;
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* @internal
|
|
1419
|
-
*/
|
|
1420
|
-
/**
|
|
1421
|
-
* Common options for all navigation methods.
|
|
1422
|
-
*/
|
|
1423
|
-
interface RouteLocationOptions {
|
|
1424
|
-
/**
|
|
1425
|
-
* Replace the entry in the history instead of pushing a new entry
|
|
1426
|
-
*/
|
|
1427
|
-
replace?: boolean;
|
|
1428
|
-
/**
|
|
1429
|
-
* Triggers the navigation even if the location is the same as the current one.
|
|
1430
|
-
* Note this will also add a new entry to the history unless `replace: true`
|
|
1431
|
-
* is passed.
|
|
1432
|
-
*/
|
|
1433
|
-
force?: boolean;
|
|
1434
|
-
/**
|
|
1435
|
-
* State to save using the History API. This cannot contain any reactive
|
|
1436
|
-
* values and some primitives like Symbols are forbidden. More info at
|
|
1437
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/History/state
|
|
1438
|
-
*/
|
|
1439
|
-
state?: HistoryState;
|
|
1440
|
-
}
|
|
1441
|
-
/**
|
|
1442
|
-
* Route Location that can infer the necessary params based on the name.
|
|
1443
|
-
*
|
|
1444
|
-
* @internal
|
|
1445
|
-
*/
|
|
1446
|
-
interface RouteLocationMatched extends RouteRecordNormalized {
|
|
1447
|
-
components: Record<string, RouteComponent> | null | undefined;
|
|
1448
|
-
}
|
|
1449
|
-
/**
|
|
1450
|
-
* Base properties for a normalized route location.
|
|
1451
|
-
*
|
|
1452
|
-
* @internal
|
|
1453
|
-
*/
|
|
1454
|
-
interface _RouteLocationBase extends Pick<MatcherLocation, 'name' | 'path' | 'params' | 'meta'> {
|
|
1455
|
-
/**
|
|
1456
|
-
* The whole location including the `search` and `hash`. This string is
|
|
1457
|
-
* percentage encoded.
|
|
1458
|
-
*/
|
|
1459
|
-
fullPath: string;
|
|
1460
|
-
/**
|
|
1461
|
-
* Object representation of the `search` property of the current location.
|
|
1462
|
-
*/
|
|
1463
|
-
query: LocationQuery;
|
|
1464
|
-
/**
|
|
1465
|
-
* Hash of the current location. If present, starts with a `#`.
|
|
1466
|
-
*/
|
|
1467
|
-
hash: string;
|
|
1468
|
-
/**
|
|
1469
|
-
* Contains the location we were initially trying to access before ending up
|
|
1470
|
-
* on the current location.
|
|
1471
|
-
*/
|
|
1472
|
-
redirectedFrom: RouteLocation | undefined;
|
|
1473
|
-
}
|
|
1474
|
-
/**
|
|
1475
|
-
* Allowed Component in {@link RouteLocationMatched}
|
|
1476
|
-
*/
|
|
1477
|
-
type RouteComponent = Component$1 | DefineComponent;
|
|
1478
|
-
/**
|
|
1479
|
-
* Allowed Component definitions in route records provided by the user
|
|
1480
|
-
*/
|
|
1481
|
-
type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
|
|
1482
|
-
/**
|
|
1483
|
-
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
|
|
1484
|
-
*/
|
|
1485
|
-
interface _RouteRecordBase extends PathParserOptions {
|
|
1486
|
-
/**
|
|
1487
|
-
* Path of the record. Should start with `/` unless the record is the child of
|
|
1488
|
-
* another record.
|
|
1489
|
-
*
|
|
1490
|
-
* @example `/users/:id` matches `/users/1` as well as `/users/posva`.
|
|
1491
|
-
*/
|
|
1492
|
-
path: string;
|
|
1493
|
-
/**
|
|
1494
|
-
* Where to redirect if the route is directly matched. The redirection happens
|
|
1495
|
-
* before any navigation guard and triggers a new navigation with the new
|
|
1496
|
-
* target location.
|
|
1497
|
-
*/
|
|
1498
|
-
redirect?: RouteRecordRedirectOption;
|
|
1499
|
-
/**
|
|
1500
|
-
* Aliases for the record. Allows defining extra paths that will behave like a
|
|
1501
|
-
* copy of the record. Allows having paths shorthands like `/users/:id` and
|
|
1502
|
-
* `/u/:id`. All `alias` and `path` values must share the same params.
|
|
1503
|
-
*/
|
|
1504
|
-
alias?: string | string[];
|
|
1505
|
-
/**
|
|
1506
|
-
* Name for the route record. Must be unique.
|
|
1507
|
-
*/
|
|
1508
|
-
name?: RouteRecordNameGeneric;
|
|
1509
|
-
/**
|
|
1510
|
-
* Before Enter guard specific to this record. Note `beforeEnter` has no
|
|
1511
|
-
* effect if the record has a `redirect` property.
|
|
1512
|
-
*/
|
|
1513
|
-
beforeEnter?: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[];
|
|
1514
|
-
/**
|
|
1515
|
-
* Arbitrary data attached to the record.
|
|
1516
|
-
*/
|
|
1517
|
-
meta?: RouteMeta;
|
|
1518
|
-
/**
|
|
1519
|
-
* Array of nested routes.
|
|
1520
|
-
*/
|
|
1521
|
-
children?: RouteRecordRaw[];
|
|
1522
|
-
/**
|
|
1523
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1524
|
-
*/
|
|
1525
|
-
props?: _RouteRecordProps | Record<string, _RouteRecordProps>;
|
|
1526
|
-
}
|
|
1527
|
-
/**
|
|
1528
|
-
* Interface to type `meta` fields in route records.
|
|
1529
|
-
*
|
|
1530
|
-
* @example
|
|
1531
|
-
*
|
|
1532
|
-
* ```ts
|
|
1533
|
-
* // typings.d.ts or router.ts
|
|
1534
|
-
* import 'vue-router';
|
|
1535
|
-
*
|
|
1536
|
-
* declare module 'vue-router' {
|
|
1537
|
-
* interface RouteMeta {
|
|
1538
|
-
* requiresAuth?: boolean
|
|
1539
|
-
* }
|
|
1540
|
-
* }
|
|
1541
|
-
* ```
|
|
1542
|
-
*/
|
|
1543
|
-
interface RouteMeta extends Record<PropertyKey, unknown> {}
|
|
1544
|
-
/**
|
|
1545
|
-
* Route Record defining one single component with the `component` option.
|
|
1546
|
-
*/
|
|
1547
|
-
interface RouteRecordSingleView extends _RouteRecordBase {
|
|
1548
|
-
/**
|
|
1549
|
-
* Component to display when the URL matches this route.
|
|
1550
|
-
*/
|
|
1551
|
-
component: RawRouteComponent;
|
|
1552
|
-
components?: never;
|
|
1553
|
-
children?: never;
|
|
1554
|
-
redirect?: never;
|
|
1555
|
-
/**
|
|
1556
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1557
|
-
*/
|
|
1558
|
-
props?: _RouteRecordProps;
|
|
1559
|
-
}
|
|
1560
|
-
/**
|
|
1561
|
-
* Route Record defining one single component with a nested view. Differently
|
|
1562
|
-
* from {@link RouteRecordSingleView}, this record has children and allows a
|
|
1563
|
-
* `redirect` option.
|
|
1564
|
-
*/
|
|
1565
|
-
interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
|
|
1566
|
-
/**
|
|
1567
|
-
* Component to display when the URL matches this route.
|
|
1568
|
-
*/
|
|
1569
|
-
component?: RawRouteComponent | null | undefined;
|
|
1570
|
-
components?: never;
|
|
1571
|
-
children: RouteRecordRaw[];
|
|
1572
|
-
/**
|
|
1573
|
-
* Allow passing down params as props to the component rendered by `router-view`.
|
|
1574
|
-
*/
|
|
1575
|
-
props?: _RouteRecordProps;
|
|
1576
|
-
}
|
|
1577
|
-
/**
|
|
1578
|
-
* Route Record defining multiple named components with the `components` option.
|
|
1579
|
-
*/
|
|
1580
|
-
interface RouteRecordMultipleViews extends _RouteRecordBase {
|
|
1581
|
-
/**
|
|
1582
|
-
* Components to display when the URL matches this route. Allow using named views.
|
|
1583
|
-
*/
|
|
1584
|
-
components: Record<string, RawRouteComponent>;
|
|
1585
|
-
component?: never;
|
|
1586
|
-
children?: never;
|
|
1587
|
-
redirect?: never;
|
|
1588
|
-
/**
|
|
1589
|
-
* Allow passing down params as props to the component rendered by
|
|
1590
|
-
* `router-view`. Should be an object with the same keys as `components` or a
|
|
1591
|
-
* boolean to be applied to every component.
|
|
1592
|
-
*/
|
|
1593
|
-
props?: Record<string, _RouteRecordProps> | boolean;
|
|
1594
|
-
}
|
|
1595
|
-
/**
|
|
1596
|
-
* Route Record defining multiple named components with the `components` option and children.
|
|
1597
|
-
*/
|
|
1598
|
-
interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
|
|
1599
|
-
/**
|
|
1600
|
-
* Components to display when the URL matches this route. Allow using named views.
|
|
1601
|
-
*/
|
|
1602
|
-
components?: Record<string, RawRouteComponent> | null | undefined;
|
|
1603
|
-
component?: never;
|
|
1604
|
-
children: RouteRecordRaw[];
|
|
1605
|
-
/**
|
|
1606
|
-
* Allow passing down params as props to the component rendered by
|
|
1607
|
-
* `router-view`. Should be an object with the same keys as `components` or a
|
|
1608
|
-
* boolean to be applied to every component.
|
|
1609
|
-
*/
|
|
1610
|
-
props?: Record<string, _RouteRecordProps> | boolean;
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* Route Record that defines a redirect. Cannot have `component` or `components`
|
|
1614
|
-
* as it is never rendered.
|
|
1615
|
-
*/
|
|
1616
|
-
interface RouteRecordRedirect extends _RouteRecordBase {
|
|
1617
|
-
redirect: RouteRecordRedirectOption;
|
|
1618
|
-
component?: never;
|
|
1619
|
-
components?: never;
|
|
1620
|
-
props?: never;
|
|
1621
|
-
}
|
|
1622
|
-
type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;
|
|
1623
|
-
/**
|
|
1624
|
-
* Route location that can be passed to the matcher.
|
|
1625
|
-
*/
|
|
1626
|
-
/**
|
|
1627
|
-
* Normalized/resolved Route location that returned by the matcher.
|
|
1628
|
-
*/
|
|
1629
|
-
interface MatcherLocation {
|
|
1630
|
-
/**
|
|
1631
|
-
* Name of the matched record
|
|
1632
|
-
*/
|
|
1633
|
-
name: RouteRecordNameGeneric | null | undefined;
|
|
1634
|
-
/**
|
|
1635
|
-
* Percentage encoded pathname section of the URL.
|
|
1636
|
-
*/
|
|
1637
|
-
path: string;
|
|
1638
|
-
/**
|
|
1639
|
-
* Object of decoded params extracted from the `path`.
|
|
1640
|
-
*/
|
|
1641
|
-
params: RouteParamsGeneric;
|
|
1642
|
-
/**
|
|
1643
|
-
* Merged `meta` properties from all the matched route records.
|
|
1644
|
-
*/
|
|
1645
|
-
meta: RouteMeta;
|
|
1646
|
-
/**
|
|
1647
|
-
* Array of {@link RouteRecord} containing components as they were
|
|
1648
|
-
* passed when adding records. It can also contain redirect records. This
|
|
1649
|
-
* can't be used directly
|
|
1650
|
-
*/
|
|
1651
|
-
matched: RouteRecord[];
|
|
1652
|
-
} //#endregion
|
|
1653
|
-
//#region src/errors.d.ts
|
|
1654
|
-
/**
|
|
1655
|
-
* Flags so we can combine them when checking for multiple errors. This is the internal version of
|
|
1656
|
-
* {@link NavigationFailureType}.
|
|
1657
|
-
*
|
|
1658
|
-
* @internal
|
|
1659
|
-
*/
|
|
1660
|
-
declare const enum ErrorTypes {
|
|
1661
|
-
MATCHER_NOT_FOUND = 1,
|
|
1662
|
-
NAVIGATION_GUARD_REDIRECT = 2,
|
|
1663
|
-
NAVIGATION_ABORTED = 4,
|
|
1664
|
-
NAVIGATION_CANCELLED = 8,
|
|
1665
|
-
NAVIGATION_DUPLICATED = 16
|
|
1666
|
-
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Enumeration with all possible types for navigation failures. Can be passed to
|
|
1669
|
-
* {@link isNavigationFailure} to check for specific failures.
|
|
1670
|
-
*/
|
|
1671
|
-
/**
|
|
1672
|
-
* Extended Error that contains extra information regarding a failed navigation.
|
|
1673
|
-
*/
|
|
1674
|
-
interface NavigationFailure extends Error {
|
|
1675
|
-
/**
|
|
1676
|
-
* Type of the navigation. One of {@link NavigationFailureType}
|
|
1677
|
-
*/
|
|
1678
|
-
type: ErrorTypes.NAVIGATION_CANCELLED | ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED;
|
|
1679
|
-
/**
|
|
1680
|
-
* Route location we were navigating from
|
|
1681
|
-
*/
|
|
1682
|
-
from: RouteLocationNormalized;
|
|
1683
|
-
/**
|
|
1684
|
-
* Route location we were navigating to
|
|
1685
|
-
*/
|
|
1686
|
-
to: RouteLocationNormalized;
|
|
1687
|
-
}
|
|
1688
|
-
/**
|
|
1689
|
-
* Internal error used to detect a redirection.
|
|
1690
|
-
*
|
|
1691
|
-
* @internal
|
|
1692
|
-
*/
|
|
1693
|
-
/**
|
|
1694
|
-
* Internal type to define an ErrorHandler
|
|
1695
|
-
*
|
|
1696
|
-
* @param error - error thrown
|
|
1697
|
-
* @param to - location we were navigating to when the error happened
|
|
1698
|
-
* @param from - location we were navigating from when the error happened
|
|
1699
|
-
* @internal
|
|
1700
|
-
*/
|
|
1701
|
-
interface _ErrorListener {
|
|
1702
|
-
(error: any, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded): any;
|
|
1703
|
-
} //#endregion
|
|
1704
|
-
//#region src/scrollBehavior.d.ts
|
|
1705
|
-
/**
|
|
1706
|
-
* Scroll position similar to
|
|
1707
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions | `ScrollToOptions`}.
|
|
1708
|
-
* Note that not all browsers support `behavior`.
|
|
1709
|
-
*/
|
|
1710
|
-
type ScrollPositionCoordinates = {
|
|
1711
|
-
behavior?: ScrollOptions['behavior'];
|
|
1712
|
-
left?: number;
|
|
1713
|
-
top?: number;
|
|
1714
|
-
};
|
|
1715
|
-
/**
|
|
1716
|
-
* Internal normalized version of {@link ScrollPositionCoordinates} that always
|
|
1717
|
-
* has `left` and `top` coordinates. Must be a type to be assignable to HistoryStateValue.
|
|
1718
|
-
*
|
|
1719
|
-
* @internal
|
|
1720
|
-
*/
|
|
1721
|
-
type _ScrollPositionNormalized = {
|
|
1722
|
-
behavior?: ScrollOptions['behavior'];
|
|
1723
|
-
left: number;
|
|
1724
|
-
top: number;
|
|
1725
|
-
};
|
|
1726
|
-
/**
|
|
1727
|
-
* Type of the `scrollBehavior` option that can be passed to `createRouter`.
|
|
1728
|
-
*/
|
|
1729
|
-
interface RouterScrollBehavior {
|
|
1730
|
-
/**
|
|
1731
|
-
* @param to - Route location where we are navigating to
|
|
1732
|
-
* @param from - Route location where we are navigating from
|
|
1733
|
-
* @param savedPosition - saved position if it exists, `null` otherwise
|
|
1734
|
-
*/
|
|
1735
|
-
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, savedPosition: _ScrollPositionNormalized | null): Awaitable<ScrollPosition | false | void>;
|
|
1736
|
-
}
|
|
1737
|
-
interface ScrollPositionElement extends ScrollToOptions {
|
|
1738
|
-
/**
|
|
1739
|
-
* A valid CSS selector. Note some characters must be escaped in id selectors (https://mathiasbynens.be/notes/css-escapes).
|
|
1740
|
-
* @example
|
|
1741
|
-
* Here are a few examples:
|
|
1742
|
-
*
|
|
1743
|
-
* - `.title`
|
|
1744
|
-
* - `.content:first-child`
|
|
1745
|
-
* - `#marker`
|
|
1746
|
-
* - `#marker\~with\~symbols`
|
|
1747
|
-
* - `#marker.with.dot`: selects `class="with dot" id="marker"`, not `id="marker.with.dot"`
|
|
1748
|
-
*
|
|
1749
|
-
*/
|
|
1750
|
-
el: string | Element;
|
|
1751
|
-
}
|
|
1752
|
-
type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;
|
|
1753
|
-
type Awaitable<T> = T | PromiseLike<T>; //#endregion
|
|
1754
|
-
//#region src/experimental/route-resolver/matchers/param-parsers/types.d.ts
|
|
1755
|
-
/**
|
|
1756
|
-
* Defines a parser that can read a param from the url (string-based) and
|
|
1757
|
-
* transform it into a more complex type, or vice versa.
|
|
1758
|
-
*
|
|
1759
|
-
* @see MatcherPattern
|
|
1760
|
-
*/
|
|
1761
|
-
//#endregion
|
|
1762
|
-
//#region src/experimental/router.d.ts
|
|
1763
|
-
/**
|
|
1764
|
-
* Options to initialize a {@link Router} instance.
|
|
1765
|
-
*/
|
|
1766
|
-
interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
|
|
1767
|
-
/**
|
|
1768
|
-
* History implementation used by the router. Most web applications should use
|
|
1769
|
-
* `createWebHistory` but it requires the server to be properly configured.
|
|
1770
|
-
* You can also use a _hash_ based history with `createWebHashHistory` that
|
|
1771
|
-
* does not require any configuration on the server but isn't handled at all
|
|
1772
|
-
* by search engines and does poorly on SEO.
|
|
1773
|
-
*
|
|
1774
|
-
* @example
|
|
1775
|
-
* ```js
|
|
1776
|
-
* createRouter({
|
|
1777
|
-
* history: createWebHistory(),
|
|
1778
|
-
* // other options...
|
|
1779
|
-
* })
|
|
1780
|
-
* ```
|
|
1781
|
-
*/
|
|
1782
|
-
history: RouterHistory;
|
|
1783
|
-
/**
|
|
1784
|
-
* Function to control scrolling when navigating between pages. Can return a
|
|
1785
|
-
* Promise to delay scrolling.
|
|
1786
|
-
*
|
|
1787
|
-
* @see {@link RouterScrollBehavior}.
|
|
1788
|
-
*
|
|
1789
|
-
* @example
|
|
1790
|
-
* ```js
|
|
1791
|
-
* function scrollBehavior(to, from, savedPosition) {
|
|
1792
|
-
* // `to` and `from` are both route locations
|
|
1793
|
-
* // `savedPosition` can be null if there isn't one
|
|
1794
|
-
* }
|
|
1795
|
-
* ```
|
|
1796
|
-
*/
|
|
1797
|
-
scrollBehavior?: RouterScrollBehavior;
|
|
1798
|
-
/**
|
|
1799
|
-
* Custom implementation to parse a query. See its counterpart,
|
|
1800
|
-
* {@link EXPERIMENTAL_RouterOptions_Base.stringifyQuery}.
|
|
1801
|
-
*
|
|
1802
|
-
* @example
|
|
1803
|
-
* Let's say you want to use the [qs package](https://github.com/ljharb/qs)
|
|
1804
|
-
* to parse queries, you can provide both `parseQuery` and `stringifyQuery`:
|
|
1805
|
-
* ```js
|
|
1806
|
-
* import qs from 'qs'
|
|
1807
|
-
*
|
|
1808
|
-
* createRouter({
|
|
1809
|
-
* // other options...
|
|
1810
|
-
* parseQuery: qs.parse,
|
|
1811
|
-
* stringifyQuery: qs.stringify,
|
|
1812
|
-
* })
|
|
1813
|
-
* ```
|
|
1814
|
-
*/
|
|
1815
|
-
parseQuery?: typeof parseQuery;
|
|
1816
|
-
/**
|
|
1817
|
-
* Custom implementation to stringify a query object. Should not prepend a leading `?`.
|
|
1818
|
-
* {@link parseQuery} counterpart to handle query parsing.
|
|
1819
|
-
*/
|
|
1820
|
-
stringifyQuery?: typeof stringifyQuery;
|
|
1821
|
-
/**
|
|
1822
|
-
* Default class applied to active {@link RouterLink}. If none is provided,
|
|
1823
|
-
* `router-link-active` will be applied.
|
|
1824
|
-
*/
|
|
1825
|
-
linkActiveClass?: string;
|
|
1826
|
-
/**
|
|
1827
|
-
* Default class applied to exact active {@link RouterLink}. If none is provided,
|
|
1828
|
-
* `router-link-exact-active` will be applied.
|
|
1829
|
-
*/
|
|
1830
|
-
linkExactActiveClass?: string;
|
|
1831
|
-
}
|
|
1832
|
-
/**
|
|
1833
|
-
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
|
|
1834
|
-
*/
|
|
1835
|
-
/**
|
|
1836
|
-
* Router base instance.
|
|
1837
|
-
*
|
|
1838
|
-
* @experimental This version is not stable, it's meant to replace {@link Router} in the future.
|
|
1839
|
-
*/
|
|
1840
|
-
interface EXPERIMENTAL_Router_Base<TRecord> {
|
|
1841
|
-
/**
|
|
1842
|
-
* Current {@link RouteLocationNormalized}
|
|
1843
|
-
*/
|
|
1844
|
-
readonly currentRoute: ShallowRef<RouteLocationNormalizedLoaded>;
|
|
1845
|
-
/**
|
|
1846
|
-
* Allows turning off the listening of history events. This is a low level api for micro-frontend.
|
|
1847
|
-
*/
|
|
1848
|
-
listening: boolean;
|
|
1849
|
-
/**
|
|
1850
|
-
* Checks if a route with a given name exists
|
|
1851
|
-
*
|
|
1852
|
-
* @param name - Name of the route to check
|
|
1853
|
-
*/
|
|
1854
|
-
hasRoute(name: NonNullable<RouteRecordNameGeneric>): boolean;
|
|
1855
|
-
/**
|
|
1856
|
-
* Get a full list of all the {@link RouteRecord | route records}.
|
|
1857
|
-
*/
|
|
1858
|
-
getRoutes(): TRecord[];
|
|
1859
|
-
/**
|
|
1860
|
-
* Returns the {@link RouteLocation | normalized version} of a
|
|
1861
|
-
* {@link RouteLocationRaw | route location}. Also includes an `href` property
|
|
1862
|
-
* that includes any existing `base`. By default, the `currentLocation` used is
|
|
1863
|
-
* `router.currentRoute` and should only be overridden in advanced use cases.
|
|
1864
|
-
*
|
|
1865
|
-
* @param to - Raw route location to resolve
|
|
1866
|
-
* @param currentLocation - Optional current location to resolve against
|
|
1867
|
-
*/
|
|
1868
|
-
resolve<Name extends keyof RouteMap = keyof RouteMap>(to: RouteLocationAsRelativeTyped<RouteMap, Name>, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved<Name>;
|
|
1869
|
-
resolve(to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved;
|
|
1870
|
-
/**
|
|
1871
|
-
* Programmatically navigate to a new URL by pushing an entry in the history
|
|
1872
|
-
* stack.
|
|
1873
|
-
*
|
|
1874
|
-
* @param to - Route location to navigate to
|
|
1875
|
-
*/
|
|
1876
|
-
push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
|
1877
|
-
/**
|
|
1878
|
-
* Programmatically navigate to a new URL by replacing the current entry in
|
|
1879
|
-
* the history stack.
|
|
1880
|
-
*
|
|
1881
|
-
* @param to - Route location to navigate to
|
|
1882
|
-
*/
|
|
1883
|
-
replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
|
|
1884
|
-
/**
|
|
1885
|
-
* Go back in history if possible by calling `history.back()`. Equivalent to
|
|
1886
|
-
* `router.go(-1)`.
|
|
1887
|
-
*/
|
|
1888
|
-
back(): void;
|
|
1889
|
-
/**
|
|
1890
|
-
* Go forward in history if possible by calling `history.forward()`.
|
|
1891
|
-
* Equivalent to `router.go(1)`.
|
|
1892
|
-
*/
|
|
1893
|
-
forward(): void;
|
|
1894
|
-
/**
|
|
1895
|
-
* Allows you to move forward or backward through the history. Calls
|
|
1896
|
-
* `history.go()`.
|
|
1897
|
-
*
|
|
1898
|
-
* @param delta - The position in the history to which you want to move,
|
|
1899
|
-
* relative to the current page
|
|
1900
|
-
*/
|
|
1901
|
-
go(delta: number): void;
|
|
1902
|
-
/**
|
|
1903
|
-
* Add a navigation guard that executes before any navigation. Returns a
|
|
1904
|
-
* function that removes the registered guard.
|
|
1905
|
-
*
|
|
1906
|
-
* @param guard - navigation guard to add
|
|
1907
|
-
*/
|
|
1908
|
-
beforeEach(guard: NavigationGuardWithThis<undefined>): () => void;
|
|
1909
|
-
/**
|
|
1910
|
-
* Add a navigation guard that executes before navigation is about to be
|
|
1911
|
-
* resolved. At this state all component have been fetched and other
|
|
1912
|
-
* navigation guards have been successful. Returns a function that removes the
|
|
1913
|
-
* registered guard.
|
|
1914
|
-
*
|
|
1915
|
-
* @param guard - navigation guard to add
|
|
1916
|
-
* @returns a function that removes the registered guard
|
|
1917
|
-
*
|
|
1918
|
-
* @example
|
|
1919
|
-
* ```js
|
|
1920
|
-
* router.beforeResolve(to => {
|
|
1921
|
-
* if (to.meta.requiresAuth && !isAuthenticated) return false
|
|
1922
|
-
* })
|
|
1923
|
-
* ```
|
|
1924
|
-
*
|
|
595
|
+
types?: TAsCellTypeComponents;
|
|
596
|
+
/** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
597
|
+
components?: Record<string, Component>;
|
|
598
|
+
/**
|
|
599
|
+
* Form-type → component dispatch map for the action-form dialog. Defaults to
|
|
600
|
+
* `createDefaultTypes()` from `@atscript/vue-form`.
|
|
1925
601
|
*/
|
|
1926
|
-
|
|
602
|
+
formTypes?: TAsTypeComponents;
|
|
603
|
+
/** Named form-component overrides for the action-form dialog. */
|
|
604
|
+
formComponents?: Record<string, Component>;
|
|
605
|
+
/** Whether to provide table context to the subtree (default: true). */
|
|
606
|
+
provideContext?: boolean;
|
|
1927
607
|
/**
|
|
1928
|
-
*
|
|
1929
|
-
*
|
|
1930
|
-
*
|
|
1931
|
-
* @param guard - navigation hook to add
|
|
1932
|
-
* @returns a function that removes the registered hook
|
|
1933
|
-
*
|
|
1934
|
-
* @example
|
|
1935
|
-
* ```js
|
|
1936
|
-
* router.afterEach((to, from, failure) => {
|
|
1937
|
-
* if (isNavigationFailure(failure)) {
|
|
1938
|
-
* console.log('failed navigation', failure)
|
|
1939
|
-
* }
|
|
1940
|
-
* })
|
|
1941
|
-
* ```
|
|
1942
|
-
*/
|
|
1943
|
-
afterEach(guard: NavigationHookAfter): () => void;
|
|
1944
|
-
/**
|
|
1945
|
-
* Adds an error handler that is called every time a non caught error happens
|
|
1946
|
-
* during navigation. This includes errors thrown synchronously and
|
|
1947
|
-
* asynchronously, errors returned or passed to `next` in any navigation
|
|
1948
|
-
* guard, and errors occurred when trying to resolve an async component that
|
|
1949
|
-
* is required to render a route.
|
|
1950
|
-
*
|
|
1951
|
-
* @param handler - error handler to register
|
|
608
|
+
* Refetch policy for `state.actions.invoke`. When `true` (default),
|
|
609
|
+
* successful `'backend'` / `'__remove'` invocations call `state.query()`.
|
|
1952
610
|
*/
|
|
1953
|
-
|
|
611
|
+
refreshOnAction?: () => boolean;
|
|
1954
612
|
/**
|
|
1955
|
-
*
|
|
1956
|
-
*
|
|
1957
|
-
*
|
|
1958
|
-
*
|
|
1959
|
-
*
|
|
1960
|
-
* This is useful in server-side rendering to ensure consistent output on both
|
|
1961
|
-
* the server and the client. Note that on server side, you need to manually
|
|
1962
|
-
* push the initial location while on client side, the router automatically
|
|
1963
|
-
* picks it up from the URL.
|
|
613
|
+
* Maps a navigate action's href before it is used as an anchor `href` /
|
|
614
|
+
* mod-click `window.open` target (e.g. `router.resolve(url).href` under a
|
|
615
|
+
* base path). Never applied on the plain-left-click invoke path. Default:
|
|
616
|
+
* identity.
|
|
1964
617
|
*/
|
|
1965
|
-
|
|
618
|
+
resolveHref?: (url: string) => string;
|
|
619
|
+
/** Bridge for `<AsTableRoot>`'s `@action` emit; see `TableActionsOptions.onResolved`. */
|
|
620
|
+
onActionResolved?: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent) => void;
|
|
1966
621
|
/**
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1971
|
-
* @param app - Application that uses the router
|
|
622
|
+
* Gate the initial `scheduleQuery("initial")` until this ref is `true`.
|
|
623
|
+
* `<AsTableRoot>` sets it `false` while it hydrates from `v-model:urlQuery`
|
|
624
|
+
* so the first fetch composes URL + defaults into one request. Omit when
|
|
625
|
+
* not using the URL bridge — the gate stays implicitly open.
|
|
1972
626
|
*/
|
|
1973
|
-
|
|
1974
|
-
}
|
|
1975
|
-
//#endregion
|
|
1976
|
-
//#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
|
|
1977
|
-
//#endregion
|
|
1978
|
-
//#region src/router.d.ts
|
|
1979
|
-
/**
|
|
1980
|
-
* Options to initialize a {@link Router} instance.
|
|
1981
|
-
*/
|
|
1982
|
-
interface RouterOptions extends EXPERIMENTAL_RouterOptions_Base {
|
|
627
|
+
urlQueryReady?: Ref<boolean>;
|
|
1983
628
|
/**
|
|
1984
|
-
*
|
|
629
|
+
* Called whenever a state mutation produces a new URL query string.
|
|
630
|
+
* Omitting it disables the URL emitter — the feature is opt-in.
|
|
1985
631
|
*/
|
|
1986
|
-
|
|
1987
|
-
}
|
|
1988
|
-
/**
|
|
1989
|
-
* Router instance.
|
|
1990
|
-
*/
|
|
1991
|
-
interface Router extends EXPERIMENTAL_Router_Base<RouteRecordNormalized> {
|
|
632
|
+
onUrlQueryChange?: (urlString: string) => void;
|
|
1992
633
|
/**
|
|
1993
|
-
*
|
|
634
|
+
* Per-aspect opt-in/out for the URL bridge — gate filters / sorters /
|
|
635
|
+
* search / pagination independently. Static; captured once at setup.
|
|
636
|
+
* Default (omitted): full sync.
|
|
1994
637
|
*/
|
|
1995
|
-
|
|
638
|
+
urlQuerySync?: UrlQuerySync;
|
|
1996
639
|
/**
|
|
1997
|
-
*
|
|
1998
|
-
*
|
|
1999
|
-
*
|
|
2000
|
-
* @param route - Route Record to add
|
|
640
|
+
* Receives each piece of a restored URL's filter that was left out because
|
|
641
|
+
* field filters cannot express it — see `TableQueryOptions.onUnsupportedFilter`.
|
|
642
|
+
* Since 0.1.139.
|
|
2001
643
|
*/
|
|
2002
|
-
|
|
644
|
+
onUnsupportedFilter?: (issue: UnsupportedFilter) => void;
|
|
2003
645
|
/**
|
|
2004
|
-
*
|
|
2005
|
-
*
|
|
2006
|
-
* @param route - Route Record to add
|
|
646
|
+
* Receives what the table left out because it names a field this caller
|
|
647
|
+
* cannot use — see `TableQueryOptions.onFieldsDropped`. Since 0.1.141.
|
|
2007
648
|
*/
|
|
2008
|
-
|
|
649
|
+
onFieldsDropped?: (report: DroppedFieldsReport) => void;
|
|
2009
650
|
/**
|
|
2010
|
-
*
|
|
2011
|
-
*
|
|
2012
|
-
*
|
|
651
|
+
* Preset feature config — opt-in. Omit to disable presets entirely
|
|
652
|
+
* (`<AsPresetPicker>` / `<AsPresetDialog>` render nothing). When set,
|
|
653
|
+
* `url` and `tableKey` are required.
|
|
2013
654
|
*/
|
|
2014
|
-
|
|
655
|
+
preset?: PresetConfig;
|
|
2015
656
|
/**
|
|
2016
|
-
*
|
|
657
|
+
* Client-owned columns merged into the server's column list — see
|
|
658
|
+
* {@link DisplayColumnDef}. Captured once at setup. Since 0.1.134.
|
|
2017
659
|
*/
|
|
2018
|
-
|
|
660
|
+
displayColumns?: readonly DisplayColumnDef[];
|
|
2019
661
|
}
|
|
2020
662
|
/**
|
|
2021
|
-
*
|
|
663
|
+
* Main entry composable for table setup.
|
|
2022
664
|
*
|
|
2023
|
-
* @param
|
|
665
|
+
* @param url — Table endpoint URL (e.g. "/db/tables/products")
|
|
2024
666
|
*/
|
|
667
|
+
declare function useTable(url: string, opts?: UseTableOptions): ReactiveTableState;
|
|
2025
668
|
//#endregion
|
|
2026
|
-
//#region src/
|
|
2027
|
-
|
|
669
|
+
//#region src/composables/use-table-export.d.ts
|
|
670
|
+
/** Per-cell formatter override. Return `undefined` to fall back to the default. */
|
|
671
|
+
type ExportCellFormatter = (value: unknown, column: ColumnDef, row: Record<string, unknown>) => ExportScalar | undefined;
|
|
672
|
+
interface ExportRowsOptions {
|
|
2028
673
|
/**
|
|
2029
|
-
*
|
|
674
|
+
* `'visible'` (default) exports the visible columns in their current display
|
|
675
|
+
* order, minus the client-owned ([display](/tables/customization)) ones —
|
|
676
|
+
* nothing on the server backs them, so they would export as an empty column
|
|
677
|
+
* unless a `formatters` entry fills them in. An array of column paths
|
|
678
|
+
* exports exactly those, in that order, display columns included.
|
|
2030
679
|
*/
|
|
2031
|
-
|
|
680
|
+
columns?: "visible" | string[];
|
|
681
|
+
/** `'csv'` (default) renders a CSV string; `'rows'` returns scalar arrays. */
|
|
682
|
+
format?: "csv" | "rows";
|
|
683
|
+
/** Rows per request while paging. Default 500. */
|
|
684
|
+
pageSize?: number;
|
|
685
|
+
/** Stop the run between pages; the promise rejects with an `AbortError`. */
|
|
686
|
+
signal?: AbortSignal;
|
|
687
|
+
/** Called after each settled page. `total` is the first page's `count`, when the endpoint reports one. */
|
|
688
|
+
onProgress?: (done: number, total?: number) => void;
|
|
689
|
+
/** Global cell formatter, applied to every column that has no `formatters` entry. */
|
|
690
|
+
formatCell?: ExportCellFormatter;
|
|
691
|
+
/** Per-column formatters keyed by column path. Win over `formatCell`. */
|
|
692
|
+
formatters?: Record<string, ExportCellFormatter>;
|
|
693
|
+
/** File name for `format: 'csv'`. `.csv` is appended when missing. Default `"export.csv"`. */
|
|
694
|
+
filename?: string;
|
|
2032
695
|
/**
|
|
2033
|
-
*
|
|
696
|
+
* CSV writer settings — `bom`, `escapeFormulas`, `delimiter`. Ignored by
|
|
697
|
+
* `format: 'rows'`.
|
|
2034
698
|
*/
|
|
2035
|
-
|
|
699
|
+
csv?: CsvOptions;
|
|
700
|
+
/** Hard ceiling on exported rows. */
|
|
701
|
+
maxRows?: number;
|
|
2036
702
|
}
|
|
2037
|
-
interface
|
|
2038
|
-
/**
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
activeClass?: string;
|
|
2047
|
-
/**
|
|
2048
|
-
* Class to apply when the link is exact active
|
|
2049
|
-
*/
|
|
2050
|
-
exactActiveClass?: string;
|
|
2051
|
-
/**
|
|
2052
|
-
* Value passed to the attribute `aria-current` when the link is exact active.
|
|
2053
|
-
*
|
|
2054
|
-
* @defaultValue `'page'`
|
|
2055
|
-
*/
|
|
2056
|
-
ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
|
|
2057
|
-
/**
|
|
2058
|
-
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
|
|
2059
|
-
*/
|
|
2060
|
-
viewTransition?: boolean;
|
|
703
|
+
interface ExportResultBase {
|
|
704
|
+
/** Header labels, in export order. */
|
|
705
|
+
columns: string[];
|
|
706
|
+
/** Column paths, in export order. */
|
|
707
|
+
columnPaths: string[];
|
|
708
|
+
/** How many data rows the run collected. */
|
|
709
|
+
rowCount: number;
|
|
710
|
+
/** Total the endpoint reported for the query, when it reported one. */
|
|
711
|
+
total?: number;
|
|
2061
712
|
}
|
|
2062
|
-
/**
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
713
|
+
/** A finished export. `format` discriminates the payload. */
|
|
714
|
+
type ExportResult = (ExportResultBase & {
|
|
715
|
+
format: "csv";
|
|
716
|
+
csv: string;
|
|
717
|
+
filename: string;
|
|
718
|
+
}) | (ExportResultBase & {
|
|
719
|
+
format: "rows";
|
|
720
|
+
rows: ExportScalar[][];
|
|
721
|
+
});
|
|
722
|
+
/** Progress of the run in flight: rows collected so far, and the reported total. */
|
|
723
|
+
interface ExportProgress {
|
|
724
|
+
done: number;
|
|
725
|
+
total?: number;
|
|
726
|
+
}
|
|
727
|
+
interface UseTableExportReturn {
|
|
2068
728
|
/**
|
|
2069
|
-
*
|
|
729
|
+
* Run an export against the table's CURRENT query. Rejects when a run is
|
|
730
|
+
* already in flight — one handle runs one export at a time.
|
|
2070
731
|
*/
|
|
2071
|
-
|
|
732
|
+
exportRows: (opts?: ExportRowsOptions) => Promise<ExportResult>;
|
|
733
|
+
/** `true` while an `exportRows` call is in flight. */
|
|
734
|
+
exporting: ComputedRef<boolean>;
|
|
735
|
+
/** Progress of the in-flight run, or `null` while idle. */
|
|
736
|
+
progress: Ref<ExportProgress | null>;
|
|
2072
737
|
}
|
|
2073
738
|
/**
|
|
2074
|
-
*
|
|
2075
|
-
*
|
|
739
|
+
* Export the table's data as it is queried right now.
|
|
740
|
+
*
|
|
741
|
+
* The export snapshots the table's own query at call time — the same filters,
|
|
742
|
+
* sorters, search term, force-filters and `$select` projection the on-screen
|
|
743
|
+
* fetch uses (`state.buildQuery()`), through the same fetch path
|
|
744
|
+
* (`state.fetchPage()`, so a custom `queryFn` is honoured) — then pages
|
|
745
|
+
* through every result instead of one page. The primary key(s) are appended
|
|
746
|
+
* to the sort as a tiebreaker so pages never overlap or skip.
|
|
747
|
+
*
|
|
748
|
+
* Values come out of the same column metadata the cells read: union/enum keys
|
|
749
|
+
* become their labels, dates become ISO strings, arrays join. Override per
|
|
750
|
+
* column with `formatters`, or globally with `formatCell`.
|
|
751
|
+
*
|
|
752
|
+
* ```ts
|
|
753
|
+
* const { exportRows } = useTableExport()
|
|
754
|
+
* downloadExport(await exportRows({ filename: "orders.csv", csv: { bom: true } }))
|
|
755
|
+
* ```
|
|
756
|
+
*
|
|
757
|
+
* Since 0.1.134.
|
|
2076
758
|
*/
|
|
2077
|
-
|
|
2078
|
-
route: ComputedRef<RouteLocationResolved<Name>>;
|
|
2079
|
-
href: ComputedRef<string>;
|
|
2080
|
-
isActive: ComputedRef<boolean>;
|
|
2081
|
-
isExactActive: ComputedRef<boolean>;
|
|
2082
|
-
navigate(e?: MouseEvent): Promise<void | NavigationFailure>;
|
|
2083
|
-
}
|
|
759
|
+
declare function useTableExport(ctx?: TableContext): UseTableExportReturn;
|
|
2084
760
|
/**
|
|
2085
|
-
*
|
|
761
|
+
* Hand a finished CSV export to the browser as a file download. Returns
|
|
762
|
+
* `false` without doing anything when there is no DOM (SSR / a worker), so a
|
|
763
|
+
* server render can call it unguarded.
|
|
2086
764
|
*
|
|
2087
|
-
*
|
|
765
|
+
* Since 0.1.134.
|
|
2088
766
|
*/
|
|
2089
|
-
declare function
|
|
767
|
+
declare function downloadExport(result: ExportResult): boolean;
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/composables/use-table-nav-bridge.d.ts
|
|
770
|
+
interface UseTableNavBridgeOptions extends Omit<NavKeyOptions, "mode"> {
|
|
771
|
+
/**
|
|
772
|
+
* Selection mode source. Pass a function (`() => selectMode.value`) so
|
|
773
|
+
* the bridge re-reads on every dispatch — Enter semantics depend on mode,
|
|
774
|
+
* but selection mode lives on the renderer's `:select` prop, not state.
|
|
775
|
+
* Default `"none"` (Enter only fires main-action).
|
|
776
|
+
*/
|
|
777
|
+
mode?: SelectionMode | (() => SelectionMode);
|
|
778
|
+
}
|
|
2090
779
|
/**
|
|
2091
|
-
*
|
|
780
|
+
* Construct a keyboard-bridge for an external `<input>` to drive table nav
|
|
781
|
+
* without losing focus. Without args, injects the nearest `<as-table-root>`
|
|
782
|
+
* context's state. With an explicit `state`, binds to that state. With
|
|
783
|
+
* `opts.enterAction`, the returned bridge's `onKeydown` defaults to that
|
|
784
|
+
* enter-action (per-call options still win).
|
|
785
|
+
*
|
|
786
|
+
* Each call returns a fresh bridge object — callers that need stable
|
|
787
|
+
* identity should bind once at setup and reuse the binding.
|
|
2092
788
|
*/
|
|
2093
|
-
declare
|
|
789
|
+
declare function useTableNavBridge(state?: ReactiveTableState, opts?: UseTableNavBridgeOptions): TableNavBridge;
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region src/composables/use-table-filter.d.ts
|
|
2094
792
|
/**
|
|
2095
|
-
*
|
|
793
|
+
* Per-field filter state composable.
|
|
794
|
+
*
|
|
795
|
+
* Creates a working copy of filter conditions (cancel-safe dialog model).
|
|
796
|
+
* Call `apply()` to commit, `reset()` to revert, `clear()` to remove.
|
|
797
|
+
*
|
|
798
|
+
* Accepts `state` directly rather than injecting — safe to call outside `setup`.
|
|
2096
799
|
*/
|
|
2097
|
-
|
|
800
|
+
declare function useTableFilter(column: ColumnDef, state: ReactiveTableState): {
|
|
801
|
+
filterType: _atscript_ui_table0.ColumnFilterType;
|
|
802
|
+
availableConditions: readonly _atscript_ui_table0.FilterConditionType[];
|
|
803
|
+
defaultCondition: _atscript_ui_table0.FilterConditionType;
|
|
804
|
+
conditions: vue.Ref<{
|
|
805
|
+
type: _atscript_ui_table0.FilterConditionType;
|
|
806
|
+
value: (string | number | boolean)[];
|
|
807
|
+
}[], FilterCondition[] | {
|
|
808
|
+
type: _atscript_ui_table0.FilterConditionType;
|
|
809
|
+
value: (string | number | boolean)[];
|
|
810
|
+
}[]>;
|
|
811
|
+
filledCount: vue.ComputedRef<number>;
|
|
812
|
+
addCondition: () => void;
|
|
813
|
+
removeCondition: (index: number) => void;
|
|
814
|
+
updateCondition: (index: number, update: Partial<FilterCondition>) => void;
|
|
815
|
+
apply: () => void;
|
|
816
|
+
clear: () => void;
|
|
817
|
+
reset: () => void;
|
|
818
|
+
};
|
|
819
|
+
//#endregion
|
|
820
|
+
//#region src/composables/use-table-search.d.ts
|
|
2098
821
|
/**
|
|
2099
|
-
*
|
|
822
|
+
* Convenience composable for wiring a search input to the table.
|
|
823
|
+
* Must be called inside an `<AsTableRoot>` subtree.
|
|
824
|
+
*
|
|
825
|
+
* Returns the reactive `searchTerm` ref and an `onSearchInput` handler.
|
|
826
|
+
* The central filter/search watcher debounces the auto-query.
|
|
2100
827
|
*/
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
828
|
+
declare function useTableSearch(): {
|
|
829
|
+
searchTerm: vue.Ref<string, string>;
|
|
830
|
+
onSearchInput: (event: Event) => void;
|
|
831
|
+
};
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region src/composables/use-table-actions.d.ts
|
|
2106
834
|
/**
|
|
2107
|
-
*
|
|
2108
|
-
*
|
|
835
|
+
* Inject the table-actions namespace from the closest `<AsTableRoot>` ancestor.
|
|
836
|
+
* Returns `state.actions` directly — no wrapping. Throws when called outside
|
|
837
|
+
* the provider tree (delegated to `useTableContext`).
|
|
2109
838
|
*
|
|
2110
|
-
*
|
|
839
|
+
* Useful for consumers that want the model without the chrome (custom
|
|
840
|
+
* toolbars, headless action buttons, programmatic invoke).
|
|
2111
841
|
*/
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
$slots: {
|
|
2116
|
-
default?: ({
|
|
2117
|
-
route,
|
|
2118
|
-
href,
|
|
2119
|
-
isActive,
|
|
2120
|
-
isExactActive,
|
|
2121
|
-
navigate
|
|
2122
|
-
}: UnwrapRef<UseLinkReturn>) => VNode[];
|
|
2123
|
-
};
|
|
2124
|
-
};
|
|
2125
|
-
/**
|
|
2126
|
-
* Access to `useLink()` without depending on using vue-router
|
|
2127
|
-
*
|
|
2128
|
-
* @internal
|
|
2129
|
-
*/
|
|
2130
|
-
useLink: typeof useLink;
|
|
2131
|
-
} //#endregion
|
|
2132
|
-
//#region src/RouterView.d.ts
|
|
2133
|
-
interface RouterViewProps {
|
|
2134
|
-
name?: string;
|
|
2135
|
-
route?: RouteLocationNormalized;
|
|
2136
|
-
}
|
|
842
|
+
declare function useTableActions(): TableActionsState;
|
|
843
|
+
//#endregion
|
|
844
|
+
//#region src/composables/use-table-url-query.d.ts
|
|
2137
845
|
/**
|
|
2138
|
-
*
|
|
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
|
|
2139
849
|
*/
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
$slots: {
|
|
2144
|
-
default?: ({
|
|
2145
|
-
Component,
|
|
2146
|
-
route
|
|
2147
|
-
}: {
|
|
2148
|
-
Component: VNode;
|
|
2149
|
-
route: RouteLocationNormalizedLoaded;
|
|
2150
|
-
}) => VNode[];
|
|
2151
|
-
};
|
|
2152
|
-
};
|
|
2153
|
-
}; //#endregion
|
|
2154
|
-
//#region src/useApi.d.ts
|
|
850
|
+
interface TableUrlQueryRoute {
|
|
851
|
+
readonly query: UrlQueryRecordInput;
|
|
852
|
+
}
|
|
2155
853
|
/**
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
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
|
|
2158
859
|
*/
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
* is even mounted.
|
|
2169
|
-
*
|
|
2170
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2171
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2172
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2173
|
-
* navigation
|
|
2174
|
-
*/
|
|
2175
|
-
beforeRouteEnter?: TypesConfig extends Record<'beforeRouteEnter', infer T> ? T : NavigationGuardWithThis<undefined>;
|
|
2176
|
-
/**
|
|
2177
|
-
* Guard called whenever the route that renders this component has changed, but
|
|
2178
|
-
* it is reused for the new route. This allows you to guard for changes in
|
|
2179
|
-
* params, the query or the hash.
|
|
2180
|
-
*
|
|
2181
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2182
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2183
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2184
|
-
* navigation
|
|
2185
|
-
*/
|
|
2186
|
-
beforeRouteUpdate?: TypesConfig extends Record<'beforeRouteUpdate', infer T> ? T : NavigationGuard;
|
|
2187
|
-
/**
|
|
2188
|
-
* Guard called when the router is navigating away from the current route that
|
|
2189
|
-
* is rendering this component.
|
|
2190
|
-
*
|
|
2191
|
-
* @param to - RouteLocationRaw we are navigating to
|
|
2192
|
-
* @param from - RouteLocationRaw we are navigating from
|
|
2193
|
-
* @param next - function to validate, cancel or modify (by redirecting) the
|
|
2194
|
-
* navigation
|
|
2195
|
-
*/
|
|
2196
|
-
beforeRouteLeave?: TypesConfig extends Record<'beforeRouteLeave', infer T> ? T : NavigationGuard;
|
|
2197
|
-
}
|
|
2198
|
-
interface ComponentCustomProperties {
|
|
2199
|
-
/**
|
|
2200
|
-
* Normalized current location. See {@link RouteLocationNormalizedLoaded}.
|
|
2201
|
-
*/
|
|
2202
|
-
$route: TypesConfig extends Record<'$route', infer T> ? T : RouteLocationNormalizedLoaded;
|
|
2203
|
-
/**
|
|
2204
|
-
* {@link Router} instance used by the application.
|
|
2205
|
-
*/
|
|
2206
|
-
$router: TypesConfig extends Record<'$router', infer T> ? T : Router;
|
|
2207
|
-
}
|
|
2208
|
-
interface GlobalComponents {
|
|
2209
|
-
RouterView: TypesConfig extends Record<'RouterView', infer T> ? T : typeof RouterView;
|
|
2210
|
-
RouterLink: TypesConfig extends Record<'RouterLink', infer T> ? T : typeof RouterLink;
|
|
2211
|
-
}
|
|
2212
|
-
} //#endregion
|
|
2213
|
-
//#endregion
|
|
2214
|
-
//#region src/composables/use-table-url-query.d.ts
|
|
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
|
+
}
|
|
2215
869
|
/** Options for {@link useTableUrlQuery}. */
|
|
2216
870
|
interface UseTableUrlQueryOptions {
|
|
2217
871
|
/**
|
|
@@ -2232,12 +886,22 @@ interface UseTableUrlQueryOptions {
|
|
|
2232
886
|
* so two tables can share one route. Since 0.1.133.
|
|
2233
887
|
*/
|
|
2234
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"];
|
|
2235
899
|
}
|
|
2236
900
|
/**
|
|
2237
|
-
* Bridge `<AsTableRoot v-model:url-query>` to
|
|
2238
|
-
*
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
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.
|
|
2241
905
|
*
|
|
2242
906
|
* Scope: the bridge owns **only what the table reads back** (since 0.1.133).
|
|
2243
907
|
* A key is the table's iff `urlQueryStringToState` would consume it — see
|
|
@@ -2249,10 +913,11 @@ interface UseTableUrlQueryOptions {
|
|
|
2249
913
|
* written as one block in the table's order.
|
|
2250
914
|
*
|
|
2251
915
|
* Without a `prefix` the bridge cannot tell a plain `field=value` filter from
|
|
2252
|
-
* a page-owned flag of the same shape
|
|
2253
|
-
*
|
|
2254
|
-
*
|
|
2255
|
-
*
|
|
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.
|
|
2256
921
|
*
|
|
2257
922
|
* @example
|
|
2258
923
|
* ```vue
|
|
@@ -2269,7 +934,7 @@ interface UseTableUrlQueryOptions {
|
|
|
2269
934
|
* </template>
|
|
2270
935
|
* ```
|
|
2271
936
|
*/
|
|
2272
|
-
declare function useTableUrlQuery(route:
|
|
937
|
+
declare function useTableUrlQuery(route: TableUrlQueryRoute, router: TableUrlQueryRouter, opts?: UseTableUrlQueryOptions): WritableComputedRef<string>;
|
|
2273
938
|
//#endregion
|
|
2274
939
|
//#region src/composables/as-presets-app.d.ts
|
|
2275
940
|
/**
|
|
@@ -2363,7 +1028,7 @@ declare function useAppPrefs(opts: UseAppPrefsOptions): UseAppPrefsReturn;
|
|
|
2363
1028
|
* falling back to the default. Safe to call outside a table context (e.g.
|
|
2364
1029
|
* a default mounted standalone in tests) — the fallback is returned.
|
|
2365
1030
|
*/
|
|
2366
|
-
declare function useTableComponent<K extends keyof TAsTableControls>(key: K, fallback: Component
|
|
1031
|
+
declare function useTableComponent<K extends keyof TAsTableControls>(key: K, fallback: Component): Component;
|
|
2367
1032
|
//#endregion
|
|
2368
1033
|
//#region src/components/as-table.vue.d.ts
|
|
2369
1034
|
type __VLS_Props$2 = {
|
|
@@ -2464,12 +1129,12 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {}, {}, {}, {}, v
|
|
|
2464
1129
|
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
2465
1130
|
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
2466
1131
|
}>, {
|
|
2467
|
-
select: SelectionMode;
|
|
2468
1132
|
stickyHeader: boolean;
|
|
2469
1133
|
virtualOverscan: number;
|
|
2470
1134
|
reorderable: boolean;
|
|
2471
1135
|
resizable: boolean;
|
|
2472
1136
|
columnMinWidth: number;
|
|
1137
|
+
select: SelectionMode;
|
|
2473
1138
|
selectOn: SelectOn;
|
|
2474
1139
|
rowDelete: boolean | RowDeleteOpt;
|
|
2475
1140
|
rowActionsColumn: RowActionsColumnPlacement | false;
|
|
@@ -2601,10 +1266,10 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, v
|
|
|
2601
1266
|
"onMain-action"?: ((row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
2602
1267
|
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
2603
1268
|
}>, {
|
|
2604
|
-
select: SelectionMode;
|
|
2605
1269
|
reorderable: boolean;
|
|
2606
1270
|
resizable: boolean;
|
|
2607
1271
|
columnMinWidth: number;
|
|
1272
|
+
select: SelectionMode;
|
|
2608
1273
|
selectOn: SelectOn;
|
|
2609
1274
|
rowDelete: boolean | RowDeleteOpt;
|
|
2610
1275
|
rowActionsColumn: RowActionsColumnPlacement | false;
|
|
@@ -2719,24 +1384,34 @@ type __VLS_Props = {
|
|
|
2719
1384
|
clientFactory?: ClientFactory; /** Skin-slot overrides for table chrome — header cells, filter dialog, column menu, etc. Use {@link createDefaultControls} to seed defaults. */
|
|
2720
1385
|
controls?: TAsTableControls; /** Cell-type → component dispatch map. Use {@link createDefaultCellTypes} to seed defaults. */
|
|
2721
1386
|
types?: TAsCellTypeComponents; /** Named cell-component overrides — looked up by `@ui.table.component "name"`. */
|
|
2722
|
-
components?: Record<string, Component
|
|
1387
|
+
components?: Record<string, Component>;
|
|
2723
1388
|
/**
|
|
2724
1389
|
* Form-type → component dispatch map for the built-in action-form dialog.
|
|
2725
1390
|
* Defaults to `createDefaultTypes()` from `@atscript/vue-form`.
|
|
2726
1391
|
*/
|
|
2727
1392
|
formTypes?: TAsTypeComponents; /** Named form-component overrides for the action-form dialog. */
|
|
2728
|
-
formComponents?: Record<string, Component
|
|
1393
|
+
formComponents?: Record<string, Component>;
|
|
2729
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;
|
|
2730
1402
|
/**
|
|
2731
1403
|
* Always-applied filter. App-authored: unlike presets and URLs it is
|
|
2732
1404
|
* never pruned of fields the caller cannot see — keep it to fields every
|
|
2733
|
-
* 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.
|
|
2734
1409
|
*/
|
|
2735
|
-
forceFilters?: FilterExpr; /** Always-applied sorters. Never pruned, like `forceFilters`. */
|
|
1410
|
+
forceFilters?: FilterExpr; /** Always-applied sorters. Never pruned, like `forceFilters`. Live; keeps the page. */
|
|
2736
1411
|
forceSorters?: SortControl[];
|
|
2737
1412
|
/**
|
|
2738
1413
|
* Leaf field paths always added to `$select` (deduped, gated by available
|
|
2739
|
-
* meta), regardless of which columns are visible. Additive only.
|
|
1414
|
+
* meta), regardless of which columns are visible. Additive only. Live.
|
|
2740
1415
|
*/
|
|
2741
1416
|
alwaysSelected?: string[];
|
|
2742
1417
|
queryOnMount?: boolean;
|
|
@@ -2878,14 +1553,14 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
|
|
|
2878
1553
|
"update:querySelection": (value: QuerySelection | null) => any;
|
|
2879
1554
|
"update:urlQuery": (value: string | undefined) => any;
|
|
2880
1555
|
} & {
|
|
2881
|
-
action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
|
|
2882
1556
|
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
1557
|
+
action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
|
|
2883
1558
|
"unsupported-filter": (issue: UnsupportedFilter) => any;
|
|
2884
1559
|
"selection-reset": (event: SelectionResetEvent) => any;
|
|
2885
1560
|
"fields-dropped": (report: DroppedFieldsReport) => any;
|
|
2886
1561
|
}, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
2887
|
-
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
|
|
2888
1562
|
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
1563
|
+
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
|
|
2889
1564
|
"onUnsupported-filter"?: ((issue: UnsupportedFilter) => any) | undefined;
|
|
2890
1565
|
"onSelection-reset"?: ((event: SelectionResetEvent) => any) | undefined;
|
|
2891
1566
|
"onFields-dropped"?: ((report: DroppedFieldsReport) => any) | undefined;
|
|
@@ -2911,4 +1586,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
2911
1586
|
};
|
|
2912
1587
|
};
|
|
2913
1588
|
//#endregion
|
|
2914
|
-
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 };
|