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