@dialpad/dialtone 9.40.0 → 9.42.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.css +299 -286
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/css/variables-dark.css +1 -1
- package/dist/tokens/css/variables-expressive-dark.css +1 -1
- package/dist/tokens/css/variables-expressive-light.css +1 -1
- package/dist/tokens/css/variables-expressive-sm-dark.css +1 -1
- package/dist/tokens/css/variables-expressive-sm-light.css +1 -1
- package/dist/tokens/css/variables-light.css +1 -1
- package/dist/tokens/css/variables-tmo-dark.css +1 -1
- package/dist/tokens/css/variables-tmo-light.css +1 -1
- package/dist/tokens/less/variables-dark.less +1 -1
- package/dist/tokens/less/variables-expressive-dark.less +1 -1
- package/dist/tokens/less/variables-expressive-light.less +1 -1
- package/dist/tokens/less/variables-expressive-sm-dark.less +1 -1
- package/dist/tokens/less/variables-expressive-sm-light.less +1 -1
- package/dist/tokens/less/variables-light.less +1 -1
- package/dist/tokens/less/variables-tmo-dark.less +1 -1
- package/dist/tokens/less/variables-tmo-light.less +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -0
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +2 -1
- package/dist/vue2/lib/badge.cjs +21 -1
- package/dist/vue2/lib/badge.cjs.map +1 -1
- package/dist/vue2/lib/badge.js +21 -1
- package/dist/vue2/lib/badge.js.map +1 -1
- package/dist/vue2/lib/button.cjs +11 -2
- package/dist/vue2/lib/button.cjs.map +1 -1
- package/dist/vue2/lib/button.js +12 -3
- package/dist/vue2/lib/button.js.map +1 -1
- package/dist/vue2/lib/emoji-picker.cjs +97 -16
- package/dist/vue2/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker.js +97 -16
- package/dist/vue2/lib/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/link.cjs +1 -0
- package/dist/vue2/lib/link.cjs.map +1 -1
- package/dist/vue2/lib/link.js +2 -1
- package/dist/vue2/lib/tooltip.cjs +26 -37
- package/dist/vue2/lib/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip.js +26 -37
- package/dist/vue2/lib/tooltip.js.map +1 -1
- package/dist/vue2/types/components/badge/badge.vue.d.ts +32 -0
- package/dist/vue2/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +21 -2
- package/dist/vue2/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/emoji_picker/emoji_picker.vue.d.ts +1 -68
- package/dist/vue2/types/components/link/index.d.ts +1 -1
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts +9 -13
- package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -0
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +2 -1
- package/dist/vue3/lib/badge.cjs +21 -1
- package/dist/vue3/lib/badge.cjs.map +1 -1
- package/dist/vue3/lib/badge.js +21 -1
- package/dist/vue3/lib/badge.js.map +1 -1
- package/dist/vue3/lib/button.cjs +11 -2
- package/dist/vue3/lib/button.cjs.map +1 -1
- package/dist/vue3/lib/button.js +12 -3
- package/dist/vue3/lib/button.js.map +1 -1
- package/dist/vue3/lib/emoji-picker.cjs +50 -18
- package/dist/vue3/lib/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker.js +51 -19
- package/dist/vue3/lib/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/link.cjs +1 -0
- package/dist/vue3/lib/link.cjs.map +1 -1
- package/dist/vue3/lib/link.js +2 -1
- package/dist/vue3/lib/tooltip.cjs +25 -31
- package/dist/vue3/lib/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip.js +25 -31
- package/dist/vue3/lib/tooltip.js.map +1 -1
- package/dist/vue3/types/components/badge/badge.vue.d.ts +32 -0
- package/dist/vue3/types/components/badge/badge.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/button/button.vue.d.ts +21 -2
- package/dist/vue3/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/link/index.d.ts +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts +9 -10
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/vue3/lib/tooltip.js
CHANGED
|
@@ -96,7 +96,7 @@ const _sfc_main = {
|
|
|
96
96
|
*/
|
|
97
97
|
sticky: {
|
|
98
98
|
type: [Boolean, String],
|
|
99
|
-
default:
|
|
99
|
+
default: true,
|
|
100
100
|
validator: (sticky) => {
|
|
101
101
|
return TOOLTIP_STICKY_VALUES.includes(sticky);
|
|
102
102
|
}
|
|
@@ -150,7 +150,7 @@ const _sfc_main = {
|
|
|
150
150
|
default: null
|
|
151
151
|
},
|
|
152
152
|
/**
|
|
153
|
-
* Whether the tooltip should have a transition effect.
|
|
153
|
+
* Whether the tooltip should have a transition effect (fade).
|
|
154
154
|
*/
|
|
155
155
|
transition: {
|
|
156
156
|
type: Boolean,
|
|
@@ -196,7 +196,7 @@ const _sfc_main = {
|
|
|
196
196
|
inTimer: null,
|
|
197
197
|
// Internal state for whether the tooltip is shown. Changing the prop
|
|
198
198
|
// will update this.
|
|
199
|
-
|
|
199
|
+
internalShow: false,
|
|
200
200
|
// this is where the placement currently is, this can be different than
|
|
201
201
|
// the placement prop when there is not enough available room for the tip
|
|
202
202
|
// to display and it uses a fallback placement.
|
|
@@ -204,15 +204,6 @@ const _sfc_main = {
|
|
|
204
204
|
};
|
|
205
205
|
},
|
|
206
206
|
computed: {
|
|
207
|
-
// whether the tooltip is visible or not.
|
|
208
|
-
isVisible() {
|
|
209
|
-
var _a, _b;
|
|
210
|
-
const hasMessage = !!((_a = this.message) == null ? void 0 : _a.trim());
|
|
211
|
-
const hasDefaultSlot = !!((_b = this.$slots) == null ? void 0 : _b.default);
|
|
212
|
-
const isDeviceCompatible = !this.isTouchDevice;
|
|
213
|
-
const shouldBeVisible = this.isShown && this.enabled && (hasMessage || hasDefaultSlot);
|
|
214
|
-
return shouldBeVisible && isDeviceCompatible;
|
|
215
|
-
},
|
|
216
207
|
// eslint-disable-next-line complexity
|
|
217
208
|
tippyProps() {
|
|
218
209
|
return {
|
|
@@ -222,12 +213,11 @@ const _sfc_main = {
|
|
|
222
213
|
sticky: this.sticky,
|
|
223
214
|
theme: this.inverted ? "inverted" : void 0,
|
|
224
215
|
animation: this.transition ? "fade" : false,
|
|
225
|
-
// onShown only triggers when transition is truthy
|
|
226
|
-
onShown:
|
|
227
|
-
|
|
228
|
-
onShow:
|
|
229
|
-
|
|
230
|
-
onHidden: this.onLeaveTransitionComplete,
|
|
216
|
+
// onShown only triggers when transition is truthy
|
|
217
|
+
onShown: (tooltipInstance) => this.onShow(tooltipInstance, "onShown"),
|
|
218
|
+
// onShown will always be called, but it will be called before the animation is complete
|
|
219
|
+
onShow: (tooltipInstance) => this.onShow(tooltipInstance, "onShow"),
|
|
220
|
+
onHidden: this.onHide,
|
|
231
221
|
popperOptions: getPopperOptions({
|
|
232
222
|
fallbackPlacements: this.fallbackPlacements,
|
|
233
223
|
hasHideModifierEnabled: true,
|
|
@@ -247,13 +237,13 @@ const _sfc_main = {
|
|
|
247
237
|
show: {
|
|
248
238
|
handler: function(show) {
|
|
249
239
|
if (show !== null) {
|
|
250
|
-
this.
|
|
240
|
+
this.internalShow = show;
|
|
251
241
|
}
|
|
252
242
|
},
|
|
253
243
|
immediate: true
|
|
254
244
|
},
|
|
255
|
-
|
|
256
|
-
if (
|
|
245
|
+
internalShow(value) {
|
|
246
|
+
if (value) {
|
|
257
247
|
this.setProps();
|
|
258
248
|
this.tip.show();
|
|
259
249
|
} else {
|
|
@@ -273,9 +263,6 @@ const _sfc_main = {
|
|
|
273
263
|
}
|
|
274
264
|
this.externalAnchor && this.addExternalAnchorEventListeners();
|
|
275
265
|
this.tip = createTippy(this.anchor, this.initOptions());
|
|
276
|
-
if (this.isShown) {
|
|
277
|
-
this.tip.show();
|
|
278
|
-
}
|
|
279
266
|
},
|
|
280
267
|
beforeUnmount() {
|
|
281
268
|
var _a;
|
|
@@ -309,11 +296,11 @@ const _sfc_main = {
|
|
|
309
296
|
triggerShow(e) {
|
|
310
297
|
if (e.type === "focusin") {
|
|
311
298
|
if (this.show === null && this.hasVisibleFocus()) {
|
|
312
|
-
this.
|
|
299
|
+
this.internalShow = true;
|
|
313
300
|
}
|
|
314
301
|
} else {
|
|
315
302
|
if (this.show === null)
|
|
316
|
-
this.
|
|
303
|
+
this.internalShow = true;
|
|
317
304
|
}
|
|
318
305
|
},
|
|
319
306
|
onLeaveAnchor(e) {
|
|
@@ -325,12 +312,12 @@ const _sfc_main = {
|
|
|
325
312
|
},
|
|
326
313
|
triggerHide() {
|
|
327
314
|
if (this.show === null)
|
|
328
|
-
this.
|
|
315
|
+
this.internalShow = false;
|
|
329
316
|
},
|
|
330
317
|
onChangePlacement(placement) {
|
|
331
318
|
this.currentPlacement = placement;
|
|
332
319
|
},
|
|
333
|
-
|
|
320
|
+
onHide() {
|
|
334
321
|
var _a;
|
|
335
322
|
(_a = this.tip) == null ? void 0 : _a.unmount();
|
|
336
323
|
this.$emit("shown", false);
|
|
@@ -338,7 +325,13 @@ const _sfc_main = {
|
|
|
338
325
|
this.$emit("update:show", false);
|
|
339
326
|
}
|
|
340
327
|
},
|
|
341
|
-
|
|
328
|
+
onShow(tooltipInstance, callingMethod) {
|
|
329
|
+
if (!this.tooltipHasContent(tooltipInstance)) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (this.transition && callingMethod === "onShow") {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
342
335
|
this.$emit("shown", true);
|
|
343
336
|
if (this.show !== null) {
|
|
344
337
|
this.$emit("update:show", true);
|
|
@@ -358,10 +351,11 @@ const _sfc_main = {
|
|
|
358
351
|
onMount() {
|
|
359
352
|
this.setProps();
|
|
360
353
|
},
|
|
361
|
-
|
|
354
|
+
tooltipHasContent(tooltipInstance) {
|
|
362
355
|
if (tooltipInstance.props.content.textContent.trim().length === 0) {
|
|
363
356
|
return false;
|
|
364
357
|
}
|
|
358
|
+
return true;
|
|
365
359
|
},
|
|
366
360
|
// set initial options here. If any of the options need to dynamically change, they should be put in
|
|
367
361
|
// tippyProps instead.
|
|
@@ -378,7 +372,7 @@ const _sfc_main = {
|
|
|
378
372
|
// disable tooltip from displaying on touch devices
|
|
379
373
|
touch: false,
|
|
380
374
|
onMount: this.onMount,
|
|
381
|
-
|
|
375
|
+
showOnCreate: this.internalShow,
|
|
382
376
|
popperOptions: getPopperOptions({
|
|
383
377
|
hasHideModifierEnabled: true
|
|
384
378
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\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 placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect.\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n isShown: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n // whether the tooltip is visible or not.\n isVisible () {\n const hasMessage = !!this.message?.trim();\n const hasDefaultSlot = !!this.$slots?.default;\n const isDeviceCompatible = !this.isTouchDevice;\n\n const shouldBeVisible = this.isShown && this.enabled && (hasMessage || hasDefaultSlot);\n\n return shouldBeVisible && isDeviceCompatible;\n },\n\n // eslint-disable-next-line complexity\n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : undefined,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy, otherwise use onShow\n onShown: this.transition ? this.onEnterTransitionComplete : () => {},\n onShow: this.transition ? () => {} : this.onEnterTransitionComplete,\n onHidden: this.onLeaveTransitionComplete,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null) {\n this.isShown = show;\n }\n },\n\n immediate: true,\n },\n\n isShown (isShown) {\n if (isShown) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.externalAnchor && this.addExternalAnchorEventListeners();\n this.tip = createTippy(this.anchor, this.initOptions());\n\n // immediate watcher fires before mounted, so have this here in case\n // show prop was initially set to true.\n if (this.isShown) {\n this.tip.show();\n }\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.tip) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (this.$el.getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n this.$el.closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.isShown = true;\n }\n } else {\n if (this.show === null) this.isShown = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.isShown = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onLeaveTransitionComplete () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onEnterTransitionComplete () {\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n onShow (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n onShow: this.onShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n@import 'tippy.js/dist/svg-arrow.css';\n\n.tippy-box[data-reference-hidden] {\n visibility: hidden;\n pointer-events: none;\n}\n\n.tippy-box > .tippy-svg-arrow {\n fill: var(--dt-color-surface-contrast);\n}\n\n.tippy-box[data-theme~='inverted'] > .tippy-svg-arrow {\n fill: var(--dt-color-surface-moderate);\n}\n\n.tippy-box[data-animation='fade'][data-state='hidden'] {\n opacity: 0;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createElementVNode","_normalizeClass"],"mappings":";;;;;;;AAiEA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AAAE,eAAO,gBAAe;AAAA,MAAK;AAAA,IACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeD,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,MAAM;AAAA,IACvB;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,EAAE;AAAA,IACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAA,cAAA,GAAA,IAAA;AAAA,MACvB,qDAAY,SAAa,iBAAA,SAAA,cAAA,GAAA,IAAA;AAAA,MACzB,qDAAY,SAAa,iBAAA,SAAA,cAAA,GAAA,IAAA;AAAA,MACzB,2DAAa,SAAa,iBAAA,SAAA,cAAA,GAAA,IAAA,GAAA,CAAA,KAAA,CAAA;AAAA;MAG3BC,WAEE,KAAA,QAAA,QAAA;AAAA;IAEJC,mBAkBM,OAAA;AAAA,MAjBH,IAAI,OAAE;AAAA,MACP,KAAI;AAAA,MACJ,WAAQ;AAAA,MACP,OAAKC,eAAA;AAAA;;WAA+C,MAAsB,uBAAC,QAAQ,GAAI,OAAQ;AAAA;QAAqB,OAAY;AAAA;;MAWjIF,WAEO,4BAFP,MAEO;AAAA,wCADF,OAAO,OAAA,GAAA,CAAA;AAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../components/tooltip/tooltip.vue"],"sourcesContent":["<template>\n <div data-qa=\"dt-tooltip-container\">\n <!-- disabling as the below events are for capturing events from interactive\n elements within the span rather than on the span itself -->\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <span\n v-if=\"!externalAnchor\"\n ref=\"anchor\"\n data-qa=\"dt-tooltip-anchor\"\n @focusin=\"onEnterAnchor\"\n @focusout=\"onLeaveAnchor\"\n @mouseenter=\"onEnterAnchor\"\n @mouseleave=\"onLeaveAnchor\"\n @keydown.esc=\"onLeaveAnchor\"\n >\n <!-- @slot Slot for the anchor element -->\n <slot\n name=\"anchor\"\n />\n </span>\n <div\n :id=\"id\"\n ref=\"content\"\n data-qa=\"dt-tooltip\"\n :class=\"[\n 'd-tooltip',\n {\n [ TOOLTIP_KIND_MODIFIERS.inverted ]: inverted,\n },\n contentClass,\n ]\"\n >\n <!-- In case when transitionend event doesn't work correct (for ex. tooltip component with custom trigger) -->\n <!-- after-leave event can be used instead of transitionend -->\n <!-- @slot Slot for the content, defaults to message prop -->\n <slot>\n {{ message }}\n </slot>\n </div>\n </div>\n</template>\n\n<script>\nimport {\n TOOLTIP_KIND_MODIFIERS,\n TOOLTIP_DIRECTIONS,\n TOOLTIP_STICKY_VALUES,\n TOOLTIP_DELAY_MS,\n} from './tooltip_constants.js';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '../popover/popover_constants';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport {\n createTippy,\n getAnchor,\n getPopperOptions,\n} from '@/components/popover/tippy_utils';\n\n/**\n * A tooltip is a floating label that briefly explains an action, function, or an element.\n * Its content is exclusively text and shouldn't be vital information for users.\n * If richer media is desired, consider using a popover instead.\n * @see https://dialtone.dialpad.com/components/tooltip.html\n */\nexport default {\n name: 'DtTooltip',\n\n props: {\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\"\n * if defined, otherwise it will automatically position to a new location\n * as it sees best fit. See\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => ['auto'],\n },\n\n /**\n * If true, applies inverted styles to the tooltip\n * @values true, false\n */\n inverted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the tooltip from its reference element\n * by the specified number of pixels. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 12],\n },\n\n /**\n * The direction the popover displays relative to the anchor. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\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 placement: {\n type: String,\n default: 'top',\n validator (placement) {\n return TOOLTIP_DIRECTIONS.includes(placement);\n },\n },\n\n /**\n * If the tooltip sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes. See\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: true,\n validator: (sticky) => {\n return TOOLTIP_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Sets the element to which the tooltip is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * This prop is not reactive, must be set on initial render.\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Additional css classes for the tooltip content element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * A provided message for the tooltip content\n */\n message: {\n type: String,\n default: '',\n },\n\n /**\n * Controls whether hover/focus causes the tooltip to appear.\n * Cannot be combined with the show prop. show value will be ignored.\n * by default this is true, if you override with false, the tooltip will never show up.\n */\n enabled: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Controls whether the tooltip is shown. Leaving this null will have the tooltip trigger on mouseover by default.\n * If you set this value, the default mouseover behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n show: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Whether the tooltip should have a transition effect (fade).\n */\n transition: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the tooltip will have a delay when being focused or moused over.\n * @values true, false\n */\n delay: {\n type: Boolean,\n default: true,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: null,\n },\n },\n\n emits: [\n /**\n * Emitted when tooltip is shown or hidden\n *\n * @event shown\n * @type {Boolean}\n */\n 'shown',\n\n /**\n * Sync show value\n *\n * @event update:show\n */\n 'update:show',\n ],\n\n data () {\n return {\n TOOLTIP_KIND_MODIFIERS,\n hasSlotContent,\n tip: null,\n\n inTimer: null,\n\n // Internal state for whether the tooltip is shown. Changing the prop\n // will update this.\n internalShow: false,\n\n // this is where the placement currently is, this can be different than\n // the placement prop when there is not enough available room for the tip\n // to display and it uses a fallback placement.\n currentPlacement: this.placement,\n };\n },\n\n computed: {\n // eslint-disable-next-line complexity\n tippyProps () {\n return {\n offset: this.offset,\n delay: this.delay ? TOOLTIP_DELAY_MS : false,\n placement: this.placement,\n sticky: this.sticky,\n theme: this.inverted ? 'inverted' : undefined,\n animation: this.transition ? 'fade' : false,\n // onShown only triggers when transition is truthy\n onShown: (tooltipInstance) => this.onShow(tooltipInstance, 'onShown'),\n // onShown will always be called, but it will be called before the animation is complete\n onShow: (tooltipInstance) => this.onShow(tooltipInstance, 'onShow'),\n onHidden: this.onHide,\n\n popperOptions: getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n hasHideModifierEnabled: true,\n onChangePlacement: this.onChangePlacement,\n }),\n };\n },\n\n anchor () {\n return this.externalAnchor ? document.body.querySelector(this.externalAnchor) : getAnchor(this.$refs.anchor);\n },\n },\n\n watch: {\n\n tippyProps: {\n handler: 'setProps',\n deep: true,\n },\n\n show: {\n handler: function (show) {\n if (show !== null) {\n this.internalShow = show;\n }\n },\n\n immediate: true,\n },\n\n internalShow (value) {\n if (value) {\n this.setProps();\n this.tip.show();\n } else {\n this.tip.hide();\n }\n },\n\n sticky (sticky) {\n this.tip.setProps({\n sticky,\n });\n },\n },\n\n mounted () {\n if (!this.enabled && this.show != null) {\n console.warn('Tooltip: You cannot use both the enabled and show props at the same time.');\n console.warn('The show prop will be ignored.');\n }\n\n this.externalAnchor && this.addExternalAnchorEventListeners();\n this.tip = createTippy(this.anchor, this.initOptions());\n },\n\n beforeUnmount () {\n this.externalAnchor && this.removeExternalAnchorEventListeners();\n\n if (this.tip) {\n this.tip?.destroy();\n }\n },\n\n methods: {\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at tooltip z-index\n if (this.$el.getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 651 when\n // anchor of popover is within a drawer.\n this.$el.closest('.d-zi-drawer')) {\n return 651;\n } else {\n return 400;\n }\n },\n\n hasVisibleFocus () {\n return this.anchor.matches(':focus-visible');\n },\n\n onEnterAnchor (e) {\n if (this.delay && this.inTimer === null) {\n this.inTimer = setTimeout(() => {\n this.triggerShow(e);\n }, TOOLTIP_DELAY_MS);\n } else {\n this.triggerShow(e);\n }\n },\n\n triggerShow (e) {\n if (e.type === 'focusin') {\n // only show tooltips on visible focus when triggered via focus.\n // when the user is using the mouse they only want tooltips to display\n // on mouseover.\n //\n // Example: anchor of a popover is a button with tooltip.\n // closing it with the mouse would trigger the tooltip to display as\n // the anchor is focused on close. Not what we want.\n if (this.show === null && this.hasVisibleFocus()) {\n this.internalShow = true;\n }\n } else {\n if (this.show === null) this.internalShow = true;\n }\n },\n\n onLeaveAnchor (e) {\n if (e.type === 'keydown' && e.code !== 'Escape') return;\n\n clearTimeout(this.inTimer);\n this.inTimer = null;\n this.triggerHide();\n },\n\n triggerHide () {\n if (this.show === null) this.internalShow = false;\n },\n\n onChangePlacement (placement) {\n this.currentPlacement = placement;\n },\n\n onHide () {\n this.tip?.unmount();\n this.$emit('shown', false);\n if (this.show !== null) {\n this.$emit('update:show', false);\n }\n },\n\n onShow (tooltipInstance, callingMethod) {\n if (!this.tooltipHasContent(tooltipInstance)) {\n return false;\n }\n if (this.transition && callingMethod === 'onShow') {\n return;\n }\n this.$emit('shown', true);\n if (this.show !== null) {\n this.$emit('update:show', true);\n }\n },\n\n setProps () {\n if (this.tip && this.tip.setProps) {\n this.tip.setProps({\n ...this.tippyProps,\n // these need to be set here rather than in tippyProps because they are non-reactive\n appendTo: this.appendTo === 'body' ? this.anchor?.getRootNode()?.querySelector('body') : this.appendTo,\n zIndex: this.calculateAnchorZindex(),\n });\n }\n },\n\n onMount () {\n this.setProps();\n },\n\n tooltipHasContent (tooltipInstance) {\n // don't show tooltip when no content\n if (tooltipInstance.props.content.textContent.trim().length === 0) {\n return false;\n }\n return true;\n },\n\n // set initial options here. If any of the options need to dynamically change, they should be put in\n // tippyProps instead.\n initOptions () {\n const template = this.$refs.content;\n return {\n content: template,\n arrow: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"7\"><path d=\"M 14.5,7 8,0 1.5,7 Z\"/></svg>',\n // transition duration - same as our custom fade delay in dialtone-globals.less\n duration: 180,\n interactive: false,\n trigger: 'manual',\n hideOnClick: false,\n // disable tooltip from displaying on touch devices\n touch: false,\n onMount: this.onMount,\n showOnCreate: this.internalShow,\n popperOptions: getPopperOptions({\n hasHideModifierEnabled: true,\n }),\n };\n },\n\n addExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor.addEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor.addEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n\n removeExternalAnchorEventListeners () {\n ['focusin', 'mouseenter'].forEach(listener => {\n this.anchor.removeEventListener(listener, (event) => this.onEnterAnchor(event));\n });\n ['focusout', 'mouseleave', 'keydown'].forEach(listener => {\n this.anchor.removeEventListener(listener, (event) => this.onLeaveAnchor(event));\n });\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n@import 'tippy.js/dist/svg-arrow.css';\n\n.tippy-box[data-reference-hidden] {\n visibility: hidden;\n pointer-events: none;\n}\n\n.tippy-box > .tippy-svg-arrow {\n fill: var(--dt-color-surface-contrast);\n}\n\n.tippy-box[data-theme~='inverted'] > .tippy-svg-arrow {\n fill: var(--dt-color-surface-moderate);\n}\n\n.tippy-box[data-animation='fade'][data-state='hidden'] {\n opacity: 0;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_renderSlot","_createElementVNode","_normalizeClass"],"mappings":";;;;;;;AAiEA,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EAEN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AAAE,eAAO,gBAAe;AAAA,MAAK;AAAA,IACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAeD,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,MAAM;AAAA,IACvB;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,EAAE;AAAA,IACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAiBD,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAW,WAAW;AACpB,eAAO,mBAAmB,SAAS,SAAS;AAAA,MAC7C;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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A+C,MAAsB,uBAAC,QAAQ,GAAI,OAAQ;AAAA;QAAqB,OAAY;AAAA;;MAWjIF,WAEO,4BAFP,MAEO;AAAA,wCADF,OAAO,OAAA,GAAA,CAAA;AAAA;;;;;"}
|
|
@@ -60,6 +60,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
60
|
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
61
61
|
default: string;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Shows a subtle appearance for the badge
|
|
65
|
+
* Currently only affects the badge when type is bulletin.
|
|
66
|
+
*/
|
|
67
|
+
subtle: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Outlines the badge with a border
|
|
73
|
+
*/
|
|
74
|
+
outlined: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
63
78
|
}, any, {
|
|
64
79
|
BADGE_TYPE_MODIFIERS: {
|
|
65
80
|
default: string;
|
|
@@ -171,6 +186,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
171
186
|
type: (ObjectConstructor | ArrayConstructor | StringConstructor)[];
|
|
172
187
|
default: string;
|
|
173
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Shows a subtle appearance for the badge
|
|
191
|
+
* Currently only affects the badge when type is bulletin.
|
|
192
|
+
*/
|
|
193
|
+
subtle: {
|
|
194
|
+
type: BooleanConstructor;
|
|
195
|
+
default: boolean;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Outlines the badge with a border
|
|
199
|
+
*/
|
|
200
|
+
outlined: {
|
|
201
|
+
type: BooleanConstructor;
|
|
202
|
+
default: boolean;
|
|
203
|
+
};
|
|
174
204
|
}>>, {
|
|
175
205
|
type: string;
|
|
176
206
|
text: string;
|
|
@@ -179,6 +209,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
179
209
|
kind: string;
|
|
180
210
|
decoration: string;
|
|
181
211
|
labelClass: string | Record<string, any> | unknown[];
|
|
212
|
+
subtle: boolean;
|
|
213
|
+
outlined: boolean;
|
|
182
214
|
}, {}>;
|
|
183
215
|
export default _default;
|
|
184
216
|
//# sourceMappingURL=badge.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.vue.d.ts","sourceRoot":"","sources":["../../../../components/badge/badge.vue.js"],"names":[],"mappings":";IAkBI;;;;OAIG;;;;;IAMH;;;OAGG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;;;OAMG;;;;;;IAOH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"badge.vue.d.ts","sourceRoot":"","sources":["../../../../components/badge/badge.vue.js"],"names":[],"mappings":";IAkBI;;;;OAIG;;;;;IAMH;;;OAGG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;;;OAMG;;;;;;IAOH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;QA/EH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAJH;;;;OAIG;;;;;IAMH;;;OAGG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;;;OAMG;;;;;;IAOH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;OAEG"}
|
|
@@ -36,7 +36,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* The color of the link and button if the button is styled as a link.
|
|
39
|
-
* @values default, warning, danger, success, muted
|
|
39
|
+
* @values default, warning, danger, success, muted
|
|
40
40
|
* @see DtLink
|
|
41
41
|
*/
|
|
42
42
|
linkKind: {
|
|
@@ -44,6 +44,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
default: string;
|
|
45
45
|
validator: (lk: unknown) => boolean;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Determines whether the link should have inverted styling if the button is styled as a link.
|
|
49
|
+
* @values true, false
|
|
50
|
+
* @see DtLink
|
|
51
|
+
*/
|
|
52
|
+
linkInverted: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
47
56
|
/**
|
|
48
57
|
* HTML button disabled attribute
|
|
49
58
|
* <a
|
|
@@ -198,7 +207,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
198
207
|
};
|
|
199
208
|
/**
|
|
200
209
|
* The color of the link and button if the button is styled as a link.
|
|
201
|
-
* @values default, warning, danger, success, muted
|
|
210
|
+
* @values default, warning, danger, success, muted
|
|
202
211
|
* @see DtLink
|
|
203
212
|
*/
|
|
204
213
|
linkKind: {
|
|
@@ -206,6 +215,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
206
215
|
default: string;
|
|
207
216
|
validator: (lk: unknown) => boolean;
|
|
208
217
|
};
|
|
218
|
+
/**
|
|
219
|
+
* Determines whether the link should have inverted styling if the button is styled as a link.
|
|
220
|
+
* @values true, false
|
|
221
|
+
* @see DtLink
|
|
222
|
+
*/
|
|
223
|
+
linkInverted: {
|
|
224
|
+
type: BooleanConstructor;
|
|
225
|
+
default: boolean;
|
|
226
|
+
};
|
|
209
227
|
/**
|
|
210
228
|
* HTML button disabled attribute
|
|
211
229
|
* <a
|
|
@@ -315,6 +333,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
315
333
|
iconPosition: string;
|
|
316
334
|
importance: string;
|
|
317
335
|
linkKind: string;
|
|
336
|
+
linkInverted: boolean;
|
|
318
337
|
disabled: boolean;
|
|
319
338
|
width: string;
|
|
320
339
|
assertiveOnFocus: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.vue.d.ts","sourceRoot":"","sources":["../../../../components/button/button.vue.js"],"names":[],"mappings":";IA6BI;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;OAIG;;;;;IAMH;;;;OAIG;;;;;;IAOH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;OAUG;;;;;;IAOH;;;;;;OAMG;;;;;IAMH;;;OAGG;;;;;;IAOH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;;;OAKG;;;;;IAMH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"button.vue.d.ts","sourceRoot":"","sources":["../../../../components/button/button.vue.js"],"names":[],"mappings":";IA6BI;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;OAIG;;;;;IAMH;;;;OAIG;;;;;;IAOH;;;;OAIG;;;;;IAMH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;OAUG;;;;;;IAOH;;;;;;OAMG;;;;;IAMH;;;OAGG;;;;;;IAOH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;;;OAKG;;;;;IAMH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA7JH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;OAGG;;;;;;IAOH;;;;OAIG;;;;;IAMH;;;;OAIG;;;;;;IAOH;;;;OAIG;;;;;IAMH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;OAUG;;;;;;IAOH;;;;;;OAMG;;;;;IAMH;;;OAGG;;;;;;IAOH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;IAOH;;;;;OAKG;;;;;IAMH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;+BAvLwB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji_search.vue.d.ts","sourceRoot":"","sources":["../../../../../components/emoji_picker/modules/emoji_search.vue.js"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"emoji_search.vue.d.ts","sourceRoot":"","sources":["../../../../../components/emoji_picker/modules/emoji_search.vue.js"],"names":[],"mappings":";;;;;;;;;;;AA6BA,0CAEC"}
|
|
@@ -136,7 +136,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
136
136
|
default: null;
|
|
137
137
|
};
|
|
138
138
|
/**
|
|
139
|
-
* Whether the tooltip should have a transition effect.
|
|
139
|
+
* Whether the tooltip should have a transition effect (fade).
|
|
140
140
|
*/
|
|
141
141
|
transition: {
|
|
142
142
|
type: BooleanConstructor;
|
|
@@ -168,10 +168,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
168
168
|
hasSlotContent: typeof hasSlotContent;
|
|
169
169
|
tip: null;
|
|
170
170
|
inTimer: null;
|
|
171
|
-
|
|
171
|
+
internalShow: boolean;
|
|
172
172
|
currentPlacement: string;
|
|
173
173
|
}, {
|
|
174
|
-
isVisible(): boolean;
|
|
175
174
|
tippyProps(): {
|
|
176
175
|
offset: unknown[];
|
|
177
176
|
delay: number | boolean;
|
|
@@ -179,8 +178,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
179
178
|
sticky: string | boolean;
|
|
180
179
|
theme: string | undefined;
|
|
181
180
|
animation: string | boolean;
|
|
182
|
-
onShown: () =>
|
|
183
|
-
onShow: () =>
|
|
181
|
+
onShown: (tooltipInstance: any) => false | undefined;
|
|
182
|
+
onShow: (tooltipInstance: any) => false | undefined;
|
|
184
183
|
onHidden: () => void;
|
|
185
184
|
popperOptions: {
|
|
186
185
|
modifiers: ({
|
|
@@ -220,11 +219,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
220
219
|
onLeaveAnchor(e: any): void;
|
|
221
220
|
triggerHide(): void;
|
|
222
221
|
onChangePlacement(placement: any): void;
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
onHide(): void;
|
|
223
|
+
onShow(tooltipInstance: any, callingMethod: any): false | undefined;
|
|
225
224
|
setProps(): void;
|
|
226
225
|
onMount(): void;
|
|
227
|
-
|
|
226
|
+
tooltipHasContent(tooltipInstance: any): boolean;
|
|
228
227
|
initOptions(): {
|
|
229
228
|
content: unknown;
|
|
230
229
|
arrow: string;
|
|
@@ -234,7 +233,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
234
233
|
hideOnClick: boolean;
|
|
235
234
|
touch: boolean;
|
|
236
235
|
onMount: () => void;
|
|
237
|
-
|
|
236
|
+
showOnCreate: boolean;
|
|
238
237
|
popperOptions: {
|
|
239
238
|
modifiers: ({
|
|
240
239
|
name: string;
|
|
@@ -404,7 +403,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
404
403
|
default: null;
|
|
405
404
|
};
|
|
406
405
|
/**
|
|
407
|
-
* Whether the tooltip should have a transition effect.
|
|
406
|
+
* Whether the tooltip should have a transition effect (fade).
|
|
408
407
|
*/
|
|
409
408
|
transition: {
|
|
410
409
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.vue.d.ts","sourceRoot":"","sources":["../../../../components/tooltip/tooltip.vue.js"],"names":[],"mappings":";IA4BI;;OAEG;;;;;IAMH;;;;;;;;;;;;SAYK;;;;;IAML;;;OAGG;;;;;IAMH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;OAKG;;;;;;;;;IAUH;;;;OAIG;;;;;IAMH;;OAEG;;;;;IAMH;;;;OAIG;;;;;IAMH;;;;;OAKG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG
|
|
1
|
+
{"version":3,"file":"tooltip.vue.d.ts","sourceRoot":"","sources":["../../../../components/tooltip/tooltip.vue.js"],"names":[],"mappings":";IA4BI;;OAEG;;;;;IAMH;;;;;;;;;;;;SAYK;;;;;IAML;;;OAGG;;;;;IAMH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;OAKG;;;;;;;;;IAUH;;;;OAIG;;;;;IAMH;;OAEG;;;;;IAMH;;;;OAIG;;;;;IAMH;;;;;OAKG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAjJH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAHH;;;eAGG;;;;;;IA7BH;;OAEG;;;;;IAMH;;;;;;;;;;;;SAYK;;;;;IAML;;;OAGG;;;;;IAMH;;;;;;;;;;OAUG;;;;;IAMH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;;;;;;;;;;OAcG;;;;;;IASH;;;;;OAKG;;;;;;;;;IAUH;;;;OAIG;;;;;IAMH;;OAEG;;;;;IAMH;;;;OAIG;;;;;IAMH;;;;;OAKG;;;;;IAMH;;OAEG;;;;;IAMH;;;OAGG;;;;;IAMH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;+BA5LyC,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialpad/dialtone",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.42.0",
|
|
4
4
|
"description": "Dialpad's Dialtone design system monorepo",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"requireindex": "1.2.0",
|
|
63
63
|
"stylelint": "15.11.0",
|
|
64
64
|
"tippy.js": "6.3.7",
|
|
65
|
-
"@dialpad/dialtone-emojis": "1.0.
|
|
66
|
-
"@dialpad/dialtone-icons": "4.16.
|
|
65
|
+
"@dialpad/dialtone-emojis": "1.0.7",
|
|
66
|
+
"@dialpad/dialtone-icons": "4.16.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@commitlint/cli": "^18.4.3",
|