@atscript/vue-table 0.1.140 → 0.1.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/as-action-form-dialog.cjs +1 -1
- package/dist/as-action-form-dialog.mjs +1 -1
- package/dist/{as-action-menu-content-B5RFt7Hc.cjs → as-action-menu-content-BaNFBYn3.cjs} +1 -1
- package/dist/{as-action-menu-content-KNJr1EkO.mjs → as-action-menu-content-miQYVP7x.mjs} +1 -1
- package/dist/as-column-menu.d.cts +1 -1
- package/dist/as-column-menu.d.mts +1 -1
- package/dist/{as-column-menu.vue-DKQNY5gh.d.cts → as-column-menu.vue-Ca3wSDxw.d.mts} +2 -2
- package/dist/{as-column-menu.vue-hOmuVcKf.d.mts → as-column-menu.vue-Co7FtiEM.d.cts} +2 -2
- package/dist/{as-config-dialog-B1KJJSHE.cjs → as-config-dialog-CVSOrS9O.cjs} +2 -2
- package/dist/{as-config-dialog-JXNkCCrh.mjs → as-config-dialog-Di02V3bs.mjs} +2 -2
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-CC6U8nLZ.mjs → as-confirm-dialog-C9Qat2rG.mjs} +1 -1
- package/dist/{as-confirm-dialog-a736BLOm.cjs → as-confirm-dialog-fCwo1ty9.cjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-IflKkOd8.cjs → as-filter-dialog-DYpbsNDx.cjs} +7 -7
- package/dist/{as-filter-dialog-C3wltqrN.mjs → as-filter-dialog-DdtrTT5w.mjs} +7 -7
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-pygBjA-K.cjs → as-filter-field-4-qFRsJx.cjs} +8 -10
- package/dist/{as-filter-field-D_6DlFcp.mjs → as-filter-field-DEQVodKG.mjs} +8 -10
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/{as-filters-BIoEsPD0.cjs → as-filters-C6ZkLrf4.cjs} +68 -25
- package/dist/{as-filters-BDzQ2SM_.mjs → as-filters-Dd_j6_6G.mjs} +69 -26
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.d.cts +1 -1
- package/dist/as-filters.d.mts +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-filters.vue-BSgUEh4D.d.mts → as-filters.vue-dHbGmcbr.d.mts} +56 -4
- package/dist/{as-filters.vue-DMXZhQW3.d.cts → as-filters.vue-vH1FHn9L.d.cts} +56 -4
- package/dist/{as-preset-dialog-D_w4cxKS.mjs → as-preset-dialog-Bap48oUv.mjs} +1 -1
- package/dist/{as-preset-dialog-BgZB8xyk.cjs → as-preset-dialog-SYA-6lGR.cjs} +1 -1
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-XnGrqHyF.cjs → as-preset-picker-BdKTZa95.cjs} +27 -21
- package/dist/{as-preset-picker-B8d6l3U1.mjs → as-preset-picker-NBrvsE6s.mjs} +27 -21
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-residual-filter-C65QsWxr.mjs → as-residual-filter-BFnbI3h3.mjs} +1 -1
- package/dist/{as-residual-filter-ihvXCtpH.cjs → as-residual-filter-CZ-Bytdj.cjs} +1 -1
- package/dist/as-residual-filter.cjs +1 -1
- package/dist/as-residual-filter.mjs +1 -1
- package/dist/{as-row-actions-C6N0lcZb.cjs → as-row-actions-C3xHkX53.cjs} +2 -2
- package/dist/{as-row-actions-xQ9M1PrO.mjs → as-row-actions-KeoHo9Ex.mjs} +2 -2
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.d.cts +1 -1
- package/dist/as-row-actions.d.mts +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-row-actions.vue-C8vslg0n.d.mts → as-row-actions.vue-D3_z3ytk.d.cts} +1 -1
- package/dist/{as-row-actions.vue-B3XAxDAL.d.cts → as-row-actions.vue-nmaDuxBT.d.mts} +1 -1
- package/dist/{as-table-status-2rA91OFT.mjs → as-select-cell-KD_ns8DS.mjs} +149 -36
- package/dist/{as-table-status-UWTPJJUL.cjs → as-select-cell-XnzNuW2v.cjs} +154 -35
- package/dist/{as-table-B49x0hDM.mjs → as-table-NHqyekNd.mjs} +10 -11
- package/dist/{as-table-actions-B2Hy3h7v.mjs → as-table-actions-BpEFcsgh.mjs} +2 -2
- package/dist/{as-table-actions-B-jY3s6f.cjs → as-table-actions-UQmFtRdJ.cjs} +2 -2
- package/dist/as-table-actions.cjs +1 -1
- package/dist/as-table-actions.d.cts +1 -1
- package/dist/as-table-actions.d.mts +1 -1
- package/dist/as-table-actions.mjs +1 -1
- package/dist/{as-table-actions.vue-BgTJuXEH.d.cts → as-table-actions.vue-BG3JVaBQ.d.mts} +1 -1
- package/dist/{as-table-actions.vue-BnLH2NqO.d.mts → as-table-actions.vue-DcuzNZoC.d.cts} +1 -1
- package/dist/{as-table-ouPxssqv.cjs → as-table-ay1yel3u.cjs} +10 -11
- package/dist/{as-table-base-DErJfFYz.mjs → as-table-base-89DkDZ-1.mjs} +46 -60
- package/dist/{as-table-base-ceywcVRq.cjs → as-table-base-umzg4PBR.cjs} +51 -65
- package/dist/{as-table-header-cell-Ccf06b2_.mjs → as-table-header-cell-DU3ws2x9.mjs} +1 -1
- package/dist/{as-table-header-cell-ZCk3XD_d.cjs → as-table-header-cell-f3YpgJX1.cjs} +1 -1
- package/dist/as-table-header-cell.cjs +1 -1
- package/dist/as-table-header-cell.d.cts +1 -1
- package/dist/as-table-header-cell.d.mts +1 -1
- package/dist/as-table-header-cell.mjs +1 -1
- package/dist/{as-table-header-cell.vue-C7jNmdDh.d.mts → as-table-header-cell.vue-5VGRc23o.d.mts} +1 -1
- package/dist/{as-table-header-cell.vue-DkClJBAT.d.cts → as-table-header-cell.vue-XR90UlHO.d.cts} +1 -1
- package/dist/{as-table-root-CG7bLzcQ.mjs → as-table-root-47hiBEnq.mjs} +8 -5
- package/dist/{as-table-root-_58hdHAi.cjs → as-table-root-DDeGktcl.cjs} +8 -5
- 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-DpPRMy3v.d.mts → as-table-root.vue-BGx453_Q.d.mts} +30 -4
- package/dist/{as-table-root.vue-D8hH1xGK.d.cts → as-table-root.vue-yZ7ZcwdT.d.cts} +32 -6
- 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-CudFoZTF.d.mts → as-table.vue-CwI5Z0y5.d.cts} +13 -11
- package/dist/{as-table.vue-Bv6sKnL5.d.cts → as-table.vue-wdFf4hMW.d.mts} +13 -11
- package/dist/{as-window-table-KyS6YUpa.mjs → as-window-table-C312T_bc.mjs} +83 -62
- package/dist/{as-window-table-C9YtzepV.cjs → as-window-table-hOYLNhX3.cjs} +89 -68
- package/dist/as-window-table.cjs +1 -1
- package/dist/as-window-table.d.cts +1 -1
- package/dist/as-window-table.d.mts +1 -1
- package/dist/as-window-table.mjs +1 -1
- package/dist/{as-window-table.vue-COVl3die.d.mts → as-window-table.vue-D6UDA6td.d.cts} +9 -7
- package/dist/{as-window-table.vue-CRWdhOgC.d.cts → as-window-table.vue-Deg1mj3t.d.mts} +9 -7
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +10 -10
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs +18 -18
- package/dist/{types-BCixOa8x.d.cts → types-BU7J-a1r.d.mts} +79 -10
- package/dist/{types-D7qVxU_y.d.mts → types-D4dK49sA.d.cts} +79 -10
- package/dist/{use-table-2xPxoNRX.mjs → use-table-DlqGHjPh.mjs} +3 -2
- package/dist/{use-table-column-handlers-p_xK-l0e.mjs → use-table-column-handlers-0myVzrZR.mjs} +1 -1
- package/dist/{use-table-column-handlers-rqFo9HLz.cjs → use-table-column-handlers-BHMCo_HR.cjs} +1 -1
- package/dist/{use-table-component-XQ-Qt_sp.cjs → use-table-component-IziAm0vk.cjs} +1 -1
- package/dist/{use-table-component-BYO0zMQj.mjs → use-table-component-TLwFq4rx.mjs} +1 -1
- package/dist/{use-table-nav-bridge-BDBnRc4C.mjs → use-table-nav-bridge-CkQqimdS.mjs} +1 -1
- package/dist/{use-table-nav-bridge-DvrsPanF.cjs → use-table-nav-bridge-QU4jKhqx.cjs} +1 -1
- package/dist/{use-table-state-pF_9gnTG.cjs → use-table-state-BiklfjP0.cjs} +243 -45
- package/dist/{use-table-state-BzjbnpBA.mjs → use-table-state-Cq-3tbVr.mjs} +227 -47
- package/dist/{use-table-B45WZLwg.cjs → use-table-yZNJTfRq.cjs} +3 -2
- package/package.json +9 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
2
|
-
import { t as useTableComponent } from "./use-table-component-
|
|
3
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
4
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
1
|
+
import { g as toggleRowAt, h as onSelectControlKeydown, o as useTableContextOptional } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
|
+
import { t as useTableComponent } from "./use-table-component-TLwFq4rx.mjs";
|
|
3
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-DU3ws2x9.mjs";
|
|
4
|
+
import { t as as_row_actions_default } from "./as-row-actions-KeoHo9Ex.mjs";
|
|
5
5
|
import { t as as_table_cell_value_default } from "./as-table-cell-value-DoH8Mieo.mjs";
|
|
6
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";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
@@ -325,12 +325,12 @@ function useColumnHeaderDragResize(opts) {
|
|
|
325
325
|
}
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region src/components/internal/as-table-colgroup.vue?vue&type=script&setup=true&lang.ts
|
|
328
|
-
const _hoisted_1$
|
|
328
|
+
const _hoisted_1$3 = {
|
|
329
329
|
key: 0,
|
|
330
330
|
class: "as-col-select"
|
|
331
331
|
};
|
|
332
|
-
const _hoisted_2$
|
|
333
|
-
const _hoisted_3$
|
|
332
|
+
const _hoisted_2$3 = ["data-column-path"];
|
|
333
|
+
const _hoisted_3$3 = {
|
|
334
334
|
key: 1,
|
|
335
335
|
class: "as-col-filler"
|
|
336
336
|
};
|
|
@@ -365,28 +365,28 @@ var as_table_colgroup_default = /* @__PURE__ */ defineComponent({
|
|
|
365
365
|
return (_ctx, _cache) => {
|
|
366
366
|
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode("\n `<colgroup>` carries column widths independently of the header so widths\n survive when `<thead>` is omitted (`headless`). Col order MUST match the\n body `<td>` order exactly: select col (when `hasSelect`), data columns,\n then the filler col (when `withFiller`).\n "), createElementVNode("colgroup", null, [
|
|
367
367
|
createCommentVNode(" Placeholder for the leading select column. No width — `as-td-select`\n self-sizes (`w-[4em]`); the col exists only for positional alignment. "),
|
|
368
|
-
__props.hasSelect ? (openBlock(), createElementBlock("col", _hoisted_1$
|
|
368
|
+
__props.hasSelect ? (openBlock(), createElementBlock("col", _hoisted_1$3)) : createCommentVNode("v-if", true),
|
|
369
369
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
|
|
370
370
|
return openBlock(), createElementBlock("col", {
|
|
371
371
|
key: col.path,
|
|
372
372
|
"data-column-path": col.path,
|
|
373
373
|
style: normalizeStyle(colStyle(col))
|
|
374
|
-
}, null, 12, _hoisted_2$
|
|
374
|
+
}, null, 12, _hoisted_2$3);
|
|
375
375
|
}), 128)),
|
|
376
376
|
createCommentVNode(" Trailing filler col; absorbs leftover space, no width. "),
|
|
377
|
-
__props.withFiller ? (openBlock(), createElementBlock("col", _hoisted_3$
|
|
377
|
+
__props.withFiller ? (openBlock(), createElementBlock("col", _hoisted_3$3)) : createCommentVNode("v-if", true)
|
|
378
378
|
])], 2112);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region src/components/internal/as-table-header.vue?vue&type=script&setup=true&lang.ts
|
|
384
|
-
const _hoisted_1$
|
|
384
|
+
const _hoisted_1$2 = {
|
|
385
385
|
key: 0,
|
|
386
386
|
class: "as-th-select"
|
|
387
387
|
};
|
|
388
|
-
const _hoisted_2$
|
|
389
|
-
const _hoisted_3$
|
|
388
|
+
const _hoisted_2$2 = ["aria-checked"];
|
|
389
|
+
const _hoisted_3$2 = {
|
|
390
390
|
key: 0,
|
|
391
391
|
class: "as-table-checkbox-tick",
|
|
392
392
|
"aria-hidden": "true"
|
|
@@ -457,6 +457,10 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
457
457
|
type: String,
|
|
458
458
|
required: false
|
|
459
459
|
},
|
|
460
|
+
selectedCount: {
|
|
461
|
+
type: Number,
|
|
462
|
+
required: false
|
|
463
|
+
},
|
|
460
464
|
withFiller: {
|
|
461
465
|
type: Boolean,
|
|
462
466
|
required: false,
|
|
@@ -476,7 +480,7 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
476
480
|
"reset-width",
|
|
477
481
|
"reorder",
|
|
478
482
|
"resize",
|
|
479
|
-
"
|
|
483
|
+
"toggle-all"
|
|
480
484
|
],
|
|
481
485
|
setup(__props, { emit: __emit }) {
|
|
482
486
|
const HeaderCell = useTableComponent("headerCell", as_table_header_cell_default);
|
|
@@ -542,11 +546,19 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
542
546
|
if (!props.selectAllState) return;
|
|
543
547
|
event.preventDefault();
|
|
544
548
|
event.stopPropagation();
|
|
545
|
-
|
|
549
|
+
toggleSelectAll();
|
|
550
|
+
}
|
|
551
|
+
/** The header control's action — click, keys and the `header-__select` slot. */
|
|
552
|
+
function toggleSelectAll() {
|
|
553
|
+
if (props.selectAllState) emit("toggle-all");
|
|
546
554
|
}
|
|
547
555
|
return (_ctx, _cache) => {
|
|
548
556
|
return openBlock(), createElementBlock("thead", null, [createElementVNode("tr", null, [
|
|
549
|
-
__props.hasSelectColumn ? (openBlock(), createElementBlock("th", _hoisted_1$
|
|
557
|
+
__props.hasSelectColumn ? (openBlock(), createElementBlock("th", _hoisted_1$2, [renderSlot(_ctx.$slots, "header-__select", {
|
|
558
|
+
state: __props.selectAllState,
|
|
559
|
+
toggle: toggleSelectAll,
|
|
560
|
+
selectedCount: __props.selectedCount ?? 0
|
|
561
|
+
}, () => [__props.selectAllState ? (openBlock(), createElementBlock("span", {
|
|
550
562
|
key: 0,
|
|
551
563
|
class: normalizeClass(["as-table-checkbox", {
|
|
552
564
|
"as-table-checkbox-checked": __props.selectAllState === "all",
|
|
@@ -556,9 +568,9 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
556
568
|
tabindex: "0",
|
|
557
569
|
"aria-label": "Select all rows",
|
|
558
570
|
"aria-checked": __props.selectAllState === "none" ? "false" : __props.selectAllState === "all" ? "true" : "mixed",
|
|
559
|
-
onClick:
|
|
571
|
+
onClick: toggleSelectAll,
|
|
560
572
|
onKeydown: onSelectAllKeydown
|
|
561
|
-
}, [__props.selectAllState === "all" ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
573
|
+
}, [__props.selectAllState === "all" ? (openBlock(), createElementBlock("span", _hoisted_3$2)) : __props.selectAllState === "some" ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("v-if", true)], 42, _hoisted_2$2)) : createCommentVNode("v-if", true)])])) : createCommentVNode("v-if", true),
|
|
562
574
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
|
|
563
575
|
return openBlock(), createElementBlock("th", {
|
|
564
576
|
key: col.path,
|
|
@@ -580,11 +592,11 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
580
592
|
filters: __props.filters?.[col.path],
|
|
581
593
|
"column-menu": __props.columnMenu,
|
|
582
594
|
"width-entry": __props.columnWidths[col.path],
|
|
583
|
-
onSort: _cache[
|
|
584
|
-
onHide: _cache[
|
|
585
|
-
onFilter: _cache[
|
|
586
|
-
onFiltersOff: _cache[
|
|
587
|
-
onResetWidth: _cache[
|
|
595
|
+
onSort: _cache[0] || (_cache[0] = (c, d) => emit("sort", c, d)),
|
|
596
|
+
onHide: _cache[1] || (_cache[1] = (c) => emit("hide", c)),
|
|
597
|
+
onFilter: _cache[2] || (_cache[2] = (c) => emit("filter", c)),
|
|
598
|
+
onFiltersOff: _cache[3] || (_cache[3] = (c) => emit("filters-off", c)),
|
|
599
|
+
onResetWidth: _cache[4] || (_cache[4] = (c) => emit("reset-width", c))
|
|
588
600
|
}, null, 40, [
|
|
589
601
|
"column",
|
|
590
602
|
"sort-direction",
|
|
@@ -596,12 +608,12 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
596
608
|
key: 0,
|
|
597
609
|
class: "as-th-resize-handle",
|
|
598
610
|
draggable: "false",
|
|
599
|
-
onDragstart: _cache[
|
|
600
|
-
onPointerdown: _cache[
|
|
601
|
-
onPointermove: _cache[
|
|
602
|
-
onPointerup: _cache[
|
|
603
|
-
onPointercancel: _cache[
|
|
604
|
-
onDblclick: _cache[
|
|
611
|
+
onDragstart: _cache[5] || (_cache[5] = withModifiers(() => {}, ["prevent", "stop"])),
|
|
612
|
+
onPointerdown: _cache[6] || (_cache[6] = withModifiers((...args) => unref(onResizeHandlePointerDown) && unref(onResizeHandlePointerDown)(...args), ["stop"])),
|
|
613
|
+
onPointermove: _cache[7] || (_cache[7] = (...args) => unref(onResizeHandlePointerMove) && unref(onResizeHandlePointerMove)(...args)),
|
|
614
|
+
onPointerup: _cache[8] || (_cache[8] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
|
|
615
|
+
onPointercancel: _cache[9] || (_cache[9] = (...args) => unref(onResizeHandleEnd) && unref(onResizeHandleEnd)(...args)),
|
|
616
|
+
onDblclick: _cache[10] || (_cache[10] = withModifiers((...args) => unref(onResizeHandleDoubleClick) && unref(onResizeHandleDoubleClick)(...args), ["stop"]))
|
|
605
617
|
}, null, 32)) : createCommentVNode("v-if", true)
|
|
606
618
|
], 46, _hoisted_5$1);
|
|
607
619
|
}), 128)),
|
|
@@ -612,12 +624,12 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
612
624
|
});
|
|
613
625
|
//#endregion
|
|
614
626
|
//#region src/components/internal/as-table-status.vue?vue&type=script&setup=true&lang.ts
|
|
615
|
-
const _hoisted_1 = {
|
|
627
|
+
const _hoisted_1$1 = {
|
|
616
628
|
key: 0,
|
|
617
629
|
class: "as-table-error"
|
|
618
630
|
};
|
|
619
|
-
const _hoisted_2 = { class: "as-vh-empty" };
|
|
620
|
-
const _hoisted_3 = { class: "as-vh-empty-body" };
|
|
631
|
+
const _hoisted_2$1 = { class: "as-vh-empty" };
|
|
632
|
+
const _hoisted_3$1 = { class: "as-vh-empty-body" };
|
|
621
633
|
const _hoisted_4 = {
|
|
622
634
|
key: 1,
|
|
623
635
|
class: "as-table-empty"
|
|
@@ -676,16 +688,16 @@ var as_table_status_default = /* @__PURE__ */ defineComponent({
|
|
|
676
688
|
},
|
|
677
689
|
setup(__props) {
|
|
678
690
|
return (_ctx, _cache) => {
|
|
679
|
-
return __props.queryError ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "error", {
|
|
691
|
+
return __props.queryError ? (openBlock(), createElementBlock("div", _hoisted_1$1, [renderSlot(_ctx.$slots, "error", {
|
|
680
692
|
error: __props.queryError,
|
|
681
693
|
retry: __props.onRetry
|
|
682
|
-
}, () => [createElementVNode("div", _hoisted_2, [
|
|
694
|
+
}, () => [createElementVNode("div", _hoisted_2$1, [
|
|
683
695
|
_cache[3] || (_cache[3] = createElementVNode("span", {
|
|
684
696
|
class: "as-vh-error-icon i-as-warning",
|
|
685
697
|
"aria-hidden": "true"
|
|
686
698
|
}, null, -1)),
|
|
687
699
|
_cache[4] || (_cache[4] = createElementVNode("p", { class: "as-vh-empty-title" }, "Failed to load values", -1)),
|
|
688
|
-
createElementVNode("p", _hoisted_3, toDisplayString(__props.queryError.message), 1),
|
|
700
|
+
createElementVNode("p", _hoisted_3$1, toDisplayString(__props.queryError.message), 1),
|
|
689
701
|
__props.onRetry ? (openBlock(), createElementBlock("button", {
|
|
690
702
|
key: 0,
|
|
691
703
|
type: "button",
|
|
@@ -724,4 +736,105 @@ var as_table_status_default = /* @__PURE__ */ defineComponent({
|
|
|
724
736
|
}
|
|
725
737
|
});
|
|
726
738
|
//#endregion
|
|
727
|
-
|
|
739
|
+
//#region src/components/internal/as-select-cell.vue?vue&type=script&setup=true&lang.ts
|
|
740
|
+
const _hoisted_1 = {
|
|
741
|
+
class: "as-td-select",
|
|
742
|
+
role: "gridcell"
|
|
743
|
+
};
|
|
744
|
+
const _hoisted_2 = [
|
|
745
|
+
"tabindex",
|
|
746
|
+
"aria-checked",
|
|
747
|
+
"aria-disabled",
|
|
748
|
+
"aria-label",
|
|
749
|
+
"title"
|
|
750
|
+
];
|
|
751
|
+
const _hoisted_3 = {
|
|
752
|
+
key: 0,
|
|
753
|
+
class: "as-table-checkbox-tick",
|
|
754
|
+
"aria-hidden": "true"
|
|
755
|
+
};
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/components/internal/as-select-cell.vue
|
|
758
|
+
var as_select_cell_default = /* @__PURE__ */ defineComponent({
|
|
759
|
+
__name: "as-select-cell",
|
|
760
|
+
props: {
|
|
761
|
+
row: {
|
|
762
|
+
type: Object,
|
|
763
|
+
required: true
|
|
764
|
+
},
|
|
765
|
+
index: {
|
|
766
|
+
type: Number,
|
|
767
|
+
required: true
|
|
768
|
+
},
|
|
769
|
+
selected: {
|
|
770
|
+
type: Boolean,
|
|
771
|
+
required: true
|
|
772
|
+
},
|
|
773
|
+
verdict: {
|
|
774
|
+
type: Object,
|
|
775
|
+
required: true
|
|
776
|
+
},
|
|
777
|
+
select: {
|
|
778
|
+
type: String,
|
|
779
|
+
required: true
|
|
780
|
+
},
|
|
781
|
+
selectOn: {
|
|
782
|
+
type: String,
|
|
783
|
+
required: true
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
setup(__props) {
|
|
787
|
+
const props = __props;
|
|
788
|
+
const ctx = useTableContextOptional();
|
|
789
|
+
function toggle() {
|
|
790
|
+
if (ctx) toggleRowAt(props.index, props.select, ctx.state);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* With `selectOn: "row"` the click bubbles to the row, which toggles; with
|
|
794
|
+
* `"control"` it toggles here and stops, so the row click (active-row move,
|
|
795
|
+
* `row-click`) and a double-click main action don't also fire.
|
|
796
|
+
*/
|
|
797
|
+
function onClick(event) {
|
|
798
|
+
if (props.selectOn !== "control") return;
|
|
799
|
+
event.stopPropagation();
|
|
800
|
+
toggle();
|
|
801
|
+
}
|
|
802
|
+
function onDblClick(event) {
|
|
803
|
+
if (props.selectOn === "control") event.stopPropagation();
|
|
804
|
+
}
|
|
805
|
+
function onKeydown(event) {
|
|
806
|
+
if (ctx) onSelectControlKeydown(event, props.index, props.select, ctx.state);
|
|
807
|
+
}
|
|
808
|
+
/** Accessible name for the control, carrying the disabled reason. */
|
|
809
|
+
function label() {
|
|
810
|
+
if (props.verdict.ok) return "Select row";
|
|
811
|
+
return props.verdict.reason ? `Select row, ${props.verdict.reason}` : "Select row, not selectable";
|
|
812
|
+
}
|
|
813
|
+
return (_ctx, _cache) => {
|
|
814
|
+
return openBlock(), createElementBlock("td", _hoisted_1, [renderSlot(_ctx.$slots, "default", {
|
|
815
|
+
row: __props.row,
|
|
816
|
+
index: __props.index,
|
|
817
|
+
selected: __props.selected,
|
|
818
|
+
selectable: __props.verdict.ok,
|
|
819
|
+
reason: __props.verdict.reason,
|
|
820
|
+
toggle
|
|
821
|
+
}, () => [createElementVNode("span", {
|
|
822
|
+
class: normalizeClass(["as-table-checkbox", {
|
|
823
|
+
"as-table-checkbox-checked": __props.selected,
|
|
824
|
+
"as-table-checkbox-disabled": !__props.verdict.ok
|
|
825
|
+
}]),
|
|
826
|
+
role: "checkbox",
|
|
827
|
+
tabindex: __props.verdict.ok ? 0 : void 0,
|
|
828
|
+
"aria-checked": __props.selected ? "true" : "false",
|
|
829
|
+
"aria-disabled": __props.verdict.ok ? void 0 : "true",
|
|
830
|
+
"aria-label": label(),
|
|
831
|
+
title: __props.verdict.reason,
|
|
832
|
+
onClick,
|
|
833
|
+
onDblclick: onDblClick,
|
|
834
|
+
onKeydown
|
|
835
|
+
}, [__props.selected ? (openBlock(), createElementBlock("span", _hoisted_3)) : createCommentVNode("v-if", true)], 42, _hoisted_2)])]);
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
//#endregion
|
|
840
|
+
export { useRafBatch as a, as_table_colgroup_default as i, as_table_status_default as n, useCellComponents as o, as_table_header_default as r, useCellResolver as s, as_select_cell_default as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_use_table_component = require("./use-table-component-
|
|
3
|
-
const require_as_table_header_cell = require("./as-table-header-cell-
|
|
4
|
-
const require_as_row_actions = require("./as-row-actions-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-BiklfjP0.cjs");
|
|
2
|
+
const require_use_table_component = require("./use-table-component-IziAm0vk.cjs");
|
|
3
|
+
const require_as_table_header_cell = require("./as-table-header-cell-f3YpgJX1.cjs");
|
|
4
|
+
const require_as_row_actions = require("./as-row-actions-C3xHkX53.cjs");
|
|
5
5
|
const require_as_table_cell_value = require("./as-table-cell-value-COyZnwUj.cjs");
|
|
6
6
|
let _atscript_ui = require("@atscript/ui");
|
|
7
7
|
let vue = require("vue");
|
|
@@ -325,12 +325,12 @@ function useColumnHeaderDragResize(opts) {
|
|
|
325
325
|
}
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region src/components/internal/as-table-colgroup.vue?vue&type=script&setup=true&lang.ts
|
|
328
|
-
const _hoisted_1$
|
|
328
|
+
const _hoisted_1$3 = {
|
|
329
329
|
key: 0,
|
|
330
330
|
class: "as-col-select"
|
|
331
331
|
};
|
|
332
|
-
const _hoisted_2$
|
|
333
|
-
const _hoisted_3$
|
|
332
|
+
const _hoisted_2$3 = ["data-column-path"];
|
|
333
|
+
const _hoisted_3$3 = {
|
|
334
334
|
key: 1,
|
|
335
335
|
class: "as-col-filler"
|
|
336
336
|
};
|
|
@@ -365,28 +365,28 @@ var as_table_colgroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
365
365
|
return (_ctx, _cache) => {
|
|
366
366
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)("\n `<colgroup>` carries column widths independently of the header so widths\n survive when `<thead>` is omitted (`headless`). Col order MUST match the\n body `<td>` order exactly: select col (when `hasSelect`), data columns,\n then the filler col (when `withFiller`).\n "), (0, vue.createElementVNode)("colgroup", null, [
|
|
367
367
|
(0, vue.createCommentVNode)(" Placeholder for the leading select column. No width — `as-td-select`\n self-sizes (`w-[4em]`); the col exists only for positional alignment. "),
|
|
368
|
-
__props.hasSelect ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_1$
|
|
368
|
+
__props.hasSelect ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_1$3)) : (0, vue.createCommentVNode)("v-if", true),
|
|
369
369
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.columns, (col) => {
|
|
370
370
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("col", {
|
|
371
371
|
key: col.path,
|
|
372
372
|
"data-column-path": col.path,
|
|
373
373
|
style: (0, vue.normalizeStyle)(colStyle(col))
|
|
374
|
-
}, null, 12, _hoisted_2$
|
|
374
|
+
}, null, 12, _hoisted_2$3);
|
|
375
375
|
}), 128)),
|
|
376
376
|
(0, vue.createCommentVNode)(" Trailing filler col; absorbs leftover space, no width. "),
|
|
377
|
-
__props.withFiller ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_3$
|
|
377
|
+
__props.withFiller ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_3$3)) : (0, vue.createCommentVNode)("v-if", true)
|
|
378
378
|
])], 2112);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region src/components/internal/as-table-header.vue?vue&type=script&setup=true&lang.ts
|
|
384
|
-
const _hoisted_1$
|
|
384
|
+
const _hoisted_1$2 = {
|
|
385
385
|
key: 0,
|
|
386
386
|
class: "as-th-select"
|
|
387
387
|
};
|
|
388
|
-
const _hoisted_2$
|
|
389
|
-
const _hoisted_3$
|
|
388
|
+
const _hoisted_2$2 = ["aria-checked"];
|
|
389
|
+
const _hoisted_3$2 = {
|
|
390
390
|
key: 0,
|
|
391
391
|
class: "as-table-checkbox-tick",
|
|
392
392
|
"aria-hidden": "true"
|
|
@@ -457,6 +457,10 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
457
457
|
type: String,
|
|
458
458
|
required: false
|
|
459
459
|
},
|
|
460
|
+
selectedCount: {
|
|
461
|
+
type: Number,
|
|
462
|
+
required: false
|
|
463
|
+
},
|
|
460
464
|
withFiller: {
|
|
461
465
|
type: Boolean,
|
|
462
466
|
required: false,
|
|
@@ -476,7 +480,7 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
476
480
|
"reset-width",
|
|
477
481
|
"reorder",
|
|
478
482
|
"resize",
|
|
479
|
-
"
|
|
483
|
+
"toggle-all"
|
|
480
484
|
],
|
|
481
485
|
setup(__props, { emit: __emit }) {
|
|
482
486
|
const HeaderCell = require_use_table_component.useTableComponent("headerCell", require_as_table_header_cell.as_table_header_cell_default);
|
|
@@ -542,11 +546,19 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
542
546
|
if (!props.selectAllState) return;
|
|
543
547
|
event.preventDefault();
|
|
544
548
|
event.stopPropagation();
|
|
545
|
-
|
|
549
|
+
toggleSelectAll();
|
|
550
|
+
}
|
|
551
|
+
/** The header control's action — click, keys and the `header-__select` slot. */
|
|
552
|
+
function toggleSelectAll() {
|
|
553
|
+
if (props.selectAllState) emit("toggle-all");
|
|
546
554
|
}
|
|
547
555
|
return (_ctx, _cache) => {
|
|
548
556
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("thead", null, [(0, vue.createElementVNode)("tr", null, [
|
|
549
|
-
__props.hasSelectColumn ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_1$
|
|
557
|
+
__props.hasSelectColumn ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", _hoisted_1$2, [(0, vue.renderSlot)(_ctx.$slots, "header-__select", {
|
|
558
|
+
state: __props.selectAllState,
|
|
559
|
+
toggle: toggleSelectAll,
|
|
560
|
+
selectedCount: __props.selectedCount ?? 0
|
|
561
|
+
}, () => [__props.selectAllState ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
550
562
|
key: 0,
|
|
551
563
|
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
552
564
|
"as-table-checkbox-checked": __props.selectAllState === "all",
|
|
@@ -556,9 +568,9 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
556
568
|
tabindex: "0",
|
|
557
569
|
"aria-label": "Select all rows",
|
|
558
570
|
"aria-checked": __props.selectAllState === "none" ? "false" : __props.selectAllState === "all" ? "true" : "mixed",
|
|
559
|
-
onClick:
|
|
571
|
+
onClick: toggleSelectAll,
|
|
560
572
|
onKeydown: onSelectAllKeydown
|
|
561
|
-
}, [__props.selectAllState === "all" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$
|
|
573
|
+
}, [__props.selectAllState === "all" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$2)) : __props.selectAllState === "some" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$1)) : (0, vue.createCommentVNode)("v-if", true)], 42, _hoisted_2$2)) : (0, vue.createCommentVNode)("v-if", true)])])) : (0, vue.createCommentVNode)("v-if", true),
|
|
562
574
|
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.columns, (col) => {
|
|
563
575
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
|
|
564
576
|
key: col.path,
|
|
@@ -580,11 +592,11 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
580
592
|
filters: __props.filters?.[col.path],
|
|
581
593
|
"column-menu": __props.columnMenu,
|
|
582
594
|
"width-entry": __props.columnWidths[col.path],
|
|
583
|
-
onSort: _cache[
|
|
584
|
-
onHide: _cache[
|
|
585
|
-
onFilter: _cache[
|
|
586
|
-
onFiltersOff: _cache[
|
|
587
|
-
onResetWidth: _cache[
|
|
595
|
+
onSort: _cache[0] || (_cache[0] = (c, d) => emit("sort", c, d)),
|
|
596
|
+
onHide: _cache[1] || (_cache[1] = (c) => emit("hide", c)),
|
|
597
|
+
onFilter: _cache[2] || (_cache[2] = (c) => emit("filter", c)),
|
|
598
|
+
onFiltersOff: _cache[3] || (_cache[3] = (c) => emit("filters-off", c)),
|
|
599
|
+
onResetWidth: _cache[4] || (_cache[4] = (c) => emit("reset-width", c))
|
|
588
600
|
}, null, 40, [
|
|
589
601
|
"column",
|
|
590
602
|
"sort-direction",
|
|
@@ -596,12 +608,12 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
596
608
|
key: 0,
|
|
597
609
|
class: "as-th-resize-handle",
|
|
598
610
|
draggable: "false",
|
|
599
|
-
onDragstart: _cache[
|
|
600
|
-
onPointerdown: _cache[
|
|
601
|
-
onPointermove: _cache[
|
|
602
|
-
onPointerup: _cache[
|
|
603
|
-
onPointercancel: _cache[
|
|
604
|
-
onDblclick: _cache[
|
|
611
|
+
onDragstart: _cache[5] || (_cache[5] = (0, vue.withModifiers)(() => {}, ["prevent", "stop"])),
|
|
612
|
+
onPointerdown: _cache[6] || (_cache[6] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandlePointerDown) && (0, vue.unref)(onResizeHandlePointerDown)(...args), ["stop"])),
|
|
613
|
+
onPointermove: _cache[7] || (_cache[7] = (...args) => (0, vue.unref)(onResizeHandlePointerMove) && (0, vue.unref)(onResizeHandlePointerMove)(...args)),
|
|
614
|
+
onPointerup: _cache[8] || (_cache[8] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
|
|
615
|
+
onPointercancel: _cache[9] || (_cache[9] = (...args) => (0, vue.unref)(onResizeHandleEnd) && (0, vue.unref)(onResizeHandleEnd)(...args)),
|
|
616
|
+
onDblclick: _cache[10] || (_cache[10] = (0, vue.withModifiers)((...args) => (0, vue.unref)(onResizeHandleDoubleClick) && (0, vue.unref)(onResizeHandleDoubleClick)(...args), ["stop"]))
|
|
605
617
|
}, null, 32)) : (0, vue.createCommentVNode)("v-if", true)
|
|
606
618
|
], 46, _hoisted_5$1);
|
|
607
619
|
}), 128)),
|
|
@@ -612,12 +624,12 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
612
624
|
});
|
|
613
625
|
//#endregion
|
|
614
626
|
//#region src/components/internal/as-table-status.vue?vue&type=script&setup=true&lang.ts
|
|
615
|
-
const _hoisted_1 = {
|
|
627
|
+
const _hoisted_1$1 = {
|
|
616
628
|
key: 0,
|
|
617
629
|
class: "as-table-error"
|
|
618
630
|
};
|
|
619
|
-
const _hoisted_2 = { class: "as-vh-empty" };
|
|
620
|
-
const _hoisted_3 = { class: "as-vh-empty-body" };
|
|
631
|
+
const _hoisted_2$1 = { class: "as-vh-empty" };
|
|
632
|
+
const _hoisted_3$1 = { class: "as-vh-empty-body" };
|
|
621
633
|
const _hoisted_4 = {
|
|
622
634
|
key: 1,
|
|
623
635
|
class: "as-table-empty"
|
|
@@ -676,16 +688,16 @@ var as_table_status_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
676
688
|
},
|
|
677
689
|
setup(__props) {
|
|
678
690
|
return (_ctx, _cache) => {
|
|
679
|
-
return __props.queryError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "error", {
|
|
691
|
+
return __props.queryError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, [(0, vue.renderSlot)(_ctx.$slots, "error", {
|
|
680
692
|
error: __props.queryError,
|
|
681
693
|
retry: __props.onRetry
|
|
682
|
-
}, () => [(0, vue.createElementVNode)("div", _hoisted_2, [
|
|
694
|
+
}, () => [(0, vue.createElementVNode)("div", _hoisted_2$1, [
|
|
683
695
|
_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", {
|
|
684
696
|
class: "as-vh-error-icon i-as-warning",
|
|
685
697
|
"aria-hidden": "true"
|
|
686
698
|
}, null, -1)),
|
|
687
699
|
_cache[4] || (_cache[4] = (0, vue.createElementVNode)("p", { class: "as-vh-empty-title" }, "Failed to load values", -1)),
|
|
688
|
-
(0, vue.createElementVNode)("p", _hoisted_3, (0, vue.toDisplayString)(__props.queryError.message), 1),
|
|
700
|
+
(0, vue.createElementVNode)("p", _hoisted_3$1, (0, vue.toDisplayString)(__props.queryError.message), 1),
|
|
689
701
|
__props.onRetry ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
690
702
|
key: 0,
|
|
691
703
|
type: "button",
|
|
@@ -724,6 +736,113 @@ var as_table_status_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
724
736
|
}
|
|
725
737
|
});
|
|
726
738
|
//#endregion
|
|
739
|
+
//#region src/components/internal/as-select-cell.vue?vue&type=script&setup=true&lang.ts
|
|
740
|
+
const _hoisted_1 = {
|
|
741
|
+
class: "as-td-select",
|
|
742
|
+
role: "gridcell"
|
|
743
|
+
};
|
|
744
|
+
const _hoisted_2 = [
|
|
745
|
+
"tabindex",
|
|
746
|
+
"aria-checked",
|
|
747
|
+
"aria-disabled",
|
|
748
|
+
"aria-label",
|
|
749
|
+
"title"
|
|
750
|
+
];
|
|
751
|
+
const _hoisted_3 = {
|
|
752
|
+
key: 0,
|
|
753
|
+
class: "as-table-checkbox-tick",
|
|
754
|
+
"aria-hidden": "true"
|
|
755
|
+
};
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/components/internal/as-select-cell.vue
|
|
758
|
+
var as_select_cell_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
759
|
+
__name: "as-select-cell",
|
|
760
|
+
props: {
|
|
761
|
+
row: {
|
|
762
|
+
type: Object,
|
|
763
|
+
required: true
|
|
764
|
+
},
|
|
765
|
+
index: {
|
|
766
|
+
type: Number,
|
|
767
|
+
required: true
|
|
768
|
+
},
|
|
769
|
+
selected: {
|
|
770
|
+
type: Boolean,
|
|
771
|
+
required: true
|
|
772
|
+
},
|
|
773
|
+
verdict: {
|
|
774
|
+
type: Object,
|
|
775
|
+
required: true
|
|
776
|
+
},
|
|
777
|
+
select: {
|
|
778
|
+
type: String,
|
|
779
|
+
required: true
|
|
780
|
+
},
|
|
781
|
+
selectOn: {
|
|
782
|
+
type: String,
|
|
783
|
+
required: true
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
setup(__props) {
|
|
787
|
+
const props = __props;
|
|
788
|
+
const ctx = require_use_table_state.useTableContextOptional();
|
|
789
|
+
function toggle() {
|
|
790
|
+
if (ctx) require_use_table_state.toggleRowAt(props.index, props.select, ctx.state);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* With `selectOn: "row"` the click bubbles to the row, which toggles; with
|
|
794
|
+
* `"control"` it toggles here and stops, so the row click (active-row move,
|
|
795
|
+
* `row-click`) and a double-click main action don't also fire.
|
|
796
|
+
*/
|
|
797
|
+
function onClick(event) {
|
|
798
|
+
if (props.selectOn !== "control") return;
|
|
799
|
+
event.stopPropagation();
|
|
800
|
+
toggle();
|
|
801
|
+
}
|
|
802
|
+
function onDblClick(event) {
|
|
803
|
+
if (props.selectOn === "control") event.stopPropagation();
|
|
804
|
+
}
|
|
805
|
+
function onKeydown(event) {
|
|
806
|
+
if (ctx) require_use_table_state.onSelectControlKeydown(event, props.index, props.select, ctx.state);
|
|
807
|
+
}
|
|
808
|
+
/** Accessible name for the control, carrying the disabled reason. */
|
|
809
|
+
function label() {
|
|
810
|
+
if (props.verdict.ok) return "Select row";
|
|
811
|
+
return props.verdict.reason ? `Select row, ${props.verdict.reason}` : "Select row, not selectable";
|
|
812
|
+
}
|
|
813
|
+
return (_ctx, _cache) => {
|
|
814
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "default", {
|
|
815
|
+
row: __props.row,
|
|
816
|
+
index: __props.index,
|
|
817
|
+
selected: __props.selected,
|
|
818
|
+
selectable: __props.verdict.ok,
|
|
819
|
+
reason: __props.verdict.reason,
|
|
820
|
+
toggle
|
|
821
|
+
}, () => [(0, vue.createElementVNode)("span", {
|
|
822
|
+
class: (0, vue.normalizeClass)(["as-table-checkbox", {
|
|
823
|
+
"as-table-checkbox-checked": __props.selected,
|
|
824
|
+
"as-table-checkbox-disabled": !__props.verdict.ok
|
|
825
|
+
}]),
|
|
826
|
+
role: "checkbox",
|
|
827
|
+
tabindex: __props.verdict.ok ? 0 : void 0,
|
|
828
|
+
"aria-checked": __props.selected ? "true" : "false",
|
|
829
|
+
"aria-disabled": __props.verdict.ok ? void 0 : "true",
|
|
830
|
+
"aria-label": label(),
|
|
831
|
+
title: __props.verdict.reason,
|
|
832
|
+
onClick,
|
|
833
|
+
onDblclick: onDblClick,
|
|
834
|
+
onKeydown
|
|
835
|
+
}, [__props.selected ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3)) : (0, vue.createCommentVNode)("v-if", true)], 42, _hoisted_2)])]);
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
//#endregion
|
|
840
|
+
Object.defineProperty(exports, "as_select_cell_default", {
|
|
841
|
+
enumerable: true,
|
|
842
|
+
get: function() {
|
|
843
|
+
return as_select_cell_default;
|
|
844
|
+
}
|
|
845
|
+
});
|
|
727
846
|
Object.defineProperty(exports, "as_table_colgroup_default", {
|
|
728
847
|
enumerable: true,
|
|
729
848
|
get: function() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as useTableContext, i as useRegisterMainActionListener } from "./use-table-state-
|
|
1
|
+
import { a as useTableContext, i as useRegisterMainActionListener } from "./use-table-state-Cq-3tbVr.mjs";
|
|
2
2
|
import { t as useSelectModeReset } from "./use-table-selection-ULbKT2xW.mjs";
|
|
3
3
|
import { t as useHasEmitListener } from "./use-has-emit-listener-DrBbsLHQ.mjs";
|
|
4
|
-
import { n as useRowActionsColumn, t as useTableColumnHandlers } from "./use-table-column-handlers-
|
|
5
|
-
import { t as as_table_base_default } from "./as-table-base-
|
|
4
|
+
import { n as useRowActionsColumn, t as useTableColumnHandlers } from "./use-table-column-handlers-0myVzrZR.mjs";
|
|
5
|
+
import { t as as_table_base_default } from "./as-table-base-89DkDZ-1.mjs";
|
|
6
6
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderList, renderSlot, unref, watch, withCtx } from "vue";
|
|
7
7
|
//#region src/components/as-table.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
const _hoisted_1 = { class: "as-table-outer-wrap" };
|
|
@@ -61,6 +61,11 @@ var as_table_default = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
required: false,
|
|
62
62
|
default: "none"
|
|
63
63
|
},
|
|
64
|
+
selectOn: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false,
|
|
67
|
+
default: "row"
|
|
68
|
+
},
|
|
64
69
|
rowDelete: {
|
|
65
70
|
type: [Boolean, Object],
|
|
66
71
|
required: false,
|
|
@@ -113,12 +118,6 @@ var as_table_default = /* @__PURE__ */ defineComponent({
|
|
|
113
118
|
});
|
|
114
119
|
useRegisterMainActionListener(state, (req) => emit("main-action", req.row, req.absIndex, req.event), useHasEmitListener("onMainAction"));
|
|
115
120
|
const { onSort, onHide, onFilter, onFiltersOff, onResetWidth, onReorder, onClearFilters } = useTableColumnHandlers(state);
|
|
116
|
-
function handleSelectAll() {
|
|
117
|
-
state.selectAll(effectiveRows.value);
|
|
118
|
-
}
|
|
119
|
-
function handleDeselectAll() {
|
|
120
|
-
state.selectedRows.value = [];
|
|
121
|
-
}
|
|
122
121
|
return (_ctx, _cache) => {
|
|
123
122
|
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(as_table_base_default, {
|
|
124
123
|
"render-mode": "standalone",
|
|
@@ -127,6 +126,7 @@ var as_table_default = /* @__PURE__ */ defineComponent({
|
|
|
127
126
|
sorters: unref(state).sorters.value,
|
|
128
127
|
"selected-rows": unref(state).selectedRows.value,
|
|
129
128
|
select: props.select,
|
|
129
|
+
"select-on": props.selectOn,
|
|
130
130
|
"row-value-fn": unref(state).rowValueFn,
|
|
131
131
|
querying: unref(state).querying.value,
|
|
132
132
|
"query-error": unref(state).queryError.value,
|
|
@@ -149,8 +149,6 @@ var as_table_default = /* @__PURE__ */ defineComponent({
|
|
|
149
149
|
onHide: unref(onHide),
|
|
150
150
|
onFilter: unref(onFilter),
|
|
151
151
|
onFiltersOff: unref(onFiltersOff),
|
|
152
|
-
onSelectAll: handleSelectAll,
|
|
153
|
-
onDeselectAll: handleDeselectAll,
|
|
154
152
|
onReorder: unref(onReorder),
|
|
155
153
|
onResize: unref(state).setColumnWidth,
|
|
156
154
|
onResetWidth: unref(onResetWidth),
|
|
@@ -167,6 +165,7 @@ var as_table_default = /* @__PURE__ */ defineComponent({
|
|
|
167
165
|
"sorters",
|
|
168
166
|
"selected-rows",
|
|
169
167
|
"select",
|
|
168
|
+
"select-on",
|
|
170
169
|
"row-value-fn",
|
|
171
170
|
"querying",
|
|
172
171
|
"query-error",
|