@atscript/vue-table 0.1.58
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/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/as-action-form-dialog.cjs +221 -0
- package/dist/as-action-form-dialog.d.cts +6 -0
- package/dist/as-action-form-dialog.d.mts +7 -0
- package/dist/as-action-form-dialog.mjs +221 -0
- package/dist/as-action-menu-content-CXsdPn42.mjs +104 -0
- package/dist/as-action-menu-content-CyUfBrWH.cjs +109 -0
- package/dist/as-cell-array-CXeZzZqt.cjs +69 -0
- package/dist/as-cell-array-DOQKR6t5.mjs +64 -0
- package/dist/as-cell-array.cjs +3 -0
- package/dist/as-cell-array.d.cts +2 -0
- package/dist/as-cell-array.d.mts +2 -0
- package/dist/as-cell-array.mjs +3 -0
- package/dist/as-cell-array.vue-DZGM2VHh.d.mts +12 -0
- package/dist/as-cell-array.vue-pFs5GcCR.d.cts +12 -0
- package/dist/as-cell-date-CTrvxS1h.cjs +78 -0
- package/dist/as-cell-date-Cq49RHmL.mjs +73 -0
- package/dist/as-cell-date.cjs +3 -0
- package/dist/as-cell-date.d.cts +2 -0
- package/dist/as-cell-date.d.mts +2 -0
- package/dist/as-cell-date.mjs +3 -0
- package/dist/as-cell-date.vue-BBSps2B2.d.cts +12 -0
- package/dist/as-cell-date.vue-Zlt4mHWb.d.mts +12 -0
- package/dist/as-cell-json-BynWIs1d.mjs +37 -0
- package/dist/as-cell-json-DvHvQ6IL.cjs +42 -0
- package/dist/as-cell-json-popover-BWdNs1YU.cjs +70 -0
- package/dist/as-cell-json-popover-DUq25I0L.mjs +65 -0
- package/dist/as-cell-json.cjs +3 -0
- package/dist/as-cell-json.d.cts +2 -0
- package/dist/as-cell-json.d.mts +2 -0
- package/dist/as-cell-json.mjs +3 -0
- package/dist/as-cell-json.vue-C6wg4ARZ.d.cts +12 -0
- package/dist/as-cell-json.vue-CESWuCer.d.mts +12 -0
- package/dist/as-cell-number-0_WrSCzu.cjs +76 -0
- package/dist/as-cell-number-Bc1C97Vg.mjs +71 -0
- package/dist/as-cell-number.cjs +3 -0
- package/dist/as-cell-number.d.cts +2 -0
- package/dist/as-cell-number.d.mts +2 -0
- package/dist/as-cell-number.mjs +3 -0
- package/dist/as-cell-number.vue-1Oq7nVI3.d.mts +12 -0
- package/dist/as-cell-number.vue-CJ2K5zeM.d.cts +12 -0
- package/dist/as-cell-union-C1w3B38J.mjs +88 -0
- package/dist/as-cell-union-CFAI0utz.cjs +93 -0
- package/dist/as-cell-union.cjs +4 -0
- package/dist/as-cell-union.d.cts +2 -0
- package/dist/as-cell-union.d.mts +2 -0
- package/dist/as-cell-union.mjs +4 -0
- package/dist/as-cell-union.vue-CslPM_c2.d.cts +12 -0
- package/dist/as-cell-union.vue-NnDmQZOA.d.mts +12 -0
- package/dist/as-column-menu-CH9Htz0Q.cjs +220 -0
- package/dist/as-column-menu-DCfhorMP.mjs +215 -0
- package/dist/as-column-menu.cjs +2 -0
- package/dist/as-column-menu.d.cts +2 -0
- package/dist/as-column-menu.d.mts +2 -0
- package/dist/as-column-menu.mjs +2 -0
- package/dist/as-column-menu.vue-C9e6wJ3z.d.mts +47 -0
- package/dist/as-column-menu.vue-o0qFdzoL.d.cts +47 -0
- package/dist/as-config-dialog-d2k7_l0U.cjs +699 -0
- package/dist/as-config-dialog-vRklaKbi.mjs +688 -0
- package/dist/as-config-dialog.cjs +3 -0
- package/dist/as-config-dialog.d.cts +2 -0
- package/dist/as-config-dialog.d.mts +2 -0
- package/dist/as-config-dialog.mjs +3 -0
- package/dist/as-config-dialog.vue-C6Q62xF5.d.mts +7 -0
- package/dist/as-config-dialog.vue-DvvJi3xx.d.cts +7 -0
- package/dist/as-confirm-dialog-BLh3Ju4-.mjs +52 -0
- package/dist/as-confirm-dialog-BgpIEE2z.cjs +57 -0
- package/dist/as-confirm-dialog.cjs +3 -0
- package/dist/as-confirm-dialog.d.cts +2 -0
- package/dist/as-confirm-dialog.d.mts +2 -0
- package/dist/as-confirm-dialog.mjs +3 -0
- package/dist/as-confirm-dialog.vue-CXxLpzbu.d.cts +7 -0
- package/dist/as-confirm-dialog.vue-pas8jGhv.d.mts +7 -0
- package/dist/as-filter-dialog-C0HMpUPT.mjs +610 -0
- package/dist/as-filter-dialog-DcGvIV3h.cjs +621 -0
- package/dist/as-filter-dialog.cjs +15 -0
- package/dist/as-filter-dialog.d.cts +2 -0
- package/dist/as-filter-dialog.d.mts +2 -0
- package/dist/as-filter-dialog.mjs +15 -0
- package/dist/as-filter-dialog.vue-BV2J8PgZ.d.cts +7 -0
- package/dist/as-filter-dialog.vue-RDZjp4gJ.d.mts +7 -0
- package/dist/as-filter-field-B_tYzvvl.cjs +984 -0
- package/dist/as-filter-field-Bqvu2ASN.mjs +943 -0
- package/dist/as-filter-field.cjs +9 -0
- package/dist/as-filter-field.d.cts +2 -0
- package/dist/as-filter-field.d.mts +2 -0
- package/dist/as-filter-field.mjs +9 -0
- package/dist/as-filter-field.vue-ByQ8xIGq.d.cts +11 -0
- package/dist/as-filter-field.vue-QY8wi5S5.d.mts +11 -0
- package/dist/as-filter-input--nr72iwX.cjs +106 -0
- package/dist/as-filter-input-P1i0CW2-.mjs +101 -0
- package/dist/as-filter-input.cjs +2 -0
- package/dist/as-filter-input.d.cts +2 -0
- package/dist/as-filter-input.d.mts +2 -0
- package/dist/as-filter-input.mjs +2 -0
- package/dist/as-filter-input.vue-CBQ71eNg.d.mts +18 -0
- package/dist/as-filter-input.vue-CS4nOk_Q.d.cts +18 -0
- package/dist/as-filters-Bxa9ZEMm.mjs +44 -0
- package/dist/as-filters-xRT2qv56.cjs +49 -0
- package/dist/as-filters.cjs +10 -0
- package/dist/as-filters.d.cts +2 -0
- package/dist/as-filters.d.mts +2 -0
- package/dist/as-filters.mjs +10 -0
- package/dist/as-filters.vue-BsMgYUcX.d.mts +10 -0
- package/dist/as-filters.vue-fv-tRL2H.d.cts +10 -0
- package/dist/as-preset-dialog-BaTfwMnh.cjs +569 -0
- package/dist/as-preset-dialog-BdDRgwf_.mjs +564 -0
- package/dist/as-preset-dialog.cjs +4 -0
- package/dist/as-preset-dialog.d.cts +2 -0
- package/dist/as-preset-dialog.d.mts +2 -0
- package/dist/as-preset-dialog.mjs +4 -0
- package/dist/as-preset-dialog.vue-Bzv-ON9W.d.mts +7 -0
- package/dist/as-preset-dialog.vue-DP9fy00Y.d.cts +7 -0
- package/dist/as-preset-picker-BQbNEiy9.mjs +427 -0
- package/dist/as-preset-picker-Ce3crTQy.cjs +432 -0
- package/dist/as-preset-picker.cjs +4 -0
- package/dist/as-preset-picker.d.cts +2 -0
- package/dist/as-preset-picker.d.mts +2 -0
- package/dist/as-preset-picker.mjs +4 -0
- package/dist/as-preset-picker.vue-CTBk6leV.d.mts +7 -0
- package/dist/as-preset-picker.vue-DfXS3pGl.d.cts +7 -0
- package/dist/as-row-actions-B6Kob6gt.cjs +120 -0
- package/dist/as-row-actions-CeWBBGqh.mjs +115 -0
- package/dist/as-row-actions.cjs +4 -0
- package/dist/as-row-actions.d.cts +2 -0
- package/dist/as-row-actions.d.mts +2 -0
- package/dist/as-row-actions.mjs +4 -0
- package/dist/as-row-actions.vue-BPaQfGev.d.mts +11 -0
- package/dist/as-row-actions.vue-Bvcc2tUN.d.cts +11 -0
- package/dist/as-table-Cnw2fOqZ.mjs +204 -0
- package/dist/as-table-DlDFxdXI.cjs +209 -0
- package/dist/as-table-actions-BK1Thy2G.cjs +142 -0
- package/dist/as-table-actions-BpMiNFni.mjs +137 -0
- package/dist/as-table-actions.cjs +4 -0
- package/dist/as-table-actions.d.cts +2 -0
- package/dist/as-table-actions.d.mts +2 -0
- package/dist/as-table-actions.mjs +4 -0
- package/dist/as-table-actions.vue-B7Q-JA3z.d.cts +47 -0
- package/dist/as-table-actions.vue-Bs1Jl1ep.d.mts +47 -0
- package/dist/as-table-base-D0k4k7k_.mjs +646 -0
- package/dist/as-table-base-VIz-B_6_.cjs +651 -0
- package/dist/as-table-cell-value-B1CiJYFn.mjs +26 -0
- package/dist/as-table-cell-value-CuxRtFn9.cjs +31 -0
- package/dist/as-table-cell-value.cjs +3 -0
- package/dist/as-table-cell-value.d.cts +2 -0
- package/dist/as-table-cell-value.d.mts +2 -0
- package/dist/as-table-cell-value.mjs +3 -0
- package/dist/as-table-cell-value.vue-BgFDv2JQ.d.cts +12 -0
- package/dist/as-table-cell-value.vue-BuPCQ8YA.d.mts +12 -0
- package/dist/as-table-header-cell-C3zeZUZo.cjs +117 -0
- package/dist/as-table-header-cell-CBn_ioCe.mjs +112 -0
- package/dist/as-table-header-cell.cjs +3 -0
- package/dist/as-table-header-cell.d.cts +2 -0
- package/dist/as-table-header-cell.d.mts +2 -0
- package/dist/as-table-header-cell.mjs +3 -0
- package/dist/as-table-header-cell.vue-Bc_DSsGY.d.cts +31 -0
- package/dist/as-table-header-cell.vue-DNMOHfek.d.mts +31 -0
- package/dist/as-table-root-Br6WcGRo.cjs +263 -0
- package/dist/as-table-root-gG7pTIdD.mjs +258 -0
- package/dist/as-table-root.cjs +28 -0
- package/dist/as-table-root.d.cts +2 -0
- package/dist/as-table-root.d.mts +2 -0
- package/dist/as-table-root.mjs +28 -0
- package/dist/as-table-root.vue-5_OhVwse.d.mts +2258 -0
- package/dist/as-table-root.vue-CSqEtIll.d.cts +2258 -0
- package/dist/as-table-status-BjRGGuhC.mjs +683 -0
- package/dist/as-table-status-DWYoJIMC.cjs +724 -0
- package/dist/as-table.cjs +10 -0
- package/dist/as-table.d.cts +2 -0
- package/dist/as-table.d.mts +2 -0
- package/dist/as-table.mjs +10 -0
- package/dist/as-table.vue-BTYg-e3Z.d.mts +81 -0
- package/dist/as-table.vue-wdRARLIe.d.cts +81 -0
- package/dist/as-window-table-CKIfo3M_.mjs +709 -0
- package/dist/as-window-table-DE7_NyEP.cjs +714 -0
- package/dist/as-window-table.cjs +9 -0
- package/dist/as-window-table.d.cts +2 -0
- package/dist/as-window-table.d.mts +2 -0
- package/dist/as-window-table.mjs +9 -0
- package/dist/as-window-table.vue-Bf8xGC9M.d.mts +86 -0
- package/dist/as-window-table.vue-CA8qsrz4.d.cts +86 -0
- package/dist/format-cell-B2xMDYO9.mjs +27 -0
- package/dist/format-cell-D4mqaN0E.cjs +32 -0
- package/dist/get-cell-value-CZSVfDLg.cjs +19 -0
- package/dist/get-cell-value-DiH84HKL.mjs +14 -0
- package/dist/index.cjs +598 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +505 -0
- package/dist/preset-aspect-display-BYeiSgcc.mjs +43 -0
- package/dist/preset-aspect-display-y8aal_EF.cjs +72 -0
- package/dist/types-BvvXN72P.d.mts +531 -0
- package/dist/types-CNMmF6W2.d.cts +531 -0
- package/dist/use-cell-locale-1uQaFTLQ.mjs +23 -0
- package/dist/use-cell-locale-B480_QYK.cjs +34 -0
- package/dist/use-table-column-handlers-CGYAY2xH.cjs +65 -0
- package/dist/use-table-column-handlers-t6xi1yCE.mjs +54 -0
- package/dist/use-table-state-C4JbonEZ.mjs +1822 -0
- package/dist/use-table-state-MU-vuzui.cjs +1917 -0
- package/package.json +195 -0
- package/styles.d.ts +2 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
const require_use_table_state = require("./use-table-state-MU-vuzui.cjs");
|
|
2
|
+
const require_as_table_cell_value = require("./as-table-cell-value-CuxRtFn9.cjs");
|
|
3
|
+
const require_as_table_header_cell = require("./as-table-header-cell-C3zeZUZo.cjs");
|
|
4
|
+
let _atscript_ui = require("@atscript/ui");
|
|
5
|
+
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
|
+
//#region src/composables/use-cell-resolver.ts
|
|
64
|
+
/** Frozen sentinel for columns with no cell-level annotations. */
|
|
65
|
+
const EMPTY_BINDINGS = Object.freeze({});
|
|
66
|
+
const TABLE_FN_KEYS = {
|
|
67
|
+
staticKey: _atscript_ui.UI_TABLE_ATTR,
|
|
68
|
+
fnKey: _atscript_ui.UI_TABLE_FN_ATTR
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Per-`TableDef.type` cache of column resolution metadata. Avoids re-probing
|
|
72
|
+
* per-key annotations on every cell render. The flat type tree itself is
|
|
73
|
+
* already pre-built on `TableDef.flatMap`.
|
|
74
|
+
*/
|
|
75
|
+
const metaCache = /* @__PURE__ */ new WeakMap();
|
|
76
|
+
const EMPTY_META_MAP = /* @__PURE__ */ new Map();
|
|
77
|
+
function getColumnMetaMap(def) {
|
|
78
|
+
if (def.type === null || typeof def.type !== "object") return EMPTY_META_MAP;
|
|
79
|
+
let map = metaCache.get(def.type);
|
|
80
|
+
if (map) return map;
|
|
81
|
+
map = /* @__PURE__ */ new Map();
|
|
82
|
+
for (const [path, prop] of def.flatMap.entries()) {
|
|
83
|
+
if (path === "") continue;
|
|
84
|
+
const m = prop.metadata;
|
|
85
|
+
const hasFnClasses = m.has(_atscript_ui.UI_TABLE_FN_CLASSES);
|
|
86
|
+
const hasFnStyles = m.has(_atscript_ui.UI_TABLE_FN_STYLES);
|
|
87
|
+
const hasFnAttrs = m.has(_atscript_ui.UI_TABLE_FN_ATTR);
|
|
88
|
+
const hasClasses = hasFnClasses || m.has(_atscript_ui.UI_TABLE_CLASSES);
|
|
89
|
+
const hasStyles = hasFnStyles || m.has(_atscript_ui.UI_TABLE_STYLES);
|
|
90
|
+
const hasAttrs = hasFnAttrs || m.has(_atscript_ui.UI_TABLE_ATTR);
|
|
91
|
+
const hasAny = hasClasses || hasStyles || hasAttrs;
|
|
92
|
+
if (!hasAny) continue;
|
|
93
|
+
map.set(path, {
|
|
94
|
+
prop,
|
|
95
|
+
hasClasses,
|
|
96
|
+
hasStyles,
|
|
97
|
+
hasAttrs,
|
|
98
|
+
hasAnyFn: hasFnClasses || hasFnStyles || hasFnAttrs,
|
|
99
|
+
hasAny
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
metaCache.set(def.type, map);
|
|
103
|
+
return map;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Per-row cell composable.
|
|
107
|
+
*
|
|
108
|
+
* Returns `{ resolve, hasAnyCellBindings }`:
|
|
109
|
+
* - `resolve(column, row, rowIndex)` produces `CellBindings`. For columns with
|
|
110
|
+
* no `@ui.table.classes` / `@ui.table.styles` / `@ui.table.attr` (static or
|
|
111
|
+
* dynamic), it short-circuits to a frozen empty object — no scope build, no
|
|
112
|
+
* reactive reads, no allocations. Static-only columns reuse a cached object.
|
|
113
|
+
* - `hasAnyCellBindings` is `false` when no column on the def has any of the
|
|
114
|
+
* above annotations — consumers should skip calling `resolve` entirely.
|
|
115
|
+
*/
|
|
116
|
+
function useCellResolver(getTableDef) {
|
|
117
|
+
const state = require_use_table_state.useTableContextOptional()?.state;
|
|
118
|
+
const hasAnyCellBindings = (0, vue.computed)(() => {
|
|
119
|
+
const def = getTableDef();
|
|
120
|
+
return !!def && getColumnMetaMap(def).size > 0;
|
|
121
|
+
});
|
|
122
|
+
const resolve = (column, row, rowIndex) => {
|
|
123
|
+
const def = getTableDef();
|
|
124
|
+
if (!def) return EMPTY_BINDINGS;
|
|
125
|
+
const colMeta = getColumnMetaMap(def).get(column.path);
|
|
126
|
+
if (!colMeta) return EMPTY_BINDINGS;
|
|
127
|
+
if (!colMeta.hasAnyFn) return colMeta.staticBindings ??= buildStaticBindings(colMeta);
|
|
128
|
+
const scope = buildScope(state, row, rowIndex);
|
|
129
|
+
const cls = colMeta.hasClasses ? (0, _atscript_ui.resolveFieldProp)(colMeta.prop, _atscript_ui.UI_TABLE_FN_CLASSES, _atscript_ui.UI_TABLE_CLASSES, scope) : void 0;
|
|
130
|
+
const style = colMeta.hasStyles ? (0, _atscript_ui.resolveFieldProp)(colMeta.prop, _atscript_ui.UI_TABLE_FN_STYLES, _atscript_ui.UI_TABLE_STYLES, scope) : void 0;
|
|
131
|
+
const attrs = colMeta.hasAttrs ? (0, _atscript_ui.resolveAttrs)(colMeta.prop, scope, TABLE_FN_KEYS) : void 0;
|
|
132
|
+
if (!attrs && cls === void 0 && style === void 0) return EMPTY_BINDINGS;
|
|
133
|
+
const out = attrs ? { ...attrs } : {};
|
|
134
|
+
if (cls !== void 0) out.class = cls;
|
|
135
|
+
if (style !== void 0) out.style = style;
|
|
136
|
+
return out;
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
resolve,
|
|
140
|
+
hasAnyCellBindings
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function buildStaticBindings(colMeta) {
|
|
144
|
+
const cls = colMeta.hasClasses ? (0, _atscript_ui.getFieldMeta)(colMeta.prop, _atscript_ui.UI_TABLE_CLASSES) : void 0;
|
|
145
|
+
const style = colMeta.hasStyles ? (0, _atscript_ui.getFieldMeta)(colMeta.prop, _atscript_ui.UI_TABLE_STYLES) : void 0;
|
|
146
|
+
const attrs = colMeta.hasAttrs ? (0, _atscript_ui.parseStaticAttrs)((0, _atscript_ui.getFieldMeta)(colMeta.prop, _atscript_ui.UI_TABLE_ATTR)) : void 0;
|
|
147
|
+
if (!attrs && cls === void 0 && style === void 0) return EMPTY_BINDINGS;
|
|
148
|
+
const out = attrs ? { ...attrs } : {};
|
|
149
|
+
if (cls !== void 0) out.class = cls;
|
|
150
|
+
if (style !== void 0) out.style = style;
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
function buildScope(state, row, rowIndex) {
|
|
154
|
+
return {
|
|
155
|
+
row,
|
|
156
|
+
ctx: {
|
|
157
|
+
searchTerm: state?.searchTerm.value ?? "",
|
|
158
|
+
filters: state?.filters.value ?? {},
|
|
159
|
+
sorters: state?.sorters.value ?? [],
|
|
160
|
+
rowIndex
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/composables/use-cell-components.ts
|
|
166
|
+
/**
|
|
167
|
+
* Resolves the cell component for each column once per column, keyed by
|
|
168
|
+
* `column.path`. Mirrors the form's resolution order in `as-field.vue`:
|
|
169
|
+
* 1. `@ui.table.component "name"` → `ctx.components[name]`
|
|
170
|
+
* 2. `column.type` → `ctx.types[type]`
|
|
171
|
+
* 3. fallback → `AsTableCellValue`
|
|
172
|
+
*
|
|
173
|
+
* Hoisted out of the per-cell render path because the answer is identical for
|
|
174
|
+
* every row in a given column — a 50×10 table avoids ~500 redundant lookups.
|
|
175
|
+
*/
|
|
176
|
+
function useCellComponents(getColumns) {
|
|
177
|
+
const ctx = require_use_table_state.useTableContextOptional();
|
|
178
|
+
return (0, vue.computed)(() => {
|
|
179
|
+
const out = {};
|
|
180
|
+
for (const col of getColumns()) {
|
|
181
|
+
let resolved;
|
|
182
|
+
if (col.component) resolved = ctx?.components?.[col.component];
|
|
183
|
+
resolved ??= ctx?.types?.[col.type] ?? require_as_table_cell_value.as_table_cell_value_default;
|
|
184
|
+
out[col.path] = resolved;
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/composables/use-raf-batch.ts
|
|
191
|
+
/**
|
|
192
|
+
* Coalesce a high-frequency stream of values into one rAF-tick callback.
|
|
193
|
+
* Pointermove / wheel can fire at >120Hz; without batching, each native event
|
|
194
|
+
* fans out reactive updates and re-runs downstream computeds + watchers.
|
|
195
|
+
*
|
|
196
|
+
* `schedule(value)` overwrites the pending value and arms a rAF if none is in
|
|
197
|
+
* flight. `flushNow()` runs the callback synchronously with whatever is pending
|
|
198
|
+
* (used at gesture-end so the final value isn't dropped). Auto-cancels on
|
|
199
|
+
* scope dispose.
|
|
200
|
+
*/
|
|
201
|
+
function useRafBatch(onFlush) {
|
|
202
|
+
let pending = null;
|
|
203
|
+
let hasPending = false;
|
|
204
|
+
let rafId = 0;
|
|
205
|
+
function flush() {
|
|
206
|
+
rafId = 0;
|
|
207
|
+
if (!hasPending) return;
|
|
208
|
+
const value = pending;
|
|
209
|
+
pending = null;
|
|
210
|
+
hasPending = false;
|
|
211
|
+
onFlush(value);
|
|
212
|
+
}
|
|
213
|
+
function schedule(value) {
|
|
214
|
+
pending = value;
|
|
215
|
+
hasPending = true;
|
|
216
|
+
if (rafId !== 0) return;
|
|
217
|
+
rafId = requestAnimationFrame(flush);
|
|
218
|
+
}
|
|
219
|
+
function flushNow() {
|
|
220
|
+
if (rafId !== 0) {
|
|
221
|
+
cancelAnimationFrame(rafId);
|
|
222
|
+
rafId = 0;
|
|
223
|
+
}
|
|
224
|
+
flush();
|
|
225
|
+
}
|
|
226
|
+
function cancel() {
|
|
227
|
+
if (rafId !== 0) {
|
|
228
|
+
cancelAnimationFrame(rafId);
|
|
229
|
+
rafId = 0;
|
|
230
|
+
}
|
|
231
|
+
pending = null;
|
|
232
|
+
hasPending = false;
|
|
233
|
+
}
|
|
234
|
+
(0, vue.onBeforeUnmount)(cancel);
|
|
235
|
+
return {
|
|
236
|
+
schedule,
|
|
237
|
+
flushNow,
|
|
238
|
+
cancel
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/composables/use-column-header-drag-resize.ts
|
|
243
|
+
function pathOf(event) {
|
|
244
|
+
return event.currentTarget?.dataset.columnPath ?? null;
|
|
245
|
+
}
|
|
246
|
+
function thFromHandleEvent(event) {
|
|
247
|
+
const th = event.currentTarget?.closest("th");
|
|
248
|
+
const path = th?.dataset.columnPath;
|
|
249
|
+
if (!th || !path) return null;
|
|
250
|
+
return {
|
|
251
|
+
th,
|
|
252
|
+
path
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function useColumnHeaderDragResize(opts) {
|
|
256
|
+
const dragSourcePath = (0, vue.ref)(null);
|
|
257
|
+
const dropTarget = (0, vue.ref)(null);
|
|
258
|
+
const resizingPath = (0, vue.ref)(null);
|
|
259
|
+
let resizeStartX = 0;
|
|
260
|
+
let resizeStartWidth = 0;
|
|
261
|
+
const resizeBatch = useRafBatch(({ path, width }) => opts.onResize(path, width));
|
|
262
|
+
function onHeaderDragStart(event) {
|
|
263
|
+
if (!opts.reorderable()) return;
|
|
264
|
+
if (resizingPath.value !== null) {
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const path = pathOf(event);
|
|
269
|
+
if (!path) return;
|
|
270
|
+
dragSourcePath.value = path;
|
|
271
|
+
if (event.dataTransfer) {
|
|
272
|
+
event.dataTransfer.effectAllowed = "move";
|
|
273
|
+
event.dataTransfer.setData("text/plain", path);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function onHeaderDragOver(event) {
|
|
277
|
+
if (!opts.reorderable() || dragSourcePath.value === null) return;
|
|
278
|
+
const path = pathOf(event);
|
|
279
|
+
if (!path) return;
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
282
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
283
|
+
const position = event.clientX - rect.left < rect.width / 2 ? "before" : "after";
|
|
284
|
+
if (dropTarget.value?.path !== path || dropTarget.value?.position !== position) dropTarget.value = {
|
|
285
|
+
path,
|
|
286
|
+
position
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function onHeaderDrop(event) {
|
|
290
|
+
if (!opts.reorderable()) return;
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
const path = pathOf(event);
|
|
293
|
+
const source = dragSourcePath.value;
|
|
294
|
+
const target = dropTarget.value;
|
|
295
|
+
if (path && source && target && target.path === path && source !== target.path) opts.onReorder(source, target.path, target.position);
|
|
296
|
+
dragSourcePath.value = null;
|
|
297
|
+
dropTarget.value = null;
|
|
298
|
+
}
|
|
299
|
+
function onHeaderDragEnd() {
|
|
300
|
+
dragSourcePath.value = null;
|
|
301
|
+
dropTarget.value = null;
|
|
302
|
+
}
|
|
303
|
+
function onResizeHandlePointerDown(event) {
|
|
304
|
+
if (!opts.resizable()) return;
|
|
305
|
+
const found = thFromHandleEvent(event);
|
|
306
|
+
if (!found) return;
|
|
307
|
+
resizingPath.value = found.path;
|
|
308
|
+
resizeStartX = event.clientX;
|
|
309
|
+
resizeStartWidth = found.th.getBoundingClientRect().width;
|
|
310
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
311
|
+
}
|
|
312
|
+
function onResizeHandlePointerMove(event) {
|
|
313
|
+
if (!resizingPath.value) return;
|
|
314
|
+
const next = Math.round(Math.max(resizeStartWidth + (event.clientX - resizeStartX), opts.columnMinWidth()));
|
|
315
|
+
resizeBatch.schedule({
|
|
316
|
+
path: resizingPath.value,
|
|
317
|
+
width: `${next}px`
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function onResizeHandleEnd() {
|
|
321
|
+
resizingPath.value = null;
|
|
322
|
+
resizeBatch.flushNow();
|
|
323
|
+
}
|
|
324
|
+
function onResizeHandleDoubleClick(event) {
|
|
325
|
+
if (!opts.resizable() || !opts.onAutoFit) return;
|
|
326
|
+
const found = thFromHandleEvent(event);
|
|
327
|
+
if (!found) return;
|
|
328
|
+
opts.onAutoFit(found.th, found.path);
|
|
329
|
+
}
|
|
330
|
+
function widthStyle(col) {
|
|
331
|
+
const entry = opts.columnWidths()[col.path];
|
|
332
|
+
if (entry) return { width: entry.w };
|
|
333
|
+
if (col.width) return { width: col.width };
|
|
334
|
+
}
|
|
335
|
+
function thClasses(path) {
|
|
336
|
+
const reorder = opts.reorderable();
|
|
337
|
+
const resize = opts.resizable();
|
|
338
|
+
if (!reorder && !resize) return {};
|
|
339
|
+
return {
|
|
340
|
+
"as-th-reorderable": reorder,
|
|
341
|
+
"as-th-dragging": reorder && dragSourcePath.value === path,
|
|
342
|
+
"as-th-drop-indicator-before": reorder && dropTarget.value?.path === path && dropTarget.value?.position === "before",
|
|
343
|
+
"as-th-drop-indicator-after": reorder && dropTarget.value?.path === path && dropTarget.value?.position === "after",
|
|
344
|
+
"as-th-resizing": resize && resizingPath.value === path
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
onHeaderDragStart,
|
|
349
|
+
onHeaderDragOver,
|
|
350
|
+
onHeaderDrop,
|
|
351
|
+
onHeaderDragEnd,
|
|
352
|
+
onResizeHandlePointerDown,
|
|
353
|
+
onResizeHandlePointerMove,
|
|
354
|
+
onResizeHandleEnd,
|
|
355
|
+
onResizeHandleDoubleClick,
|
|
356
|
+
thClasses,
|
|
357
|
+
widthStyle
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/components/internal/as-table-header.vue?vue&type=script&setup=true&lang.ts
|
|
362
|
+
const _hoisted_1$1 = {
|
|
363
|
+
key: 0,
|
|
364
|
+
class: "as-th-select"
|
|
365
|
+
};
|
|
366
|
+
const _hoisted_2$1 = ["aria-checked"];
|
|
367
|
+
const _hoisted_3$1 = {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "as-table-checkbox-tick",
|
|
370
|
+
"aria-hidden": "true"
|
|
371
|
+
};
|
|
372
|
+
const _hoisted_4$1 = {
|
|
373
|
+
key: 1,
|
|
374
|
+
class: "as-table-checkbox-dash"
|
|
375
|
+
};
|
|
376
|
+
const _hoisted_5$1 = [
|
|
377
|
+
"data-column-path",
|
|
378
|
+
"draggable",
|
|
379
|
+
"aria-label",
|
|
380
|
+
"onDragstart",
|
|
381
|
+
"onDragover",
|
|
382
|
+
"onDrop",
|
|
383
|
+
"onDragend"
|
|
384
|
+
];
|
|
385
|
+
const _hoisted_6$1 = {
|
|
386
|
+
key: 1,
|
|
387
|
+
class: "as-th-filler"
|
|
388
|
+
};
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/components/internal/as-table-header.vue
|
|
391
|
+
var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
392
|
+
__name: "as-table-header",
|
|
393
|
+
props: {
|
|
394
|
+
columns: {
|
|
395
|
+
type: Array,
|
|
396
|
+
required: true
|
|
397
|
+
},
|
|
398
|
+
sorters: {
|
|
399
|
+
type: Array,
|
|
400
|
+
required: true
|
|
401
|
+
},
|
|
402
|
+
filters: {
|
|
403
|
+
type: Object,
|
|
404
|
+
required: false
|
|
405
|
+
},
|
|
406
|
+
columnMenu: {
|
|
407
|
+
type: Object,
|
|
408
|
+
required: false
|
|
409
|
+
},
|
|
410
|
+
columnWidths: {
|
|
411
|
+
type: Object,
|
|
412
|
+
required: true
|
|
413
|
+
},
|
|
414
|
+
reorderable: {
|
|
415
|
+
type: Boolean,
|
|
416
|
+
required: false,
|
|
417
|
+
default: true
|
|
418
|
+
},
|
|
419
|
+
resizable: {
|
|
420
|
+
type: Boolean,
|
|
421
|
+
required: false,
|
|
422
|
+
default: true
|
|
423
|
+
},
|
|
424
|
+
columnMinWidth: {
|
|
425
|
+
type: Number,
|
|
426
|
+
required: false,
|
|
427
|
+
default: 48
|
|
428
|
+
},
|
|
429
|
+
hasSelectColumn: {
|
|
430
|
+
type: Boolean,
|
|
431
|
+
required: false,
|
|
432
|
+
default: false
|
|
433
|
+
},
|
|
434
|
+
selectAllState: {
|
|
435
|
+
type: String,
|
|
436
|
+
required: false
|
|
437
|
+
},
|
|
438
|
+
withFiller: {
|
|
439
|
+
type: Boolean,
|
|
440
|
+
required: false,
|
|
441
|
+
default: false
|
|
442
|
+
},
|
|
443
|
+
enableAutoFit: {
|
|
444
|
+
type: Boolean,
|
|
445
|
+
required: false,
|
|
446
|
+
default: false
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
emits: [
|
|
450
|
+
"sort",
|
|
451
|
+
"hide",
|
|
452
|
+
"filter",
|
|
453
|
+
"filters-off",
|
|
454
|
+
"reset-width",
|
|
455
|
+
"reorder",
|
|
456
|
+
"resize",
|
|
457
|
+
"select-all-toggle"
|
|
458
|
+
],
|
|
459
|
+
setup(__props, { emit: __emit }) {
|
|
460
|
+
const props = __props;
|
|
461
|
+
const emit = __emit;
|
|
462
|
+
const sortMap = (0, vue.computed)(() => {
|
|
463
|
+
const map = {};
|
|
464
|
+
for (const s of props.sorters) map[s.field] = s.direction;
|
|
465
|
+
return map;
|
|
466
|
+
});
|
|
467
|
+
const { onHeaderDragStart, onHeaderDragOver, onHeaderDrop, onHeaderDragEnd, onResizeHandlePointerDown, onResizeHandlePointerMove, onResizeHandleEnd, onResizeHandleDoubleClick, thClasses, widthStyle } = useColumnHeaderDragResize({
|
|
468
|
+
reorderable: () => props.reorderable,
|
|
469
|
+
resizable: () => props.resizable,
|
|
470
|
+
columnMinWidth: () => props.columnMinWidth,
|
|
471
|
+
columnWidths: () => props.columnWidths,
|
|
472
|
+
onReorder: (from, to, position) => emit("reorder", from, to, position),
|
|
473
|
+
onResize: (path, width) => emit("resize", path, width),
|
|
474
|
+
onAutoFit: props.enableAutoFit ? (th, path) => {
|
|
475
|
+
const table = th.closest("table");
|
|
476
|
+
if (!table) return;
|
|
477
|
+
const measured = measureNaturalColumnWidth(th, table);
|
|
478
|
+
if (measured > 0) {
|
|
479
|
+
emit("resize", path, `${Math.max(Math.ceil(measured), props.columnMinWidth)}px`);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
let fallback = th.scrollWidth;
|
|
483
|
+
const colIndex = th.cellIndex;
|
|
484
|
+
for (const tr of table.querySelectorAll("tbody tr")) {
|
|
485
|
+
const cell = tr.children[colIndex];
|
|
486
|
+
if (cell) fallback = Math.max(fallback, cell.scrollWidth);
|
|
487
|
+
}
|
|
488
|
+
emit("resize", path, `${Math.max(fallback, props.columnMinWidth)}px`);
|
|
489
|
+
} : void 0
|
|
490
|
+
});
|
|
491
|
+
function measureNaturalColumnWidth(th, table) {
|
|
492
|
+
const origTableLayout = table.style.tableLayout;
|
|
493
|
+
const origTableWidth = table.style.width;
|
|
494
|
+
const origTableMinWidth = table.style.minWidth;
|
|
495
|
+
const origThWidth = th.style.width;
|
|
496
|
+
table.style.tableLayout = "auto";
|
|
497
|
+
table.style.minWidth = "0";
|
|
498
|
+
table.style.width = "max-content";
|
|
499
|
+
th.style.width = "max-content";
|
|
500
|
+
const measured = th.offsetWidth;
|
|
501
|
+
th.style.width = origThWidth;
|
|
502
|
+
table.style.width = origTableWidth;
|
|
503
|
+
table.style.minWidth = origTableMinWidth;
|
|
504
|
+
table.style.tableLayout = origTableLayout;
|
|
505
|
+
return measured;
|
|
506
|
+
}
|
|
507
|
+
return (_ctx, _cache) => {
|
|
508
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("thead", null, [(0, vue.createElementVNode)("tr", null, [
|
|
509
|
+
__props.hasSelectColumn ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_1$1, [__props.selectAllState ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
510
|
+
key: 0,
|
|
511
|
+
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
512
|
+
"as-table-checkbox-checked": __props.selectAllState === "all",
|
|
513
|
+
"as-table-checkbox-indeterminate": __props.selectAllState === "some"
|
|
514
|
+
}]),
|
|
515
|
+
role: "checkbox",
|
|
516
|
+
tabindex: "0",
|
|
517
|
+
"aria-checked": __props.selectAllState === "none" ? "false" : __props.selectAllState === "all" ? "true" : "mixed",
|
|
518
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("select-all-toggle", __props.selectAllState))
|
|
519
|
+
}, [__props.selectAllState === "all" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$1)) : __props.selectAllState === "some" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$1)) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_2$1)) : (0, vue.createCommentVNode)("v-if", true)])) : (0, vue.createCommentVNode)("v-if", true),
|
|
520
|
+
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.columns, (col) => {
|
|
521
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
|
|
522
|
+
key: col.path,
|
|
523
|
+
"data-column-path": col.path,
|
|
524
|
+
draggable: __props.reorderable && !col.fixed || void 0,
|
|
525
|
+
class: (0, vue.normalizeClass)([(0, vue.unref)(thClasses)(col.path), col.fixed ? "as-th-fixed" : void 0]),
|
|
526
|
+
style: (0, vue.normalizeStyle)((0, vue.unref)(widthStyle)(col)),
|
|
527
|
+
"aria-label": col.fixed && col.path === (0, vue.unref)("__actions") ? "Actions" : void 0,
|
|
528
|
+
onDragstart: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDragStart)($event),
|
|
529
|
+
onDragover: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDragOver)($event),
|
|
530
|
+
onDrop: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDrop)($event),
|
|
531
|
+
onDragend: ($event) => col.fixed ? void 0 : (0, vue.unref)(onHeaderDragEnd)()
|
|
532
|
+
}, [!col.fixed ? (0, vue.renderSlot)(_ctx.$slots, `header-${col.path}`, {
|
|
533
|
+
key: 0,
|
|
534
|
+
column: col
|
|
535
|
+
}, () => [(0, vue.createVNode)(require_as_table_header_cell.as_table_header_cell_default, {
|
|
536
|
+
column: col,
|
|
537
|
+
"sort-direction": sortMap.value[col.path] ?? null,
|
|
538
|
+
filters: __props.filters?.[col.path],
|
|
539
|
+
"column-menu": __props.columnMenu,
|
|
540
|
+
"width-entry": __props.columnWidths[col.path],
|
|
541
|
+
onSort: _cache[1] || (_cache[1] = (c, d) => emit("sort", c, d)),
|
|
542
|
+
onHide: _cache[2] || (_cache[2] = (c) => emit("hide", c)),
|
|
543
|
+
onFilter: _cache[3] || (_cache[3] = (c) => emit("filter", c)),
|
|
544
|
+
onFiltersOff: _cache[4] || (_cache[4] = (c) => emit("filters-off", c)),
|
|
545
|
+
onResetWidth: _cache[5] || (_cache[5] = (c) => emit("reset-width", c))
|
|
546
|
+
}, null, 8, [
|
|
547
|
+
"column",
|
|
548
|
+
"sort-direction",
|
|
549
|
+
"filters",
|
|
550
|
+
"column-menu",
|
|
551
|
+
"width-entry"
|
|
552
|
+
])]) : (0, vue.createCommentVNode)("v-if", true), __props.resizable && !col.fixed ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
553
|
+
key: 1,
|
|
554
|
+
class: "as-th-resize-handle",
|
|
555
|
+
draggable: "false",
|
|
556
|
+
onDragstart: _cache[6] || (_cache[6] = (0, vue.withModifiers)(() => {}, ["prevent", "stop"])),
|
|
557
|
+
onPointerdown: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandlePointerDown) && (0, vue.unref)(onResizeHandlePointerDown)(...args), ["stop"])),
|
|
558
|
+
onPointermove: _cache[8] || (_cache[8] = (...args) => (0, vue.unref)(onResizeHandlePointerMove) && (0, vue.unref)(onResizeHandlePointerMove)(...args)),
|
|
559
|
+
onPointerup: _cache[9] || (_cache[9] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
|
|
560
|
+
onPointercancel: _cache[10] || (_cache[10] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
|
|
561
|
+
onDblclick: _cache[11] || (_cache[11] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandleDoubleClick) && (0, vue.unref)(onResizeHandleDoubleClick)(...args), ["stop"]))
|
|
562
|
+
}, null, 32)) : (0, vue.createCommentVNode)("v-if", true)], 46, _hoisted_5$1);
|
|
563
|
+
}), 128)),
|
|
564
|
+
__props.withFiller ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_6$1)) : (0, vue.createCommentVNode)("v-if", true)
|
|
565
|
+
])]);
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/components/internal/as-table-status.vue?vue&type=script&setup=true&lang.ts
|
|
571
|
+
const _hoisted_1 = {
|
|
572
|
+
key: 0,
|
|
573
|
+
class: "as-table-error"
|
|
574
|
+
};
|
|
575
|
+
const _hoisted_2 = { class: "as-vh-empty" };
|
|
576
|
+
const _hoisted_3 = { class: "as-vh-empty-body" };
|
|
577
|
+
const _hoisted_4 = {
|
|
578
|
+
key: 1,
|
|
579
|
+
class: "as-table-empty"
|
|
580
|
+
};
|
|
581
|
+
const _hoisted_5 = { class: "as-vh-empty" };
|
|
582
|
+
const _hoisted_6 = {
|
|
583
|
+
key: 0,
|
|
584
|
+
class: "as-vh-empty-body"
|
|
585
|
+
};
|
|
586
|
+
const _hoisted_7 = { class: "as-vh-empty-code" };
|
|
587
|
+
const _hoisted_8 = {
|
|
588
|
+
key: 1,
|
|
589
|
+
class: "as-vh-empty-body"
|
|
590
|
+
};
|
|
591
|
+
const _hoisted_9 = {
|
|
592
|
+
key: 2,
|
|
593
|
+
class: "as-vh-empty-body"
|
|
594
|
+
};
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/components/internal/as-table-status.vue
|
|
597
|
+
var as_table_status_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
598
|
+
__name: "as-table-status",
|
|
599
|
+
props: {
|
|
600
|
+
queryError: {
|
|
601
|
+
type: null,
|
|
602
|
+
required: true
|
|
603
|
+
},
|
|
604
|
+
isEmpty: {
|
|
605
|
+
type: Boolean,
|
|
606
|
+
required: true
|
|
607
|
+
},
|
|
608
|
+
querying: {
|
|
609
|
+
type: Boolean,
|
|
610
|
+
required: true
|
|
611
|
+
},
|
|
612
|
+
columns: {
|
|
613
|
+
type: Array,
|
|
614
|
+
required: true
|
|
615
|
+
},
|
|
616
|
+
searchTerm: {
|
|
617
|
+
type: String,
|
|
618
|
+
required: false
|
|
619
|
+
},
|
|
620
|
+
hasActiveFilters: {
|
|
621
|
+
type: Boolean,
|
|
622
|
+
required: true
|
|
623
|
+
},
|
|
624
|
+
onClearFilters: {
|
|
625
|
+
type: Function,
|
|
626
|
+
required: false
|
|
627
|
+
},
|
|
628
|
+
onRetry: {
|
|
629
|
+
type: Function,
|
|
630
|
+
required: false
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
setup(__props) {
|
|
634
|
+
return (_ctx, _cache) => {
|
|
635
|
+
return __props.queryError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "error", {
|
|
636
|
+
error: __props.queryError,
|
|
637
|
+
retry: __props.onRetry
|
|
638
|
+
}, () => [(0, vue.createElementVNode)("div", _hoisted_2, [
|
|
639
|
+
_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", {
|
|
640
|
+
class: "as-vh-error-icon i-as-warning",
|
|
641
|
+
"aria-hidden": "true"
|
|
642
|
+
}, null, -1)),
|
|
643
|
+
_cache[4] || (_cache[4] = (0, vue.createElementVNode)("p", { class: "as-vh-empty-title" }, "Failed to load values", -1)),
|
|
644
|
+
(0, vue.createElementVNode)("p", _hoisted_3, (0, vue.toDisplayString)(__props.queryError.message), 1),
|
|
645
|
+
__props.onRetry ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
646
|
+
key: 0,
|
|
647
|
+
type: "button",
|
|
648
|
+
class: "as-vh-empty-clear",
|
|
649
|
+
onClick: _cache[0] || (_cache[0] = (...args) => __props.onRetry && __props.onRetry(...args))
|
|
650
|
+
}, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", {
|
|
651
|
+
class: "i-as-refresh",
|
|
652
|
+
"aria-hidden": "true"
|
|
653
|
+
}, null, -1), (0, vue.createTextVNode)(" Retry ", -1)])])) : (0, vue.createCommentVNode)("v-if", true)
|
|
654
|
+
])])])) : __props.isEmpty && !__props.querying && __props.columns.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4, [(0, vue.renderSlot)(_ctx.$slots, "empty", {
|
|
655
|
+
searchTerm: __props.searchTerm,
|
|
656
|
+
hasActiveFilters: __props.hasActiveFilters,
|
|
657
|
+
onClearFilters: __props.onClearFilters
|
|
658
|
+
}, () => [(0, vue.createElementVNode)("div", _hoisted_5, [
|
|
659
|
+
_cache[8] || (_cache[8] = (0, vue.createElementVNode)("span", {
|
|
660
|
+
class: "as-vh-empty-icon i-as-search",
|
|
661
|
+
"aria-hidden": "true"
|
|
662
|
+
}, null, -1)),
|
|
663
|
+
_cache[9] || (_cache[9] = (0, vue.createElementVNode)("p", { class: "as-vh-empty-title" }, "No matching values", -1)),
|
|
664
|
+
__props.searchTerm ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_6, [
|
|
665
|
+
_cache[5] || (_cache[5] = (0, vue.createTextVNode)(" No entries match ", -1)),
|
|
666
|
+
(0, vue.createElementVNode)("span", _hoisted_7, "\"" + (0, vue.toDisplayString)(__props.searchTerm) + "\"", 1),
|
|
667
|
+
_cache[6] || (_cache[6] = (0, vue.createTextVNode)(". Try a different search. ", -1))
|
|
668
|
+
])) : __props.hasActiveFilters ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_8, " No entries match the current filters. ")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_9, "No entries available")),
|
|
669
|
+
(__props.searchTerm || __props.hasActiveFilters) && __props.onClearFilters ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
670
|
+
key: 3,
|
|
671
|
+
type: "button",
|
|
672
|
+
class: "as-vh-empty-clear",
|
|
673
|
+
onClick: _cache[1] || (_cache[1] = (...args) => __props.onClearFilters && __props.onClearFilters(...args))
|
|
674
|
+
}, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("span", {
|
|
675
|
+
class: "i-as-refresh",
|
|
676
|
+
"aria-hidden": "true"
|
|
677
|
+
}, null, -1), (0, vue.createTextVNode)(" Clear filters ", -1)])])) : (0, vue.createCommentVNode)("v-if", true)
|
|
678
|
+
])])])) : (0, vue.createCommentVNode)("v-if", true);
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
//#endregion
|
|
683
|
+
Object.defineProperty(exports, "as_table_header_default", {
|
|
684
|
+
enumerable: true,
|
|
685
|
+
get: function() {
|
|
686
|
+
return as_table_header_default;
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
Object.defineProperty(exports, "as_table_status_default", {
|
|
690
|
+
enumerable: true,
|
|
691
|
+
get: function() {
|
|
692
|
+
return as_table_status_default;
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
Object.defineProperty(exports, "useCellComponents", {
|
|
696
|
+
enumerable: true,
|
|
697
|
+
get: function() {
|
|
698
|
+
return useCellComponents;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
Object.defineProperty(exports, "useCellResolver", {
|
|
702
|
+
enumerable: true,
|
|
703
|
+
get: function() {
|
|
704
|
+
return useCellResolver;
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
Object.defineProperty(exports, "useRafBatch", {
|
|
708
|
+
enumerable: true,
|
|
709
|
+
get: function() {
|
|
710
|
+
return useRafBatch;
|
|
711
|
+
}
|
|
712
|
+
});
|
|
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
|
+
});
|