@dialpad/dialtone-vue 3.85.0 → 3.86.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 +18 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +6 -6
- package/dist/dialtone-vue.js +1426 -1408
- package/dist/emoji-bd8527a3.cjs +25 -0
- package/dist/{emoji-3ed8aeab.js → emoji-c109b6ee.js} +9419 -9758
- package/dist/emoji.cjs +1 -1
- package/dist/emoji.js +112 -31
- package/dist/message_input.cjs +1 -1
- package/dist/message_input.js +2 -2
- package/dist/{notice-702ad033.js → notice-c5521e01.js} +98 -91
- package/dist/notice-f2b0212d.cjs +2 -0
- package/dist/style.css +1 -1
- package/dist/types/common/utils.d.ts +16 -0
- package/dist/types/common/utils.d.ts.map +1 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +23 -2
- package/dist/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/types/components/avatar/avatar_constants.d.ts +1 -1
- package/dist/types/components/avatar/avatar_constants.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +1 -1
- package/dist/types/components/notice/notice.vue.d.ts +1 -1
- package/dist/types/components/radio/radio.vue.d.ts +1 -1
- package/dist/types/components/toast/toast.vue.d.ts +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +4 -2
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/callbox/callbox.vue.d.ts +20 -1
- package/dist/types/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/package.json +19 -21
- package/dist/emoji-9b6e4b5a.cjs +0 -25
- package/dist/emoji_text_wrapper-4fc20727.js +0 -86
- package/dist/emoji_text_wrapper-b1235087.cjs +0 -1
- package/dist/notice-119b7aa6.cjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _, D as E, h as P,
|
|
2
|
-
import { resolveComponent as c, openBlock as l, createElementBlock as
|
|
3
|
-
const
|
|
1
|
+
import { _ as v, D as E, h as P, a as L, u as R, T as V, b as q, g as A, i as M, c as x, d as K } from "./emoji-c109b6ee.js";
|
|
2
|
+
import { resolveComponent as c, openBlock as l, createElementBlock as h, renderSlot as a, createVNode as _, createCommentVNode as r, createTextVNode as z, toDisplayString as W, createElementVNode as C, createBlock as f, withKeys as g, withModifiers as S, withCtx as d, mergeProps as k, resolveDynamicComponent as w, normalizeClass as b, toHandlers as D, createSlots as j, renderList as U, Teleport as Y } from "vue";
|
|
3
|
+
const $ = ["base", "error", "info", "success", "warning"], G = ["alert", "alertdialog", "status"], Z = /* @__PURE__ */ new Map([
|
|
4
4
|
["info", "info"],
|
|
5
5
|
["success", "check-circle"],
|
|
6
6
|
["warning", "alert-triangle"],
|
|
@@ -20,7 +20,7 @@ const F = ["base", "error", "info", "success", "warning"], G = ["alert", "alertd
|
|
|
20
20
|
type: String,
|
|
21
21
|
default: "base",
|
|
22
22
|
validate(e) {
|
|
23
|
-
return
|
|
23
|
+
return $.includes(e);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -41,16 +41,16 @@ const F = ["base", "error", "info", "success", "warning"], G = ["alert", "alertd
|
|
|
41
41
|
};
|
|
42
42
|
function Q(e, t, o, i, n, s) {
|
|
43
43
|
const u = c("dt-icon");
|
|
44
|
-
return s.defaultIcon || n.hasSlotContent(e.$slots.default) ? (l(),
|
|
44
|
+
return s.defaultIcon || n.hasSlotContent(e.$slots.default) ? (l(), h("div", J, [
|
|
45
45
|
a(e.$slots, "default", {}, () => [
|
|
46
|
-
|
|
46
|
+
_(u, {
|
|
47
47
|
name: s.defaultIcon,
|
|
48
48
|
size: "400"
|
|
49
49
|
}, null, 8, ["name"])
|
|
50
50
|
])
|
|
51
51
|
])) : r("", !0);
|
|
52
52
|
}
|
|
53
|
-
const ee = /* @__PURE__ */
|
|
53
|
+
const ee = /* @__PURE__ */ v(X, [["render", Q]]), te = {
|
|
54
54
|
name: "DtNoticeContent",
|
|
55
55
|
props: {
|
|
56
56
|
/**
|
|
@@ -87,8 +87,8 @@ const ee = /* @__PURE__ */ _(X, [["render", Q]]), te = {
|
|
|
87
87
|
"data-qa": "notice-content"
|
|
88
88
|
}, se = ["id"], ne = ["id"];
|
|
89
89
|
function ie(e, t, o, i, n, s) {
|
|
90
|
-
return l(),
|
|
91
|
-
o.title || n.hasSlotContent(e.$slots.titleOverride) ? (l(),
|
|
90
|
+
return l(), h("div", oe, [
|
|
91
|
+
o.title || n.hasSlotContent(e.$slots.titleOverride) ? (l(), h("p", {
|
|
92
92
|
key: 0,
|
|
93
93
|
id: o.titleId,
|
|
94
94
|
class: "d-notice__title",
|
|
@@ -107,7 +107,7 @@ function ie(e, t, o, i, n, s) {
|
|
|
107
107
|
], 8, ne)
|
|
108
108
|
]);
|
|
109
109
|
}
|
|
110
|
-
const le = /* @__PURE__ */
|
|
110
|
+
const le = /* @__PURE__ */ v(te, [["render", ie]]), I = {
|
|
111
111
|
props: {
|
|
112
112
|
/**
|
|
113
113
|
* If true, a hidden close button is included for screen readers
|
|
@@ -180,17 +180,17 @@ function re(e, t, o, i, n, s) {
|
|
|
180
180
|
onKeydown: g(S(s.close, ["prevent", "stop"]), ["space"])
|
|
181
181
|
}, {
|
|
182
182
|
default: d(() => [
|
|
183
|
-
|
|
183
|
+
_(u, { name: "close" })
|
|
184
184
|
]),
|
|
185
185
|
_: 1
|
|
186
186
|
}, 8, ["aria-label", "onClick", "onKeydown"]);
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const F = /* @__PURE__ */ v(ae, [["render", re]]), de = {
|
|
189
189
|
name: "DtNoticeAction",
|
|
190
190
|
components: {
|
|
191
191
|
DtIcon: E,
|
|
192
192
|
DtButton: L,
|
|
193
|
-
SrOnlyCloseButton:
|
|
193
|
+
SrOnlyCloseButton: F
|
|
194
194
|
},
|
|
195
195
|
mixins: [I],
|
|
196
196
|
props: {
|
|
@@ -239,7 +239,7 @@ const $ = /* @__PURE__ */ _(ae, [["render", re]]), de = {
|
|
|
239
239
|
};
|
|
240
240
|
function ue(e, t, o, i, n, s) {
|
|
241
241
|
const u = c("dt-icon"), m = c("dt-button"), y = c("sr-only-close-button");
|
|
242
|
-
return l(),
|
|
242
|
+
return l(), h("div", ce, [
|
|
243
243
|
a(e.$slots, "default"),
|
|
244
244
|
o.hideClose ? r("", !0) : (l(), f(m, k({
|
|
245
245
|
key: 0,
|
|
@@ -251,7 +251,7 @@ function ue(e, t, o, i, n, s) {
|
|
|
251
251
|
"aria-label": o.closeButtonProps.ariaLabel ? o.closeButtonProps.ariaLabel : "Close"
|
|
252
252
|
}, o.closeButtonProps, { onClick: s.close }), {
|
|
253
253
|
icon: d(() => [
|
|
254
|
-
|
|
254
|
+
_(u, {
|
|
255
255
|
name: "close",
|
|
256
256
|
size: "200"
|
|
257
257
|
})
|
|
@@ -265,7 +265,7 @@ function ue(e, t, o, i, n, s) {
|
|
|
265
265
|
}, null, 8, ["visually-hidden-close-label", "onClose"])) : r("", !0)
|
|
266
266
|
]);
|
|
267
267
|
}
|
|
268
|
-
const
|
|
268
|
+
const pe = /* @__PURE__ */ v(de, [["render", ue]]), N = ':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])', he = `${N}:not([tabindex="-1"])`, fe = "button,[href],input,select,textarea,details,[tabindex]", me = {
|
|
269
269
|
methods: {
|
|
270
270
|
/**
|
|
271
271
|
* get the first focusable element in your component, includes tabindex="-1".
|
|
@@ -311,7 +311,7 @@ const he = /* @__PURE__ */ _(de, [["render", ue]]), N = ':not(:disabled):not([ar
|
|
|
311
311
|
_getFocusableElements(e = this.$el, t = !1) {
|
|
312
312
|
return e ? [...e.querySelectorAll(fe)].filter((i) => {
|
|
313
313
|
const n = window.getComputedStyle(i);
|
|
314
|
-
return n.getPropertyValue("display") !== "none" && n.getPropertyValue("visibility") !== "hidden" && i.matches(t ? N :
|
|
314
|
+
return n.getPropertyValue("display") !== "none" && n.getPropertyValue("visibility") !== "hidden" && i.matches(t ? N : he);
|
|
315
315
|
}) : [];
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
@@ -339,7 +339,8 @@ const he = /* @__PURE__ */ _(de, [["render", ue]]), N = ':not(:disabled):not([ar
|
|
|
339
339
|
ARROW_KEYS: "arrow-keys",
|
|
340
340
|
TAB: "tab",
|
|
341
341
|
NONE: "none"
|
|
342
|
-
}
|
|
342
|
+
};
|
|
343
|
+
const ye = {
|
|
343
344
|
name: "DtItemLayout",
|
|
344
345
|
props: {
|
|
345
346
|
/**
|
|
@@ -350,11 +351,11 @@ const he = /* @__PURE__ */ _(de, [["render", ue]]), N = ':not(:disabled):not([ar
|
|
|
350
351
|
default: "div"
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
|
-
},
|
|
354
|
+
}, _e = {
|
|
354
355
|
key: 0,
|
|
355
356
|
"data-qa": "dt-item-layout-left-wrapper",
|
|
356
357
|
class: "dt-item-layout--left"
|
|
357
|
-
},
|
|
358
|
+
}, ve = {
|
|
358
359
|
"data-qa": "dt-item-layout-content-wrapper",
|
|
359
360
|
class: "dt-item-layout--content"
|
|
360
361
|
}, be = {
|
|
@@ -369,38 +370,44 @@ const he = /* @__PURE__ */ _(de, [["render", ue]]), N = ':not(:disabled):not([ar
|
|
|
369
370
|
key: 1,
|
|
370
371
|
"data-qa": "dt-item-layout-right-wrapper",
|
|
371
372
|
class: "dt-item-layout--right"
|
|
373
|
+
}, Ee = {
|
|
374
|
+
key: 2,
|
|
375
|
+
"data-qa": "dt-item-layout-selected-wrapper",
|
|
376
|
+
class: "dt-item-layout--selected"
|
|
372
377
|
};
|
|
373
|
-
function
|
|
378
|
+
function Oe(e, t, o, i, n, s) {
|
|
374
379
|
return l(), f(w(o.as), { class: "dt-item-layout" }, {
|
|
375
380
|
default: d(() => [
|
|
376
|
-
e.$slots.left ? (l(),
|
|
377
|
-
a(e.$slots, "left")
|
|
381
|
+
e.$slots.left ? (l(), h("section", _e, [
|
|
382
|
+
a(e.$slots, "left", {}, void 0, !0)
|
|
378
383
|
])) : r("", !0),
|
|
379
|
-
C("section",
|
|
380
|
-
e.$slots.default ? (l(),
|
|
381
|
-
a(e.$slots, "default")
|
|
384
|
+
C("section", ve, [
|
|
385
|
+
e.$slots.default ? (l(), h("div", be, [
|
|
386
|
+
a(e.$slots, "default", {}, void 0, !0)
|
|
382
387
|
])) : r("", !0),
|
|
383
|
-
e.$slots.subtitle ? (l(),
|
|
388
|
+
e.$slots.subtitle ? (l(), h("div", {
|
|
384
389
|
key: 1,
|
|
385
390
|
"data-qa": "dt-item-layout-subtitle-wrapper",
|
|
386
391
|
class: b(["dt-item-layout--subtitle", { "d-mtn2": e.$slots.default }])
|
|
387
392
|
}, [
|
|
388
|
-
a(e.$slots, "subtitle")
|
|
393
|
+
a(e.$slots, "subtitle", {}, void 0, !0)
|
|
389
394
|
], 2)) : r("", !0),
|
|
390
|
-
e.$slots.bottom ? (l(),
|
|
391
|
-
a(e.$slots, "bottom")
|
|
395
|
+
e.$slots.bottom ? (l(), h("div", ge, [
|
|
396
|
+
a(e.$slots, "bottom", {}, void 0, !0)
|
|
392
397
|
])) : r("", !0)
|
|
393
398
|
]),
|
|
394
|
-
e.$slots.right ? (l(),
|
|
395
|
-
a(e.$slots, "right")
|
|
399
|
+
e.$slots.right ? (l(), h("section", Ce, [
|
|
400
|
+
a(e.$slots, "right", {}, void 0, !0)
|
|
396
401
|
])) : r("", !0),
|
|
397
|
-
|
|
402
|
+
e.$slots.selected ? (l(), h("section", Ee, [
|
|
403
|
+
a(e.$slots, "selected", {}, void 0, !0)
|
|
404
|
+
])) : r("", !0)
|
|
398
405
|
]),
|
|
399
406
|
_: 3
|
|
400
407
|
});
|
|
401
408
|
}
|
|
402
|
-
const B = /* @__PURE__ */
|
|
403
|
-
const
|
|
409
|
+
const B = /* @__PURE__ */ v(ye, [["render", Oe], ["__scopeId", "data-v-9afad3c4"]]);
|
|
410
|
+
const Se = {
|
|
404
411
|
name: "DtListItem",
|
|
405
412
|
components: {
|
|
406
413
|
DtItemLayout: B,
|
|
@@ -551,7 +558,7 @@ const Oe = {
|
|
|
551
558
|
}
|
|
552
559
|
}
|
|
553
560
|
};
|
|
554
|
-
function
|
|
561
|
+
function we(e, t, o, i, n, s) {
|
|
555
562
|
const u = c("dt-icon");
|
|
556
563
|
return l(), f(w(o.elementType), k({
|
|
557
564
|
id: o.id,
|
|
@@ -575,7 +582,7 @@ function Se(e, t, o, i, n, s) {
|
|
|
575
582
|
o.selected ? {
|
|
576
583
|
name: "selected",
|
|
577
584
|
fn: d(() => [
|
|
578
|
-
|
|
585
|
+
_(u, {
|
|
579
586
|
name: "check",
|
|
580
587
|
size: "400",
|
|
581
588
|
class: "dt-list-item--selected-icon"
|
|
@@ -588,19 +595,19 @@ function Se(e, t, o, i, n, s) {
|
|
|
588
595
|
_: 3
|
|
589
596
|
}, 16, ["id", "class", "tabindex", "role", "aria-selected"]);
|
|
590
597
|
}
|
|
591
|
-
const
|
|
598
|
+
const Ke = /* @__PURE__ */ v(Se, [["render", we]]), H = {
|
|
592
599
|
none: void 0,
|
|
593
600
|
small: "d-p4",
|
|
594
601
|
medium: "d-p8",
|
|
595
602
|
large: "d-p16"
|
|
596
|
-
},
|
|
603
|
+
}, Pe = {
|
|
597
604
|
none: void 0,
|
|
598
605
|
small: "d-pl4",
|
|
599
606
|
medium: "d-pl8",
|
|
600
607
|
large: "d-pl16"
|
|
601
|
-
},
|
|
608
|
+
}, ke = ["dialog", "menu", "listbox", "tree", "grid"], Te = ["", "anchor"], Le = ["none", "dialog", "first"], Ie = ["parent", "body"], Ae = [
|
|
602
609
|
...V
|
|
603
|
-
],
|
|
610
|
+
], Be = {
|
|
604
611
|
name: "PopoverHeaderFooter",
|
|
605
612
|
components: {
|
|
606
613
|
DtButton: L,
|
|
@@ -661,16 +668,16 @@ const xe = /* @__PURE__ */ _(Oe, [["render", Se]]), H = {
|
|
|
661
668
|
}
|
|
662
669
|
}
|
|
663
670
|
};
|
|
664
|
-
function
|
|
671
|
+
function He(e, t, o, i, n, s) {
|
|
665
672
|
const u = c("dt-icon"), m = c("dt-button");
|
|
666
|
-
return l(),
|
|
673
|
+
return l(), h("div", {
|
|
667
674
|
"data-qa": "dt-popover-header-footer",
|
|
668
675
|
class: b({
|
|
669
676
|
"d-popover__header": o.type === "header",
|
|
670
677
|
"d-popover__footer": o.type === "footer"
|
|
671
678
|
})
|
|
672
679
|
}, [
|
|
673
|
-
n.hasSlotContent(e.$slots.content) ? (l(),
|
|
680
|
+
n.hasSlotContent(e.$slots.content) ? (l(), h("div", {
|
|
674
681
|
key: 0,
|
|
675
682
|
"data-qa": "dt-popover-header-footer-content",
|
|
676
683
|
class: b(["d-to-ellipsis", "d-w100p", o.contentClass])
|
|
@@ -689,7 +696,7 @@ function Be(e, t, o, i, n, s) {
|
|
|
689
696
|
onClick: t[0] || (t[0] = (y) => e.$emit("close"))
|
|
690
697
|
}), {
|
|
691
698
|
icon: d(() => [
|
|
692
|
-
|
|
699
|
+
_(u, {
|
|
693
700
|
name: "close",
|
|
694
701
|
size: "300"
|
|
695
702
|
})
|
|
@@ -698,16 +705,16 @@ function Be(e, t, o, i, n, s) {
|
|
|
698
705
|
}, 16)) : r("", !0)
|
|
699
706
|
], 2);
|
|
700
707
|
}
|
|
701
|
-
const
|
|
702
|
-
const
|
|
708
|
+
const De = /* @__PURE__ */ v(Be, [["render", He]]);
|
|
709
|
+
const $e = {
|
|
703
710
|
name: "DtPopover",
|
|
704
711
|
/********************
|
|
705
712
|
* CHILD COMPONENTS *
|
|
706
713
|
********************/
|
|
707
714
|
components: {
|
|
708
|
-
SrOnlyCloseButton:
|
|
715
|
+
SrOnlyCloseButton: F,
|
|
709
716
|
DtLazyShow: q,
|
|
710
|
-
PopoverHeaderFooter:
|
|
717
|
+
PopoverHeaderFooter: De
|
|
711
718
|
},
|
|
712
719
|
mixins: [me, I],
|
|
713
720
|
props: {
|
|
@@ -752,7 +759,7 @@ const De = {
|
|
|
752
759
|
role: {
|
|
753
760
|
type: String,
|
|
754
761
|
default: "dialog",
|
|
755
|
-
validator: (e) =>
|
|
762
|
+
validator: (e) => ke.includes(e)
|
|
756
763
|
},
|
|
757
764
|
/**
|
|
758
765
|
* ID of the element that serves as the label for the popover content.
|
|
@@ -805,7 +812,7 @@ const De = {
|
|
|
805
812
|
contentWidth: {
|
|
806
813
|
type: String,
|
|
807
814
|
default: "",
|
|
808
|
-
validator: (e) =>
|
|
815
|
+
validator: (e) => Te.includes(e)
|
|
809
816
|
},
|
|
810
817
|
/**
|
|
811
818
|
* Whether to apply transition on initial render in the content lazy show component.
|
|
@@ -939,7 +946,7 @@ const De = {
|
|
|
939
946
|
sticky: {
|
|
940
947
|
type: [Boolean, String],
|
|
941
948
|
default: !1,
|
|
942
|
-
validator: (e) =>
|
|
949
|
+
validator: (e) => Ae.includes(e)
|
|
943
950
|
},
|
|
944
951
|
/**
|
|
945
952
|
* Determines maximum height for the popover before overflow.
|
|
@@ -997,7 +1004,7 @@ const De = {
|
|
|
997
1004
|
initialFocusElement: {
|
|
998
1005
|
type: [String, HTMLElement],
|
|
999
1006
|
default: "first",
|
|
1000
|
-
validator: (e) =>
|
|
1007
|
+
validator: (e) => Le.includes(e) || e instanceof HTMLElement || e.startsWith("#")
|
|
1001
1008
|
},
|
|
1002
1009
|
/**
|
|
1003
1010
|
* If the popover should open pressing up or down arrow key on the anchor element.
|
|
@@ -1016,7 +1023,7 @@ const De = {
|
|
|
1016
1023
|
appendTo: {
|
|
1017
1024
|
type: [HTMLElement, String],
|
|
1018
1025
|
default: "body",
|
|
1019
|
-
validator: (e) =>
|
|
1026
|
+
validator: (e) => Ie.includes(e) || e instanceof HTMLElement
|
|
1020
1027
|
}
|
|
1021
1028
|
},
|
|
1022
1029
|
emits: [
|
|
@@ -1043,7 +1050,7 @@ const De = {
|
|
|
1043
1050
|
data() {
|
|
1044
1051
|
return {
|
|
1045
1052
|
POPOVER_PADDING_CLASSES: H,
|
|
1046
|
-
POPOVER_HEADER_FOOTER_PADDING_CLASSES:
|
|
1053
|
+
POPOVER_HEADER_FOOTER_PADDING_CLASSES: Pe,
|
|
1047
1054
|
intersectionObserver: null,
|
|
1048
1055
|
isOutsideViewport: !1,
|
|
1049
1056
|
isOpen: !1,
|
|
@@ -1287,10 +1294,10 @@ const De = {
|
|
|
1287
1294
|
});
|
|
1288
1295
|
}
|
|
1289
1296
|
}
|
|
1290
|
-
}, Fe = ["aria-hidden"],
|
|
1291
|
-
function
|
|
1297
|
+
}, Fe = ["aria-hidden"], Ne = ["id", "tabindex"];
|
|
1298
|
+
function Re(e, t, o, i, n, s) {
|
|
1292
1299
|
const u = c("popover-header-footer"), m = c("sr-only-close-button"), y = c("dt-lazy-show");
|
|
1293
|
-
return l(),
|
|
1300
|
+
return l(), h("div", null, [
|
|
1294
1301
|
o.modal && n.isOpen ? (l(), f(Y, {
|
|
1295
1302
|
key: 0,
|
|
1296
1303
|
to: "body"
|
|
@@ -1313,15 +1320,15 @@ function Ne(e, t, o, i, n, s) {
|
|
|
1313
1320
|
ref: "anchor",
|
|
1314
1321
|
"data-qa": "dt-popover-anchor",
|
|
1315
1322
|
tabindex: o.openOnContext ? 0 : void 0,
|
|
1316
|
-
onClickCapture: t[1] || (t[1] = (...
|
|
1317
|
-
onContextmenu: t[2] || (t[2] = (...
|
|
1323
|
+
onClickCapture: t[1] || (t[1] = (...p) => s.defaultToggleOpen && s.defaultToggleOpen(...p)),
|
|
1324
|
+
onContextmenu: t[2] || (t[2] = (...p) => s.onContext && s.onContext(...p)),
|
|
1318
1325
|
onKeydown: [
|
|
1319
|
-
t[3] || (t[3] = g(S((...
|
|
1320
|
-
t[4] || (t[4] = g(S((...
|
|
1321
|
-
t[6] || (t[6] = g((
|
|
1322
|
-
t[7] || (t[7] = g((
|
|
1326
|
+
t[3] || (t[3] = g(S((...p) => s.onArrowKeyPress && s.onArrowKeyPress(...p), ["prevent"]), ["up"])),
|
|
1327
|
+
t[4] || (t[4] = g(S((...p) => s.onArrowKeyPress && s.onArrowKeyPress(...p), ["prevent"]), ["down"])),
|
|
1328
|
+
t[6] || (t[6] = g((p) => e.$emit("keydown", p), ["enter"])),
|
|
1329
|
+
t[7] || (t[7] = g((p) => e.$emit("keydown", p), ["space"]))
|
|
1323
1330
|
],
|
|
1324
|
-
onKeydownCapture: t[5] || (t[5] = g((...
|
|
1331
|
+
onKeydownCapture: t[5] || (t[5] = g((...p) => s.closePopover && s.closePopover(...p), ["escape"]))
|
|
1325
1332
|
}, [
|
|
1326
1333
|
a(e.$slots, "anchor", {
|
|
1327
1334
|
attrs: {
|
|
@@ -1330,8 +1337,8 @@ function Ne(e, t, o, i, n, s) {
|
|
|
1330
1337
|
"aria-haspopup": o.role
|
|
1331
1338
|
}
|
|
1332
1339
|
})
|
|
1333
|
-
], 40,
|
|
1334
|
-
|
|
1340
|
+
], 40, Ne),
|
|
1341
|
+
_(y, k({
|
|
1335
1342
|
id: o.id,
|
|
1336
1343
|
ref: "content",
|
|
1337
1344
|
role: o.role,
|
|
@@ -1403,12 +1410,12 @@ function Ne(e, t, o, i, n, s) {
|
|
|
1403
1410
|
}, 8, ["class"]))
|
|
1404
1411
|
]);
|
|
1405
1412
|
}
|
|
1406
|
-
const
|
|
1413
|
+
const ze = /* @__PURE__ */ v($e, [["render", Re]]), Ve = {
|
|
1407
1414
|
name: "DtNotice",
|
|
1408
1415
|
components: {
|
|
1409
1416
|
DtNoticeIcon: ee,
|
|
1410
1417
|
DtNoticeContent: le,
|
|
1411
|
-
DtNoticeAction:
|
|
1418
|
+
DtNoticeAction: pe
|
|
1412
1419
|
},
|
|
1413
1420
|
mixins: [I],
|
|
1414
1421
|
props: {
|
|
@@ -1465,7 +1472,7 @@ const Ke = /* @__PURE__ */ _(De, [["render", Ne]]), Re = {
|
|
|
1465
1472
|
type: String,
|
|
1466
1473
|
default: "base",
|
|
1467
1474
|
validate(e) {
|
|
1468
|
-
return
|
|
1475
|
+
return $.includes(e);
|
|
1469
1476
|
}
|
|
1470
1477
|
},
|
|
1471
1478
|
/**
|
|
@@ -1515,19 +1522,19 @@ const Ke = /* @__PURE__ */ _(De, [["render", Ne]]), Re = {
|
|
|
1515
1522
|
}
|
|
1516
1523
|
}
|
|
1517
1524
|
};
|
|
1518
|
-
function
|
|
1525
|
+
function qe(e, t, o, i, n, s) {
|
|
1519
1526
|
const u = c("dt-notice-icon"), m = c("dt-notice-content"), y = c("dt-notice-action");
|
|
1520
|
-
return l(),
|
|
1527
|
+
return l(), h("aside", {
|
|
1521
1528
|
class: b(s.noticeClass),
|
|
1522
1529
|
"data-qa": "notice"
|
|
1523
1530
|
}, [
|
|
1524
|
-
|
|
1531
|
+
_(u, { kind: o.kind }, {
|
|
1525
1532
|
default: d(() => [
|
|
1526
1533
|
a(e.$slots, "icon")
|
|
1527
1534
|
]),
|
|
1528
1535
|
_: 3
|
|
1529
1536
|
}, 8, ["kind"]),
|
|
1530
|
-
|
|
1537
|
+
_(m, {
|
|
1531
1538
|
"title-id": o.titleId,
|
|
1532
1539
|
"content-id": o.contentId,
|
|
1533
1540
|
title: o.title,
|
|
@@ -1541,12 +1548,12 @@ function Ve(e, t, o, i, n, s) {
|
|
|
1541
1548
|
]),
|
|
1542
1549
|
_: 3
|
|
1543
1550
|
}, 8, ["title-id", "content-id", "title", "role"]),
|
|
1544
|
-
|
|
1551
|
+
_(y, {
|
|
1545
1552
|
"hide-close": o.hideClose,
|
|
1546
1553
|
"close-button-props": o.closeButtonProps,
|
|
1547
1554
|
"visually-hidden-close": e.visuallyHiddenClose,
|
|
1548
1555
|
"visually-hidden-close-label": e.visuallyHiddenCloseLabel,
|
|
1549
|
-
onClose: t[0] || (t[0] = (
|
|
1556
|
+
onClose: t[0] || (t[0] = (p) => e.$emit("close"))
|
|
1550
1557
|
}, {
|
|
1551
1558
|
default: d(() => [
|
|
1552
1559
|
a(e.$slots, "action")
|
|
@@ -1555,24 +1562,24 @@ function Ve(e, t, o, i, n, s) {
|
|
|
1555
1562
|
}, 8, ["hide-close", "close-button-props", "visually-hidden-close", "visually-hidden-close-label"])
|
|
1556
1563
|
], 2);
|
|
1557
1564
|
}
|
|
1558
|
-
const
|
|
1565
|
+
const We = /* @__PURE__ */ v(Ve, [["render", qe]]);
|
|
1559
1566
|
export {
|
|
1560
|
-
|
|
1567
|
+
Ke as D,
|
|
1561
1568
|
O as L,
|
|
1562
1569
|
me as M,
|
|
1563
|
-
|
|
1564
|
-
|
|
1570
|
+
$ as N,
|
|
1571
|
+
Ie as P,
|
|
1565
1572
|
I as S,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1573
|
+
We as a,
|
|
1574
|
+
ze as b,
|
|
1575
|
+
ee as c,
|
|
1576
|
+
le as d,
|
|
1577
|
+
pe as e,
|
|
1578
|
+
F as f,
|
|
1579
|
+
Te as g,
|
|
1580
|
+
B as h,
|
|
1574
1581
|
H as i,
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1582
|
+
Pe as j,
|
|
1583
|
+
ke as k,
|
|
1584
|
+
Le as l
|
|
1578
1585
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const l=require("./emoji-bd8527a3.cjs"),t=require("vue"),_=["base","error","info","success","warning"],I=["alert","alertdialog","status"],T=new Map([["info","info"],["success","check-circle"],["warning","alert-triangle"],["error","alert-circle"],["base","bell"]]),N={name:"DtNoticeIcon",components:{DtIcon:l.DtIcon},props:{kind:{type:String,default:"base",validate(e){return _.includes(e)}}},data(){return{hasSlotContent:l.hasSlotContent}},computed:{defaultIcon(){return T.get(this.kind)}}},L={key:0,"aria-hidden":"true",class:"d-notice__icon"};function D(e,o,n,a,i,s){const r=t.resolveComponent("dt-icon");return s.defaultIcon||i.hasSlotContent(e.$slots.default)?(t.openBlock(),t.createElementBlock("div",L,[t.renderSlot(e.$slots,"default",{},()=>[t.createVNode(r,{name:s.defaultIcon,size:"400"},null,8,["name"])])])):t.createCommentVNode("",!0)}const C=l._export_sfc(N,[["render",D]]),A={name:"DtNoticeContent",props:{title:{type:String,default:""},titleId:{type:String,default:void 0},contentId:{type:String,default:void 0}},data(){return{hasSlotContent:l.hasSlotContent}}},V={class:"d-notice__content","data-qa":"notice-content"},H=["id"],F=["id"];function $(e,o,n,a,i,s){return t.openBlock(),t.createElementBlock("div",V,[n.title||i.hasSlotContent(e.$slots.titleOverride)?(t.openBlock(),t.createElementBlock("p",{key:0,id:n.titleId,class:"d-notice__title","data-qa":"notice-content-title"},[t.renderSlot(e.$slots,"titleOverride",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)])],8,H)):t.createCommentVNode("",!0),t.createElementVNode("p",{id:n.contentId,class:"d-notice__message","data-qa":"notice-content-message"},[t.renderSlot(e.$slots,"default")],8,F)])}const b=l._export_sfc(A,[["render",$]]),h={props:{visuallyHiddenClose:{type:Boolean,default:!1},visuallyHiddenCloseLabel:{type:String,default:null}},watch:{$props:{immediate:!0,deep:!0,handler(){this.validateVisuallyHiddenCloseProps()}}},computed:{showVisuallyHiddenClose(){return this.visuallyHiddenClose&&this.visuallyHiddenCloseLabel!=null}},methods:{validateVisuallyHiddenCloseProps(){this.visuallyHiddenClose&&!this.visuallyHiddenCloseLabel&&console.error(`If visuallyHiddenClose prop is true, the component includes
|
|
2
|
+
a visually hidden close button and you must set the visuallyHiddenCloseLabel prop.`)}}},x={name:"SrOnlyCloseButton",components:{DtIcon:l.DtIcon,DtButton:l.DtButton},props:{visuallyHiddenCloseLabel:{type:String,default:null}},emits:["close"],methods:{close(){this.$emit("close")}}};function R(e,o,n,a,i,s){const r=t.resolveComponent("dt-icon"),c=t.resolveComponent("dt-button");return t.openBlock(),t.createBlock(c,{id:"sr-only-close-button","data-qa":"dt-sr-only-close-button",class:"d-vi-visible-sr","aria-label":n.visuallyHiddenCloseLabel,onClick:s.close,onKeydown:t.withKeys(t.withModifiers(s.close,["prevent","stop"]),["space"])},{default:t.withCtx(()=>[t.createVNode(r,{name:"close"})]),_:1},8,["aria-label","onClick","onKeydown"])}const v=l._export_sfc(x,[["render",R]]),q={name:"DtNoticeAction",components:{DtIcon:l.DtIcon,DtButton:l.DtButton,SrOnlyCloseButton:v},mixins:[h],props:{closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close"],created(){!this.hideClose&&!this.closeButtonProps.ariaLabel&&console.error("Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.")},mounted(){this.hideClose||(this.lastFocusedElement=document.activeElement)},beforeUnmount(){var e;(e=this.lastFocusedElement)==null||e.focus()},methods:{close(){this.$emit("close")}}},M={class:"d-notice__actions","data-qa":"notice-content-actions"};function z(e,o,n,a,i,s){const r=t.resolveComponent("dt-icon"),c=t.resolveComponent("dt-button"),u=t.resolveComponent("sr-only-close-button");return t.openBlock(),t.createElementBlock("div",M,[t.renderSlot(e.$slots,"default"),n.hideClose?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(c,t.mergeProps({key:0,ref:"closeButton","data-qa":"dt-notice-action-close-button",size:"sm",importance:"clear",circle:"","aria-label":n.closeButtonProps.ariaLabel?n.closeButtonProps.ariaLabel:"Close"},n.closeButtonProps,{onClick:s.close}),{icon:t.withCtx(()=>[t.createVNode(r,{name:"close",size:"200"})]),_:1},16,["aria-label","onClick"])),e.showVisuallyHiddenClose?(t.openBlock(),t.createBlock(u,{key:1,"visually-hidden-close-label":e.visuallyHiddenCloseLabel,onClose:s.close},null,8,["visually-hidden-close-label","onClose"])):t.createCommentVNode("",!0)])}const g=l._export_sfc(q,[["render",z]]),E=':not(:disabled):not([aria-disabled="true"]):not([role="presentation"])',K=`${E}:not([tabindex="-1"])`,W="button,[href],input,select,textarea,details,[tabindex]",S={methods:{async getFirstFocusableElement(e){await this.$nextTick();const o=this._getFocusableElements(e,!0);return this._getFirstFocusElement(o)},async focusFirstElement(e){const o=await this.getFirstFocusableElement(e);o==null||o.focus({preventScroll:!0})},_getFirstFocusElement(e){if(!e.length)return;let o=e[0];return o.matches('[type="radio"]:not(:checked)')&&(o=e.find(n=>n.checked&&n.name===o.name)||o),o},_getFocusableElements(e=this.$el,o=!1){return e?[...e.querySelectorAll(W)].filter(a=>{const i=window.getComputedStyle(a);return i.getPropertyValue("display")!=="none"&&i.getPropertyValue("visibility")!=="hidden"&&a.matches(o?E:K)}):[]},focusTrappedTabPress(e,o){if(!(e.key==="Tab"))return;const a=this._getFocusableElements(o);if(!a.length){e.preventDefault();return}const i=this._getFirstFocusElement(a),s=a[a.length-1];e.shiftKey?document.activeElement===i&&(s.focus(),e.preventDefault()):document.activeElement===s&&(i.focus(),e.preventDefault())}}},m={DEFAULT:"default",CUSTOM:"custom"},p={ARROW_KEYS:"arrow-keys",TAB:"tab",NONE:"none"};const j={name:"DtItemLayout",props:{as:{type:String,default:"div"}}},U={key:0,"data-qa":"dt-item-layout-left-wrapper",class:"dt-item-layout--left"},G={"data-qa":"dt-item-layout-content-wrapper",class:"dt-item-layout--content"},Y={key:0,"data-qa":"dt-item-layout-title-wrapper",class:"dt-item-layout--title"},Z={key:2,"data-qa":"dt-item-layout-bottom-wrapper",class:"dt-item-layout--bottom"},X={key:1,"data-qa":"dt-item-layout-right-wrapper",class:"dt-item-layout--right"},J={key:2,"data-qa":"dt-item-layout-selected-wrapper",class:"dt-item-layout--selected"};function Q(e,o,n,a,i,s){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.as),{class:"dt-item-layout"},{default:t.withCtx(()=>[e.$slots.left?(t.openBlock(),t.createElementBlock("section",U,[t.renderSlot(e.$slots,"left",{},void 0,!0)])):t.createCommentVNode("",!0),t.createElementVNode("section",G,[e.$slots.default?(t.openBlock(),t.createElementBlock("div",Y,[t.renderSlot(e.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0),e.$slots.subtitle?(t.openBlock(),t.createElementBlock("div",{key:1,"data-qa":"dt-item-layout-subtitle-wrapper",class:t.normalizeClass(["dt-item-layout--subtitle",{"d-mtn2":e.$slots.default}])},[t.renderSlot(e.$slots,"subtitle",{},void 0,!0)],2)):t.createCommentVNode("",!0),e.$slots.bottom?(t.openBlock(),t.createElementBlock("div",Z,[t.renderSlot(e.$slots,"bottom",{},void 0,!0)])):t.createCommentVNode("",!0)]),e.$slots.right?(t.openBlock(),t.createElementBlock("section",X,[t.renderSlot(e.$slots,"right",{},void 0,!0)])):t.createCommentVNode("",!0),e.$slots.selected?(t.openBlock(),t.createElementBlock("section",J,[t.renderSlot(e.$slots,"selected",{},void 0,!0)])):t.createCommentVNode("",!0)]),_:3})}const f=l._export_sfc(j,[["render",Q],["__scopeId","data-v-9afad3c4"]]);const ee={name:"DtListItem",components:{DtItemLayout:f,DtIcon:l.DtIcon},inject:{highlightId:{default:null}},props:{id:{type:String,default(){return l.utils.getUniqueString()}},role:{type:String,default:"listitem"},elementType:{type:String,default:"li"},type:{type:String,default:m.DEFAULT,validator:e=>Object.values(m).includes(e)},navigationType:{type:String,default:p.NONE,validator:e=>Object.values(p).includes(e)},selected:{type:Boolean,default:!1}},emits:["keydown","mousemove","mouseleave","mousedown"],data(){return{injected:!1,mouseHighlighted:!1}},computed:{listItemType(){switch(this.type){case m.DEFAULT:return f;default:return null}},listItemListeners(){return{keydown:e=>{["enter","space"].includes(e.code.toLowerCase())&&this.onClick(e),this.$emit("keydown",e)},mousemove:e=>{this.onMouseHover(e),this.$emit("mousemove",e)},mouseleave:e=>{this.onMouseLeave(e),this.$emit("mouseleave",e)}}},isHighlighted(){return this.isHoverable?this.highlightId&&this.highlightId()?this.id===this.highlightId():this.mouseHighlighted:!1},isFocusable(){return this.navigationType===p.TAB},isHoverable(){return this.navigationType!==p.NONE}},methods:{onClick(e){this.$emit("click",e)},onMouseHover(){this.mouseHighlighted=!0},onMouseLeave(){this.mouseHighlighted=!1}}};function te(e,o,n,a,i,s){const r=t.resolveComponent("dt-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.elementType),t.mergeProps({id:n.id,class:["dt-list-item",{"dt-list-item--focusable":s.isFocusable,"dt-list-item--highlighted":s.isHighlighted,"dt-list-item--static":!s.isHoverable}],tabindex:s.isFocusable?0:-1,role:n.role,"aria-selected":s.isHighlighted},t.toHandlers(s.listItemListeners)),{default:t.withCtx(()=>[s.listItemType?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.listItemType),{key:0},t.createSlots({_:2},[t.renderList(e.$slots,(c,u)=>({name:u,fn:t.withCtx(()=>[t.renderSlot(e.$slots,u)])})),n.selected?{name:"selected",fn:t.withCtx(()=>[t.createVNode(r,{name:"check",size:"400",class:"dt-list-item--selected-icon"})]),key:"0"}:void 0]),1024)):t.renderSlot(e.$slots,"default",{key:1})]),_:3},16,["id","class","tabindex","role","aria-selected"])}const oe=l._export_sfc(ee,[["render",te]]),y={none:void 0,small:"d-p4",medium:"d-p8",large:"d-p16"},k={none:void 0,small:"d-pl4",medium:"d-pl8",large:"d-pl16"},O=["dialog","menu","listbox","tree","grid"],w=["","anchor"],P=["none","dialog","first"],B=["parent","body"],ne=[...l.TIPPY_STICKY_VALUES],se={name:"PopoverHeaderFooter",components:{DtButton:l.DtButton,DtIcon:l.DtIcon},props:{type:{type:String,validator:function(e){return["header","footer"].includes(e)}},contentClass:{type:[String,Array,Object],default:""},showCloseButton:{type:Boolean,default:!1},closeButtonProps:{type:Object,default:()=>{}}},emits:["close"],data(){return{hasSlotContent:l.hasSlotContent}},methods:{focusCloseButton(){var o;const e=(o=this.$refs["popover__close-button"])==null?void 0:o.$el;e==null||e.focus()}}};function ie(e,o,n,a,i,s){const r=t.resolveComponent("dt-icon"),c=t.resolveComponent("dt-button");return t.openBlock(),t.createElementBlock("div",{"data-qa":"dt-popover-header-footer",class:t.normalizeClass({"d-popover__header":n.type==="header","d-popover__footer":n.type==="footer"})},[i.hasSlotContent(e.$slots.content)?(t.openBlock(),t.createElementBlock("div",{key:0,"data-qa":"dt-popover-header-footer-content",class:t.normalizeClass(["d-to-ellipsis","d-w100p",n.contentClass])},[t.renderSlot(e.$slots,"content")],2)):t.createCommentVNode("",!0),n.showCloseButton?(t.openBlock(),t.createBlock(c,t.mergeProps({key:1,ref:"popover__close-button","data-qa":"dt-popover-close",class:"d-p6 d-mr6 d-bc-transparent",importance:"outlined",kind:"muted",circle:""},n.closeButtonProps,{onClick:o[0]||(o[0]=u=>e.$emit("close"))}),{icon:t.withCtx(()=>[t.createVNode(r,{name:"close",size:"300"})]),_:1},16)):t.createCommentVNode("",!0)],2)}const le=l._export_sfc(se,[["render",ie]]);const ae={name:"DtPopover",components:{SrOnlyCloseButton:v,DtLazyShow:l.DtLazyShow,PopoverHeaderFooter:le},mixins:[S,h],props:{open:{type:Boolean,default:null},openOnContext:{type:Boolean,default:!1},elementType:{type:String,default:"div"},transition:{type:String,default:"fade"},role:{type:String,default:"dialog",validator:e=>O.includes(e)},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},closeButtonProps:{type:Object,default:()=>({})},padding:{type:String,default:"large",validator:e=>Object.keys(y).some(o=>o===e)},contentClass:{type:[String,Array,Object],default:""},contentWidth:{type:String,default:"",validator:e=>w.includes(e)},contentAppear:{type:Boolean,default:null},contentTabindex:{type:Number||null,default:-1},externalAnchor:{type:String,default:""},id:{type:String,default(){return l.getUniqueString()}},offset:{type:Array,default:()=>[0,4]},hideOnClick:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"bottom-end"},tether:{type:Boolean,default:!0},sticky:{type:[Boolean,String],default:!1,validator:e=>ne.includes(e)},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButton:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:""},footerClass:{type:[String,Array,Object],default:""},dialogClass:{type:[String,Array,Object],default:""},initialFocusElement:{type:[String,HTMLElement],default:"first",validator:e=>P.includes(e)||e instanceof HTMLElement||e.startsWith("#")},openWithArrowKeys:{type:Boolean,default:!1},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>B.includes(e)||e instanceof HTMLElement}},emits:["keydown","update:open","opened"],data(){return{POPOVER_PADDING_CLASSES:y,POPOVER_HEADER_FOOTER_PADDING_CLASSES:k,intersectionObserver:null,isOutsideViewport:!1,isOpen:!1,toAppear:!1,anchorEl:null,popoverContentEl:null,hasSlotContent:l.hasSlotContent}},computed:{popoverListeners(){return{keydown:e=>{this.onKeydown(e)},"after-leave":e=>{this.onLeaveTransitionComplete()},"after-enter":e=>{this.onEnterTransitionComplete()}}},calculatedMaxHeight(){return this.isOutsideViewport&&this.modal?"calc(100vh - var(--dt-space-300))":this.maxHeight},labelledBy(){return this.ariaLabelledby||!this.ariaLabel&&l.getUniqueString("DtPopover__anchor")}},watch:{$props:{immediate:!0,deep:!0,handler(){this.validateProps()}},modal(e){var o;(o=this.tip)==null||o.setProps({zIndex:e?650:this.calculateAnchorZindex()})},offset(e){var o;(o=this.tip)==null||o.setProps({offset:e})},sticky(e){var o;(o=this.tip)==null||o.setProps({sticky:e})},fallbackPlacements(){var e;(e=this.tip)==null||e.setProps({popperOptions:this.popperOptions()})},tether(){var e;(e=this.tip)==null||e.setProps({popperOptions:this.popperOptions()})},placement(e){var o;(o=this.tip)==null||o.setProps({placement:e})},open:{handler:function(e){e!==null&&(this.isOpen=e),e===!0&&(this.toAppear=!0)},immediate:!0},contentAppear:{handler:function(e){e!==null&&(this.toAppear=e)}},isOpen(e,o){e?(this.initTippyInstance(),this.tip.show()):!e&&o!==e&&(this.removeEventListeners(),this.tip.hide())}},mounted(){const e=this.externalAnchor?this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`):null;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)},beforeUnmount(){var e;(e=this.tip)==null||e.destroy(),this.intersectionObserver.disconnect(),this.removeReferences(),this.removeEventListeners()},methods:{hasIntersectedViewport(e){var a;const o=(a=e==null?void 0:e[0])==null?void 0:a.target;if(!o)return;const n=l.isOutOfViewPort(o);this.isOutsideViewport=n.bottom||n.top},popperOptions(){return l.getPopperOptions({fallbackPlacements:this.fallbackPlacements,tether:this.tether,hasHideModifierEnabled:!0})},validateProps(){this.modal&&this.initialFocusElement==="none"&&console.error('If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement')},calculateAnchorZindex(){var e;return this.$el.getRootNode().querySelector('.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"]')||(e=this.anchorEl)!=null&&e.closest(".d-zi-drawer")?650:300},defaultToggleOpen(e){var o,n,a;if(!this.openOnContext&&(this.open===null||this.open===void 0)){if(!((o=this.anchorEl)!=null&&o.contains(e.target))&&!((n=this.anchorEl)!=null&&n.isEqualNode(e.target))||(a=this.anchorEl)!=null&&a.disabled)return;this.toggleOpen()}},async onContext(e){this.openOnContext&&(e.preventDefault(),this.isOpen=!0,await this.$nextTick(),this.tip.setProps({placement:"right-start",getReferenceClientRect:()=>({width:0,height:0,top:e.clientY,bottom:e.clientY,left:e.clientX,right:e.clientX})}))},toggleOpen(){this.isOpen=!this.isOpen},onArrowKeyPress(e){var o;this.open===null&&(this.openWithArrowKeys&&((o=this.anchorEl)!=null&&o.contains(e.target))&&(this.isOpen||(this.isOpen=!0)),this.$emit("keydown",e))},addEventListeners(){window.addEventListener("dt-popover-close",this.closePopover),this.contentWidth==="anchor"&&window.addEventListener("resize",this.onResize)},removeEventListeners(){window.removeEventListener("dt-popover-close",this.closePopover),this.contentWidth==="anchor"&&window.removeEventListener("resize",this.onResize)},closePopover(){this.isOpen=!1},preventScrolling(){var e;if(this.modal){const o=(e=this.anchorEl)==null?void 0:e.closest("body, .tippy-box");o.tagName.toLowerCase()==="body"?(o.classList.add("d-of-hidden"),this.tip.setProps({offset:this.offset})):o.classList.add("d-zi-popover")}},enableScrolling(){var o,n;const e=(o=this.anchorEl)==null?void 0:o.closest("body, .tippy-box");e&&(((n=e.tagName)==null?void 0:n.toLowerCase())==="body"?(e.classList.remove("d-of-hidden"),this.tip.setProps({offset:this.offset})):e.classList.remove("d-zi-popover"))},removeReferences(){this.anchorEl=null,this.popoverContentEl=null,this.tip=null},async onShow(){this.contentWidth==="anchor"&&await this.setPopoverContentAnchorWidth(),this.contentWidth===null&&(this.popoverContentEl.style.width="auto"),this.addEventListeners()},async onLeaveTransitionComplete(){var e;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)},async onEnterTransitionComplete(){this.focusInitialElement(),await this.$nextTick(),this.preventScrolling(),this.$emit("opened",!0,this.$refs.popover__content),this.open!==null&&this.$emit("update:open",!0)},focusInitialElement(){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()},focusInitialElementById(){var o,n,a;const e=(n=(o=this.$refs.content)==null?void 0:o.$el)==null?void 0:n.querySelector(this.initialFocusElement);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()},onResize(){this.closePopover()},onClickOutside(){if(!this.hideOnClick)return;this.popoverContentEl.querySelector(".d-popover__anchor--opened")||this.closePopover()},onKeydown(e){e.key==="Tab"&&this.modal&&this.focusTrappedTabPress(e,this.popoverContentEl),e.key==="Escape"&&this.closePopover(),this.$emit("keydown",e)},async setPopoverContentAnchorWidth(){var e;await this.$nextTick(),this.popoverContentEl.style.width=`${(e=this.anchorEl)==null?void 0:e.clientWidth}px`},focusFirstElementIfNeeded(e){var n,a;this._getFocusableElements(e,!0).length!==0?this.focusFirstElement(e):this.showCloseButton?(n=this.$refs.popover__header)==null||n.focusCloseButton():(a=this.$refs.content)==null||a.$el.focus()},initTippyInstance(){var e,o;this.tip=l.createTippy(this.anchorEl,{popperOptions:this.popperOptions(),contentElement:this.popoverContentEl,placement:this.placement,offset:this.offset,sticky:this.sticky,appendTo:this.appendTo==="body"?(o=(e=this.anchorEl)==null?void 0:e.getRootNode())==null?void 0:o.querySelector("body"):this.appendTo,interactive:!0,trigger:"manual",hideOnClick:!1,zIndex:this.modal?650:this.calculateAnchorZindex(),onClickOutside:this.onClickOutside,onShow:this.onShow})}}},re=["aria-hidden"],de=["id","tabindex"];function ce(e,o,n,a,i,s){const r=t.resolveComponent("popover-header-footer"),c=t.resolveComponent("sr-only-close-button"),u=t.resolveComponent("dt-lazy-show");return t.openBlock(),t.createElementBlock("div",null,[n.modal&&i.isOpen?(t.openBlock(),t.createBlock(t.Teleport,{key:0,to:"body"},[t.createElementVNode("div",{class:"d-modal--transparent","aria-hidden":n.modal&&i.isOpen?"false":"true",onClick:o[0]||(o[0]=t.withModifiers(()=>{},["prevent","stop"]))},null,8,re)])):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.elementType),{ref:"popover",class:t.normalizeClass(["d-popover",{"d-popover__anchor--opened":i.isOpen}]),"data-qa":"dt-popover-container"},{default:t.withCtx(()=>[t.createElementVNode("div",{id:!n.ariaLabelledby&&s.labelledBy,ref:"anchor","data-qa":"dt-popover-anchor",tabindex:n.openOnContext?0:void 0,onClickCapture:o[1]||(o[1]=(...d)=>s.defaultToggleOpen&&s.defaultToggleOpen(...d)),onContextmenu:o[2]||(o[2]=(...d)=>s.onContext&&s.onContext(...d)),onKeydown:[o[3]||(o[3]=t.withKeys(t.withModifiers((...d)=>s.onArrowKeyPress&&s.onArrowKeyPress(...d),["prevent"]),["up"])),o[4]||(o[4]=t.withKeys(t.withModifiers((...d)=>s.onArrowKeyPress&&s.onArrowKeyPress(...d),["prevent"]),["down"])),o[6]||(o[6]=t.withKeys(d=>e.$emit("keydown",d),["enter"])),o[7]||(o[7]=t.withKeys(d=>e.$emit("keydown",d),["space"]))],onKeydownCapture:o[5]||(o[5]=t.withKeys((...d)=>s.closePopover&&s.closePopover(...d),["escape"]))},[t.renderSlot(e.$slots,"anchor",{attrs:{"aria-expanded":i.isOpen.toString(),"aria-controls":n.id,"aria-haspopup":n.role}})],40,de),t.createVNode(u,t.mergeProps({id:n.id,ref:"content",role:n.role,"data-qa":"dt-popover","aria-hidden":`${!i.isOpen}`,"aria-labelledby":s.labelledBy,"aria-label":n.ariaLabel,"aria-modal":`${!n.modal}`,transition:n.transition,show:i.isOpen,appear:i.toAppear,class:["d-popover__dialog",{"d-popover__dialog--modal":n.modal},n.dialogClass],style:{"max-height":s.calculatedMaxHeight,"max-width":n.maxWidth},css:e.$attrs.css,tabindex:n.contentTabindex},t.toHandlers(s.popoverListeners)),{default:t.withCtx(()=>[i.hasSlotContent(e.$slots.headerContent)||n.showCloseButton?(t.openBlock(),t.createBlock(r,{key:0,ref:"popover__header",class:t.normalizeClass(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),"content-class":n.headerClass,type:"header","show-close-button":n.showCloseButton,"close-button-props":n.closeButtonProps,onClose:s.closePopover},{content:t.withCtx(()=>[t.renderSlot(e.$slots,"headerContent",{close:s.closePopover})]),_:3},8,["class","content-class","show-close-button","close-button-props","onClose"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"popover__content","data-qa":"dt-popover-content",class:t.normalizeClass(["d-popover__content",i.POPOVER_PADDING_CLASSES[n.padding],n.contentClass])},[t.renderSlot(e.$slots,"content",{close:s.closePopover})],2),i.hasSlotContent(e.$slots.footerContent)?(t.openBlock(),t.createBlock(r,{key:1,ref:"popover__footer",type:"footer",class:t.normalizeClass(i.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),"content-class":n.footerClass},{content:t.withCtx(()=>[t.renderSlot(e.$slots,"footerContent",{close:s.closePopover})]),_:3},8,["class","content-class"])):t.createCommentVNode("",!0),e.showVisuallyHiddenClose?(t.openBlock(),t.createBlock(c,{key:2,"visually-hidden-close-label":e.visuallyHiddenCloseLabel,onClose:s.closePopover},null,8,["visually-hidden-close-label","onClose"])):t.createCommentVNode("",!0)]),_:3},16,["id","role","aria-hidden","aria-labelledby","aria-label","aria-modal","transition","show","appear","class","style","css","tabindex"])]),_:3},8,["class"]))])}const ue=l._export_sfc(ae,[["render",ce]]),pe={name:"DtNotice",components:{DtNoticeIcon:C,DtNoticeContent:b,DtNoticeAction:g},mixins:[h],props:{titleId:{type:String,default:void 0},contentId:{type:String,default:void 0},title:{type:String,default:""},role:{type:String,default:"status",validate(e){return I.includes(e)}},important:{type:Boolean,default:!1},kind:{type:String,default:"base",validate(e){return _.includes(e)}},closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1}},emits:["close","click"],computed:{noticeClass(){return["d-notice",{error:"d-notice--error",info:"d-notice--info",success:"d-notice--success",warning:"d-notice--warning",base:"d-notice--base"}[this.kind],{"d-notice--important":this.important}]}}};function he(e,o,n,a,i,s){const r=t.resolveComponent("dt-notice-icon"),c=t.resolveComponent("dt-notice-content"),u=t.resolveComponent("dt-notice-action");return t.openBlock(),t.createElementBlock("aside",{class:t.normalizeClass(s.noticeClass),"data-qa":"notice"},[t.createVNode(r,{kind:n.kind},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"icon")]),_:3},8,["kind"]),t.createVNode(c,{"title-id":n.titleId,"content-id":n.contentId,title:n.title,role:n.role},{titleOverride:t.withCtx(()=>[t.renderSlot(e.$slots,"titleOverride")]),default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["title-id","content-id","title","role"]),t.createVNode(u,{"hide-close":n.hideClose,"close-button-props":n.closeButtonProps,"visually-hidden-close":e.visuallyHiddenClose,"visually-hidden-close-label":e.visuallyHiddenCloseLabel,onClose:o[0]||(o[0]=d=>e.$emit("close"))},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"action")]),_:3},8,["hide-close","close-button-props","visually-hidden-close","visually-hidden-close-label"])],2)}const me=l._export_sfc(pe,[["render",he]]);exports.DtItemLayout=f;exports.DtListItem=oe;exports.DtNotice=me;exports.DtNoticeAction=g;exports.DtNoticeContent=b;exports.DtNoticeIcon=C;exports.DtPopover=ue;exports.LIST_ITEM_NAVIGATION_TYPES=p;exports.Modal=S;exports.NOTICE_KINDS=_;exports.POPOVER_APPEND_TO_VALUES=B;exports.POPOVER_CONTENT_WIDTHS=w;exports.POPOVER_HEADER_FOOTER_PADDING_CLASSES=k;exports.POPOVER_INITIAL_FOCUS_STRINGS=P;exports.POPOVER_PADDING_CLASSES=y;exports.POPOVER_ROLES=O;exports.SrOnlyCloseButton=v;exports.SrOnlyCloseButtonMixin=h;
|