@dialpad/dialtone 9.106.0 → 9.106.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +1 -0
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +1 -0
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +13539 -13539
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +9 -9
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +9 -9
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +22 -22
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +22 -22
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs
CHANGED
|
@@ -12,9 +12,9 @@ const _sfc_main = {
|
|
|
12
12
|
name: "DtRecipeCallbarButtonWithDropdown",
|
|
13
13
|
components: { DtRecipeCallbarButton: callbar_button.default, DtDropdown: dropdown.default, DtButton: button.default, DtIconChevronUp: vue3.DtIconChevronUp },
|
|
14
14
|
/* inheritAttrs: false is generally an option we want to set on library
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
components. This allows any attributes passed in that are not recognized
|
|
16
|
+
as props to be passed down to another element or component using v-bind:$attrs
|
|
17
|
+
more info: https://vuejs.org/v2/api/#inheritAttrs */
|
|
18
18
|
inheritAttrs: false,
|
|
19
19
|
props: {
|
|
20
20
|
/**
|
|
@@ -119,7 +119,7 @@ const _sfc_main = {
|
|
|
119
119
|
* This makes it impossible from the regular declaration (emits: ['click']) to check whether
|
|
120
120
|
* we actually have a click handler or not.
|
|
121
121
|
* We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220
|
|
122
|
-
|
|
122
|
+
*/
|
|
123
123
|
/* eslint-disable-next-line vue/no-unused-properties */
|
|
124
124
|
onClick: {
|
|
125
125
|
type: Function,
|
|
@@ -252,17 +252,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
252
252
|
const _component_dt_dropdown = vue.resolveComponent("dt-dropdown");
|
|
253
253
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
254
254
|
vue.createVNode(_component_dt_recipe_callbar_button, {
|
|
255
|
-
"aria-label": $props.ariaLabel,
|
|
256
|
-
disabled: $props.disabled,
|
|
257
255
|
active: $props.active,
|
|
258
|
-
|
|
256
|
+
"aria-label": $props.ariaLabel,
|
|
259
257
|
"button-class": $props.buttonClass,
|
|
260
258
|
"button-width-size": $props.buttonWidthSize,
|
|
261
|
-
|
|
259
|
+
danger: $props.danger,
|
|
260
|
+
disabled: $props.disabled,
|
|
262
261
|
"inverted-tooltip": $props.invertedTooltip,
|
|
263
262
|
"show-tooltip": $props.showTooltip,
|
|
264
|
-
"
|
|
263
|
+
"text-class": $props.textClass,
|
|
265
264
|
"tooltip-delay": $props.tooltipDelay,
|
|
265
|
+
"tooltip-text": $props.tooltipText,
|
|
266
266
|
class: "dt-recipe--callbar-button-with-dropdown--main-button",
|
|
267
267
|
onClick: $options.buttonClick
|
|
268
268
|
}, {
|
|
@@ -276,28 +276,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
276
276
|
vue.renderSlot(_ctx.$slots, "default")
|
|
277
277
|
]),
|
|
278
278
|
_: 3
|
|
279
|
-
}, 8, ["
|
|
279
|
+
}, 8, ["active", "aria-label", "button-class", "button-width-size", "danger", "disabled", "inverted-tooltip", "show-tooltip", "text-class", "tooltip-delay", "tooltip-text", "onClick"]),
|
|
280
280
|
$options.showArrowButton ? (vue.openBlock(), vue.createBlock(_component_dt_dropdown, vue.mergeProps({
|
|
281
281
|
key: 0,
|
|
282
282
|
id: $props.id,
|
|
283
|
+
"fallback-placements": $props.fallbackPlacements,
|
|
283
284
|
open: $data.open,
|
|
284
285
|
placement: $props.placement,
|
|
285
|
-
"
|
|
286
|
-
padding: "none"
|
|
287
|
-
class: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper"
|
|
286
|
+
class: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper",
|
|
287
|
+
padding: "none"
|
|
288
288
|
}, _ctx.$attrs, { onOpened: $options.onModalIsOpened }), {
|
|
289
289
|
anchor: vue.withCtx(() => [
|
|
290
290
|
vue.createVNode(_component_dt_button, {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
size: "lg",
|
|
291
|
+
active: $data.open,
|
|
292
|
+
"aria-label": $props.arrowButtonLabel,
|
|
294
293
|
class: vue.normalizeClass([
|
|
295
294
|
"dt-recipe--callbar-button-with-dropdown--arrow",
|
|
296
295
|
{ "dt-recipe--callbar-button-with-dropdown--arrow--large": !$options.isCompactMode }
|
|
297
296
|
]),
|
|
297
|
+
circle: "",
|
|
298
|
+
importance: "clear",
|
|
299
|
+
size: "lg",
|
|
298
300
|
width: "2rem",
|
|
299
|
-
"aria-label": $props.arrowButtonLabel,
|
|
300
|
-
active: $data.open,
|
|
301
301
|
onClick: $options.arrowClick
|
|
302
302
|
}, {
|
|
303
303
|
icon: vue.withCtx(() => [
|
|
@@ -307,13 +307,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
307
307
|
})
|
|
308
308
|
]),
|
|
309
309
|
_: 1
|
|
310
|
-
}, 8, ["
|
|
310
|
+
}, 8, ["active", "aria-label", "class", "onClick"])
|
|
311
311
|
]),
|
|
312
|
-
list: vue.withCtx(() => [
|
|
313
|
-
vue.renderSlot(_ctx.$slots, "list")
|
|
312
|
+
list: vue.withCtx(({ close }) => [
|
|
313
|
+
vue.renderSlot(_ctx.$slots, "list", { close })
|
|
314
314
|
]),
|
|
315
315
|
_: 3
|
|
316
|
-
}, 16, ["id", "
|
|
316
|
+
}, 16, ["id", "fallback-placements", "open", "placement", "onOpened"])) : vue.createCommentVNode("", true)
|
|
317
317
|
]);
|
|
318
318
|
}
|
|
319
319
|
const callbar_button_with_dropdown = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -1 +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/vue3';\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 * We need this declaration because of how Vue3 informs the component about a listener.\n * Spoiler alert: it doesn't.\n * Vue3 intends to work as a real pub-sub, meaning the publisher has not a clue of who the subscribers are.\n * This makes it impossible from the regular declaration (emits: ['click']) to check whether\n * we actually have a click handler or not.\n * We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220\n */\n /* eslint-disable-next-line vue/no-unused-properties */\n onClick: {\n type: Function,\n default: null,\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.$props.onClick) {\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","_openBlock","_createElementBlock","_createVNode","_renderSlot","_withCtx","_createBlock","_mergeProps","_normalizeClass","_createCommentVNode"],"mappings":";;;;;;;;;;AAwEA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY,EAAA,uBAAEA,eAAqB,SAAA,YAAEC,kBAAYC,UAAAA,OAAAA,SAAUC,iBAAAA,KAAAA,gBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5E,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AACT,eAAOC,aAAAA,QAAM;MACd;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,UAAU;AACpB,eAAO,SAASC,SAAK,OAAO;AAAA,MAC7B;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC;AAAA,MACV;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYD,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS,MAAM;AACb,eAAO,CAAC,MAAM;AAAA,MACf;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;A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AAM;AAAA,MACL,SAAO,SAAW;AAAA;MAER,kBACT,MAAoB;AAAA,QAApBC,eAAoB,KAAA,QAAA,MAAA;AAAA;MAEX,qBACT,MAAuB;AAAA,QAAvBA,eAAuB,KAAA,QAAA,SAAA;AAAA;MAvB/B,SAAAC,IAAA,QAyBM,MAAQ;AAAA,QAARD,eAAQ,KAAA,QAAA,SAAA;AAAA;MAzBd,GAAA;AAAA;IA4BY,SAAe,mBADvBH,IAAAA,aAAAK,IAAAA,YAkCc,wBAlCdC,eAkCc;AAAA,MA7DlB,KAAA;AAAA,MA6BO,IAAI,OAAE;AAAA,MACN,MAAM,MAAI;AAAA,MACV,WAAW,OAAS;AAAA,MACpB,uBAAqB,OAAkB;AAAA,MACxC,SAAQ;AAAA,MACR,OAAM;AAAA,OACE,KAAM,QAAA,EACb,UAAQ,SAAe,gBAAA,CAAA,GAAA;AAAA,MAEb,oBACT,MAiBY;AAAA,QAjBZJ,IAAAA,YAiBY,sBAAA;AAAA,UAhBV,QAAA;AAAA,UACA,YAAW;AAAA,UACX,MAAK;AAAA,UACJ,OA3CXK,IAAA,eAAA;AAAA,YAAA;AAAA,wEA2CoJ,SAAa,cAAA;AAAA,UAAA,CAAA;AAAA,UAEvJ,OAAM;AAAA,UACL,cAAY,OAAgB;AAAA,UAC5B,QAAQ,MAAI;AAAA,UACZ,SAAO,SAAU;AAAA;UAEP,kBACT,MAGE;AAAA,YAHFL,IAAAA,YAGE,+BAAA;AAAA,cAFA,OAAM;AAAA,cACN,MAAK;AAAA;;UArDnB,GAAA;AAAA;;MA0DiB,kBACT,MAAoB;AAAA,QAApBC,eAAoB,KAAA,QAAA,MAAA;AAAA;MA3D5B,GAAA;AAAA,8EAAAK,IAAA,mBAAA,IAAA,IAAA;AAAA;;;;"}
|
|
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 :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\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 :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :aria-label=\"arrowButtonLabel\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n width=\"2rem\"\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=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\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/vue3';\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 * We need this declaration because of how Vue3 informs the component about a listener.\n * Spoiler alert: it doesn't.\n * Vue3 intends to work as a real pub-sub, meaning the publisher has not a clue of who the subscribers are.\n * This makes it impossible from the regular declaration (emits: ['click']) to check whether\n * we actually have a click handler or not.\n * We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220\n */\n /* eslint-disable-next-line vue/no-unused-properties */\n onClick: {\n type: Function,\n default: null,\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.$props.onClick) {\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","_openBlock","_createElementBlock","_createVNode","_renderSlot","_withCtx","_createBlock","_mergeProps","_normalizeClass","_createCommentVNode"],"mappings":";;;;;;;;;;AA2EA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY,EAAA,uBAAEA,eAAqB,SAAA,YAAEC,kBAAYC,UAAAA,OAAAA,SAAUC,iBAAAA,KAAAA,gBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5E,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AACT,eAAOC,aAAAA,QAAM;MACd;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,UAAU;AACpB,eAAO,SAASC,SAAK,OAAO;AAAA,MAC7B;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC;AAAA,MACV;AAA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A,CAAA;AAAA,UAEvJ,QAAA;AAAA,UACA,YAAW;AAAA,UACX,MAAK;AAAA,UACL,OAAM;AAAA,UACL,SAAO,SAAU;AAAA;UAEP,kBACT,MAGE;AAAA,YAHFL,IAAAA,YAGE,+BAAA;AAAA,cAFA,OAAM;AAAA,cACN,MAAK;AAAA;;UArDnB,GAAA;AAAA;;MA0DiB,MAAIE,IAAA,QACb,CAGE,EAJe,YAAK;AAAA,QACtBD,IAGE,WAAA,KAAA,QAAA,QAAA,EAFC,OAAY;AAAA;MA5DvB,GAAA;AAAA,8EAAAK,IAAA,mBAAA,IAAA,IAAA;AAAA;;;;"}
|
package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js
CHANGED
|
@@ -10,9 +10,9 @@ const _sfc_main = {
|
|
|
10
10
|
name: "DtRecipeCallbarButtonWithDropdown",
|
|
11
11
|
components: { DtRecipeCallbarButton, DtDropdown, DtButton, DtIconChevronUp },
|
|
12
12
|
/* inheritAttrs: false is generally an option we want to set on library
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
components. This allows any attributes passed in that are not recognized
|
|
14
|
+
as props to be passed down to another element or component using v-bind:$attrs
|
|
15
|
+
more info: https://vuejs.org/v2/api/#inheritAttrs */
|
|
16
16
|
inheritAttrs: false,
|
|
17
17
|
props: {
|
|
18
18
|
/**
|
|
@@ -117,7 +117,7 @@ const _sfc_main = {
|
|
|
117
117
|
* This makes it impossible from the regular declaration (emits: ['click']) to check whether
|
|
118
118
|
* we actually have a click handler or not.
|
|
119
119
|
* We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220
|
|
120
|
-
|
|
120
|
+
*/
|
|
121
121
|
/* eslint-disable-next-line vue/no-unused-properties */
|
|
122
122
|
onClick: {
|
|
123
123
|
type: Function,
|
|
@@ -250,17 +250,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
250
250
|
const _component_dt_dropdown = resolveComponent("dt-dropdown");
|
|
251
251
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
252
252
|
createVNode(_component_dt_recipe_callbar_button, {
|
|
253
|
-
"aria-label": $props.ariaLabel,
|
|
254
|
-
disabled: $props.disabled,
|
|
255
253
|
active: $props.active,
|
|
256
|
-
|
|
254
|
+
"aria-label": $props.ariaLabel,
|
|
257
255
|
"button-class": $props.buttonClass,
|
|
258
256
|
"button-width-size": $props.buttonWidthSize,
|
|
259
|
-
|
|
257
|
+
danger: $props.danger,
|
|
258
|
+
disabled: $props.disabled,
|
|
260
259
|
"inverted-tooltip": $props.invertedTooltip,
|
|
261
260
|
"show-tooltip": $props.showTooltip,
|
|
262
|
-
"
|
|
261
|
+
"text-class": $props.textClass,
|
|
263
262
|
"tooltip-delay": $props.tooltipDelay,
|
|
263
|
+
"tooltip-text": $props.tooltipText,
|
|
264
264
|
class: "dt-recipe--callbar-button-with-dropdown--main-button",
|
|
265
265
|
onClick: $options.buttonClick
|
|
266
266
|
}, {
|
|
@@ -274,28 +274,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
274
274
|
renderSlot(_ctx.$slots, "default")
|
|
275
275
|
]),
|
|
276
276
|
_: 3
|
|
277
|
-
}, 8, ["
|
|
277
|
+
}, 8, ["active", "aria-label", "button-class", "button-width-size", "danger", "disabled", "inverted-tooltip", "show-tooltip", "text-class", "tooltip-delay", "tooltip-text", "onClick"]),
|
|
278
278
|
$options.showArrowButton ? (openBlock(), createBlock(_component_dt_dropdown, mergeProps({
|
|
279
279
|
key: 0,
|
|
280
280
|
id: $props.id,
|
|
281
|
+
"fallback-placements": $props.fallbackPlacements,
|
|
281
282
|
open: $data.open,
|
|
282
283
|
placement: $props.placement,
|
|
283
|
-
"
|
|
284
|
-
padding: "none"
|
|
285
|
-
class: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper"
|
|
284
|
+
class: "dt-recipe--callbar-button-with-dropdown--dropdown-wrapper",
|
|
285
|
+
padding: "none"
|
|
286
286
|
}, _ctx.$attrs, { onOpened: $options.onModalIsOpened }), {
|
|
287
287
|
anchor: withCtx(() => [
|
|
288
288
|
createVNode(_component_dt_button, {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
size: "lg",
|
|
289
|
+
active: $data.open,
|
|
290
|
+
"aria-label": $props.arrowButtonLabel,
|
|
292
291
|
class: normalizeClass([
|
|
293
292
|
"dt-recipe--callbar-button-with-dropdown--arrow",
|
|
294
293
|
{ "dt-recipe--callbar-button-with-dropdown--arrow--large": !$options.isCompactMode }
|
|
295
294
|
]),
|
|
295
|
+
circle: "",
|
|
296
|
+
importance: "clear",
|
|
297
|
+
size: "lg",
|
|
296
298
|
width: "2rem",
|
|
297
|
-
"aria-label": $props.arrowButtonLabel,
|
|
298
|
-
active: $data.open,
|
|
299
299
|
onClick: $options.arrowClick
|
|
300
300
|
}, {
|
|
301
301
|
icon: withCtx(() => [
|
|
@@ -305,13 +305,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
305
305
|
})
|
|
306
306
|
]),
|
|
307
307
|
_: 1
|
|
308
|
-
}, 8, ["
|
|
308
|
+
}, 8, ["active", "aria-label", "class", "onClick"])
|
|
309
309
|
]),
|
|
310
|
-
list: withCtx(() => [
|
|
311
|
-
renderSlot(_ctx.$slots, "list")
|
|
310
|
+
list: withCtx(({ close }) => [
|
|
311
|
+
renderSlot(_ctx.$slots, "list", { close })
|
|
312
312
|
]),
|
|
313
313
|
_: 3
|
|
314
|
-
}, 16, ["id", "
|
|
314
|
+
}, 16, ["id", "fallback-placements", "open", "placement", "onOpened"])) : createCommentVNode("", true)
|
|
315
315
|
]);
|
|
316
316
|
}
|
|
317
317
|
const callbar_button_with_dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button_with_dropdown.vue.js","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/vue3';\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 * We need this declaration because of how Vue3 informs the component about a listener.\n * Spoiler alert: it doesn't.\n * Vue3 intends to work as a real pub-sub, meaning the publisher has not a clue of who the subscribers are.\n * This makes it impossible from the regular declaration (emits: ['click']) to check whether\n * we actually have a click handler or not.\n * We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220\n */\n /* eslint-disable-next-line vue/no-unused-properties */\n onClick: {\n type: Function,\n default: null,\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.$props.onClick) {\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":["this","_openBlock","_createElementBlock","_createVNode","_renderSlot","_withCtx","_createBlock","_mergeProps","_normalizeClass","_createCommentVNode"],"mappings":";;;;;;;;AAwEA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY,EAAE,uBAAuB,YAAY,UAAU,gBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5E,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AACT,eAAO,MAAM;MACd;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,UAAU;AACpB,eAAO,SAASA,SAAK,OAAO;AAAA,MAC7B;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAAC,UAAU;AACpB,eAAO,CAAC,CAAC;AAAA,MACV;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA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AA;;UArDnB,GAAA;AAAA;;MA0DiB,cACT,MAAoB;AAAA,QAApBC,WAAoB,KAAA,QAAA,MAAA;AAAA;MA3D5B,GAAA;AAAA,8EAAAK,mBAAA,IAAA,IAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"callbar_button_with_dropdown.vue.js","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 :active=\"active\"\n :aria-label=\"ariaLabel\"\n :button-class=\"buttonClass\"\n :button-width-size=\"buttonWidthSize\"\n :danger=\"danger\"\n :disabled=\"disabled\"\n :inverted-tooltip=\"invertedTooltip\"\n :show-tooltip=\"showTooltip\"\n :text-class=\"textClass\"\n :tooltip-delay=\"tooltipDelay\"\n :tooltip-text=\"tooltipText\"\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 :fallback-placements=\"fallbackPlacements\"\n :open=\"open\"\n :placement=\"placement\"\n class=\"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper\"\n padding=\"none\"\n v-bind=\"$attrs\"\n @opened=\"onModalIsOpened\"\n >\n <template #anchor>\n <dt-button\n :active=\"open\"\n :aria-label=\"arrowButtonLabel\"\n :class=\"['dt-recipe--callbar-button-with-dropdown--arrow',\n { 'dt-recipe--callbar-button-with-dropdown--arrow--large': !isCompactMode }]\"\n circle\n importance=\"clear\"\n size=\"lg\"\n width=\"2rem\"\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=\"{ close }\">\n <slot\n :close=\"close\"\n name=\"list\"\n />\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/vue3';\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 * We need this declaration because of how Vue3 informs the component about a listener.\n * Spoiler alert: it doesn't.\n * Vue3 intends to work as a real pub-sub, meaning the publisher has not a clue of who the subscribers are.\n * This makes it impossible from the regular declaration (emits: ['click']) to check whether\n * we actually have a click handler or not.\n * We're hacking it by adding an onClick prop: https://github.com/vuejs/core/issues/5220\n */\n /* eslint-disable-next-line vue/no-unused-properties */\n onClick: {\n type: Function,\n default: null,\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.$props.onClick) {\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":["this","_openBlock","_createElementBlock","_createVNode","_renderSlot","_withCtx","_createBlock","_mergeProps","_normalizeClass","_createCommentVNode"],"mappings":";;;;;;;;AA2EA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY,EAAE,uBAAuB,YAAY,UAAU,gBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5E,cAAc;AAAA,EAEd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AACT,eAAO,MAAM;MACd;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAAC,UAAU;AACpB,eAAO,SAASA,SAAK,OAAO;AAAA,MAC7B;AAAA,IACF;AAAA;AAAA;AAA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AA,UAC5B,OA1CXK,eAAA;AAAA,YAAA;AAAA,wEA0CoJ,SAAa,cAAA;AAAA,UAAA,CAAA;AAAA,UAEvJ,QAAA;AAAA,UACA,YAAW;AAAA,UACX,MAAK;AAAA,UACL,OAAM;AAAA,UACL,SAAO,SAAU;AAAA;UAEP,cACT,MAGE;AAAA,YAHFL,YAGE,+BAAA;AAAA,cAFA,OAAM;AAAA,cACN,MAAK;AAAA;;UArDnB,GAAA;AAAA;;MA0DiB,MAAIE,QACb,CAGE,EAJe,YAAK;AAAA,QACtBD,WAGE,KAAA,QAAA,QAAA,EAFC,OAAY;AAAA;MA5DvB,GAAA;AAAA,8EAAAK,mBAAA,IAAA,IAAA;AAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbar_button_with_dropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callbar_button_with_dropdown.vue.d.ts","sourceRoot":"","sources":["../../../../../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue"],"names":[],"mappings":"AAmEA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialpad/dialtone",
|
|
3
|
-
"version": "9.106.
|
|
3
|
+
"version": "9.106.1",
|
|
4
4
|
"description": "Dialpad's Dialtone design system monorepo",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"overlayscrollbars": "2.10.0",
|
|
77
77
|
"regex-combined-emojis": "1.6.0",
|
|
78
78
|
"tippy.js": "6.3.7",
|
|
79
|
-
"@dialpad/dialtone-
|
|
79
|
+
"@dialpad/dialtone-icons": "4.34.1",
|
|
80
80
|
"@dialpad/dialtone-tokens": "1.41.1",
|
|
81
|
-
"@dialpad/dialtone-
|
|
81
|
+
"@dialpad/dialtone-emojis": "1.1.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@commitlint/cli": "^18.4.3",
|