@atscript/vue-table 0.1.97 → 0.1.98
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-cell-array-DOQKR6t5.mjs → as-cell-array-2qmJ1lT2.mjs} +2 -2
- package/dist/{as-cell-array-CXeZzZqt.cjs → as-cell-array-iPeUnk2G.cjs} +2 -2
- 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-DPWBlhyM.mjs → as-cell-date-BwFgi6O0.mjs} +2 -2
- package/dist/{as-cell-date-D0rowX5E.cjs → as-cell-date-DyixWKuS.cjs} +2 -2
- 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-BynWIs1d.mjs → as-cell-json--95Xq6yq.mjs} +2 -2
- package/dist/{as-cell-json-DvHvQ6IL.cjs → as-cell-json-Bvv2P7YV.cjs} +2 -2
- 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-Bc1C97Vg.mjs → as-cell-number-DKRaS9pM.mjs} +2 -2
- package/dist/{as-cell-number-0_WrSCzu.cjs → as-cell-number-DuPMOesI.cjs} +2 -2
- 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-CFAI0utz.cjs → as-cell-union-CT0rIvQq.cjs} +3 -3
- package/dist/{as-cell-union-C1w3B38J.mjs → as-cell-union-sAOSdepj.mjs} +3 -3
- 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.cjs +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.mjs +1 -1
- package/dist/{as-column-menu.vue-C9e6wJ3z.d.mts → as-column-menu.vue-BtXVQywl.d.cts} +2 -2
- package/dist/{as-column-menu.vue-o0qFdzoL.d.cts → as-column-menu.vue-D3Z5BVLx.d.mts} +2 -2
- package/dist/{as-config-dialog-BB6BDa1E.mjs → as-config-dialog-COwDabdW.mjs} +15 -13
- package/dist/{as-config-dialog-BCvtSxi6.cjs → as-config-dialog-vOUtx5zq.cjs} +14 -12
- 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.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-O62-CnIQ.cjs → as-filter-dialog-BcPI27cn.cjs} +19 -70
- package/dist/{as-filter-dialog-KGyPqr2P.mjs → as-filter-dialog-DuFgEjqE.mjs} +20 -65
- 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-jL7cnKUR.cjs → as-filter-field-B8idz2UD.cjs} +3 -473
- package/dist/{as-filter-field-CkiRXHVx.mjs → as-filter-field-Dsk1l3Et.mjs} +7 -441
- 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.cjs +1 -1
- package/dist/as-filter-input.d.mts +1 -1
- package/dist/as-filter-input.mjs +1 -1
- package/dist/{as-filters-BJM-NjUn.mjs → as-filters-BS7kWJfI.mjs} +5 -3
- package/dist/{as-filters-BFpZKtAU.cjs → as-filters-BzdQ4HUx.cjs} +4 -2
- 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-1Xl8DIiN.cjs → as-preset-dialog-DOdrDDKy.cjs} +7 -8
- package/dist/{as-preset-dialog-DXbqMVI1.mjs → as-preset-dialog-DoEpCt2j.mjs} +7 -8
- 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-CkaaKzYB.cjs → as-preset-picker-2DkH7QfW.cjs} +1 -1
- package/dist/{as-preset-picker-DJTF47_V.mjs → as-preset-picker-ByUCQpnX.mjs} +1 -1
- 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-row-actions-C78cvaf3.cjs → as-row-actions-05pQX_om.cjs} +1 -1
- package/dist/{as-row-actions-CpEMa5NU.mjs → as-row-actions-D7YgGt0x.mjs} +1 -1
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-table-v42bV1ea.cjs → as-table-DyuL_hUo.cjs} +6 -5
- package/dist/{as-table-DDyvnBFL.mjs → as-table-H5uKWieH.mjs} +4 -3
- package/dist/{as-table-actions-DtCjMMCI.cjs → as-table-actions-CsdY2_BG.cjs} +1 -1
- package/dist/{as-table-actions-D2-MBvoy.mjs → as-table-actions-DCEGQiHi.mjs} +1 -1
- 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-pDtCQ0oB.d.cts → as-table-actions.vue-33oeDXOg.d.cts} +2 -2
- package/dist/{as-table-actions.vue-riwwEAGF.d.mts → as-table-actions.vue-DMf6-R5o.d.mts} +2 -2
- package/dist/{as-table-base-CSrtmIN2.mjs → as-table-base-DReD74pJ.mjs} +2 -2
- package/dist/{as-table-base-CHzULili.cjs → as-table-base-GEf95oXP.cjs} +2 -2
- package/dist/{as-table-cell-value-B1CiJYFn.mjs → as-table-cell-value-Byrb_Zyh.mjs} +2 -2
- package/dist/{as-table-cell-value-CuxRtFn9.cjs → as-table-cell-value-CcWR5oG4.cjs} +2 -2
- 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-CBn_ioCe.mjs → as-table-header-cell-BUf8wvrw.mjs} +6 -4
- package/dist/{as-table-header-cell-C3zeZUZo.cjs → as-table-header-cell-DWONx2MI.cjs} +5 -3
- 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-Bc_DSsGY.d.cts → as-table-header-cell.vue-CzqTEpyk.d.cts} +1 -1
- package/dist/{as-table-header-cell.vue-DNMOHfek.d.mts → as-table-header-cell.vue-Dj_Tl7dZ.d.mts} +1 -1
- package/dist/{as-table-root-zJdmNnsC.cjs → as-table-root-Cg2zkxR5.cjs} +8 -20
- package/dist/{as-table-root-Bc23Z7we.mjs → as-table-root-DpQUTbQ8.mjs} +4 -16
- 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-DuMkOgkl.d.mts → as-table-root.vue-Boq6pDr1.d.mts} +13 -4
- package/dist/{as-table-root.vue-D3ILISqx.d.cts → as-table-root.vue-CYmnf5SH.d.cts} +13 -4
- package/dist/{as-table-status-DKXFSCzE.cjs → as-table-status-DZP8dFpm.cjs} +17 -74
- package/dist/{as-table-status-B11orhFu.mjs → as-table-status-Dinns93w.mjs} +19 -64
- 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-Bab-ISDO.d.mts → as-table.vue-CE_7OC_h.d.mts} +3 -3
- package/dist/{as-table.vue-Dk6YH5ls.d.cts → as-table.vue-kFORh8Vg.d.cts} +3 -3
- package/dist/{as-window-table-CDTjX7W5.mjs → as-window-table-BwF2t4Zy.mjs} +5 -3
- package/dist/{as-window-table-DuwMCDUh.cjs → as-window-table-CCRJKpoE.cjs} +7 -5
- 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-DjTUqghh.d.mts → as-window-table.vue-C60NtRtq.d.cts} +3 -3
- package/dist/{as-window-table.vue-BJFSC4Rq.d.cts → as-window-table.vue-C88OoW5d.d.mts} +3 -3
- package/dist/index.cjs +46 -44
- package/dist/index.d.cts +19 -17
- package/dist/index.d.mts +23 -21
- package/dist/index.mjs +35 -35
- package/dist/{types-BvvXN72P.d.mts → types-BPFBxUS_.d.cts} +2 -4
- package/dist/{types-CNMmF6W2.d.cts → types-BWeFiZKk.d.mts} +2 -4
- package/dist/use-has-emit-listener-BTMDIv2e.mjs +14 -0
- package/dist/use-has-emit-listener-hhOH8CBI.cjs +19 -0
- package/dist/use-seed-on-open-DO3A1kIb.mjs +30 -0
- package/dist/use-seed-on-open-Dg9I89fU.cjs +35 -0
- package/dist/use-table-CLsp2mAu.cjs +475 -0
- package/dist/use-table-CRsFMyJb.mjs +440 -0
- package/dist/{use-table-column-handlers-CGYAY2xH.cjs → use-table-column-handlers-BgC4gUJV.cjs} +0 -19
- package/dist/{use-table-column-handlers-t6xi1yCE.mjs → use-table-column-handlers-cm0GxR2u.mjs} +1 -14
- package/dist/use-table-component-BbETnUuy.mjs +12 -0
- package/dist/use-table-component-CirEOQ_P.cjs +17 -0
- package/dist/use-table-nav-bridge-Bh1tpG0X.cjs +57 -0
- package/dist/use-table-nav-bridge-i8AjtjIt.mjs +52 -0
- package/dist/use-table-selection-C84z4OZy.mjs +59 -0
- package/dist/use-table-selection-Cmiu1h4S.cjs +70 -0
- package/package.json +10 -7
- /package/dist/{as-action-menu-content-CSPPMACR.cjs → as-action-menu-content-BChqFX3E.cjs} +0 -0
- /package/dist/{as-action-menu-content-DXWuttt_.mjs → as-action-menu-content-D2yf0zD2.mjs} +0 -0
- /package/dist/{as-cell-array.vue-DZGM2VHh.d.mts → as-cell-array.vue-D4vS7C_D.d.mts} +0 -0
- /package/dist/{as-cell-date.vue-Zlt4mHWb.d.mts → as-cell-date.vue-Chs7WTZ9.d.mts} +0 -0
- /package/dist/{as-cell-json-popover-BWdNs1YU.cjs → as-cell-json-popover-BM2QLgfk.cjs} +0 -0
- /package/dist/{as-cell-json-popover-DUq25I0L.mjs → as-cell-json-popover-Dkdv5Y9E.mjs} +0 -0
- /package/dist/{as-cell-json.vue-CESWuCer.d.mts → as-cell-json.vue-C0_LDvQw.d.mts} +0 -0
- /package/dist/{as-cell-number.vue-1Oq7nVI3.d.mts → as-cell-number.vue-BBF0OuU8.d.mts} +0 -0
- /package/dist/{as-cell-union.vue-NnDmQZOA.d.mts → as-cell-union.vue-CL-Lf-Rm.d.mts} +0 -0
- /package/dist/{as-column-menu-CH9Htz0Q.cjs → as-column-menu-fZVbJ9lU.cjs} +0 -0
- /package/dist/{as-column-menu-DCfhorMP.mjs → as-column-menu-kTIQfLTi.mjs} +0 -0
- /package/dist/{as-config-dialog.vue-C6Q62xF5.d.mts → as-config-dialog.vue-BvFZZRuY.d.mts} +0 -0
- /package/dist/{as-confirm-dialog-Xtw2wE1X.cjs → as-confirm-dialog-C6HAGzrj.cjs} +0 -0
- /package/dist/{as-confirm-dialog-DL0mCEeX.mjs → as-confirm-dialog-ClVKU1Dm.mjs} +0 -0
- /package/dist/{as-confirm-dialog.vue-pas8jGhv.d.mts → as-confirm-dialog.vue-Cz52-v6c.d.mts} +0 -0
- /package/dist/{as-filter-dialog.vue-RDZjp4gJ.d.mts → as-filter-dialog.vue-likNLqzF.d.mts} +0 -0
- /package/dist/{as-filter-field.vue-QY8wi5S5.d.mts → as-filter-field.vue-BbXLhd6O.d.mts} +0 -0
- /package/dist/{as-filter-input-P1i0CW2-.mjs → as-filter-input-BM23TNeh.mjs} +0 -0
- /package/dist/{as-filter-input--nr72iwX.cjs → as-filter-input-DJu2k9gO.cjs} +0 -0
- /package/dist/{as-filter-input.vue-CBQ71eNg.d.mts → as-filter-input.vue-B9ma2l9j.d.mts} +0 -0
- /package/dist/{as-filters.vue-BsMgYUcX.d.mts → as-filters.vue-DmECMd1v.d.mts} +0 -0
- /package/dist/{as-preset-dialog.vue-Bzv-ON9W.d.mts → as-preset-dialog.vue-BRjjfPty.d.mts} +0 -0
- /package/dist/{as-preset-picker.vue-CTBk6leV.d.mts → as-preset-picker.vue-BPjsiaVt.d.mts} +0 -0
- /package/dist/{as-row-actions.vue-BPaQfGev.d.mts → as-row-actions.vue-DUSDuoR2.d.mts} +0 -0
- /package/dist/{as-table-cell-value.vue-BuPCQ8YA.d.mts → as-table-cell-value.vue-kfNgVhzn.d.mts} +0 -0
- /package/dist/{format-cell-B2xMDYO9.mjs → format-cell-CNQ6BpvR.mjs} +0 -0
- /package/dist/{format-cell-D4mqaN0E.cjs → format-cell-CSbJgz5B.cjs} +0 -0
- /package/dist/{get-cell-value-CZSVfDLg.cjs → get-cell-value-4rHKP-TG.cjs} +0 -0
- /package/dist/{get-cell-value-DiH84HKL.mjs → get-cell-value-C8LLc_Rr.mjs} +0 -0
- /package/dist/{preset-aspect-display-BYeiSgcc.mjs → preset-aspect-display-IICxAlVo.mjs} +0 -0
- /package/dist/{preset-aspect-display-y8aal_EF.cjs → preset-aspect-display-TWwf6j1B.cjs} +0 -0
- /package/dist/{use-cell-locale-B480_QYK.cjs → use-cell-locale-BGBRQB7s.cjs} +0 -0
- /package/dist/{use-cell-locale-1uQaFTLQ.mjs → use-cell-locale-MQXoONh5.mjs} +0 -0
|
@@ -1,65 +1,10 @@
|
|
|
1
1
|
const require_use_table_state = require("./use-table-state-DFQ30m-j.cjs");
|
|
2
|
-
const
|
|
3
|
-
const require_as_table_header_cell = require("./as-table-header-cell-
|
|
2
|
+
const require_use_table_component = require("./use-table-component-CirEOQ_P.cjs");
|
|
3
|
+
const require_as_table_header_cell = require("./as-table-header-cell-DWONx2MI.cjs");
|
|
4
|
+
const require_as_row_actions = require("./as-row-actions-05pQX_om.cjs");
|
|
5
|
+
const require_as_table_cell_value = require("./as-table-cell-value-CcWR5oG4.cjs");
|
|
4
6
|
let _atscript_ui = require("@atscript/ui");
|
|
5
7
|
let vue = require("vue");
|
|
6
|
-
let _atscript_ui_table = require("@atscript/ui-table");
|
|
7
|
-
//#region src/composables/use-table-selection.ts
|
|
8
|
-
/**
|
|
9
|
-
* Renderer-owned cleanup for the `select` prop transition. Dropping into
|
|
10
|
-
* `'none'` clears `selectedRows` so the next opt-in to multi-mode starts
|
|
11
|
-
* clean; other transitions are no-ops (`'none' → 'multi'` already has an
|
|
12
|
-
* empty selection, `'multi' → 'multi'` doesn't change semantics). The
|
|
13
|
-
* getter is invoked once per change — NOT immediate, so the mount-time
|
|
14
|
-
* default `'none'` doesn't clobber externally-seeded selections.
|
|
15
|
-
*
|
|
16
|
-
* Lives outside `useTableSelection` because selection mode is a renderer
|
|
17
|
-
* concern (a prop, not state) — both `<AsTable>` and `<AsWindowTable>`
|
|
18
|
-
* call this from their setup so the cleanup tracks the renderer's prop.
|
|
19
|
-
*/
|
|
20
|
-
function useSelectModeReset(state, selectGetter) {
|
|
21
|
-
(0, vue.watch)(selectGetter, (next, prev) => {
|
|
22
|
-
if (next === "none" && prev !== "none" && state.selectedRows.value.length > 0) state.selectedRows.value = [];
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Wire up selection reconciliation on results change.
|
|
27
|
-
*
|
|
28
|
-
* The watcher distinguishes results-replacement (query / invalidate /
|
|
29
|
-
* pagination jump) from results-extension in EITHER direction (queryNext /
|
|
30
|
-
* forward-merging loadRange / backward-merging loadRange) and only runs the
|
|
31
|
-
* reconciliation logic on replacement. Backward extension prepends rows AND
|
|
32
|
-
* decrements `resultsStart` — caught via the last-row reference identity
|
|
33
|
-
* check, so scrolling upward doesn't silently mutate selection.
|
|
34
|
-
*
|
|
35
|
-
* Mode semantics on results-replacement:
|
|
36
|
-
* - `"persist"` — no-op; the consumer's ref is untouched.
|
|
37
|
-
* - `"trim"` (default) — keep the subset of selected PKs still present in the new results.
|
|
38
|
-
* - `"clear"` — drop everything.
|
|
39
|
-
*/
|
|
40
|
-
function useTableSelection(state, opts) {
|
|
41
|
-
const mode = opts?.mode ?? "trim";
|
|
42
|
-
(0, vue.watch)([() => state.results.value, () => state.resultsStart.value], ([newResults, newResultsStart], [oldResults, oldResultsStart]) => {
|
|
43
|
-
if (mode === "persist") return;
|
|
44
|
-
if (state.selectedRows.value.length === 0) return;
|
|
45
|
-
const oldArr = oldResults ?? [];
|
|
46
|
-
const newArr = newResults;
|
|
47
|
-
const oldStart = oldResultsStart ?? 0;
|
|
48
|
-
const delta = newArr.length - oldArr.length;
|
|
49
|
-
if (delta > 0 && oldArr.length > 0) {
|
|
50
|
-
if (newResultsStart === oldStart && newArr[0] === oldArr[0]) return;
|
|
51
|
-
if (newResultsStart === oldStart - delta && newArr[newArr.length - 1] === oldArr[oldArr.length - 1]) return;
|
|
52
|
-
}
|
|
53
|
-
if (mode === "clear") {
|
|
54
|
-
state.selectedRows.value = [];
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const presentPks = /* @__PURE__ */ new Set();
|
|
58
|
-
for (const r of newArr) presentPks.add(state.rowValueFn(r));
|
|
59
|
-
state.selectedRows.value = (0, _atscript_ui_table.trimSelection)(state.selectedRows.value, presentPks);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
8
|
//#region src/composables/use-cell-resolver.ts
|
|
64
9
|
/** Frozen sentinel for columns with no cell-level annotations. */
|
|
65
10
|
const EMPTY_BINDINGS = Object.freeze({});
|
|
@@ -170,14 +115,23 @@ function buildScope(state, row, rowIndex) {
|
|
|
170
115
|
* 2. `column.type` → `ctx.types[type]`
|
|
171
116
|
* 3. fallback → `AsTableCellValue`
|
|
172
117
|
*
|
|
118
|
+
* The synthesized `__actions` pseudo-column is chrome, not data — it
|
|
119
|
+
* dispatches through `controls.rowActions` first, then the `:types` entry,
|
|
120
|
+
* then the built-in `AsRowActions`.
|
|
121
|
+
*
|
|
173
122
|
* Hoisted out of the per-cell render path because the answer is identical for
|
|
174
123
|
* every row in a given column — a 50×10 table avoids ~500 redundant lookups.
|
|
175
124
|
*/
|
|
176
125
|
function useCellComponents(getColumns) {
|
|
177
126
|
const ctx = require_use_table_state.useTableContextOptional();
|
|
127
|
+
const RowActions = require_use_table_component.useTableComponent("rowActions", ctx?.types?.["__actions"] ?? require_as_row_actions.as_row_actions_default);
|
|
178
128
|
return (0, vue.computed)(() => {
|
|
179
129
|
const out = {};
|
|
180
130
|
for (const col of getColumns()) {
|
|
131
|
+
if (col.type === "__actions") {
|
|
132
|
+
out[col.path] = RowActions;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
181
135
|
let resolved;
|
|
182
136
|
if (col.component) resolved = ctx?.components?.[col.component];
|
|
183
137
|
resolved ??= ctx?.types?.[col.type] ?? require_as_table_cell_value.as_table_cell_value_default;
|
|
@@ -457,6 +411,7 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
457
411
|
"select-all-toggle"
|
|
458
412
|
],
|
|
459
413
|
setup(__props, { emit: __emit }) {
|
|
414
|
+
const HeaderCell = require_use_table_component.useTableComponent("headerCell", require_as_table_header_cell.as_table_header_cell_default);
|
|
460
415
|
const props = __props;
|
|
461
416
|
const emit = __emit;
|
|
462
417
|
const sortMap = (0, vue.computed)(() => {
|
|
@@ -532,7 +487,7 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
532
487
|
}, [!col.fixed ? (0, vue.renderSlot)(_ctx.$slots, `header-${col.path}`, {
|
|
533
488
|
key: 0,
|
|
534
489
|
column: col
|
|
535
|
-
}, () => [(0, vue.
|
|
490
|
+
}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(HeaderCell)), {
|
|
536
491
|
column: col,
|
|
537
492
|
"sort-direction": sortMap.value[col.path] ?? null,
|
|
538
493
|
filters: __props.filters?.[col.path],
|
|
@@ -543,13 +498,13 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
543
498
|
onFilter: _cache[3] || (_cache[3] = (c) => emit("filter", c)),
|
|
544
499
|
onFiltersOff: _cache[4] || (_cache[4] = (c) => emit("filters-off", c)),
|
|
545
500
|
onResetWidth: _cache[5] || (_cache[5] = (c) => emit("reset-width", c))
|
|
546
|
-
}, null,
|
|
501
|
+
}, null, 40, [
|
|
547
502
|
"column",
|
|
548
503
|
"sort-direction",
|
|
549
504
|
"filters",
|
|
550
505
|
"column-menu",
|
|
551
506
|
"width-entry"
|
|
552
|
-
])]) : (0, vue.createCommentVNode)("v-if", true), __props.resizable && !col.fixed ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
507
|
+
]))]) : (0, vue.createCommentVNode)("v-if", true), __props.resizable && !col.fixed ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
553
508
|
key: 1,
|
|
554
509
|
class: "as-th-resize-handle",
|
|
555
510
|
draggable: "false",
|
|
@@ -710,15 +665,3 @@ Object.defineProperty(exports, "useRafBatch", {
|
|
|
710
665
|
return useRafBatch;
|
|
711
666
|
}
|
|
712
667
|
});
|
|
713
|
-
Object.defineProperty(exports, "useSelectModeReset", {
|
|
714
|
-
enumerable: true,
|
|
715
|
-
get: function() {
|
|
716
|
-
return useSelectModeReset;
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
Object.defineProperty(exports, "useTableSelection", {
|
|
720
|
-
enumerable: true,
|
|
721
|
-
get: function() {
|
|
722
|
-
return useTableSelection;
|
|
723
|
-
}
|
|
724
|
-
});
|
|
@@ -1,65 +1,10 @@
|
|
|
1
1
|
import { o as useTableContextOptional } from "./use-table-state-CuZ2OXoY.mjs";
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
2
|
+
import { t as useTableComponent } from "./use-table-component-BbETnUuy.mjs";
|
|
3
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-BUf8wvrw.mjs";
|
|
4
|
+
import { t as as_row_actions_default } from "./as-row-actions-D7YgGt0x.mjs";
|
|
5
|
+
import { t as as_table_cell_value_default } from "./as-table-cell-value-Byrb_Zyh.mjs";
|
|
4
6
|
import { UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_STYLES, UI_TABLE_STYLES, getFieldMeta, parseStaticAttrs, resolveAttrs, resolveFieldProp } from "@atscript/ui";
|
|
5
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode,
|
|
6
|
-
import { trimSelection } from "@atscript/ui-table";
|
|
7
|
-
//#region src/composables/use-table-selection.ts
|
|
8
|
-
/**
|
|
9
|
-
* Renderer-owned cleanup for the `select` prop transition. Dropping into
|
|
10
|
-
* `'none'` clears `selectedRows` so the next opt-in to multi-mode starts
|
|
11
|
-
* clean; other transitions are no-ops (`'none' → 'multi'` already has an
|
|
12
|
-
* empty selection, `'multi' → 'multi'` doesn't change semantics). The
|
|
13
|
-
* getter is invoked once per change — NOT immediate, so the mount-time
|
|
14
|
-
* default `'none'` doesn't clobber externally-seeded selections.
|
|
15
|
-
*
|
|
16
|
-
* Lives outside `useTableSelection` because selection mode is a renderer
|
|
17
|
-
* concern (a prop, not state) — both `<AsTable>` and `<AsWindowTable>`
|
|
18
|
-
* call this from their setup so the cleanup tracks the renderer's prop.
|
|
19
|
-
*/
|
|
20
|
-
function useSelectModeReset(state, selectGetter) {
|
|
21
|
-
watch(selectGetter, (next, prev) => {
|
|
22
|
-
if (next === "none" && prev !== "none" && state.selectedRows.value.length > 0) state.selectedRows.value = [];
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Wire up selection reconciliation on results change.
|
|
27
|
-
*
|
|
28
|
-
* The watcher distinguishes results-replacement (query / invalidate /
|
|
29
|
-
* pagination jump) from results-extension in EITHER direction (queryNext /
|
|
30
|
-
* forward-merging loadRange / backward-merging loadRange) and only runs the
|
|
31
|
-
* reconciliation logic on replacement. Backward extension prepends rows AND
|
|
32
|
-
* decrements `resultsStart` — caught via the last-row reference identity
|
|
33
|
-
* check, so scrolling upward doesn't silently mutate selection.
|
|
34
|
-
*
|
|
35
|
-
* Mode semantics on results-replacement:
|
|
36
|
-
* - `"persist"` — no-op; the consumer's ref is untouched.
|
|
37
|
-
* - `"trim"` (default) — keep the subset of selected PKs still present in the new results.
|
|
38
|
-
* - `"clear"` — drop everything.
|
|
39
|
-
*/
|
|
40
|
-
function useTableSelection(state, opts) {
|
|
41
|
-
const mode = opts?.mode ?? "trim";
|
|
42
|
-
watch([() => state.results.value, () => state.resultsStart.value], ([newResults, newResultsStart], [oldResults, oldResultsStart]) => {
|
|
43
|
-
if (mode === "persist") return;
|
|
44
|
-
if (state.selectedRows.value.length === 0) return;
|
|
45
|
-
const oldArr = oldResults ?? [];
|
|
46
|
-
const newArr = newResults;
|
|
47
|
-
const oldStart = oldResultsStart ?? 0;
|
|
48
|
-
const delta = newArr.length - oldArr.length;
|
|
49
|
-
if (delta > 0 && oldArr.length > 0) {
|
|
50
|
-
if (newResultsStart === oldStart && newArr[0] === oldArr[0]) return;
|
|
51
|
-
if (newResultsStart === oldStart - delta && newArr[newArr.length - 1] === oldArr[oldArr.length - 1]) return;
|
|
52
|
-
}
|
|
53
|
-
if (mode === "clear") {
|
|
54
|
-
state.selectedRows.value = [];
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const presentPks = /* @__PURE__ */ new Set();
|
|
58
|
-
for (const r of newArr) presentPks.add(state.rowValueFn(r));
|
|
59
|
-
state.selectedRows.value = trimSelection(state.selectedRows.value, presentPks);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
63
8
|
//#region src/composables/use-cell-resolver.ts
|
|
64
9
|
/** Frozen sentinel for columns with no cell-level annotations. */
|
|
65
10
|
const EMPTY_BINDINGS = Object.freeze({});
|
|
@@ -170,14 +115,23 @@ function buildScope(state, row, rowIndex) {
|
|
|
170
115
|
* 2. `column.type` → `ctx.types[type]`
|
|
171
116
|
* 3. fallback → `AsTableCellValue`
|
|
172
117
|
*
|
|
118
|
+
* The synthesized `__actions` pseudo-column is chrome, not data — it
|
|
119
|
+
* dispatches through `controls.rowActions` first, then the `:types` entry,
|
|
120
|
+
* then the built-in `AsRowActions`.
|
|
121
|
+
*
|
|
173
122
|
* Hoisted out of the per-cell render path because the answer is identical for
|
|
174
123
|
* every row in a given column — a 50×10 table avoids ~500 redundant lookups.
|
|
175
124
|
*/
|
|
176
125
|
function useCellComponents(getColumns) {
|
|
177
126
|
const ctx = useTableContextOptional();
|
|
127
|
+
const RowActions = useTableComponent("rowActions", ctx?.types?.["__actions"] ?? as_row_actions_default);
|
|
178
128
|
return computed(() => {
|
|
179
129
|
const out = {};
|
|
180
130
|
for (const col of getColumns()) {
|
|
131
|
+
if (col.type === "__actions") {
|
|
132
|
+
out[col.path] = RowActions;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
181
135
|
let resolved;
|
|
182
136
|
if (col.component) resolved = ctx?.components?.[col.component];
|
|
183
137
|
resolved ??= ctx?.types?.[col.type] ?? as_table_cell_value_default;
|
|
@@ -457,6 +411,7 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
457
411
|
"select-all-toggle"
|
|
458
412
|
],
|
|
459
413
|
setup(__props, { emit: __emit }) {
|
|
414
|
+
const HeaderCell = useTableComponent("headerCell", as_table_header_cell_default);
|
|
460
415
|
const props = __props;
|
|
461
416
|
const emit = __emit;
|
|
462
417
|
const sortMap = computed(() => {
|
|
@@ -532,7 +487,7 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
532
487
|
}, [!col.fixed ? renderSlot(_ctx.$slots, `header-${col.path}`, {
|
|
533
488
|
key: 0,
|
|
534
489
|
column: col
|
|
535
|
-
}, () => [
|
|
490
|
+
}, () => [(openBlock(), createBlock(resolveDynamicComponent(unref(HeaderCell)), {
|
|
536
491
|
column: col,
|
|
537
492
|
"sort-direction": sortMap.value[col.path] ?? null,
|
|
538
493
|
filters: __props.filters?.[col.path],
|
|
@@ -543,13 +498,13 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
543
498
|
onFilter: _cache[3] || (_cache[3] = (c) => emit("filter", c)),
|
|
544
499
|
onFiltersOff: _cache[4] || (_cache[4] = (c) => emit("filters-off", c)),
|
|
545
500
|
onResetWidth: _cache[5] || (_cache[5] = (c) => emit("reset-width", c))
|
|
546
|
-
}, null,
|
|
501
|
+
}, null, 40, [
|
|
547
502
|
"column",
|
|
548
503
|
"sort-direction",
|
|
549
504
|
"filters",
|
|
550
505
|
"column-menu",
|
|
551
506
|
"width-entry"
|
|
552
|
-
])]) : createCommentVNode("v-if", true), __props.resizable && !col.fixed ? (openBlock(), createElementBlock("div", {
|
|
507
|
+
]))]) : createCommentVNode("v-if", true), __props.resizable && !col.fixed ? (openBlock(), createElementBlock("div", {
|
|
553
508
|
key: 1,
|
|
554
509
|
class: "as-th-resize-handle",
|
|
555
510
|
draggable: "false",
|
|
@@ -680,4 +635,4 @@ var as_table_status_default = /* @__PURE__ */ defineComponent({
|
|
|
680
635
|
}
|
|
681
636
|
});
|
|
682
637
|
//#endregion
|
|
683
|
-
export { useCellResolver as a, useCellComponents as i, as_table_header_default as n,
|
|
638
|
+
export { useCellResolver as a, useCellComponents as i, as_table_header_default as n, useRafBatch as r, as_table_status_default as t };
|
package/dist/as-table.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_table = require("./as-table-
|
|
1
|
+
const require_as_table = require("./as-table-DyuL_hUo.cjs");
|
|
2
2
|
module.exports = require_as_table.as_table_default;
|
package/dist/as-table.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table.vue-
|
|
1
|
+
import { t as _default } from "./as-table.vue-kFORh8Vg.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-table.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table.vue-
|
|
1
|
+
import { t as _default } from "./as-table.vue-CE_7OC_h.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-table.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_table_default } from "./as-table-
|
|
1
|
+
import { t as as_table_default } from "./as-table-H5uKWieH.mjs";
|
|
2
2
|
export { as_table_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-
|
|
1
|
+
import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-BWeFiZKk.mjs";
|
|
2
2
|
import { ColumnDef } from "@atscript/ui";
|
|
3
3
|
import * as vue from "vue";
|
|
4
4
|
import { SelectionMode } from "@atscript/ui-table";
|
|
@@ -53,13 +53,13 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof _
|
|
|
53
53
|
'query-loading'?: (props: typeof __VLS_24) => any;
|
|
54
54
|
};
|
|
55
55
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
56
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
56
57
|
"row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
57
58
|
"row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
58
|
-
"main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
59
59
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
60
61
|
"onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
61
62
|
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
62
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
63
63
|
}>, {
|
|
64
64
|
select: SelectionMode;
|
|
65
65
|
stickyHeader: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-
|
|
1
|
+
import { f as RowDeleteOpt, n as ColumnMenuConfig } from "./types-BPFBxUS_.cjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { ColumnDef } from "@atscript/ui";
|
|
4
4
|
import { SelectionMode } from "@atscript/ui-table";
|
|
@@ -53,13 +53,13 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof _
|
|
|
53
53
|
'query-loading'?: (props: typeof __VLS_24) => any;
|
|
54
54
|
};
|
|
55
55
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
56
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
56
57
|
"row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
57
58
|
"row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
58
|
-
"main-action": (row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
59
59
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
60
61
|
"onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
61
62
|
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
62
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
63
63
|
}>, {
|
|
64
64
|
select: SelectionMode;
|
|
65
65
|
stickyHeader: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { a as useTableContext, i as useRegisterMainActionListener } from "./use-table-state-CuZ2OXoY.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as getCellValue } from "./get-cell-value-
|
|
2
|
+
import { t as useSelectModeReset } from "./use-table-selection-C84z4OZy.mjs";
|
|
3
|
+
import { t as useHasEmitListener } from "./use-has-emit-listener-BTMDIv2e.mjs";
|
|
4
|
+
import { t as getCellValue } from "./get-cell-value-C8LLc_Rr.mjs";
|
|
5
|
+
import { a as useCellResolver, i as useCellComponents, n as as_table_header_default, r as useRafBatch, t as as_table_status_default } from "./as-table-status-Dinns93w.mjs";
|
|
6
|
+
import { t as useTableColumnHandlers } from "./use-table-column-handlers-cm0GxR2u.mjs";
|
|
5
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
6
8
|
import { DEFAULT_ROW_HEIGHT_PX, clampTopIndex, filledFilterCount } from "@atscript/ui-table";
|
|
7
9
|
import { useElementSize, useResizeObserver } from "@vueuse/core";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const require_use_table_state = require("./use-table-state-DFQ30m-j.cjs");
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_get_cell_value = require("./get-cell-value-
|
|
2
|
+
const require_use_table_selection = require("./use-table-selection-Cmiu1h4S.cjs");
|
|
3
|
+
const require_use_has_emit_listener = require("./use-has-emit-listener-hhOH8CBI.cjs");
|
|
4
|
+
const require_get_cell_value = require("./get-cell-value-4rHKP-TG.cjs");
|
|
5
|
+
const require_as_table_status = require("./as-table-status-DZP8dFpm.cjs");
|
|
6
|
+
const require_use_table_column_handlers = require("./use-table-column-handlers-BgC4gUJV.cjs");
|
|
5
7
|
let vue = require("vue");
|
|
6
8
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
7
9
|
let _vueuse_core = require("@vueuse/core");
|
|
@@ -646,8 +648,8 @@ var as_window_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
646
648
|
(0, vue.watch)(() => props.rowDelete, (val) => {
|
|
647
649
|
state.rowDelete.value = val;
|
|
648
650
|
}, { immediate: true });
|
|
649
|
-
|
|
650
|
-
require_use_table_state.useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event),
|
|
651
|
+
require_use_table_selection.useSelectModeReset(state, () => props.select);
|
|
652
|
+
require_use_table_state.useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event), require_use_has_emit_listener.useHasEmitListener("onMainAction"));
|
|
651
653
|
const containerRef = (0, vue.ref)(null);
|
|
652
654
|
function onMetrics({ fits, rowHeightPx, chromePx }) {
|
|
653
655
|
const minR = props.rows ?? props.minRows;
|
package/dist/as-window-table.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_window_table = require("./as-window-table-
|
|
1
|
+
const require_as_window_table = require("./as-window-table-CCRJKpoE.cjs");
|
|
2
2
|
module.exports = require_as_window_table.as_window_table_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-window-table.vue-
|
|
1
|
+
import { t as _default } from "./as-window-table.vue-C60NtRtq.cjs";
|
|
2
2
|
export = _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-window-table.vue-
|
|
1
|
+
import { t as _default } from "./as-window-table.vue-C88OoW5d.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-window-table.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_window_table_default } from "./as-window-table-
|
|
1
|
+
import { t as as_window_table_default } from "./as-window-table-BwF2t4Zy.mjs";
|
|
2
2
|
export { as_window_table_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-
|
|
1
|
+
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-BPFBxUS_.cjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { SelectionMode } from "@atscript/ui-table";
|
|
4
4
|
|
|
@@ -57,14 +57,14 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof _
|
|
|
57
57
|
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
58
58
|
};
|
|
59
59
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
60
|
+
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
60
61
|
"row-click": (row: Row, event: MouseEvent) => any;
|
|
61
62
|
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
62
|
-
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
63
63
|
error: (error: Error, kind: QueryErrorKind) => any;
|
|
64
64
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
65
66
|
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
66
67
|
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
67
|
-
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
68
68
|
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
69
69
|
}>, {
|
|
70
70
|
select: SelectionMode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-
|
|
1
|
+
import { a as EnterAction, f as RowDeleteOpt, n as ColumnMenuConfig, u as QueryErrorKind } from "./types-BWeFiZKk.mjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { SelectionMode } from "@atscript/ui-table";
|
|
4
4
|
|
|
@@ -57,14 +57,14 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof _
|
|
|
57
57
|
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
58
58
|
};
|
|
59
59
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
60
|
+
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
60
61
|
"row-click": (row: Row, event: MouseEvent) => any;
|
|
61
62
|
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
62
|
-
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
63
63
|
error: (error: Error, kind: QueryErrorKind) => any;
|
|
64
64
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
65
66
|
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
66
67
|
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
67
|
-
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
68
68
|
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
69
69
|
}>, {
|
|
70
70
|
select: SelectionMode;
|
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_use_table_state = require("./use-table-state-DFQ30m-j.cjs");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
3
|
+
const require_use_table_selection = require("./use-table-selection-Cmiu1h4S.cjs");
|
|
4
|
+
const require_use_table = require("./use-table-CLsp2mAu.cjs");
|
|
5
|
+
const require_use_table_nav_bridge = require("./use-table-nav-bridge-Bh1tpG0X.cjs");
|
|
6
|
+
const require_use_table_component = require("./use-table-component-CirEOQ_P.cjs");
|
|
7
|
+
const require_get_cell_value = require("./get-cell-value-4rHKP-TG.cjs");
|
|
8
|
+
const require_as_cell_array = require("./as-cell-array-iPeUnk2G.cjs");
|
|
9
|
+
const require_as_cell_date = require("./as-cell-date-DyixWKuS.cjs");
|
|
10
|
+
const require_use_cell_locale = require("./use-cell-locale-BGBRQB7s.cjs");
|
|
11
|
+
const require_as_cell_json = require("./as-cell-json-Bvv2P7YV.cjs");
|
|
12
|
+
const require_as_cell_number = require("./as-cell-number-DuPMOesI.cjs");
|
|
13
|
+
const require_format_cell = require("./format-cell-CSbJgz5B.cjs");
|
|
14
|
+
const require_as_cell_union = require("./as-cell-union-CT0rIvQq.cjs");
|
|
15
|
+
const require_as_column_menu = require("./as-column-menu-fZVbJ9lU.cjs");
|
|
16
|
+
const require_as_config_dialog = require("./as-config-dialog-vOUtx5zq.cjs");
|
|
17
|
+
const require_as_confirm_dialog = require("./as-confirm-dialog-C6HAGzrj.cjs");
|
|
18
|
+
const require_as_filter_input = require("./as-filter-input-DJu2k9gO.cjs");
|
|
19
|
+
const require_as_filter_dialog = require("./as-filter-dialog-BcPI27cn.cjs");
|
|
20
|
+
const require_as_table_header_cell = require("./as-table-header-cell-DWONx2MI.cjs");
|
|
21
|
+
const require_as_window_table = require("./as-window-table-CCRJKpoE.cjs");
|
|
22
|
+
const require_as_filter_field = require("./as-filter-field-B8idz2UD.cjs");
|
|
23
|
+
const require_as_filters = require("./as-filters-BzdQ4HUx.cjs");
|
|
24
|
+
const require_as_preset_dialog = require("./as-preset-dialog-DOdrDDKy.cjs");
|
|
25
|
+
const require_as_row_actions = require("./as-row-actions-05pQX_om.cjs");
|
|
26
|
+
const require_as_table_cell_value = require("./as-table-cell-value-CcWR5oG4.cjs");
|
|
27
|
+
const require_as_table_root = require("./as-table-root-Cg2zkxR5.cjs");
|
|
28
|
+
const require_as_table = require("./as-table-DyuL_hUo.cjs");
|
|
29
|
+
const require_as_table_actions = require("./as-table-actions-CsdY2_BG.cjs");
|
|
30
|
+
const require_as_preset_picker = require("./as-preset-picker-2DkH7QfW.cjs");
|
|
28
31
|
let _atscript_ui = require("@atscript/ui");
|
|
29
32
|
let vue = require("vue");
|
|
30
33
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
@@ -254,7 +257,7 @@ function instanceKey(app, url) {
|
|
|
254
257
|
* ```
|
|
255
258
|
*/
|
|
256
259
|
function useAppPrefs(opts) {
|
|
257
|
-
const app =
|
|
260
|
+
const app = require_use_table.injectPresetsApp(opts.app);
|
|
258
261
|
const key = instanceKey(app, opts.url);
|
|
259
262
|
const existing = REGISTRY.get(key);
|
|
260
263
|
if (existing) {
|
|
@@ -423,13 +426,6 @@ function createChannel(app) {
|
|
|
423
426
|
}
|
|
424
427
|
}
|
|
425
428
|
//#endregion
|
|
426
|
-
//#region src/composables/use-table-component.ts
|
|
427
|
-
/** Resolve a single skin-slot component from the injected `controls` map, falling back to the default. */
|
|
428
|
-
function useTableComponent(key, fallback) {
|
|
429
|
-
const { controls } = require_use_table_state.useTableContext();
|
|
430
|
-
return controls[key] ?? fallback;
|
|
431
|
-
}
|
|
432
|
-
//#endregion
|
|
433
429
|
//#region src/composables/create-default-controls.ts
|
|
434
430
|
/**
|
|
435
431
|
* Returns a fresh skin-slot map pre-filled with all built-in defaults.
|
|
@@ -439,6 +435,11 @@ function useTableComponent(key, fallback) {
|
|
|
439
435
|
* const controls = { ...createDefaultControls(), filterDialog: MyFilterDialog }
|
|
440
436
|
* ```
|
|
441
437
|
*
|
|
438
|
+
* `rowActions` is intentionally not seeded — the row-actions column
|
|
439
|
+
* already falls back to the `types` map's `__actions` entry and then the
|
|
440
|
+
* built-in renderer. Set `controls.rowActions` only to override explicitly
|
|
441
|
+
* (it wins over the `types` entry).
|
|
442
|
+
*
|
|
442
443
|
* `actionFormDialog` is intentionally not seeded — the table root
|
|
443
444
|
* lazy-mounts it only when an `@InputForm` action is detected. To override
|
|
444
445
|
* or eager-load, import from `@atscript/vue-table/as-action-form-dialog`
|
|
@@ -452,8 +453,7 @@ function createDefaultControls() {
|
|
|
452
453
|
filterInput: require_as_filter_input.as_filter_input_default,
|
|
453
454
|
filterField: require_as_filter_field.as_filter_field_default,
|
|
454
455
|
configDialog: require_as_config_dialog.as_config_dialog_default,
|
|
455
|
-
confirmDialog: require_as_confirm_dialog.as_confirm_dialog_default
|
|
456
|
-
rowActions: require_as_row_actions.as_row_actions_default
|
|
456
|
+
confirmDialog: require_as_confirm_dialog.as_confirm_dialog_default
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
//#endregion
|
|
@@ -498,13 +498,15 @@ function getColumnWidth(column) {
|
|
|
498
498
|
return column.width || DEFAULT_WIDTHS[column.type] || "15em";
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
|
-
exports.AS_PRESETS_APP =
|
|
501
|
+
exports.AS_PRESETS_APP = require_use_table.AS_PRESETS_APP;
|
|
502
502
|
exports.AsCellArray = require_as_cell_array.as_cell_array_default;
|
|
503
503
|
exports.AsCellDate = require_as_cell_date.as_cell_date_default;
|
|
504
504
|
exports.AsCellJson = require_as_cell_json.as_cell_json_default;
|
|
505
505
|
exports.AsCellNumber = require_as_cell_number.as_cell_number_default;
|
|
506
|
+
exports.AsCellUnion = require_as_cell_union.as_cell_union_default;
|
|
506
507
|
exports.AsColumnMenu = require_as_column_menu.as_column_menu_default;
|
|
507
508
|
exports.AsConfigDialog = require_as_config_dialog.as_config_dialog_default;
|
|
509
|
+
exports.AsConfirmDialog = require_as_confirm_dialog.as_confirm_dialog_default;
|
|
508
510
|
exports.AsFilterDialog = require_as_filter_dialog.as_filter_dialog_default;
|
|
509
511
|
exports.AsFilterField = require_as_filter_field.as_filter_field_default;
|
|
510
512
|
exports.AsFilterInput = require_as_filter_input.as_filter_input_default;
|
|
@@ -536,7 +538,7 @@ Object.defineProperty(exports, "SYSTEM_PRESET_PREFIX", {
|
|
|
536
538
|
return _atscript_ui_table.SYSTEM_PRESET_PREFIX;
|
|
537
539
|
}
|
|
538
540
|
});
|
|
539
|
-
exports.clearTableCache =
|
|
541
|
+
exports.clearTableCache = require_use_table.clearTableCache;
|
|
540
542
|
exports.createDefaultCellTypes = createDefaultCellTypes;
|
|
541
543
|
exports.createDefaultControls = createDefaultControls;
|
|
542
544
|
exports.createStaticTableState = require_use_table_state.createStaticTableState;
|
|
@@ -551,7 +553,7 @@ Object.defineProperty(exports, "getDefaultClientFactory", {
|
|
|
551
553
|
return _atscript_ui.getDefaultClientFactory;
|
|
552
554
|
}
|
|
553
555
|
});
|
|
554
|
-
exports.injectPresetsApp =
|
|
556
|
+
exports.injectPresetsApp = require_use_table.injectPresetsApp;
|
|
555
557
|
Object.defineProperty(exports, "isSystemPresetId", {
|
|
556
558
|
enumerable: true,
|
|
557
559
|
get: function() {
|
|
@@ -579,15 +581,15 @@ Object.defineProperty(exports, "setDefaultClientFactory", {
|
|
|
579
581
|
});
|
|
580
582
|
exports.useAppPrefs = useAppPrefs;
|
|
581
583
|
exports.useCellLocale = require_use_cell_locale.useCellLocale;
|
|
582
|
-
exports.useLocalDraft =
|
|
583
|
-
exports.usePresets =
|
|
584
|
-
exports.useTable =
|
|
584
|
+
exports.useLocalDraft = require_use_table.useLocalDraft;
|
|
585
|
+
exports.usePresets = require_use_table.usePresets;
|
|
586
|
+
exports.useTable = require_use_table.useTable;
|
|
585
587
|
exports.useTableActions = useTableActions;
|
|
586
|
-
exports.useTableComponent = useTableComponent;
|
|
588
|
+
exports.useTableComponent = require_use_table_component.useTableComponent;
|
|
587
589
|
exports.useTableContext = require_use_table_state.useTableContext;
|
|
588
590
|
exports.useTableContextOptional = require_use_table_state.useTableContextOptional;
|
|
589
591
|
exports.useTableFilter = useTableFilter;
|
|
590
|
-
exports.useTableNavBridge =
|
|
592
|
+
exports.useTableNavBridge = require_use_table_nav_bridge.useTableNavBridge;
|
|
591
593
|
exports.useTableSearch = useTableSearch;
|
|
592
|
-
exports.useTableSelection =
|
|
594
|
+
exports.useTableSelection = require_use_table_selection.useTableSelection;
|
|
593
595
|
exports.useTableUrlQuery = useTableUrlQuery;
|