@dialpad/dialtone-vue 2.125.0 → 2.125.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/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
- package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
- package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
- package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
- package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
- package/dist/chunks/index-nIyl_PL6.js +372 -0
- package/dist/chunks/index-nIyl_PL6.js.map +1 -0
- package/dist/chunks/index-o4OMWMuv.js +244 -0
- package/dist/chunks/index-o4OMWMuv.js.map +1 -0
- package/dist/chunks/input-1tm09l_-.js +273 -0
- package/dist/chunks/input-1tm09l_-.js.map +1 -0
- package/dist/chunks/input_group-zcAq3DQl.js +141 -0
- package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
- package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
- package/dist/chunks/link_constants-vIUB92L4.js +16 -0
- package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
- package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
- package/dist/chunks/modal-VuMFkZFH.js +82 -0
- package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
- package/dist/chunks/notice_action-9NmtQRai.js +182 -0
- package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
- package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
- package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
- package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
- package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
- package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
- package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
- package/dist/chunks/tab-Qm9LVkYj.js +346 -0
- package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.js +354 -10368
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/attachment-carousel.js +250 -0
- package/dist/lib/attachment-carousel.js.map +1 -0
- package/dist/lib/avatar.js +369 -0
- package/dist/lib/avatar.js.map +1 -0
- package/dist/lib/badge.js +169 -0
- package/dist/lib/badge.js.map +1 -0
- package/dist/lib/banner.js +200 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/breadcrumbs.js +138 -0
- package/dist/lib/breadcrumbs.js.map +1 -0
- package/dist/lib/button-group.js +45 -0
- package/dist/lib/button-group.js.map +1 -0
- package/dist/lib/button.js +328 -0
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/callbar-button-with-popover.js +235 -0
- package/dist/lib/callbar-button-with-popover.js.map +1 -0
- package/dist/lib/callbar-button.js +175 -0
- package/dist/lib/callbar-button.js.map +1 -0
- package/dist/lib/callbox.js +142 -0
- package/dist/lib/callbox.js.map +1 -0
- package/dist/lib/card.js +72 -0
- package/dist/lib/card.js.map +1 -0
- package/dist/lib/checkbox-group.js +117 -0
- package/dist/lib/checkbox-group.js.map +1 -0
- package/dist/lib/checkbox.js +117 -0
- package/dist/lib/checkbox.js.map +1 -0
- package/dist/lib/chip.js +186 -0
- package/dist/lib/chip.js.map +1 -0
- package/dist/lib/codeblock.js +29 -0
- package/dist/lib/codeblock.js.map +1 -0
- package/dist/lib/collapsible.js +313 -0
- package/dist/lib/collapsible.js.map +1 -0
- package/dist/lib/combobox-multi-select.js +433 -0
- package/dist/lib/combobox-multi-select.js.map +1 -0
- package/dist/lib/combobox-with-popover.js +341 -0
- package/dist/lib/combobox-with-popover.js.map +1 -0
- package/dist/lib/combobox.js +19 -0
- package/dist/lib/combobox.js.map +1 -0
- package/dist/lib/constants.js +53 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/contact-info.js +145 -0
- package/dist/lib/contact-info.js.map +1 -0
- package/dist/lib/contact-row.js +203 -0
- package/dist/lib/contact-row.js.map +1 -0
- package/dist/lib/datepicker.js +552 -0
- package/dist/lib/datepicker.js.map +1 -0
- package/dist/lib/dates.js +57 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/description-list.js +83 -0
- package/dist/lib/description-list.js.map +1 -0
- package/dist/lib/dropdown.js +45 -0
- package/dist/lib/dropdown.js.map +1 -0
- package/dist/lib/editor.js +527 -0
- package/dist/lib/editor.js.map +1 -0
- package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -12
- package/dist/lib/emoji-picker.js.map +1 -0
- package/dist/lib/emoji-row.js +83 -0
- package/dist/lib/emoji-row.js.map +1 -0
- package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -14
- package/dist/lib/emoji-text-wrapper.js.map +1 -0
- package/dist/lib/emoji.js +11 -0
- package/dist/{emoji.js.map → lib/emoji.js.map} +1 -1
- package/dist/lib/feed-item-row.js +207 -0
- package/dist/lib/feed-item-row.js.map +1 -0
- package/dist/lib/feed-pill.js +142 -0
- package/dist/lib/feed-pill.js.map +1 -0
- package/dist/lib/general-row.js +379 -0
- package/dist/lib/general-row.js.map +1 -0
- package/dist/lib/group-row.js +115 -0
- package/dist/lib/group-row.js.map +1 -0
- package/dist/lib/grouped-chip.js +45 -0
- package/dist/lib/grouped-chip.js.map +1 -0
- package/dist/lib/hovercard.js +194 -0
- package/dist/lib/hovercard.js.map +1 -0
- package/dist/lib/icon.js +82 -0
- package/dist/lib/icon.js.map +1 -0
- package/dist/lib/image-viewer.js +171 -0
- package/dist/lib/image-viewer.js.map +1 -0
- package/dist/lib/input-group.js +90 -0
- package/dist/lib/input-group.js.map +1 -0
- package/dist/lib/input.js +455 -0
- package/dist/lib/input.js.map +1 -0
- package/dist/lib/item-layout.js +39 -0
- package/dist/lib/item-layout.js.map +1 -0
- package/dist/lib/ivr-node.js +195 -0
- package/dist/lib/ivr-node.js.map +1 -0
- package/dist/lib/keyboard-shortcut.js +100 -0
- package/dist/lib/keyboard-shortcut.js.map +1 -0
- package/dist/lib/lazy-show.js +77 -0
- package/dist/lib/lazy-show.js.map +1 -0
- package/dist/lib/link.js +69 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/list-item-group.js +59 -0
- package/dist/lib/list-item-group.js.map +1 -0
- package/dist/lib/list-item.js +195 -0
- package/dist/lib/list-item.js.map +1 -0
- package/dist/{message_input.js → lib/message-input.js} +107 -56
- package/dist/lib/message-input.js.map +1 -0
- package/dist/lib/mixins.js +17 -0
- package/dist/lib/mixins.js.map +1 -0
- package/dist/lib/modal.js +324 -0
- package/dist/lib/modal.js.map +1 -0
- package/dist/lib/notice.js +158 -0
- package/dist/lib/notice.js.map +1 -0
- package/dist/lib/pagination.js +142 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/popover.js +779 -0
- package/dist/lib/popover.js.map +1 -0
- package/dist/lib/presence.js +60 -0
- package/dist/lib/presence.js.map +1 -0
- package/dist/lib/radio-group.js +97 -0
- package/dist/lib/radio-group.js.map +1 -0
- package/dist/lib/radio.js +111 -0
- package/dist/lib/radio.js.map +1 -0
- package/dist/lib/rich-text-editor.js +920 -0
- package/dist/lib/rich-text-editor.js.map +1 -0
- package/dist/lib/root-layout.js +127 -0
- package/dist/lib/root-layout.js.map +1 -0
- package/dist/lib/select-menu.js +243 -0
- package/dist/lib/select-menu.js.map +1 -0
- package/dist/lib/settings-menu-button.js +65 -0
- package/dist/lib/settings-menu-button.js.map +1 -0
- package/dist/lib/skeleton.js +574 -0
- package/dist/lib/skeleton.js.map +1 -0
- package/dist/lib/stack.js +118 -0
- package/dist/lib/stack.js.map +1 -0
- package/dist/lib/tabs.js +93 -0
- package/dist/lib/tabs.js.map +1 -0
- package/dist/lib/time-pill.js +43 -0
- package/dist/lib/time-pill.js.map +1 -0
- package/dist/lib/toast.js +226 -0
- package/dist/lib/toast.js.map +1 -0
- package/dist/lib/toggle.js +169 -0
- package/dist/lib/toggle.js.map +1 -0
- package/dist/{directives.js → lib/tooltip-directive.js} +24 -18
- package/dist/lib/tooltip-directive.js.map +1 -0
- package/dist/lib/tooltip.js +376 -0
- package/dist/lib/tooltip.js.map +1 -0
- package/dist/lib/top-banner-info.js +60 -0
- package/dist/lib/top-banner-info.js.map +1 -0
- package/dist/lib/unread-pill.js +61 -0
- package/dist/lib/unread-pill.js.map +1 -0
- package/dist/lib/utils.js +175 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validation-messages.js +83 -0
- package/dist/lib/validation-messages.js.map +1 -0
- package/dist/lib/validators.js +12 -0
- package/dist/lib/validators.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
- package/dist/types/common/constants/index.d.ts.map +1 -0
- package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
- package/dist/types/common/dates/index.d.ts.map +1 -0
- package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
- package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
- package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
- package/dist/types/common/utils/index.d.ts.map +1 -0
- package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
- package/dist/types/common/validators/index.d.ts.map +1 -0
- package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
- package/dist/types/components/button/button.vue.d.ts +2 -2
- package/dist/types/components/card/card.vue.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
- package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +2 -2
- package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
- package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
- package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
- package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
- package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
- package/dist/types/components/icon/icon.vue.d.ts +20 -16
- package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
- package/dist/types/components/icon/icon_constants.d.ts +2 -0
- package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
- package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
- package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +7 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
- package/dist/types/components/radio/radio.vue.d.ts +2 -12
- package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
- package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
- package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
- package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
- package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
- package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
- package/dist/types/index.d.ts +36 -29
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
- package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
- package/package.json +18 -58
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -2904
- package/dist/dialtone-vue.cjs +0 -6
- package/dist/dialtone-vue.cjs.map +0 -1
- package/dist/directives.cjs +0 -2
- package/dist/directives.cjs.map +0 -1
- package/dist/directives.js.map +0 -1
- package/dist/emoji.cjs +0 -2
- package/dist/emoji.cjs.map +0 -1
- package/dist/emoji.js +0 -36
- package/dist/emoji_picker-kiTOKaq8.js.map +0 -1
- package/dist/emoji_picker-njWWAm6V.cjs +0 -2
- package/dist/emoji_picker-njWWAm6V.cjs.map +0 -1
- package/dist/emoji_text_wrapper-48ClwKvf.js.map +0 -1
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -2
- package/dist/emoji_text_wrapper-ZlynvHnd.cjs.map +0 -1
- package/dist/index-OF94C6nQ.js +0 -142834
- package/dist/index-OF94C6nQ.js.map +0 -1
- package/dist/index-Wx7Jagcr.cjs +0 -2
- package/dist/index-Wx7Jagcr.cjs.map +0 -1
- package/dist/message_input.cjs +0 -2
- package/dist/message_input.cjs.map +0 -1
- package/dist/message_input.js.map +0 -1
- package/dist/rich_text_editor-RVMsCB8N.cjs +0 -98
- package/dist/rich_text_editor-RVMsCB8N.cjs.map +0 -1
- package/dist/rich_text_editor-eMvTs_Gp.js +0 -16479
- package/dist/rich_text_editor-eMvTs_Gp.js.map +0 -1
- package/dist/tooltip-88U5vFMA.js +0 -2517
- package/dist/tooltip-88U5vFMA.js.map +0 -1
- package/dist/tooltip-i2wxFIIi.cjs +0 -22
- package/dist/tooltip-i2wxFIIi.cjs.map +0 -1
- package/dist/types/common/constants.d.ts.map +0 -1
- package/dist/types/common/dates.d.ts.map +0 -1
- package/dist/types/common/utils.d.ts.map +0 -1
- package/dist/types/common/validators.d.ts.map +0 -1
- package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
- package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -2
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/emoji.d.ts +0 -5
- package/dist/types/emoji.d.ts.map +0 -1
- package/dist/types/message_input.d.ts +0 -3
- package/dist/types/message_input.d.ts.map +0 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import c from "vue";
|
|
2
|
+
import { n as u } from "../chunks/_plugin-vue2_normalizer-u6G_3nkj.js";
|
|
3
|
+
import { a as o } from "../chunks/link_constants-vIUB92L4.js";
|
|
4
|
+
const a = {
|
|
5
|
+
xs: "d-btn--xs",
|
|
6
|
+
sm: "d-btn--sm",
|
|
7
|
+
md: "",
|
|
8
|
+
lg: "d-btn--lg",
|
|
9
|
+
xl: "d-btn--xl"
|
|
10
|
+
}, l = {
|
|
11
|
+
default: "",
|
|
12
|
+
muted: "d-btn--muted",
|
|
13
|
+
danger: "d-btn--danger",
|
|
14
|
+
inverted: "d-btn--inverted"
|
|
15
|
+
}, r = {
|
|
16
|
+
clear: "",
|
|
17
|
+
primary: "d-btn--primary",
|
|
18
|
+
outlined: "d-btn--outlined"
|
|
19
|
+
}, m = ["submit", "reset", "button"], d = {
|
|
20
|
+
left: "d-btn__icon--left",
|
|
21
|
+
right: "d-btn__icon--right",
|
|
22
|
+
top: "d-btn__icon--top",
|
|
23
|
+
bottom: "d-btn__icon--bottom"
|
|
24
|
+
}, b = [
|
|
25
|
+
{
|
|
26
|
+
circle: !0,
|
|
27
|
+
kind: "default",
|
|
28
|
+
importance: "primary",
|
|
29
|
+
message: s(!0, "default", "primary")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
circle: !0,
|
|
33
|
+
kind: "danger",
|
|
34
|
+
importance: "outlined",
|
|
35
|
+
message: s(!0, "danger", "outlined")
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
circle: !0,
|
|
39
|
+
kind: "muted",
|
|
40
|
+
importance: "primary",
|
|
41
|
+
message: s(!0, "muted", "primary")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
circle: !1,
|
|
45
|
+
kind: "muted",
|
|
46
|
+
importance: "primary",
|
|
47
|
+
message: s(!1, "muted", "primary")
|
|
48
|
+
}
|
|
49
|
+
], p = {
|
|
50
|
+
xs: "200",
|
|
51
|
+
sm: "200",
|
|
52
|
+
md: "300",
|
|
53
|
+
lg: "400",
|
|
54
|
+
xl: "500"
|
|
55
|
+
};
|
|
56
|
+
function s(e, t, i) {
|
|
57
|
+
return `You cannot have a ${e ? "circle " : ""}button with kind: ${t} and importance: ${i} as it does not exist in our design system. See https://dialtone.dialpad.com/components/button.html for a list of available button styles`;
|
|
58
|
+
}
|
|
59
|
+
const f = {
|
|
60
|
+
name: "DtButton",
|
|
61
|
+
props: {
|
|
62
|
+
/**
|
|
63
|
+
* Whether the button is a circle or not.
|
|
64
|
+
* @values true, false
|
|
65
|
+
*/
|
|
66
|
+
circle: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* The position of the icon slot within the button.
|
|
72
|
+
* @values left, right, top, bottom
|
|
73
|
+
*/
|
|
74
|
+
iconPosition: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "left",
|
|
77
|
+
validator: (e) => Object.keys(d).includes(e)
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* The fill and outline of the button associated with its visual importance.
|
|
81
|
+
* @values clear, outlined, primary
|
|
82
|
+
*/
|
|
83
|
+
importance: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: "primary",
|
|
86
|
+
validator: (e) => Object.keys(r).includes(e)
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Whether the button should be styled as a link or not.
|
|
90
|
+
* @values true, false
|
|
91
|
+
* @see DtLink
|
|
92
|
+
*/
|
|
93
|
+
link: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: !1
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* The color of the link and button if the button is styled as a link.
|
|
99
|
+
* @values default, warning, danger, success, muted, inverted
|
|
100
|
+
* @see DtLink
|
|
101
|
+
*/
|
|
102
|
+
linkKind: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "default",
|
|
105
|
+
validator: (e) => Object.keys(o).includes(e)
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* HTML button disabled attribute
|
|
109
|
+
* <a
|
|
110
|
+
* class="d-link"
|
|
111
|
+
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled"
|
|
112
|
+
* target="_blank"
|
|
113
|
+
* >
|
|
114
|
+
* (Reference)
|
|
115
|
+
* </a>
|
|
116
|
+
* @values true, false
|
|
117
|
+
*/
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !1
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* HTML button type attribute
|
|
124
|
+
* <a
|
|
125
|
+
* class="d-link"
|
|
126
|
+
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type"
|
|
127
|
+
* target="_blank"
|
|
128
|
+
* >
|
|
129
|
+
* (Reference)
|
|
130
|
+
* </a>
|
|
131
|
+
* @values button, submit, reset
|
|
132
|
+
*/
|
|
133
|
+
type: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "button",
|
|
136
|
+
validator: (e) => m.includes(e)
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Button width, accepts
|
|
140
|
+
* <a class="d-link" href="https://developer.mozilla.org/en-US/docs/Web/CSS/width" target="_blank">
|
|
141
|
+
* CSS width attribute
|
|
142
|
+
* </a>
|
|
143
|
+
* values
|
|
144
|
+
*/
|
|
145
|
+
width: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: null
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* The size of the button.
|
|
151
|
+
* @values xs, sm, md, lg, xl
|
|
152
|
+
*/
|
|
153
|
+
size: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: "md",
|
|
156
|
+
validator: (e) => Object.keys(a).includes(e)
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Used to customize the label container
|
|
160
|
+
*/
|
|
161
|
+
labelClass: {
|
|
162
|
+
type: [String, Array, Object],
|
|
163
|
+
default: ""
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Whether the button should display a loading animation or not.
|
|
167
|
+
* @values true, false
|
|
168
|
+
*/
|
|
169
|
+
loading: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: !1
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* The color of the button.
|
|
175
|
+
* @values default, muted, danger, inverted
|
|
176
|
+
*/
|
|
177
|
+
kind: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: "default",
|
|
180
|
+
validator: (e) => Object.keys(l).includes(e)
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Determines whether a screenreader reads live updates of
|
|
184
|
+
* the button content to the user while the button
|
|
185
|
+
* is in focus. default is to not.
|
|
186
|
+
* @values true, false
|
|
187
|
+
*/
|
|
188
|
+
assertiveOnFocus: {
|
|
189
|
+
type: Boolean,
|
|
190
|
+
default: !1
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Determines whether the button should have active styling
|
|
194
|
+
* default is false.
|
|
195
|
+
* @values true, false
|
|
196
|
+
*/
|
|
197
|
+
active: {
|
|
198
|
+
type: Boolean,
|
|
199
|
+
default: !1
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
emits: [
|
|
203
|
+
/**
|
|
204
|
+
* Native button click event
|
|
205
|
+
*
|
|
206
|
+
* @event click
|
|
207
|
+
* @type {PointerEvent | KeyboardEvent}
|
|
208
|
+
*/
|
|
209
|
+
"click",
|
|
210
|
+
/**
|
|
211
|
+
* Native button focus in event
|
|
212
|
+
*
|
|
213
|
+
* @event focusin
|
|
214
|
+
* @type {FocusEvent}
|
|
215
|
+
*/
|
|
216
|
+
"focusin",
|
|
217
|
+
/**
|
|
218
|
+
* Native button focus out event
|
|
219
|
+
*
|
|
220
|
+
* @event focusout
|
|
221
|
+
* @type {FocusEvent}
|
|
222
|
+
*/
|
|
223
|
+
"focusout"
|
|
224
|
+
],
|
|
225
|
+
data() {
|
|
226
|
+
return {
|
|
227
|
+
ICON_POSITION_MODIFIERS: d,
|
|
228
|
+
// whether the button is currently in focus
|
|
229
|
+
isInFocus: !1
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
computed: {
|
|
233
|
+
buttonListeners() {
|
|
234
|
+
return this.assertiveOnFocus ? {
|
|
235
|
+
...this.$listeners,
|
|
236
|
+
focusin: (e) => {
|
|
237
|
+
this.isInFocus = !0;
|
|
238
|
+
},
|
|
239
|
+
focusout: (e) => {
|
|
240
|
+
this.isInFocus = !1;
|
|
241
|
+
}
|
|
242
|
+
} : this.$listeners;
|
|
243
|
+
},
|
|
244
|
+
computedAriaLive() {
|
|
245
|
+
return this.assertiveOnFocus && this.isInFocus ? "assertive" : this.$attrs.ariaLive;
|
|
246
|
+
},
|
|
247
|
+
iconSize() {
|
|
248
|
+
return p[this.size];
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
watch: {
|
|
252
|
+
$props: {
|
|
253
|
+
deep: !0,
|
|
254
|
+
immediate: !0,
|
|
255
|
+
handler() {
|
|
256
|
+
process.env.NODE_ENV !== "production" && (this.circle && this.link && c.util.warn("You cannot enable circle and link at the same time", this), this.isInvalidPropCombination(this.circle, this.kind, this.importance));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
methods: {
|
|
261
|
+
buttonClasses() {
|
|
262
|
+
return this.link ? [
|
|
263
|
+
"d-link",
|
|
264
|
+
o[this.linkKind],
|
|
265
|
+
a[this.size]
|
|
266
|
+
] : [
|
|
267
|
+
"d-btn",
|
|
268
|
+
r[this.importance],
|
|
269
|
+
l[this.kind],
|
|
270
|
+
a[this.size],
|
|
271
|
+
{
|
|
272
|
+
"d-btn--circle": this.circle,
|
|
273
|
+
"d-btn--loading": this.loading,
|
|
274
|
+
"d-btn--icon-only": this.isIconOnly(),
|
|
275
|
+
"d-btn--vertical": this.isVerticalIconLayout(),
|
|
276
|
+
"d-btn--active": this.active
|
|
277
|
+
}
|
|
278
|
+
];
|
|
279
|
+
},
|
|
280
|
+
isInvalidPropCombination(e, t, i) {
|
|
281
|
+
for (const n of b)
|
|
282
|
+
if (e === n.circle && t === n.kind && i === n.importance)
|
|
283
|
+
return console.warn(n.message), !1;
|
|
284
|
+
return !0;
|
|
285
|
+
},
|
|
286
|
+
shouldRenderIcon() {
|
|
287
|
+
return this.$scopedSlots.icon && !this.link;
|
|
288
|
+
},
|
|
289
|
+
isIconOnly() {
|
|
290
|
+
return this.shouldRenderIcon() && !this.$slots.default;
|
|
291
|
+
},
|
|
292
|
+
isVerticalIconLayout() {
|
|
293
|
+
return !this.isIconOnly() && ["top", "bottom"].includes(this.iconPosition);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
var _ = function() {
|
|
298
|
+
var t = this, i = t._self._c;
|
|
299
|
+
return i("button", t._g({ class: [
|
|
300
|
+
"base-button__button",
|
|
301
|
+
t.buttonClasses()
|
|
302
|
+
], style: { width: t.width }, attrs: { "data-qa": "dt-button", type: t.type, disabled: t.disabled, "aria-live": t.computedAriaLive, "aria-label": t.loading ? "loading" : t.$attrs["aria-label"] } }, t.buttonListeners), [t.shouldRenderIcon() ? i("span", { class: [
|
|
303
|
+
"base-button__icon",
|
|
304
|
+
"d-btn__icon",
|
|
305
|
+
t.ICON_POSITION_MODIFIERS[t.iconPosition]
|
|
306
|
+
], attrs: { "data-qa": "dt-button-icon" } }, [t._t("icon", null, { iconSize: t.iconSize })], 2) : t._e(), t.$slots.default ? i("span", { class: ["d-btn__label", "base-button__label", t.labelClass], attrs: { "data-qa": "dt-button-label" } }, [t._t("default")], 2) : t._e()]);
|
|
307
|
+
}, h = [], I = /* @__PURE__ */ u(
|
|
308
|
+
f,
|
|
309
|
+
_,
|
|
310
|
+
h,
|
|
311
|
+
!1,
|
|
312
|
+
null,
|
|
313
|
+
null,
|
|
314
|
+
null,
|
|
315
|
+
null
|
|
316
|
+
);
|
|
317
|
+
const g = I.exports;
|
|
318
|
+
export {
|
|
319
|
+
p as BUTTON_ICON_SIZES,
|
|
320
|
+
r as BUTTON_IMPORTANCE_MODIFIERS,
|
|
321
|
+
l as BUTTON_KIND_MODIFIERS,
|
|
322
|
+
a as BUTTON_SIZE_MODIFIERS,
|
|
323
|
+
m as BUTTON_TYPES,
|
|
324
|
+
g as DtButton,
|
|
325
|
+
d as ICON_POSITION_MODIFIERS,
|
|
326
|
+
b as INVALID_COMBINATION
|
|
327
|
+
};
|
|
328
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../components/button/button_constants.js","../../components/button/button.vue"],"sourcesContent":["export const BUTTON_SIZE_MODIFIERS = {\n xs: 'd-btn--xs',\n sm: 'd-btn--sm',\n md: '',\n lg: 'd-btn--lg',\n xl: 'd-btn--xl',\n};\n\nexport const BUTTON_KIND_MODIFIERS = {\n default: '',\n muted: 'd-btn--muted',\n danger: 'd-btn--danger',\n inverted: 'd-btn--inverted',\n};\n\nexport const BUTTON_IMPORTANCE_MODIFIERS = {\n clear: '',\n primary: 'd-btn--primary',\n outlined: 'd-btn--outlined',\n};\n\nexport const BUTTON_TYPES = ['submit', 'reset', 'button'];\n\nexport const ICON_POSITION_MODIFIERS = {\n left: 'd-btn__icon--left',\n right: 'd-btn__icon--right',\n top: 'd-btn__icon--top',\n bottom: 'd-btn__icon--bottom',\n};\n\nexport const INVALID_COMBINATION = [\n {\n circle: true,\n kind: 'default',\n importance: 'primary',\n message: _invalidCombinationMessage(true, 'default', 'primary'),\n },\n {\n circle: true,\n kind: 'danger',\n importance: 'outlined',\n message: _invalidCombinationMessage(true, 'danger', 'outlined'),\n },\n {\n circle: true,\n kind: 'muted',\n importance: 'primary',\n message: _invalidCombinationMessage(true, 'muted', 'primary'),\n },\n {\n circle: false,\n kind: 'muted',\n importance: 'primary',\n message: _invalidCombinationMessage(false, 'muted', 'primary'),\n },\n];\n\nexport const BUTTON_ICON_SIZES = {\n xs: '200',\n sm: '200',\n md: '300',\n lg: '400',\n xl: '500',\n};\n\nfunction _invalidCombinationMessage (circle, kind, importance) {\n return `You cannot have a ${circle ? 'circle ' : ''}button \\\nwith kind: ${kind} and importance: ${importance} as it \\\ndoes not exist in our design system. \\\nSee https://dialtone.dialpad.com/components/button.html for a \\\nlist of available button styles`;\n}\n\nexport default {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n BUTTON_ICON_SIZES,\n};\n","<template>\n <button\n :class=\"[\n 'base-button__button',\n buttonClasses(),\n ]\"\n data-qa=\"dt-button\"\n :type=\"type\"\n :disabled=\"disabled\"\n :style=\"{ width: width }\"\n :aria-live=\"computedAriaLive\"\n :aria-label=\"loading ? 'loading' : $attrs['aria-label']\"\n v-on=\"buttonListeners\"\n >\n <!-- NOTE(cormac): This span is needed since we can't apply styles to slots. -->\n <span\n v-if=\"shouldRenderIcon()\"\n data-qa=\"dt-button-icon\"\n :class=\"[\n 'base-button__icon',\n 'd-btn__icon',\n ICON_POSITION_MODIFIERS[iconPosition],\n ]\"\n >\n <!-- @slot Button icon -->\n <slot\n name=\"icon\"\n :icon-size=\"iconSize\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n data-qa=\"dt-button-label\"\n :class=\"['d-btn__label', 'base-button__label', labelClass]\"\n >\n <!-- @slot Content within button -->\n <slot />\n </span>\n </button>\n</template>\n\n<script>\nimport Vue from 'vue';\n\nimport {\n BUTTON_SIZE_MODIFIERS,\n BUTTON_KIND_MODIFIERS,\n BUTTON_IMPORTANCE_MODIFIERS,\n BUTTON_ICON_SIZES,\n BUTTON_TYPES,\n ICON_POSITION_MODIFIERS,\n INVALID_COMBINATION,\n} from './button_constants';\n\nimport { LINK_KIND_MODIFIERS } from '@/components/link';\n\n/**\n * A button is a UI element which allows users to take an action throughout the app.\n * It is important a button is identifiable, consistent, and communicates its actions clearly,\n * and is appropriately sized to its action.\n * @see https://dialtone.dialpad.com/components/button.html\n */\nexport default {\n name: 'DtButton',\n\n props: {\n /**\n * Whether the button is a circle or not.\n * @values true, false\n */\n circle: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of the icon slot within the button.\n * @values left, right, top, bottom\n */\n iconPosition: {\n type: String,\n default: 'left',\n validator: (position) => Object.keys(ICON_POSITION_MODIFIERS).includes(position),\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n * @values clear, outlined, primary\n */\n importance: {\n type: String,\n default: 'primary',\n validator: (i) => Object.keys(BUTTON_IMPORTANCE_MODIFIERS).includes(i),\n },\n\n /**\n * Whether the button should be styled as a link or not.\n * @values true, false\n * @see DtLink\n */\n link: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the link and button if the button is styled as a link.\n * @values default, warning, danger, success, muted, inverted\n * @see DtLink\n */\n linkKind: {\n type: String,\n default: 'default',\n validator: (lk) => Object.keys(LINK_KIND_MODIFIERS).includes(lk),\n },\n\n /**\n * HTML button disabled attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button type attribute\n * <a\n * class=\"d-link\"\n * href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\"\n * target=\"_blank\"\n * >\n * (Reference)\n * </a>\n * @values button, submit, reset\n */\n type: {\n type: String,\n default: 'button',\n validator: (t) => BUTTON_TYPES.includes(t),\n },\n\n /**\n * Button width, accepts\n * <a class=\"d-link\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/width\" target=\"_blank\">\n * CSS width attribute\n * </a>\n * values\n */\n width: {\n type: String,\n default: null,\n },\n\n /**\n * The size of the button.\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n validator: (s) => Object.keys(BUTTON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The color of the button.\n * @values default, muted, danger, inverted\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(BUTTON_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button\n * is in focus. default is to not.\n * @values true, false\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n */\n active: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native button focus in event\n *\n * @event focusin\n * @type {FocusEvent}\n */\n 'focusin',\n\n /**\n * Native button focus out event\n *\n * @event focusout\n * @type {FocusEvent}\n */\n 'focusout',\n ],\n\n data () {\n return {\n ICON_POSITION_MODIFIERS,\n // whether the button is currently in focus\n isInFocus: false,\n };\n },\n\n computed: {\n\n buttonListeners () {\n if (!this.assertiveOnFocus) {\n return this.$listeners;\n }\n return {\n ...this.$listeners,\n focusin: (e) => {\n this.isInFocus = true;\n },\n\n focusout: (e) => {\n this.isInFocus = false;\n },\n };\n },\n\n computedAriaLive () {\n return this.assertiveOnFocus && this.isInFocus ? 'assertive' : this.$attrs.ariaLive;\n },\n\n iconSize () {\n return BUTTON_ICON_SIZES[this.size];\n },\n },\n\n watch: {\n $props: {\n deep: true,\n immediate: true,\n handler () {\n if (process.env.NODE_ENV === 'production') return;\n\n if (this.circle && this.link) {\n Vue.util.warn('You cannot enable circle and link at the same time', this);\n }\n\n this.isInvalidPropCombination(this.circle, this.kind, this.importance);\n },\n },\n },\n\n methods: {\n buttonClasses () {\n if (this.link) {\n return [\n 'd-link',\n LINK_KIND_MODIFIERS[this.linkKind],\n BUTTON_SIZE_MODIFIERS[this.size],\n ];\n }\n return [\n 'd-btn',\n BUTTON_IMPORTANCE_MODIFIERS[this.importance],\n BUTTON_KIND_MODIFIERS[this.kind],\n BUTTON_SIZE_MODIFIERS[this.size],\n {\n 'd-btn--circle': this.circle,\n 'd-btn--loading': this.loading,\n 'd-btn--icon-only': this.isIconOnly(),\n 'd-btn--vertical': this.isVerticalIconLayout(),\n 'd-btn--active': this.active,\n },\n ];\n },\n\n isInvalidPropCombination (circle, kind, importance) {\n for (const row of INVALID_COMBINATION) {\n if (circle === row.circle && kind === row.kind && importance === row.importance) {\n console.warn(row.message);\n return false;\n }\n }\n return true;\n },\n\n shouldRenderIcon () {\n return this.$scopedSlots.icon && !this.link;\n },\n\n isIconOnly () {\n return this.shouldRenderIcon() && !this.$slots.default;\n },\n\n isVerticalIconLayout () {\n return !this.isIconOnly() && ['top', 'bottom'].includes(this.iconPosition);\n },\n },\n};\n</script>\n"],"names":["BUTTON_SIZE_MODIFIERS","BUTTON_KIND_MODIFIERS","BUTTON_IMPORTANCE_MODIFIERS","BUTTON_TYPES","ICON_POSITION_MODIFIERS","INVALID_COMBINATION","_invalidCombinationMessage","BUTTON_ICON_SIZES","circle","kind","importance","_sfc_main","position","i","lk","LINK_KIND_MODIFIERS","t","s","k","Vue","row"],"mappings":";;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ton as l, CALLBAR_BUTTON_VALID_WIDTH_SIZE as a } from "./callbar-button.js";
|
|
4
|
+
import { DtPopover as i } from "./popover.js";
|
|
5
|
+
import { DtButton as s } from "./button.js";
|
|
6
|
+
import { DtIcon as p } from "./icon.js";
|
|
7
|
+
import "./constants.js";
|
|
8
|
+
import "vue";
|
|
9
|
+
import "./tooltip.js";
|
|
10
|
+
import "../chunks/popover_constants-qjlEkroB.js";
|
|
11
|
+
import "tippy.js";
|
|
12
|
+
import "./lazy-show.js";
|
|
13
|
+
import "@linusborg/vue-simple-portal";
|
|
14
|
+
import "../chunks/modal-VuMFkZFH.js";
|
|
15
|
+
import "../chunks/sr_only_close_button-JGole5Xi.js";
|
|
16
|
+
import "../chunks/link_constants-vIUB92L4.js";
|
|
17
|
+
import "@dialpad/dialtone-icons/vue2";
|
|
18
|
+
import "../chunks/icon_constants-OpYAAKwF.js";
|
|
19
|
+
import "@dialpad/dialtone-icons/icons.json";
|
|
20
|
+
import "./skeleton.js";
|
|
21
|
+
const c = {
|
|
22
|
+
name: "DtRecipeCallbarButtonWithPopover",
|
|
23
|
+
components: { DtRecipeCallbarButton: l, DtPopover: i, DtButton: s, DtIcon: p },
|
|
24
|
+
/* inheritAttrs: false is generally an option we want to set on library
|
|
25
|
+
components. This allows any attributes passed in that are not recognized
|
|
26
|
+
as props to be passed down to another element or component using v-bind:$attrs
|
|
27
|
+
more info: https://vuejs.org/v2/api/#inheritAttrs */
|
|
28
|
+
inheritAttrs: !1,
|
|
29
|
+
props: {
|
|
30
|
+
/**
|
|
31
|
+
* Id for the item.
|
|
32
|
+
*/
|
|
33
|
+
id: {
|
|
34
|
+
type: String,
|
|
35
|
+
default() {
|
|
36
|
+
return r.getUniqueString();
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Aria label for the button. If empty, it takes its value from the default slot.
|
|
41
|
+
*/
|
|
42
|
+
ariaLabel: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null,
|
|
45
|
+
validator: (e) => e || (void 0).$slots.default
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Aria label for the arrow. Cannot be empty.
|
|
49
|
+
*/
|
|
50
|
+
arrowButtonLabel: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: !0,
|
|
53
|
+
validator: (e) => !!e
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* The direction the popover displays relative to the anchor.
|
|
57
|
+
* @values 'bottom', 'bottom-start', 'bottom-end',
|
|
58
|
+
* 'right', 'right-start', 'right-end',
|
|
59
|
+
* 'left', 'left-start', 'left-end',
|
|
60
|
+
* 'top', 'top-start', 'top-end'
|
|
61
|
+
* @default 'top'
|
|
62
|
+
*/
|
|
63
|
+
placement: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "top"
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* The element that is focused when the popover is opened. This can be an
|
|
69
|
+
* HTMLElement within the popover, a string starting with '#' which will
|
|
70
|
+
* find the element by ID. 'first' which will automatically focus
|
|
71
|
+
* the first element, or 'dialog' which will focus the dialog window itself.
|
|
72
|
+
* If the dialog is modal this prop cannot be 'none'.
|
|
73
|
+
*/
|
|
74
|
+
initialFocusElement: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "first"
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Determines visibility for close button
|
|
80
|
+
*/
|
|
81
|
+
showCloseButton: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !0
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Determines whether the button should be disabled
|
|
87
|
+
* default is false.
|
|
88
|
+
* @values true, false
|
|
89
|
+
*/
|
|
90
|
+
disabled: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Forces showing the arrow, even if the button is disabled.
|
|
96
|
+
* default is false
|
|
97
|
+
* @values true, false
|
|
98
|
+
*/
|
|
99
|
+
forceShowArrow: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Determines whether the button should have active styling
|
|
105
|
+
* default is false.
|
|
106
|
+
* @values true, false
|
|
107
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
108
|
+
*/
|
|
109
|
+
active: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: !1
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Determines whether the button should have danger styling
|
|
115
|
+
* default is false.
|
|
116
|
+
* @values true, false
|
|
117
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
118
|
+
*/
|
|
119
|
+
danger: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* Additional class name for the button wrapper element.
|
|
125
|
+
*/
|
|
126
|
+
buttonClass: {
|
|
127
|
+
type: [String, Array, Object],
|
|
128
|
+
default: ""
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Additional class name for the button text.
|
|
132
|
+
*/
|
|
133
|
+
textClass: {
|
|
134
|
+
type: [String, Array, Object],
|
|
135
|
+
default: ""
|
|
136
|
+
},
|
|
137
|
+
/*
|
|
138
|
+
* Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.
|
|
139
|
+
*/
|
|
140
|
+
buttonWidthSize: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: "xl",
|
|
143
|
+
validator: (e) => a.includes(e)
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Additional class name for the popover content wrapper element.
|
|
147
|
+
*/
|
|
148
|
+
contentClass: {
|
|
149
|
+
type: [String, Array, Object],
|
|
150
|
+
default: ""
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* To auto open the modal popover.
|
|
154
|
+
*/
|
|
155
|
+
openPopover: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: !1
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
emits: [
|
|
161
|
+
/**
|
|
162
|
+
* Emitted when the arrow is clicked
|
|
163
|
+
*/
|
|
164
|
+
"arrow-click",
|
|
165
|
+
/**
|
|
166
|
+
* Native click event
|
|
167
|
+
*
|
|
168
|
+
* @event click
|
|
169
|
+
* @type {PointerEvent | KeyboardEvent}
|
|
170
|
+
*/
|
|
171
|
+
"click",
|
|
172
|
+
/**
|
|
173
|
+
* Emitted when modal popover is opened or closed.
|
|
174
|
+
*/
|
|
175
|
+
"opened"
|
|
176
|
+
],
|
|
177
|
+
data() {
|
|
178
|
+
return {
|
|
179
|
+
open: !1
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
computed: {
|
|
183
|
+
showArrowButton() {
|
|
184
|
+
return this.forceShowArrow || !this.disabled;
|
|
185
|
+
},
|
|
186
|
+
isCompactMode() {
|
|
187
|
+
return this.buttonWidthSize === "sm" || this.buttonWidthSize === "md";
|
|
188
|
+
},
|
|
189
|
+
showPopover() {
|
|
190
|
+
return !this.openPopover || this.open ? (this.syncOpenState(), !1) : this.toggleOpen();
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
methods: {
|
|
194
|
+
arrowClick(e) {
|
|
195
|
+
return this.$emit("arrow-click", e), this.toggleOpen();
|
|
196
|
+
},
|
|
197
|
+
toggleOpen() {
|
|
198
|
+
return this.open = !this.open;
|
|
199
|
+
},
|
|
200
|
+
syncOpenState() {
|
|
201
|
+
this.open = this.openPopover;
|
|
202
|
+
},
|
|
203
|
+
buttonClick(e) {
|
|
204
|
+
this.$listeners.click ? this.$emit("click", e) : this.arrowClick(e);
|
|
205
|
+
},
|
|
206
|
+
onModalIsOpened(e) {
|
|
207
|
+
this.open = e, this.$emit("opened", e);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var u = function() {
|
|
212
|
+
var t = this, o = t._self._c;
|
|
213
|
+
return o("div", { staticClass: "dt-recipe--callbar-button-with-popover" }, [o("dt-recipe-callbar-button", { staticClass: "dt-recipe--callbar-button-with-popover--main-button", attrs: { "aria-label": t.ariaLabel, disabled: t.disabled, active: t.active, danger: t.danger, "button-class": t.buttonClass, "button-width-size": t.buttonWidthSize, "text-class": t.textClass }, on: { click: t.buttonClick } }, [t._t("icon", null, { slot: "icon" }), t._t("tooltip", null, { slot: "tooltip" }), t._t("default")], 2), t.showArrowButton ? o("dt-popover", t._b({ staticClass: "dt-recipe--callbar-button-with-popover--popover-wrapper", attrs: { id: t.id, modal: !1, open: t.open, placement: t.placement, "initial-focus-element": t.initialFocusElement, "show-close-button": t.showCloseButton, offset: [0, 16], padding: "none", "dialog-class": ["dt-recipe--callbar-button-with-popover--popover", t.contentClass], "header-class": "d-d-flex d-ai-center d-fw-normal d-px12", "open-popover": t.showPopover }, on: { opened: t.onModalIsOpened }, scopedSlots: t._u([{ key: "anchor", fn: function() {
|
|
214
|
+
return [o("dt-button", { class: [
|
|
215
|
+
"dt-recipe--callbar-button-with-popover--arrow",
|
|
216
|
+
{ "dt-recipe--callbar-button-with-popover--arrow--large": !t.isCompactMode }
|
|
217
|
+
], attrs: { circle: "", importance: "clear", size: "lg", width: "2rem", "aria-label": t.arrowButtonLabel, active: t.open }, on: { click: t.arrowClick }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
218
|
+
return [o("dt-icon", { staticClass: "dt-recipe--callbar-button-with-popover--arrow__icon", attrs: { name: "chevron-up", size: "200" } })];
|
|
219
|
+
}, proxy: !0 }], null, !1, 982444464) })];
|
|
220
|
+
}, proxy: !0 }], null, !1, 3818376870) }, "dt-popover", t.$attrs, !1), [t._t("content", null, { slot: "content" }), t._t("headerContent", null, { slot: "headerContent" }), t._t("footerContent", null, { slot: "footerContent" })], 2) : t._e()], 1);
|
|
221
|
+
}, d = [], f = /* @__PURE__ */ n(
|
|
222
|
+
c,
|
|
223
|
+
u,
|
|
224
|
+
d,
|
|
225
|
+
!1,
|
|
226
|
+
null,
|
|
227
|
+
null,
|
|
228
|
+
null,
|
|
229
|
+
null
|
|
230
|
+
);
|
|
231
|
+
const I = f.exports;
|
|
232
|
+
export {
|
|
233
|
+
I as DtRecipeCallbarButtonWithPopover
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=callbar-button-with-popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbar-button-with-popover.js","sources":["../../recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-popover\"\n >\n <dt-recipe-callbar-button\n :aria-label=\"ariaLabel\"\n :disabled=\"disabled\"\n :active=\"active\"\n :danger=\"danger\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :text-class=\"textClass\"\n class=\"dt-recipe--callbar-button-with-popover--main-button\"\n @click=\"buttonClick\"\n >\n <slot\n slot=\"icon\"\n name=\"icon\"\n />\n <slot\n slot=\"tooltip\"\n name=\"tooltip\"\n />\n <slot />\n </dt-recipe-callbar-button>\n <dt-popover\n v-if=\"showArrowButton\"\n :id=\"id\"\n :modal=\"false\"\n :open=\"open\"\n :placement=\"placement\"\n :initial-focus-element=\"initialFocusElement\"\n :show-close-button=\"showCloseButton\"\n :offset=\"[0, 16]\"\n padding=\"none\"\n class=\"dt-recipe--callbar-button-with-popover--popover-wrapper\"\n :dialog-class=\"['dt-recipe--callbar-button-with-popover--popover', contentClass]\"\n header-class=\"d-d-flex d-ai-center d-fw-normal d-px12\"\n v-bind=\"$attrs\"\n :open-popover=\"showPopover\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n circle\n importance=\"clear\"\n size=\"lg\"\n :class=\"['dt-recipe--callbar-button-with-popover--arrow',\n { 'dt-recipe--callbar-button-with-popover--arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon\n name=\"chevron-up\"\n class=\"dt-recipe--callbar-button-with-popover--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <slot\n slot=\"content\"\n name=\"content\"\n />\n <slot\n slot=\"headerContent\"\n name=\"headerContent\"\n />\n <slot\n slot=\"footerContent\"\n name=\"footerContent\"\n />\n </dt-popover>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtIcon } from '@/components/icon';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithPopover',\n\n components: { DtRecipeCallbarButton, DtPopover, DtButton, DtIcon },\n\n /* inheritAttrs: false is generally an option we want to set on library\n components. This allows any attributes passed in that are not recognized\n as props to be passed down to another element or component using v-bind:$attrs\n more info: https://vuejs.org/v2/api/#inheritAttrs */\n inheritAttrs: false,\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () {\n return utils.getUniqueString();\n },\n },\n\n /**\n * Aria label for the button. If empty, it takes its value from the default slot.\n */\n ariaLabel: {\n type: String,\n default: null,\n validator: (label) => {\n return label || this.$slots.default;\n },\n },\n\n /**\n * Aria label for the arrow. Cannot be empty.\n */\n arrowButtonLabel: {\n type: String,\n required: true,\n validator: (label) => {\n return !!label;\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * @values 'bottom', 'bottom-start', 'bottom-end',\n * 'right', 'right-start', 'right-end',\n * 'left', 'left-start', 'left-end',\n * 'top', 'top-start', 'top-end'\n * @default 'top'\n */\n placement: {\n type: String,\n default: 'top',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: String,\n default: 'first',\n },\n\n /**\n * Determines visibility for close button\n */\n showCloseButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines whether the button should be disabled\n * default is false.\n * @values true, false\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Forces showing the arrow, even if the button is disabled.\n * default is false\n * @values true, false\n */\n forceShowArrow: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have active styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines whether the button should have danger styling\n * default is false.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n danger: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the button wrapper element.\n */\n buttonClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the button text.\n */\n textClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /*\n * Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.\n */\n buttonWidthSize: {\n type: String,\n default: 'xl',\n validator: size => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size),\n },\n\n /**\n * Additional class name for the popover content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * To auto open the modal popover.\n */\n openPopover: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Emitted when the arrow is clicked\n */\n 'arrow-click',\n\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Emitted when modal popover is opened or closed.\n */\n 'opened',\n ],\n\n data () {\n return {\n open: false,\n };\n },\n\n computed: {\n showArrowButton () {\n return this.forceShowArrow || !this.disabled;\n },\n\n isCompactMode () {\n return this.buttonWidthSize === 'sm' || this.buttonWidthSize === 'md';\n },\n\n showPopover () {\n if (!this.openPopover || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n methods: {\n arrowClick (ev) {\n this.$emit('arrow-click', ev);\n return this.toggleOpen();\n },\n\n toggleOpen () {\n return (this.open = !this.open);\n },\n\n syncOpenState () {\n this.open = this.openPopover;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the popover\n // the same as if the arrow was clicked.\n if (!this.$listeners.click) {\n this.arrowClick(ev);\n } else {\n this.$emit('click', ev);\n }\n },\n\n onModalIsOpened (isOpened) {\n this.open = isOpened;\n this.$emit('opened', isOpened);\n },\n },\n\n};\n</script>\n\n<style lang=\"less\">\n.dt-recipe--callbar-button-with-popover--arrow {\n margin-top: var(--dt-space-350-negative);\n margin-left: calc(var(--dt-space-300-negative) * 5);\n width: var(--dt-size-500);\n height: var(--dt-size-500);\n padding: var(--dt-space-400);\n border-radius: var(--dt-size-300);\n\n &.d-btn--active {\n background: var(--dt-color-surface-moderate-opaque);\n }\n\n &--large {\n margin-left: var(--dt-space-550-negative);\n }\n\n &__icon {\n color: var(--dt-color-black-800);\n }\n}\n\n.dt-recipe--callbar-button-with-popover--popover {\n .d-popover__header {\n background: var(--dt-color-surface-contrast);\n color: var(--dt-color-foreground-primary-inverted);\n\n .d-btn {\n color: var(--dt-color-foreground-primary-inverted);\n }\n }\n}\n\n.dt-recipe--callbar-button-with-popover--button .d-tab--selected::after,\n.dt-recipe--callbar-button-with-popover--button .d-tab--selected:hover::after {\n --tab--bgc: var(--dt-color-surface-contrast);\n}\n.dt-recipe--callbar-button-with-popover--button .tab-group {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.dt-recipe--callbar-button-with-popover--button .tab-content {\n flex: 1 1 100%;\n overflow-y: auto;\n}\n\n.dt-recipe--callbar-button-with-popover {\n display: flex;\n align-items: center;\n}\n</style>\n"],"names":["_sfc_main","DtRecipeCallbarButton","DtPopover","DtButton","DtIcon","utils","label","this","size","CALLBAR_BUTTON_VALID_WIDTH_SIZE","ev","isOpened"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsFA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,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