@dialpad/dialtone 9.102.2 → 9.104.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/dist/css/dialtone-default-theme.css +41 -0
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +41 -0
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +9832 -9832
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +8 -0
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +8 -0
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue2/dialtone-vue.cjs +2 -0
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +42 -40
- package/dist/vue2/dialtone-vue.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown.cjs +5 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.cjs.map +1 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.js +5 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.js.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs +9 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js +9 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +258 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +258 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +9 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +9 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/index.d.ts +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +9 -0
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +167 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts +2 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts.map +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +9 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/common/utils.cjs +1 -1
- package/dist/vue3/common/utils.cjs.map +1 -1
- package/dist/vue3/common/utils.js +1 -1
- package/dist/vue3/common/utils.js.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +8 -0
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +8 -0
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +2 -0
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +42 -40
- package/dist/vue3/dialtone-vue.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown.cjs +5 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.cjs.map +1 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.js +5 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.js.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs +10 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js +10 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +321 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +321 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +10 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +10 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +2 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +2 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/index.d.ts +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +9 -0
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +180 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts +2 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts.map +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +9 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button.vue.cjs","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\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 * 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 * 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 * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\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 * 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 * 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: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["DtButton","DtTooltip","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"callbar_button.vue.cjs","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :delay=\"tooltipDelay\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\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 * 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 * 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 * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\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 * 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 * 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: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["DtButton","DtTooltip","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE"],"mappings":";;;;;;;AA2CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,qBAAA;AACA,aAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,QACA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mBAAA,KAAA;AAAA,QACA;AAAA,MAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,cAAA,KAAA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,UAAA,KAAA,YAAA;AACA,eAAA,KAAA;AAAA,MACA;AACA,aAAA,KAAA,SAAA,aAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA,GAAA,KAAA;AAAA,QACA,OAAA,CAAA,UAAA,KAAA,MAAA,SAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -118,6 +118,14 @@ const _sfc_main = {
|
|
|
118
118
|
tooltipText: {
|
|
119
119
|
type: String,
|
|
120
120
|
default: void 0
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* Whether there is a delay before the tooltip shows on hover/focus.
|
|
124
|
+
* @values true, false
|
|
125
|
+
*/
|
|
126
|
+
tooltipDelay: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: void 0
|
|
121
129
|
}
|
|
122
130
|
},
|
|
123
131
|
emits: [
|
|
@@ -174,7 +182,7 @@ const _sfc_main = {
|
|
|
174
182
|
};
|
|
175
183
|
var _sfc_render = function render() {
|
|
176
184
|
var _vm = this, _c = _vm._self._c;
|
|
177
|
-
return _c("dt-tooltip", { attrs: { "id": _vm.id, "inverted": _vm.invertedTooltip, "show": _vm.showTooltip, "offset": [0, 24] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
185
|
+
return _c("dt-tooltip", { attrs: { "id": _vm.id, "inverted": _vm.invertedTooltip, "delay": _vm.tooltipDelay, "show": _vm.showTooltip, "offset": [0, 24] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
178
186
|
return [_c("span", { class: { "d-recipe-callbar-button--disabled": _vm.disabled } }, [_c("dt-button", _vm._g(_vm._b({ class: _vm.callbarButtonClass, attrs: { "importance": _vm.buttonImportance, "kind": "muted", "icon-position": "top", "aria-disabled": _vm.disabled, "aria-label": _vm.ariaLabel, "label-class": _vm.callbarButtonTextClass, "width": _vm.buttonWidth }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
179
187
|
return [_vm._t("icon")];
|
|
180
188
|
}, proxy: true }], null, true) }, "dt-button", _vm.$attrs, false), _vm.callbarButtonListeners), [_vm._t("default")], 2)], 1)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button.vue.js","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\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 * 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 * 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 * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\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 * 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 * 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: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["this"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"callbar_button.vue.js","sources":["../../../../recipes/buttons/callbar_button/callbar_button.vue"],"sourcesContent":["<template>\n <dt-tooltip\n :id=\"id\"\n :inverted=\"invertedTooltip\"\n :delay=\"tooltipDelay\"\n :show=\"showTooltip\"\n :offset=\"[0, 24]\"\n >\n <template #anchor>\n <span\n :class=\"{ 'd-recipe-callbar-button--disabled': disabled }\"\n >\n <dt-button\n :importance=\"buttonImportance\"\n kind=\"muted\"\n icon-position=\"top\"\n :aria-disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n :label-class=\"callbarButtonTextClass\"\n :width=\"buttonWidth\"\n :class=\"callbarButtonClass\"\n v-bind=\"$attrs\"\n v-on=\"callbarButtonListeners\"\n >\n <slot />\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </dt-button>\n </span>\n </template>\n <slot name=\"tooltip\">\n {{ tooltipText }}\n </slot>\n </dt-tooltip>\n</template>\n\n<script>\nimport { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from './callbar_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport utils from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButton',\n\n components: { DtButton, DtTooltip },\n\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 * 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 * 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 * Whether the button is a circle or not.\n * @values true, false\n * @see https://dialtone.dialpad.com/components/button/\n */\n circle: {\n type: Boolean,\n default: false,\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 * 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 * 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: '',\n },\n\n /**\n * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n computed: {\n callbarButtonClass () {\n return [\n this.buttonClass,\n 'd-recipe-callbar-button',\n {\n 'd-recipe-callbar-button--circle': this.circle,\n 'd-recipe-callbar-button--active': this.active,\n 'd-recipe-callbar-button--danger': this.danger,\n 'd-btn--disabled': this.disabled,\n }];\n },\n\n callbarButtonTextClass () {\n return [\n 'd-recipe-callbar-button__text',\n this.textClass,\n ];\n },\n\n buttonWidth () {\n switch (this.buttonWidthSize) {\n case 'sm':\n return '4.5rem';\n case 'md':\n return '6rem';\n default:\n return '8.4rem';\n }\n },\n\n buttonImportance () {\n if (this.importance) {\n return this.importance;\n }\n return this.circle ? 'outlined' : 'clear';\n },\n\n callbarButtonListeners () {\n return {\n ...this.$listeners,\n click: (event) => this.$emit('click', event),\n };\n },\n },\n};\n</script>\n"],"names":["this"],"mappings":";;;;;AA2CA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,UAA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AA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,qBAAA;AACA,aAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,QACA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mCAAA,KAAA;AAAA,UACA,mBAAA,KAAA;AAAA,QACA;AAAA,MAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA;AAAA,QACA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,cAAA,KAAA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA,KAAA;AACA,iBAAA;AAAA,QACA;AACA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,mBAAA;AACA,UAAA,KAAA,YAAA;AACA,eAAA,KAAA;AAAA,MACA;AACA,aAAA,KAAA,SAAA,aAAA;AAAA,IACA;AAAA,IAEA,yBAAA;AACA,aAAA;AAAA,QACA,GAAA,KAAA;AAAA,QACA,OAAA,CAAA,UAAA,KAAA,MAAA,SAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
|
package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue2 = require("@dialpad/dialtone-icons/vue2");
|
|
4
|
+
const common_utils = require("../../../common/utils.cjs");
|
|
5
|
+
const _pluginVue2_normalizer = require("../../../_virtual/_plugin-vue2_normalizer.cjs");
|
|
6
|
+
const callbar_button = require("../callbar_button/callbar_button.vue.cjs");
|
|
7
|
+
const dropdown = require("../../../components/dropdown/dropdown.vue.cjs");
|
|
8
|
+
const button = require("../../../components/button/button.vue.cjs");
|
|
9
|
+
const callbar_button_constants = require("../callbar_button/callbar_button_constants.cjs");
|
|
10
|
+
const _sfc_main = {
|
|
11
|
+
name: "DtRecipeCallbarButtonWithDropdown",
|
|
12
|
+
components: { DtRecipeCallbarButton: callbar_button.default, DtDropdown: dropdown.default, DtButton: button.default, DtIconChevronUp: vue2.DtIconChevronUp },
|
|
13
|
+
/* inheritAttrs: false is generally an option we want to set on library
|
|
14
|
+
components. This allows any attributes passed in that are not recognized
|
|
15
|
+
as props to be passed down to another element or component using v-bind:$attrs
|
|
16
|
+
more info: https://vuejs.org/v2/api/#inheritAttrs */
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
props: {
|
|
19
|
+
/**
|
|
20
|
+
* Id for the item.
|
|
21
|
+
*/
|
|
22
|
+
id: {
|
|
23
|
+
type: String,
|
|
24
|
+
default() {
|
|
25
|
+
return common_utils.default.getUniqueString();
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Aria label for the button. If empty, it takes its value from the default slot.
|
|
30
|
+
*/
|
|
31
|
+
ariaLabel: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null,
|
|
34
|
+
validator: (label) => {
|
|
35
|
+
return label || (void 0).$slots.default;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Aria label for the arrow. Cannot be empty.
|
|
40
|
+
*/
|
|
41
|
+
arrowButtonLabel: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
validator: (label) => {
|
|
45
|
+
return !!label;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* The direction the dropdown displays relative to the anchor.
|
|
50
|
+
* @values 'bottom', 'bottom-start', 'bottom-end',
|
|
51
|
+
* 'right', 'right-start', 'right-end',
|
|
52
|
+
* 'left', 'left-start', 'left-end',
|
|
53
|
+
* 'top', 'top-start', 'top-end'
|
|
54
|
+
* @default 'top'
|
|
55
|
+
*/
|
|
56
|
+
placement: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "top"
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* If the dropdown does not fit in the direction described by "placement",
|
|
62
|
+
* it will attempt to change it's direction to the "fallbackPlacements".
|
|
63
|
+
*
|
|
64
|
+
* @values top, top-start, top-end,
|
|
65
|
+
* right, right-start, right-end,
|
|
66
|
+
* left, left-start, left-end,
|
|
67
|
+
* bottom, bottom-start, bottom-end,
|
|
68
|
+
* auto, auto-start, auto-end
|
|
69
|
+
* */
|
|
70
|
+
fallbackPlacements: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: () => {
|
|
73
|
+
return ["auto"];
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Determines whether the button should be disabled
|
|
78
|
+
* default is false.
|
|
79
|
+
* @values true, false
|
|
80
|
+
*/
|
|
81
|
+
disabled: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Forces showing the arrow, even if the button is disabled.
|
|
87
|
+
* default is false
|
|
88
|
+
* @values true, false
|
|
89
|
+
*/
|
|
90
|
+
forceShowArrow: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Determines whether the button should have active styling
|
|
96
|
+
* default is false.
|
|
97
|
+
* @values true, false
|
|
98
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
99
|
+
*/
|
|
100
|
+
active: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Determines whether the button should have danger styling
|
|
106
|
+
* default is false.
|
|
107
|
+
* @values true, false
|
|
108
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
109
|
+
*/
|
|
110
|
+
danger: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Additional class name for the button wrapper element.
|
|
116
|
+
*/
|
|
117
|
+
buttonClass: {
|
|
118
|
+
type: [String, Array, Object],
|
|
119
|
+
default: ""
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Additional class name for the button text.
|
|
123
|
+
*/
|
|
124
|
+
textClass: {
|
|
125
|
+
type: [String, Array, Object],
|
|
126
|
+
default: ""
|
|
127
|
+
},
|
|
128
|
+
/*
|
|
129
|
+
* Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.
|
|
130
|
+
*/
|
|
131
|
+
buttonWidthSize: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: "xl",
|
|
134
|
+
validator: (size) => callbar_button_constants.CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size)
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Whether the tooltip has an inverted background color.
|
|
138
|
+
* @values true, false
|
|
139
|
+
*/
|
|
140
|
+
invertedTooltip: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: false
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Use this if you would like to manually override the logic for when the tooltip shows.
|
|
146
|
+
* Otherwise it will just show on hover/focus.
|
|
147
|
+
* @values null, true, false
|
|
148
|
+
*/
|
|
149
|
+
showTooltip: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: null
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
* The message that displays in the tooltip. This will be overridden by the tooltip slot.
|
|
155
|
+
*/
|
|
156
|
+
tooltipText: {
|
|
157
|
+
type: String,
|
|
158
|
+
default: void 0
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* Whether there is a delay before the tooltip shows on hover/focus.
|
|
162
|
+
* @values true, false
|
|
163
|
+
*/
|
|
164
|
+
tooltipDelay: {
|
|
165
|
+
type: Boolean,
|
|
166
|
+
default: void 0
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
emits: [
|
|
170
|
+
/**
|
|
171
|
+
* Emitted when the arrow is clicked
|
|
172
|
+
*/
|
|
173
|
+
"arrow-click",
|
|
174
|
+
/**
|
|
175
|
+
* Native click event
|
|
176
|
+
*
|
|
177
|
+
* @event click
|
|
178
|
+
* @type {PointerEvent | KeyboardEvent}
|
|
179
|
+
*/
|
|
180
|
+
"click",
|
|
181
|
+
/**
|
|
182
|
+
* Emitted when modal dropdown is opened or closed.
|
|
183
|
+
*/
|
|
184
|
+
"opened"
|
|
185
|
+
],
|
|
186
|
+
data() {
|
|
187
|
+
return {
|
|
188
|
+
open: false
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
computed: {
|
|
192
|
+
showArrowButton() {
|
|
193
|
+
return this.forceShowArrow || !this.disabled;
|
|
194
|
+
},
|
|
195
|
+
isCompactMode() {
|
|
196
|
+
return this.buttonWidthSize === "sm" || this.buttonWidthSize === "md";
|
|
197
|
+
},
|
|
198
|
+
showDropdown() {
|
|
199
|
+
if (!this.openDropdown || this.open) {
|
|
200
|
+
this.syncOpenState();
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
return this.toggleOpen();
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
mounted() {
|
|
207
|
+
common_utils.warnIfUnmounted(this.$el, this.$options.name);
|
|
208
|
+
},
|
|
209
|
+
methods: {
|
|
210
|
+
arrowClick(ev) {
|
|
211
|
+
this.$emit("arrow-click", ev);
|
|
212
|
+
return this.toggleOpen();
|
|
213
|
+
},
|
|
214
|
+
toggleOpen() {
|
|
215
|
+
return this.open = !this.open;
|
|
216
|
+
},
|
|
217
|
+
syncOpenState() {
|
|
218
|
+
this.open = this.openDropdown;
|
|
219
|
+
},
|
|
220
|
+
buttonClick(ev) {
|
|
221
|
+
if (!this.$listeners.click) {
|
|
222
|
+
this.arrowClick(ev);
|
|
223
|
+
} else {
|
|
224
|
+
this.$emit("click", ev);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
onModalIsOpened(isOpened) {
|
|
228
|
+
this.open = isOpened;
|
|
229
|
+
this.$emit("opened", isOpened);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
var _sfc_render = function render() {
|
|
234
|
+
var _vm = this, _c = _vm._self._c;
|
|
235
|
+
return _c("div", { staticClass: "dt-recipe--callbar-button-with-dropdown" }, [_c("dt-recipe-callbar-button", { staticClass: "dt-recipe--callbar-button-with-dropdown--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText, "tooltip-delay": _vm.tooltipDelay }, on: { "click": _vm.buttonClick }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
236
|
+
return [_vm._t("icon")];
|
|
237
|
+
}, proxy: true }, { key: "tooltip", fn: function() {
|
|
238
|
+
return [_vm._t("tooltip")];
|
|
239
|
+
}, proxy: true }], null, true) }, [_vm._t("default")], 2), _vm.showArrowButton ? _c("dt-dropdown", _vm._b({ staticClass: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper", attrs: { "id": _vm.id, "open": _vm.open, "placement": _vm.placement, "fallback-placements": _vm.fallbackPlacements, "padding": "none" }, on: { "opened": _vm.onModalIsOpened }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
240
|
+
return [_c("dt-button", { class: [
|
|
241
|
+
"dt-recipe--callbar-button-with-dropdown--arrow",
|
|
242
|
+
{ "dt-recipe--callbar-button-with-dropdown--arrow--large": !_vm.isCompactMode }
|
|
243
|
+
], attrs: { "circle": "", "importance": "clear", "size": "lg", "width": "2rem", "aria-label": _vm.arrowButtonLabel, "active": _vm.open }, on: { "click": _vm.arrowClick }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
244
|
+
return [_c("dt-icon-chevron-up", { staticClass: "dt-recipe--callbar-button-with-dropdown--arrow__icon", attrs: { "size": "200" } })];
|
|
245
|
+
}, proxy: true }], null, false, 887776886) })];
|
|
246
|
+
}, proxy: true }, { key: "list", fn: function() {
|
|
247
|
+
return [_vm._t("list")];
|
|
248
|
+
}, proxy: true }], null, true) }, "dt-dropdown", _vm.$attrs, false)) : _vm._e()], 1);
|
|
249
|
+
};
|
|
250
|
+
var _sfc_staticRenderFns = [];
|
|
251
|
+
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default(
|
|
252
|
+
_sfc_main,
|
|
253
|
+
_sfc_render,
|
|
254
|
+
_sfc_staticRenderFns
|
|
255
|
+
);
|
|
256
|
+
const callbar_button_with_dropdown = __component__.exports;
|
|
257
|
+
exports.default = callbar_button_with_dropdown;
|
|
258
|
+
//# sourceMappingURL=callbar_button_with_dropdown.vue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbar_button_with_dropdown.vue.cjs","sources":["../../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"sourcesContent":["<template>\n <div\n class=\"dt-recipe--callbar-button-with-dropdown\"\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 :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :tooltip-text=\"tooltipText\"\n :tooltip-delay=\"tooltipDelay\"\n class=\"dt-recipe--callbar-button-with-dropdown--main-button\"\n @click=\"buttonClick\"\n >\n <template #icon>\n <slot name=\"icon\" />\n </template>\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n <slot />\n </dt-recipe-callbar-button>\n <dt-dropdown\n v-if=\"showArrowButton\"\n :id=\"id\"\n :open=\"open\"\n :placement=\"placement\"\n :fallback-placements=\"fallbackPlacements\"\n padding=\"none\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n v-bind=\"$attrs\"\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-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n width=\"2rem\"\n :aria-label=\"arrowButtonLabel\"\n :active=\"open\"\n @click=\"arrowClick\"\n >\n <template #icon>\n <dt-icon-chevron-up\n class=\"dt-recipe--callbar-button-with-dropdown--arrow__icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n <template #list>\n <slot name=\"list\" />\n </template>\n </dt-dropdown>\n </div>\n</template>\n\n<script>\nimport { DtButton } from '@/components/button';\nimport { DtDropdown } from '@/components/dropdown';\nimport { DtIconChevronUp } from '@dialpad/dialtone-icons/vue2';\nimport { DtRecipeCallbarButton, CALLBAR_BUTTON_VALID_WIDTH_SIZE } from '../callbar_button';\nimport utils, { warnIfUnmounted } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeCallbarButtonWithDropdown',\n\n components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },\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 dropdown 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 * If the dropdown does not fit in the direction described by \"placement\",\n * it will attempt to change it's direction to the \"fallbackPlacements\".\n *\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\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 * Whether the tooltip has an inverted background color.\n * @values true, false\n */\n invertedTooltip: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Use this if you would like to manually override the logic for when the tooltip shows.\n * Otherwise it will just show on hover/focus.\n * @values null, true, false\n */\n showTooltip: {\n type: Boolean,\n default: null,\n },\n\n /**\n * The message that displays in the tooltip. This will be overridden by the tooltip slot.\n */\n tooltipText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Whether there is a delay before the tooltip shows on hover/focus.\n * @values true, false\n */\n tooltipDelay: {\n type: Boolean,\n default: undefined,\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 dropdown 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 showDropdown () {\n if (!this.openDropdown || this.open) {\n this.syncOpenState();\n return false;\n }\n\n return this.toggleOpen();\n },\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\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.openDropdown;\n },\n\n buttonClick (ev) {\n // If no listener for the click event, the button click opens the dropdown\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"],"names":["DtRecipeCallbarButton","DtDropdown","DtButton","DtIconChevronUp","utils","this","CALLBAR_BUTTON_VALID_WIDTH_SIZE","warnIfUnmounted"],"mappings":";;;;;;;;;AAwEA,MAAA,YAAA;AAAA,EACA,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,KAAA,KAAA,SAAA,IAAA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,WAAA,IAAA;AACA,WAAA,MAAA,eAAA,EAAA;AACA,aAAA,KAAA;IACA;AAAA,IAEA,aAAA;AACA,aAAA,KAAA,OAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,OAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA,IAAA;AAGA,UAAA,CAAA,KAAA,WAAA,OAAA;AACA,aAAA,WAAA,EAAA;AAAA,MACA,OAAA;AACA,aAAA,MAAA,SAAA,EAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,gBAAA,UAAA;AACA,WAAA,OAAA;AACA,WAAA,MAAA,UAAA,QAAA;AAAA,IACA;AAAA,EACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { DtIconChevronUp } from "@dialpad/dialtone-icons/vue2";
|
|
2
|
+
import utils, { warnIfUnmounted } from "../../../common/utils.js";
|
|
3
|
+
import normalizeComponent from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
import DtRecipeCallbarButton from "../callbar_button/callbar_button.vue.js";
|
|
5
|
+
import DtDropdown from "../../../components/dropdown/dropdown.vue.js";
|
|
6
|
+
import DtButton from "../../../components/button/button.vue.js";
|
|
7
|
+
import { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from "../callbar_button/callbar_button_constants.js";
|
|
8
|
+
const _sfc_main = {
|
|
9
|
+
name: "DtRecipeCallbarButtonWithDropdown",
|
|
10
|
+
components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },
|
|
11
|
+
/* inheritAttrs: false is generally an option we want to set on library
|
|
12
|
+
components. This allows any attributes passed in that are not recognized
|
|
13
|
+
as props to be passed down to another element or component using v-bind:$attrs
|
|
14
|
+
more info: https://vuejs.org/v2/api/#inheritAttrs */
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* Id for the item.
|
|
19
|
+
*/
|
|
20
|
+
id: {
|
|
21
|
+
type: String,
|
|
22
|
+
default() {
|
|
23
|
+
return utils.getUniqueString();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Aria label for the button. If empty, it takes its value from the default slot.
|
|
28
|
+
*/
|
|
29
|
+
ariaLabel: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null,
|
|
32
|
+
validator: (label) => {
|
|
33
|
+
return label || (void 0).$slots.default;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Aria label for the arrow. Cannot be empty.
|
|
38
|
+
*/
|
|
39
|
+
arrowButtonLabel: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
validator: (label) => {
|
|
43
|
+
return !!label;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* The direction the dropdown displays relative to the anchor.
|
|
48
|
+
* @values 'bottom', 'bottom-start', 'bottom-end',
|
|
49
|
+
* 'right', 'right-start', 'right-end',
|
|
50
|
+
* 'left', 'left-start', 'left-end',
|
|
51
|
+
* 'top', 'top-start', 'top-end'
|
|
52
|
+
* @default 'top'
|
|
53
|
+
*/
|
|
54
|
+
placement: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "top"
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* If the dropdown does not fit in the direction described by "placement",
|
|
60
|
+
* it will attempt to change it's direction to the "fallbackPlacements".
|
|
61
|
+
*
|
|
62
|
+
* @values top, top-start, top-end,
|
|
63
|
+
* right, right-start, right-end,
|
|
64
|
+
* left, left-start, left-end,
|
|
65
|
+
* bottom, bottom-start, bottom-end,
|
|
66
|
+
* auto, auto-start, auto-end
|
|
67
|
+
* */
|
|
68
|
+
fallbackPlacements: {
|
|
69
|
+
type: Array,
|
|
70
|
+
default: () => {
|
|
71
|
+
return ["auto"];
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Determines whether the button should be disabled
|
|
76
|
+
* default is false.
|
|
77
|
+
* @values true, false
|
|
78
|
+
*/
|
|
79
|
+
disabled: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Forces showing the arrow, even if the button is disabled.
|
|
85
|
+
* default is false
|
|
86
|
+
* @values true, false
|
|
87
|
+
*/
|
|
88
|
+
forceShowArrow: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Determines whether the button should have active styling
|
|
94
|
+
* default is false.
|
|
95
|
+
* @values true, false
|
|
96
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
97
|
+
*/
|
|
98
|
+
active: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Determines whether the button should have danger styling
|
|
104
|
+
* default is false.
|
|
105
|
+
* @values true, false
|
|
106
|
+
* @see https://dialtone.dialpad.com/components/button/
|
|
107
|
+
*/
|
|
108
|
+
danger: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Additional class name for the button wrapper element.
|
|
114
|
+
*/
|
|
115
|
+
buttonClass: {
|
|
116
|
+
type: [String, Array, Object],
|
|
117
|
+
default: ""
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Additional class name for the button text.
|
|
121
|
+
*/
|
|
122
|
+
textClass: {
|
|
123
|
+
type: [String, Array, Object],
|
|
124
|
+
default: ""
|
|
125
|
+
},
|
|
126
|
+
/*
|
|
127
|
+
* Width size. Valid values are: 'xl', 'lg', 'md' and 'sm'.
|
|
128
|
+
*/
|
|
129
|
+
buttonWidthSize: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: "xl",
|
|
132
|
+
validator: (size) => CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(size)
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* Whether the tooltip has an inverted background color.
|
|
136
|
+
* @values true, false
|
|
137
|
+
*/
|
|
138
|
+
invertedTooltip: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* Use this if you would like to manually override the logic for when the tooltip shows.
|
|
144
|
+
* Otherwise it will just show on hover/focus.
|
|
145
|
+
* @values null, true, false
|
|
146
|
+
*/
|
|
147
|
+
showTooltip: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: null
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* The message that displays in the tooltip. This will be overridden by the tooltip slot.
|
|
153
|
+
*/
|
|
154
|
+
tooltipText: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: void 0
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Whether there is a delay before the tooltip shows on hover/focus.
|
|
160
|
+
* @values true, false
|
|
161
|
+
*/
|
|
162
|
+
tooltipDelay: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: void 0
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
emits: [
|
|
168
|
+
/**
|
|
169
|
+
* Emitted when the arrow is clicked
|
|
170
|
+
*/
|
|
171
|
+
"arrow-click",
|
|
172
|
+
/**
|
|
173
|
+
* Native click event
|
|
174
|
+
*
|
|
175
|
+
* @event click
|
|
176
|
+
* @type {PointerEvent | KeyboardEvent}
|
|
177
|
+
*/
|
|
178
|
+
"click",
|
|
179
|
+
/**
|
|
180
|
+
* Emitted when modal dropdown is opened or closed.
|
|
181
|
+
*/
|
|
182
|
+
"opened"
|
|
183
|
+
],
|
|
184
|
+
data() {
|
|
185
|
+
return {
|
|
186
|
+
open: false
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
computed: {
|
|
190
|
+
showArrowButton() {
|
|
191
|
+
return this.forceShowArrow || !this.disabled;
|
|
192
|
+
},
|
|
193
|
+
isCompactMode() {
|
|
194
|
+
return this.buttonWidthSize === "sm" || this.buttonWidthSize === "md";
|
|
195
|
+
},
|
|
196
|
+
showDropdown() {
|
|
197
|
+
if (!this.openDropdown || this.open) {
|
|
198
|
+
this.syncOpenState();
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
return this.toggleOpen();
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
mounted() {
|
|
205
|
+
warnIfUnmounted(this.$el, this.$options.name);
|
|
206
|
+
},
|
|
207
|
+
methods: {
|
|
208
|
+
arrowClick(ev) {
|
|
209
|
+
this.$emit("arrow-click", ev);
|
|
210
|
+
return this.toggleOpen();
|
|
211
|
+
},
|
|
212
|
+
toggleOpen() {
|
|
213
|
+
return this.open = !this.open;
|
|
214
|
+
},
|
|
215
|
+
syncOpenState() {
|
|
216
|
+
this.open = this.openDropdown;
|
|
217
|
+
},
|
|
218
|
+
buttonClick(ev) {
|
|
219
|
+
if (!this.$listeners.click) {
|
|
220
|
+
this.arrowClick(ev);
|
|
221
|
+
} else {
|
|
222
|
+
this.$emit("click", ev);
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
onModalIsOpened(isOpened) {
|
|
226
|
+
this.open = isOpened;
|
|
227
|
+
this.$emit("opened", isOpened);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var _sfc_render = function render() {
|
|
232
|
+
var _vm = this, _c = _vm._self._c;
|
|
233
|
+
return _c("div", { staticClass: "dt-recipe--callbar-button-with-dropdown" }, [_c("dt-recipe-callbar-button", { staticClass: "dt-recipe--callbar-button-with-dropdown--main-button", attrs: { "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "active": _vm.active, "danger": _vm.danger, "button-class": _vm.buttonClass, "button-width-size": _vm.buttonWidthSize, "text-class": _vm.textClass, "inverted-tooltip": _vm.invertedTooltip, "show-tooltip": _vm.showTooltip, "tooltip-text": _vm.tooltipText, "tooltip-delay": _vm.tooltipDelay }, on: { "click": _vm.buttonClick }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
234
|
+
return [_vm._t("icon")];
|
|
235
|
+
}, proxy: true }, { key: "tooltip", fn: function() {
|
|
236
|
+
return [_vm._t("tooltip")];
|
|
237
|
+
}, proxy: true }], null, true) }, [_vm._t("default")], 2), _vm.showArrowButton ? _c("dt-dropdown", _vm._b({ staticClass: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper", attrs: { "id": _vm.id, "open": _vm.open, "placement": _vm.placement, "fallback-placements": _vm.fallbackPlacements, "padding": "none" }, on: { "opened": _vm.onModalIsOpened }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
238
|
+
return [_c("dt-button", { class: [
|
|
239
|
+
"dt-recipe--callbar-button-with-dropdown--arrow",
|
|
240
|
+
{ "dt-recipe--callbar-button-with-dropdown--arrow--large": !_vm.isCompactMode }
|
|
241
|
+
], attrs: { "circle": "", "importance": "clear", "size": "lg", "width": "2rem", "aria-label": _vm.arrowButtonLabel, "active": _vm.open }, on: { "click": _vm.arrowClick }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
242
|
+
return [_c("dt-icon-chevron-up", { staticClass: "dt-recipe--callbar-button-with-dropdown--arrow__icon", attrs: { "size": "200" } })];
|
|
243
|
+
}, proxy: true }], null, false, 887776886) })];
|
|
244
|
+
}, proxy: true }, { key: "list", fn: function() {
|
|
245
|
+
return [_vm._t("list")];
|
|
246
|
+
}, proxy: true }], null, true) }, "dt-dropdown", _vm.$attrs, false)) : _vm._e()], 1);
|
|
247
|
+
};
|
|
248
|
+
var _sfc_staticRenderFns = [];
|
|
249
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
250
|
+
_sfc_main,
|
|
251
|
+
_sfc_render,
|
|
252
|
+
_sfc_staticRenderFns
|
|
253
|
+
);
|
|
254
|
+
const callbar_button_with_dropdown = __component__.exports;
|
|
255
|
+
export {
|
|
256
|
+
callbar_button_with_dropdown as default
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=callbar_button_with_dropdown.vue.js.map
|