@dialpad/dialtone-vue 3.89.0 → 3.91.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/CHANGELOG.json +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/dialtone-vue.cjs +5 -5
- package/dist/dialtone-vue.js +1528 -1211
- package/dist/{emoji-e5c98301.js → emoji-131e3eda.js} +83 -83
- package/dist/emoji.js +23 -23
- package/dist/message_input-0c6b468f.cjs +93 -0
- package/dist/message_input-4bede2c7.js +15844 -0
- package/dist/message_input.cjs +1 -92
- package/dist/message_input.js +4 -13670
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +82 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts +6 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel_constants.d.ts.map +1 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/index.d.ts +2 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/index.d.ts.map +1 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +49 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts +30 -0
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts.map +1 -0
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts +5 -4
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/stack-5e05e7f3.js +0 -2177
- package/dist/stack-96a00d5c.cjs +0 -2
package/dist/stack-5e05e7f3.js
DELETED
|
@@ -1,2177 +0,0 @@
|
|
|
1
|
-
import { _ as y, d as Y, p as Z, D as I, g as R, I as X, a as J, h as L, b as F, L as Q, c as ee, u as te, T as se, e as ne, i as oe, f as ie, j as ae } from "./emoji-e5c98301.js";
|
|
2
|
-
import { openBlock as i, createElementBlock as r, toDisplayString as A, createCommentVNode as d, createElementVNode as b, normalizeClass as p, resolveComponent as f, createBlock as u, resolveDynamicComponent as C, withCtx as h, mergeProps as T, renderSlot as l, createVNode as g, createTextVNode as le, withKeys as E, withModifiers as P, toHandlers as z, createSlots as re, renderList as de, Teleport as ce } from "vue";
|
|
3
|
-
const O = {
|
|
4
|
-
BUSY: "busy",
|
|
5
|
-
AWAY: "away",
|
|
6
|
-
OFFLINE: "offline",
|
|
7
|
-
ACTIVE: "active"
|
|
8
|
-
}, ue = [
|
|
9
|
-
O.BUSY,
|
|
10
|
-
O.AWAY,
|
|
11
|
-
O.OFFLINE,
|
|
12
|
-
O.ACTIVE
|
|
13
|
-
], he = {
|
|
14
|
-
name: "DtPresence",
|
|
15
|
-
props: {
|
|
16
|
-
/**
|
|
17
|
-
* Determines the color of the inner presence circle, indicating status.
|
|
18
|
-
* Accepts one of 4 values: 'busy', 'away', 'active', 'offline'
|
|
19
|
-
* @values busy, away, active, offline
|
|
20
|
-
*/
|
|
21
|
-
presence: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: O.ACTIVE,
|
|
24
|
-
validator: (e) => ue.includes(e)
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* Since Presence is a visual element, we need SRs to read out any state changes
|
|
28
|
-
* that occur.
|
|
29
|
-
* Text entered here will be read by assistive technology. If null this component will be ignored by AT.
|
|
30
|
-
*/
|
|
31
|
-
srText: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: null
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}, fe = ["aria-live"], pe = {
|
|
37
|
-
key: 0,
|
|
38
|
-
"data-qa": "dt-presence-sr-text",
|
|
39
|
-
class: "sr-only"
|
|
40
|
-
};
|
|
41
|
-
function me(e, s, t, a, o, n) {
|
|
42
|
-
return i(), r("div", {
|
|
43
|
-
class: "d-presence",
|
|
44
|
-
"data-qa": "dt-presence",
|
|
45
|
-
role: "status",
|
|
46
|
-
"aria-live": e.$attrs.ariaLive || "off"
|
|
47
|
-
}, [
|
|
48
|
-
t.srText ? (i(), r("span", pe, A(t.srText), 1)) : d("", !0),
|
|
49
|
-
b("div", {
|
|
50
|
-
class: p(["d-presence__inner", {
|
|
51
|
-
"d-presence__inner--active": t.presence === "active",
|
|
52
|
-
"d-presence__inner--away": t.presence === "away",
|
|
53
|
-
"d-presence__inner--busy": t.presence === "busy",
|
|
54
|
-
"d-presence__inner--offline": t.presence === "offline"
|
|
55
|
-
}])
|
|
56
|
-
}, null, 2)
|
|
57
|
-
], 8, fe);
|
|
58
|
-
}
|
|
59
|
-
const ye = /* @__PURE__ */ y(he, [["render", me]]), N = {
|
|
60
|
-
xs: "d-avatar--xs",
|
|
61
|
-
sm: "d-avatar--sm",
|
|
62
|
-
md: "d-avatar--md",
|
|
63
|
-
lg: "d-avatar--lg",
|
|
64
|
-
xl: "d-avatar--xl"
|
|
65
|
-
}, _e = {
|
|
66
|
-
default: "",
|
|
67
|
-
icon: "d-avatar__icon",
|
|
68
|
-
initials: "d-avatar__initials"
|
|
69
|
-
}, ve = {
|
|
70
|
-
md: "d-avatar__presence--md",
|
|
71
|
-
lg: "d-avatar__presence--lg"
|
|
72
|
-
}, V = {
|
|
73
|
-
NONE: "",
|
|
74
|
-
BUSY: "busy",
|
|
75
|
-
AWAY: "away",
|
|
76
|
-
OFFLINE: "offline",
|
|
77
|
-
ACTIVE: "active"
|
|
78
|
-
}, ge = {
|
|
79
|
-
xs: "100",
|
|
80
|
-
sm: "200",
|
|
81
|
-
md: "300",
|
|
82
|
-
lg: "500",
|
|
83
|
-
xl: "600"
|
|
84
|
-
}, be = [
|
|
85
|
-
"100",
|
|
86
|
-
"200",
|
|
87
|
-
"300",
|
|
88
|
-
"400",
|
|
89
|
-
"500",
|
|
90
|
-
"600",
|
|
91
|
-
"700",
|
|
92
|
-
"800",
|
|
93
|
-
"900",
|
|
94
|
-
"1000",
|
|
95
|
-
"1100",
|
|
96
|
-
"1200",
|
|
97
|
-
"1300",
|
|
98
|
-
"1400",
|
|
99
|
-
"1500",
|
|
100
|
-
"1600",
|
|
101
|
-
"1700",
|
|
102
|
-
"1800"
|
|
103
|
-
], x = (e) => e > 1;
|
|
104
|
-
function Se() {
|
|
105
|
-
return [void 0, ...Object.keys(Y).map((e) => Z(e))];
|
|
106
|
-
}
|
|
107
|
-
const Ee = (e) => {
|
|
108
|
-
if (typeof e != "string" || !e.trim())
|
|
109
|
-
return "";
|
|
110
|
-
const s = e.trim().split(/\s+/g);
|
|
111
|
-
return s.length === 1 ? s.join("").substring(0, 2) : s.filter((t, a) => a === 0 || a === s.length - 1).map((t) => t.slice(0, 1).toUpperCase()).join("");
|
|
112
|
-
};
|
|
113
|
-
const Ce = Se(), Ie = {
|
|
114
|
-
name: "DtAvatar",
|
|
115
|
-
components: { DtPresence: ye, DtIcon: I },
|
|
116
|
-
inheritAttrs: !1,
|
|
117
|
-
props: {
|
|
118
|
-
/**
|
|
119
|
-
* Id of the avatar content wrapper element
|
|
120
|
-
*/
|
|
121
|
-
id: {
|
|
122
|
-
type: String,
|
|
123
|
-
default() {
|
|
124
|
-
return R();
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
/**
|
|
128
|
-
* Pass in a seed to get the random color generation based on that string. For example if you pass in a
|
|
129
|
-
* user ID as the string it will return the same randomly generated colors every time for that user.
|
|
130
|
-
*/
|
|
131
|
-
seed: {
|
|
132
|
-
type: String,
|
|
133
|
-
default: void 0
|
|
134
|
-
},
|
|
135
|
-
/**
|
|
136
|
-
* Set the avatar background to a specific color. If undefined will randomize the color which can be deterministic
|
|
137
|
-
* if the seed prop is set.
|
|
138
|
-
*/
|
|
139
|
-
color: {
|
|
140
|
-
type: String,
|
|
141
|
-
default: void 0
|
|
142
|
-
},
|
|
143
|
-
/**
|
|
144
|
-
* The size of the avatar
|
|
145
|
-
* @values xs, sm, md, lg, xl
|
|
146
|
-
*/
|
|
147
|
-
size: {
|
|
148
|
-
type: String,
|
|
149
|
-
default: "md",
|
|
150
|
-
validator: (e) => Object.keys(N).includes(e)
|
|
151
|
-
},
|
|
152
|
-
/**
|
|
153
|
-
* Used to customize the avatar container
|
|
154
|
-
*/
|
|
155
|
-
avatarClass: {
|
|
156
|
-
type: [String, Array, Object],
|
|
157
|
-
default: ""
|
|
158
|
-
},
|
|
159
|
-
/**
|
|
160
|
-
* Set classes on the avatar canvas. Wrapper around the core avatar image.
|
|
161
|
-
*/
|
|
162
|
-
canvasClass: {
|
|
163
|
-
type: [String, Array, Object],
|
|
164
|
-
default: ""
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* Pass through classes. Used to customize the avatar icon
|
|
168
|
-
*/
|
|
169
|
-
iconClass: {
|
|
170
|
-
type: [String, Array, Object],
|
|
171
|
-
default: ""
|
|
172
|
-
},
|
|
173
|
-
/**
|
|
174
|
-
* Determines whether to show the presence indicator for
|
|
175
|
-
* Avatar - accepts PRESENCE_STATES values: 'busy', 'away', 'offline',
|
|
176
|
-
* or 'active'. By default, it's null and nothing is shown.
|
|
177
|
-
* @values null, busy, away, offline, active
|
|
178
|
-
*/
|
|
179
|
-
presence: {
|
|
180
|
-
type: String,
|
|
181
|
-
default: V.NONE,
|
|
182
|
-
validator: (e) => Object.values(V).includes(e)
|
|
183
|
-
},
|
|
184
|
-
/**
|
|
185
|
-
* A set of props to be passed into the presence component.
|
|
186
|
-
*/
|
|
187
|
-
presenceProps: {
|
|
188
|
-
type: Object,
|
|
189
|
-
default: () => ({})
|
|
190
|
-
},
|
|
191
|
-
/**
|
|
192
|
-
* Determines whether to show a group avatar.
|
|
193
|
-
* Limit to 2 digits max, more than 99 will be rendered as “99+”.
|
|
194
|
-
* if the number is 1 or less it would just show the regular avatar as if group had not been set.
|
|
195
|
-
*/
|
|
196
|
-
group: {
|
|
197
|
-
type: Number,
|
|
198
|
-
default: void 0,
|
|
199
|
-
validator: (e) => x(e)
|
|
200
|
-
},
|
|
201
|
-
/**
|
|
202
|
-
* The icon that overlays the avatar
|
|
203
|
-
*/
|
|
204
|
-
overlayIcon: {
|
|
205
|
-
type: String,
|
|
206
|
-
default: ""
|
|
207
|
-
},
|
|
208
|
-
/**
|
|
209
|
-
* The text that overlays the avatar
|
|
210
|
-
*/
|
|
211
|
-
overlayText: {
|
|
212
|
-
type: String,
|
|
213
|
-
default: ""
|
|
214
|
-
},
|
|
215
|
-
/**
|
|
216
|
-
* Used to customize the avatar overlay
|
|
217
|
-
*/
|
|
218
|
-
overlayClass: {
|
|
219
|
-
type: [String, Array, Object],
|
|
220
|
-
default: ""
|
|
221
|
-
},
|
|
222
|
-
/**
|
|
223
|
-
* Source of the image
|
|
224
|
-
*/
|
|
225
|
-
imageSrc: {
|
|
226
|
-
type: String,
|
|
227
|
-
default: ""
|
|
228
|
-
},
|
|
229
|
-
/**
|
|
230
|
-
* Alt attribute of the image, by default
|
|
231
|
-
* it'd be the full name
|
|
232
|
-
*/
|
|
233
|
-
imageAlt: {
|
|
234
|
-
type: String,
|
|
235
|
-
default: ""
|
|
236
|
-
},
|
|
237
|
-
/**
|
|
238
|
-
* Icon name to be displayed on the avatar
|
|
239
|
-
*/
|
|
240
|
-
iconName: {
|
|
241
|
-
type: String,
|
|
242
|
-
default: void 0,
|
|
243
|
-
validator: (e) => Ce.includes(e)
|
|
244
|
-
},
|
|
245
|
-
/**
|
|
246
|
-
* Icon size to be displayed on the avatar
|
|
247
|
-
* @values 100, 200, 300, 400, 500, 600, 700, 800
|
|
248
|
-
*/
|
|
249
|
-
iconSize: {
|
|
250
|
-
type: String,
|
|
251
|
-
default: "",
|
|
252
|
-
validator: (e) => !e || Object.keys(X).includes(e)
|
|
253
|
-
},
|
|
254
|
-
/**
|
|
255
|
-
* Full name used to extract initials and set alt attribute.
|
|
256
|
-
*/
|
|
257
|
-
fullName: {
|
|
258
|
-
type: String,
|
|
259
|
-
default: ""
|
|
260
|
-
},
|
|
261
|
-
/**
|
|
262
|
-
* Makes the avatar focusable and clickable,
|
|
263
|
-
* emits a click event when clicked.
|
|
264
|
-
*/
|
|
265
|
-
clickable: {
|
|
266
|
-
type: Boolean,
|
|
267
|
-
default: !1
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
emits: [
|
|
271
|
-
/**
|
|
272
|
-
* Avatar click event
|
|
273
|
-
*
|
|
274
|
-
* @event click
|
|
275
|
-
* @type {PointerEvent | KeyboardEvent}
|
|
276
|
-
*/
|
|
277
|
-
"click"
|
|
278
|
-
],
|
|
279
|
-
data() {
|
|
280
|
-
return {
|
|
281
|
-
AVATAR_SIZE_MODIFIERS: N,
|
|
282
|
-
AVATAR_KIND_MODIFIERS: _e,
|
|
283
|
-
AVATAR_PRESENCE_SIZE_MODIFIERS: ve,
|
|
284
|
-
AVATAR_ICON_SIZES: ge,
|
|
285
|
-
imageLoadedSuccessfully: null,
|
|
286
|
-
formattedInitials: "",
|
|
287
|
-
initializing: !1
|
|
288
|
-
};
|
|
289
|
-
},
|
|
290
|
-
computed: {
|
|
291
|
-
isNotIconType() {
|
|
292
|
-
return !this.iconName;
|
|
293
|
-
},
|
|
294
|
-
avatarClasses() {
|
|
295
|
-
return [
|
|
296
|
-
"d-avatar",
|
|
297
|
-
N[this.validatedSize],
|
|
298
|
-
this.avatarClass,
|
|
299
|
-
{
|
|
300
|
-
"d-avatar--group": this.showGroup,
|
|
301
|
-
[`d-avatar--color-${this.getColor()}`]: this.isNotIconType,
|
|
302
|
-
"d-avatar--clickable": this.clickable
|
|
303
|
-
}
|
|
304
|
-
];
|
|
305
|
-
},
|
|
306
|
-
overlayClasses() {
|
|
307
|
-
return [
|
|
308
|
-
"d-avatar__overlay",
|
|
309
|
-
this.overlayClass
|
|
310
|
-
];
|
|
311
|
-
},
|
|
312
|
-
showGroup() {
|
|
313
|
-
return x(this.group);
|
|
314
|
-
},
|
|
315
|
-
formattedGroup() {
|
|
316
|
-
return this.group > 99 ? "99+" : this.group;
|
|
317
|
-
},
|
|
318
|
-
validatedSize() {
|
|
319
|
-
return this.group ? "xs" : this.size;
|
|
320
|
-
},
|
|
321
|
-
showImage() {
|
|
322
|
-
return this.imageLoadedSuccessfully !== !1 && this.imageSrc;
|
|
323
|
-
},
|
|
324
|
-
buttonAriaLabel() {
|
|
325
|
-
if (this.clickable)
|
|
326
|
-
return this.fullName || this.imageAlt || this.$attrs["aria-label"];
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
watch: {
|
|
330
|
-
fullName: {
|
|
331
|
-
immediate: !0,
|
|
332
|
-
handler(e) {
|
|
333
|
-
this.formatInitials(e);
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
imageSrc(e) {
|
|
337
|
-
this.imageLoadedSuccessfully = null, e && (this.validateProps(), this.setImageListeners());
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
mounted() {
|
|
341
|
-
this.validateProps(), this.setImageListeners();
|
|
342
|
-
},
|
|
343
|
-
methods: {
|
|
344
|
-
async setImageListeners() {
|
|
345
|
-
await this.$nextTick();
|
|
346
|
-
const e = this.$refs.avatarImage;
|
|
347
|
-
e && (e.addEventListener("load", () => this._loadedImageEventHandler(e), { once: !0 }), e.addEventListener("error", () => this._erroredImageEventHandler(e), { once: !0 }));
|
|
348
|
-
},
|
|
349
|
-
formatInitials(e) {
|
|
350
|
-
const s = Ee(e);
|
|
351
|
-
this.validatedSize === "xs" ? this.formattedInitials = "" : this.validatedSize === "sm" ? this.formattedInitials = s[0] : this.formattedInitials = s;
|
|
352
|
-
},
|
|
353
|
-
getColor() {
|
|
354
|
-
return this.color ?? J(be, this.seed);
|
|
355
|
-
},
|
|
356
|
-
_loadedImageEventHandler(e) {
|
|
357
|
-
this.imageLoadedSuccessfully = !0, e.classList.remove("d-d-none");
|
|
358
|
-
},
|
|
359
|
-
_erroredImageEventHandler(e) {
|
|
360
|
-
this.imageLoadedSuccessfully = !1, e.classList.add("d-d-none");
|
|
361
|
-
},
|
|
362
|
-
validateProps() {
|
|
363
|
-
if (this.imageSrc && !(this.fullName || this.imageAlt))
|
|
364
|
-
throw new Error("full-name or image-alt must be set if image-src is provided");
|
|
365
|
-
},
|
|
366
|
-
handleClick(e) {
|
|
367
|
-
this.clickable && this.$emit("click", e);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}, Oe = ["src", "alt"], Ae = {
|
|
371
|
-
key: 1,
|
|
372
|
-
class: "d-avatar__overlay-text"
|
|
373
|
-
}, ke = {
|
|
374
|
-
key: 1,
|
|
375
|
-
class: "d-avatar__count",
|
|
376
|
-
"data-qa": "dt-avatar-count"
|
|
377
|
-
};
|
|
378
|
-
function Te(e, s, t, a, o, n) {
|
|
379
|
-
const c = f("dt-icon"), _ = f("dt-presence");
|
|
380
|
-
return i(), u(C(t.clickable ? "button" : "div"), {
|
|
381
|
-
id: t.id,
|
|
382
|
-
class: p(n.avatarClasses),
|
|
383
|
-
"data-qa": "dt-avatar",
|
|
384
|
-
"aria-label": n.buttonAriaLabel,
|
|
385
|
-
onClick: n.handleClick
|
|
386
|
-
}, {
|
|
387
|
-
default: h(() => [
|
|
388
|
-
b("div", {
|
|
389
|
-
ref: "canvas",
|
|
390
|
-
class: p([
|
|
391
|
-
t.canvasClass,
|
|
392
|
-
"d-avatar__canvas",
|
|
393
|
-
{ "d-avatar--image-loaded": o.imageLoadedSuccessfully }
|
|
394
|
-
])
|
|
395
|
-
}, [
|
|
396
|
-
n.showImage ? (i(), r("img", {
|
|
397
|
-
key: 0,
|
|
398
|
-
ref: "avatarImage",
|
|
399
|
-
class: "d-avatar__image",
|
|
400
|
-
"data-qa": "dt-avatar-image",
|
|
401
|
-
src: t.imageSrc,
|
|
402
|
-
alt: t.imageAlt || t.fullName
|
|
403
|
-
}, null, 8, Oe)) : t.iconName ? (i(), u(c, {
|
|
404
|
-
key: 1,
|
|
405
|
-
name: t.iconName,
|
|
406
|
-
size: t.iconSize || o.AVATAR_ICON_SIZES[t.size],
|
|
407
|
-
class: p([t.iconClass, o.AVATAR_KIND_MODIFIERS.icon]),
|
|
408
|
-
"data-qa": "dt-avatar-icon"
|
|
409
|
-
}, null, 8, ["name", "size", "class"])) : (i(), r("span", {
|
|
410
|
-
key: 2,
|
|
411
|
-
class: p([o.AVATAR_KIND_MODIFIERS.initials, "d-ps-absolute d-zi-base d-us-none"])
|
|
412
|
-
}, A(o.formattedInitials), 3))
|
|
413
|
-
], 2),
|
|
414
|
-
t.overlayIcon || t.overlayText ? (i(), r("div", {
|
|
415
|
-
key: 0,
|
|
416
|
-
class: p(n.overlayClasses)
|
|
417
|
-
}, [
|
|
418
|
-
t.overlayIcon ? (i(), u(c, {
|
|
419
|
-
key: 0,
|
|
420
|
-
class: "d-avatar__overlay-icon",
|
|
421
|
-
name: t.overlayIcon
|
|
422
|
-
}, null, 8, ["name"])) : t.overlayText ? (i(), r("p", Ae, A(t.overlayText), 1)) : d("", !0)
|
|
423
|
-
], 2)) : d("", !0),
|
|
424
|
-
n.showGroup ? (i(), r("span", ke, A(n.formattedGroup), 1)) : d("", !0),
|
|
425
|
-
t.presence && !n.showGroup ? (i(), u(_, T({
|
|
426
|
-
key: 2,
|
|
427
|
-
presence: t.presence,
|
|
428
|
-
class: [
|
|
429
|
-
"d-avatar__presence",
|
|
430
|
-
o.AVATAR_PRESENCE_SIZE_MODIFIERS[t.size]
|
|
431
|
-
]
|
|
432
|
-
}, t.presenceProps, { "data-qa": "dt-presence" }), null, 16, ["presence", "class"])) : d("", !0)
|
|
433
|
-
]),
|
|
434
|
-
_: 1
|
|
435
|
-
}, 8, ["id", "class", "aria-label", "onClick"]);
|
|
436
|
-
}
|
|
437
|
-
const Dt = /* @__PURE__ */ y(Ie, [["render", Te]]), M = ["base", "error", "info", "success", "warning"], we = ["alert", "alertdialog", "status"], Pe = /* @__PURE__ */ new Map([
|
|
438
|
-
["info", "info"],
|
|
439
|
-
["success", "check-circle"],
|
|
440
|
-
["warning", "alert-triangle"],
|
|
441
|
-
["error", "alert-circle"],
|
|
442
|
-
["base", "bell"]
|
|
443
|
-
]), Le = {
|
|
444
|
-
name: "DtNoticeIcon",
|
|
445
|
-
components: {
|
|
446
|
-
DtIcon: I
|
|
447
|
-
},
|
|
448
|
-
props: {
|
|
449
|
-
/**
|
|
450
|
-
* Kind of icon
|
|
451
|
-
* @values base, error, info, success, warning
|
|
452
|
-
*/
|
|
453
|
-
kind: {
|
|
454
|
-
type: String,
|
|
455
|
-
default: "base",
|
|
456
|
-
validate(e) {
|
|
457
|
-
return M.includes(e);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
data() {
|
|
462
|
-
return {
|
|
463
|
-
hasSlotContent: L
|
|
464
|
-
};
|
|
465
|
-
},
|
|
466
|
-
computed: {
|
|
467
|
-
defaultIcon() {
|
|
468
|
-
return Pe.get(this.kind);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}, Ne = {
|
|
472
|
-
key: 0,
|
|
473
|
-
"aria-hidden": "true",
|
|
474
|
-
class: "d-notice__icon"
|
|
475
|
-
};
|
|
476
|
-
function De(e, s, t, a, o, n) {
|
|
477
|
-
const c = f("dt-icon");
|
|
478
|
-
return n.defaultIcon || o.hasSlotContent(e.$slots.default) ? (i(), r("div", Ne, [
|
|
479
|
-
l(e.$slots, "default", {}, () => [
|
|
480
|
-
g(c, {
|
|
481
|
-
name: n.defaultIcon,
|
|
482
|
-
size: "400"
|
|
483
|
-
}, null, 8, ["name"])
|
|
484
|
-
])
|
|
485
|
-
])) : d("", !0);
|
|
486
|
-
}
|
|
487
|
-
const Re = /* @__PURE__ */ y(Le, [["render", De]]), Fe = {
|
|
488
|
-
name: "DtNoticeContent",
|
|
489
|
-
props: {
|
|
490
|
-
/**
|
|
491
|
-
* Title header of the notice. This can be left blank to remove the title from the notice entirely.
|
|
492
|
-
*/
|
|
493
|
-
title: {
|
|
494
|
-
type: String,
|
|
495
|
-
default: ""
|
|
496
|
-
},
|
|
497
|
-
/**
|
|
498
|
-
* ID for the title element of the component. Useful for aria-describedby
|
|
499
|
-
* or aria-labelledby or any other reason you may need an id to refer to the title.
|
|
500
|
-
*/
|
|
501
|
-
titleId: {
|
|
502
|
-
type: String,
|
|
503
|
-
default: void 0
|
|
504
|
-
},
|
|
505
|
-
/**
|
|
506
|
-
* ID for the content element of the component. Useful for aria-describedby
|
|
507
|
-
* or aria-labelledby or any other reason you may need an id to refer to the content.
|
|
508
|
-
*/
|
|
509
|
-
contentId: {
|
|
510
|
-
type: String,
|
|
511
|
-
default: void 0
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
data() {
|
|
515
|
-
return {
|
|
516
|
-
hasSlotContent: L
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
}, Be = {
|
|
520
|
-
class: "d-notice__content",
|
|
521
|
-
"data-qa": "notice-content"
|
|
522
|
-
}, He = ["id"], Ve = ["id"];
|
|
523
|
-
function xe(e, s, t, a, o, n) {
|
|
524
|
-
return i(), r("div", Be, [
|
|
525
|
-
t.title || o.hasSlotContent(e.$slots.titleOverride) ? (i(), r("p", {
|
|
526
|
-
key: 0,
|
|
527
|
-
id: t.titleId,
|
|
528
|
-
class: "d-notice__title",
|
|
529
|
-
"data-qa": "notice-content-title"
|
|
530
|
-
}, [
|
|
531
|
-
l(e.$slots, "titleOverride", {}, () => [
|
|
532
|
-
le(A(t.title), 1)
|
|
533
|
-
])
|
|
534
|
-
], 8, He)) : d("", !0),
|
|
535
|
-
b("p", {
|
|
536
|
-
id: t.contentId,
|
|
537
|
-
class: "d-notice__message",
|
|
538
|
-
"data-qa": "notice-content-message"
|
|
539
|
-
}, [
|
|
540
|
-
l(e.$slots, "default")
|
|
541
|
-
], 8, Ve)
|
|
542
|
-
]);
|
|
543
|
-
}
|
|
544
|
-
const $e = /* @__PURE__ */ y(Fe, [["render", xe]]), B = {
|
|
545
|
-
props: {
|
|
546
|
-
/**
|
|
547
|
-
* If true, a hidden close button is included for screen readers
|
|
548
|
-
* @values true, false
|
|
549
|
-
*/
|
|
550
|
-
visuallyHiddenClose: {
|
|
551
|
-
type: Boolean,
|
|
552
|
-
default: !1
|
|
553
|
-
},
|
|
554
|
-
/**
|
|
555
|
-
* Label for the visually hidden close button
|
|
556
|
-
* Required if visuallyHiddenClose is set to `true`
|
|
557
|
-
*/
|
|
558
|
-
visuallyHiddenCloseLabel: {
|
|
559
|
-
type: String,
|
|
560
|
-
default: null
|
|
561
|
-
}
|
|
562
|
-
},
|
|
563
|
-
watch: {
|
|
564
|
-
$props: {
|
|
565
|
-
immediate: !0,
|
|
566
|
-
deep: !0,
|
|
567
|
-
handler() {
|
|
568
|
-
this.validateVisuallyHiddenCloseProps();
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
},
|
|
572
|
-
computed: {
|
|
573
|
-
showVisuallyHiddenClose() {
|
|
574
|
-
return this.visuallyHiddenClose && this.visuallyHiddenCloseLabel != null;
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
|
-
methods: {
|
|
578
|
-
validateVisuallyHiddenCloseProps() {
|
|
579
|
-
this.visuallyHiddenClose && !this.visuallyHiddenCloseLabel && console.error(`If visuallyHiddenClose prop is true, the component includes
|
|
580
|
-
a visually hidden close button and you must set the visuallyHiddenCloseLabel prop.`);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}, qe = {
|
|
584
|
-
name: "SrOnlyCloseButton",
|
|
585
|
-
components: {
|
|
586
|
-
DtIcon: I,
|
|
587
|
-
DtButton: F
|
|
588
|
-
},
|
|
589
|
-
props: {
|
|
590
|
-
/**
|
|
591
|
-
* Label for the visually hidden close button
|
|
592
|
-
* Required if visuallyHiddenClose is set to `true`
|
|
593
|
-
*/
|
|
594
|
-
visuallyHiddenCloseLabel: {
|
|
595
|
-
type: String,
|
|
596
|
-
default: null
|
|
597
|
-
}
|
|
598
|
-
},
|
|
599
|
-
emits: ["close"],
|
|
600
|
-
methods: {
|
|
601
|
-
close() {
|
|
602
|
-
this.$emit("close");
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
function je(e, s, t, a, o, n) {
|
|
607
|
-
const c = f("dt-icon"), _ = f("dt-button");
|
|
608
|
-
return i(), u(_, {
|
|
609
|
-
id: "sr-only-close-button",
|
|
610
|
-
"data-qa": "dt-sr-only-close-button",
|
|
611
|
-
class: "d-vi-visible-sr",
|
|
612
|
-
"aria-label": t.visuallyHiddenCloseLabel,
|
|
613
|
-
onClick: n.close,
|
|
614
|
-
onKeydown: E(P(n.close, ["prevent", "stop"]), ["space"])
|
|
615
|
-
}, {
|
|
616
|
-
default: h(() => [
|
|
617
|
-
g(c, { name: "close" })
|
|
618
|
-
]),
|
|
619
|
-
_: 1
|
|
620
|
-
}, 8, ["aria-label", "onClick", "onKeydown"]);
|
|
621
|
-
}
|
|
622
|
-
const W = /* @__PURE__ */ y(qe, [["render", je]]), Ke = {
|
|
623
|
-
name: "DtNoticeAction",
|
|
624
|
-
components: {
|
|
625
|
-
DtIcon: I,
|
|
626
|
-
DtButton: F,
|
|
627
|
-
SrOnlyCloseButton: W
|
|
628
|
-
},
|
|
629
|
-
mixins: [B],
|
|
630
|
-
props: {
|
|
631
|
-
/**
|
|
632
|
-
* Props for the notice close button.
|
|
633
|
-
*/
|
|
634
|
-
closeButtonProps: {
|
|
635
|
-
type: Object,
|
|
636
|
-
default: () => ({})
|
|
637
|
-
},
|
|
638
|
-
/**
|
|
639
|
-
* Hides the close button from the notice
|
|
640
|
-
* @values true, false
|
|
641
|
-
*/
|
|
642
|
-
hideClose: {
|
|
643
|
-
type: Boolean,
|
|
644
|
-
default: !1
|
|
645
|
-
}
|
|
646
|
-
},
|
|
647
|
-
emits: [
|
|
648
|
-
/**
|
|
649
|
-
* Close button click event
|
|
650
|
-
*
|
|
651
|
-
* @event close
|
|
652
|
-
*/
|
|
653
|
-
"close"
|
|
654
|
-
],
|
|
655
|
-
created() {
|
|
656
|
-
!this.hideClose && !this.closeButtonProps.ariaLabel && console.error("Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.");
|
|
657
|
-
},
|
|
658
|
-
mounted() {
|
|
659
|
-
this.hideClose || (this.lastFocusedElement = document.activeElement);
|
|
660
|
-
},
|
|
661
|
-
beforeUnmount() {
|
|
662
|
-
var e;
|
|
663
|
-
(e = this.lastFocusedElement) == null || e.focus();
|
|
664
|
-
},
|
|
665
|
-
methods: {
|
|
666
|
-
close() {
|
|
667
|
-
this.$emit("close");
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}, ze = {
|
|
671
|
-
class: "d-notice__actions",
|
|
672
|
-
"data-qa": "notice-content-actions"
|
|
673
|
-
};
|
|
674
|
-
function Me(e, s, t, a, o, n) {
|
|
675
|
-
const c = f("dt-icon"), _ = f("dt-button"), v = f("sr-only-close-button");
|
|
676
|
-
return i(), r("div", ze, [
|
|
677
|
-
l(e.$slots, "default"),
|
|
678
|
-
t.hideClose ? d("", !0) : (i(), u(_, T({
|
|
679
|
-
key: 0,
|
|
680
|
-
ref: "closeButton",
|
|
681
|
-
"data-qa": "dt-notice-action-close-button",
|
|
682
|
-
size: "sm",
|
|
683
|
-
importance: "clear",
|
|
684
|
-
circle: "",
|
|
685
|
-
"aria-label": t.closeButtonProps.ariaLabel ? t.closeButtonProps.ariaLabel : "Close"
|
|
686
|
-
}, t.closeButtonProps, { onClick: n.close }), {
|
|
687
|
-
icon: h(() => [
|
|
688
|
-
g(c, {
|
|
689
|
-
name: "close",
|
|
690
|
-
size: "200"
|
|
691
|
-
})
|
|
692
|
-
]),
|
|
693
|
-
_: 1
|
|
694
|
-
}, 16, ["aria-label", "onClick"])),
|
|
695
|
-
e.showVisuallyHiddenClose ? (i(), u(v, {
|
|
696
|
-
key: 1,
|
|
697
|
-
"visually-hidden-close-label": e.visuallyHiddenCloseLabel,
|
|
698
|
-
onClose: n.close
|
|
699
|
-
}, null, 8, ["visually-hidden-close-label", "onClose"])) : d("", !0)
|
|
700
|
-
]);
|
|
701
|
-
}
|
|
702
|
-
const We = /* @__PURE__ */ y(Ke, [["render", Me]]), G = ':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])', Ge = `${G}:not([tabindex="-1"])`, Ue = "button,[href],input,select,textarea,details,[tabindex]", Ye = {
|
|
703
|
-
methods: {
|
|
704
|
-
/**
|
|
705
|
-
* get the first focusable element in your component, includes tabindex="-1".
|
|
706
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
707
|
-
* will default to the root node of the vue component
|
|
708
|
-
*/
|
|
709
|
-
async getFirstFocusableElement(e) {
|
|
710
|
-
await this.$nextTick();
|
|
711
|
-
const s = this._getFocusableElements(e, !0);
|
|
712
|
-
return this._getFirstFocusElement(s);
|
|
713
|
-
},
|
|
714
|
-
/**
|
|
715
|
-
* set focus to the first focusable element in your component, includes tabindex="-1".
|
|
716
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
717
|
-
* will default to the root node of the vue component
|
|
718
|
-
*/
|
|
719
|
-
async focusFirstElement(e) {
|
|
720
|
-
const s = await this.getFirstFocusableElement(e);
|
|
721
|
-
s == null || s.focus({ preventScroll: !0 });
|
|
722
|
-
},
|
|
723
|
-
/**
|
|
724
|
-
* internal use only.
|
|
725
|
-
*
|
|
726
|
-
* @param focusableElements - list of focusable elements
|
|
727
|
-
* @returns {*} - first DOM element that is focusable.
|
|
728
|
-
* @private
|
|
729
|
-
*/
|
|
730
|
-
_getFirstFocusElement(e) {
|
|
731
|
-
if (!e.length)
|
|
732
|
-
return;
|
|
733
|
-
let s = e[0];
|
|
734
|
-
return s.matches('[type="radio"]:not(:checked)') && (s = e.find((t) => t.checked && t.name === s.name) || s), s;
|
|
735
|
-
},
|
|
736
|
-
/**
|
|
737
|
-
* internal use only.
|
|
738
|
-
*
|
|
739
|
-
* gets all the focusable elements within the component
|
|
740
|
-
* and sets the first and last of those elements.
|
|
741
|
-
*
|
|
742
|
-
* @param {object} el - the root dom element to find focusable elements in.
|
|
743
|
-
* @param {bool} includeNegativeTabIndex - will include tabindex="-1" in the list of focusable elements.
|
|
744
|
-
*/
|
|
745
|
-
_getFocusableElements(e = this.$el, s = !1) {
|
|
746
|
-
return e ? [...e.querySelectorAll(Ue)].filter((a) => {
|
|
747
|
-
const o = window.getComputedStyle(a);
|
|
748
|
-
return o.getPropertyValue("display") !== "none" && o.getPropertyValue("visibility") !== "hidden" && a.matches(s ? G : Ge);
|
|
749
|
-
}) : [];
|
|
750
|
-
},
|
|
751
|
-
/**
|
|
752
|
-
* tabs to the next element contained within your component, does not include tabindex="-1".
|
|
753
|
-
* @param {object} e - keypress event
|
|
754
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
755
|
-
* will default to the root node of the vue component
|
|
756
|
-
*/
|
|
757
|
-
focusTrappedTabPress(e, s) {
|
|
758
|
-
if (!(e.key === "Tab"))
|
|
759
|
-
return;
|
|
760
|
-
const a = this._getFocusableElements(s);
|
|
761
|
-
if (!a.length) {
|
|
762
|
-
e.preventDefault();
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
const o = this._getFirstFocusElement(a), n = a[a.length - 1];
|
|
766
|
-
e.shiftKey ? document.activeElement === o && (n.focus(), e.preventDefault()) : document.activeElement === n && (o.focus(), e.preventDefault());
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}, Ze = {
|
|
770
|
-
name: "DtLink",
|
|
771
|
-
props: {
|
|
772
|
-
/**
|
|
773
|
-
* Applies the link variant styles
|
|
774
|
-
* @values null, danger, warning, success, muted, inverted
|
|
775
|
-
*/
|
|
776
|
-
kind: {
|
|
777
|
-
type: String,
|
|
778
|
-
default: "",
|
|
779
|
-
validator(e) {
|
|
780
|
-
return Q.includes(e);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
},
|
|
784
|
-
data() {
|
|
785
|
-
return {
|
|
786
|
-
LINK_KIND_MODIFIERS: ee
|
|
787
|
-
};
|
|
788
|
-
}
|
|
789
|
-
}, Xe = ["href"];
|
|
790
|
-
function Je(e, s, t, a, o, n) {
|
|
791
|
-
return i(), r("a", {
|
|
792
|
-
class: p([
|
|
793
|
-
"d-link",
|
|
794
|
-
o.LINK_KIND_MODIFIERS[t.kind]
|
|
795
|
-
]),
|
|
796
|
-
"data-qa": "dt-link",
|
|
797
|
-
href: "href" in e.$attrs ? e.$attrs.href : "javascript:void(0)"
|
|
798
|
-
}, [
|
|
799
|
-
l(e.$slots, "default")
|
|
800
|
-
], 10, Xe);
|
|
801
|
-
}
|
|
802
|
-
const Rt = /* @__PURE__ */ y(Ze, [["render", Je]]), D = {
|
|
803
|
-
DEFAULT: "default",
|
|
804
|
-
CUSTOM: "custom"
|
|
805
|
-
}, w = {
|
|
806
|
-
ARROW_KEYS: "arrow-keys",
|
|
807
|
-
TAB: "tab",
|
|
808
|
-
NONE: "none"
|
|
809
|
-
};
|
|
810
|
-
const Qe = {
|
|
811
|
-
name: "DtItemLayout",
|
|
812
|
-
props: {
|
|
813
|
-
/**
|
|
814
|
-
* Set this prop to render layout as a specific HTML element.
|
|
815
|
-
*/
|
|
816
|
-
as: {
|
|
817
|
-
type: String,
|
|
818
|
-
default: "div"
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}, et = {
|
|
822
|
-
key: 0,
|
|
823
|
-
"data-qa": "dt-item-layout-left-wrapper",
|
|
824
|
-
class: "dt-item-layout--left"
|
|
825
|
-
}, tt = {
|
|
826
|
-
"data-qa": "dt-item-layout-content-wrapper",
|
|
827
|
-
class: "dt-item-layout--content"
|
|
828
|
-
}, st = {
|
|
829
|
-
key: 0,
|
|
830
|
-
"data-qa": "dt-item-layout-title-wrapper",
|
|
831
|
-
class: "dt-item-layout--title"
|
|
832
|
-
}, nt = {
|
|
833
|
-
key: 2,
|
|
834
|
-
"data-qa": "dt-item-layout-bottom-wrapper",
|
|
835
|
-
class: "dt-item-layout--bottom"
|
|
836
|
-
}, ot = {
|
|
837
|
-
key: 1,
|
|
838
|
-
"data-qa": "dt-item-layout-right-wrapper",
|
|
839
|
-
class: "dt-item-layout--right"
|
|
840
|
-
}, it = {
|
|
841
|
-
key: 2,
|
|
842
|
-
"data-qa": "dt-item-layout-selected-wrapper",
|
|
843
|
-
class: "dt-item-layout--selected"
|
|
844
|
-
};
|
|
845
|
-
function at(e, s, t, a, o, n) {
|
|
846
|
-
return i(), u(C(t.as), { class: "dt-item-layout" }, {
|
|
847
|
-
default: h(() => [
|
|
848
|
-
e.$slots.left ? (i(), r("section", et, [
|
|
849
|
-
l(e.$slots, "left", {}, void 0, !0)
|
|
850
|
-
])) : d("", !0),
|
|
851
|
-
b("section", tt, [
|
|
852
|
-
e.$slots.default ? (i(), r("div", st, [
|
|
853
|
-
l(e.$slots, "default", {}, void 0, !0)
|
|
854
|
-
])) : d("", !0),
|
|
855
|
-
e.$slots.subtitle ? (i(), r("div", {
|
|
856
|
-
key: 1,
|
|
857
|
-
"data-qa": "dt-item-layout-subtitle-wrapper",
|
|
858
|
-
class: p(["dt-item-layout--subtitle", { "d-mtn2": e.$slots.default }])
|
|
859
|
-
}, [
|
|
860
|
-
l(e.$slots, "subtitle", {}, void 0, !0)
|
|
861
|
-
], 2)) : d("", !0),
|
|
862
|
-
e.$slots.bottom ? (i(), r("div", nt, [
|
|
863
|
-
l(e.$slots, "bottom", {}, void 0, !0)
|
|
864
|
-
])) : d("", !0)
|
|
865
|
-
]),
|
|
866
|
-
e.$slots.right ? (i(), r("section", ot, [
|
|
867
|
-
l(e.$slots, "right", {}, void 0, !0)
|
|
868
|
-
])) : d("", !0),
|
|
869
|
-
e.$slots.selected ? (i(), r("section", it, [
|
|
870
|
-
l(e.$slots, "selected", {}, void 0, !0)
|
|
871
|
-
])) : d("", !0)
|
|
872
|
-
]),
|
|
873
|
-
_: 3
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
const $ = /* @__PURE__ */ y(Qe, [["render", at], ["__scopeId", "data-v-9afad3c4"]]);
|
|
877
|
-
const lt = {
|
|
878
|
-
name: "DtListItem",
|
|
879
|
-
components: {
|
|
880
|
-
DtItemLayout: $,
|
|
881
|
-
DtIcon: I
|
|
882
|
-
},
|
|
883
|
-
/**
|
|
884
|
-
* Value provided from keyboard_list_navigation.js using id prop.
|
|
885
|
-
*/
|
|
886
|
-
inject: {
|
|
887
|
-
highlightId: { default: null }
|
|
888
|
-
},
|
|
889
|
-
props: {
|
|
890
|
-
/**
|
|
891
|
-
* Id for the item.
|
|
892
|
-
*/
|
|
893
|
-
id: {
|
|
894
|
-
type: String,
|
|
895
|
-
default() {
|
|
896
|
-
return te.getUniqueString();
|
|
897
|
-
}
|
|
898
|
-
},
|
|
899
|
-
/**
|
|
900
|
-
* String to use for the item's role.
|
|
901
|
-
*/
|
|
902
|
-
role: {
|
|
903
|
-
type: String,
|
|
904
|
-
default: "listitem"
|
|
905
|
-
},
|
|
906
|
-
/**
|
|
907
|
-
* HTML element type (tag name) of the content wrapper element.
|
|
908
|
-
*/
|
|
909
|
-
elementType: {
|
|
910
|
-
type: String,
|
|
911
|
-
default: "li"
|
|
912
|
-
},
|
|
913
|
-
/**
|
|
914
|
-
* The type of child list item to use.
|
|
915
|
-
* @values default, custom
|
|
916
|
-
*/
|
|
917
|
-
type: {
|
|
918
|
-
type: String,
|
|
919
|
-
default: D.DEFAULT,
|
|
920
|
-
validator: (e) => Object.values(D).includes(e)
|
|
921
|
-
},
|
|
922
|
-
/**
|
|
923
|
-
* The type of navigation that this component should support.
|
|
924
|
-
* - "arrow-keys" for items that are navigated with UP/DOWN keys.
|
|
925
|
-
* - "tab" for items that are navigated using the TAB key.
|
|
926
|
-
* - "none" for static items that are not interactive.
|
|
927
|
-
* @values arrow-keys, tab, none
|
|
928
|
-
*/
|
|
929
|
-
navigationType: {
|
|
930
|
-
type: String,
|
|
931
|
-
default: w.NONE,
|
|
932
|
-
validator: (e) => Object.values(w).includes(e)
|
|
933
|
-
},
|
|
934
|
-
/**
|
|
935
|
-
* Applies selected styles to the list item
|
|
936
|
-
*/
|
|
937
|
-
selected: {
|
|
938
|
-
type: Boolean,
|
|
939
|
-
default: !1
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
emits: [
|
|
943
|
-
/**
|
|
944
|
-
* Key down event
|
|
945
|
-
*
|
|
946
|
-
* @event keydown
|
|
947
|
-
* @type {KeyboardEvent}
|
|
948
|
-
*/
|
|
949
|
-
"keydown",
|
|
950
|
-
/**
|
|
951
|
-
* Native mouse move event
|
|
952
|
-
*
|
|
953
|
-
* @event mousemove
|
|
954
|
-
* @type {MouseEvent}
|
|
955
|
-
*/
|
|
956
|
-
"mousemove",
|
|
957
|
-
/**
|
|
958
|
-
* Native mouse leave event
|
|
959
|
-
*
|
|
960
|
-
* @event mouseleave
|
|
961
|
-
* @type {MouseEvent}
|
|
962
|
-
*/
|
|
963
|
-
"mouseleave",
|
|
964
|
-
/**
|
|
965
|
-
* Mouse down event
|
|
966
|
-
*
|
|
967
|
-
* @event mousedown
|
|
968
|
-
*/
|
|
969
|
-
"mousedown"
|
|
970
|
-
],
|
|
971
|
-
data() {
|
|
972
|
-
return {
|
|
973
|
-
injected: !1,
|
|
974
|
-
mouseHighlighted: !1
|
|
975
|
-
};
|
|
976
|
-
},
|
|
977
|
-
computed: {
|
|
978
|
-
listItemType() {
|
|
979
|
-
switch (this.type) {
|
|
980
|
-
case D.DEFAULT:
|
|
981
|
-
return $;
|
|
982
|
-
default:
|
|
983
|
-
return null;
|
|
984
|
-
}
|
|
985
|
-
},
|
|
986
|
-
listItemListeners() {
|
|
987
|
-
return {
|
|
988
|
-
keydown: (e) => {
|
|
989
|
-
["enter", "space"].includes(e.code.toLowerCase()) && this.onClick(e), this.$emit("keydown", e);
|
|
990
|
-
},
|
|
991
|
-
mousemove: (e) => {
|
|
992
|
-
this.onMouseHover(e), this.$emit("mousemove", e);
|
|
993
|
-
},
|
|
994
|
-
mouseleave: (e) => {
|
|
995
|
-
this.onMouseLeave(e), this.$emit("mouseleave", e);
|
|
996
|
-
}
|
|
997
|
-
};
|
|
998
|
-
},
|
|
999
|
-
/**
|
|
1000
|
-
* For keyboard navigation, whether this item is currently highlighted.
|
|
1001
|
-
* An injected highlightId will override the default mouseover highlight.
|
|
1002
|
-
*/
|
|
1003
|
-
isHighlighted() {
|
|
1004
|
-
return this.isHoverable ? this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted : !1;
|
|
1005
|
-
},
|
|
1006
|
-
isFocusable() {
|
|
1007
|
-
return this.navigationType === w.TAB;
|
|
1008
|
-
},
|
|
1009
|
-
/**
|
|
1010
|
-
* Whether to apply hover styles.
|
|
1011
|
-
*/
|
|
1012
|
-
isHoverable() {
|
|
1013
|
-
return this.navigationType !== w.NONE;
|
|
1014
|
-
}
|
|
1015
|
-
},
|
|
1016
|
-
methods: {
|
|
1017
|
-
onClick(e) {
|
|
1018
|
-
this.$emit("click", e);
|
|
1019
|
-
},
|
|
1020
|
-
onMouseHover() {
|
|
1021
|
-
this.mouseHighlighted = !0;
|
|
1022
|
-
},
|
|
1023
|
-
onMouseLeave() {
|
|
1024
|
-
this.mouseHighlighted = !1;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
function rt(e, s, t, a, o, n) {
|
|
1029
|
-
const c = f("dt-icon");
|
|
1030
|
-
return i(), u(C(t.elementType), T({
|
|
1031
|
-
id: t.id,
|
|
1032
|
-
class: ["dt-list-item", {
|
|
1033
|
-
"dt-list-item--focusable": n.isFocusable,
|
|
1034
|
-
"dt-list-item--highlighted": n.isHighlighted,
|
|
1035
|
-
"dt-list-item--static": !n.isHoverable
|
|
1036
|
-
}],
|
|
1037
|
-
tabindex: n.isFocusable ? 0 : -1,
|
|
1038
|
-
role: t.role,
|
|
1039
|
-
"aria-selected": n.isHighlighted
|
|
1040
|
-
}, z(n.listItemListeners)), {
|
|
1041
|
-
default: h(() => [
|
|
1042
|
-
n.listItemType ? (i(), u(C(n.listItemType), { key: 0 }, re({ _: 2 }, [
|
|
1043
|
-
de(e.$slots, (_, v) => ({
|
|
1044
|
-
name: v,
|
|
1045
|
-
fn: h(() => [
|
|
1046
|
-
l(e.$slots, v)
|
|
1047
|
-
])
|
|
1048
|
-
})),
|
|
1049
|
-
t.selected ? {
|
|
1050
|
-
name: "selected",
|
|
1051
|
-
fn: h(() => [
|
|
1052
|
-
g(c, {
|
|
1053
|
-
name: "check",
|
|
1054
|
-
size: "400",
|
|
1055
|
-
class: "dt-list-item--selected-icon"
|
|
1056
|
-
})
|
|
1057
|
-
]),
|
|
1058
|
-
key: "0"
|
|
1059
|
-
} : void 0
|
|
1060
|
-
]), 1024)) : l(e.$slots, "default", { key: 1 })
|
|
1061
|
-
]),
|
|
1062
|
-
_: 3
|
|
1063
|
-
}, 16, ["id", "class", "tabindex", "role", "aria-selected"]);
|
|
1064
|
-
}
|
|
1065
|
-
const Ft = /* @__PURE__ */ y(lt, [["render", rt]]), q = {
|
|
1066
|
-
none: void 0,
|
|
1067
|
-
small: "d-p4",
|
|
1068
|
-
medium: "d-p8",
|
|
1069
|
-
large: "d-p16"
|
|
1070
|
-
}, dt = {
|
|
1071
|
-
none: void 0,
|
|
1072
|
-
small: "d-pl4",
|
|
1073
|
-
medium: "d-pl8",
|
|
1074
|
-
large: "d-pl16"
|
|
1075
|
-
}, ct = ["dialog", "menu", "listbox", "tree", "grid"], ut = ["", "anchor"], ht = ["none", "dialog", "first"], ft = ["parent", "body"], pt = [
|
|
1076
|
-
...se
|
|
1077
|
-
], mt = {
|
|
1078
|
-
name: "PopoverHeaderFooter",
|
|
1079
|
-
components: {
|
|
1080
|
-
DtButton: F,
|
|
1081
|
-
DtIcon: I
|
|
1082
|
-
},
|
|
1083
|
-
props: {
|
|
1084
|
-
// eslint-disable-next-line vue/require-default-prop
|
|
1085
|
-
type: {
|
|
1086
|
-
type: String,
|
|
1087
|
-
validator: function(e) {
|
|
1088
|
-
return ["header", "footer"].includes(e);
|
|
1089
|
-
}
|
|
1090
|
-
},
|
|
1091
|
-
/**
|
|
1092
|
-
* Additional class name for the content wrapper element.
|
|
1093
|
-
*/
|
|
1094
|
-
contentClass: {
|
|
1095
|
-
type: [String, Array, Object],
|
|
1096
|
-
default: ""
|
|
1097
|
-
},
|
|
1098
|
-
/**
|
|
1099
|
-
* Determines visibility for close button
|
|
1100
|
-
* @values true, false
|
|
1101
|
-
*/
|
|
1102
|
-
showCloseButton: {
|
|
1103
|
-
type: Boolean,
|
|
1104
|
-
default: !1
|
|
1105
|
-
},
|
|
1106
|
-
/**
|
|
1107
|
-
* A set of props to be passed into the popover's header close button.
|
|
1108
|
-
* Requires an 'ariaLabel' property.
|
|
1109
|
-
*/
|
|
1110
|
-
closeButtonProps: {
|
|
1111
|
-
type: Object,
|
|
1112
|
-
default: () => {
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
},
|
|
1116
|
-
emits: [
|
|
1117
|
-
/**
|
|
1118
|
-
* Emitted when popover is closed
|
|
1119
|
-
*
|
|
1120
|
-
* @event close
|
|
1121
|
-
* @type { Boolean }
|
|
1122
|
-
*/
|
|
1123
|
-
"close"
|
|
1124
|
-
],
|
|
1125
|
-
data() {
|
|
1126
|
-
return {
|
|
1127
|
-
hasSlotContent: L
|
|
1128
|
-
};
|
|
1129
|
-
},
|
|
1130
|
-
methods: {
|
|
1131
|
-
focusCloseButton() {
|
|
1132
|
-
var s;
|
|
1133
|
-
const e = (s = this.$refs["popover__close-button"]) == null ? void 0 : s.$el;
|
|
1134
|
-
e == null || e.focus();
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
};
|
|
1138
|
-
function yt(e, s, t, a, o, n) {
|
|
1139
|
-
const c = f("dt-icon"), _ = f("dt-button");
|
|
1140
|
-
return i(), r("div", {
|
|
1141
|
-
"data-qa": "dt-popover-header-footer",
|
|
1142
|
-
class: p({
|
|
1143
|
-
"d-popover__header": t.type === "header",
|
|
1144
|
-
"d-popover__footer": t.type === "footer"
|
|
1145
|
-
})
|
|
1146
|
-
}, [
|
|
1147
|
-
o.hasSlotContent(e.$slots.content) ? (i(), r("div", {
|
|
1148
|
-
key: 0,
|
|
1149
|
-
"data-qa": "dt-popover-header-footer-content",
|
|
1150
|
-
class: p(["d-to-ellipsis", "d-w100p", t.contentClass])
|
|
1151
|
-
}, [
|
|
1152
|
-
l(e.$slots, "content")
|
|
1153
|
-
], 2)) : d("", !0),
|
|
1154
|
-
t.showCloseButton ? (i(), u(_, T({
|
|
1155
|
-
key: 1,
|
|
1156
|
-
ref: "popover__close-button",
|
|
1157
|
-
"data-qa": "dt-popover-close",
|
|
1158
|
-
class: "d-p6 d-mr6 d-bc-transparent",
|
|
1159
|
-
importance: "outlined",
|
|
1160
|
-
kind: "muted",
|
|
1161
|
-
circle: ""
|
|
1162
|
-
}, t.closeButtonProps, {
|
|
1163
|
-
onClick: s[0] || (s[0] = (v) => e.$emit("close"))
|
|
1164
|
-
}), {
|
|
1165
|
-
icon: h(() => [
|
|
1166
|
-
g(c, {
|
|
1167
|
-
name: "close",
|
|
1168
|
-
size: "300"
|
|
1169
|
-
})
|
|
1170
|
-
]),
|
|
1171
|
-
_: 1
|
|
1172
|
-
}, 16)) : d("", !0)
|
|
1173
|
-
], 2);
|
|
1174
|
-
}
|
|
1175
|
-
const _t = /* @__PURE__ */ y(mt, [["render", yt]]);
|
|
1176
|
-
const vt = {
|
|
1177
|
-
name: "DtPopover",
|
|
1178
|
-
/********************
|
|
1179
|
-
* CHILD COMPONENTS *
|
|
1180
|
-
********************/
|
|
1181
|
-
components: {
|
|
1182
|
-
SrOnlyCloseButton: W,
|
|
1183
|
-
DtLazyShow: ne,
|
|
1184
|
-
PopoverHeaderFooter: _t
|
|
1185
|
-
},
|
|
1186
|
-
mixins: [Ye, B],
|
|
1187
|
-
props: {
|
|
1188
|
-
/**
|
|
1189
|
-
* Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.
|
|
1190
|
-
* If you set this value, the default trigger behavior will be disabled, and you can control it as you need.
|
|
1191
|
-
* Supports v-model
|
|
1192
|
-
* @values null, true, false
|
|
1193
|
-
*/
|
|
1194
|
-
open: {
|
|
1195
|
-
type: Boolean,
|
|
1196
|
-
default: null
|
|
1197
|
-
},
|
|
1198
|
-
/**
|
|
1199
|
-
* Opens the popover on right click (context menu). If you set this value to `true`,
|
|
1200
|
-
* the default trigger behavior will be disabled.
|
|
1201
|
-
* @values true, false
|
|
1202
|
-
*/
|
|
1203
|
-
openOnContext: {
|
|
1204
|
-
type: Boolean,
|
|
1205
|
-
default: !1
|
|
1206
|
-
},
|
|
1207
|
-
/**
|
|
1208
|
-
* Element type (tag name) of the root element of the component.
|
|
1209
|
-
*/
|
|
1210
|
-
elementType: {
|
|
1211
|
-
type: String,
|
|
1212
|
-
default: "div"
|
|
1213
|
-
},
|
|
1214
|
-
/**
|
|
1215
|
-
* Named transition when the content display is toggled.
|
|
1216
|
-
* @see DtLazyShow
|
|
1217
|
-
*/
|
|
1218
|
-
transition: {
|
|
1219
|
-
type: String,
|
|
1220
|
-
default: "fade"
|
|
1221
|
-
},
|
|
1222
|
-
/**
|
|
1223
|
-
* ARIA role for the content of the popover. Defaults to "dialog".
|
|
1224
|
-
* <a class="d-link" href="https://www.w3.org/TR/wai-aria/#aria-haspopup" target="_blank">aria-haspopup</a>
|
|
1225
|
-
*/
|
|
1226
|
-
role: {
|
|
1227
|
-
type: String,
|
|
1228
|
-
default: "dialog",
|
|
1229
|
-
validator: (e) => ct.includes(e)
|
|
1230
|
-
},
|
|
1231
|
-
/**
|
|
1232
|
-
* ID of the element that serves as the label for the popover content.
|
|
1233
|
-
* Defaults to the "anchor" element; this exists to provide a different
|
|
1234
|
-
* ID of the label element if, for example, the anchor slot contains
|
|
1235
|
-
* other items that do not serve as a label. You should provide this
|
|
1236
|
-
* or ariaLabel, but not both.
|
|
1237
|
-
*/
|
|
1238
|
-
ariaLabelledby: {
|
|
1239
|
-
type: String,
|
|
1240
|
-
default: null
|
|
1241
|
-
},
|
|
1242
|
-
/**
|
|
1243
|
-
* Descriptive label for the popover content. You should provide this
|
|
1244
|
-
* or ariaLabelledby, but not both.
|
|
1245
|
-
*/
|
|
1246
|
-
ariaLabel: {
|
|
1247
|
-
type: String,
|
|
1248
|
-
default: null
|
|
1249
|
-
},
|
|
1250
|
-
/**
|
|
1251
|
-
* A set of props to be passed into the popover's header close button.
|
|
1252
|
-
* Requires an 'ariaLabel' property, when the header popover is visible
|
|
1253
|
-
*/
|
|
1254
|
-
closeButtonProps: {
|
|
1255
|
-
type: Object,
|
|
1256
|
-
default: () => ({})
|
|
1257
|
-
},
|
|
1258
|
-
/**
|
|
1259
|
-
* Padding size class for the popover content.
|
|
1260
|
-
* @values none, small, medium, large
|
|
1261
|
-
*/
|
|
1262
|
-
padding: {
|
|
1263
|
-
type: String,
|
|
1264
|
-
default: "large",
|
|
1265
|
-
validator: (e) => Object.keys(q).some((s) => s === e)
|
|
1266
|
-
},
|
|
1267
|
-
/**
|
|
1268
|
-
* Additional class name for the content wrapper element.
|
|
1269
|
-
*/
|
|
1270
|
-
contentClass: {
|
|
1271
|
-
type: [String, Array, Object],
|
|
1272
|
-
default: ""
|
|
1273
|
-
},
|
|
1274
|
-
/**
|
|
1275
|
-
* Width configuration for the popover content. When its value is 'anchor',
|
|
1276
|
-
* the popover content will have the same width as the anchor.
|
|
1277
|
-
* @values null, anchor
|
|
1278
|
-
*/
|
|
1279
|
-
contentWidth: {
|
|
1280
|
-
type: String,
|
|
1281
|
-
default: "",
|
|
1282
|
-
validator: (e) => ut.includes(e)
|
|
1283
|
-
},
|
|
1284
|
-
/**
|
|
1285
|
-
* Whether to apply transition on initial render in the content lazy show component.
|
|
1286
|
-
*/
|
|
1287
|
-
contentAppear: {
|
|
1288
|
-
type: Boolean,
|
|
1289
|
-
default: null
|
|
1290
|
-
},
|
|
1291
|
-
/**
|
|
1292
|
-
* Tabindex value for the content. Passing null, no tabindex attribute will be set.
|
|
1293
|
-
*/
|
|
1294
|
-
contentTabindex: {
|
|
1295
|
-
type: Number || null,
|
|
1296
|
-
default: -1
|
|
1297
|
-
},
|
|
1298
|
-
/**
|
|
1299
|
-
* External anchor id to use in those cases the anchor can't be provided via the slot.
|
|
1300
|
-
* For instance, using the combobox's input as the anchor for the popover.
|
|
1301
|
-
*/
|
|
1302
|
-
externalAnchor: {
|
|
1303
|
-
type: String,
|
|
1304
|
-
default: ""
|
|
1305
|
-
},
|
|
1306
|
-
/**
|
|
1307
|
-
* The id of the tooltip
|
|
1308
|
-
*/
|
|
1309
|
-
id: {
|
|
1310
|
-
type: String,
|
|
1311
|
-
default() {
|
|
1312
|
-
return R();
|
|
1313
|
-
}
|
|
1314
|
-
},
|
|
1315
|
-
/**
|
|
1316
|
-
* Displaces the content box from its anchor element
|
|
1317
|
-
* by the specified number of pixels.
|
|
1318
|
-
* <a
|
|
1319
|
-
* class="d-link"
|
|
1320
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#offset"
|
|
1321
|
-
* target="_blank"
|
|
1322
|
-
* >
|
|
1323
|
-
* Tippy.js docs
|
|
1324
|
-
* </a>
|
|
1325
|
-
*/
|
|
1326
|
-
offset: {
|
|
1327
|
-
type: Array,
|
|
1328
|
-
default: () => [0, 4]
|
|
1329
|
-
},
|
|
1330
|
-
/**
|
|
1331
|
-
* Determines if the popover hides upon clicking the
|
|
1332
|
-
* anchor or outside the content box.
|
|
1333
|
-
* @values true, false
|
|
1334
|
-
*/
|
|
1335
|
-
hideOnClick: {
|
|
1336
|
-
type: Boolean,
|
|
1337
|
-
default: !0
|
|
1338
|
-
},
|
|
1339
|
-
/**
|
|
1340
|
-
* Determines modal state. If enabled popover has a modal overlay
|
|
1341
|
-
* preventing interaction with elements below it, but it is invisible.
|
|
1342
|
-
* @values true, false
|
|
1343
|
-
*/
|
|
1344
|
-
modal: {
|
|
1345
|
-
type: Boolean,
|
|
1346
|
-
default: !0
|
|
1347
|
-
},
|
|
1348
|
-
/**
|
|
1349
|
-
* If the popover does not fit in the direction described by "placement",
|
|
1350
|
-
* it will attempt to change its direction to the "fallbackPlacements".
|
|
1351
|
-
* <a
|
|
1352
|
-
* class="d-link"
|
|
1353
|
-
* href="https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements"
|
|
1354
|
-
* target="_blank"
|
|
1355
|
-
* >
|
|
1356
|
-
* Popper.js docs
|
|
1357
|
-
* </a>
|
|
1358
|
-
* */
|
|
1359
|
-
fallbackPlacements: {
|
|
1360
|
-
type: Array,
|
|
1361
|
-
default: () => ["auto"]
|
|
1362
|
-
},
|
|
1363
|
-
/**
|
|
1364
|
-
* The direction the popover displays relative to the anchor.
|
|
1365
|
-
* <a
|
|
1366
|
-
* class="d-link"
|
|
1367
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#placement"
|
|
1368
|
-
* target="_blank"
|
|
1369
|
-
* >
|
|
1370
|
-
* Tippy.js docs
|
|
1371
|
-
* </a>
|
|
1372
|
-
* @values top, top-start, top-end,
|
|
1373
|
-
* right, right-start, right-end,
|
|
1374
|
-
* left, left-start, left-end,
|
|
1375
|
-
* bottom, bottom-start, bottom-end,
|
|
1376
|
-
* auto, auto-start, auto-end
|
|
1377
|
-
*/
|
|
1378
|
-
placement: {
|
|
1379
|
-
type: String,
|
|
1380
|
-
default: "bottom-end"
|
|
1381
|
-
},
|
|
1382
|
-
/**
|
|
1383
|
-
* If set to false the dialog will display over top of the anchor when there is insufficient space.
|
|
1384
|
-
* If set to true it will never move from its position relative to the anchor and will clip instead.
|
|
1385
|
-
* <a
|
|
1386
|
-
* class="d-link"
|
|
1387
|
-
* href="https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether"
|
|
1388
|
-
* target="_blank"
|
|
1389
|
-
* >
|
|
1390
|
-
* Popper.js docs
|
|
1391
|
-
* </a>
|
|
1392
|
-
* @values true, false
|
|
1393
|
-
*/
|
|
1394
|
-
tether: {
|
|
1395
|
-
type: Boolean,
|
|
1396
|
-
default: !0
|
|
1397
|
-
},
|
|
1398
|
-
/**
|
|
1399
|
-
* If the popover sticks to the anchor. This is usually not needed, but can be needed
|
|
1400
|
-
* if the reference element's position is animating, or to automatically update the popover
|
|
1401
|
-
* position in those cases the DOM layout changes the reference element's position.
|
|
1402
|
-
* `true` enables it, `reference` only checks the "reference" rect for changes and `popper` only
|
|
1403
|
-
* checks the "popper" rect for changes.
|
|
1404
|
-
* <a
|
|
1405
|
-
* class="d-link"
|
|
1406
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#sticky"
|
|
1407
|
-
* target="_blank"
|
|
1408
|
-
* >
|
|
1409
|
-
* Tippy.js docs
|
|
1410
|
-
* </a>
|
|
1411
|
-
* @values true, false, reference, popper
|
|
1412
|
-
*/
|
|
1413
|
-
sticky: {
|
|
1414
|
-
type: [Boolean, String],
|
|
1415
|
-
default: !1,
|
|
1416
|
-
validator: (e) => pt.includes(e)
|
|
1417
|
-
},
|
|
1418
|
-
/**
|
|
1419
|
-
* Determines maximum height for the popover before overflow.
|
|
1420
|
-
* Possible units rem|px|em
|
|
1421
|
-
*/
|
|
1422
|
-
maxHeight: {
|
|
1423
|
-
type: String,
|
|
1424
|
-
default: ""
|
|
1425
|
-
},
|
|
1426
|
-
/**
|
|
1427
|
-
* Determines maximum width for the popover before overflow.
|
|
1428
|
-
* Possible units rem|px|%|em
|
|
1429
|
-
*/
|
|
1430
|
-
maxWidth: {
|
|
1431
|
-
type: String,
|
|
1432
|
-
default: ""
|
|
1433
|
-
},
|
|
1434
|
-
/**
|
|
1435
|
-
* Determines visibility for close button
|
|
1436
|
-
* @values true, false
|
|
1437
|
-
*/
|
|
1438
|
-
showCloseButton: {
|
|
1439
|
-
type: Boolean,
|
|
1440
|
-
default: !1
|
|
1441
|
-
},
|
|
1442
|
-
/**
|
|
1443
|
-
* Additional class name for the header content wrapper element.
|
|
1444
|
-
*/
|
|
1445
|
-
headerClass: {
|
|
1446
|
-
type: [String, Array, Object],
|
|
1447
|
-
default: ""
|
|
1448
|
-
},
|
|
1449
|
-
/**
|
|
1450
|
-
* Additional class name for the footer content wrapper element.
|
|
1451
|
-
*/
|
|
1452
|
-
footerClass: {
|
|
1453
|
-
type: [String, Array, Object],
|
|
1454
|
-
default: ""
|
|
1455
|
-
},
|
|
1456
|
-
/**
|
|
1457
|
-
* Additional class name for the dialog element.
|
|
1458
|
-
*/
|
|
1459
|
-
dialogClass: {
|
|
1460
|
-
type: [String, Array, Object],
|
|
1461
|
-
default: ""
|
|
1462
|
-
},
|
|
1463
|
-
/**
|
|
1464
|
-
* The element that is focused when the popover is opened. This can be an
|
|
1465
|
-
* HTMLElement within the popover, a string starting with '#' which will
|
|
1466
|
-
* find the element by ID. 'first' which will automatically focus
|
|
1467
|
-
* the first element, or 'dialog' which will focus the dialog window itself.
|
|
1468
|
-
* If the dialog is modal this prop cannot be 'none'.
|
|
1469
|
-
* @values none, dialog, first
|
|
1470
|
-
*/
|
|
1471
|
-
initialFocusElement: {
|
|
1472
|
-
type: [String, HTMLElement],
|
|
1473
|
-
default: "first",
|
|
1474
|
-
validator: (e) => ht.includes(e) || e instanceof HTMLElement || e.startsWith("#")
|
|
1475
|
-
},
|
|
1476
|
-
/**
|
|
1477
|
-
* If the popover should open pressing up or down arrow key on the anchor element.
|
|
1478
|
-
* This can be set when not passing open prop.
|
|
1479
|
-
* @values true, false
|
|
1480
|
-
*/
|
|
1481
|
-
openWithArrowKeys: {
|
|
1482
|
-
type: Boolean,
|
|
1483
|
-
default: !1
|
|
1484
|
-
},
|
|
1485
|
-
/**
|
|
1486
|
-
* Sets the element to which the popover is going to append to.
|
|
1487
|
-
* 'body' will append to the nearest body (supports shadow DOM).
|
|
1488
|
-
* @values 'body', 'parent', HTMLElement,
|
|
1489
|
-
*/
|
|
1490
|
-
appendTo: {
|
|
1491
|
-
type: [HTMLElement, String],
|
|
1492
|
-
default: "body",
|
|
1493
|
-
validator: (e) => ft.includes(e) || e instanceof HTMLElement
|
|
1494
|
-
}
|
|
1495
|
-
},
|
|
1496
|
-
emits: [
|
|
1497
|
-
/**
|
|
1498
|
-
* Native keydown event
|
|
1499
|
-
*
|
|
1500
|
-
* @event keydown
|
|
1501
|
-
* @type {KeyboardEvent}
|
|
1502
|
-
*/
|
|
1503
|
-
"keydown",
|
|
1504
|
-
/**
|
|
1505
|
-
* Event fired to sync the open prop with the parent component
|
|
1506
|
-
* @event update:open
|
|
1507
|
-
*/
|
|
1508
|
-
"update:open",
|
|
1509
|
-
/**
|
|
1510
|
-
* Emitted when popover is shown or hidden
|
|
1511
|
-
*
|
|
1512
|
-
* @event opened
|
|
1513
|
-
* @type {Boolean | Array}
|
|
1514
|
-
*/
|
|
1515
|
-
"opened"
|
|
1516
|
-
],
|
|
1517
|
-
data() {
|
|
1518
|
-
return {
|
|
1519
|
-
POPOVER_PADDING_CLASSES: q,
|
|
1520
|
-
POPOVER_HEADER_FOOTER_PADDING_CLASSES: dt,
|
|
1521
|
-
intersectionObserver: null,
|
|
1522
|
-
isOutsideViewport: !1,
|
|
1523
|
-
isOpen: !1,
|
|
1524
|
-
toAppear: !1,
|
|
1525
|
-
anchorEl: null,
|
|
1526
|
-
popoverContentEl: null,
|
|
1527
|
-
hasSlotContent: L
|
|
1528
|
-
};
|
|
1529
|
-
},
|
|
1530
|
-
computed: {
|
|
1531
|
-
popoverListeners() {
|
|
1532
|
-
return {
|
|
1533
|
-
keydown: (e) => {
|
|
1534
|
-
this.onKeydown(e);
|
|
1535
|
-
},
|
|
1536
|
-
"after-leave": (e) => {
|
|
1537
|
-
this.onLeaveTransitionComplete();
|
|
1538
|
-
},
|
|
1539
|
-
"after-enter": (e) => {
|
|
1540
|
-
this.onEnterTransitionComplete();
|
|
1541
|
-
}
|
|
1542
|
-
};
|
|
1543
|
-
},
|
|
1544
|
-
calculatedMaxHeight() {
|
|
1545
|
-
return this.isOutsideViewport && this.modal ? "calc(100vh - var(--dt-space-300))" : this.maxHeight;
|
|
1546
|
-
},
|
|
1547
|
-
labelledBy() {
|
|
1548
|
-
return this.ariaLabelledby || !this.ariaLabel && R("DtPopover__anchor");
|
|
1549
|
-
}
|
|
1550
|
-
},
|
|
1551
|
-
watch: {
|
|
1552
|
-
$props: {
|
|
1553
|
-
immediate: !0,
|
|
1554
|
-
deep: !0,
|
|
1555
|
-
handler() {
|
|
1556
|
-
this.validateProps();
|
|
1557
|
-
}
|
|
1558
|
-
},
|
|
1559
|
-
modal(e) {
|
|
1560
|
-
var s;
|
|
1561
|
-
(s = this.tip) == null || s.setProps({
|
|
1562
|
-
zIndex: e ? 650 : this.calculateAnchorZindex()
|
|
1563
|
-
});
|
|
1564
|
-
},
|
|
1565
|
-
offset(e) {
|
|
1566
|
-
var s;
|
|
1567
|
-
(s = this.tip) == null || s.setProps({
|
|
1568
|
-
offset: e
|
|
1569
|
-
});
|
|
1570
|
-
},
|
|
1571
|
-
sticky(e) {
|
|
1572
|
-
var s;
|
|
1573
|
-
(s = this.tip) == null || s.setProps({
|
|
1574
|
-
sticky: e
|
|
1575
|
-
});
|
|
1576
|
-
},
|
|
1577
|
-
fallbackPlacements() {
|
|
1578
|
-
var e;
|
|
1579
|
-
(e = this.tip) == null || e.setProps({
|
|
1580
|
-
popperOptions: this.popperOptions()
|
|
1581
|
-
});
|
|
1582
|
-
},
|
|
1583
|
-
tether() {
|
|
1584
|
-
var e;
|
|
1585
|
-
(e = this.tip) == null || e.setProps({
|
|
1586
|
-
popperOptions: this.popperOptions()
|
|
1587
|
-
});
|
|
1588
|
-
},
|
|
1589
|
-
placement(e) {
|
|
1590
|
-
var s;
|
|
1591
|
-
(s = this.tip) == null || s.setProps({
|
|
1592
|
-
placement: e
|
|
1593
|
-
});
|
|
1594
|
-
},
|
|
1595
|
-
open: {
|
|
1596
|
-
handler: function(e) {
|
|
1597
|
-
e !== null && (this.isOpen = e), e === !0 && (this.toAppear = !0);
|
|
1598
|
-
},
|
|
1599
|
-
immediate: !0
|
|
1600
|
-
},
|
|
1601
|
-
contentAppear: {
|
|
1602
|
-
handler: function(e) {
|
|
1603
|
-
e !== null && (this.toAppear = e);
|
|
1604
|
-
}
|
|
1605
|
-
},
|
|
1606
|
-
isOpen(e, s) {
|
|
1607
|
-
e ? (this.initTippyInstance(), this.tip.show()) : !e && s !== e && (this.removeEventListeners(), this.tip.hide());
|
|
1608
|
-
}
|
|
1609
|
-
},
|
|
1610
|
-
mounted() {
|
|
1611
|
-
const e = this.externalAnchor ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`) : null;
|
|
1612
|
-
this.anchorEl = e ?? this.$refs.anchor.children[0], this.popoverContentEl = this.$refs.content.$el, this.isOpen && (this.initTippyInstance(), this.tip.show()), this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport), this.intersectionObserver.observe(this.popoverContentEl);
|
|
1613
|
-
},
|
|
1614
|
-
beforeUnmount() {
|
|
1615
|
-
var e;
|
|
1616
|
-
(e = this.tip) == null || e.destroy(), this.intersectionObserver.disconnect(), this.removeReferences(), this.removeEventListeners();
|
|
1617
|
-
},
|
|
1618
|
-
/******************
|
|
1619
|
-
* METHODS *
|
|
1620
|
-
******************/
|
|
1621
|
-
methods: {
|
|
1622
|
-
hasIntersectedViewport(e) {
|
|
1623
|
-
var a;
|
|
1624
|
-
const s = (a = e == null ? void 0 : e[0]) == null ? void 0 : a.target;
|
|
1625
|
-
if (!s)
|
|
1626
|
-
return;
|
|
1627
|
-
const t = oe(s);
|
|
1628
|
-
this.isOutsideViewport = t.bottom || t.top;
|
|
1629
|
-
},
|
|
1630
|
-
popperOptions() {
|
|
1631
|
-
return ie({
|
|
1632
|
-
fallbackPlacements: this.fallbackPlacements,
|
|
1633
|
-
tether: this.tether,
|
|
1634
|
-
hasHideModifierEnabled: !0
|
|
1635
|
-
});
|
|
1636
|
-
},
|
|
1637
|
-
validateProps() {
|
|
1638
|
-
this.modal && this.initialFocusElement === "none" && console.error('If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement');
|
|
1639
|
-
},
|
|
1640
|
-
calculateAnchorZindex() {
|
|
1641
|
-
var e;
|
|
1642
|
-
return this.$el.getRootNode().querySelector('.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"]') || // Special case because we don't have any dialtone drawer component yet. Render at 650 when
|
|
1643
|
-
// anchor of popover is within a drawer.
|
|
1644
|
-
(e = this.anchorEl) != null && e.closest(".d-zi-drawer") ? 650 : 300;
|
|
1645
|
-
},
|
|
1646
|
-
defaultToggleOpen(e) {
|
|
1647
|
-
var s, t, a;
|
|
1648
|
-
if (!this.openOnContext && (this.open === null || this.open === void 0)) {
|
|
1649
|
-
if (!((s = this.anchorEl) != null && s.contains(e.target)) && !((t = this.anchorEl) != null && t.isEqualNode(e.target)) || (a = this.anchorEl) != null && a.disabled)
|
|
1650
|
-
return;
|
|
1651
|
-
this.toggleOpen();
|
|
1652
|
-
}
|
|
1653
|
-
},
|
|
1654
|
-
async onContext(e) {
|
|
1655
|
-
this.openOnContext && (e.preventDefault(), this.isOpen = !0, await this.$nextTick(), this.tip.setProps({
|
|
1656
|
-
placement: "right-start",
|
|
1657
|
-
getReferenceClientRect: () => ({
|
|
1658
|
-
width: 0,
|
|
1659
|
-
height: 0,
|
|
1660
|
-
top: e.clientY,
|
|
1661
|
-
bottom: e.clientY,
|
|
1662
|
-
left: e.clientX,
|
|
1663
|
-
right: e.clientX
|
|
1664
|
-
})
|
|
1665
|
-
}));
|
|
1666
|
-
},
|
|
1667
|
-
toggleOpen() {
|
|
1668
|
-
this.isOpen = !this.isOpen;
|
|
1669
|
-
},
|
|
1670
|
-
onArrowKeyPress(e) {
|
|
1671
|
-
var s;
|
|
1672
|
-
this.open === null && (this.openWithArrowKeys && ((s = this.anchorEl) != null && s.contains(e.target)) && (this.isOpen || (this.isOpen = !0)), this.$emit("keydown", e));
|
|
1673
|
-
},
|
|
1674
|
-
addEventListeners() {
|
|
1675
|
-
window.addEventListener("dt-popover-close", this.closePopover), this.contentWidth === "anchor" && window.addEventListener("resize", this.onResize);
|
|
1676
|
-
},
|
|
1677
|
-
removeEventListeners() {
|
|
1678
|
-
window.removeEventListener("dt-popover-close", this.closePopover), this.contentWidth === "anchor" && window.removeEventListener("resize", this.onResize);
|
|
1679
|
-
},
|
|
1680
|
-
closePopover() {
|
|
1681
|
-
this.isOpen = !1;
|
|
1682
|
-
},
|
|
1683
|
-
/*
|
|
1684
|
-
* Prevents scrolling outside of the currently opened modal popover by:
|
|
1685
|
-
* - when anchor is not within another popover: setting the body to overflow: hidden
|
|
1686
|
-
* - when anchor is within another popover: set the popover dialog container to it's non-modal z-index
|
|
1687
|
-
* since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.
|
|
1688
|
-
**/
|
|
1689
|
-
preventScrolling() {
|
|
1690
|
-
var e;
|
|
1691
|
-
if (this.modal) {
|
|
1692
|
-
const s = (e = this.anchorEl) == null ? void 0 : e.closest("body, .tippy-box");
|
|
1693
|
-
s.tagName.toLowerCase() === "body" ? (s.classList.add("d-of-hidden"), this.tip.setProps({ offset: this.offset })) : s.classList.add("d-zi-popover");
|
|
1694
|
-
}
|
|
1695
|
-
},
|
|
1696
|
-
/*
|
|
1697
|
-
* Resets the prevent scrolling properties set in preventScrolling() back to normal.
|
|
1698
|
-
**/
|
|
1699
|
-
enableScrolling() {
|
|
1700
|
-
var s, t;
|
|
1701
|
-
const e = (s = this.anchorEl) == null ? void 0 : s.closest("body, .tippy-box");
|
|
1702
|
-
e && (((t = e.tagName) == null ? void 0 : t.toLowerCase()) === "body" ? (e.classList.remove("d-of-hidden"), this.tip.setProps({ offset: this.offset })) : e.classList.remove("d-zi-popover"));
|
|
1703
|
-
},
|
|
1704
|
-
removeReferences() {
|
|
1705
|
-
this.anchorEl = null, this.popoverContentEl = null, this.tip = null;
|
|
1706
|
-
},
|
|
1707
|
-
async onShow() {
|
|
1708
|
-
this.contentWidth === "anchor" && await this.setPopoverContentAnchorWidth(), this.contentWidth === null && (this.popoverContentEl.style.width = "auto"), this.addEventListeners();
|
|
1709
|
-
},
|
|
1710
|
-
async onLeaveTransitionComplete() {
|
|
1711
|
-
var e;
|
|
1712
|
-
this.modal && (await this.focusFirstElement(this.$refs.anchor), await this.$nextTick(), this.enableScrolling()), (e = this.tip) == null || e.unmount(), this.$emit("opened", !1), this.open !== null && this.$emit("update:open", !1);
|
|
1713
|
-
},
|
|
1714
|
-
async onEnterTransitionComplete() {
|
|
1715
|
-
this.focusInitialElement(), await this.$nextTick(), this.preventScrolling(), this.$emit("opened", !0, this.$refs.popover__content), this.open !== null && this.$emit("update:open", !0);
|
|
1716
|
-
},
|
|
1717
|
-
focusInitialElement() {
|
|
1718
|
-
this.initialFocusElement === "dialog" && this.$refs.content.$el.focus(), this.initialFocusElement.startsWith("#") && this.focusInitialElementById(), this.initialFocusElement === "first" && this.focusFirstElementIfNeeded(this.$refs.popover__content), this.initialFocusElement instanceof HTMLElement && this.initialFocusElement.focus();
|
|
1719
|
-
},
|
|
1720
|
-
focusInitialElementById() {
|
|
1721
|
-
var s, t, a;
|
|
1722
|
-
const e = (t = (s = this.$refs.content) == null ? void 0 : s.$el) == null ? void 0 : t.querySelector(this.initialFocusElement);
|
|
1723
|
-
e ? e.focus() : console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.'), e ? e.focus() : (a = this.$refs.content) == null || a.$el.focus();
|
|
1724
|
-
},
|
|
1725
|
-
onResize() {
|
|
1726
|
-
this.closePopover();
|
|
1727
|
-
},
|
|
1728
|
-
onClickOutside() {
|
|
1729
|
-
if (!this.hideOnClick)
|
|
1730
|
-
return;
|
|
1731
|
-
this.popoverContentEl.querySelector(".d-popover__anchor--opened") || this.closePopover();
|
|
1732
|
-
},
|
|
1733
|
-
onKeydown(e) {
|
|
1734
|
-
e.key === "Tab" && this.modal && this.focusTrappedTabPress(e, this.popoverContentEl), e.key === "Escape" && this.closePopover(), this.$emit("keydown", e);
|
|
1735
|
-
},
|
|
1736
|
-
async setPopoverContentAnchorWidth() {
|
|
1737
|
-
var e;
|
|
1738
|
-
await this.$nextTick(), this.popoverContentEl.style.width = `${(e = this.anchorEl) == null ? void 0 : e.clientWidth}px`;
|
|
1739
|
-
},
|
|
1740
|
-
focusFirstElementIfNeeded(e) {
|
|
1741
|
-
var t, a;
|
|
1742
|
-
this._getFocusableElements(e, !0).length !== 0 ? this.focusFirstElement(e) : this.showCloseButton ? (t = this.$refs.popover__header) == null || t.focusCloseButton() : (a = this.$refs.content) == null || a.$el.focus();
|
|
1743
|
-
},
|
|
1744
|
-
initTippyInstance() {
|
|
1745
|
-
var e, s;
|
|
1746
|
-
this.tip = ae(this.anchorEl, {
|
|
1747
|
-
popperOptions: this.popperOptions(),
|
|
1748
|
-
contentElement: this.popoverContentEl,
|
|
1749
|
-
placement: this.placement,
|
|
1750
|
-
offset: this.offset,
|
|
1751
|
-
sticky: this.sticky,
|
|
1752
|
-
appendTo: this.appendTo === "body" ? (s = (e = this.anchorEl) == null ? void 0 : e.getRootNode()) == null ? void 0 : s.querySelector("body") : this.appendTo,
|
|
1753
|
-
interactive: !0,
|
|
1754
|
-
trigger: "manual",
|
|
1755
|
-
// We have to manage hideOnClick functionality manually to handle
|
|
1756
|
-
// popover within popover situations.
|
|
1757
|
-
hideOnClick: !1,
|
|
1758
|
-
zIndex: this.modal ? 650 : this.calculateAnchorZindex(),
|
|
1759
|
-
onClickOutside: this.onClickOutside,
|
|
1760
|
-
onShow: this.onShow
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
}, gt = ["aria-hidden"], bt = ["id", "tabindex"];
|
|
1765
|
-
function St(e, s, t, a, o, n) {
|
|
1766
|
-
const c = f("popover-header-footer"), _ = f("sr-only-close-button"), v = f("dt-lazy-show");
|
|
1767
|
-
return i(), r("div", null, [
|
|
1768
|
-
t.modal && o.isOpen ? (i(), u(ce, {
|
|
1769
|
-
key: 0,
|
|
1770
|
-
to: "body"
|
|
1771
|
-
}, [
|
|
1772
|
-
b("div", {
|
|
1773
|
-
class: "d-modal--transparent",
|
|
1774
|
-
"aria-hidden": t.modal && o.isOpen ? "false" : "true",
|
|
1775
|
-
onClick: s[0] || (s[0] = P(() => {
|
|
1776
|
-
}, ["prevent", "stop"]))
|
|
1777
|
-
}, null, 8, gt)
|
|
1778
|
-
])) : d("", !0),
|
|
1779
|
-
(i(), u(C(t.elementType), {
|
|
1780
|
-
ref: "popover",
|
|
1781
|
-
class: p(["d-popover", { "d-popover__anchor--opened": o.isOpen }]),
|
|
1782
|
-
"data-qa": "dt-popover-container"
|
|
1783
|
-
}, {
|
|
1784
|
-
default: h(() => [
|
|
1785
|
-
b("div", {
|
|
1786
|
-
id: !t.ariaLabelledby && n.labelledBy,
|
|
1787
|
-
ref: "anchor",
|
|
1788
|
-
"data-qa": "dt-popover-anchor",
|
|
1789
|
-
tabindex: t.openOnContext ? 0 : void 0,
|
|
1790
|
-
onClickCapture: s[1] || (s[1] = (...m) => n.defaultToggleOpen && n.defaultToggleOpen(...m)),
|
|
1791
|
-
onContextmenu: s[2] || (s[2] = (...m) => n.onContext && n.onContext(...m)),
|
|
1792
|
-
onKeydown: [
|
|
1793
|
-
s[3] || (s[3] = E(P((...m) => n.onArrowKeyPress && n.onArrowKeyPress(...m), ["prevent"]), ["up"])),
|
|
1794
|
-
s[4] || (s[4] = E(P((...m) => n.onArrowKeyPress && n.onArrowKeyPress(...m), ["prevent"]), ["down"])),
|
|
1795
|
-
s[6] || (s[6] = E((m) => e.$emit("keydown", m), ["enter"])),
|
|
1796
|
-
s[7] || (s[7] = E((m) => e.$emit("keydown", m), ["space"]))
|
|
1797
|
-
],
|
|
1798
|
-
onKeydownCapture: s[5] || (s[5] = E((...m) => n.closePopover && n.closePopover(...m), ["escape"]))
|
|
1799
|
-
}, [
|
|
1800
|
-
l(e.$slots, "anchor", {
|
|
1801
|
-
attrs: {
|
|
1802
|
-
"aria-expanded": o.isOpen.toString(),
|
|
1803
|
-
"aria-controls": t.id,
|
|
1804
|
-
"aria-haspopup": t.role
|
|
1805
|
-
}
|
|
1806
|
-
})
|
|
1807
|
-
], 40, bt),
|
|
1808
|
-
g(v, T({
|
|
1809
|
-
id: t.id,
|
|
1810
|
-
ref: "content",
|
|
1811
|
-
role: t.role,
|
|
1812
|
-
"data-qa": "dt-popover",
|
|
1813
|
-
"aria-hidden": `${!o.isOpen}`,
|
|
1814
|
-
"aria-labelledby": n.labelledBy,
|
|
1815
|
-
"aria-label": t.ariaLabel,
|
|
1816
|
-
"aria-modal": `${!t.modal}`,
|
|
1817
|
-
transition: t.transition,
|
|
1818
|
-
show: o.isOpen,
|
|
1819
|
-
appear: o.toAppear,
|
|
1820
|
-
class: ["d-popover__dialog", { "d-popover__dialog--modal": t.modal }, t.dialogClass],
|
|
1821
|
-
style: {
|
|
1822
|
-
"max-height": n.calculatedMaxHeight,
|
|
1823
|
-
"max-width": t.maxWidth
|
|
1824
|
-
},
|
|
1825
|
-
css: e.$attrs.css,
|
|
1826
|
-
tabindex: t.contentTabindex
|
|
1827
|
-
}, z(n.popoverListeners)), {
|
|
1828
|
-
default: h(() => [
|
|
1829
|
-
o.hasSlotContent(e.$slots.headerContent) || t.showCloseButton ? (i(), u(c, {
|
|
1830
|
-
key: 0,
|
|
1831
|
-
ref: "popover__header",
|
|
1832
|
-
class: p(o.POPOVER_HEADER_FOOTER_PADDING_CLASSES[t.padding]),
|
|
1833
|
-
"content-class": t.headerClass,
|
|
1834
|
-
type: "header",
|
|
1835
|
-
"show-close-button": t.showCloseButton,
|
|
1836
|
-
"close-button-props": t.closeButtonProps,
|
|
1837
|
-
onClose: n.closePopover
|
|
1838
|
-
}, {
|
|
1839
|
-
content: h(() => [
|
|
1840
|
-
l(e.$slots, "headerContent", { close: n.closePopover })
|
|
1841
|
-
]),
|
|
1842
|
-
_: 3
|
|
1843
|
-
}, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : d("", !0),
|
|
1844
|
-
b("div", {
|
|
1845
|
-
ref: "popover__content",
|
|
1846
|
-
"data-qa": "dt-popover-content",
|
|
1847
|
-
class: p([
|
|
1848
|
-
"d-popover__content",
|
|
1849
|
-
o.POPOVER_PADDING_CLASSES[t.padding],
|
|
1850
|
-
t.contentClass
|
|
1851
|
-
])
|
|
1852
|
-
}, [
|
|
1853
|
-
l(e.$slots, "content", { close: n.closePopover })
|
|
1854
|
-
], 2),
|
|
1855
|
-
o.hasSlotContent(e.$slots.footerContent) ? (i(), u(c, {
|
|
1856
|
-
key: 1,
|
|
1857
|
-
ref: "popover__footer",
|
|
1858
|
-
type: "footer",
|
|
1859
|
-
class: p(o.POPOVER_HEADER_FOOTER_PADDING_CLASSES[t.padding]),
|
|
1860
|
-
"content-class": t.footerClass
|
|
1861
|
-
}, {
|
|
1862
|
-
content: h(() => [
|
|
1863
|
-
l(e.$slots, "footerContent", { close: n.closePopover })
|
|
1864
|
-
]),
|
|
1865
|
-
_: 3
|
|
1866
|
-
}, 8, ["class", "content-class"])) : d("", !0),
|
|
1867
|
-
e.showVisuallyHiddenClose ? (i(), u(_, {
|
|
1868
|
-
key: 2,
|
|
1869
|
-
"visually-hidden-close-label": e.visuallyHiddenCloseLabel,
|
|
1870
|
-
onClose: n.closePopover
|
|
1871
|
-
}, null, 8, ["visually-hidden-close-label", "onClose"])) : d("", !0)
|
|
1872
|
-
]),
|
|
1873
|
-
_: 3
|
|
1874
|
-
}, 16, ["id", "role", "aria-hidden", "aria-labelledby", "aria-label", "aria-modal", "transition", "show", "appear", "class", "style", "css", "tabindex"])
|
|
1875
|
-
]),
|
|
1876
|
-
_: 3
|
|
1877
|
-
}, 8, ["class"]))
|
|
1878
|
-
]);
|
|
1879
|
-
}
|
|
1880
|
-
const Bt = /* @__PURE__ */ y(vt, [["render", St]]), Et = {
|
|
1881
|
-
name: "DtNotice",
|
|
1882
|
-
components: {
|
|
1883
|
-
DtNoticeIcon: Re,
|
|
1884
|
-
DtNoticeContent: $e,
|
|
1885
|
-
DtNoticeAction: We
|
|
1886
|
-
},
|
|
1887
|
-
mixins: [B],
|
|
1888
|
-
props: {
|
|
1889
|
-
/**
|
|
1890
|
-
* Sets an ID on the title element of the component. Useful for aria-describedby
|
|
1891
|
-
* or aria-labelledby or any other reason you may need an id to refer to the title.
|
|
1892
|
-
*/
|
|
1893
|
-
titleId: {
|
|
1894
|
-
type: String,
|
|
1895
|
-
default: void 0
|
|
1896
|
-
},
|
|
1897
|
-
/**
|
|
1898
|
-
* Sets an ID on the content element of the component. Useful for aria-describedby
|
|
1899
|
-
* or aria-labelledby or any other reason you may need an id to refer to the content.
|
|
1900
|
-
*/
|
|
1901
|
-
contentId: {
|
|
1902
|
-
type: String,
|
|
1903
|
-
default: void 0
|
|
1904
|
-
},
|
|
1905
|
-
/**
|
|
1906
|
-
* Title header of the notice. This can be left blank to remove the title from the notice entirely.
|
|
1907
|
-
*/
|
|
1908
|
-
title: {
|
|
1909
|
-
type: String,
|
|
1910
|
-
default: ""
|
|
1911
|
-
},
|
|
1912
|
-
/**
|
|
1913
|
-
* Provides a role for the notice. 'status' is used to communicate a message. 'alert' is used to communicate an
|
|
1914
|
-
* important message that does not contain any interactive elements. 'alertdialog' is used to communicate an
|
|
1915
|
-
* important message that does contain interactive elements.
|
|
1916
|
-
* @values alert, alertdialog, status
|
|
1917
|
-
*/
|
|
1918
|
-
role: {
|
|
1919
|
-
type: String,
|
|
1920
|
-
default: "status",
|
|
1921
|
-
validate(e) {
|
|
1922
|
-
return we.includes(e);
|
|
1923
|
-
}
|
|
1924
|
-
},
|
|
1925
|
-
/**
|
|
1926
|
-
* Used in scenarios where the message needs to visually dominate the screen.
|
|
1927
|
-
* This will also change the aria role from status to alert.
|
|
1928
|
-
* @values true, false
|
|
1929
|
-
*/
|
|
1930
|
-
important: {
|
|
1931
|
-
type: Boolean,
|
|
1932
|
-
default: !1
|
|
1933
|
-
},
|
|
1934
|
-
/**
|
|
1935
|
-
* Severity level of the notice, sets the icon and background
|
|
1936
|
-
* @values base, error, info, success, warning
|
|
1937
|
-
*/
|
|
1938
|
-
kind: {
|
|
1939
|
-
type: String,
|
|
1940
|
-
default: "base",
|
|
1941
|
-
validate(e) {
|
|
1942
|
-
return M.includes(e);
|
|
1943
|
-
}
|
|
1944
|
-
},
|
|
1945
|
-
/**
|
|
1946
|
-
* Props for the notice close button.
|
|
1947
|
-
*/
|
|
1948
|
-
closeButtonProps: {
|
|
1949
|
-
type: Object,
|
|
1950
|
-
default: () => ({})
|
|
1951
|
-
},
|
|
1952
|
-
/**
|
|
1953
|
-
* Hides the close button from the notice
|
|
1954
|
-
* @values true, false
|
|
1955
|
-
*/
|
|
1956
|
-
hideClose: {
|
|
1957
|
-
type: Boolean,
|
|
1958
|
-
default: !1
|
|
1959
|
-
}
|
|
1960
|
-
},
|
|
1961
|
-
emits: [
|
|
1962
|
-
/**
|
|
1963
|
-
* Close button click event
|
|
1964
|
-
*
|
|
1965
|
-
* @event close
|
|
1966
|
-
*/
|
|
1967
|
-
"close",
|
|
1968
|
-
/**
|
|
1969
|
-
* Native button click event
|
|
1970
|
-
*
|
|
1971
|
-
* @event click
|
|
1972
|
-
* @type {PointerEvent | KeyboardEvent}
|
|
1973
|
-
*/
|
|
1974
|
-
"click"
|
|
1975
|
-
],
|
|
1976
|
-
computed: {
|
|
1977
|
-
noticeClass() {
|
|
1978
|
-
return [
|
|
1979
|
-
"d-notice",
|
|
1980
|
-
{
|
|
1981
|
-
error: "d-notice--error",
|
|
1982
|
-
info: "d-notice--info",
|
|
1983
|
-
success: "d-notice--success",
|
|
1984
|
-
warning: "d-notice--warning",
|
|
1985
|
-
base: "d-notice--base"
|
|
1986
|
-
}[this.kind],
|
|
1987
|
-
{ "d-notice--important": this.important }
|
|
1988
|
-
];
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
};
|
|
1992
|
-
function Ct(e, s, t, a, o, n) {
|
|
1993
|
-
const c = f("dt-notice-icon"), _ = f("dt-notice-content"), v = f("dt-notice-action");
|
|
1994
|
-
return i(), r("aside", {
|
|
1995
|
-
class: p(n.noticeClass),
|
|
1996
|
-
"data-qa": "notice"
|
|
1997
|
-
}, [
|
|
1998
|
-
g(c, { kind: t.kind }, {
|
|
1999
|
-
default: h(() => [
|
|
2000
|
-
l(e.$slots, "icon")
|
|
2001
|
-
]),
|
|
2002
|
-
_: 3
|
|
2003
|
-
}, 8, ["kind"]),
|
|
2004
|
-
g(_, {
|
|
2005
|
-
"title-id": t.titleId,
|
|
2006
|
-
"content-id": t.contentId,
|
|
2007
|
-
title: t.title,
|
|
2008
|
-
role: t.role
|
|
2009
|
-
}, {
|
|
2010
|
-
titleOverride: h(() => [
|
|
2011
|
-
l(e.$slots, "titleOverride")
|
|
2012
|
-
]),
|
|
2013
|
-
default: h(() => [
|
|
2014
|
-
l(e.$slots, "default")
|
|
2015
|
-
]),
|
|
2016
|
-
_: 3
|
|
2017
|
-
}, 8, ["title-id", "content-id", "title", "role"]),
|
|
2018
|
-
g(v, {
|
|
2019
|
-
"hide-close": t.hideClose,
|
|
2020
|
-
"close-button-props": t.closeButtonProps,
|
|
2021
|
-
"visually-hidden-close": e.visuallyHiddenClose,
|
|
2022
|
-
"visually-hidden-close-label": e.visuallyHiddenCloseLabel,
|
|
2023
|
-
onClose: s[0] || (s[0] = (m) => e.$emit("close"))
|
|
2024
|
-
}, {
|
|
2025
|
-
default: h(() => [
|
|
2026
|
-
l(e.$slots, "action")
|
|
2027
|
-
]),
|
|
2028
|
-
_: 3
|
|
2029
|
-
}, 8, ["hide-close", "close-button-props", "visually-hidden-close", "visually-hidden-close-label"])
|
|
2030
|
-
], 2);
|
|
2031
|
-
}
|
|
2032
|
-
const Ht = /* @__PURE__ */ y(Et, [["render", Ct]]), S = {
|
|
2033
|
-
default: "column",
|
|
2034
|
-
column: "column",
|
|
2035
|
-
row: "row",
|
|
2036
|
-
"row-reverse": "row-reverse",
|
|
2037
|
-
"column-reverse": "column-reverse"
|
|
2038
|
-
}, U = ["sm", "md", "lg", "xl"], H = ["0", "100", "200", "300", "400", "500", "600"];
|
|
2039
|
-
function j(e) {
|
|
2040
|
-
return e === S.default;
|
|
2041
|
-
}
|
|
2042
|
-
function K(e) {
|
|
2043
|
-
if (k(e) === "string")
|
|
2044
|
-
return j(e) ? null : S[e];
|
|
2045
|
-
if (k(e) === "object") {
|
|
2046
|
-
const { default: s } = e;
|
|
2047
|
-
return j(s) ? null : S[s];
|
|
2048
|
-
} else
|
|
2049
|
-
return null;
|
|
2050
|
-
}
|
|
2051
|
-
function k(e) {
|
|
2052
|
-
return typeof e;
|
|
2053
|
-
}
|
|
2054
|
-
function It(e) {
|
|
2055
|
-
return K(e) ? `d-stack--${S[K(e)]}` : null;
|
|
2056
|
-
}
|
|
2057
|
-
function Ot(e) {
|
|
2058
|
-
return k(e) === "object" ? [
|
|
2059
|
-
...U.map((s) => e[s] ? `d-stack--${s}--${e[s]}` : null)
|
|
2060
|
-
] : null;
|
|
2061
|
-
}
|
|
2062
|
-
function At(e) {
|
|
2063
|
-
return H.includes(e) ? `d-stack--gap-${e}` : null;
|
|
2064
|
-
}
|
|
2065
|
-
function kt(e) {
|
|
2066
|
-
if (k(e) === "string")
|
|
2067
|
-
return Object.keys(S).includes(e);
|
|
2068
|
-
if (k(e) === "object") {
|
|
2069
|
-
const { default: s } = e;
|
|
2070
|
-
return Object.keys(S).includes(s);
|
|
2071
|
-
} else
|
|
2072
|
-
return null;
|
|
2073
|
-
}
|
|
2074
|
-
function Tt(e) {
|
|
2075
|
-
return H.includes(e);
|
|
2076
|
-
}
|
|
2077
|
-
const wt = {
|
|
2078
|
-
name: "DtStack",
|
|
2079
|
-
props: {
|
|
2080
|
-
/**
|
|
2081
|
-
* Set this prop to the direction to stack the items.
|
|
2082
|
-
* You can override the default direction with 'default' key.
|
|
2083
|
-
* All the undefined breakpoints will have 'default' value.
|
|
2084
|
-
* By default, for the column direction it will have `justify-content: flex-start`
|
|
2085
|
-
* and for the row direction `align-items: center`. This can be overriden
|
|
2086
|
-
* by utility classes.
|
|
2087
|
-
*/
|
|
2088
|
-
direction: {
|
|
2089
|
-
type: [String, Object],
|
|
2090
|
-
default: "column",
|
|
2091
|
-
validator: (e) => kt(e)
|
|
2092
|
-
},
|
|
2093
|
-
/**
|
|
2094
|
-
* Set this prop to render stack as a specific HTML element.
|
|
2095
|
-
*/
|
|
2096
|
-
as: {
|
|
2097
|
-
type: String,
|
|
2098
|
-
default: "div"
|
|
2099
|
-
},
|
|
2100
|
-
/**
|
|
2101
|
-
* Set this prop to have the space between each stack item
|
|
2102
|
-
* @values 0, 100, 200, 300, 400, 500, 600
|
|
2103
|
-
*/
|
|
2104
|
-
gap: {
|
|
2105
|
-
type: String,
|
|
2106
|
-
default: "0",
|
|
2107
|
-
validator: (e) => Tt(e)
|
|
2108
|
-
}
|
|
2109
|
-
},
|
|
2110
|
-
data() {
|
|
2111
|
-
return {
|
|
2112
|
-
DT_STACK_DIRECTION: S,
|
|
2113
|
-
DT_STACK_GAP: H,
|
|
2114
|
-
DT_STACK_RESPONSIVE_BREAKPOINTS: U
|
|
2115
|
-
};
|
|
2116
|
-
},
|
|
2117
|
-
computed: {
|
|
2118
|
-
stackGap() {
|
|
2119
|
-
return At(this.gap);
|
|
2120
|
-
},
|
|
2121
|
-
defaultDirection() {
|
|
2122
|
-
return It(this.direction);
|
|
2123
|
-
},
|
|
2124
|
-
stackResponsive() {
|
|
2125
|
-
return Ot(this.direction);
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
};
|
|
2129
|
-
function Pt(e, s, t, a, o, n) {
|
|
2130
|
-
return i(), u(C(t.as), {
|
|
2131
|
-
class: p([
|
|
2132
|
-
"d-stack",
|
|
2133
|
-
n.defaultDirection,
|
|
2134
|
-
n.stackResponsive,
|
|
2135
|
-
n.stackGap
|
|
2136
|
-
])
|
|
2137
|
-
}, {
|
|
2138
|
-
default: h(() => [
|
|
2139
|
-
l(e.$slots, "default")
|
|
2140
|
-
]),
|
|
2141
|
-
_: 3
|
|
2142
|
-
}, 8, ["class"]);
|
|
2143
|
-
}
|
|
2144
|
-
const Vt = /* @__PURE__ */ y(wt, [["render", Pt]]);
|
|
2145
|
-
export {
|
|
2146
|
-
N as A,
|
|
2147
|
-
Ft as D,
|
|
2148
|
-
w as L,
|
|
2149
|
-
Ye as M,
|
|
2150
|
-
M as N,
|
|
2151
|
-
ft as P,
|
|
2152
|
-
B as S,
|
|
2153
|
-
Vt as a,
|
|
2154
|
-
Rt as b,
|
|
2155
|
-
Dt as c,
|
|
2156
|
-
Ht as d,
|
|
2157
|
-
Bt as e,
|
|
2158
|
-
Re as f,
|
|
2159
|
-
$e as g,
|
|
2160
|
-
We as h,
|
|
2161
|
-
W as i,
|
|
2162
|
-
ut as j,
|
|
2163
|
-
$ as k,
|
|
2164
|
-
_e as l,
|
|
2165
|
-
ve as m,
|
|
2166
|
-
V as n,
|
|
2167
|
-
ge as o,
|
|
2168
|
-
be as p,
|
|
2169
|
-
x as q,
|
|
2170
|
-
q as r,
|
|
2171
|
-
dt as s,
|
|
2172
|
-
ct as t,
|
|
2173
|
-
ht as u,
|
|
2174
|
-
ye as v,
|
|
2175
|
-
O as w,
|
|
2176
|
-
ue as x
|
|
2177
|
-
};
|