@featherk/ui 0.11.2 → 0.12.0
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/README.md +4 -0
- package/dist/__tests__/withSetupHarness.d.ts +9 -0
- package/dist/featherk-ui.es.js +249 -124
- package/dist/featherk-ui.es.js.map +1 -1
- package/dist/featherk-ui.umd.js +1 -1
- package/dist/featherk-ui.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/table/ActionCell.test.d.ts +1 -0
- package/dist/table/ActionCell.vue.d.ts +40 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/types.d.ts +40 -0
- package/dist/table/useActionCellMenu.d.ts +71 -0
- package/dist/table/useActionCellMenu.test.d.ts +1 -0
- package/dist/ui.css +1 -1
- package/docs/table/ActionCell.md +118 -0
- package/docs/table/useActionCellMenu.md +175 -0
- package/package.json +18 -1
package/README.md
CHANGED
|
@@ -6,11 +6,15 @@ Vue UI component package for FeatherK.
|
|
|
6
6
|
|
|
7
7
|
- **Address**: `USAddress` - Presentational US address renderer driven by a parent-owned `useUSAddress` view model.
|
|
8
8
|
- Component guide: [docs/address/USAddress.md](https://github.com/NantHealth/featherk/blob/integration/packages/ui/docs/address/USAddress.md)
|
|
9
|
+
- **Table**: `ActionCell` - Configurable repeatable action-button container driven by a parent-owned shared popup lifecycle.
|
|
10
|
+
- Component guide: [docs/table/ActionCell.md](https://github.com/NantHealth/featherk/blob/integration/packages/ui/docs/table/ActionCell.md)
|
|
11
|
+
- Composable guide: [docs/table/useActionCellMenu.md](https://github.com/NantHealth/featherk/blob/integration/packages/ui/docs/table/useActionCellMenu.md)
|
|
9
12
|
|
|
10
13
|
## Importing Components
|
|
11
14
|
|
|
12
15
|
```ts
|
|
13
16
|
import { USAddress } from "@featherk/ui";
|
|
17
|
+
import { ActionCell } from "@featherk/ui/table";
|
|
14
18
|
import { useUSAddress } from "@featherk/composables/address";
|
|
15
19
|
```
|
|
16
20
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPublicInstance } from "vue";
|
|
2
|
+
import { type VueWrapper } from "@vue/test-utils";
|
|
3
|
+
type SetupFactory<T> = () => T;
|
|
4
|
+
export declare function withSetupHarness<T>(factory: SetupFactory<T>): Promise<{
|
|
5
|
+
api: T;
|
|
6
|
+
wrapper: VueWrapper<ComponentPublicInstance>;
|
|
7
|
+
unmount: () => void;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
package/dist/featherk-ui.es.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import "./ui.css";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { Error as
|
|
4
|
-
import { TextBox as
|
|
5
|
-
import { DropDownList as
|
|
6
|
-
|
|
2
|
+
import { defineComponent as R, computed as l, openBlock as c, createElementBlock as w, normalizeClass as U, createElementVNode as E, createVNode as D, unref as o, Fragment as F, createBlock as y, withCtx as m, createTextVNode as g, toDisplayString as I, createCommentVNode as S, renderList as H, toValue as W } from "vue";
|
|
3
|
+
import { Error as A, Hint as V } from "@progress/kendo-vue-labels";
|
|
4
|
+
import { TextBox as b } from "@progress/kendo-vue-inputs";
|
|
5
|
+
import { DropDownList as J } from "@progress/kendo-vue-dropdowns";
|
|
6
|
+
import { Button as Q } from "@progress/kendo-vue-buttons";
|
|
7
|
+
import { useCompositeId as X, useActiveIdRegistry as Y, usePopupMenu as ee } from "@featherk/composables";
|
|
8
|
+
const ae = { class: "address1" }, te = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "address2"
|
|
9
|
-
},
|
|
11
|
+
}, le = { class: "city" }, re = { class: "state" }, ie = { class: "zip" }, de = {
|
|
10
12
|
key: 1,
|
|
11
13
|
class: "messages"
|
|
12
|
-
},
|
|
14
|
+
}, M = "Enter a 5 or 9 digit zip code.", se = "Incomplete address.", ne = /* @__PURE__ */ R({
|
|
13
15
|
__name: "USAddress",
|
|
14
16
|
props: {
|
|
15
17
|
id: {},
|
|
@@ -19,8 +21,8 @@ const K = { class: "address1" }, W = {
|
|
|
19
21
|
messages: {},
|
|
20
22
|
showAddress2: { type: Boolean, default: !0 }
|
|
21
23
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
+
setup(n) {
|
|
25
|
+
const t = n, d = {
|
|
24
26
|
placeholder: {
|
|
25
27
|
address1: "Address Line 1",
|
|
26
28
|
address2: "Address Line 2",
|
|
@@ -30,7 +32,7 @@ const K = { class: "address1" }, W = {
|
|
|
30
32
|
fieldset: {
|
|
31
33
|
error: {
|
|
32
34
|
required: "Required fields are missing.",
|
|
33
|
-
zip:
|
|
35
|
+
zip: M
|
|
34
36
|
},
|
|
35
37
|
hint: {
|
|
36
38
|
address: "Enter address information."
|
|
@@ -42,130 +44,130 @@ const K = { class: "address1" }, W = {
|
|
|
42
44
|
address2: "",
|
|
43
45
|
city: "Required",
|
|
44
46
|
state: "Required",
|
|
45
|
-
zip:
|
|
47
|
+
zip: M
|
|
46
48
|
},
|
|
47
49
|
hint: {
|
|
48
50
|
address1: "Enter address line 1.",
|
|
49
51
|
address2: "Optional",
|
|
50
52
|
city: "",
|
|
51
53
|
state: "",
|
|
52
|
-
zip:
|
|
54
|
+
zip: M
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
},
|
|
57
|
+
}, p = (a) => ({
|
|
56
58
|
placeholder: {
|
|
57
|
-
address1: a?.placeholder?.address1 ??
|
|
58
|
-
address2: a?.placeholder?.address2 ??
|
|
59
|
-
city: a?.placeholder?.city ??
|
|
60
|
-
zip: a?.placeholder?.zip ??
|
|
59
|
+
address1: a?.placeholder?.address1 ?? d.placeholder.address1,
|
|
60
|
+
address2: a?.placeholder?.address2 ?? d.placeholder.address2,
|
|
61
|
+
city: a?.placeholder?.city ?? d.placeholder.city,
|
|
62
|
+
zip: a?.placeholder?.zip ?? d.placeholder.zip
|
|
61
63
|
},
|
|
62
64
|
fieldset: {
|
|
63
65
|
error: {
|
|
64
|
-
required: a?.fieldset?.error?.required ??
|
|
65
|
-
zip: a?.fieldset?.error?.zip ??
|
|
66
|
+
required: a?.fieldset?.error?.required ?? d.fieldset.error.required,
|
|
67
|
+
zip: a?.fieldset?.error?.zip ?? d.fieldset.error.zip
|
|
66
68
|
},
|
|
67
69
|
hint: {
|
|
68
|
-
address: a?.fieldset?.hint?.address ??
|
|
70
|
+
address: a?.fieldset?.hint?.address ?? d.fieldset.hint.address
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
field: {
|
|
72
74
|
error: {
|
|
73
|
-
address1: a?.field?.error?.address1 ??
|
|
74
|
-
address2: a?.field?.error?.address2 ??
|
|
75
|
-
city: a?.field?.error?.city ??
|
|
76
|
-
state: a?.field?.error?.state ??
|
|
77
|
-
zip: a?.field?.error?.zip ??
|
|
75
|
+
address1: a?.field?.error?.address1 ?? d.field.error.address1,
|
|
76
|
+
address2: a?.field?.error?.address2 ?? d.field.error.address2,
|
|
77
|
+
city: a?.field?.error?.city ?? d.field.error.city,
|
|
78
|
+
state: a?.field?.error?.state ?? d.field.error.state,
|
|
79
|
+
zip: a?.field?.error?.zip ?? d.field.error.zip
|
|
78
80
|
},
|
|
79
81
|
hint: {
|
|
80
|
-
address1: a?.field?.hint?.address1 ??
|
|
81
|
-
address2: a?.field?.hint?.address2 ??
|
|
82
|
-
city: a?.field?.hint?.city ??
|
|
83
|
-
state: a?.field?.hint?.state ??
|
|
84
|
-
zip: a?.field?.hint?.zip ??
|
|
82
|
+
address1: a?.field?.hint?.address1 ?? d.field.hint.address1,
|
|
83
|
+
address2: a?.field?.hint?.address2 ?? d.field.hint.address2,
|
|
84
|
+
city: a?.field?.hint?.city ?? d.field.hint.city,
|
|
85
|
+
state: a?.field?.hint?.state ?? d.field.hint.state,
|
|
86
|
+
zip: a?.field?.hint?.zip ?? d.field.hint.zip
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
|
-
}),
|
|
88
|
-
address1: `${
|
|
89
|
-
address2: `${
|
|
90
|
-
city: `${
|
|
91
|
-
state: `${
|
|
92
|
-
zip: `${
|
|
93
|
-
})), e = l(() =>
|
|
89
|
+
}), s = l(() => p(t.messages)), h = l(() => t.messageScope === "field"), C = l(() => t.messageScope === "fieldset"), i = l(() => t.required), f = l(() => i.value), v = l(() => ({
|
|
90
|
+
address1: `${t.id}-address1`,
|
|
91
|
+
address2: `${t.id}-address2`,
|
|
92
|
+
city: `${t.id}-city`,
|
|
93
|
+
state: `${t.id}-state`,
|
|
94
|
+
zip: `${t.id}-zip`
|
|
95
|
+
})), e = l(() => t.address), T = l(() => e.value.address1Valid.value && e.value.cityValid.value && e.value.stateValid.value), r = l(() => e.value.formData.address1.trim() !== "" || e.value.formData.address2.trim() !== "" || e.value.formData.city.trim() !== "" || (e.value.formData.state ?? "").trim() !== "" || e.value.formData.zip.replace(/\D/g, "") !== ""), u = l(() => {
|
|
94
96
|
if (e.value.optionalZipInvalid)
|
|
95
97
|
return e.value.optionalZipInvalid.value;
|
|
96
98
|
const a = e.value.formData.zip.replace(/\D/g, "");
|
|
97
|
-
return !
|
|
98
|
-
}),
|
|
99
|
-
const a =
|
|
100
|
-
return
|
|
99
|
+
return !i.value && r.value && a.length !== 5 && a.length !== 9;
|
|
100
|
+
}), _ = l(() => e.value.optionalPartialInvalid ? e.value.optionalPartialInvalid.value : !i.value && r.value && !e.value.addressValid.value), k = l(() => i.value || !_.value ? !1 : e.value.optionalFeedbackActive ? e.value.optionalFeedbackActive.value : !1), x = l(() => f.value && !e.value.address1Valid.value || k.value && e.value.formData.address1.trim() === ""), O = l(() => f.value && !e.value.cityValid.value || k.value && e.value.formData.city.trim() === ""), P = l(() => f.value && !e.value.stateValid.value || k.value && (e.value.formData.state ?? "").trim() === ""), q = l(() => f.value && !e.value.zipValid.value || k.value && u.value), z = l(() => i.value ? e.value.addressValidate.value : k.value), B = l(() => i.value ? e.value.address1Valid.value : !x.value), K = l(() => i.value ? e.value.cityValid.value : !O.value), L = l(() => i.value ? e.value.stateValid.value : !P.value), Z = l(() => i.value ? e.value.zipValid.value : !q.value), j = l(() => {
|
|
101
|
+
const a = s.value.placeholder.address2;
|
|
102
|
+
return C.value && i.value ? `${a} (Optional)` : a;
|
|
101
103
|
}), N = l(() => {
|
|
102
104
|
const a = [];
|
|
103
|
-
return
|
|
104
|
-
}),
|
|
105
|
-
const a = [
|
|
106
|
-
return
|
|
105
|
+
return T.value || a.push(s.value.fieldset.error.required), e.value.zipValid.value || a.push(s.value.fieldset.error.zip), a.join(" ");
|
|
106
|
+
}), G = l(() => {
|
|
107
|
+
const a = [se];
|
|
108
|
+
return u.value && a.push(s.value.fieldset.error.zip), a.join(" ");
|
|
107
109
|
});
|
|
108
|
-
return (a,
|
|
109
|
-
class: U(["fkui-us-address", { "fkui-us-address--fieldset-scope":
|
|
110
|
+
return (a, ve) => (c(), w("div", {
|
|
111
|
+
class: U(["fkui-us-address", { "fkui-us-address--fieldset-scope": C.value }])
|
|
110
112
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
id:
|
|
114
|
-
placeholder:
|
|
113
|
+
E("div", ae, [
|
|
114
|
+
D(o(b), {
|
|
115
|
+
id: v.value.address1,
|
|
116
|
+
placeholder: s.value.placeholder.address1,
|
|
115
117
|
value: e.value.formData.address1,
|
|
116
|
-
valid:
|
|
117
|
-
validate:
|
|
118
|
-
validityStyles:
|
|
118
|
+
valid: B.value,
|
|
119
|
+
validate: z.value,
|
|
120
|
+
validityStyles: z.value,
|
|
119
121
|
onInput: e.value.onAddress1Input
|
|
120
122
|
}, null, 8, ["id", "placeholder", "value", "valid", "validate", "validityStyles", "onInput"]),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
default:
|
|
124
|
-
|
|
123
|
+
h.value ? (c(), w(F, { key: 0 }, [
|
|
124
|
+
x.value ? (c(), y(o(A), { key: 0 }, {
|
|
125
|
+
default: m(() => [
|
|
126
|
+
g(I(s.value.field.error.address1), 1)
|
|
125
127
|
]),
|
|
126
128
|
_: 1
|
|
127
|
-
})) : (
|
|
128
|
-
default:
|
|
129
|
-
|
|
129
|
+
})) : (c(), y(o(V), { key: 1 }, {
|
|
130
|
+
default: m(() => [
|
|
131
|
+
g(I(s.value.field.hint.address1), 1)
|
|
130
132
|
]),
|
|
131
133
|
_: 1
|
|
132
134
|
}))
|
|
133
|
-
], 64)) :
|
|
135
|
+
], 64)) : S("", !0)
|
|
134
136
|
]),
|
|
135
|
-
a.showAddress2 ? (
|
|
136
|
-
|
|
137
|
-
id:
|
|
138
|
-
placeholder:
|
|
137
|
+
a.showAddress2 ? (c(), w("div", te, [
|
|
138
|
+
D(o(b), {
|
|
139
|
+
id: v.value.address2,
|
|
140
|
+
placeholder: j.value,
|
|
139
141
|
value: e.value.formData.address2,
|
|
140
142
|
onInput: e.value.onAddress2Input
|
|
141
143
|
}, null, 8, ["id", "placeholder", "value", "onInput"]),
|
|
142
|
-
|
|
143
|
-
default:
|
|
144
|
-
|
|
144
|
+
h.value ? (c(), y(o(V), { key: 0 }, {
|
|
145
|
+
default: m(() => [
|
|
146
|
+
g(I(s.value.field.hint.address2), 1)
|
|
145
147
|
]),
|
|
146
148
|
_: 1
|
|
147
|
-
})) :
|
|
148
|
-
])) :
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
id:
|
|
152
|
-
placeholder:
|
|
149
|
+
})) : S("", !0)
|
|
150
|
+
])) : S("", !0),
|
|
151
|
+
E("div", le, [
|
|
152
|
+
D(o(b), {
|
|
153
|
+
id: v.value.city,
|
|
154
|
+
placeholder: s.value.placeholder.city,
|
|
153
155
|
value: e.value.formData.city,
|
|
154
|
-
valid:
|
|
155
|
-
validate:
|
|
156
|
-
validityStyles:
|
|
156
|
+
valid: K.value,
|
|
157
|
+
validate: z.value,
|
|
158
|
+
validityStyles: z.value,
|
|
157
159
|
onInput: e.value.onCityInput
|
|
158
160
|
}, null, 8, ["id", "placeholder", "value", "valid", "validate", "validityStyles", "onInput"]),
|
|
159
|
-
|
|
160
|
-
default:
|
|
161
|
-
|
|
161
|
+
h.value && O.value ? (c(), y(o(A), { key: 0 }, {
|
|
162
|
+
default: m(() => [
|
|
163
|
+
g(I(s.value.field.error.city), 1)
|
|
162
164
|
]),
|
|
163
165
|
_: 1
|
|
164
|
-
})) :
|
|
166
|
+
})) : S("", !0)
|
|
165
167
|
]),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
id:
|
|
168
|
+
E("div", re, [
|
|
169
|
+
D(o(J), {
|
|
170
|
+
id: v.value.state,
|
|
169
171
|
value: e.value.formData.state,
|
|
170
172
|
onChange: e.value.onStateChange,
|
|
171
173
|
defaultItem: e.value.stateDefaultItem,
|
|
@@ -175,68 +177,191 @@ const K = { class: "address1" }, W = {
|
|
|
175
177
|
dataItemKey: "value",
|
|
176
178
|
valuePrimitive: !0,
|
|
177
179
|
valid: L.value,
|
|
178
|
-
validate:
|
|
179
|
-
validityStyles:
|
|
180
|
+
validate: z.value,
|
|
181
|
+
validityStyles: z.value
|
|
180
182
|
}, null, 8, ["id", "value", "onChange", "defaultItem", "dataItems", "valid", "validate", "validityStyles"]),
|
|
181
|
-
|
|
182
|
-
default:
|
|
183
|
-
|
|
183
|
+
h.value && P.value ? (c(), y(o(A), { key: 0 }, {
|
|
184
|
+
default: m(() => [
|
|
185
|
+
g(I(s.value.field.error.state), 1)
|
|
184
186
|
]),
|
|
185
187
|
_: 1
|
|
186
|
-
})) :
|
|
188
|
+
})) : S("", !0)
|
|
187
189
|
]),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
id:
|
|
191
|
-
placeholder:
|
|
190
|
+
E("div", ie, [
|
|
191
|
+
D(o(b), {
|
|
192
|
+
id: v.value.zip,
|
|
193
|
+
placeholder: s.value.placeholder.zip,
|
|
192
194
|
wrapperClass: e.value.zipWrapperClass,
|
|
193
195
|
value: e.value.zipDisplay.value,
|
|
194
196
|
onInput: e.value.onZipInput,
|
|
195
|
-
valid:
|
|
196
|
-
validate:
|
|
197
|
-
validityStyles:
|
|
197
|
+
valid: Z.value,
|
|
198
|
+
validate: z.value,
|
|
199
|
+
validityStyles: z.value,
|
|
198
200
|
style: { width: "100%" }
|
|
199
201
|
}, null, 8, ["id", "placeholder", "wrapperClass", "value", "onInput", "valid", "validate", "validityStyles"]),
|
|
200
|
-
|
|
201
|
-
default:
|
|
202
|
-
|
|
202
|
+
h.value && q.value ? (c(), y(o(A), { key: 0 }, {
|
|
203
|
+
default: m(() => [
|
|
204
|
+
g(I(s.value.field.error.zip), 1)
|
|
203
205
|
]),
|
|
204
206
|
_: 1
|
|
205
|
-
})) :
|
|
206
|
-
|
|
207
|
-
default:
|
|
208
|
-
|
|
207
|
+
})) : S("", !0),
|
|
208
|
+
h.value && !q.value ? (c(), y(o(V), { key: 1 }, {
|
|
209
|
+
default: m(() => [
|
|
210
|
+
g(I(s.value.field.hint.zip), 1)
|
|
209
211
|
]),
|
|
210
212
|
_: 1
|
|
211
|
-
})) :
|
|
213
|
+
})) : S("", !0)
|
|
212
214
|
]),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
default:
|
|
216
|
-
|
|
215
|
+
C.value ? (c(), w("div", de, [
|
|
216
|
+
f.value && !e.value.addressValid.value ? (c(), y(o(A), { key: 0 }, {
|
|
217
|
+
default: m(() => [
|
|
218
|
+
g(I(N.value), 1)
|
|
217
219
|
]),
|
|
218
220
|
_: 1
|
|
219
|
-
})) :
|
|
220
|
-
default:
|
|
221
|
-
|
|
221
|
+
})) : k.value ? (c(), y(o(A), { key: 1 }, {
|
|
222
|
+
default: m(() => [
|
|
223
|
+
g(I(G.value), 1)
|
|
222
224
|
]),
|
|
223
225
|
_: 1
|
|
224
|
-
})) : (
|
|
225
|
-
default:
|
|
226
|
-
|
|
226
|
+
})) : (c(), y(o(V), { key: 2 }, {
|
|
227
|
+
default: m(() => [
|
|
228
|
+
g(I(s.value.fieldset.hint.address), 1)
|
|
227
229
|
]),
|
|
228
230
|
_: 1
|
|
229
231
|
}))
|
|
230
|
-
])) :
|
|
232
|
+
])) : S("", !0)
|
|
231
233
|
], 2));
|
|
232
234
|
}
|
|
233
|
-
}),
|
|
234
|
-
const
|
|
235
|
-
for (const [
|
|
236
|
-
|
|
237
|
-
return
|
|
238
|
-
},
|
|
235
|
+
}), $ = (n, t) => {
|
|
236
|
+
const d = n.__vccOpts || n;
|
|
237
|
+
for (const [p, s] of t)
|
|
238
|
+
d[p] = s;
|
|
239
|
+
return d;
|
|
240
|
+
}, ge = /* @__PURE__ */ $(ne, [["__scopeId", "data-v-8aeb035b"]]), ue = ["id"], oe = /* @__PURE__ */ R({
|
|
241
|
+
__name: "ActionCell",
|
|
242
|
+
props: {
|
|
243
|
+
dataItem: {
|
|
244
|
+
type: Object,
|
|
245
|
+
required: !0
|
|
246
|
+
},
|
|
247
|
+
config: {
|
|
248
|
+
type: Object,
|
|
249
|
+
required: !0
|
|
250
|
+
},
|
|
251
|
+
menuController: {
|
|
252
|
+
type: Object,
|
|
253
|
+
required: !0
|
|
254
|
+
},
|
|
255
|
+
tabIndex: {
|
|
256
|
+
type: Number,
|
|
257
|
+
default: -1
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
setup(n) {
|
|
261
|
+
const t = n, d = X("action-cell"), p = (i) => t.menuController.getTriggerId(i, t.dataItem), s = (i) => t.menuController.registry.isIdActive(p(i)), h = (i, f) => {
|
|
262
|
+
t.menuController.registry.register(
|
|
263
|
+
p(i),
|
|
264
|
+
f
|
|
265
|
+
);
|
|
266
|
+
}, C = (i, ...f) => {
|
|
267
|
+
t.menuController.handleTriggerKeydown(p(i), ...f);
|
|
268
|
+
};
|
|
269
|
+
return (i, f) => (c(), w("td", {
|
|
270
|
+
id: o(d).instanceId,
|
|
271
|
+
class: "fkui-action-cell"
|
|
272
|
+
}, [
|
|
273
|
+
(c(!0), w(F, null, H(n.config.triggers, (v) => (c(), y(o(Q), {
|
|
274
|
+
key: v.key,
|
|
275
|
+
ref_for: !0,
|
|
276
|
+
ref: (e) => h(v, e),
|
|
277
|
+
id: o(d).compose(v.key, "trigger"),
|
|
278
|
+
"svg-icon": v.icon,
|
|
279
|
+
type: "button",
|
|
280
|
+
"fill-mode": "flat",
|
|
281
|
+
"theme-color": "primary",
|
|
282
|
+
rounded: "full",
|
|
283
|
+
"aria-label": v.ariaLabel,
|
|
284
|
+
"aria-haspopup": "menu",
|
|
285
|
+
"aria-expanded": s(v),
|
|
286
|
+
disabled: v.disabled?.(n.dataItem),
|
|
287
|
+
tabindex: n.tabIndex,
|
|
288
|
+
onClick: (e) => n.menuController.handleTriggerClick(p(v)),
|
|
289
|
+
onKeydown: (e) => C(v, e)
|
|
290
|
+
}, null, 8, ["id", "svg-icon", "aria-label", "aria-expanded", "disabled", "tabindex", "onClick", "onKeydown"]))), 128))
|
|
291
|
+
], 8, ue));
|
|
292
|
+
}
|
|
293
|
+
}), Ie = /* @__PURE__ */ $(oe, [["__scopeId", "data-v-2a6441af"]]), _e = (n) => {
|
|
294
|
+
const t = Y(), d = n.getTriggerId ?? ((r, u) => `${r.key}:${n.getRowId(u)}`), p = l(() => {
|
|
295
|
+
const r = t.activeId.value?.split(":")[0];
|
|
296
|
+
return n.config.triggers.find((u) => u.key === r) ?? null;
|
|
297
|
+
}), s = l(() => {
|
|
298
|
+
const r = t.activeId.value?.split(":").slice(1).join(":");
|
|
299
|
+
return r === void 0 ? null : W(n.rows).find(
|
|
300
|
+
(u) => String(n.getRowId(u)) === r
|
|
301
|
+
) ?? null;
|
|
302
|
+
}), h = l(() => {
|
|
303
|
+
const r = s.value, u = p.value;
|
|
304
|
+
return r && u ? u.items?.(r) ?? [] : [];
|
|
305
|
+
}), C = l(() => {
|
|
306
|
+
const r = s.value, u = p.value;
|
|
307
|
+
return r && u?.title ? u.title(r) : null;
|
|
308
|
+
}), i = ee({
|
|
309
|
+
isOpen: t.isActive,
|
|
310
|
+
triggerRef: t.activeElement,
|
|
311
|
+
menuRef: n.menuRef,
|
|
312
|
+
triggerMode: n.triggerMode ?? "button",
|
|
313
|
+
anchor: n.anchor ?? !0,
|
|
314
|
+
resolveFocusTarget: n.resolveFocusTarget,
|
|
315
|
+
requestShow: (r) => {
|
|
316
|
+
typeof r == "string" && t.activate(r);
|
|
317
|
+
},
|
|
318
|
+
requestHide: () => t.deactivate()
|
|
319
|
+
}), f = (r) => {
|
|
320
|
+
t.isActive.value && !t.isIdActive(r) && t.deactivate(), n.coexistsWith?.forEach((u) => u.deactivate()), i.handleActionButtonClick(r);
|
|
321
|
+
}, v = (r, ...u) => {
|
|
322
|
+
const _ = u[0];
|
|
323
|
+
if (_.key === "Enter" || _.code === "Space") {
|
|
324
|
+
_.preventDefault(), f(r);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
i.handleActionButtonKeydown(_, r);
|
|
328
|
+
}, e = (r) => {
|
|
329
|
+
r.key === "Escape" && i.handleActionMenuEscape(r);
|
|
330
|
+
}, T = (r) => {
|
|
331
|
+
const u = s.value, _ = p.value;
|
|
332
|
+
i.handleMenuSelect(r, (k) => {
|
|
333
|
+
u && _ && n.onActionSelected(k.item?.text, u, _);
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
return {
|
|
337
|
+
actionCellProps: {
|
|
338
|
+
config: n.config,
|
|
339
|
+
menuController: {
|
|
340
|
+
registry: t,
|
|
341
|
+
getTriggerId: d,
|
|
342
|
+
handleTriggerClick: f,
|
|
343
|
+
handleTriggerKeydown: v
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
popupProps: l(() => ({
|
|
347
|
+
show: t.isActive.value,
|
|
348
|
+
offset: i.offset.value,
|
|
349
|
+
onClose: i.handlePopupClose
|
|
350
|
+
})),
|
|
351
|
+
menuProps: l(() => ({
|
|
352
|
+
items: h.value,
|
|
353
|
+
vertical: !0,
|
|
354
|
+
onKeydown: e,
|
|
355
|
+
onSelect: T
|
|
356
|
+
})),
|
|
357
|
+
activeRow: s,
|
|
358
|
+
activeTrigger: p,
|
|
359
|
+
activeTitle: C
|
|
360
|
+
};
|
|
361
|
+
};
|
|
239
362
|
export {
|
|
240
|
-
|
|
363
|
+
Ie as ActionCell,
|
|
364
|
+
ge as USAddress,
|
|
365
|
+
_e as useActionCellMenu
|
|
241
366
|
};
|
|
242
367
|
//# sourceMappingURL=featherk-ui.es.js.map
|