@atscript/vue-table 0.1.132 → 0.1.134
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 +42 -30
- package/dist/as-action-form-dialog.mjs +42 -30
- package/dist/{as-action-menu-content-C5qx9MPE.cjs → as-action-menu-content-C_D_Fepo.cjs} +1 -1
- package/dist/{as-action-menu-content-4UfcabUe.mjs → as-action-menu-content-rim8hAO9.mjs} +1 -1
- package/dist/{as-cell-array-2qmJ1lT2.mjs → as-cell-array-BWHkJX3I.mjs} +2 -2
- package/dist/{as-cell-array-iPeUnk2G.cjs → as-cell-array-D-8Pqlgo.cjs} +2 -2
- package/dist/as-cell-array.cjs +1 -1
- package/dist/as-cell-array.mjs +1 -1
- package/dist/{as-cell-date-DyixWKuS.cjs → as-cell-date-DviMJEqs.cjs} +2 -2
- package/dist/{as-cell-date-BwFgi6O0.mjs → as-cell-date-mGlnDeLP.mjs} +2 -2
- package/dist/as-cell-date.cjs +1 -1
- package/dist/as-cell-date.mjs +1 -1
- package/dist/{as-cell-json--95Xq6yq.mjs → as-cell-json-2I081xnO.mjs} +2 -2
- package/dist/{as-cell-json-Bvv2P7YV.cjs → as-cell-json-CaVB6e7V.cjs} +2 -2
- package/dist/as-cell-json.cjs +1 -1
- package/dist/as-cell-json.mjs +1 -1
- package/dist/{as-cell-number-DuPMOesI.cjs → as-cell-number-BnYbxOiG.cjs} +2 -2
- package/dist/{as-cell-number-DKRaS9pM.mjs → as-cell-number-CP2AZI9g.mjs} +2 -2
- package/dist/as-cell-number.cjs +1 -1
- package/dist/as-cell-number.mjs +1 -1
- package/dist/{as-cell-union-DJNsEKTi.cjs → as-cell-union-BjMP91PS.cjs} +3 -3
- package/dist/{as-cell-union-C9FukGqF.mjs → as-cell-union-NHpDCXty.mjs} +3 -3
- package/dist/as-cell-union.cjs +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-u_DNy3f-.d.cts → as-column-menu.vue-De7SRhj6.d.cts} +1 -1
- package/dist/{as-column-menu.vue-DL5N9mKR.d.mts → as-column-menu.vue-Dg0H1dOd.d.mts} +1 -1
- package/dist/{as-config-dialog-BehfqIGd.mjs → as-config-dialog-BUBHiVlf.mjs} +56 -35
- package/dist/{as-config-dialog-BOYWPYYH.cjs → as-config-dialog-DvBptYMS.cjs} +55 -34
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-UwhDHysk.cjs → as-confirm-dialog-ByMfIG0A.cjs} +12 -9
- package/dist/{as-confirm-dialog-bpN4A-KN.mjs → as-confirm-dialog-G4ZoL_Xo.mjs} +12 -9
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-D1qzq-8b.mjs → as-filter-dialog-BJWH8cvc.mjs} +34 -26
- package/dist/{as-filter-dialog-Dh2Ylthb.cjs → as-filter-dialog-C2oyT0yt.cjs} +33 -25
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-DirBmnbb.mjs → as-filter-field-B2skq4K0.mjs} +4 -4
- package/dist/{as-filter-field-DRsDJdpx.cjs → as-filter-field-DxGfasQj.cjs} +4 -4
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/as-filter-input.cjs +1 -1
- package/dist/as-filter-input.mjs +1 -1
- package/dist/as-filters-Bhte22La.cjs +130 -0
- package/dist/as-filters-DogNVlqr.mjs +125 -0
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.d.cts +1 -1
- package/dist/as-filters.d.mts +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/as-filters.vue-BG_ysCkC.d.mts +65 -0
- package/dist/as-filters.vue-DcxDnWAU.d.cts +65 -0
- package/dist/{as-preset-dialog-CDqCAR7N.mjs → as-preset-dialog-BwHV6Y77.mjs} +71 -21
- package/dist/{as-preset-dialog-DpM06jqR.cjs → as-preset-dialog-D2a6nxEX.cjs} +75 -25
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-CISaxEZ0.mjs → as-preset-picker-B0JnyAPA.mjs} +39 -15
- package/dist/{as-preset-picker-jUS_YDX8.cjs → as-preset-picker-DbkmapBx.cjs} +45 -21
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-row-actions-xqJeAdQl.mjs → as-row-actions-BkIsJVBm.mjs} +24 -11
- package/dist/{as-row-actions-Bm6Bzyno.cjs → as-row-actions-CRg8LHGk.cjs} +24 -11
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.cts +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-row-actions.vue-Bvcc2tUN.d.cts → as-row-actions.vue-VpJsBAJ4.d.mts} +8 -0
- package/dist/{as-row-actions.vue-DUSDuoR2.d.mts → as-row-actions.vue-dn_DKcMm.d.cts} +8 -0
- package/dist/{as-table-CDSG2yED.mjs → as-table-BEvsX87E.mjs} +26 -8
- package/dist/{as-table-actions-DMxeaczm.mjs → as-table-actions-B5upF1bQ.mjs} +69 -18
- package/dist/{as-table-actions-gV4lqqxc.cjs → as-table-actions-B6sKd4sl.cjs} +68 -17
- 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-B-cgiCXP.d.cts → as-table-actions.vue-CoxhpIlJ.d.mts} +2 -2
- package/dist/{as-table-actions.vue-ClMa0OD1.d.mts → as-table-actions.vue-Kic8m28V.d.cts} +2 -2
- package/dist/{as-table-base-BaTE3VSN.mjs → as-table-base-BxKBdIdS.mjs} +142 -47
- package/dist/{as-table-base-RG2TEIgV.cjs → as-table-base-DLuhKz69.cjs} +142 -47
- package/dist/{as-table-cell-value-D1JkTQt0.cjs → as-table-cell-value-BAi5yadc.cjs} +2 -2
- package/dist/{as-table-cell-value-CPcFxSOj.mjs → as-table-cell-value-BVcfhhCb.mjs} +2 -2
- package/dist/as-table-cell-value.cjs +1 -1
- package/dist/as-table-cell-value.mjs +1 -1
- package/dist/{as-table-header-cell-CIqlO6Lw.cjs → as-table-header-cell-Bv6q5iKA.cjs} +2 -2
- package/dist/{as-table-header-cell-Bdhl5Lox.mjs → as-table-header-cell-Xd3cvnII.mjs} +2 -2
- 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-BCszzxtU.d.mts → as-table-header-cell.vue-AS6u4e6v.d.cts} +2 -2
- package/dist/{as-table-header-cell.vue-BzTzfGRo.d.cts → as-table-header-cell.vue-zKOmlzhT.d.mts} +2 -2
- package/dist/{as-table-root-BLReUbRH.mjs → as-table-root-C1A6JkwL.mjs} +112 -10
- package/dist/{as-table-root-DLJ_3Jf4.cjs → as-table-root-DlYjnZax.cjs} +112 -10
- package/dist/as-table-root.cjs +1 -1
- package/dist/as-table-root.d.cts +1 -1
- package/dist/as-table-root.d.mts +1 -1
- package/dist/as-table-root.mjs +1 -1
- package/dist/{as-table-root.vue-QMT93qPk.d.mts → as-table-root.vue-CWk9YgpG.d.mts} +257 -41
- package/dist/{as-table-root.vue-D0T3n-Vm.d.cts → as-table-root.vue-D94eypcL.d.cts} +258 -42
- package/dist/{as-table-status-Du4WLF4k.cjs → as-table-status-B2HPerJT.cjs} +54 -38
- package/dist/{as-table-status-DGTZlpyq.mjs → as-table-status-QzlBdSiR.mjs} +54 -38
- package/dist/{as-table-BWUPzjRn.cjs → as-table-vJbZyZVx.cjs} +26 -8
- 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-Ds7MEp37.d.cts → as-table.vue-BB1vaNL6.d.cts} +28 -4
- package/dist/{as-table.vue-Ce5606ZO.d.mts → as-table.vue-BUDFTCpo.d.mts} +28 -4
- package/dist/{as-window-table-DWujiUQy.mjs → as-window-table-BH0tDDnr.mjs} +107 -24
- package/dist/{as-window-table-jD_y9yet.cjs → as-window-table-Bl_q72WL.cjs} +107 -24
- 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-DfZF1Mux.d.mts → as-window-table.vue-Be2IA0Eb.d.cts} +27 -4
- package/dist/{as-window-table.vue-Bhf9BK8E.d.cts → as-window-table.vue-CLqFM2ff.d.mts} +27 -4
- package/dist/error-message-CfKpn_5w.cjs +18 -0
- package/dist/error-message-gNEXnnbb.mjs +13 -0
- package/dist/index.cjs +237 -41
- package/dist/index.d.cts +10 -10
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +230 -43
- package/dist/{types-ByU4O0Yf.d.mts → types--ex8BJIO.d.cts} +263 -5
- package/dist/{types-CTMxE_zA.d.cts → types-CBGaTR2Z.d.mts} +263 -5
- package/dist/{use-table-CyFcVtUN.mjs → use-table-BFhbfWgY.mjs} +48 -23
- package/dist/{use-table-component-K6xj1obF.mjs → use-table-component-CRmLHdqi.mjs} +1 -1
- package/dist/{use-table-component-DO_kvKSf.cjs → use-table-component-DS5NJPzs.cjs} +1 -1
- package/dist/{use-table-nav-bridge-uOQUDooh.cjs → use-table-nav-bridge-DS14D_rG.cjs} +1 -1
- package/dist/{use-table-nav-bridge-DeGeaQX-.mjs → use-table-nav-bridge-DzJN5v9a.mjs} +1 -1
- package/dist/{use-table-nvBq1dZ4.cjs → use-table-nvuZdgUd.cjs} +51 -20
- package/dist/{use-table-state-BxX3SpeW.mjs → use-table-state-mBXx11aH.mjs} +501 -105
- package/dist/{use-table-state-Oi2ds4_a.cjs → use-table-state-mhm-YWnu.cjs} +541 -109
- package/package.json +9 -9
- package/dist/as-filters-DCZTHjf5.cjs +0 -51
- package/dist/as-filters-beIud9sF.mjs +0 -46
- package/dist/as-filters.vue-DmECMd1v.d.mts +0 -10
- package/dist/as-filters.vue-fv-tRL2H.d.cts +0 -10
- package/dist/preset-aspect-display-IICxAlVo.mjs +0 -43
- package/dist/preset-aspect-display-TWwf6j1B.cjs +0 -72
- /package/dist/{as-cell-json-popover-Dkdv5Y9E.mjs → as-cell-json-popover-CH5bAcLE.mjs} +0 -0
- /package/dist/{as-cell-json-popover-BM2QLgfk.cjs → as-cell-json-popover-vty5vMjW.cjs} +0 -0
- /package/dist/{as-column-menu-kTIQfLTi.mjs → as-column-menu-BMTS3DO2.mjs} +0 -0
- /package/dist/{as-column-menu-fZVbJ9lU.cjs → as-column-menu-D_8NxujZ.cjs} +0 -0
- /package/dist/{as-filter-input-BM23TNeh.mjs → as-filter-input-C8KmOus8.mjs} +0 -0
- /package/dist/{as-filter-input-DJu2k9gO.cjs → as-filter-input-DUqpkTkg.cjs} +0 -0
- /package/dist/{format-cell-D1Ziv96Q.mjs → format-cell-Bx7wNc4X.mjs} +0 -0
- /package/dist/{format-cell-vCNTh4WZ.cjs → format-cell-DaxV6WIJ.cjs} +0 -0
- /package/dist/{get-cell-value-4rHKP-TG.cjs → get-cell-value-CJT4fk4y.cjs} +0 -0
- /package/dist/{get-cell-value-C8LLc_Rr.mjs → get-cell-value-Cb3X8nUn.mjs} +0 -0
- /package/dist/{use-cell-locale-MQXoONh5.mjs → use-cell-locale-CxQOQsns.mjs} +0 -0
- /package/dist/{use-cell-locale-BGBRQB7s.cjs → use-cell-locale-caG2Fzpc.cjs} +0 -0
- /package/dist/{use-has-emit-listener-hhOH8CBI.cjs → use-has-emit-listener-BaGFZDyM.cjs} +0 -0
- /package/dist/{use-has-emit-listener-BTMDIv2e.mjs → use-has-emit-listener-DrBbsLHQ.mjs} +0 -0
- /package/dist/{use-seed-on-open-Dg9I89fU.cjs → use-seed-on-open-9TSm1Vbv.cjs} +0 -0
- /package/dist/{use-seed-on-open-DO3A1kIb.mjs → use-seed-on-open-DSh4XFyp.mjs} +0 -0
- /package/dist/{use-table-column-handlers-ehreEzcx.cjs → use-table-column-handlers-BMrP0WY2.cjs} +0 -0
- /package/dist/{use-table-column-handlers-CpiiIniD.mjs → use-table-column-handlers-Bx3JERqs.mjs} +0 -0
- /package/dist/{use-table-selection-Cmiu1h4S.cjs → use-table-selection-DtCV3rhu.cjs} +0 -0
- /package/dist/{use-table-selection-C84z4OZy.mjs → use-table-selection-ULbKT2xW.mjs} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_as_table_status = require("./as-table-status-
|
|
6
|
-
const require_use_table_column_handlers = require("./use-table-column-handlers-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-mhm-YWnu.cjs");
|
|
2
|
+
const require_get_cell_value = require("./get-cell-value-CJT4fk4y.cjs");
|
|
3
|
+
const require_use_table_selection = require("./use-table-selection-DtCV3rhu.cjs");
|
|
4
|
+
const require_use_has_emit_listener = require("./use-has-emit-listener-BaGFZDyM.cjs");
|
|
5
|
+
const require_as_table_status = require("./as-table-status-B2HPerJT.cjs");
|
|
6
|
+
const require_use_table_column_handlers = require("./use-table-column-handlers-BMrP0WY2.cjs");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
9
9
|
let _vueuse_core = require("@vueuse/core");
|
|
@@ -175,6 +175,7 @@ const _hoisted_2 = ["aria-rowcount", "aria-multiselectable"];
|
|
|
175
175
|
const _hoisted_3 = ["aria-activedescendant"];
|
|
176
176
|
const _hoisted_4 = [
|
|
177
177
|
"id",
|
|
178
|
+
"data-selectable",
|
|
178
179
|
"aria-rowindex",
|
|
179
180
|
"aria-selected",
|
|
180
181
|
"onClick",
|
|
@@ -185,7 +186,14 @@ const _hoisted_5 = {
|
|
|
185
186
|
class: "as-td-select",
|
|
186
187
|
role: "gridcell"
|
|
187
188
|
};
|
|
188
|
-
const _hoisted_6 = [
|
|
189
|
+
const _hoisted_6 = [
|
|
190
|
+
"tabindex",
|
|
191
|
+
"aria-label",
|
|
192
|
+
"title",
|
|
193
|
+
"aria-checked",
|
|
194
|
+
"aria-disabled",
|
|
195
|
+
"onKeydown"
|
|
196
|
+
];
|
|
189
197
|
const _hoisted_7 = {
|
|
190
198
|
key: 0,
|
|
191
199
|
class: "as-table-checkbox-tick",
|
|
@@ -241,6 +249,14 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
241
249
|
type: Boolean,
|
|
242
250
|
required: false,
|
|
243
251
|
default: false
|
|
252
|
+
},
|
|
253
|
+
rowClass: {
|
|
254
|
+
type: Function,
|
|
255
|
+
required: false
|
|
256
|
+
},
|
|
257
|
+
rowAttrs: {
|
|
258
|
+
type: Function,
|
|
259
|
+
required: false
|
|
244
260
|
}
|
|
245
261
|
},
|
|
246
262
|
emits: [
|
|
@@ -255,6 +271,10 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
255
271
|
const { state } = require_use_table_state.useTableContext();
|
|
256
272
|
const { resolve: cellResolver, hasAnyCellBindings } = require_as_table_status.useCellResolver(() => state.tableDef.value);
|
|
257
273
|
const cellComponents = require_as_table_status.useCellComponents(() => state.columns.value);
|
|
274
|
+
const headerColumns = (0, vue.computed)(() => state.columns.value.map((c) => c.local && c.sortable ? {
|
|
275
|
+
...c,
|
|
276
|
+
sortable: false
|
|
277
|
+
} : c));
|
|
258
278
|
const hasValue = (0, vue.computed)(() => props.select !== "none");
|
|
259
279
|
const hasActiveFilters = (0, vue.computed)(() => (0, _atscript_ui_table.filledFilterCount)(state.filters.value) > 0);
|
|
260
280
|
const selectAllState = (0, vue.computed)(() => {
|
|
@@ -267,6 +287,13 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
267
287
|
return out;
|
|
268
288
|
});
|
|
269
289
|
const rowStyle = (0, vue.computed)(() => ({ height: `${props.rowHeight}px` }));
|
|
290
|
+
/** Shared "selectable" verdict — frozen, so a hookless pool allocates nothing. */
|
|
291
|
+
const SELECTABLE = Object.freeze({ ok: true });
|
|
292
|
+
/** Accessible name for a row's selection control, carrying the disabled reason. */
|
|
293
|
+
function selectLabel(verdict) {
|
|
294
|
+
if (verdict.ok) return "Select row";
|
|
295
|
+
return verdict.reason ? `Select row, ${verdict.reason}` : "Select row, not selectable";
|
|
296
|
+
}
|
|
270
297
|
const visibleSlots = (0, vue.computed)(() => {
|
|
271
298
|
const viewport = state.viewportRowCount.value;
|
|
272
299
|
if (viewport <= 0) return [];
|
|
@@ -276,19 +303,38 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
276
303
|
const rowValueFn = state.rowValueFn;
|
|
277
304
|
const hasSelection = props.select !== "none";
|
|
278
305
|
const selectedSet = hasSelection ? new Set(state.selectedRows.value) : null;
|
|
306
|
+
const gated = !!state.rowSelectable.value;
|
|
307
|
+
const hasHooks = gated || !!props.rowClass || !!props.rowAttrs;
|
|
279
308
|
const out = [];
|
|
280
309
|
for (let s = 0; s < count; s++) {
|
|
281
310
|
const abs = top + s;
|
|
282
311
|
const row = state.dataAt(abs);
|
|
283
312
|
const pk = row === void 0 ? void 0 : rowValueFn(row);
|
|
284
313
|
const selected = selectedSet !== null && row !== void 0 && selectedSet.has(pk);
|
|
314
|
+
let selectable = SELECTABLE;
|
|
315
|
+
let cls;
|
|
316
|
+
let attrs;
|
|
317
|
+
if (hasHooks && row !== void 0) {
|
|
318
|
+
const hookCtx = {
|
|
319
|
+
index: abs,
|
|
320
|
+
get selected() {
|
|
321
|
+
return selected;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
if (gated) selectable = state.isRowSelectable(row, abs);
|
|
325
|
+
cls = props.rowClass?.(row, hookCtx);
|
|
326
|
+
attrs = props.rowAttrs?.(row, hookCtx);
|
|
327
|
+
}
|
|
285
328
|
out.push({
|
|
286
329
|
s,
|
|
287
330
|
row,
|
|
288
331
|
pk,
|
|
289
332
|
errored: row === void 0 && state.errorAt(abs) !== null,
|
|
290
333
|
selected,
|
|
291
|
-
ariaSelected: hasSelection ? selected ? "true" : "false" : void 0
|
|
334
|
+
ariaSelected: hasSelection ? selected ? "true" : "false" : void 0,
|
|
335
|
+
selectable,
|
|
336
|
+
cls,
|
|
337
|
+
attrs
|
|
292
338
|
});
|
|
293
339
|
}
|
|
294
340
|
return out;
|
|
@@ -324,6 +370,9 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
324
370
|
mode: props.select
|
|
325
371
|
});
|
|
326
372
|
}
|
|
373
|
+
function onSelectCellKeydown(event, absIdx) {
|
|
374
|
+
require_use_table_state.onSelectControlKeydown(event, absIdx, props.select, state);
|
|
375
|
+
}
|
|
327
376
|
(0, vue.watch)([() => state.activeIndex.value, () => state.viewportRowCount.value], ([idx, viewport]) => {
|
|
328
377
|
if (idx < 0) return;
|
|
329
378
|
if (viewport <= 0) return;
|
|
@@ -362,11 +411,12 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
362
411
|
state.requestMainAction(event);
|
|
363
412
|
}
|
|
364
413
|
function onSelectAllToggle(headerState) {
|
|
365
|
-
if (headerState
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
414
|
+
if (headerState !== "none") {
|
|
415
|
+
state.selectedRows.value = [];
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const entries = [...state.windowCache.value.entries()].toSorted((a, b) => a[0] - b[0]);
|
|
419
|
+
state.selectAll(entries.map((e) => e[1]), (i) => entries[i][0]);
|
|
370
420
|
}
|
|
371
421
|
const { onSort, onHide, onFilter, onFiltersOff, onResetWidth, onReorder, onClearFilters } = require_use_table_column_handlers.useTableColumnHandlers(state);
|
|
372
422
|
const wrapperRef = (0, vue.ref)(null);
|
|
@@ -431,7 +481,7 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
431
481
|
]),
|
|
432
482
|
!__props.headless ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_table_status.as_table_header_default, {
|
|
433
483
|
key: 0,
|
|
434
|
-
columns:
|
|
484
|
+
columns: headerColumns.value,
|
|
435
485
|
sorters: (0, vue.unref)(state).sorters.value,
|
|
436
486
|
filters: (0, vue.unref)(state).filters.value,
|
|
437
487
|
"column-menu": __props.columnMenu,
|
|
@@ -488,23 +538,37 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
488
538
|
onTouchmove: (0, vue.withModifiers)(onTouchMove, ["prevent"]),
|
|
489
539
|
onTouchend: onTouchEnd
|
|
490
540
|
}, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(visibleSlots.value, (slot) => {
|
|
491
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: `slot-${slot.s}` }, [slot.row !== void 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
|
|
541
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: `slot-${slot.s}` }, [(0, vue.createCommentVNode)("\n `v-bind=\"slot.attrs\"` comes FIRST so every framework binding\n after it wins — consumer attrs decorate a row, never rewrite its\n id / role / aria / data contract.\n "), slot.row !== void 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("tr", (0, vue.mergeProps)({
|
|
492
542
|
key: 0,
|
|
543
|
+
ref_for: true
|
|
544
|
+
}, slot.attrs, {
|
|
493
545
|
id: (0, vue.unref)(state).rowId((0, vue.unref)(state).topIndex.value + slot.s),
|
|
494
|
-
class:
|
|
546
|
+
class: [
|
|
547
|
+
"as-window-data-row",
|
|
548
|
+
{ "as-table-row-active": (0, vue.unref)(state).activeIndex.value === (0, vue.unref)(state).topIndex.value + slot.s },
|
|
549
|
+
slot.cls
|
|
550
|
+
],
|
|
551
|
+
"data-selectable": slot.selectable.ok ? void 0 : "false",
|
|
495
552
|
role: "row",
|
|
496
553
|
"aria-rowindex": (0, vue.unref)(state).topIndex.value + slot.s + 2,
|
|
497
554
|
"aria-selected": slot.ariaSelected,
|
|
498
|
-
style:
|
|
555
|
+
style: rowStyle.value,
|
|
499
556
|
onClick: ($event) => onRowClick(slot.row, $event, (0, vue.unref)(state).topIndex.value + slot.s),
|
|
500
557
|
onDblclick: ($event) => onRowDblClick(slot.row, $event, (0, vue.unref)(state).topIndex.value + slot.s)
|
|
501
|
-
}, [
|
|
558
|
+
}), [
|
|
502
559
|
hasValue.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_5, [(0, vue.createElementVNode)("span", {
|
|
503
|
-
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
560
|
+
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
561
|
+
"as-table-checkbox-checked": slot.selected,
|
|
562
|
+
"as-table-checkbox-disabled": !slot.selectable.ok
|
|
563
|
+
}]),
|
|
504
564
|
role: "checkbox",
|
|
505
|
-
tabindex:
|
|
506
|
-
"aria-
|
|
507
|
-
|
|
565
|
+
tabindex: slot.selectable.ok ? 0 : void 0,
|
|
566
|
+
"aria-label": selectLabel(slot.selectable),
|
|
567
|
+
title: slot.selectable.reason,
|
|
568
|
+
"aria-checked": slot.selected ? "true" : "false",
|
|
569
|
+
"aria-disabled": slot.selectable.ok ? void 0 : "true",
|
|
570
|
+
onKeydown: ($event) => onSelectCellKeydown($event, (0, vue.unref)(state).topIndex.value + slot.s)
|
|
571
|
+
}, [slot.selected ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7)) : (0, vue.createCommentVNode)("v-if", true)], 42, _hoisted_6)])) : (0, vue.createCommentVNode)("v-if", true),
|
|
508
572
|
(0, vue.unref)(hasAnyCellBindings) ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)((0, vue.unref)(state).columns.value, (col) => {
|
|
509
573
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: col.path }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)([(0, vue.unref)(cellResolver)(col, slot.row, (0, vue.unref)(state).topIndex.value + slot.s)], (bindings) => {
|
|
510
574
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [cellSlotFlags.value[col.path] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", (0, vue.mergeProps)({
|
|
@@ -537,7 +601,7 @@ var as_window_table_base_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
537
601
|
class: "as-td-filler",
|
|
538
602
|
role: "gridcell"
|
|
539
603
|
}, null, -1))
|
|
540
|
-
],
|
|
604
|
+
], 16, _hoisted_4)) : ((0, vue.openBlock)(), (0, vue.createBlock)(as_window_skeleton_row_default, {
|
|
541
605
|
key: 1,
|
|
542
606
|
columns: (0, vue.unref)(state).columns.value,
|
|
543
607
|
"row-height": __props.rowHeight,
|
|
@@ -658,6 +722,18 @@ var as_window_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
658
722
|
type: Boolean,
|
|
659
723
|
required: false,
|
|
660
724
|
default: false
|
|
725
|
+
},
|
|
726
|
+
rowSelectable: {
|
|
727
|
+
type: Function,
|
|
728
|
+
required: false
|
|
729
|
+
},
|
|
730
|
+
rowClass: {
|
|
731
|
+
type: Function,
|
|
732
|
+
required: false
|
|
733
|
+
},
|
|
734
|
+
rowAttrs: {
|
|
735
|
+
type: Function,
|
|
736
|
+
required: false
|
|
661
737
|
}
|
|
662
738
|
},
|
|
663
739
|
emits: [
|
|
@@ -673,6 +749,9 @@ var as_window_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
673
749
|
(0, vue.watch)(() => props.rowDelete, (val) => {
|
|
674
750
|
state.rowDelete.value = val;
|
|
675
751
|
}, { immediate: true });
|
|
752
|
+
(0, vue.watch)(() => props.rowSelectable, (val) => {
|
|
753
|
+
state.rowSelectable.value = val;
|
|
754
|
+
}, { immediate: true });
|
|
676
755
|
require_use_table_selection.useSelectModeReset(state, () => props.select);
|
|
677
756
|
require_use_table_state.useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event), require_use_has_emit_listener.useHasEmitListener("onMainAction"));
|
|
678
757
|
const containerRef = (0, vue.ref)(null);
|
|
@@ -709,6 +788,8 @@ var as_window_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
709
788
|
select: __props.select,
|
|
710
789
|
headless: __props.headless,
|
|
711
790
|
"enter-action": __props.enterAction,
|
|
791
|
+
"row-class": __props.rowClass,
|
|
792
|
+
"row-attrs": __props.rowAttrs,
|
|
712
793
|
onRowClick: _cache[0] || (_cache[0] = (row, ev) => emit("row-click", row, ev)),
|
|
713
794
|
onRowDblclick: _cache[1] || (_cache[1] = (row, ev) => emit("row-dblclick", row, ev)),
|
|
714
795
|
onViewportMetricsChange: onMetrics
|
|
@@ -726,7 +807,9 @@ var as_window_table_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
726
807
|
"column-min-width",
|
|
727
808
|
"select",
|
|
728
809
|
"headless",
|
|
729
|
-
"enter-action"
|
|
810
|
+
"enter-action",
|
|
811
|
+
"row-class",
|
|
812
|
+
"row-attrs"
|
|
730
813
|
]), (0, vue.unref)(state).querying.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "query-loading", {}, () => [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", {
|
|
731
814
|
class: "as-table-query-overlay-icon",
|
|
732
815
|
"aria-hidden": "true"
|
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-Bl_q72WL.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-Be2IA0Eb.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-CLqFM2ff.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-BH0tDDnr.mjs";
|
|
2
2
|
export { as_window_table_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EnterAction,
|
|
1
|
+
import { a as EnterAction, d as QueryErrorKind, g as RowDeleteOpt, h as RowClassHook, m as RowAttrsHook, n as ColumnMenuConfig, v as RowSelectableHook } from "./types--ex8BJIO.cjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { SelectionMode } from "@atscript/ui-table";
|
|
4
4
|
|
|
@@ -58,26 +58,49 @@ type __VLS_Props = {
|
|
|
58
58
|
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
59
59
|
*/
|
|
60
60
|
headless?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Per-row selectability. Return `false` — or a string, surfaced as the
|
|
63
|
+
* disabled reason on the row's selection control — to make a row not
|
|
64
|
+
* selectable. Enforced on every path: row click, Space/Enter toggle, and
|
|
65
|
+
* the header select-all. Since 0.1.133.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
|
|
69
|
+
*/
|
|
70
|
+
rowSelectable?: RowSelectableHook;
|
|
71
|
+
/**
|
|
72
|
+
* Extra classes for the row element — string, array, or
|
|
73
|
+
* `{ class: boolean }` map, merged with the framework's own row classes.
|
|
74
|
+
* Since 0.1.133.
|
|
75
|
+
*/
|
|
76
|
+
rowClass?: RowClassHook;
|
|
77
|
+
/**
|
|
78
|
+
* Extra attributes for the row element. The framework's own `id`, `role`,
|
|
79
|
+
* `aria-*`, `data-*`, `class` and `style` always win, so a hook can
|
|
80
|
+
* decorate a row but never rewrite its accessibility contract.
|
|
81
|
+
* Since 0.1.133.
|
|
82
|
+
*/
|
|
83
|
+
rowAttrs?: RowAttrsHook;
|
|
61
84
|
};
|
|
62
85
|
declare var __VLS_13: string, __VLS_14: any, __VLS_16: {};
|
|
63
86
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any } & {
|
|
64
87
|
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
65
88
|
};
|
|
66
89
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
67
|
-
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
68
90
|
"row-click": (row: Row, event: MouseEvent) => any;
|
|
69
91
|
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
92
|
+
"main-action": (row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
70
93
|
error: (error: Error, kind: QueryErrorKind) => any;
|
|
71
94
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
72
|
-
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
73
95
|
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
74
96
|
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
97
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
75
98
|
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
76
99
|
}>, {
|
|
77
|
-
select: SelectionMode;
|
|
78
100
|
reorderable: boolean;
|
|
79
101
|
resizable: boolean;
|
|
80
102
|
columnMinWidth: number;
|
|
103
|
+
select: SelectionMode;
|
|
81
104
|
rowDelete: boolean | RowDeleteOpt;
|
|
82
105
|
headless: boolean;
|
|
83
106
|
rowHeight: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EnterAction,
|
|
1
|
+
import { a as EnterAction, d as QueryErrorKind, g as RowDeleteOpt, h as RowClassHook, m as RowAttrsHook, n as ColumnMenuConfig, v as RowSelectableHook } from "./types-CBGaTR2Z.mjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { SelectionMode } from "@atscript/ui-table";
|
|
4
4
|
|
|
@@ -58,26 +58,49 @@ type __VLS_Props = {
|
|
|
58
58
|
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
59
59
|
*/
|
|
60
60
|
headless?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Per-row selectability. Return `false` — or a string, surfaced as the
|
|
63
|
+
* disabled reason on the row's selection control — to make a row not
|
|
64
|
+
* selectable. Enforced on every path: row click, Space/Enter toggle, and
|
|
65
|
+
* the header select-all. Since 0.1.133.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* `:row-selectable="(row) => row.locked ? 'Locked by another user' : true"`
|
|
69
|
+
*/
|
|
70
|
+
rowSelectable?: RowSelectableHook;
|
|
71
|
+
/**
|
|
72
|
+
* Extra classes for the row element — string, array, or
|
|
73
|
+
* `{ class: boolean }` map, merged with the framework's own row classes.
|
|
74
|
+
* Since 0.1.133.
|
|
75
|
+
*/
|
|
76
|
+
rowClass?: RowClassHook;
|
|
77
|
+
/**
|
|
78
|
+
* Extra attributes for the row element. The framework's own `id`, `role`,
|
|
79
|
+
* `aria-*`, `data-*`, `class` and `style` always win, so a hook can
|
|
80
|
+
* decorate a row but never rewrite its accessibility contract.
|
|
81
|
+
* Since 0.1.133.
|
|
82
|
+
*/
|
|
83
|
+
rowAttrs?: RowAttrsHook;
|
|
61
84
|
};
|
|
62
85
|
declare var __VLS_13: string, __VLS_14: any, __VLS_16: {};
|
|
63
86
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any } & {
|
|
64
87
|
'query-loading'?: (props: typeof __VLS_16) => any;
|
|
65
88
|
};
|
|
66
89
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
67
|
-
"main-action": (row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any;
|
|
68
90
|
"row-click": (row: Row, event: MouseEvent) => any;
|
|
69
91
|
"row-dblclick": (row: Row, event: MouseEvent) => any;
|
|
92
|
+
"main-action": (row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
70
93
|
error: (error: Error, kind: QueryErrorKind) => any;
|
|
71
94
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
72
|
-
"onMain-action"?: ((row: Row, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
73
95
|
"onRow-click"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
74
96
|
"onRow-dblclick"?: ((row: Row, event: MouseEvent) => any) | undefined;
|
|
97
|
+
"onMain-action"?: ((row: Row, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
75
98
|
onError?: ((error: Error, kind: QueryErrorKind) => any) | undefined;
|
|
76
99
|
}>, {
|
|
77
|
-
select: SelectionMode;
|
|
78
100
|
reorderable: boolean;
|
|
79
101
|
resizable: boolean;
|
|
80
102
|
columnMinWidth: number;
|
|
103
|
+
select: SelectionMode;
|
|
81
104
|
rowDelete: boolean | RowDeleteOpt;
|
|
82
105
|
headless: boolean;
|
|
83
106
|
rowHeight: number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/utils/error-message.ts
|
|
2
|
+
/**
|
|
3
|
+
* Turn an unknown thrown value into copy a user can read. Anything that
|
|
4
|
+
* isn't an `Error` with a non-empty message falls back to `fallback` —
|
|
5
|
+
* `"[object Object]"` and empty bubbles never reach the surface.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.1.133
|
|
8
|
+
*/
|
|
9
|
+
function errorMessage(err, fallback) {
|
|
10
|
+
return err instanceof Error && err.message ? err.message : fallback;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, "errorMessage", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return errorMessage;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/utils/error-message.ts
|
|
2
|
+
/**
|
|
3
|
+
* Turn an unknown thrown value into copy a user can read. Anything that
|
|
4
|
+
* isn't an `Error` with a non-empty message falls back to `fallback` —
|
|
5
|
+
* `"[object Object]"` and empty bubbles never reach the surface.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.1.133
|
|
8
|
+
*/
|
|
9
|
+
function errorMessage(err, fallback) {
|
|
10
|
+
return err instanceof Error && err.message ? err.message : fallback;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { errorMessage as t };
|