@dialpad/dialtone 9.9.0 → 9.10.1
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/css/dialtone.css +2 -2
- package/dist/icons/icons.json +1 -1
- package/dist/icons/keywords.json +1 -1
- package/dist/icons/svg/{0365-calendar.svg → o365-calendar.svg} +1 -1
- package/dist/tokens/android/java/tokens-dark.kt +1 -1
- package/dist/tokens/android/java/tokens-light.kt +1 -1
- package/dist/tokens/android/res/values/colors-dark.xml +1 -1
- package/dist/tokens/android/res/values/colors-light.xml +1 -1
- package/dist/tokens/android/res/values/dimens.xml +1 -1
- package/dist/tokens/css/variables-dark.css +1 -1
- package/dist/tokens/css/variables-light.css +1 -1
- package/dist/tokens/ios/tokens-dark.swift +1 -1
- package/dist/tokens/ios/tokens-light.swift +1 -1
- package/dist/tokens/less/variables-dark.less +1 -1
- package/dist/tokens/less/variables-light.less +1 -1
- package/dist/vue2/dialtone-vue.cjs +5 -5
- package/dist/vue2/dialtone-vue.js +1742 -1298
- package/dist/vue2/emoji.cjs +1 -1
- package/dist/vue2/emoji.js +3 -3
- package/dist/vue2/emoji_picker-3cVhhlbr.js +782 -0
- package/dist/vue2/emoji_picker-50hU6Bus.cjs +1 -0
- package/dist/vue2/{emoji_text_wrapper-VgRKbImg.js → emoji_text_wrapper-45075bUQ.js} +1 -1
- package/dist/vue2/{emoji_text_wrapper-fbV6ZEWh.cjs → emoji_text_wrapper-dc6a_C0K.cjs} +1 -1
- package/dist/vue2/index-8ytmeBCH.cjs +1 -0
- package/dist/vue2/index-NG2T0qK1.js +139501 -0
- package/dist/vue2/message_input.cjs +1 -92
- package/dist/vue2/message_input.js +86 -13208
- package/dist/vue2/rich_text_editor-E7mcsC-J.cjs +97 -0
- package/dist/vue2/rich_text_editor-sxTdV897.js +16483 -0
- package/dist/vue2/style.css +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +16 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts +2 -0
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue2/types/index.d.ts +1 -0
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +518 -0
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -0
- package/dist/vue2/types/recipes/conversation_view/editor/editor_constants.d.ts +8 -0
- package/dist/vue2/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -0
- package/dist/vue2/types/recipes/conversation_view/editor/index.d.ts +2 -0
- package/dist/vue2/types/recipes/conversation_view/editor/index.d.ts.map +1 -0
- package/dist/vue3/dialtone-vue.cjs +5 -5
- package/dist/vue3/dialtone-vue.js +2857 -2264
- package/dist/vue3/{emoji-wyzCAeMh.cjs → emoji-3sZLmJtM.cjs} +1 -1
- package/dist/vue3/{emoji-WjzabgKs.js → emoji-RvO57rkW.js} +3406 -3406
- package/dist/vue3/emoji.cjs +1 -1
- package/dist/vue3/emoji.js +3 -3
- package/dist/vue3/{emoji_picker-Uhm2r1e3.cjs → emoji_picker-EYanEJrn.cjs} +1 -1
- package/dist/vue3/{emoji_picker-J3yCpi0n.js → emoji_picker-ZDMH1VIY.js} +1 -1
- package/dist/vue3/{emoji_text_wrapper-PF5FAHE8.cjs → emoji_text_wrapper-p2pyEE4j.cjs} +1 -1
- package/dist/vue3/{emoji_text_wrapper-N_7eQTWM.js → emoji_text_wrapper-zvhbHADN.js} +1 -1
- package/dist/vue3/message_input.cjs +1 -92
- package/dist/vue3/message_input.js +156 -13406
- package/dist/vue3/rich_text_editor-VFx2M8I2.cjs +97 -0
- package/dist/vue3/rich_text_editor-o1bRsprW.js +16664 -0
- package/dist/vue3/style.css +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +16 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts +2 -0
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue3/types/index.d.ts +1 -0
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +522 -0
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/editor/editor_constants.d.ts +8 -0
- package/dist/vue3/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/editor/index.d.ts +2 -0
- package/dist/vue3/types/recipes/conversation_view/editor/index.d.ts.map +1 -0
- package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/vue2/emoji-dxiv7Pn5.cjs +0 -1
- package/dist/vue2/emoji-eFDb2_CE.js +0 -56678
- package/dist/vue2/emoji_picker-1wJCa-sD.js +0 -83604
- package/dist/vue2/emoji_picker-abQkp-dE.cjs +0 -1
- package/dist/vue2/stack-T6wnw8L8.cjs +0 -2
- package/dist/vue2/stack-ksXg6ONX.js +0 -1852
- package/dist/vue3/stack--3ERj1r4.cjs +0 -2
- package/dist/vue3/stack-tU3sgAgJ.js +0 -1905
|
@@ -1,1905 +0,0 @@
|
|
|
1
|
-
import { _ as y, g as N, a as G, u as U, b as Y, B as Z, h as j, c as X, i as J, d as Q, e as ee, f as F } from "./tooltip-Cr_G7ib3.js";
|
|
2
|
-
import { openBlock as i, createElementBlock as r, toDisplayString as T, createCommentVNode as d, createElementVNode as E, normalizeClass as u, resolveComponent as m, createBlock as h, resolveDynamicComponent as b, withCtx as f, mergeProps as w, renderSlot as c, withKeys as g, withModifiers as A, createVNode as P, toHandlers as K, createSlots as te, renderList as se, Teleport as ne } from "vue";
|
|
3
|
-
import { A as ae, w as k, I as ie, L as oe, B as le, C as z } from "./emoji-WjzabgKs.js";
|
|
4
|
-
const C = {
|
|
5
|
-
BUSY: "busy",
|
|
6
|
-
AWAY: "away",
|
|
7
|
-
OFFLINE: "offline",
|
|
8
|
-
ACTIVE: "active"
|
|
9
|
-
}, re = [
|
|
10
|
-
C.BUSY,
|
|
11
|
-
C.AWAY,
|
|
12
|
-
C.OFFLINE,
|
|
13
|
-
C.ACTIVE
|
|
14
|
-
], de = {
|
|
15
|
-
name: "DtPresence",
|
|
16
|
-
props: {
|
|
17
|
-
/**
|
|
18
|
-
* Determines the color of the inner presence circle, indicating status.
|
|
19
|
-
* Accepts one of 4 values: 'busy', 'away', 'active', 'offline'
|
|
20
|
-
* @values busy, away, active, offline
|
|
21
|
-
*/
|
|
22
|
-
presence: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: C.ACTIVE,
|
|
25
|
-
validator: (e) => re.includes(e)
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* Since Presence is a visual element, we need SRs to read out any state changes
|
|
29
|
-
* that occur.
|
|
30
|
-
* Text entered here will be read by assistive technology. If null this component will be ignored by AT.
|
|
31
|
-
*/
|
|
32
|
-
srText: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: null
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, ce = ["aria-live"], ue = {
|
|
38
|
-
key: 0,
|
|
39
|
-
"data-qa": "dt-presence-sr-text",
|
|
40
|
-
class: "sr-only"
|
|
41
|
-
};
|
|
42
|
-
function he(e, t, s, o, a, n) {
|
|
43
|
-
return i(), r("div", {
|
|
44
|
-
class: "d-presence",
|
|
45
|
-
"data-qa": "dt-presence",
|
|
46
|
-
role: "status",
|
|
47
|
-
"aria-live": e.$attrs.ariaLive || "off"
|
|
48
|
-
}, [
|
|
49
|
-
s.srText ? (i(), r("span", ue, T(s.srText), 1)) : d("", !0),
|
|
50
|
-
E("div", {
|
|
51
|
-
class: u(["d-presence__inner", {
|
|
52
|
-
"d-presence__inner--active": s.presence === "active",
|
|
53
|
-
"d-presence__inner--away": s.presence === "away",
|
|
54
|
-
"d-presence__inner--busy": s.presence === "busy",
|
|
55
|
-
"d-presence__inner--offline": s.presence === "offline"
|
|
56
|
-
}])
|
|
57
|
-
}, null, 2)
|
|
58
|
-
], 8, ce);
|
|
59
|
-
}
|
|
60
|
-
const fe = /* @__PURE__ */ y(de, [["render", he]]), L = {
|
|
61
|
-
xs: "d-avatar--xs",
|
|
62
|
-
sm: "d-avatar--sm",
|
|
63
|
-
md: "d-avatar--md",
|
|
64
|
-
lg: "d-avatar--lg",
|
|
65
|
-
xl: "d-avatar--xl"
|
|
66
|
-
}, pe = {
|
|
67
|
-
default: "",
|
|
68
|
-
icon: "d-avatar__icon",
|
|
69
|
-
initials: "d-avatar__initials"
|
|
70
|
-
}, me = {
|
|
71
|
-
md: "d-avatar__presence--md",
|
|
72
|
-
lg: "d-avatar__presence--lg"
|
|
73
|
-
}, H = {
|
|
74
|
-
NONE: "",
|
|
75
|
-
BUSY: "busy",
|
|
76
|
-
AWAY: "away",
|
|
77
|
-
OFFLINE: "offline",
|
|
78
|
-
ACTIVE: "active"
|
|
79
|
-
}, ye = {
|
|
80
|
-
xs: "100",
|
|
81
|
-
sm: "200",
|
|
82
|
-
md: "300",
|
|
83
|
-
lg: "500",
|
|
84
|
-
xl: "600"
|
|
85
|
-
}, ve = [
|
|
86
|
-
"100",
|
|
87
|
-
"200",
|
|
88
|
-
"300",
|
|
89
|
-
"400",
|
|
90
|
-
"500",
|
|
91
|
-
"600",
|
|
92
|
-
"700",
|
|
93
|
-
"800",
|
|
94
|
-
"900",
|
|
95
|
-
"1000",
|
|
96
|
-
"1100",
|
|
97
|
-
"1200",
|
|
98
|
-
"1300",
|
|
99
|
-
"1400",
|
|
100
|
-
"1500",
|
|
101
|
-
"1600",
|
|
102
|
-
"1700",
|
|
103
|
-
"1800"
|
|
104
|
-
], V = (e) => e > 1;
|
|
105
|
-
function _e() {
|
|
106
|
-
return [void 0, ...ae];
|
|
107
|
-
}
|
|
108
|
-
const ge = (e) => {
|
|
109
|
-
if (typeof e != "string" || !e.trim())
|
|
110
|
-
return "";
|
|
111
|
-
const t = e.trim().split(/\s+/g);
|
|
112
|
-
return t.length === 1 ? t.join("").substring(0, 2) : t.filter((s, o) => o === 0 || o === t.length - 1).map((s) => s.slice(0, 1).toUpperCase()).join("");
|
|
113
|
-
}, Ee = _e(), be = {
|
|
114
|
-
name: "DtAvatar",
|
|
115
|
-
components: { DtPresence: fe, DtIcon: k },
|
|
116
|
-
inheritAttrs: !1,
|
|
117
|
-
props: {
|
|
118
|
-
/**
|
|
119
|
-
* Id of the avatar content wrapper element
|
|
120
|
-
*/
|
|
121
|
-
id: {
|
|
122
|
-
type: String,
|
|
123
|
-
default() {
|
|
124
|
-
return N();
|
|
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(L).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: H.NONE,
|
|
182
|
-
validator: (e) => Object.values(H).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) => V(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) => Ee.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(ie).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: L,
|
|
282
|
-
AVATAR_KIND_MODIFIERS: pe,
|
|
283
|
-
AVATAR_PRESENCE_SIZE_MODIFIERS: me,
|
|
284
|
-
AVATAR_ICON_SIZES: ye,
|
|
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
|
-
L[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 V(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 t = ge(e);
|
|
351
|
-
this.validatedSize === "xs" ? this.formattedInitials = "" : this.validatedSize === "sm" ? this.formattedInitials = t[0] : this.formattedInitials = t;
|
|
352
|
-
},
|
|
353
|
-
getColor() {
|
|
354
|
-
return this.color ?? G(ve, 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
|
-
}, Se = ["src", "alt"], Ce = {
|
|
371
|
-
key: 1,
|
|
372
|
-
class: "d-avatar__overlay-text"
|
|
373
|
-
}, Oe = {
|
|
374
|
-
key: 1,
|
|
375
|
-
class: "d-avatar__count",
|
|
376
|
-
"data-qa": "dt-avatar-count"
|
|
377
|
-
};
|
|
378
|
-
function Ie(e, t, s, o, a, n) {
|
|
379
|
-
const p = m("dt-icon"), v = m("dt-presence");
|
|
380
|
-
return i(), h(b(s.clickable ? "button" : "div"), {
|
|
381
|
-
id: s.id,
|
|
382
|
-
class: u(n.avatarClasses),
|
|
383
|
-
"data-qa": "dt-avatar",
|
|
384
|
-
"aria-label": n.buttonAriaLabel,
|
|
385
|
-
onClick: n.handleClick
|
|
386
|
-
}, {
|
|
387
|
-
default: f(() => [
|
|
388
|
-
E("div", {
|
|
389
|
-
ref: "canvas",
|
|
390
|
-
class: u([
|
|
391
|
-
s.canvasClass,
|
|
392
|
-
"d-avatar__canvas",
|
|
393
|
-
{ "d-avatar--image-loaded": a.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: s.imageSrc,
|
|
402
|
-
alt: s.imageAlt || s.fullName
|
|
403
|
-
}, null, 8, Se)) : s.iconName ? (i(), h(p, {
|
|
404
|
-
key: 1,
|
|
405
|
-
name: s.iconName,
|
|
406
|
-
size: s.iconSize || a.AVATAR_ICON_SIZES[s.size],
|
|
407
|
-
class: u([s.iconClass, a.AVATAR_KIND_MODIFIERS.icon]),
|
|
408
|
-
"data-qa": "dt-avatar-icon"
|
|
409
|
-
}, null, 8, ["name", "size", "class"])) : (i(), r("span", {
|
|
410
|
-
key: 2,
|
|
411
|
-
class: u([a.AVATAR_KIND_MODIFIERS.initials])
|
|
412
|
-
}, T(a.formattedInitials), 3))
|
|
413
|
-
], 2),
|
|
414
|
-
s.overlayIcon || s.overlayText ? (i(), r("div", {
|
|
415
|
-
key: 0,
|
|
416
|
-
class: u(n.overlayClasses)
|
|
417
|
-
}, [
|
|
418
|
-
s.overlayIcon ? (i(), h(p, {
|
|
419
|
-
key: 0,
|
|
420
|
-
class: "d-avatar__overlay-icon",
|
|
421
|
-
name: s.overlayIcon
|
|
422
|
-
}, null, 8, ["name"])) : s.overlayText ? (i(), r("p", Ce, T(s.overlayText), 1)) : d("", !0)
|
|
423
|
-
], 2)) : d("", !0),
|
|
424
|
-
n.showGroup ? (i(), r("span", Oe, T(n.formattedGroup), 1)) : d("", !0),
|
|
425
|
-
s.presence && !n.showGroup ? (i(), h(v, w({
|
|
426
|
-
key: 2,
|
|
427
|
-
presence: s.presence,
|
|
428
|
-
class: [
|
|
429
|
-
"d-avatar__presence",
|
|
430
|
-
a.AVATAR_PRESENCE_SIZE_MODIFIERS[s.size]
|
|
431
|
-
]
|
|
432
|
-
}, s.presenceProps, { "data-qa": "dt-presence" }), null, 16, ["presence", "class"])) : d("", !0)
|
|
433
|
-
]),
|
|
434
|
-
_: 1
|
|
435
|
-
}, 8, ["id", "class", "aria-label", "onClick"]);
|
|
436
|
-
}
|
|
437
|
-
const yt = /* @__PURE__ */ y(be, [["render", Ie]]), Te = {
|
|
438
|
-
name: "DtLink",
|
|
439
|
-
props: {
|
|
440
|
-
/**
|
|
441
|
-
* Applies the link variant styles
|
|
442
|
-
* @values null, danger, warning, success, muted, inverted
|
|
443
|
-
*/
|
|
444
|
-
kind: {
|
|
445
|
-
type: String,
|
|
446
|
-
default: "",
|
|
447
|
-
validator(e) {
|
|
448
|
-
return oe.includes(e);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
data() {
|
|
453
|
-
return {
|
|
454
|
-
LINK_KIND_MODIFIERS: le
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
}, Ae = ["href"];
|
|
458
|
-
function we(e, t, s, o, a, n) {
|
|
459
|
-
return i(), r("a", {
|
|
460
|
-
class: u([
|
|
461
|
-
"d-link",
|
|
462
|
-
a.LINK_KIND_MODIFIERS[s.kind]
|
|
463
|
-
]),
|
|
464
|
-
"data-qa": "dt-link",
|
|
465
|
-
href: "href" in e.$attrs ? e.$attrs.href : "javascript:void(0)"
|
|
466
|
-
}, [
|
|
467
|
-
c(e.$slots, "default")
|
|
468
|
-
], 10, Ae);
|
|
469
|
-
}
|
|
470
|
-
const vt = /* @__PURE__ */ y(Te, [["render", we]]), Pe = {
|
|
471
|
-
props: {
|
|
472
|
-
/**
|
|
473
|
-
* If true, a hidden close button is included for screen readers
|
|
474
|
-
* @values true, false
|
|
475
|
-
*/
|
|
476
|
-
visuallyHiddenClose: {
|
|
477
|
-
type: Boolean,
|
|
478
|
-
default: !1
|
|
479
|
-
},
|
|
480
|
-
/**
|
|
481
|
-
* Label for the visually hidden close button
|
|
482
|
-
* Required if visuallyHiddenClose is set to `true`
|
|
483
|
-
*/
|
|
484
|
-
visuallyHiddenCloseLabel: {
|
|
485
|
-
type: String,
|
|
486
|
-
default: null
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
watch: {
|
|
490
|
-
$props: {
|
|
491
|
-
immediate: !0,
|
|
492
|
-
deep: !0,
|
|
493
|
-
handler() {
|
|
494
|
-
this.validateVisuallyHiddenCloseProps();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
computed: {
|
|
499
|
-
showVisuallyHiddenClose() {
|
|
500
|
-
return this.visuallyHiddenClose && this.visuallyHiddenCloseLabel != null;
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
methods: {
|
|
504
|
-
validateVisuallyHiddenCloseProps() {
|
|
505
|
-
this.visuallyHiddenClose && !this.visuallyHiddenCloseLabel && console.error(`If visuallyHiddenClose prop is true, the component includes
|
|
506
|
-
a visually hidden close button and you must set the visuallyHiddenCloseLabel prop.`);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}, ke = {
|
|
510
|
-
name: "SrOnlyCloseButton",
|
|
511
|
-
components: {
|
|
512
|
-
DtIcon: k,
|
|
513
|
-
DtButton: z
|
|
514
|
-
},
|
|
515
|
-
props: {
|
|
516
|
-
/**
|
|
517
|
-
* Label for the visually hidden close button
|
|
518
|
-
* Required if visuallyHiddenClose is set to `true`
|
|
519
|
-
*/
|
|
520
|
-
visuallyHiddenCloseLabel: {
|
|
521
|
-
type: String,
|
|
522
|
-
default: null
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
emits: ["close"],
|
|
526
|
-
methods: {
|
|
527
|
-
close() {
|
|
528
|
-
this.$emit("close");
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
function Le(e, t, s, o, a, n) {
|
|
533
|
-
const p = m("dt-icon"), v = m("dt-button");
|
|
534
|
-
return i(), h(v, {
|
|
535
|
-
id: "sr-only-close-button",
|
|
536
|
-
"data-qa": "dt-sr-only-close-button",
|
|
537
|
-
class: "d-vi-visible-sr",
|
|
538
|
-
"aria-label": s.visuallyHiddenCloseLabel,
|
|
539
|
-
onClick: n.close,
|
|
540
|
-
onKeydown: g(A(n.close, ["prevent", "stop"]), ["space"])
|
|
541
|
-
}, {
|
|
542
|
-
default: f(() => [
|
|
543
|
-
P(p, { name: "close" })
|
|
544
|
-
]),
|
|
545
|
-
_: 1
|
|
546
|
-
}, 8, ["aria-label", "onClick", "onKeydown"]);
|
|
547
|
-
}
|
|
548
|
-
const De = /* @__PURE__ */ y(ke, [["render", Le]]), $ = ':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])', Ne = `${$}:not([tabindex="-1"])`, Re = "button,[href],input,select,textarea,details,[tabindex]", Fe = {
|
|
549
|
-
methods: {
|
|
550
|
-
/**
|
|
551
|
-
* get the first focusable element in your component, includes tabindex="-1".
|
|
552
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
553
|
-
* will default to the root node of the vue component
|
|
554
|
-
*/
|
|
555
|
-
async getFirstFocusableElement(e) {
|
|
556
|
-
await this.$nextTick();
|
|
557
|
-
const t = this._getFocusableElements(e, !0);
|
|
558
|
-
return this._getFirstFocusElement(t);
|
|
559
|
-
},
|
|
560
|
-
/**
|
|
561
|
-
* set focus to the first focusable element in your component, includes tabindex="-1".
|
|
562
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
563
|
-
* will default to the root node of the vue component
|
|
564
|
-
*/
|
|
565
|
-
async focusFirstElement(e) {
|
|
566
|
-
const t = await this.getFirstFocusableElement(e);
|
|
567
|
-
t == null || t.focus({ preventScroll: !0 });
|
|
568
|
-
},
|
|
569
|
-
/**
|
|
570
|
-
* internal use only.
|
|
571
|
-
*
|
|
572
|
-
* @param focusableElements - list of focusable elements
|
|
573
|
-
* @returns {*} - first DOM element that is focusable.
|
|
574
|
-
* @private
|
|
575
|
-
*/
|
|
576
|
-
_getFirstFocusElement(e) {
|
|
577
|
-
if (!e.length)
|
|
578
|
-
return;
|
|
579
|
-
let t = e[0];
|
|
580
|
-
return t.matches('[type="radio"]:not(:checked)') && (t = e.find((s) => s.checked && s.name === t.name) || t), t;
|
|
581
|
-
},
|
|
582
|
-
/**
|
|
583
|
-
* internal use only.
|
|
584
|
-
*
|
|
585
|
-
* gets all the focusable elements within the component
|
|
586
|
-
* and sets the first and last of those elements.
|
|
587
|
-
*
|
|
588
|
-
* @param {object} el - the root dom element to find focusable elements in.
|
|
589
|
-
* @param {bool} includeNegativeTabIndex - will include tabindex="-1" in the list of focusable elements.
|
|
590
|
-
*/
|
|
591
|
-
_getFocusableElements(e = this.$el, t = !1) {
|
|
592
|
-
return e ? [...e.querySelectorAll(Re)].filter((o) => {
|
|
593
|
-
const a = window.getComputedStyle(o);
|
|
594
|
-
return a.getPropertyValue("display") !== "none" && a.getPropertyValue("visibility") !== "hidden" && o.matches(t ? $ : Ne);
|
|
595
|
-
}) : [];
|
|
596
|
-
},
|
|
597
|
-
/**
|
|
598
|
-
* tabs to the next element contained within your component, does not include tabindex="-1".
|
|
599
|
-
* @param {object} e - keypress event
|
|
600
|
-
* @param {object} el - optional - ref of dom element to trap focus on.
|
|
601
|
-
* will default to the root node of the vue component
|
|
602
|
-
*/
|
|
603
|
-
focusTrappedTabPress(e, t) {
|
|
604
|
-
if (!(e.key === "Tab"))
|
|
605
|
-
return;
|
|
606
|
-
const o = this._getFocusableElements(t);
|
|
607
|
-
if (!o.length) {
|
|
608
|
-
e.preventDefault();
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
const a = this._getFirstFocusElement(o), n = o[o.length - 1];
|
|
612
|
-
e.shiftKey ? document.activeElement === a && (n.focus(), e.preventDefault()) : document.activeElement === n && (a.focus(), e.preventDefault());
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}, D = {
|
|
616
|
-
DEFAULT: "default",
|
|
617
|
-
CUSTOM: "custom"
|
|
618
|
-
}, I = {
|
|
619
|
-
ARROW_KEYS: "arrow-keys",
|
|
620
|
-
TAB: "tab",
|
|
621
|
-
NONE: "none"
|
|
622
|
-
}, He = {
|
|
623
|
-
name: "DtItemLayout",
|
|
624
|
-
props: {
|
|
625
|
-
/**
|
|
626
|
-
* Set this prop to render layout as a specific HTML element.
|
|
627
|
-
*/
|
|
628
|
-
as: {
|
|
629
|
-
type: String,
|
|
630
|
-
default: "div"
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}, Ve = {
|
|
634
|
-
key: 0,
|
|
635
|
-
"data-qa": "dt-item-layout-left-wrapper",
|
|
636
|
-
class: "dt-item-layout--left"
|
|
637
|
-
}, Be = {
|
|
638
|
-
"data-qa": "dt-item-layout-content-wrapper",
|
|
639
|
-
class: "dt-item-layout--content"
|
|
640
|
-
}, qe = {
|
|
641
|
-
key: 0,
|
|
642
|
-
"data-qa": "dt-item-layout-title-wrapper",
|
|
643
|
-
class: "dt-item-layout--title"
|
|
644
|
-
}, xe = {
|
|
645
|
-
key: 2,
|
|
646
|
-
"data-qa": "dt-item-layout-bottom-wrapper",
|
|
647
|
-
class: "dt-item-layout--bottom"
|
|
648
|
-
}, Me = {
|
|
649
|
-
key: 1,
|
|
650
|
-
"data-qa": "dt-item-layout-right-wrapper",
|
|
651
|
-
class: "dt-item-layout--right"
|
|
652
|
-
}, je = {
|
|
653
|
-
key: 2,
|
|
654
|
-
"data-qa": "dt-item-layout-selected-wrapper",
|
|
655
|
-
class: "dt-item-layout--selected"
|
|
656
|
-
};
|
|
657
|
-
function Ke(e, t, s, o, a, n) {
|
|
658
|
-
return i(), h(b(s.as), { class: "dt-item-layout" }, {
|
|
659
|
-
default: f(() => [
|
|
660
|
-
e.$slots.left ? (i(), r("section", Ve, [
|
|
661
|
-
c(e.$slots, "left", {}, void 0, !0)
|
|
662
|
-
])) : d("", !0),
|
|
663
|
-
E("section", Be, [
|
|
664
|
-
e.$slots.default ? (i(), r("div", qe, [
|
|
665
|
-
c(e.$slots, "default", {}, void 0, !0)
|
|
666
|
-
])) : d("", !0),
|
|
667
|
-
e.$slots.subtitle ? (i(), r("div", {
|
|
668
|
-
key: 1,
|
|
669
|
-
"data-qa": "dt-item-layout-subtitle-wrapper",
|
|
670
|
-
class: u(["dt-item-layout--subtitle", { "dt-item-layout--subtitle--with-title": e.$slots.default }])
|
|
671
|
-
}, [
|
|
672
|
-
c(e.$slots, "subtitle", {}, void 0, !0)
|
|
673
|
-
], 2)) : d("", !0),
|
|
674
|
-
e.$slots.bottom ? (i(), r("div", xe, [
|
|
675
|
-
c(e.$slots, "bottom", {}, void 0, !0)
|
|
676
|
-
])) : d("", !0)
|
|
677
|
-
]),
|
|
678
|
-
e.$slots.right ? (i(), r("section", Me, [
|
|
679
|
-
c(e.$slots, "right", {}, void 0, !0)
|
|
680
|
-
])) : d("", !0),
|
|
681
|
-
e.$slots.selected ? (i(), r("section", je, [
|
|
682
|
-
c(e.$slots, "selected", {}, void 0, !0)
|
|
683
|
-
])) : d("", !0)
|
|
684
|
-
]),
|
|
685
|
-
_: 3
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
|
-
const B = /* @__PURE__ */ y(He, [["render", Ke], ["__scopeId", "data-v-411cb81e"]]), ze = {
|
|
689
|
-
name: "DtListItem",
|
|
690
|
-
components: {
|
|
691
|
-
DtItemLayout: B,
|
|
692
|
-
DtIcon: k
|
|
693
|
-
},
|
|
694
|
-
/**
|
|
695
|
-
* Value provided from keyboard_list_navigation.js using id prop.
|
|
696
|
-
*/
|
|
697
|
-
inject: {
|
|
698
|
-
highlightId: { default: null }
|
|
699
|
-
},
|
|
700
|
-
props: {
|
|
701
|
-
/**
|
|
702
|
-
* Id for the item.
|
|
703
|
-
*/
|
|
704
|
-
id: {
|
|
705
|
-
type: String,
|
|
706
|
-
default() {
|
|
707
|
-
return U.getUniqueString();
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
/**
|
|
711
|
-
* String to use for the item's role.
|
|
712
|
-
*/
|
|
713
|
-
role: {
|
|
714
|
-
type: String,
|
|
715
|
-
default: "listitem"
|
|
716
|
-
},
|
|
717
|
-
/**
|
|
718
|
-
* HTML element type (tag name) of the content wrapper element.
|
|
719
|
-
*/
|
|
720
|
-
elementType: {
|
|
721
|
-
type: String,
|
|
722
|
-
default: "li"
|
|
723
|
-
},
|
|
724
|
-
/**
|
|
725
|
-
* The type of child list item to use.
|
|
726
|
-
* @values default, custom
|
|
727
|
-
*/
|
|
728
|
-
type: {
|
|
729
|
-
type: String,
|
|
730
|
-
default: D.DEFAULT,
|
|
731
|
-
validator: (e) => Object.values(D).includes(e)
|
|
732
|
-
},
|
|
733
|
-
/**
|
|
734
|
-
* The type of navigation that this component should support.
|
|
735
|
-
* - "arrow-keys" for items that are navigated with UP/DOWN keys.
|
|
736
|
-
* - "tab" for items that are navigated using the TAB key.
|
|
737
|
-
* - "none" for static items that are not interactive.
|
|
738
|
-
* @values arrow-keys, tab, none
|
|
739
|
-
*/
|
|
740
|
-
navigationType: {
|
|
741
|
-
type: String,
|
|
742
|
-
default: I.NONE,
|
|
743
|
-
validator: (e) => Object.values(I).includes(e)
|
|
744
|
-
},
|
|
745
|
-
/**
|
|
746
|
-
* Applies selected styles to the list item
|
|
747
|
-
*/
|
|
748
|
-
selected: {
|
|
749
|
-
type: Boolean,
|
|
750
|
-
default: !1
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
emits: [
|
|
754
|
-
/**
|
|
755
|
-
* Key down event
|
|
756
|
-
*
|
|
757
|
-
* @event keydown
|
|
758
|
-
* @type {KeyboardEvent}
|
|
759
|
-
*/
|
|
760
|
-
"keydown",
|
|
761
|
-
/**
|
|
762
|
-
* Native mouse move event
|
|
763
|
-
*
|
|
764
|
-
* @event mousemove
|
|
765
|
-
* @type {MouseEvent}
|
|
766
|
-
*/
|
|
767
|
-
"mousemove",
|
|
768
|
-
/**
|
|
769
|
-
* Native mouse leave event
|
|
770
|
-
*
|
|
771
|
-
* @event mouseleave
|
|
772
|
-
* @type {MouseEvent}
|
|
773
|
-
*/
|
|
774
|
-
"mouseleave",
|
|
775
|
-
/**
|
|
776
|
-
* Mouse down event
|
|
777
|
-
*
|
|
778
|
-
* @event mousedown
|
|
779
|
-
*/
|
|
780
|
-
"mousedown"
|
|
781
|
-
],
|
|
782
|
-
data() {
|
|
783
|
-
return {
|
|
784
|
-
injected: !1,
|
|
785
|
-
mouseHighlighted: !1
|
|
786
|
-
};
|
|
787
|
-
},
|
|
788
|
-
computed: {
|
|
789
|
-
listItemType() {
|
|
790
|
-
switch (this.type) {
|
|
791
|
-
case D.DEFAULT:
|
|
792
|
-
return B;
|
|
793
|
-
default:
|
|
794
|
-
return null;
|
|
795
|
-
}
|
|
796
|
-
},
|
|
797
|
-
listItemListeners() {
|
|
798
|
-
return {
|
|
799
|
-
keydown: (e) => {
|
|
800
|
-
["enter", "space"].includes(e.code.toLowerCase()) && this.onClick(e), this.$emit("keydown", e);
|
|
801
|
-
},
|
|
802
|
-
mousemove: (e) => {
|
|
803
|
-
this.onMouseHover(e), this.$emit("mousemove", e);
|
|
804
|
-
},
|
|
805
|
-
mouseleave: (e) => {
|
|
806
|
-
this.onMouseLeave(e), this.$emit("mouseleave", e);
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
},
|
|
810
|
-
/**
|
|
811
|
-
* For keyboard navigation, whether this item is currently highlighted.
|
|
812
|
-
* An injected highlightId will override the default mouseover highlight.
|
|
813
|
-
*/
|
|
814
|
-
isHighlighted() {
|
|
815
|
-
return this.isHoverable ? this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted : !1;
|
|
816
|
-
},
|
|
817
|
-
isFocusable() {
|
|
818
|
-
return this.navigationType === I.TAB;
|
|
819
|
-
},
|
|
820
|
-
/**
|
|
821
|
-
* Whether to apply hover styles.
|
|
822
|
-
*/
|
|
823
|
-
isHoverable() {
|
|
824
|
-
return this.navigationType !== I.NONE;
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
methods: {
|
|
828
|
-
onClick(e) {
|
|
829
|
-
this.$emit("click", e);
|
|
830
|
-
},
|
|
831
|
-
onMouseHover() {
|
|
832
|
-
this.mouseHighlighted = !0;
|
|
833
|
-
},
|
|
834
|
-
onMouseLeave() {
|
|
835
|
-
this.mouseHighlighted = !1;
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
};
|
|
839
|
-
function $e(e, t, s, o, a, n) {
|
|
840
|
-
const p = m("dt-icon");
|
|
841
|
-
return i(), h(b(s.elementType), w({
|
|
842
|
-
id: s.id,
|
|
843
|
-
class: ["dt-list-item", {
|
|
844
|
-
"dt-list-item--focusable": n.isFocusable,
|
|
845
|
-
"dt-list-item--highlighted": n.isHighlighted,
|
|
846
|
-
"dt-list-item--static": !n.isHoverable
|
|
847
|
-
}],
|
|
848
|
-
tabindex: n.isFocusable ? 0 : -1,
|
|
849
|
-
role: s.role,
|
|
850
|
-
"aria-selected": n.isHighlighted
|
|
851
|
-
}, K(n.listItemListeners)), {
|
|
852
|
-
default: f(() => [
|
|
853
|
-
n.listItemType ? (i(), h(b(n.listItemType), { key: 0 }, te({ _: 2 }, [
|
|
854
|
-
se(e.$slots, (v, S) => ({
|
|
855
|
-
name: S,
|
|
856
|
-
fn: f(() => [
|
|
857
|
-
c(e.$slots, S)
|
|
858
|
-
])
|
|
859
|
-
})),
|
|
860
|
-
s.selected ? {
|
|
861
|
-
name: "selected",
|
|
862
|
-
fn: f(() => [
|
|
863
|
-
P(p, {
|
|
864
|
-
name: "check",
|
|
865
|
-
size: "400",
|
|
866
|
-
class: "dt-list-item--selected-icon"
|
|
867
|
-
})
|
|
868
|
-
]),
|
|
869
|
-
key: "0"
|
|
870
|
-
} : void 0
|
|
871
|
-
]), 1024)) : c(e.$slots, "default", { key: 1 })
|
|
872
|
-
]),
|
|
873
|
-
_: 3
|
|
874
|
-
}, 16, ["id", "class", "tabindex", "role", "aria-selected"]);
|
|
875
|
-
}
|
|
876
|
-
const _t = /* @__PURE__ */ y(ze, [["render", $e]]), _ = {
|
|
877
|
-
default: "column",
|
|
878
|
-
column: "column",
|
|
879
|
-
row: "row",
|
|
880
|
-
"row-reverse": "row-reverse",
|
|
881
|
-
"column-reverse": "column-reverse"
|
|
882
|
-
}, W = ["sm", "md", "lg", "xl"], R = ["0", "100", "200", "300", "400", "500", "600"], q = {
|
|
883
|
-
none: void 0,
|
|
884
|
-
small: "d-p4",
|
|
885
|
-
medium: "d-p8",
|
|
886
|
-
large: "d-p16"
|
|
887
|
-
}, We = {
|
|
888
|
-
none: void 0,
|
|
889
|
-
small: "d-pl4",
|
|
890
|
-
medium: "d-pl8",
|
|
891
|
-
large: "d-pl16"
|
|
892
|
-
}, Ge = ["dialog", "menu", "listbox", "tree", "grid"], Ue = ["", "anchor"], Ye = ["none", "dialog", "first"], Ze = ["parent", "body"], Xe = [
|
|
893
|
-
...Y
|
|
894
|
-
], gt = [
|
|
895
|
-
...Z
|
|
896
|
-
], Je = {
|
|
897
|
-
name: "PopoverHeaderFooter",
|
|
898
|
-
components: {
|
|
899
|
-
DtButton: z,
|
|
900
|
-
DtIcon: k
|
|
901
|
-
},
|
|
902
|
-
props: {
|
|
903
|
-
// eslint-disable-next-line vue/require-default-prop
|
|
904
|
-
type: {
|
|
905
|
-
type: String,
|
|
906
|
-
validator: function(e) {
|
|
907
|
-
return ["header", "footer"].includes(e);
|
|
908
|
-
}
|
|
909
|
-
},
|
|
910
|
-
/**
|
|
911
|
-
* Additional class name for the content wrapper element.
|
|
912
|
-
*/
|
|
913
|
-
contentClass: {
|
|
914
|
-
type: [String, Array, Object],
|
|
915
|
-
default: ""
|
|
916
|
-
},
|
|
917
|
-
/**
|
|
918
|
-
* Determines visibility for close button
|
|
919
|
-
* @values true, false
|
|
920
|
-
*/
|
|
921
|
-
showCloseButton: {
|
|
922
|
-
type: Boolean,
|
|
923
|
-
default: !1
|
|
924
|
-
},
|
|
925
|
-
/**
|
|
926
|
-
* A set of props to be passed into the popover's header close button.
|
|
927
|
-
* Requires an 'ariaLabel' property.
|
|
928
|
-
*/
|
|
929
|
-
closeButtonProps: {
|
|
930
|
-
type: Object,
|
|
931
|
-
default: () => {
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
},
|
|
935
|
-
emits: [
|
|
936
|
-
/**
|
|
937
|
-
* Emitted when popover is closed
|
|
938
|
-
*
|
|
939
|
-
* @event close
|
|
940
|
-
* @type { Boolean }
|
|
941
|
-
*/
|
|
942
|
-
"close"
|
|
943
|
-
],
|
|
944
|
-
data() {
|
|
945
|
-
return {
|
|
946
|
-
hasSlotContent: j
|
|
947
|
-
};
|
|
948
|
-
},
|
|
949
|
-
methods: {
|
|
950
|
-
focusCloseButton() {
|
|
951
|
-
var t;
|
|
952
|
-
const e = (t = this.$refs["popover__close-button"]) == null ? void 0 : t.$el;
|
|
953
|
-
e == null || e.focus();
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
};
|
|
957
|
-
function Qe(e, t, s, o, a, n) {
|
|
958
|
-
const p = m("dt-icon"), v = m("dt-button");
|
|
959
|
-
return i(), r("div", {
|
|
960
|
-
"data-qa": "dt-popover-header-footer",
|
|
961
|
-
class: u({
|
|
962
|
-
"d-popover__header": s.type === "header",
|
|
963
|
-
"d-popover__footer": s.type === "footer"
|
|
964
|
-
})
|
|
965
|
-
}, [
|
|
966
|
-
a.hasSlotContent(e.$slots.content) ? (i(), r("div", {
|
|
967
|
-
key: 0,
|
|
968
|
-
"data-qa": "dt-popover-header-footer-content",
|
|
969
|
-
class: u([{
|
|
970
|
-
"d-popover__header__content": s.type === "header",
|
|
971
|
-
"d-popover__footer__content": s.type === "footer"
|
|
972
|
-
}, s.contentClass])
|
|
973
|
-
}, [
|
|
974
|
-
c(e.$slots, "content")
|
|
975
|
-
], 2)) : d("", !0),
|
|
976
|
-
s.showCloseButton ? (i(), h(v, w({
|
|
977
|
-
key: 1,
|
|
978
|
-
ref: "popover__close-button",
|
|
979
|
-
"data-qa": "dt-popover-close",
|
|
980
|
-
class: {
|
|
981
|
-
"d-popover__header__close-button": s.type === "header",
|
|
982
|
-
"d-popover__footer__close-button": s.type === "footer"
|
|
983
|
-
},
|
|
984
|
-
importance: "outlined",
|
|
985
|
-
kind: "muted",
|
|
986
|
-
circle: ""
|
|
987
|
-
}, s.closeButtonProps, {
|
|
988
|
-
onClick: t[0] || (t[0] = (S) => e.$emit("close"))
|
|
989
|
-
}), {
|
|
990
|
-
icon: f(() => [
|
|
991
|
-
P(p, {
|
|
992
|
-
name: "close",
|
|
993
|
-
size: "300"
|
|
994
|
-
})
|
|
995
|
-
]),
|
|
996
|
-
_: 1
|
|
997
|
-
}, 16, ["class"])) : d("", !0)
|
|
998
|
-
], 2);
|
|
999
|
-
}
|
|
1000
|
-
const et = /* @__PURE__ */ y(Je, [["render", Qe]]), tt = {
|
|
1001
|
-
name: "DtPopover",
|
|
1002
|
-
/********************
|
|
1003
|
-
* CHILD COMPONENTS *
|
|
1004
|
-
********************/
|
|
1005
|
-
components: {
|
|
1006
|
-
SrOnlyCloseButton: De,
|
|
1007
|
-
DtLazyShow: X,
|
|
1008
|
-
PopoverHeaderFooter: et
|
|
1009
|
-
},
|
|
1010
|
-
mixins: [Fe, Pe],
|
|
1011
|
-
props: {
|
|
1012
|
-
/**
|
|
1013
|
-
* Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.
|
|
1014
|
-
* If you set this value, the default trigger behavior will be disabled, and you can control it as you need.
|
|
1015
|
-
* Supports v-model
|
|
1016
|
-
* @values null, true, false
|
|
1017
|
-
*/
|
|
1018
|
-
open: {
|
|
1019
|
-
type: Boolean,
|
|
1020
|
-
default: null
|
|
1021
|
-
},
|
|
1022
|
-
/**
|
|
1023
|
-
* Opens the popover on right click (context menu). If you set this value to `true`,
|
|
1024
|
-
* the default trigger behavior will be disabled.
|
|
1025
|
-
* @values true, false
|
|
1026
|
-
*/
|
|
1027
|
-
openOnContext: {
|
|
1028
|
-
type: Boolean,
|
|
1029
|
-
default: !1
|
|
1030
|
-
},
|
|
1031
|
-
/**
|
|
1032
|
-
* Element type (tag name) of the root element of the component.
|
|
1033
|
-
*/
|
|
1034
|
-
elementType: {
|
|
1035
|
-
type: String,
|
|
1036
|
-
default: "div"
|
|
1037
|
-
},
|
|
1038
|
-
/**
|
|
1039
|
-
* Named transition when the content display is toggled.
|
|
1040
|
-
* @see DtLazyShow
|
|
1041
|
-
*/
|
|
1042
|
-
transition: {
|
|
1043
|
-
type: String,
|
|
1044
|
-
default: "fade"
|
|
1045
|
-
},
|
|
1046
|
-
/**
|
|
1047
|
-
* ARIA role for the content of the popover. Defaults to "dialog".
|
|
1048
|
-
* <a class="d-link" href="https://www.w3.org/TR/wai-aria/#aria-haspopup" target="_blank">aria-haspopup</a>
|
|
1049
|
-
*/
|
|
1050
|
-
role: {
|
|
1051
|
-
type: String,
|
|
1052
|
-
default: "dialog",
|
|
1053
|
-
validator: (e) => Ge.includes(e)
|
|
1054
|
-
},
|
|
1055
|
-
/**
|
|
1056
|
-
* ID of the element that serves as the label for the popover content.
|
|
1057
|
-
* Defaults to the "anchor" element; this exists to provide a different
|
|
1058
|
-
* ID of the label element if, for example, the anchor slot contains
|
|
1059
|
-
* other items that do not serve as a label. You should provide this
|
|
1060
|
-
* or ariaLabel, but not both.
|
|
1061
|
-
*/
|
|
1062
|
-
ariaLabelledby: {
|
|
1063
|
-
type: String,
|
|
1064
|
-
default: null
|
|
1065
|
-
},
|
|
1066
|
-
/**
|
|
1067
|
-
* Descriptive label for the popover content. You should provide this
|
|
1068
|
-
* or ariaLabelledby, but not both.
|
|
1069
|
-
*/
|
|
1070
|
-
ariaLabel: {
|
|
1071
|
-
type: String,
|
|
1072
|
-
default: null
|
|
1073
|
-
},
|
|
1074
|
-
/**
|
|
1075
|
-
* A set of props to be passed into the popover's header close button.
|
|
1076
|
-
* Requires an 'ariaLabel' property, when the header popover is visible
|
|
1077
|
-
*/
|
|
1078
|
-
closeButtonProps: {
|
|
1079
|
-
type: Object,
|
|
1080
|
-
default: () => ({})
|
|
1081
|
-
},
|
|
1082
|
-
/**
|
|
1083
|
-
* Padding size class for the popover content.
|
|
1084
|
-
* @values none, small, medium, large
|
|
1085
|
-
*/
|
|
1086
|
-
padding: {
|
|
1087
|
-
type: String,
|
|
1088
|
-
default: "large",
|
|
1089
|
-
validator: (e) => Object.keys(q).some((t) => t === e)
|
|
1090
|
-
},
|
|
1091
|
-
/**
|
|
1092
|
-
* Additional class name for the content wrapper element.
|
|
1093
|
-
*/
|
|
1094
|
-
contentClass: {
|
|
1095
|
-
type: [String, Array, Object],
|
|
1096
|
-
default: ""
|
|
1097
|
-
},
|
|
1098
|
-
/**
|
|
1099
|
-
* Width configuration for the popover content. When its value is 'anchor',
|
|
1100
|
-
* the popover content will have the same width as the anchor.
|
|
1101
|
-
* @values null, anchor
|
|
1102
|
-
*/
|
|
1103
|
-
contentWidth: {
|
|
1104
|
-
type: String,
|
|
1105
|
-
default: "",
|
|
1106
|
-
validator: (e) => Ue.includes(e)
|
|
1107
|
-
},
|
|
1108
|
-
/**
|
|
1109
|
-
* Whether to apply transition on initial render in the content lazy show component.
|
|
1110
|
-
*/
|
|
1111
|
-
contentAppear: {
|
|
1112
|
-
type: Boolean,
|
|
1113
|
-
default: null
|
|
1114
|
-
},
|
|
1115
|
-
/**
|
|
1116
|
-
* Tabindex value for the content. Passing null, no tabindex attribute will be set.
|
|
1117
|
-
*/
|
|
1118
|
-
contentTabindex: {
|
|
1119
|
-
type: Number || null,
|
|
1120
|
-
default: -1
|
|
1121
|
-
},
|
|
1122
|
-
/**
|
|
1123
|
-
* External anchor id to use in those cases the anchor can't be provided via the slot.
|
|
1124
|
-
* For instance, using the combobox's input as the anchor for the popover.
|
|
1125
|
-
*/
|
|
1126
|
-
externalAnchor: {
|
|
1127
|
-
type: String,
|
|
1128
|
-
default: ""
|
|
1129
|
-
},
|
|
1130
|
-
/**
|
|
1131
|
-
* The id of the tooltip
|
|
1132
|
-
*/
|
|
1133
|
-
id: {
|
|
1134
|
-
type: String,
|
|
1135
|
-
default() {
|
|
1136
|
-
return N();
|
|
1137
|
-
}
|
|
1138
|
-
},
|
|
1139
|
-
/**
|
|
1140
|
-
* Displaces the content box from its anchor element
|
|
1141
|
-
* by the specified number of pixels.
|
|
1142
|
-
* <a
|
|
1143
|
-
* class="d-link"
|
|
1144
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#offset"
|
|
1145
|
-
* target="_blank"
|
|
1146
|
-
* >
|
|
1147
|
-
* Tippy.js docs
|
|
1148
|
-
* </a>
|
|
1149
|
-
*/
|
|
1150
|
-
offset: {
|
|
1151
|
-
type: Array,
|
|
1152
|
-
default: () => [0, 4]
|
|
1153
|
-
},
|
|
1154
|
-
/**
|
|
1155
|
-
* Determines if the popover hides upon clicking the
|
|
1156
|
-
* anchor or outside the content box.
|
|
1157
|
-
* @values true, false
|
|
1158
|
-
*/
|
|
1159
|
-
hideOnClick: {
|
|
1160
|
-
type: Boolean,
|
|
1161
|
-
default: !0
|
|
1162
|
-
},
|
|
1163
|
-
/**
|
|
1164
|
-
* Determines modal state. If enabled popover has a modal overlay
|
|
1165
|
-
* preventing interaction with elements below it, but it is invisible.
|
|
1166
|
-
* @values true, false
|
|
1167
|
-
*/
|
|
1168
|
-
modal: {
|
|
1169
|
-
type: Boolean,
|
|
1170
|
-
default: !0
|
|
1171
|
-
},
|
|
1172
|
-
/**
|
|
1173
|
-
* If the popover does not fit in the direction described by "placement",
|
|
1174
|
-
* it will attempt to change its direction to the "fallbackPlacements".
|
|
1175
|
-
* <a
|
|
1176
|
-
* class="d-link"
|
|
1177
|
-
* href="https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements"
|
|
1178
|
-
* target="_blank"
|
|
1179
|
-
* >
|
|
1180
|
-
* Popper.js docs
|
|
1181
|
-
* </a>
|
|
1182
|
-
* */
|
|
1183
|
-
fallbackPlacements: {
|
|
1184
|
-
type: Array,
|
|
1185
|
-
default: () => ["auto"]
|
|
1186
|
-
},
|
|
1187
|
-
/**
|
|
1188
|
-
* The direction the popover displays relative to the anchor.
|
|
1189
|
-
* <a
|
|
1190
|
-
* class="d-link"
|
|
1191
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#placement"
|
|
1192
|
-
* target="_blank"
|
|
1193
|
-
* >
|
|
1194
|
-
* Tippy.js docs
|
|
1195
|
-
* </a>
|
|
1196
|
-
* @values top, top-start, top-end,
|
|
1197
|
-
* right, right-start, right-end,
|
|
1198
|
-
* left, left-start, left-end,
|
|
1199
|
-
* bottom, bottom-start, bottom-end,
|
|
1200
|
-
* auto, auto-start, auto-end
|
|
1201
|
-
*/
|
|
1202
|
-
placement: {
|
|
1203
|
-
type: String,
|
|
1204
|
-
default: "bottom-end"
|
|
1205
|
-
},
|
|
1206
|
-
/**
|
|
1207
|
-
* If set to false the dialog will display over top of the anchor when there is insufficient space.
|
|
1208
|
-
* If set to true it will never move from its position relative to the anchor and will clip instead.
|
|
1209
|
-
* <a
|
|
1210
|
-
* class="d-link"
|
|
1211
|
-
* href="https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether"
|
|
1212
|
-
* target="_blank"
|
|
1213
|
-
* >
|
|
1214
|
-
* Popper.js docs
|
|
1215
|
-
* </a>
|
|
1216
|
-
* @values true, false
|
|
1217
|
-
*/
|
|
1218
|
-
tether: {
|
|
1219
|
-
type: Boolean,
|
|
1220
|
-
default: !0
|
|
1221
|
-
},
|
|
1222
|
-
/**
|
|
1223
|
-
* If the popover sticks to the anchor. This is usually not needed, but can be needed
|
|
1224
|
-
* if the reference element's position is animating, or to automatically update the popover
|
|
1225
|
-
* position in those cases the DOM layout changes the reference element's position.
|
|
1226
|
-
* `true` enables it, `reference` only checks the "reference" rect for changes and `popper` only
|
|
1227
|
-
* checks the "popper" rect for changes.
|
|
1228
|
-
* <a
|
|
1229
|
-
* class="d-link"
|
|
1230
|
-
* href="https://atomiks.github.io/tippyjs/v6/all-props/#sticky"
|
|
1231
|
-
* target="_blank"
|
|
1232
|
-
* >
|
|
1233
|
-
* Tippy.js docs
|
|
1234
|
-
* </a>
|
|
1235
|
-
* @values true, false, reference, popper
|
|
1236
|
-
*/
|
|
1237
|
-
sticky: {
|
|
1238
|
-
type: [Boolean, String],
|
|
1239
|
-
default: !1,
|
|
1240
|
-
validator: (e) => Xe.includes(e)
|
|
1241
|
-
},
|
|
1242
|
-
/**
|
|
1243
|
-
* Determines maximum height for the popover before overflow.
|
|
1244
|
-
* Possible units rem|px|em
|
|
1245
|
-
*/
|
|
1246
|
-
maxHeight: {
|
|
1247
|
-
type: String,
|
|
1248
|
-
default: ""
|
|
1249
|
-
},
|
|
1250
|
-
/**
|
|
1251
|
-
* Determines maximum width for the popover before overflow.
|
|
1252
|
-
* Possible units rem|px|%|em
|
|
1253
|
-
*/
|
|
1254
|
-
maxWidth: {
|
|
1255
|
-
type: String,
|
|
1256
|
-
default: ""
|
|
1257
|
-
},
|
|
1258
|
-
/**
|
|
1259
|
-
* Determines visibility for close button
|
|
1260
|
-
* @values true, false
|
|
1261
|
-
*/
|
|
1262
|
-
showCloseButton: {
|
|
1263
|
-
type: Boolean,
|
|
1264
|
-
default: !1
|
|
1265
|
-
},
|
|
1266
|
-
/**
|
|
1267
|
-
* Additional class name for the header content wrapper element.
|
|
1268
|
-
*/
|
|
1269
|
-
headerClass: {
|
|
1270
|
-
type: [String, Array, Object],
|
|
1271
|
-
default: ""
|
|
1272
|
-
},
|
|
1273
|
-
/**
|
|
1274
|
-
* Additional class name for the footer content wrapper element.
|
|
1275
|
-
*/
|
|
1276
|
-
footerClass: {
|
|
1277
|
-
type: [String, Array, Object],
|
|
1278
|
-
default: ""
|
|
1279
|
-
},
|
|
1280
|
-
/**
|
|
1281
|
-
* Additional class name for the dialog element.
|
|
1282
|
-
*/
|
|
1283
|
-
dialogClass: {
|
|
1284
|
-
type: [String, Array, Object],
|
|
1285
|
-
default: ""
|
|
1286
|
-
},
|
|
1287
|
-
/**
|
|
1288
|
-
* The element that is focused when the popover is opened. This can be an
|
|
1289
|
-
* HTMLElement within the popover, a string starting with '#' which will
|
|
1290
|
-
* find the element by ID. 'first' which will automatically focus
|
|
1291
|
-
* the first element, or 'dialog' which will focus the dialog window itself.
|
|
1292
|
-
* If the dialog is modal this prop cannot be 'none'.
|
|
1293
|
-
* @values none, dialog, first
|
|
1294
|
-
*/
|
|
1295
|
-
initialFocusElement: {
|
|
1296
|
-
type: [String, HTMLElement],
|
|
1297
|
-
default: "first",
|
|
1298
|
-
validator: (e) => Ye.includes(e) || e instanceof HTMLElement || e.startsWith("#")
|
|
1299
|
-
},
|
|
1300
|
-
/**
|
|
1301
|
-
* If the popover should open pressing up or down arrow key on the anchor element.
|
|
1302
|
-
* This can be set when not passing open prop.
|
|
1303
|
-
* @values true, false
|
|
1304
|
-
*/
|
|
1305
|
-
openWithArrowKeys: {
|
|
1306
|
-
type: Boolean,
|
|
1307
|
-
default: !1
|
|
1308
|
-
},
|
|
1309
|
-
/**
|
|
1310
|
-
* Sets the element to which the popover is going to append to.
|
|
1311
|
-
* 'body' will append to the nearest body (supports shadow DOM).
|
|
1312
|
-
* @values 'body', 'parent', HTMLElement,
|
|
1313
|
-
*/
|
|
1314
|
-
appendTo: {
|
|
1315
|
-
type: [HTMLElement, String],
|
|
1316
|
-
default: "body",
|
|
1317
|
-
validator: (e) => Ze.includes(e) || e instanceof HTMLElement
|
|
1318
|
-
},
|
|
1319
|
-
/**
|
|
1320
|
-
* Set this prop to true and popover component will support hovercard behaviour
|
|
1321
|
-
* It will open on mouseenter and close on mouseleave with timer delay of 300ms
|
|
1322
|
-
*/
|
|
1323
|
-
hovercard: {
|
|
1324
|
-
type: Boolean,
|
|
1325
|
-
default: !1
|
|
1326
|
-
},
|
|
1327
|
-
/**
|
|
1328
|
-
* The timer is used only when the hovercard prop is true.
|
|
1329
|
-
* It defines the delays when opening several hovercards.
|
|
1330
|
-
* It must have the keys: enter, leave and current.
|
|
1331
|
-
* If null, the default delay of 300ms will be used.
|
|
1332
|
-
*/
|
|
1333
|
-
timer: {
|
|
1334
|
-
type: [Object, null],
|
|
1335
|
-
default: null,
|
|
1336
|
-
validator: (e) => e === null || e.enter && e.leave && Object.keys(e).includes("current")
|
|
1337
|
-
}
|
|
1338
|
-
},
|
|
1339
|
-
emits: [
|
|
1340
|
-
/**
|
|
1341
|
-
* Native keydown event
|
|
1342
|
-
*
|
|
1343
|
-
* @event keydown
|
|
1344
|
-
* @type {KeyboardEvent}
|
|
1345
|
-
*/
|
|
1346
|
-
"keydown",
|
|
1347
|
-
/**
|
|
1348
|
-
* Event fired to sync the open prop with the parent component
|
|
1349
|
-
* @event update:open
|
|
1350
|
-
*/
|
|
1351
|
-
"update:open",
|
|
1352
|
-
/**
|
|
1353
|
-
* Emitted when popover is shown or hidden
|
|
1354
|
-
*
|
|
1355
|
-
* @event opened
|
|
1356
|
-
* @type {Boolean | Array}
|
|
1357
|
-
*/
|
|
1358
|
-
"opened"
|
|
1359
|
-
],
|
|
1360
|
-
data() {
|
|
1361
|
-
return {
|
|
1362
|
-
POPOVER_PADDING_CLASSES: q,
|
|
1363
|
-
POPOVER_HEADER_FOOTER_PADDING_CLASSES: We,
|
|
1364
|
-
intersectionObserver: null,
|
|
1365
|
-
isOutsideViewport: !1,
|
|
1366
|
-
isOpen: !1,
|
|
1367
|
-
toAppear: !1,
|
|
1368
|
-
anchorEl: null,
|
|
1369
|
-
popoverContentEl: null,
|
|
1370
|
-
hasSlotContent: j,
|
|
1371
|
-
inTimer: null,
|
|
1372
|
-
outTimer: null
|
|
1373
|
-
};
|
|
1374
|
-
},
|
|
1375
|
-
computed: {
|
|
1376
|
-
popoverListeners() {
|
|
1377
|
-
return {
|
|
1378
|
-
keydown: (e) => {
|
|
1379
|
-
this.onKeydown(e);
|
|
1380
|
-
},
|
|
1381
|
-
"after-leave": (e) => {
|
|
1382
|
-
this.onLeaveTransitionComplete();
|
|
1383
|
-
},
|
|
1384
|
-
"after-enter": (e) => {
|
|
1385
|
-
this.onEnterTransitionComplete();
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
},
|
|
1389
|
-
calculatedMaxHeight() {
|
|
1390
|
-
return this.isOutsideViewport && this.modal ? "calc(100vh - var(--dt-space-300))" : this.maxHeight;
|
|
1391
|
-
},
|
|
1392
|
-
labelledBy() {
|
|
1393
|
-
return this.ariaLabelledby || !this.ariaLabel && N("DtPopover__anchor");
|
|
1394
|
-
},
|
|
1395
|
-
currentHovercard() {
|
|
1396
|
-
var e;
|
|
1397
|
-
return (e = this.timer) == null ? void 0 : e.current;
|
|
1398
|
-
}
|
|
1399
|
-
},
|
|
1400
|
-
watch: {
|
|
1401
|
-
$props: {
|
|
1402
|
-
immediate: !0,
|
|
1403
|
-
deep: !0,
|
|
1404
|
-
handler() {
|
|
1405
|
-
this.validateProps();
|
|
1406
|
-
}
|
|
1407
|
-
},
|
|
1408
|
-
modal(e) {
|
|
1409
|
-
var t;
|
|
1410
|
-
(t = this.tip) == null || t.setProps({
|
|
1411
|
-
zIndex: e ? 650 : this.calculateAnchorZindex()
|
|
1412
|
-
});
|
|
1413
|
-
},
|
|
1414
|
-
offset(e) {
|
|
1415
|
-
var t;
|
|
1416
|
-
(t = this.tip) == null || t.setProps({
|
|
1417
|
-
offset: e
|
|
1418
|
-
});
|
|
1419
|
-
},
|
|
1420
|
-
sticky(e) {
|
|
1421
|
-
var t;
|
|
1422
|
-
(t = this.tip) == null || t.setProps({
|
|
1423
|
-
sticky: e
|
|
1424
|
-
});
|
|
1425
|
-
},
|
|
1426
|
-
fallbackPlacements() {
|
|
1427
|
-
var e;
|
|
1428
|
-
(e = this.tip) == null || e.setProps({
|
|
1429
|
-
popperOptions: this.popperOptions()
|
|
1430
|
-
});
|
|
1431
|
-
},
|
|
1432
|
-
tether() {
|
|
1433
|
-
var e;
|
|
1434
|
-
(e = this.tip) == null || e.setProps({
|
|
1435
|
-
popperOptions: this.popperOptions()
|
|
1436
|
-
});
|
|
1437
|
-
},
|
|
1438
|
-
placement(e) {
|
|
1439
|
-
var t;
|
|
1440
|
-
(t = this.tip) == null || t.setProps({
|
|
1441
|
-
placement: e
|
|
1442
|
-
});
|
|
1443
|
-
},
|
|
1444
|
-
open: {
|
|
1445
|
-
handler: function(e) {
|
|
1446
|
-
e !== null && (this.isOpen = e), e === !0 && (this.toAppear = !0);
|
|
1447
|
-
},
|
|
1448
|
-
immediate: !0
|
|
1449
|
-
},
|
|
1450
|
-
contentAppear: {
|
|
1451
|
-
handler: function(e) {
|
|
1452
|
-
e !== null && (this.toAppear = e);
|
|
1453
|
-
}
|
|
1454
|
-
},
|
|
1455
|
-
isOpen(e, t) {
|
|
1456
|
-
e ? (this.initTippyInstance(), this.tip.show()) : !e && t !== e && (this.removeEventListeners(), this.tip.hide());
|
|
1457
|
-
},
|
|
1458
|
-
currentHovercard() {
|
|
1459
|
-
this.hovercard && this.timer && (this.currentHovercard === this.id ? this.isOpen = !0 : this.isOpen = !1);
|
|
1460
|
-
}
|
|
1461
|
-
},
|
|
1462
|
-
mounted() {
|
|
1463
|
-
const e = this.externalAnchor ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`) : null;
|
|
1464
|
-
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);
|
|
1465
|
-
},
|
|
1466
|
-
beforeUnmount() {
|
|
1467
|
-
var e;
|
|
1468
|
-
(e = this.tip) == null || e.destroy(), this.intersectionObserver.disconnect(), this.removeReferences(), this.removeEventListeners();
|
|
1469
|
-
},
|
|
1470
|
-
/******************
|
|
1471
|
-
* METHODS *
|
|
1472
|
-
******************/
|
|
1473
|
-
methods: {
|
|
1474
|
-
hasIntersectedViewport(e) {
|
|
1475
|
-
var o;
|
|
1476
|
-
const t = (o = e == null ? void 0 : e[0]) == null ? void 0 : o.target;
|
|
1477
|
-
if (!t)
|
|
1478
|
-
return;
|
|
1479
|
-
const s = J(t);
|
|
1480
|
-
this.isOutsideViewport = s.bottom || s.top;
|
|
1481
|
-
},
|
|
1482
|
-
popperOptions() {
|
|
1483
|
-
return Q({
|
|
1484
|
-
fallbackPlacements: this.fallbackPlacements,
|
|
1485
|
-
tether: this.tether,
|
|
1486
|
-
hasHideModifierEnabled: !0
|
|
1487
|
-
});
|
|
1488
|
-
},
|
|
1489
|
-
validateProps() {
|
|
1490
|
-
this.modal && this.initialFocusElement === "none" && console.error('If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement');
|
|
1491
|
-
},
|
|
1492
|
-
calculateAnchorZindex() {
|
|
1493
|
-
var e;
|
|
1494
|
-
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
|
|
1495
|
-
// anchor of popover is within a drawer.
|
|
1496
|
-
(e = this.anchorEl) != null && e.closest(".d-zi-drawer") ? 650 : 300;
|
|
1497
|
-
},
|
|
1498
|
-
defaultToggleOpen(e) {
|
|
1499
|
-
var t, s, o;
|
|
1500
|
-
if (!this.hovercard && !this.openOnContext && (this.open === null || this.open === void 0)) {
|
|
1501
|
-
if (!((t = this.anchorEl) != null && t.contains(e.target)) && !((s = this.anchorEl) != null && s.isEqualNode(e.target)) || (o = this.anchorEl) != null && o.disabled)
|
|
1502
|
-
return;
|
|
1503
|
-
this.toggleOpen();
|
|
1504
|
-
}
|
|
1505
|
-
},
|
|
1506
|
-
async onContext(e) {
|
|
1507
|
-
this.openOnContext && (e.preventDefault(), this.isOpen = !0, await this.$nextTick(), this.tip.setProps({
|
|
1508
|
-
placement: "right-start",
|
|
1509
|
-
getReferenceClientRect: () => ({
|
|
1510
|
-
width: 0,
|
|
1511
|
-
height: 0,
|
|
1512
|
-
top: e.clientY,
|
|
1513
|
-
bottom: e.clientY,
|
|
1514
|
-
left: e.clientX,
|
|
1515
|
-
right: e.clientX
|
|
1516
|
-
})
|
|
1517
|
-
}));
|
|
1518
|
-
},
|
|
1519
|
-
toggleOpen() {
|
|
1520
|
-
this.isOpen = !this.isOpen;
|
|
1521
|
-
},
|
|
1522
|
-
onArrowKeyPress(e) {
|
|
1523
|
-
var t;
|
|
1524
|
-
this.open === null && (this.openWithArrowKeys && ((t = this.anchorEl) != null && t.contains(e.target)) && (this.isOpen || (this.isOpen = !0)), this.$emit("keydown", e));
|
|
1525
|
-
},
|
|
1526
|
-
addEventListeners() {
|
|
1527
|
-
window.addEventListener("dt-popover-close", this.closePopover), this.contentWidth === "anchor" && window.addEventListener("resize", this.onResize);
|
|
1528
|
-
},
|
|
1529
|
-
removeEventListeners() {
|
|
1530
|
-
window.removeEventListener("dt-popover-close", this.closePopover), this.contentWidth === "anchor" && window.removeEventListener("resize", this.onResize);
|
|
1531
|
-
},
|
|
1532
|
-
closePopover() {
|
|
1533
|
-
this.isOpen = !1;
|
|
1534
|
-
},
|
|
1535
|
-
/*
|
|
1536
|
-
* Prevents scrolling outside of the currently opened modal popover by:
|
|
1537
|
-
* - when anchor is not within another popover: setting the body to overflow: hidden
|
|
1538
|
-
* - when anchor is within another popover: set the popover dialog container to it's non-modal z-index
|
|
1539
|
-
* since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.
|
|
1540
|
-
**/
|
|
1541
|
-
preventScrolling() {
|
|
1542
|
-
var e;
|
|
1543
|
-
if (this.modal) {
|
|
1544
|
-
const t = (e = this.anchorEl) == null ? void 0 : e.closest("body, .tippy-box");
|
|
1545
|
-
t.tagName.toLowerCase() === "body" ? (t.classList.add("d-of-hidden"), this.tip.setProps({ offset: this.offset })) : t.classList.add("d-zi-popover");
|
|
1546
|
-
}
|
|
1547
|
-
},
|
|
1548
|
-
/*
|
|
1549
|
-
* Resets the prevent scrolling properties set in preventScrolling() back to normal.
|
|
1550
|
-
**/
|
|
1551
|
-
enableScrolling() {
|
|
1552
|
-
var t, s;
|
|
1553
|
-
const e = (t = this.anchorEl) == null ? void 0 : t.closest("body, .tippy-box");
|
|
1554
|
-
e && (((s = e.tagName) == null ? void 0 : s.toLowerCase()) === "body" ? (e.classList.remove("d-of-hidden"), this.tip.setProps({ offset: this.offset })) : e.classList.remove("d-zi-popover"));
|
|
1555
|
-
},
|
|
1556
|
-
removeReferences() {
|
|
1557
|
-
this.anchorEl = null, this.popoverContentEl = null, this.tip = null;
|
|
1558
|
-
},
|
|
1559
|
-
async onShow() {
|
|
1560
|
-
this.contentWidth === "anchor" && await this.setPopoverContentAnchorWidth(), this.contentWidth === null && (this.popoverContentEl.style.width = "auto"), this.addEventListeners();
|
|
1561
|
-
},
|
|
1562
|
-
async onLeaveTransitionComplete() {
|
|
1563
|
-
var e;
|
|
1564
|
-
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);
|
|
1565
|
-
},
|
|
1566
|
-
async onEnterTransitionComplete() {
|
|
1567
|
-
this.focusInitialElement(), await this.$nextTick(), this.preventScrolling(), this.$emit("opened", !0, this.$refs.popover__content), this.open !== null && this.$emit("update:open", !0);
|
|
1568
|
-
},
|
|
1569
|
-
focusInitialElement() {
|
|
1570
|
-
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();
|
|
1571
|
-
},
|
|
1572
|
-
focusInitialElementById() {
|
|
1573
|
-
var t, s, o;
|
|
1574
|
-
const e = (s = (t = this.$refs.content) == null ? void 0 : t.$el) == null ? void 0 : s.querySelector(this.initialFocusElement);
|
|
1575
|
-
e ? e.focus() : console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.'), e ? e.focus() : (o = this.$refs.content) == null || o.$el.focus();
|
|
1576
|
-
},
|
|
1577
|
-
onResize() {
|
|
1578
|
-
this.closePopover();
|
|
1579
|
-
},
|
|
1580
|
-
onClickOutside() {
|
|
1581
|
-
if (!this.hideOnClick)
|
|
1582
|
-
return;
|
|
1583
|
-
this.popoverContentEl.querySelector(".d-popover__anchor--opened") || this.closePopover();
|
|
1584
|
-
},
|
|
1585
|
-
onKeydown(e) {
|
|
1586
|
-
e.key === "Tab" && this.modal && this.focusTrappedTabPress(e, this.popoverContentEl), e.key === "Escape" && this.closePopover(), this.$emit("keydown", e);
|
|
1587
|
-
},
|
|
1588
|
-
async setPopoverContentAnchorWidth() {
|
|
1589
|
-
var e;
|
|
1590
|
-
await this.$nextTick(), this.popoverContentEl.style.width = `${(e = this.anchorEl) == null ? void 0 : e.clientWidth}px`;
|
|
1591
|
-
},
|
|
1592
|
-
focusFirstElementIfNeeded(e) {
|
|
1593
|
-
var s, o;
|
|
1594
|
-
this._getFocusableElements(e, !0).length !== 0 ? this.focusFirstElement(e) : this.showCloseButton ? (s = this.$refs.popover__header) == null || s.focusCloseButton() : (o = this.$refs.content) == null || o.$el.focus();
|
|
1595
|
-
},
|
|
1596
|
-
initTippyInstance() {
|
|
1597
|
-
var e, t;
|
|
1598
|
-
this.tip = ee(this.anchorEl, {
|
|
1599
|
-
popperOptions: this.popperOptions(),
|
|
1600
|
-
contentElement: this.popoverContentEl,
|
|
1601
|
-
placement: this.placement,
|
|
1602
|
-
offset: this.offset,
|
|
1603
|
-
sticky: this.sticky,
|
|
1604
|
-
appendTo: this.appendTo === "body" ? (t = (e = this.anchorEl) == null ? void 0 : e.getRootNode()) == null ? void 0 : t.querySelector("body") : this.appendTo,
|
|
1605
|
-
interactive: !0,
|
|
1606
|
-
trigger: "manual",
|
|
1607
|
-
// We have to manage hideOnClick functionality manually to handle
|
|
1608
|
-
// popover within popover situations.
|
|
1609
|
-
hideOnClick: !1,
|
|
1610
|
-
zIndex: this.modal ? 650 : this.calculateAnchorZindex(),
|
|
1611
|
-
onClickOutside: this.onClickOutside,
|
|
1612
|
-
onShow: this.onShow
|
|
1613
|
-
});
|
|
1614
|
-
},
|
|
1615
|
-
// ============================================================================
|
|
1616
|
-
// $ HOVERCARD
|
|
1617
|
-
// ----------------------------------------------------------------------------
|
|
1618
|
-
setInTimer() {
|
|
1619
|
-
this.inTimer = setTimeout(() => {
|
|
1620
|
-
this.isOpen = !0;
|
|
1621
|
-
}, F);
|
|
1622
|
-
},
|
|
1623
|
-
setOutTimer() {
|
|
1624
|
-
this.outTimer = setTimeout(() => {
|
|
1625
|
-
this.isOpen = !1;
|
|
1626
|
-
}, F);
|
|
1627
|
-
},
|
|
1628
|
-
onEnterAnchor() {
|
|
1629
|
-
this.hovercard && (this.timer ? this.timer.enter(this.id) : (clearTimeout(this.outTimer), this.setInTimer()));
|
|
1630
|
-
},
|
|
1631
|
-
onLeaveAnchor() {
|
|
1632
|
-
this.hovercard && (this.timer ? this.timer.leave() : (clearTimeout(this.inTimer), this.setOutTimer()));
|
|
1633
|
-
},
|
|
1634
|
-
onEnterContent() {
|
|
1635
|
-
this.hovercard && (this.timer ? this.timer.enter(this.id) : clearTimeout(this.outTimer));
|
|
1636
|
-
},
|
|
1637
|
-
onLeaveContent() {
|
|
1638
|
-
this.hovercard && (this.timer ? this.timer.leave() : this.setOutTimer());
|
|
1639
|
-
}
|
|
1640
|
-
// ============================================================================
|
|
1641
|
-
// $ HOVERCARD
|
|
1642
|
-
// ----------------------------------------------------------------------------
|
|
1643
|
-
}
|
|
1644
|
-
}, st = ["aria-hidden"], nt = ["id", "data-qa", "tabindex"], at = ["data-qa"];
|
|
1645
|
-
function it(e, t, s, o, a, n) {
|
|
1646
|
-
const p = m("popover-header-footer"), v = m("sr-only-close-button"), S = m("dt-lazy-show");
|
|
1647
|
-
return i(), r("div", null, [
|
|
1648
|
-
s.modal && a.isOpen ? (i(), h(ne, {
|
|
1649
|
-
key: 0,
|
|
1650
|
-
to: "body"
|
|
1651
|
-
}, [
|
|
1652
|
-
E("div", {
|
|
1653
|
-
class: "d-modal--transparent",
|
|
1654
|
-
"aria-hidden": s.modal && a.isOpen ? "false" : "true",
|
|
1655
|
-
onClick: t[0] || (t[0] = A(() => {
|
|
1656
|
-
}, ["prevent", "stop"]))
|
|
1657
|
-
}, null, 8, st)
|
|
1658
|
-
])) : d("", !0),
|
|
1659
|
-
(i(), h(b(s.elementType), {
|
|
1660
|
-
ref: "popover",
|
|
1661
|
-
class: u(["d-popover", { "d-popover__anchor--opened": a.isOpen }]),
|
|
1662
|
-
"data-qa": "dt-popover-container"
|
|
1663
|
-
}, {
|
|
1664
|
-
default: f(() => [
|
|
1665
|
-
E("div", {
|
|
1666
|
-
id: !s.ariaLabelledby && n.labelledBy,
|
|
1667
|
-
ref: "anchor",
|
|
1668
|
-
"data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}-anchor` : "dt-popover-anchor",
|
|
1669
|
-
tabindex: s.openOnContext ? 0 : void 0,
|
|
1670
|
-
onClickCapture: t[1] || (t[1] = (...l) => n.defaultToggleOpen && n.defaultToggleOpen(...l)),
|
|
1671
|
-
onContextmenu: t[2] || (t[2] = (...l) => n.onContext && n.onContext(...l)),
|
|
1672
|
-
onKeydown: [
|
|
1673
|
-
t[3] || (t[3] = g(A((...l) => n.onArrowKeyPress && n.onArrowKeyPress(...l), ["prevent"]), ["up"])),
|
|
1674
|
-
t[4] || (t[4] = g(A((...l) => n.onArrowKeyPress && n.onArrowKeyPress(...l), ["prevent"]), ["down"])),
|
|
1675
|
-
t[6] || (t[6] = g((l) => e.$emit("keydown", l), ["enter"])),
|
|
1676
|
-
t[7] || (t[7] = g((l) => e.$emit("keydown", l), ["space"]))
|
|
1677
|
-
],
|
|
1678
|
-
onKeydownCapture: t[5] || (t[5] = g((...l) => n.closePopover && n.closePopover(...l), ["escape"])),
|
|
1679
|
-
onMouseenter: t[8] || (t[8] = (...l) => n.onEnterAnchor && n.onEnterAnchor(...l)),
|
|
1680
|
-
onMouseleave: t[9] || (t[9] = (...l) => n.onLeaveAnchor && n.onLeaveAnchor(...l))
|
|
1681
|
-
}, [
|
|
1682
|
-
c(e.$slots, "anchor", {
|
|
1683
|
-
attrs: {
|
|
1684
|
-
"aria-expanded": a.isOpen.toString(),
|
|
1685
|
-
"aria-controls": s.id,
|
|
1686
|
-
"aria-haspopup": s.role
|
|
1687
|
-
}
|
|
1688
|
-
})
|
|
1689
|
-
], 40, nt),
|
|
1690
|
-
P(S, w({
|
|
1691
|
-
id: s.id,
|
|
1692
|
-
ref: "content",
|
|
1693
|
-
role: s.role,
|
|
1694
|
-
"data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}__dialog` : "dt-popover",
|
|
1695
|
-
"aria-hidden": `${!a.isOpen}`,
|
|
1696
|
-
"aria-labelledby": n.labelledBy,
|
|
1697
|
-
"aria-label": s.ariaLabel,
|
|
1698
|
-
"aria-modal": `${!s.modal}`,
|
|
1699
|
-
transition: s.transition,
|
|
1700
|
-
show: a.isOpen,
|
|
1701
|
-
appear: a.toAppear,
|
|
1702
|
-
class: ["d-popover__dialog", { "d-popover__dialog--modal": s.modal }, s.dialogClass],
|
|
1703
|
-
style: {
|
|
1704
|
-
"max-height": n.calculatedMaxHeight,
|
|
1705
|
-
"max-width": s.maxWidth
|
|
1706
|
-
},
|
|
1707
|
-
css: e.$attrs.css,
|
|
1708
|
-
tabindex: s.contentTabindex
|
|
1709
|
-
}, K(n.popoverListeners), {
|
|
1710
|
-
onMouseenter: n.onEnterContent,
|
|
1711
|
-
onMouseleave: n.onLeaveContent
|
|
1712
|
-
}), {
|
|
1713
|
-
default: f(() => [
|
|
1714
|
-
a.hasSlotContent(e.$slots.headerContent) || s.showCloseButton ? (i(), h(p, {
|
|
1715
|
-
key: 0,
|
|
1716
|
-
ref: "popover__header",
|
|
1717
|
-
class: u(a.POPOVER_HEADER_FOOTER_PADDING_CLASSES[s.padding]),
|
|
1718
|
-
"content-class": s.headerClass,
|
|
1719
|
-
type: "header",
|
|
1720
|
-
"show-close-button": s.showCloseButton,
|
|
1721
|
-
"close-button-props": s.closeButtonProps,
|
|
1722
|
-
onClose: n.closePopover
|
|
1723
|
-
}, {
|
|
1724
|
-
content: f(() => [
|
|
1725
|
-
c(e.$slots, "headerContent", { close: n.closePopover })
|
|
1726
|
-
]),
|
|
1727
|
-
_: 3
|
|
1728
|
-
}, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : d("", !0),
|
|
1729
|
-
E("div", {
|
|
1730
|
-
ref: "popover__content",
|
|
1731
|
-
"data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}-content` : "dt-popover-content",
|
|
1732
|
-
class: u([
|
|
1733
|
-
"d-popover__content",
|
|
1734
|
-
a.POPOVER_PADDING_CLASSES[s.padding],
|
|
1735
|
-
s.contentClass
|
|
1736
|
-
])
|
|
1737
|
-
}, [
|
|
1738
|
-
c(e.$slots, "content", { close: n.closePopover })
|
|
1739
|
-
], 10, at),
|
|
1740
|
-
a.hasSlotContent(e.$slots.footerContent) ? (i(), h(p, {
|
|
1741
|
-
key: 1,
|
|
1742
|
-
ref: "popover__footer",
|
|
1743
|
-
type: "footer",
|
|
1744
|
-
class: u(a.POPOVER_HEADER_FOOTER_PADDING_CLASSES[s.padding]),
|
|
1745
|
-
"content-class": s.footerClass
|
|
1746
|
-
}, {
|
|
1747
|
-
content: f(() => [
|
|
1748
|
-
c(e.$slots, "footerContent", { close: n.closePopover })
|
|
1749
|
-
]),
|
|
1750
|
-
_: 3
|
|
1751
|
-
}, 8, ["class", "content-class"])) : d("", !0),
|
|
1752
|
-
e.showVisuallyHiddenClose ? (i(), h(v, {
|
|
1753
|
-
key: 2,
|
|
1754
|
-
"visually-hidden-close-label": e.visuallyHiddenCloseLabel,
|
|
1755
|
-
onClose: n.closePopover
|
|
1756
|
-
}, null, 8, ["visually-hidden-close-label", "onClose"])) : d("", !0)
|
|
1757
|
-
]),
|
|
1758
|
-
_: 3
|
|
1759
|
-
}, 16, ["id", "role", "data-qa", "aria-hidden", "aria-labelledby", "aria-label", "aria-modal", "transition", "show", "appear", "class", "style", "css", "tabindex", "onMouseenter", "onMouseleave"])
|
|
1760
|
-
]),
|
|
1761
|
-
_: 3
|
|
1762
|
-
}, 8, ["class"]))
|
|
1763
|
-
]);
|
|
1764
|
-
}
|
|
1765
|
-
const Et = /* @__PURE__ */ y(tt, [["render", it]]);
|
|
1766
|
-
function x(e) {
|
|
1767
|
-
return e === _.default;
|
|
1768
|
-
}
|
|
1769
|
-
function M(e) {
|
|
1770
|
-
if (O(e) === "string")
|
|
1771
|
-
return x(e) ? null : _[e];
|
|
1772
|
-
if (O(e) === "object") {
|
|
1773
|
-
const { default: t } = e;
|
|
1774
|
-
return x(t) ? null : _[t];
|
|
1775
|
-
} else
|
|
1776
|
-
return null;
|
|
1777
|
-
}
|
|
1778
|
-
function O(e) {
|
|
1779
|
-
return typeof e;
|
|
1780
|
-
}
|
|
1781
|
-
function ot(e) {
|
|
1782
|
-
return M(e) ? `d-stack--${_[M(e)]}` : null;
|
|
1783
|
-
}
|
|
1784
|
-
function lt(e) {
|
|
1785
|
-
return O(e) === "object" ? [
|
|
1786
|
-
...W.map((t) => e[t] ? `d-stack--${t}--${e[t]}` : null)
|
|
1787
|
-
] : null;
|
|
1788
|
-
}
|
|
1789
|
-
function rt(e) {
|
|
1790
|
-
return R.includes(e) ? `d-stack--gap-${e}` : null;
|
|
1791
|
-
}
|
|
1792
|
-
function dt(e) {
|
|
1793
|
-
if (O(e) === "string")
|
|
1794
|
-
return Object.keys(_).includes(e);
|
|
1795
|
-
if (O(e) === "object") {
|
|
1796
|
-
const { default: t } = e;
|
|
1797
|
-
return Object.keys(_).includes(t);
|
|
1798
|
-
} else
|
|
1799
|
-
return null;
|
|
1800
|
-
}
|
|
1801
|
-
function ct(e) {
|
|
1802
|
-
return R.includes(e);
|
|
1803
|
-
}
|
|
1804
|
-
const ut = {
|
|
1805
|
-
name: "DtStack",
|
|
1806
|
-
props: {
|
|
1807
|
-
/**
|
|
1808
|
-
* Set this prop to the direction to stack the items.
|
|
1809
|
-
* You can override the default direction with 'default' key.
|
|
1810
|
-
* All the undefined breakpoints will have 'default' value.
|
|
1811
|
-
* By default, for the column direction it will have `justify-content: flex-start`
|
|
1812
|
-
* and for the row direction `align-items: center`. This can be overriden
|
|
1813
|
-
* by utility classes.
|
|
1814
|
-
*/
|
|
1815
|
-
direction: {
|
|
1816
|
-
type: [String, Object],
|
|
1817
|
-
default: "column",
|
|
1818
|
-
validator: (e) => dt(e)
|
|
1819
|
-
},
|
|
1820
|
-
/**
|
|
1821
|
-
* Set this prop to render stack as a specific HTML element.
|
|
1822
|
-
*/
|
|
1823
|
-
as: {
|
|
1824
|
-
type: String,
|
|
1825
|
-
default: "div"
|
|
1826
|
-
},
|
|
1827
|
-
/**
|
|
1828
|
-
* Set this prop to have the space between each stack item
|
|
1829
|
-
* @values 0, 100, 200, 300, 400, 500, 600
|
|
1830
|
-
*/
|
|
1831
|
-
gap: {
|
|
1832
|
-
type: String,
|
|
1833
|
-
default: "0",
|
|
1834
|
-
validator: (e) => ct(e)
|
|
1835
|
-
}
|
|
1836
|
-
},
|
|
1837
|
-
data() {
|
|
1838
|
-
return {
|
|
1839
|
-
DT_STACK_DIRECTION: _,
|
|
1840
|
-
DT_STACK_GAP: R,
|
|
1841
|
-
DT_STACK_RESPONSIVE_BREAKPOINTS: W
|
|
1842
|
-
};
|
|
1843
|
-
},
|
|
1844
|
-
computed: {
|
|
1845
|
-
stackGap() {
|
|
1846
|
-
return rt(this.gap);
|
|
1847
|
-
},
|
|
1848
|
-
defaultDirection() {
|
|
1849
|
-
return ot(this.direction);
|
|
1850
|
-
},
|
|
1851
|
-
stackResponsive() {
|
|
1852
|
-
return lt(this.direction);
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
};
|
|
1856
|
-
function ht(e, t, s, o, a, n) {
|
|
1857
|
-
return i(), h(b(s.as), {
|
|
1858
|
-
class: u([
|
|
1859
|
-
"d-stack",
|
|
1860
|
-
n.defaultDirection,
|
|
1861
|
-
n.stackResponsive,
|
|
1862
|
-
n.stackGap
|
|
1863
|
-
])
|
|
1864
|
-
}, {
|
|
1865
|
-
default: f(() => [
|
|
1866
|
-
c(e.$slots, "default")
|
|
1867
|
-
]),
|
|
1868
|
-
_: 3
|
|
1869
|
-
}, 8, ["class"]);
|
|
1870
|
-
}
|
|
1871
|
-
const bt = /* @__PURE__ */ y(ut, [["render", ht]]);
|
|
1872
|
-
export {
|
|
1873
|
-
L as A,
|
|
1874
|
-
_t as D,
|
|
1875
|
-
I as L,
|
|
1876
|
-
Fe as M,
|
|
1877
|
-
Ze as P,
|
|
1878
|
-
De as S,
|
|
1879
|
-
bt as a,
|
|
1880
|
-
vt as b,
|
|
1881
|
-
yt as c,
|
|
1882
|
-
Et as d,
|
|
1883
|
-
Pe as e,
|
|
1884
|
-
R as f,
|
|
1885
|
-
q as g,
|
|
1886
|
-
Ue as h,
|
|
1887
|
-
B as i,
|
|
1888
|
-
pe as j,
|
|
1889
|
-
me as k,
|
|
1890
|
-
H as l,
|
|
1891
|
-
ye as m,
|
|
1892
|
-
ve as n,
|
|
1893
|
-
V as o,
|
|
1894
|
-
D as p,
|
|
1895
|
-
We as q,
|
|
1896
|
-
Ge as r,
|
|
1897
|
-
Ye as s,
|
|
1898
|
-
Xe as t,
|
|
1899
|
-
gt as u,
|
|
1900
|
-
fe as v,
|
|
1901
|
-
C as w,
|
|
1902
|
-
re as x,
|
|
1903
|
-
_ as y,
|
|
1904
|
-
W as z
|
|
1905
|
-
};
|