@atscript/vue-table 0.1.112 → 0.1.114
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-C_-ndF6S.cjs → as-action-menu-content-C7n_dJx0.cjs} +63 -7
- package/dist/{as-action-menu-content-CVZJpVPG.mjs → as-action-menu-content-CWmWeQam.mjs} +63 -7
- package/dist/as-column-menu.d.cts +1 -1
- package/dist/as-column-menu.d.mts +1 -1
- package/dist/{as-column-menu.vue-BbdaVsNi.d.cts → as-column-menu.vue-DL5N9mKR.d.mts} +2 -2
- package/dist/{as-column-menu.vue-CwhbMgzZ.d.mts → as-column-menu.vue-u_DNy3f-.d.cts} +2 -2
- package/dist/{as-config-dialog-Dvnlubkp.mjs → as-config-dialog-0e-az0nn.mjs} +2 -2
- package/dist/{as-config-dialog-ulI6e9vX.cjs → as-config-dialog-B6MFmBRW.cjs} +2 -2
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-B7SM0zxy.cjs → as-confirm-dialog-CYiLQUP-.cjs} +1 -1
- package/dist/{as-confirm-dialog-DLR2ejrF.mjs → as-confirm-dialog-DlZzfASO.mjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-CiIPgmt8.mjs → as-filter-dialog-Bole60UC.mjs} +7 -7
- package/dist/{as-filter-dialog-DfX7ahsa.cjs → as-filter-dialog-OiRuTYfh.cjs} +7 -7
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-D8kv8lOm.cjs → as-filter-field-iJbKFVSw.cjs} +3 -3
- package/dist/{as-filter-field-C3wmTg22.mjs → as-filter-field-xzcm2aGE.mjs} +3 -3
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/{as-filters-Dmn0ykIo.mjs → as-filters-CGRd9vX0.mjs} +3 -3
- package/dist/{as-filters-BhPQXswG.cjs → as-filters-DfkxKGNU.cjs} +3 -3
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-preset-dialog-B3fC0Eqc.mjs → as-preset-dialog-BbnwfYzC.mjs} +1 -1
- package/dist/{as-preset-dialog-DYxEVZ7V.cjs → as-preset-dialog-D77Dg9ll.cjs} +1 -1
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-B9hw2qc8.mjs → as-preset-picker-Bwr3kM4o.mjs} +1 -1
- package/dist/{as-preset-picker-PbSNiBDr.cjs → as-preset-picker-Divz_1ZG.cjs} +1 -1
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-row-actions-C4mSAqeh.mjs → as-row-actions-CBVF6B2-.mjs} +55 -28
- package/dist/{as-row-actions-N30up8uG.cjs → as-row-actions-DC6-kpsJ.cjs} +54 -27
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-table-DnUc3TB1.mjs → as-table-DQwYi63u.mjs} +2 -2
- package/dist/{as-table-3TbYx5tz.cjs → as-table-DaT2K-7n.cjs} +2 -2
- package/dist/{as-table-actions-CoN68w6P.cjs → as-table-actions-CEhZXH97.cjs} +48 -19
- package/dist/{as-table-actions-Ct3tEarY.mjs → as-table-actions-ChR9MGQt.mjs} +49 -20
- 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-62ZjZoIa.d.cts → as-table-actions.vue-DTGYOsZh.d.mts} +6 -6
- package/dist/{as-table-actions.vue-B2C_nC86.d.mts → as-table-actions.vue-WXkllHVw.d.cts} +6 -6
- package/dist/{as-table-base-CbxfXR2t.cjs → as-table-base-1uBBmFuL.cjs} +2 -2
- package/dist/{as-table-base-O9cMoTBL.mjs → as-table-base-DOvVedJg.mjs} +2 -2
- package/dist/{as-table-header-cell-D025cLjb.cjs → as-table-header-cell-DD6Tw87_.cjs} +1 -1
- package/dist/{as-table-header-cell-BlDhjZNp.mjs → as-table-header-cell-DfjfNeq4.mjs} +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-BjQUPdmH.d.cts → as-table-header-cell.vue-BCszzxtU.d.mts} +2 -2
- package/dist/{as-table-header-cell.vue-PEFiv40i.d.mts → as-table-header-cell.vue-BzTzfGRo.d.cts} +2 -2
- package/dist/{as-table-root-IzffHCVo.mjs → as-table-root-BSbO16CM.mjs} +9 -4
- package/dist/{as-table-root-CeypME9M.cjs → as-table-root-BnW1SL4W.cjs} +9 -4
- package/dist/as-table-root.cjs +1 -1
- package/dist/as-table-root.d.cts +1 -1
- package/dist/as-table-root.d.mts +1 -1
- package/dist/as-table-root.mjs +1 -1
- package/dist/{as-table-root.vue-D5Tp8U_d.d.cts → as-table-root.vue-DRv85M1N.d.cts} +26 -5
- package/dist/{as-table-root.vue-DtJBjtoC.d.mts → as-table-root.vue-TUauKr31.d.mts} +26 -5
- package/dist/{as-table-status-f4QmdAZ0.cjs → as-table-status-2eUIHBmk.cjs} +4 -4
- package/dist/{as-table-status-d3iUSOoH.mjs → as-table-status-Dy3rA0T-.mjs} +4 -4
- 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-53yyA7zP.d.cts → as-table.vue-D9cCjbtr.d.cts} +7 -7
- package/dist/{as-table.vue-CdSb4IUc.d.mts → as-table.vue-DxtfL26P.d.mts} +7 -7
- package/dist/{as-window-table-C3o72zaM.mjs → as-window-table-B9k_nv4c.mjs} +2 -2
- package/dist/{as-window-table-BzyV1iDL.cjs → as-window-table-iwpsLq0K.cjs} +2 -2
- 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-DU6UdjA3.d.cts → as-window-table.vue-BavmqDeH.d.cts} +6 -6
- package/dist/{as-window-table.vue-DQPjWA3T.d.mts → as-window-table.vue-BpvgmsC1.d.mts} +6 -6
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +17 -17
- package/dist/{types-DAgdkjji.d.cts → types-ByU4O0Yf.d.mts} +10 -2
- package/dist/{types-iSundY5p.d.mts → types-CTMxE_zA.d.cts} +10 -2
- package/dist/{use-table-Dwl4JoZR.cjs → use-table-BWgcmQS7.cjs} +2 -1
- package/dist/{use-table-ClKUAYU4.mjs → use-table-DHN_frAf.mjs} +2 -1
- package/dist/{use-table-component-QIECHhdZ.mjs → use-table-component-Bu7CIG5I.mjs} +1 -1
- package/dist/{use-table-component-xSoXI7Jm.cjs → use-table-component-QDcfYIBU.cjs} +1 -1
- package/dist/{use-table-nav-bridge-Cs4R_6F2.cjs → use-table-nav-bridge-BlqeY53w.cjs} +1 -1
- package/dist/{use-table-nav-bridge-0WVZrMv9.mjs → use-table-nav-bridge-CVO5_ttZ.mjs} +1 -1
- package/dist/{use-table-state-CI8i5m7s.cjs → use-table-state-CElgF_iy.cjs} +95 -1
- package/dist/{use-table-state-kxv6_Biy.mjs → use-table-state-Dju5bxt8.mjs} +72 -2
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as useTableContext, c as
|
|
2
|
-
import { t as as_action_menu_content_default } from "./as-action-menu-content-
|
|
3
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
1
|
+
import { a as useTableContext, c as actionHref, d as ariaLabelFor, h as intentClass, l as applyRowGate, m as extractIdentifier, p as createNavigateGestures, y as triggerAction } from "./use-table-state-Dju5bxt8.mjs";
|
|
2
|
+
import { t as as_action_menu_content_default } from "./as-action-menu-content-CWmWeQam.mjs";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
4
4
|
import { DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger } from "reka-ui";
|
|
5
5
|
//#region src/components/defaults/as-row-actions.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = {
|
|
@@ -11,16 +11,11 @@ const _hoisted_2 = {
|
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "as-row-actions"
|
|
13
13
|
};
|
|
14
|
-
const _hoisted_3 =
|
|
15
|
-
"data-default",
|
|
16
|
-
"aria-label",
|
|
17
|
-
"title"
|
|
18
|
-
];
|
|
19
|
-
const _hoisted_4 = {
|
|
14
|
+
const _hoisted_3 = {
|
|
20
15
|
key: 1,
|
|
21
16
|
class: "as-row-actions-btn-label"
|
|
22
17
|
};
|
|
23
|
-
const
|
|
18
|
+
const _hoisted_4 = {
|
|
24
19
|
key: 2,
|
|
25
20
|
class: "as-row-actions"
|
|
26
21
|
};
|
|
@@ -41,6 +36,18 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
41
36
|
setup(__props) {
|
|
42
37
|
const props = __props;
|
|
43
38
|
const { state } = useTableContext();
|
|
39
|
+
/** The row's identifier — the `pk` prop when given, else extracted from the row. */
|
|
40
|
+
function identifierOf() {
|
|
41
|
+
const preferredId = state.tableDef.value?.preferredId ?? [];
|
|
42
|
+
return props.pk !== void 0 ? props.pk : extractIdentifier(props.row, preferredId);
|
|
43
|
+
}
|
|
44
|
+
function promptCtx() {
|
|
45
|
+
const id = identifierOf();
|
|
46
|
+
return {
|
|
47
|
+
identifiers: id === void 0 ? [] : [id],
|
|
48
|
+
preferredId: state.tableDef.value?.preferredId ?? []
|
|
49
|
+
};
|
|
50
|
+
}
|
|
44
51
|
const view = computed(() => {
|
|
45
52
|
const sourceDefault = state.actions.default.row;
|
|
46
53
|
const filtered = applyRowGate({
|
|
@@ -50,6 +57,7 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
50
57
|
}, props.row);
|
|
51
58
|
const total = (filtered.default ? 1 : 0) + filtered.others.length + filtered.rows.length;
|
|
52
59
|
const single = total === 1 ? filtered.default ?? filtered.others[0] ?? filtered.rows[0] : void 0;
|
|
60
|
+
const singleHref = single ? actionHref(state, single, identifierOf()) : void 0;
|
|
53
61
|
return {
|
|
54
62
|
total,
|
|
55
63
|
default: filtered.default,
|
|
@@ -57,6 +65,8 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
57
65
|
singleLabelOnly: !!single && !single.icon,
|
|
58
66
|
singleIntentClass: single ? intentClass("as-row-actions", single) : void 0,
|
|
59
67
|
singleIsDefault: !!single && single === sourceDefault,
|
|
68
|
+
singleHref,
|
|
69
|
+
singleAsLink: singleHref !== void 0 && !single?.promptText,
|
|
60
70
|
menuGroups: [
|
|
61
71
|
filtered.default ? [filtered.default] : [],
|
|
62
72
|
filtered.others,
|
|
@@ -65,34 +75,45 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
65
75
|
};
|
|
66
76
|
});
|
|
67
77
|
async function trigger(action, event) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
preferredId
|
|
73
|
-
}, event);
|
|
78
|
+
await triggerAction(state, action, promptCtx(), event);
|
|
79
|
+
}
|
|
80
|
+
function hrefFor(action) {
|
|
81
|
+
return actionHref(state, action, identifierOf());
|
|
74
82
|
}
|
|
83
|
+
const { onTriggerClick, onTriggerAuxClick, openNewTab } = createNavigateGestures(state, promptCtx, hrefFor);
|
|
75
84
|
return (_ctx, _cache) => {
|
|
76
|
-
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" table-layout: fixed needs a placeholder cell so column widths line up. "), view.value.total === 0 ? (openBlock(), createElementBlock("td", _hoisted_1)) : view.value.single ? (openBlock(), createElementBlock("td", _hoisted_2, [
|
|
77
|
-
|
|
85
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" table-layout: fixed needs a placeholder cell so column widths line up. "), view.value.total === 0 ? (openBlock(), createElementBlock("td", _hoisted_1)) : view.value.single ? (openBlock(), createElementBlock("td", _hoisted_2, [(openBlock(), createBlock(resolveDynamicComponent(view.value.singleAsLink ? "a" : "button"), {
|
|
86
|
+
href: view.value.singleAsLink ? view.value.singleHref : void 0,
|
|
87
|
+
type: view.value.singleAsLink ? void 0 : "button",
|
|
78
88
|
class: normalizeClass(["as-row-actions-btn", [view.value.singleLabelOnly ? "as-row-actions-btn-labelled" : void 0, view.value.singleIntentClass]]),
|
|
79
89
|
"data-default": view.value.singleIsDefault || void 0,
|
|
80
90
|
"aria-label": unref(ariaLabelFor)(view.value.single),
|
|
81
91
|
title: unref(ariaLabelFor)(view.value.single),
|
|
82
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onTriggerClick)(view.value.single, view.value.singleHref, view.value.singleAsLink, $event), ["stop"])),
|
|
93
|
+
onAuxclick: _cache[1] || (_cache[1] = withModifiers(($event) => unref(onTriggerAuxClick)(view.value.single, view.value.singleHref, view.value.singleAsLink, $event), ["stop"]))
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => [view.value.single.icon ? (openBlock(), createElementBlock("span", {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: normalizeClass(["as-row-actions-btn-icon", view.value.single.icon]),
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}, null, 2)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(view.value.single.label || view.value.single.name), 1))]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 40, [
|
|
102
|
+
"href",
|
|
103
|
+
"type",
|
|
104
|
+
"class",
|
|
105
|
+
"data-default",
|
|
106
|
+
"aria-label",
|
|
107
|
+
"title"
|
|
108
|
+
]))])) : (openBlock(), createElementBlock("td", _hoisted_4, [createVNode(unref(DropdownMenuRoot), { modal: false }, {
|
|
88
109
|
default: withCtx(() => [createVNode(unref(DropdownMenuTrigger), { "as-child": "" }, {
|
|
89
110
|
default: withCtx(() => [createElementVNode("button", {
|
|
90
111
|
type: "button",
|
|
91
112
|
class: "as-row-actions-btn as-row-actions-more",
|
|
92
113
|
"aria-label": "Row actions",
|
|
93
114
|
title: "Row actions",
|
|
94
|
-
onClick: _cache[
|
|
95
|
-
}, [..._cache[
|
|
115
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
|
|
116
|
+
}, [..._cache[3] || (_cache[3] = [createElementVNode("span", {
|
|
96
117
|
class: "as-row-actions-btn-icon i-as-menu",
|
|
97
118
|
"aria-hidden": "true"
|
|
98
119
|
}, null, -1)])])]),
|
|
@@ -102,8 +123,14 @@ var as_row_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
102
123
|
groups: view.value.menuGroups,
|
|
103
124
|
"default-marker": view.value.default,
|
|
104
125
|
prefix: "as-row-actions",
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
"href-for": hrefFor,
|
|
127
|
+
onSelect: trigger,
|
|
128
|
+
onNewtab: unref(openNewTab)
|
|
129
|
+
}, null, 8, [
|
|
130
|
+
"groups",
|
|
131
|
+
"default-marker",
|
|
132
|
+
"onNewtab"
|
|
133
|
+
])]),
|
|
107
134
|
_: 1
|
|
108
135
|
})]),
|
|
109
136
|
_: 1
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_as_action_menu_content = require("./as-action-menu-content-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-CElgF_iy.cjs");
|
|
2
|
+
const require_as_action_menu_content = require("./as-action-menu-content-C7n_dJx0.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let reka_ui = require("reka-ui");
|
|
5
5
|
//#region src/components/defaults/as-row-actions.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -11,16 +11,11 @@ const _hoisted_2 = {
|
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "as-row-actions"
|
|
13
13
|
};
|
|
14
|
-
const _hoisted_3 =
|
|
15
|
-
"data-default",
|
|
16
|
-
"aria-label",
|
|
17
|
-
"title"
|
|
18
|
-
];
|
|
19
|
-
const _hoisted_4 = {
|
|
14
|
+
const _hoisted_3 = {
|
|
20
15
|
key: 1,
|
|
21
16
|
class: "as-row-actions-btn-label"
|
|
22
17
|
};
|
|
23
|
-
const
|
|
18
|
+
const _hoisted_4 = {
|
|
24
19
|
key: 2,
|
|
25
20
|
class: "as-row-actions"
|
|
26
21
|
};
|
|
@@ -41,6 +36,18 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
41
36
|
setup(__props) {
|
|
42
37
|
const props = __props;
|
|
43
38
|
const { state } = require_use_table_state.useTableContext();
|
|
39
|
+
/** The row's identifier — the `pk` prop when given, else extracted from the row. */
|
|
40
|
+
function identifierOf() {
|
|
41
|
+
const preferredId = state.tableDef.value?.preferredId ?? [];
|
|
42
|
+
return props.pk !== void 0 ? props.pk : require_use_table_state.extractIdentifier(props.row, preferredId);
|
|
43
|
+
}
|
|
44
|
+
function promptCtx() {
|
|
45
|
+
const id = identifierOf();
|
|
46
|
+
return {
|
|
47
|
+
identifiers: id === void 0 ? [] : [id],
|
|
48
|
+
preferredId: state.tableDef.value?.preferredId ?? []
|
|
49
|
+
};
|
|
50
|
+
}
|
|
44
51
|
const view = (0, vue.computed)(() => {
|
|
45
52
|
const sourceDefault = state.actions.default.row;
|
|
46
53
|
const filtered = require_use_table_state.applyRowGate({
|
|
@@ -50,6 +57,7 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
50
57
|
}, props.row);
|
|
51
58
|
const total = (filtered.default ? 1 : 0) + filtered.others.length + filtered.rows.length;
|
|
52
59
|
const single = total === 1 ? filtered.default ?? filtered.others[0] ?? filtered.rows[0] : void 0;
|
|
60
|
+
const singleHref = single ? require_use_table_state.actionHref(state, single, identifierOf()) : void 0;
|
|
53
61
|
return {
|
|
54
62
|
total,
|
|
55
63
|
default: filtered.default,
|
|
@@ -57,6 +65,8 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
57
65
|
singleLabelOnly: !!single && !single.icon,
|
|
58
66
|
singleIntentClass: single ? require_use_table_state.intentClass("as-row-actions", single) : void 0,
|
|
59
67
|
singleIsDefault: !!single && single === sourceDefault,
|
|
68
|
+
singleHref,
|
|
69
|
+
singleAsLink: singleHref !== void 0 && !single?.promptText,
|
|
60
70
|
menuGroups: [
|
|
61
71
|
filtered.default ? [filtered.default] : [],
|
|
62
72
|
filtered.others,
|
|
@@ -65,34 +75,45 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
65
75
|
};
|
|
66
76
|
});
|
|
67
77
|
async function trigger(action, event) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
preferredId
|
|
73
|
-
}, event);
|
|
78
|
+
await require_use_table_state.triggerAction(state, action, promptCtx(), event);
|
|
79
|
+
}
|
|
80
|
+
function hrefFor(action) {
|
|
81
|
+
return require_use_table_state.actionHref(state, action, identifierOf());
|
|
74
82
|
}
|
|
83
|
+
const { onTriggerClick, onTriggerAuxClick, openNewTab } = require_use_table_state.createNavigateGestures(state, promptCtx, hrefFor);
|
|
75
84
|
return (_ctx, _cache) => {
|
|
76
|
-
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)(" table-layout: fixed needs a placeholder cell so column widths line up. "), view.value.total === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_1)) : view.value.single ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_2, [(0, vue.
|
|
77
|
-
|
|
85
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)(" table-layout: fixed needs a placeholder cell so column widths line up. "), view.value.total === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_1)) : view.value.single ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_2, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(view.value.singleAsLink ? "a" : "button"), {
|
|
86
|
+
href: view.value.singleAsLink ? view.value.singleHref : void 0,
|
|
87
|
+
type: view.value.singleAsLink ? void 0 : "button",
|
|
78
88
|
class: (0, vue.normalizeClass)(["as-row-actions-btn", [view.value.singleLabelOnly ? "as-row-actions-btn-labelled" : void 0, view.value.singleIntentClass]]),
|
|
79
89
|
"data-default": view.value.singleIsDefault || void 0,
|
|
80
90
|
"aria-label": (0, vue.unref)(require_use_table_state.ariaLabelFor)(view.value.single),
|
|
81
91
|
title: (0, vue.unref)(require_use_table_state.ariaLabelFor)(view.value.single),
|
|
82
|
-
onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) => (0, vue.unref)(onTriggerClick)(view.value.single, view.value.singleHref, view.value.singleAsLink, $event), ["stop"])),
|
|
93
|
+
onAuxclick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(($event) => (0, vue.unref)(onTriggerAuxClick)(view.value.single, view.value.singleHref, view.value.singleAsLink, $event), ["stop"]))
|
|
94
|
+
}, {
|
|
95
|
+
default: (0, vue.withCtx)(() => [view.value.single.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: (0, vue.normalizeClass)(["as-row-actions-btn-icon", view.value.single.icon]),
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}, null, 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3, (0, vue.toDisplayString)(view.value.single.label || view.value.single.name), 1))]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 40, [
|
|
102
|
+
"href",
|
|
103
|
+
"type",
|
|
104
|
+
"class",
|
|
105
|
+
"data-default",
|
|
106
|
+
"aria-label",
|
|
107
|
+
"title"
|
|
108
|
+
]))])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("td", _hoisted_4, [(0, vue.createVNode)((0, vue.unref)(reka_ui.DropdownMenuRoot), { modal: false }, {
|
|
88
109
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(reka_ui.DropdownMenuTrigger), { "as-child": "" }, {
|
|
89
110
|
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("button", {
|
|
90
111
|
type: "button",
|
|
91
112
|
class: "as-row-actions-btn as-row-actions-more",
|
|
92
113
|
"aria-label": "Row actions",
|
|
93
114
|
title: "Row actions",
|
|
94
|
-
onClick: _cache[
|
|
95
|
-
}, [..._cache[
|
|
115
|
+
onClick: _cache[2] || (_cache[2] = (0, vue.withModifiers)(() => {}, ["stop"]))
|
|
116
|
+
}, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", {
|
|
96
117
|
class: "as-row-actions-btn-icon i-as-menu",
|
|
97
118
|
"aria-hidden": "true"
|
|
98
119
|
}, null, -1)])])]),
|
|
@@ -102,8 +123,14 @@ var as_row_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
102
123
|
groups: view.value.menuGroups,
|
|
103
124
|
"default-marker": view.value.default,
|
|
104
125
|
prefix: "as-row-actions",
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
"href-for": hrefFor,
|
|
127
|
+
onSelect: trigger,
|
|
128
|
+
onNewtab: (0, vue.unref)(openNewTab)
|
|
129
|
+
}, null, 8, [
|
|
130
|
+
"groups",
|
|
131
|
+
"default-marker",
|
|
132
|
+
"onNewtab"
|
|
133
|
+
])]),
|
|
107
134
|
_: 1
|
|
108
135
|
})]),
|
|
109
136
|
_: 1
|
package/dist/as-row-actions.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_row_actions = require("./as-row-actions-
|
|
1
|
+
const require_as_row_actions = require("./as-row-actions-DC6-kpsJ.cjs");
|
|
2
2
|
module.exports = require_as_row_actions.as_row_actions_default;
|
package/dist/as-row-actions.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
1
|
+
import { t as as_row_actions_default } from "./as-row-actions-CBVF6B2-.mjs";
|
|
2
2
|
export { as_row_actions_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as useTableContext, b as ROW_ACTIONS_PATH, i as useRegisterMainActionListener, x as ROW_ACTIONS_TYPE } from "./use-table-state-Dju5bxt8.mjs";
|
|
2
2
|
import { t as useSelectModeReset } from "./use-table-selection-C84z4OZy.mjs";
|
|
3
3
|
import { t as useHasEmitListener } from "./use-has-emit-listener-BTMDIv2e.mjs";
|
|
4
4
|
import { t as useTableColumnHandlers } from "./use-table-column-handlers-CpiiIniD.mjs";
|
|
5
|
-
import { t as as_table_base_default } from "./as-table-base-
|
|
5
|
+
import { t as as_table_base_default } from "./as-table-base-DOvVedJg.mjs";
|
|
6
6
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderList, renderSlot, unref, watch, withCtx } from "vue";
|
|
7
7
|
import { rowsToPks } from "@atscript/ui-table";
|
|
8
8
|
//#region src/components/as-table.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-CElgF_iy.cjs");
|
|
2
2
|
const require_use_table_selection = require("./use-table-selection-Cmiu1h4S.cjs");
|
|
3
3
|
const require_use_has_emit_listener = require("./use-has-emit-listener-hhOH8CBI.cjs");
|
|
4
4
|
const require_use_table_column_handlers = require("./use-table-column-handlers-ehreEzcx.cjs");
|
|
5
|
-
const require_as_table_base = require("./as-table-base-
|
|
5
|
+
const require_as_table_base = require("./as-table-base-1uBBmFuL.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
let _atscript_ui_table = require("@atscript/ui-table");
|
|
8
8
|
//#region src/components/as-table.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_as_action_menu_content = require("./as-action-menu-content-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-CElgF_iy.cjs");
|
|
2
|
+
const require_as_action_menu_content = require("./as-action-menu-content-C7n_dJx0.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let reka_ui = require("reka-ui");
|
|
5
5
|
//#region src/components/as-table-actions.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -7,8 +7,7 @@ const _hoisted_1 = {
|
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "as-table-actions"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_2 =
|
|
11
|
-
const _hoisted_3 = { class: "as-table-actions-btn-label" };
|
|
10
|
+
const _hoisted_2 = { class: "as-table-actions-btn-label" };
|
|
12
11
|
//#endregion
|
|
13
12
|
//#region src/components/as-table-actions.vue
|
|
14
13
|
var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -40,6 +39,15 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
40
39
|
}
|
|
41
40
|
const preferredId = (0, vue.computed)(() => state.tableDef.value?.preferredId ?? []);
|
|
42
41
|
const resolved = (0, vue.computed)(() => {
|
|
42
|
+
const r = resolveBuckets();
|
|
43
|
+
const defaultHref = r.defaultAction ? require_use_table_state.actionHref(state, r.defaultAction, r.ids[0]) : void 0;
|
|
44
|
+
return {
|
|
45
|
+
...r,
|
|
46
|
+
defaultHref,
|
|
47
|
+
defaultAsLink: defaultHref !== void 0 && !r.defaultAction?.promptText
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
function resolveBuckets() {
|
|
43
51
|
const selectedCount = state.selectedCount.value;
|
|
44
52
|
const explicit = props.level;
|
|
45
53
|
const effectiveLevel = resolveLevel(explicit, selectedCount);
|
|
@@ -78,14 +86,22 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
78
86
|
level: "rows",
|
|
79
87
|
ids: require_use_table_state.collectIdentifiers(state, state.selectedRows.value, pid)
|
|
80
88
|
});
|
|
81
|
-
}
|
|
89
|
+
}
|
|
82
90
|
const hasAny = (0, vue.computed)(() => resolved.value.defaultAction !== void 0 || resolved.value.otherActions.length > 0 || resolved.value.trailingRowActions.length > 0);
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
function promptCtx() {
|
|
92
|
+
return {
|
|
85
93
|
identifiers: resolved.value.ids,
|
|
86
94
|
preferredId: preferredId.value
|
|
87
|
-
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function invokeWith(action, event) {
|
|
98
|
+
await require_use_table_state.triggerAction(state, action, promptCtx(), event);
|
|
99
|
+
}
|
|
100
|
+
/** Resolved navigate href for `action` against the toolbar's current ids. */
|
|
101
|
+
function hrefFor(action) {
|
|
102
|
+
return require_use_table_state.actionHref(state, action, resolved.value.ids[0]);
|
|
88
103
|
}
|
|
104
|
+
const { onTriggerClick, onTriggerAuxClick, openNewTab } = require_use_table_state.createNavigateGestures(state, promptCtx, hrefFor);
|
|
89
105
|
return (_ctx, _cache) => {
|
|
90
106
|
return hasAny.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "default", {
|
|
91
107
|
defaultAction: resolved.value.defaultAction,
|
|
@@ -94,24 +110,35 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
94
110
|
level: resolved.value.level,
|
|
95
111
|
ids: resolved.value.ids,
|
|
96
112
|
invoke: invokeWith
|
|
97
|
-
}, () => [resolved.value.defaultAction ? ((0, vue.openBlock)(), (0, vue.
|
|
113
|
+
}, () => [resolved.value.defaultAction ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(resolved.value.defaultAsLink ? "a" : "button"), {
|
|
98
114
|
key: 0,
|
|
99
|
-
|
|
115
|
+
href: resolved.value.defaultAsLink ? resolved.value.defaultHref : void 0,
|
|
116
|
+
type: resolved.value.defaultAsLink ? void 0 : "button",
|
|
100
117
|
class: (0, vue.normalizeClass)(["as-table-actions-btn", (0, vue.unref)(require_use_table_state.intentClass)("as-table-actions", resolved.value.defaultAction)]),
|
|
101
118
|
"data-default": "",
|
|
102
119
|
"aria-label": (0, vue.unref)(require_use_table_state.ariaLabelFor)(resolved.value.defaultAction),
|
|
103
120
|
title: (0, vue.unref)(require_use_table_state.ariaLabelFor)(resolved.value.defaultAction),
|
|
104
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
onClick: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(onTriggerClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event)),
|
|
122
|
+
onAuxclick: _cache[1] || (_cache[1] = ($event) => (0, vue.unref)(onTriggerAuxClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event))
|
|
123
|
+
}, {
|
|
124
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "button", { action: resolved.value.defaultAction }, () => [resolved.value.defaultAction.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: (0, vue.normalizeClass)(["as-table-actions-btn-icon", resolved.value.defaultAction.icon]),
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}, null, 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", _hoisted_2, (0, vue.toDisplayString)(resolved.value.defaultAction.label || resolved.value.defaultAction.name), 1)])]),
|
|
129
|
+
_: 3
|
|
130
|
+
}, 40, [
|
|
131
|
+
"href",
|
|
132
|
+
"type",
|
|
133
|
+
"class",
|
|
134
|
+
"aria-label",
|
|
135
|
+
"title"
|
|
136
|
+
])) : (0, vue.createCommentVNode)("v-if", true), resolved.value.otherActions.length > 0 || resolved.value.trailingRowActions.length > 0 ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(reka_ui.DropdownMenuRoot), {
|
|
110
137
|
key: 1,
|
|
111
138
|
modal: false
|
|
112
139
|
}, {
|
|
113
140
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(reka_ui.DropdownMenuTrigger), { "as-child": "" }, {
|
|
114
|
-
default: (0, vue.withCtx)(() => [..._cache[
|
|
141
|
+
default: (0, vue.withCtx)(() => [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("button", {
|
|
115
142
|
type: "button",
|
|
116
143
|
class: "as-table-actions-more",
|
|
117
144
|
"aria-label": "More actions",
|
|
@@ -125,12 +152,14 @@ var as_table_actions_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
125
152
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_as_action_menu_content.as_action_menu_content_default, {
|
|
126
153
|
groups: [resolved.value.otherActions, resolved.value.trailingRowActions],
|
|
127
154
|
prefix: "as-table-actions",
|
|
128
|
-
|
|
155
|
+
"href-for": hrefFor,
|
|
156
|
+
onSelect: invokeWith,
|
|
157
|
+
onNewtab: (0, vue.unref)(openNewTab)
|
|
129
158
|
}, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots["menu-item"] ? {
|
|
130
159
|
name: "menu-item",
|
|
131
160
|
fn: (0, vue.withCtx)((slotProps) => [(0, vue.renderSlot)(_ctx.$slots, "menu-item", { action: slotProps.action })]),
|
|
132
161
|
key: "0"
|
|
133
|
-
} : void 0]), 1032, ["groups"])]),
|
|
162
|
+
} : void 0]), 1032, ["groups", "onNewtab"])]),
|
|
134
163
|
_: 3
|
|
135
164
|
})]),
|
|
136
165
|
_: 3
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { a as useTableContext, c as
|
|
2
|
-
import { t as as_action_menu_content_default } from "./as-action-menu-content-
|
|
3
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
1
|
+
import { a as useTableContext, c as actionHref, d as ariaLabelFor, f as collectIdentifiers, h as intentClass, l as applyRowGate, p as createNavigateGestures, u as applyRowsGate, y as triggerAction } from "./use-table-state-Dju5bxt8.mjs";
|
|
2
|
+
import { t as as_action_menu_content_default } from "./as-action-menu-content-CWmWeQam.mjs";
|
|
3
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
|
|
4
4
|
import { DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger } from "reka-ui";
|
|
5
5
|
//#region src/components/as-table-actions.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "as-table-actions"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_2 =
|
|
11
|
-
const _hoisted_3 = { class: "as-table-actions-btn-label" };
|
|
10
|
+
const _hoisted_2 = { class: "as-table-actions-btn-label" };
|
|
12
11
|
//#endregion
|
|
13
12
|
//#region src/components/as-table-actions.vue
|
|
14
13
|
var as_table_actions_default = /* @__PURE__ */ defineComponent({
|
|
@@ -40,6 +39,15 @@ var as_table_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
40
39
|
}
|
|
41
40
|
const preferredId = computed(() => state.tableDef.value?.preferredId ?? []);
|
|
42
41
|
const resolved = computed(() => {
|
|
42
|
+
const r = resolveBuckets();
|
|
43
|
+
const defaultHref = r.defaultAction ? actionHref(state, r.defaultAction, r.ids[0]) : void 0;
|
|
44
|
+
return {
|
|
45
|
+
...r,
|
|
46
|
+
defaultHref,
|
|
47
|
+
defaultAsLink: defaultHref !== void 0 && !r.defaultAction?.promptText
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
function resolveBuckets() {
|
|
43
51
|
const selectedCount = state.selectedCount.value;
|
|
44
52
|
const explicit = props.level;
|
|
45
53
|
const effectiveLevel = resolveLevel(explicit, selectedCount);
|
|
@@ -78,14 +86,22 @@ var as_table_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
78
86
|
level: "rows",
|
|
79
87
|
ids: collectIdentifiers(state, state.selectedRows.value, pid)
|
|
80
88
|
});
|
|
81
|
-
}
|
|
89
|
+
}
|
|
82
90
|
const hasAny = computed(() => resolved.value.defaultAction !== void 0 || resolved.value.otherActions.length > 0 || resolved.value.trailingRowActions.length > 0);
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
function promptCtx() {
|
|
92
|
+
return {
|
|
85
93
|
identifiers: resolved.value.ids,
|
|
86
94
|
preferredId: preferredId.value
|
|
87
|
-
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function invokeWith(action, event) {
|
|
98
|
+
await triggerAction(state, action, promptCtx(), event);
|
|
99
|
+
}
|
|
100
|
+
/** Resolved navigate href for `action` against the toolbar's current ids. */
|
|
101
|
+
function hrefFor(action) {
|
|
102
|
+
return actionHref(state, action, resolved.value.ids[0]);
|
|
88
103
|
}
|
|
104
|
+
const { onTriggerClick, onTriggerAuxClick, openNewTab } = createNavigateGestures(state, promptCtx, hrefFor);
|
|
89
105
|
return (_ctx, _cache) => {
|
|
90
106
|
return hasAny.value ? (openBlock(), createElementBlock("span", _hoisted_1, [renderSlot(_ctx.$slots, "default", {
|
|
91
107
|
defaultAction: resolved.value.defaultAction,
|
|
@@ -94,24 +110,35 @@ var as_table_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
94
110
|
level: resolved.value.level,
|
|
95
111
|
ids: resolved.value.ids,
|
|
96
112
|
invoke: invokeWith
|
|
97
|
-
}, () => [resolved.value.defaultAction ? (openBlock(),
|
|
113
|
+
}, () => [resolved.value.defaultAction ? (openBlock(), createBlock(resolveDynamicComponent(resolved.value.defaultAsLink ? "a" : "button"), {
|
|
98
114
|
key: 0,
|
|
99
|
-
|
|
115
|
+
href: resolved.value.defaultAsLink ? resolved.value.defaultHref : void 0,
|
|
116
|
+
type: resolved.value.defaultAsLink ? void 0 : "button",
|
|
100
117
|
class: normalizeClass(["as-table-actions-btn", unref(intentClass)("as-table-actions", resolved.value.defaultAction)]),
|
|
101
118
|
"data-default": "",
|
|
102
119
|
"aria-label": unref(ariaLabelFor)(resolved.value.defaultAction),
|
|
103
120
|
title: unref(ariaLabelFor)(resolved.value.defaultAction),
|
|
104
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(onTriggerClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event)),
|
|
122
|
+
onAuxclick: _cache[1] || (_cache[1] = ($event) => unref(onTriggerAuxClick)(resolved.value.defaultAction, resolved.value.defaultHref, resolved.value.defaultAsLink, $event))
|
|
123
|
+
}, {
|
|
124
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "button", { action: resolved.value.defaultAction }, () => [resolved.value.defaultAction.icon ? (openBlock(), createElementBlock("span", {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: normalizeClass(["as-table-actions-btn-icon", resolved.value.defaultAction.icon]),
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}, null, 2)) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_2, toDisplayString(resolved.value.defaultAction.label || resolved.value.defaultAction.name), 1)])]),
|
|
129
|
+
_: 3
|
|
130
|
+
}, 40, [
|
|
131
|
+
"href",
|
|
132
|
+
"type",
|
|
133
|
+
"class",
|
|
134
|
+
"aria-label",
|
|
135
|
+
"title"
|
|
136
|
+
])) : createCommentVNode("v-if", true), resolved.value.otherActions.length > 0 || resolved.value.trailingRowActions.length > 0 ? (openBlock(), createBlock(unref(DropdownMenuRoot), {
|
|
110
137
|
key: 1,
|
|
111
138
|
modal: false
|
|
112
139
|
}, {
|
|
113
140
|
default: withCtx(() => [createVNode(unref(DropdownMenuTrigger), { "as-child": "" }, {
|
|
114
|
-
default: withCtx(() => [..._cache[
|
|
141
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createElementVNode("button", {
|
|
115
142
|
type: "button",
|
|
116
143
|
class: "as-table-actions-more",
|
|
117
144
|
"aria-label": "More actions",
|
|
@@ -125,12 +152,14 @@ var as_table_actions_default = /* @__PURE__ */ defineComponent({
|
|
|
125
152
|
default: withCtx(() => [createVNode(as_action_menu_content_default, {
|
|
126
153
|
groups: [resolved.value.otherActions, resolved.value.trailingRowActions],
|
|
127
154
|
prefix: "as-table-actions",
|
|
128
|
-
|
|
155
|
+
"href-for": hrefFor,
|
|
156
|
+
onSelect: invokeWith,
|
|
157
|
+
onNewtab: unref(openNewTab)
|
|
129
158
|
}, createSlots({ _: 2 }, [_ctx.$slots["menu-item"] ? {
|
|
130
159
|
name: "menu-item",
|
|
131
160
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "menu-item", { action: slotProps.action })]),
|
|
132
161
|
key: "0"
|
|
133
|
-
} : void 0]), 1032, ["groups"])]),
|
|
162
|
+
} : void 0]), 1032, ["groups", "onNewtab"])]),
|
|
134
163
|
_: 3
|
|
135
164
|
})]),
|
|
136
165
|
_: 3
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_table_actions = require("./as-table-actions-
|
|
1
|
+
const require_as_table_actions = require("./as-table-actions-CEhZXH97.cjs");
|
|
2
2
|
module.exports = require_as_table_actions.as_table_actions_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table-actions.vue-
|
|
1
|
+
import { t as _default } from "./as-table-actions.vue-WXkllHVw.cjs";
|
|
2
2
|
export = _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table-actions.vue-
|
|
1
|
+
import { t as _default } from "./as-table-actions.vue-DTGYOsZh.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_table_actions_default } from "./as-table-actions-
|
|
1
|
+
import { t as as_table_actions_default } from "./as-table-actions-ChR9MGQt.mjs";
|
|
2
2
|
export { as_table_actions_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as TVueTableActionInfo } from "./types-
|
|
1
|
+
import { h as TVueTableActionInfo } from "./types-ByU4O0Yf.mjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/as-table-actions.vue.d.ts
|
|
@@ -18,20 +18,20 @@ declare var __VLS_1: {
|
|
|
18
18
|
defaultAction: TVueTableActionInfo | undefined;
|
|
19
19
|
otherActions: TVueTableActionInfo[];
|
|
20
20
|
trailingRowActions: TVueTableActionInfo[];
|
|
21
|
-
level: "
|
|
21
|
+
level: "row" | "rows" | "table";
|
|
22
22
|
ids: Record<string, unknown>[];
|
|
23
23
|
invoke: typeof invokeWith;
|
|
24
|
-
},
|
|
24
|
+
}, __VLS_12: {
|
|
25
25
|
action: TVueTableActionInfo;
|
|
26
|
-
},
|
|
26
|
+
}, __VLS_42: {
|
|
27
27
|
action: TVueTableActionInfo;
|
|
28
28
|
};
|
|
29
29
|
type __VLS_Slots = {} & {
|
|
30
30
|
default?: (props: typeof __VLS_1) => any;
|
|
31
31
|
} & {
|
|
32
|
-
button?: (props: typeof
|
|
32
|
+
button?: (props: typeof __VLS_12) => any;
|
|
33
33
|
} & {
|
|
34
|
-
'menu-item'?: (props: typeof
|
|
34
|
+
'menu-item'?: (props: typeof __VLS_42) => any;
|
|
35
35
|
};
|
|
36
36
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
37
37
|
level: "auto" | "table" | "rows" | "row";
|