@atscript/vue-table 0.1.141 → 0.1.142
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-AKbIp4Ni.cjs → as-action-menu-content-BaNFBYn3.cjs} +1 -1
- package/dist/{as-action-menu-content-6dR5q8bs.mjs → as-action-menu-content-miQYVP7x.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-DapdB_qF.d.cts → as-column-menu.vue-Ca3wSDxw.d.mts} +2 -2
- package/dist/{as-column-menu.vue-Ys_sx0VE.d.mts → as-column-menu.vue-Co7FtiEM.d.cts} +2 -2
- package/dist/{as-config-dialog-Chpw_2tu.cjs → as-config-dialog-CVSOrS9O.cjs} +2 -2
- package/dist/{as-config-dialog-UeMU7jTP.mjs → as-config-dialog-Di02V3bs.mjs} +2 -2
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-SIqCOw2p.mjs → as-confirm-dialog-C9Qat2rG.mjs} +1 -1
- package/dist/{as-confirm-dialog-hHYVEX9E.cjs → as-confirm-dialog-fCwo1ty9.cjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-Xvj5q09A.cjs → as-filter-dialog-DYpbsNDx.cjs} +7 -7
- package/dist/{as-filter-dialog-DVRhCx6O.mjs → as-filter-dialog-DdtrTT5w.mjs} +7 -7
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-B7b2sEG0.cjs → as-filter-field-4-qFRsJx.cjs} +8 -10
- package/dist/{as-filter-field-D4vQCOEU.mjs → as-filter-field-DEQVodKG.mjs} +8 -10
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/{as-filters-CWQgQBCH.cjs → as-filters-C6ZkLrf4.cjs} +68 -25
- package/dist/{as-filters-CudeInPr.mjs → as-filters-Dd_j6_6G.mjs} +69 -26
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.d.cts +1 -1
- package/dist/as-filters.d.mts +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-filters.vue-BSgUEh4D.d.mts → as-filters.vue-dHbGmcbr.d.mts} +56 -4
- package/dist/{as-filters.vue-DMXZhQW3.d.cts → as-filters.vue-vH1FHn9L.d.cts} +56 -4
- package/dist/{as-preset-dialog-BsWSuY9N.mjs → as-preset-dialog-Bap48oUv.mjs} +1 -1
- package/dist/{as-preset-dialog-l81WXBmf.cjs → as-preset-dialog-SYA-6lGR.cjs} +1 -1
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-Bp4xMTua.cjs → as-preset-picker-BdKTZa95.cjs} +1 -1
- package/dist/{as-preset-picker-BTkMqSxH.mjs → as-preset-picker-NBrvsE6s.mjs} +1 -1
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-residual-filter-D1SGFQ1p.mjs → as-residual-filter-BFnbI3h3.mjs} +1 -1
- package/dist/{as-residual-filter-BJ4cwFP4.cjs → as-residual-filter-CZ-Bytdj.cjs} +1 -1
- package/dist/as-residual-filter.cjs +1 -1
- package/dist/as-residual-filter.mjs +1 -1
- package/dist/{as-row-actions-9p_BJPga.cjs → as-row-actions-C3xHkX53.cjs} +2 -2
- package/dist/{as-row-actions-CH8WZ5kN.mjs → as-row-actions-KeoHo9Ex.mjs} +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-BezMFOr6.d.cts → as-row-actions.vue-D3_z3ytk.d.cts} +1 -1
- package/dist/{as-row-actions.vue-BOURuyjv.d.mts → as-row-actions.vue-nmaDuxBT.d.mts} +1 -1
- package/dist/{as-table-status-Bl9XmWqc.mjs → as-select-cell-KD_ns8DS.mjs} +149 -36
- package/dist/{as-table-status-bbuFDaaK.cjs → as-select-cell-XnzNuW2v.cjs} +154 -35
- package/dist/{as-table-DmmXWq94.mjs → as-table-NHqyekNd.mjs} +10 -11
- package/dist/{as-table-actions-CFBAxKIS.mjs → as-table-actions-BpEFcsgh.mjs} +2 -2
- package/dist/{as-table-actions-oxVqSH-G.cjs → as-table-actions-UQmFtRdJ.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-CrZtcxAY.d.mts → as-table-actions.vue-BG3JVaBQ.d.mts} +2 -2
- package/dist/{as-table-actions.vue-Dls_1Vze.d.cts → as-table-actions.vue-DcuzNZoC.d.cts} +2 -2
- package/dist/{as-table-fOBpTDrI.cjs → as-table-ay1yel3u.cjs} +10 -11
- package/dist/{as-table-base-Cl1XJu4H.mjs → as-table-base-89DkDZ-1.mjs} +46 -60
- package/dist/{as-table-base--MfU8LVN.cjs → as-table-base-umzg4PBR.cjs} +51 -65
- package/dist/{as-table-header-cell-M8g9X9dR.mjs → as-table-header-cell-DU3ws2x9.mjs} +1 -1
- package/dist/{as-table-header-cell-10DQEs00.cjs → as-table-header-cell-f3YpgJX1.cjs} +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-D-iI_EJY.d.cts → as-table-header-cell.vue-5VGRc23o.d.mts} +2 -2
- package/dist/{as-table-header-cell.vue-SMBpzqU2.d.mts → as-table-header-cell.vue-XR90UlHO.d.cts} +2 -2
- package/dist/{as-table-root-Bl423S7X.mjs → as-table-root-47hiBEnq.mjs} +4 -4
- package/dist/{as-table-root-CGXKfCIk.cjs → as-table-root-DDeGktcl.cjs} +4 -4
- 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-BROdsTqv.d.mts → as-table-root.vue-BGx453_Q.d.mts} +5 -5
- package/dist/{as-table-root.vue-D5H8uXFK.d.cts → as-table-root.vue-yZ7ZcwdT.d.cts} +7 -7
- 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-table.vue-B_7Y82yW.d.mts → as-table.vue-CwI5Z0y5.d.cts} +10 -8
- package/dist/{as-table.vue-B533pYs6.d.cts → as-table.vue-wdFf4hMW.d.mts} +10 -8
- package/dist/{as-window-table-CkTJOvu9.mjs → as-window-table-C312T_bc.mjs} +83 -62
- package/dist/{as-window-table-Dpbezh9D.cjs → as-window-table-hOYLNhX3.cjs} +89 -68
- 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/{as-window-table.vue-Bar8mWRL.d.cts → as-window-table.vue-D6UDA6td.d.cts} +6 -4
- package/dist/{as-window-table.vue-OL4KC7Y-.d.mts → as-window-table.vue-Deg1mj3t.d.mts} +6 -4
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +10 -10
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +18 -18
- package/dist/{types-Cdk5OH1-.d.cts → types-BU7J-a1r.d.mts} +41 -9
- package/dist/{types-Ev-A5h_D.d.mts → types-D4dK49sA.d.cts} +41 -9
- package/dist/{use-table-BG3IZyCO.mjs → use-table-DlqGHjPh.mjs} +1 -1
- package/dist/{use-table-column-handlers-CaT7dYnI.mjs → use-table-column-handlers-0myVzrZR.mjs} +1 -1
- package/dist/{use-table-column-handlers-CWHRcQbE.cjs → use-table-column-handlers-BHMCo_HR.cjs} +1 -1
- package/dist/{use-table-component-Tc_ZvZua.cjs → use-table-component-IziAm0vk.cjs} +1 -1
- package/dist/{use-table-component-OTdgA202.mjs → use-table-component-TLwFq4rx.mjs} +1 -1
- package/dist/{use-table-nav-bridge-BNjwR3qy.mjs → use-table-nav-bridge-CkQqimdS.mjs} +1 -1
- package/dist/{use-table-nav-bridge-ByQo00IH.cjs → use-table-nav-bridge-QU4jKhqx.cjs} +1 -1
- package/dist/{use-table-state-CgXY-ruN.cjs → use-table-state-BiklfjP0.cjs} +79 -28
- package/dist/{use-table-state-BgLIOO31.mjs → use-table-state-Cq-3tbVr.mjs} +69 -30
- package/dist/{use-table-rc6_sYU6.cjs → use-table-yZNJTfRq.cjs} +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as useTableContext, j as ROW_ACTIONS_TYPE, n as createTableState, o as useTableContextOptional, r as provideTableContext, t as createStaticTableState, w as extractIdentifier } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
import { t as getCellValue } from "./get-cell-value-Cb3X8nUn.mjs";
|
|
3
3
|
import { n as useTableSelection } from "./use-table-selection-ULbKT2xW.mjs";
|
|
4
|
-
import { a as useLocalDraft, i as usePresets, o as AS_PRESETS_APP, r as useTable, s as injectPresetsApp, t as clearTableCache } from "./use-table-
|
|
5
|
-
import { t as useTableNavBridge } from "./use-table-nav-bridge-
|
|
6
|
-
import { t as useTableComponent } from "./use-table-component-
|
|
4
|
+
import { a as useLocalDraft, i as usePresets, o as AS_PRESETS_APP, r as useTable, s as injectPresetsApp, t as clearTableCache } from "./use-table-DlqGHjPh.mjs";
|
|
5
|
+
import { t as useTableNavBridge } from "./use-table-nav-bridge-CkQqimdS.mjs";
|
|
6
|
+
import { t as useTableComponent } from "./use-table-component-TLwFq4rx.mjs";
|
|
7
7
|
import { t as as_cell_array_default } from "./as-cell-array-Bgc4GYZf.mjs";
|
|
8
8
|
import { t as as_cell_date_default } from "./as-cell-date-B9mu0OOD.mjs";
|
|
9
9
|
import { n as useCellLocale, t as provideCellLocale } from "./use-cell-locale-MQXoONh5.mjs";
|
|
@@ -12,22 +12,22 @@ import { t as as_cell_number_default } from "./as-cell-number-CNDT6gfw.mjs";
|
|
|
12
12
|
import { t as formatCellValue } from "./format-cell-D1Ziv96Q.mjs";
|
|
13
13
|
import { t as as_cell_union_default } from "./as-cell-union-DMnoa7RM.mjs";
|
|
14
14
|
import { t as as_column_menu_default } from "./as-column-menu-CBtUfYEE.mjs";
|
|
15
|
-
import { t as as_config_dialog_default } from "./as-config-dialog-
|
|
16
|
-
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-
|
|
15
|
+
import { t as as_config_dialog_default } from "./as-config-dialog-Di02V3bs.mjs";
|
|
16
|
+
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-C9Qat2rG.mjs";
|
|
17
17
|
import { t as as_filter_input_default } from "./as-filter-input-BM23TNeh.mjs";
|
|
18
|
-
import { t as as_filter_dialog_default } from "./as-filter-dialog-
|
|
19
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
20
|
-
import { t as as_window_table_default } from "./as-window-table-
|
|
21
|
-
import { t as as_filter_field_default } from "./as-filter-field-
|
|
22
|
-
import { t as as_residual_filter_default } from "./as-residual-filter-
|
|
23
|
-
import { t as as_filters_default } from "./as-filters-
|
|
24
|
-
import { t as as_preset_dialog_default } from "./as-preset-dialog-
|
|
25
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
18
|
+
import { t as as_filter_dialog_default } from "./as-filter-dialog-DdtrTT5w.mjs";
|
|
19
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-DU3ws2x9.mjs";
|
|
20
|
+
import { t as as_window_table_default } from "./as-window-table-C312T_bc.mjs";
|
|
21
|
+
import { t as as_filter_field_default } from "./as-filter-field-DEQVodKG.mjs";
|
|
22
|
+
import { t as as_residual_filter_default } from "./as-residual-filter-BFnbI3h3.mjs";
|
|
23
|
+
import { t as as_filters_default } from "./as-filters-Dd_j6_6G.mjs";
|
|
24
|
+
import { t as as_preset_dialog_default } from "./as-preset-dialog-Bap48oUv.mjs";
|
|
25
|
+
import { t as as_row_actions_default } from "./as-row-actions-KeoHo9Ex.mjs";
|
|
26
26
|
import { t as as_table_cell_value_default } from "./as-table-cell-value-DoH8Mieo.mjs";
|
|
27
|
-
import { t as as_table_root_default } from "./as-table-root-
|
|
28
|
-
import { t as as_table_default } from "./as-table-
|
|
29
|
-
import { t as as_table_actions_default } from "./as-table-actions-
|
|
30
|
-
import { t as as_preset_picker_default } from "./as-preset-picker-
|
|
27
|
+
import { t as as_table_root_default } from "./as-table-root-47hiBEnq.mjs";
|
|
28
|
+
import { t as as_table_default } from "./as-table-NHqyekNd.mjs";
|
|
29
|
+
import { t as as_table_actions_default } from "./as-table-actions-BpEFcsgh.mjs";
|
|
30
|
+
import { t as as_preset_picker_default } from "./as-preset-picker-NBrvsE6s.mjs";
|
|
31
31
|
import { getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
32
32
|
import { computed, effectScope, ref, shallowRef } from "vue";
|
|
33
33
|
import { AppPrefsClient, ExportAbortError, PRESET_ASPECTS, STANDARD_PRESET_ID, SYSTEM_PRESET_PREFIX, collectExportRows, columnDefaultCondition, columnFilterConditions, columnFilterType, isFilled, isSystemPresetId, isUnavailableError, resolveExportValue, resolveSystemPresets, toCsv, urlQueryConsumesKey, withStableOrder } from "@atscript/ui-table";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
|
|
1
2
|
import { Component, ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
|
|
3
|
+
import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, DroppedFields, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
|
|
2
4
|
import { ClientError, PageResult, TDbActionInfo, TDbActionProcessor, TDbDeleteResult } from "@atscript/db-client";
|
|
3
5
|
import { FilterExpr, Uniquery } from "@uniqu/core";
|
|
4
|
-
import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
|
|
5
|
-
import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, DroppedFields, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
|
|
6
6
|
|
|
7
7
|
//#region src/composables/state/intent-scope.d.ts
|
|
8
8
|
interface ActionBuckets {
|
|
@@ -309,6 +309,19 @@ interface PresetConfig {
|
|
|
309
309
|
draftScope?: MaybeRefOrGetter<string | undefined>;
|
|
310
310
|
}
|
|
311
311
|
type QueryErrorKind = "initial" | "query" | "queryNext" | "loadRange";
|
|
312
|
+
/**
|
|
313
|
+
* Tri-state for the multi-select header checkbox, measured against the rows
|
|
314
|
+
* the header acts on: the loaded rows in `<AsTable>`, every row in
|
|
315
|
+
* `<AsWindowTable>` (which shows the control only once all rows are loaded).
|
|
316
|
+
*/
|
|
317
|
+
type SelectAllState = "none" | "some" | "all";
|
|
318
|
+
/**
|
|
319
|
+
* What toggles a row's selection by pointer (`:select-on` on `<AsTable>` /
|
|
320
|
+
* `<AsWindowTable>`): `"row"` — a click anywhere on the row (the default);
|
|
321
|
+
* `"control"` — only the row's checkbox, a row click just moves the active
|
|
322
|
+
* row. Space / Enter behave the same in both. Since 0.1.142.
|
|
323
|
+
*/
|
|
324
|
+
type SelectOn = "row" | "control";
|
|
312
325
|
/**
|
|
313
326
|
* Context handed to the per-row hooks of `<AsTable>` (`rowSelectable`,
|
|
314
327
|
* `rowClass`, `rowAttrs`). Since 0.1.133.
|
|
@@ -590,13 +603,30 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
590
603
|
/** How many of `rows` the `rowSelectable` predicate lets through. Since 0.1.133. */
|
|
591
604
|
selectableCount: (rows: readonly Record<string, unknown>[]) => number;
|
|
592
605
|
/**
|
|
593
|
-
*
|
|
594
|
-
* selected
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* Since 0.1.133.
|
|
606
|
+
* Add every eligible row in `rows` to the selection. Nothing already
|
|
607
|
+
* selected is dropped — rows outside `rows`, and an ineligible row that is
|
|
608
|
+
* already picked, stay. `indexOf` maps a position in `rows` to the index
|
|
609
|
+
* the `rowSelectable` predicate sees — windowed callers pass it because
|
|
610
|
+
* their rows come from a cache keyed by absolute index. Since 0.1.133.
|
|
598
611
|
*/
|
|
599
612
|
selectAll: (rows: readonly Record<string, unknown>[], indexOf?: (position: number) => number) => void;
|
|
613
|
+
/**
|
|
614
|
+
* Remove every eligible row in `rows` from the selection. Selections
|
|
615
|
+
* outside `rows` stay, and so does a picked row the `rowSelectable`
|
|
616
|
+
* predicate rejects. Since 0.1.142.
|
|
617
|
+
*/
|
|
618
|
+
deselectAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
619
|
+
/**
|
|
620
|
+
* The header checkbox's action over `rows`: deselect them when every
|
|
621
|
+
* eligible one is selected, otherwise select them. Since 0.1.142.
|
|
622
|
+
*/
|
|
623
|
+
toggleAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
624
|
+
/**
|
|
625
|
+
* Empty the selection — every pk, whether or not its row is loaded or
|
|
626
|
+
* eligible. The header checkbox only ever acts on loaded rows; this is the
|
|
627
|
+
* real clear. Since 0.1.142.
|
|
628
|
+
*/
|
|
629
|
+
clearSelection: () => void;
|
|
600
630
|
/** Column currently open in the filter dialog (null when closed). */
|
|
601
631
|
filterDialogColumn: Ref<ColumnDef | null>;
|
|
602
632
|
/** Absolute index of the keyboard-active row. -1 = nothing active. */
|
|
@@ -828,7 +858,9 @@ interface PresetSurface {
|
|
|
828
858
|
/**
|
|
829
859
|
* Active preset's snapshot (system presets are aspect-expanded), pruned of
|
|
830
860
|
* fields this caller cannot use — what applying it wrote. The stored row
|
|
831
|
-
* is never rewritten.
|
|
861
|
+
* is never rewritten. Since 0.1.142 it is canonical, spelled the way
|
|
862
|
+
* `captureSnapshot()` spells table state: no width equal to its column's
|
|
863
|
+
* default, no filter field with nothing filled.
|
|
832
864
|
*/
|
|
833
865
|
activeSnapshot: ComputedRef<PresetSnapshot>;
|
|
834
866
|
/**
|
|
@@ -905,4 +937,4 @@ interface PresetSurface {
|
|
|
905
937
|
lastError: Ref<Error | null>;
|
|
906
938
|
}
|
|
907
939
|
//#endregion
|
|
908
|
-
export {
|
|
940
|
+
export { extractIdentifier as A, SelectAllState as C, TVueTableActionInfo as D, TAsTableControls as E, TableActionsState as O, RowSelectableVerdict as S, TAsCellTypeComponents as T, RowAttrsHook as _, ConfirmOptions as a, RowHookContext as b, InvokeOpts as c, NavKeyOptions as d, PresetConfig as f, RowActionsConfig as g, RowActionsColumnPlacement as h, ConfigTab as i, TableNavBridge as k, LocalRowAction as l, ReactiveTableState as m, ApplyUrlQueryOptions as n, DroppedFieldsReport as o, QueryErrorKind as p, ColumnMenuConfig as r, EnterAction as s, ActionResult as t, MainActionRequest as u, RowClassHook as v, SelectOn as w, RowSelectableHook as x, RowDeleteOpt as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
|
|
2
1
|
import { Component, ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
|
|
3
|
-
import {
|
|
2
|
+
import { ColumnDef, PaginationControl, SortControl, TableDef } from "@atscript/ui";
|
|
4
3
|
import { ClientError, PageResult, TDbActionInfo, TDbActionProcessor, TDbDeleteResult } from "@atscript/db-client";
|
|
5
4
|
import { FilterExpr, Uniquery } from "@uniqu/core";
|
|
5
|
+
import { AsPresetEntryRow, AspectMask, ColumnWidthsMap, ConfigTab, DroppedFields, FieldFilters, PresetAspect, PresetCapabilities, PresetSnapshot, SelectionMode, SystemPreset, SystemPresetInput, TableStateMethods } from "@atscript/ui-table";
|
|
6
6
|
|
|
7
7
|
//#region src/composables/state/intent-scope.d.ts
|
|
8
8
|
interface ActionBuckets {
|
|
@@ -309,6 +309,19 @@ interface PresetConfig {
|
|
|
309
309
|
draftScope?: MaybeRefOrGetter<string | undefined>;
|
|
310
310
|
}
|
|
311
311
|
type QueryErrorKind = "initial" | "query" | "queryNext" | "loadRange";
|
|
312
|
+
/**
|
|
313
|
+
* Tri-state for the multi-select header checkbox, measured against the rows
|
|
314
|
+
* the header acts on: the loaded rows in `<AsTable>`, every row in
|
|
315
|
+
* `<AsWindowTable>` (which shows the control only once all rows are loaded).
|
|
316
|
+
*/
|
|
317
|
+
type SelectAllState = "none" | "some" | "all";
|
|
318
|
+
/**
|
|
319
|
+
* What toggles a row's selection by pointer (`:select-on` on `<AsTable>` /
|
|
320
|
+
* `<AsWindowTable>`): `"row"` — a click anywhere on the row (the default);
|
|
321
|
+
* `"control"` — only the row's checkbox, a row click just moves the active
|
|
322
|
+
* row. Space / Enter behave the same in both. Since 0.1.142.
|
|
323
|
+
*/
|
|
324
|
+
type SelectOn = "row" | "control";
|
|
312
325
|
/**
|
|
313
326
|
* Context handed to the per-row hooks of `<AsTable>` (`rowSelectable`,
|
|
314
327
|
* `rowClass`, `rowAttrs`). Since 0.1.133.
|
|
@@ -590,13 +603,30 @@ interface ReactiveTableState extends TableStateMethods {
|
|
|
590
603
|
/** How many of `rows` the `rowSelectable` predicate lets through. Since 0.1.133. */
|
|
591
604
|
selectableCount: (rows: readonly Record<string, unknown>[]) => number;
|
|
592
605
|
/**
|
|
593
|
-
*
|
|
594
|
-
* selected
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* Since 0.1.133.
|
|
606
|
+
* Add every eligible row in `rows` to the selection. Nothing already
|
|
607
|
+
* selected is dropped — rows outside `rows`, and an ineligible row that is
|
|
608
|
+
* already picked, stay. `indexOf` maps a position in `rows` to the index
|
|
609
|
+
* the `rowSelectable` predicate sees — windowed callers pass it because
|
|
610
|
+
* their rows come from a cache keyed by absolute index. Since 0.1.133.
|
|
598
611
|
*/
|
|
599
612
|
selectAll: (rows: readonly Record<string, unknown>[], indexOf?: (position: number) => number) => void;
|
|
613
|
+
/**
|
|
614
|
+
* Remove every eligible row in `rows` from the selection. Selections
|
|
615
|
+
* outside `rows` stay, and so does a picked row the `rowSelectable`
|
|
616
|
+
* predicate rejects. Since 0.1.142.
|
|
617
|
+
*/
|
|
618
|
+
deselectAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
619
|
+
/**
|
|
620
|
+
* The header checkbox's action over `rows`: deselect them when every
|
|
621
|
+
* eligible one is selected, otherwise select them. Since 0.1.142.
|
|
622
|
+
*/
|
|
623
|
+
toggleAll: (rows: readonly Record<string, unknown>[]) => void;
|
|
624
|
+
/**
|
|
625
|
+
* Empty the selection — every pk, whether or not its row is loaded or
|
|
626
|
+
* eligible. The header checkbox only ever acts on loaded rows; this is the
|
|
627
|
+
* real clear. Since 0.1.142.
|
|
628
|
+
*/
|
|
629
|
+
clearSelection: () => void;
|
|
600
630
|
/** Column currently open in the filter dialog (null when closed). */
|
|
601
631
|
filterDialogColumn: Ref<ColumnDef | null>;
|
|
602
632
|
/** Absolute index of the keyboard-active row. -1 = nothing active. */
|
|
@@ -828,7 +858,9 @@ interface PresetSurface {
|
|
|
828
858
|
/**
|
|
829
859
|
* Active preset's snapshot (system presets are aspect-expanded), pruned of
|
|
830
860
|
* fields this caller cannot use — what applying it wrote. The stored row
|
|
831
|
-
* is never rewritten.
|
|
861
|
+
* is never rewritten. Since 0.1.142 it is canonical, spelled the way
|
|
862
|
+
* `captureSnapshot()` spells table state: no width equal to its column's
|
|
863
|
+
* default, no filter field with nothing filled.
|
|
832
864
|
*/
|
|
833
865
|
activeSnapshot: ComputedRef<PresetSnapshot>;
|
|
834
866
|
/**
|
|
@@ -905,4 +937,4 @@ interface PresetSurface {
|
|
|
905
937
|
lastError: Ref<Error | null>;
|
|
906
938
|
}
|
|
907
939
|
//#endregion
|
|
908
|
-
export {
|
|
940
|
+
export { extractIdentifier as A, SelectAllState as C, TVueTableActionInfo as D, TAsTableControls as E, TableActionsState as O, RowSelectableVerdict as S, TAsCellTypeComponents as T, RowAttrsHook as _, ConfirmOptions as a, RowHookContext as b, InvokeOpts as c, NavKeyOptions as d, PresetConfig as f, RowActionsConfig as g, RowActionsColumnPlacement as h, ConfigTab as i, TableNavBridge as k, LocalRowAction as l, ReactiveTableState as m, ApplyUrlQueryOptions as n, DroppedFieldsReport as o, QueryErrorKind as p, ColumnMenuConfig as r, EnterAction as s, ActionResult as t, MainActionRequest as u, RowClassHook as v, SelectOn as w, RowSelectableHook as x, RowDeleteOpt as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-
|
|
1
|
+
import { l as DEFAULT_AVAILABLE_ASPECTS, n as createTableState, r as provideTableContext } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
import { n as useTableSelection } from "./use-table-selection-ULbKT2xW.mjs";
|
|
3
3
|
import { createTableDef, getMetaEntry, resetMetaCache } from "@atscript/ui";
|
|
4
4
|
import { computed, inject, isRef, ref, shallowRef, toValue, watch } from "vue";
|
package/dist/{use-table-column-handlers-CaT7dYnI.mjs → use-table-column-handlers-0myVzrZR.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as ROW_ACTIONS_PATH, j as ROW_ACTIONS_TYPE } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
import { computed, watch } from "vue";
|
|
3
3
|
import { reorderColumnNames } from "@atscript/ui-table";
|
|
4
4
|
//#region src/composables/use-row-actions-column.ts
|
package/dist/{use-table-column-handlers-CWHRcQbE.cjs → use-table-column-handlers-BHMCo_HR.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BiklfjP0.cjs");
|
|
2
2
|
let vue = require("vue");
|
|
3
3
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
4
4
|
//#region src/composables/use-row-actions-column.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BiklfjP0.cjs");
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
//#region src/composables/use-table-component.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolve a single skin-slot component from the injected `controls` map,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
//#region src/composables/use-table-nav-bridge.ts
|
|
3
3
|
function isPassthroughKey(event) {
|
|
4
4
|
const key = event.key;
|
|
@@ -565,6 +565,14 @@ function buildRemoveAction(opts) {
|
|
|
565
565
|
/** Shared verdicts — frozen, so the common case allocates nothing per row. */
|
|
566
566
|
const SELECTABLE = Object.freeze({ ok: true });
|
|
567
567
|
const NOT_SELECTABLE = Object.freeze({ ok: false });
|
|
568
|
+
/**
|
|
569
|
+
* The header tri-state from how many of the rows in scope are eligible and
|
|
570
|
+
* how many of those are selected.
|
|
571
|
+
*/
|
|
572
|
+
function toSelectAllState(selected, selectable) {
|
|
573
|
+
if (selected === 0) return "none";
|
|
574
|
+
return selected >= selectable ? "all" : "some";
|
|
575
|
+
}
|
|
568
576
|
/** Normalise a {@link RowSelectableHook} return value. `""` carries no reason. */
|
|
569
577
|
function verdictOf(value) {
|
|
570
578
|
if (value === void 0 || value === true) return SELECTABLE;
|
|
@@ -602,22 +610,33 @@ function createSelectionApi(opts, getActiveRow, activeIndex) {
|
|
|
602
610
|
for (let i = 0; i < rows.length; i++) if (isRowSelectable(rows[i], i).ok) n++;
|
|
603
611
|
return n;
|
|
604
612
|
}
|
|
613
|
+
function eligiblePks(rows) {
|
|
614
|
+
return (0, _atscript_ui_table.rowsToPks)(selectableRows(rows), rowValueFn);
|
|
615
|
+
}
|
|
616
|
+
function addPks(pks) {
|
|
617
|
+
const current = selectedSet.value;
|
|
618
|
+
const added = [...new Set(pks)].filter((pk) => !current.has(pk));
|
|
619
|
+
if (added.length > 0) selectedRows.value = [...selectedRows.value, ...added];
|
|
620
|
+
}
|
|
621
|
+
function removePks(pks) {
|
|
622
|
+
const drop = new Set(pks);
|
|
623
|
+
const next = selectedRows.value.filter((pk) => !drop.has(pk));
|
|
624
|
+
if (next.length !== selectedRows.value.length) selectedRows.value = next;
|
|
625
|
+
}
|
|
605
626
|
function selectAll(rows, indexOf) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
selectedRows.value = out;
|
|
627
|
+
addPks((0, _atscript_ui_table.rowsToPks)(indexOf ? rows.filter((row, i) => isRowSelectable(row, indexOf(i)).ok) : selectableRows(rows), rowValueFn));
|
|
628
|
+
}
|
|
629
|
+
function deselectAll(rows) {
|
|
630
|
+
removePks(eligiblePks(rows));
|
|
631
|
+
}
|
|
632
|
+
function toggleAll(rows) {
|
|
633
|
+
const pks = eligiblePks(rows);
|
|
634
|
+
const selected = pks.filter((pk) => selectedSet.value.has(pk)).length;
|
|
635
|
+
if (toSelectAllState(selected, pks.length) === "all") removePks(pks);
|
|
636
|
+
else addPks(pks);
|
|
637
|
+
}
|
|
638
|
+
function clearSelection() {
|
|
639
|
+
if (selectedRows.value.length > 0) selectedRows.value = [];
|
|
621
640
|
}
|
|
622
641
|
function toggleActiveSelection(mode) {
|
|
623
642
|
if (mode === "none") return;
|
|
@@ -637,6 +656,9 @@ function createSelectionApi(opts, getActiveRow, activeIndex) {
|
|
|
637
656
|
selectableRows,
|
|
638
657
|
selectableCount,
|
|
639
658
|
selectAll,
|
|
659
|
+
deselectAll,
|
|
660
|
+
toggleAll,
|
|
661
|
+
clearSelection,
|
|
640
662
|
toggleActiveSelection
|
|
641
663
|
};
|
|
642
664
|
}
|
|
@@ -854,6 +876,15 @@ function createNavController(inputs) {
|
|
|
854
876
|
};
|
|
855
877
|
}
|
|
856
878
|
/**
|
|
879
|
+
* Toggle the row at `index`: it becomes the active row, then the active row
|
|
880
|
+
* toggles. Selectability is NOT re-checked here: `toggleActiveSelection`
|
|
881
|
+
* gates on `rowSelectable` itself, which is the single place that rule lives.
|
|
882
|
+
*/
|
|
883
|
+
function toggleRowAt(index, mode, state) {
|
|
884
|
+
state.setActive(index);
|
|
885
|
+
state.toggleActiveSelection(mode);
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
857
888
|
* `@keydown` handler for a row's SELECTION CONTROL (the leading checkbox),
|
|
858
889
|
* shared by `<AsTableBase>` and `<AsWindowTableBase>`. The control carries
|
|
859
890
|
* `role="checkbox"`, so the tbody-level nav handler deliberately leaves
|
|
@@ -862,16 +893,13 @@ function createNavController(inputs) {
|
|
|
862
893
|
* Keys other than Space, and `select="none"`, fall through untouched; only
|
|
863
894
|
* once the press is ours do we consume it, so the Reka-wrapped rendering
|
|
864
895
|
* modes (which never bind this handler) keep Space for their own item.
|
|
865
|
-
* Selectability is NOT re-checked here: `toggleActiveSelection` gates on
|
|
866
|
-
* `rowSelectable` itself, which is the single place that rule lives.
|
|
867
896
|
*/
|
|
868
897
|
function onSelectControlKeydown(event, index, mode, state) {
|
|
869
898
|
if (event.key !== " ") return;
|
|
870
899
|
if (mode === "none") return;
|
|
871
900
|
event.preventDefault();
|
|
872
901
|
event.stopPropagation();
|
|
873
|
-
|
|
874
|
-
state.toggleActiveSelection(mode);
|
|
902
|
+
toggleRowAt(index, mode, state);
|
|
875
903
|
}
|
|
876
904
|
//#endregion
|
|
877
905
|
//#region src/composables/preset-aspect-display.ts
|
|
@@ -1022,7 +1050,7 @@ function createPresetState(opts) {
|
|
|
1022
1050
|
},
|
|
1023
1051
|
apply(o, value, isSystem) {
|
|
1024
1052
|
if (!value && !isSystem) return;
|
|
1025
|
-
o.filters.value = value ? { ...value } : {};
|
|
1053
|
+
o.filters.value = value ? { ...(0, _atscript_ui_table.compactFieldFilters)(value) } : {};
|
|
1026
1054
|
if (o.residualFilters?.value.length) o.residualFilters.value = [];
|
|
1027
1055
|
},
|
|
1028
1056
|
expandDefault: () => ({})
|
|
@@ -1170,6 +1198,11 @@ function createPresetState(opts) {
|
|
|
1170
1198
|
const wire = row.data?.content;
|
|
1171
1199
|
return wire ? (0, _atscript_ui_table.fromWireSnapshot)(wire) : {};
|
|
1172
1200
|
});
|
|
1201
|
+
const defaultWidths = (0, vue.computed)((prev) => {
|
|
1202
|
+
const next = {};
|
|
1203
|
+
for (const [path, entry] of Object.entries(opts.columnWidths.value)) next[path] = entry.d;
|
|
1204
|
+
return prev && shallowEqual(prev, next) ? prev : next;
|
|
1205
|
+
});
|
|
1173
1206
|
const prunedActive = (0, vue.computed)(() => {
|
|
1174
1207
|
const known = opts.knownFields?.value;
|
|
1175
1208
|
const stored = storedActiveSnapshot.value;
|
|
@@ -1178,7 +1211,7 @@ function createPresetState(opts) {
|
|
|
1178
1211
|
dropped: null
|
|
1179
1212
|
};
|
|
1180
1213
|
});
|
|
1181
|
-
const activeSnapshot = (0, vue.computed)(() => prunedActive.value.snapshot);
|
|
1214
|
+
const activeSnapshot = (0, vue.computed)(() => (0, _atscript_ui_table.canonicalPresetSnapshot)(prunedActive.value.snapshot, defaultWidths.value));
|
|
1182
1215
|
const droppedFields = (0, vue.computed)(() => {
|
|
1183
1216
|
const dropped = prunedActive.value.dropped;
|
|
1184
1217
|
const presetId = activeId.value;
|
|
@@ -1326,6 +1359,12 @@ function createPresetState(opts) {
|
|
|
1326
1359
|
}
|
|
1327
1360
|
};
|
|
1328
1361
|
}
|
|
1362
|
+
function shallowEqual(a, b) {
|
|
1363
|
+
const keys = Object.keys(a);
|
|
1364
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
1365
|
+
for (const k of keys) if (a[k] !== b[k]) return false;
|
|
1366
|
+
return true;
|
|
1367
|
+
}
|
|
1329
1368
|
function inertMutator() {
|
|
1330
1369
|
throw new Error("[vue-table] presets feature not configured (preset.url missing)");
|
|
1331
1370
|
}
|
|
@@ -1968,7 +2007,7 @@ function createTableState(opts) {
|
|
|
1968
2007
|
if (idx < 0) return void 0;
|
|
1969
2008
|
return navMode.value === "window" ? dataAt(idx) : results.value[idx];
|
|
1970
2009
|
}
|
|
1971
|
-
const { selectedRows, selectedCount, rowValueFn, isPkSelected, rowSelectable, isRowSelectable, selectableRows, selectableCount, selectAll, toggleActiveSelection } = createSelectionApi(selectionOpts, getActiveRow, activeIndex);
|
|
2010
|
+
const { selectedRows, selectedCount, rowValueFn, isPkSelected, rowSelectable, isRowSelectable, selectableRows, selectableCount, selectAll, deselectAll, toggleAll, clearSelection, toggleActiveSelection } = createSelectionApi(selectionOpts, getActiveRow, activeIndex);
|
|
1972
2011
|
const { actions } = createActions({
|
|
1973
2012
|
tableDef,
|
|
1974
2013
|
client,
|
|
@@ -2143,6 +2182,9 @@ function createTableState(opts) {
|
|
|
2143
2182
|
selectableRows,
|
|
2144
2183
|
selectableCount,
|
|
2145
2184
|
selectAll,
|
|
2185
|
+
deselectAll,
|
|
2186
|
+
toggleAll,
|
|
2187
|
+
clearSelection,
|
|
2146
2188
|
rowDelete,
|
|
2147
2189
|
rowActions,
|
|
2148
2190
|
includeActions,
|
|
@@ -2206,14 +2248,11 @@ function createTableState(opts) {
|
|
|
2206
2248
|
filterFields.value = filterFields.value.filter((f) => f !== path);
|
|
2207
2249
|
},
|
|
2208
2250
|
setFieldFilter(path, conditions) {
|
|
2209
|
-
if (!conditions.some(_atscript_ui_table.isFilled))
|
|
2210
|
-
|
|
2211
|
-
const { [path]: _, ...rest } = filters.value;
|
|
2212
|
-
filters.value = rest;
|
|
2213
|
-
} else filters.value = {
|
|
2251
|
+
if (!conditions.some(_atscript_ui_table.isFilled) && !(path in filters.value)) return;
|
|
2252
|
+
filters.value = (0, _atscript_ui_table.compactFieldFilters)({
|
|
2214
2253
|
...filters.value,
|
|
2215
2254
|
[path]: conditions
|
|
2216
|
-
};
|
|
2255
|
+
});
|
|
2217
2256
|
},
|
|
2218
2257
|
setColumnWidth(path, width) {
|
|
2219
2258
|
writeColumnWidth(path, width);
|
|
@@ -2772,6 +2811,18 @@ Object.defineProperty(exports, "rowActionHref", {
|
|
|
2772
2811
|
return rowActionHref;
|
|
2773
2812
|
}
|
|
2774
2813
|
});
|
|
2814
|
+
Object.defineProperty(exports, "toSelectAllState", {
|
|
2815
|
+
enumerable: true,
|
|
2816
|
+
get: function() {
|
|
2817
|
+
return toSelectAllState;
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
Object.defineProperty(exports, "toggleRowAt", {
|
|
2821
|
+
enumerable: true,
|
|
2822
|
+
get: function() {
|
|
2823
|
+
return toggleRowAt;
|
|
2824
|
+
}
|
|
2825
|
+
});
|
|
2775
2826
|
Object.defineProperty(exports, "triggerAction", {
|
|
2776
2827
|
enumerable: true,
|
|
2777
2828
|
get: function() {
|