@adyen/bento-vue3 1.63.2 → 1.64.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/@types/index.d.ts +4 -0
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{checkbox-group.Aqtco8Q5.js → checkbox-group.BZIl5tRV.js} +4 -4
- package/dist/chunks/{checkbox-group.Aqtco8Q5.js.map → checkbox-group.BZIl5tRV.js.map} +1 -1
- package/dist/chunks/{checkbox.Hl6-8Sai.js → checkbox.8caojfCf.js} +18 -18
- package/dist/chunks/{checkbox.Hl6-8Sai.js.map → checkbox.8caojfCf.js.map} +1 -1
- package/dist/chunks/{code-snippet.DyAfzpUj.js → code-snippet.iVFAaX-7.js} +3 -3
- package/dist/chunks/{code-snippet.DyAfzpUj.js.map → code-snippet.iVFAaX-7.js.map} +1 -1
- package/dist/chunks/{controls-group.D32ggMrj.js → controls-group.DD1m4EKn.js} +2 -2
- package/dist/chunks/{controls-group.D32ggMrj.js.map → controls-group.DD1m4EKn.js.map} +1 -1
- package/dist/chunks/{copy.BFMgEWBq.js → copy.DqckFHHS.js} +2 -2
- package/dist/chunks/{copy.BFMgEWBq.js.map → copy.DqckFHHS.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DPWO9ADi.js → dashed-underline.ywc0ydgS.js} +2 -2
- package/dist/chunks/{dashed-underline.DPWO9ADi.js.map → dashed-underline.ywc0ydgS.js.map} +1 -1
- package/dist/chunks/data-grid.BpuoBniw.js +3773 -0
- package/dist/chunks/data-grid.BpuoBniw.js.map +1 -0
- package/dist/chunks/{date-picker.DGj3tbf8.js → date-picker.CRZaa2pG.js} +15 -15
- package/dist/chunks/{date-picker.DGj3tbf8.js.map → date-picker.CRZaa2pG.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BJm2xOoG.js → date-range-picker.Wd3Wj2xh.js} +23 -23
- package/dist/chunks/{date-range-picker.BJm2xOoG.js.map → date-range-picker.Wd3Wj2xh.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CQMkfl3K.js → dropdown-tag.C8iqeoRx.js} +3 -3
- package/dist/chunks/{dropdown-tag.CQMkfl3K.js.map → dropdown-tag.C8iqeoRx.js.map} +1 -1
- package/dist/chunks/{dropdown.BPQS22Kl.js → dropdown.UapzImAi.js} +169 -169
- package/dist/chunks/dropdown.UapzImAi.js.map +1 -0
- package/dist/chunks/{error-message.C9YtK-P0.js → error-message.DZWphzoT.js} +2 -2
- package/dist/chunks/{error-message.C9YtK-P0.js.map → error-message.DZWphzoT.js.map} +1 -1
- package/dist/chunks/{file-uploader.CXi2dHhF.js → file-uploader.C8DwUCMp.js} +3 -3
- package/dist/chunks/{file-uploader.CXi2dHhF.js.map → file-uploader.C8DwUCMp.js.map} +1 -1
- package/dist/chunks/{filter-bar.BFnsLrta.js → filter-bar.n8rNb16m.js} +10 -10
- package/dist/chunks/{filter-bar.BFnsLrta.js.map → filter-bar.n8rNb16m.js.map} +1 -1
- package/dist/chunks/{header-with-views.CCSJ1mUs.js → header-with-views.CAPWxTOO.js} +4 -4
- package/dist/chunks/{header-with-views.CCSJ1mUs.js.map → header-with-views.CAPWxTOO.js.map} +1 -1
- package/dist/chunks/{info-icon.BOxWZsrW.js → info-icon.CpGwbhZQ.js} +2 -2
- package/dist/chunks/{info-icon.BOxWZsrW.js.map → info-icon.CpGwbhZQ.js.map} +1 -1
- package/dist/chunks/{input-field-password.B5zx9e4K.js → input-field-password.COKWNkFD.js} +137 -134
- package/dist/chunks/input-field-password.COKWNkFD.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.DqfmWaJ2.js → input-field-phone-number.BcuBaX7v.js} +3 -3
- package/dist/chunks/{input-field-phone-number.DqfmWaJ2.js.map → input-field-phone-number.BcuBaX7v.js.map} +1 -1
- package/dist/chunks/{input-field.CfsdWr4t.js → input-field.DyLJYbGL.js} +3 -3
- package/dist/chunks/{input-field.CfsdWr4t.js.map → input-field.DyLJYbGL.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.0fIXV0Bs.js → listbox-option-tag.0BK6jWO9.js} +2 -2
- package/dist/chunks/{listbox-option-tag.0fIXV0Bs.js.map → listbox-option-tag.0BK6jWO9.js.map} +1 -1
- package/dist/chunks/{pagination.BKyr5hq_.js → pagination.i2eNp6n4.js} +2 -2
- package/dist/chunks/{pagination.BKyr5hq_.js.map → pagination.i2eNp6n4.js.map} +1 -1
- package/dist/chunks/{radio-group.B7-_Wh8z.js → radio-group.435rdgzm.js} +4 -4
- package/dist/chunks/{radio-group.B7-_Wh8z.js.map → radio-group.435rdgzm.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.BK2zdyOm.js → rich-text-editor.CE7kjKfA.js} +4 -4
- package/dist/chunks/{rich-text-editor.BK2zdyOm.js.map → rich-text-editor.CE7kjKfA.js.map} +1 -1
- package/dist/chunks/{search-bar.DgOHq0ns.js → search-bar.g_dBJXfU.js} +3 -3
- package/dist/chunks/{search-bar.DgOHq0ns.js.map → search-bar.g_dBJXfU.js.map} +1 -1
- package/dist/chunks/{secondary-nav.BHpoi5U4.js → secondary-nav.Dy9Abrau.js} +2 -2
- package/dist/chunks/{secondary-nav.BHpoi5U4.js.map → secondary-nav.Dy9Abrau.js.map} +1 -1
- package/dist/chunks/{segmented-control.CZpx9H-d.js → segmented-control.5-vlm8Gt.js} +2 -2
- package/dist/chunks/{segmented-control.CZpx9H-d.js.map → segmented-control.5-vlm8Gt.js.map} +1 -1
- package/dist/chunks/{selection-card-group.-8bXRhOW.js → selection-card-group.TPoxTPl3.js} +11 -11
- package/dist/chunks/{selection-card-group.-8bXRhOW.js.map → selection-card-group.TPoxTPl3.js.map} +1 -1
- package/dist/chunks/{structured-list-item.Ca1EGpL7.js → structured-list-item.DQzxNb_M.js} +4 -4
- package/dist/chunks/{structured-list-item.Ca1EGpL7.js.map → structured-list-item.DQzxNb_M.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CGJ5YLMz.js → summary-grid.types.BpS1z1-W.js} +5 -5
- package/dist/chunks/{summary-grid.types.CGJ5YLMz.js.map → summary-grid.types.BpS1z1-W.js.map} +1 -1
- package/dist/chunks/{tag.B1G_vwKM.js → tag.D3in0-Bp.js} +2 -2
- package/dist/chunks/{tag.B1G_vwKM.js.map → tag.D3in0-Bp.js.map} +1 -1
- package/dist/chunks/{textarea.CuTrFVEa.js → textarea.CV1HjB0x.js} +2 -2
- package/dist/chunks/{textarea.CuTrFVEa.js.map → textarea.CV1HjB0x.js.map} +1 -1
- package/dist/chunks/{timeline-item.Oovatubh.js → timeline-item.DUp8MmgZ.js} +4 -4
- package/dist/chunks/{timeline-item.Oovatubh.js.map → timeline-item.DUp8MmgZ.js.map} +1 -1
- package/dist/chunks/{tooltip.D2o0d8Xf.js → tooltip.VYPUHERk.js} +13 -13
- package/dist/chunks/tooltip.VYPUHERk.js.map +1 -0
- package/dist/chunks/use-cached-selected-values.CatIU1_1.js +1591 -0
- package/dist/chunks/use-cached-selected-values.CatIU1_1.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +30 -30
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +6 -6
- package/dist/pagination.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/chunks/data-grid.BD6IwwRl.js +0 -3741
- package/dist/chunks/data-grid.BD6IwwRl.js.map +0 -1
- package/dist/chunks/dropdown.BPQS22Kl.js.map +0 -1
- package/dist/chunks/input-field-password.B5zx9e4K.js.map +0 -1
- package/dist/chunks/tooltip.D2o0d8Xf.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.swt0cdsA.js +0 -1524
- package/dist/chunks/use-cached-selected-values.swt0cdsA.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, useAttrs as m, computed as o, createElementBlock as y, openBlock as a, normalizeClass as r, createElementVNode as h, renderSlot as g, createBlock as i, createCommentVNode as n, unref as s, withCtx as w, createTextVNode as S, toDisplayString as B } from "vue";
|
|
2
2
|
import { d as C, B as v } from "./typography.DN5eC5ch.js";
|
|
3
|
-
import { F as x } from "./error-message.
|
|
3
|
+
import { F as x } from "./error-message.DZWphzoT.js";
|
|
4
4
|
import { _ as L } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
5
|
import "../assets/controls-group.css";
|
|
6
6
|
const N = ["form", "disabled", "aria-describedby"], _ = {}, q = /* @__PURE__ */ f({
|
|
@@ -95,4 +95,4 @@ const N = ["form", "disabled", "aria-describedby"], _ = {}, q = /* @__PURE__ */
|
|
|
95
95
|
export {
|
|
96
96
|
V as C
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=controls-group.
|
|
98
|
+
//# sourceMappingURL=controls-group.DD1m4EKn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls-group.
|
|
1
|
+
{"version":3,"file":"controls-group.DD1m4EKn.js","sources":["../../../vue2/src/components/internal/controls-group/controls-group.vue"],"sourcesContent":["<template>\n <fieldset\n class=\"b-controls-group\"\n :class=\"conditionalClasses\"\n :form=\"form\"\n :disabled=\"disabled\"\n :aria-describedby=\"ariaAttributes['aria-describedby']\"\n >\n <legend class=\"b-controls-group__label-container\" :class=\"legendConditionalClasses\">\n <field-label\n v-if=\"label\"\n class=\"b-controls-group__label\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography v-if=\"description\" class=\"b-controls-group__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </legend>\n <slot />\n </fieldset>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useAttrs } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { FieldLabel } from '@/components/internal/field-label';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * The name of the component to cite when throwing a depreacte error.\n */\n componentName: { type: String, required: true },\n\n /**\n * Sets all child controls of the <fieldset> as disabled.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The value of the id attribute of a <form> element the <fieldset> is to part of, even if it is not inside the form itself.\n */\n form: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * The label is shown when `hideLabel` is set to `true` or if `description` is passed\n */\n label: { type: String, required: true },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n });\n\n const ariaAttributes = computed(() => ({\n 'aria-describedby': attrs['aria-describedby']?.toString() as string,\n }));\n\n const conditionalClasses = computed(() => ({\n 'b-controls-group--disabled': props.disabled,\n }));\n\n const legendConditionalClasses = computed(() => {\n const isLabelAndDescriptionPresent = props.label && props.description;\n const shouldShowLabel = isLabelAndDescriptionPresent || props.hideLabel === false;\n\n return {\n 'b-controls-group__label-container--hidden': !shouldShowLabel,\n };\n });\n\n // eslint-disable-next-line eqeqeq -- Needs to show deprecate message when hideLabel is not set and no description available\n const hasNoPropsDefined = !props.description && props.hideLabel == undefined;\n if (hasNoPropsDefined) {\n deprecate(\n `${props.componentName}: The property \\`label\\` will always be rendered by default.`,\n `After version 2.0.0, the label will be shown by default.\n To continue hiding the label set \\`:hide-label=\"true\"\\`. Up until version 2.0.0, to display the label set \\`hide-label=\"false\"\\`.\n \\`label\\` will always be rendered when \\`description\\` is passed alongside with \\`label\\``,\n `2.0.0`\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A controls group components should be used whenever it is necessary to group a set of controls (i.e. radio buttons or checkboxes)\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * @example\n * import { ControlsGroup, BentoCheckbox, BentoRadioButton } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { ControlsGroup, BentoRadioButton },\n * template: `\n * <controls-group\n * label=\"Your group label\"\n * description=\"Description\"\n * >\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * </bento-radio-button>\n * <bento-radio-button\n * value=\"inputRadio\"\n * >\n * Another label text\n * </bento-radio-button>\n * </controls-group>\n * `\n * };\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/controls-group/controls-group.scss\" />\n"],"names":["__default__","attrs","useAttrs","props","__props","ariaAttributes","computed","_a","conditionalClasses","legendConditionalClasses","deprecate"],"mappings":";;;;;oDA8IIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/GA,UAAAC,IAAAC,EAAA,GAEAC,IAAAC,GAgDAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAuC,qBAAAC,IAAAN,EAAA,kBAAA,MAAA,gBAAAM,EAAA;AAAA,MACqB;AAAA,KAAA,GAG5DC,IAAAF,EAAA,OAAA;AAAA,MAA2C,8BAAAH,EAAA;AAAA,IACH,EAAA,GAGxCM,IAAAH,EAAA,OAII;AAAA,MAAO,6CAAA,EAHPH,EAAA,SAAAA,EAAA,eACAA,EAAA,cAAA;AAAA,IAGkD,EAClD;AAKJ,WADA,CAAAA,EAAA,eAAAA,EAAA,aAAA,QAEIO;AAAA,MAAA,GAAAP,EAAA,aAAA;AAAA,MAC0B;AAAA,MACtB;AAAA,IAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { createElementBlock as a, openBlock as r, mergeProps as $, createComment
|
|
|
2
2
|
import { B as D } from "./button.AB0SOQMn.js";
|
|
3
3
|
import { c as O } from "./popper-container.types.BCZMbVFD.js";
|
|
4
4
|
import "./events.FNmSWp_P.js";
|
|
5
|
-
import { B as F } from "./tooltip.
|
|
5
|
+
import { B as F } from "./tooltip.VYPUHERk.js";
|
|
6
6
|
import { u as N } from "./i18n.B6g5VX0q.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { _ as V } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -153,4 +153,4 @@ export {
|
|
|
153
153
|
Q as C,
|
|
154
154
|
o as a
|
|
155
155
|
};
|
|
156
|
-
//# sourceMappingURL=copy.
|
|
156
|
+
//# sourceMappingURL=copy.DqckFHHS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.
|
|
1
|
+
{"version":3,"file":"copy.DqckFHHS.js","sources":["../../../vue2/src/components/internal/copy/copy.types.ts","../../../ui-assets/icons-16/dist/vue/copy.vue","../../../vue2/src/components/internal/copy/copy.vue"],"sourcesContent":["import type { BentoButton } from '../../button';\n\nexport enum CopyTooltipState {\n DEFAULT = 'default',\n COPYING = 'copying',\n ERROR = 'error',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\nexport type BentoCopyButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M3.5 1.25C2.25736 1.25 1.25 2.25736 1.25 3.5V8.5C1.25 9.74264 2.25736 10.75 3.5 10.75H5.25V12.5C5.25 13.7426 6.25736 14.75 7.5 14.75H12.5C13.7426 14.75 14.75 13.7426 14.75 12.5V7.5C14.75 6.25736 13.7426 5.25 12.5 5.25H10.75V3.5C10.75 2.25736 9.74264 1.25 8.5 1.25H3.5ZM9.25 5.25H7.5C6.25736 5.25 5.25 6.25736 5.25 7.5V9.25H3.5C3.08579 9.25 2.75 8.91421 2.75 8.5V3.5C2.75 3.08579 3.08579 2.75 3.5 2.75H8.5C8.91421 2.75 9.25 3.08579 9.25 3.5V5.25ZM6.75 12.5V7.5C6.75 7.08579 7.08579 6.75 7.5 6.75H12.5C12.9142 6.75 13.25 7.08579 13.25 7.5V12.5C13.25 12.9142 12.9142 13.25 12.5 13.25H7.5C7.08579 13.25 6.75 12.9142 6.75 12.5Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <div class=\"b-copy\" @mouseleave=\"resetText\" @focusout=\"resetText\">\n <span v-if=\"$slots.default\" v-bento-tooltip-directive:[tooltipPosition]=\"copyText\" @click=\"onClickCopy\">\n <slot />\n </span>\n <bento-button\n v-else\n v-bento-tooltip-directive:[tooltipPosition]=\"copyText\"\n v-bind=\"button\"\n @click=\"onClickCopy\"\n >\n <template #iconLeft>\n <copy-icon :svg-title=\"svgTitle\" />\n </template>\n <template v-if=\"buttonText\" #default>\n {{ buttonText }}\n </template>\n </bento-button>\n <div v-if=\"showScreenReaderAlert\" role=\"alert\" class=\"b-copy__screen-reader-alert\">{{ t('copied') }}</div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoButton } from '@/components/button';\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective } from '@/directives';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoCopyButtonProps, CopyTooltipState } from './copy.types';\n import CopyIcon from '@adyen/ui-assets-icons-16/vue/copy';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * An internal button component that copies text to the user's clipboard.\n *\n * @example\n * import { Copy } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { Copy },\n * template: `\n * <copy :text=\"textToCopy\" />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'copy',\n components: { BentoButton, CopyIcon },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoCopyButtonProps>,\n default: () =>\n ({\n variant: 'tertiary',\n } as BentoCopyButtonProps),\n },\n\n /**\n * Sets the button text of the copy button.\n */\n buttonText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Defines the string that will get copied to the clipboard\n */\n text: {\n type: String,\n required: true,\n },\n\n /**\n * Position the tooltip should take if space is available. Defaults to 'top'\n */\n tooltipPosition: {\n type: String as PropType<PopperContainerPosition>,\n default: PopperContainerPosition.TOP,\n },\n },\n setup(props) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const copyState = ref<CopyTooltipState>(CopyTooltipState.DEFAULT);\n\n const showScreenReaderAlert = ref(false);\n const onClickCopy = async () => {\n try {\n await navigator.clipboard.writeText(props.text);\n copyState.value = CopyTooltipState.COPYING;\n showScreenReaderAlert.value = true;\n } catch {\n copyState.value = CopyTooltipState.ERROR;\n }\n };\n\n const resetText = () => {\n copyState.value = CopyTooltipState.DEFAULT;\n showScreenReaderAlert.value = false;\n };\n\n const copyText = computed(() => {\n switch (copyState.value) {\n case CopyTooltipState.COPYING:\n return t('copied');\n case CopyTooltipState.ERROR:\n return t('copyFailed');\n case CopyTooltipState.DEFAULT:\n default:\n return t('copy');\n }\n });\n\n const svgTitle = computed(() => (props?.buttonText ? undefined : t('copy')));\n\n return {\n copyText,\n onClickCopy,\n resetText,\n showScreenReaderAlert,\n svgTitle,\n\n // Translations\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./copy.scss\" />\n"],"names":["CopyTooltipState","CopyTooltipState2","uuid","openBlock","createElementBlock","mergeProps","_ctx","createCommentVNode","_sfc_main","defineComponent","messages","BentoButton","CopyIcon","BentoTooltipDirective","PopperContainerPosition","props","useI18n","copyState","ref","showScreenReaderAlert","onClickCopy","resetText","copyText","computed","svgTitle","_directive_bento_tooltip_directive","resolveDirective","_cache","args","withDirectives","tooltipPosition","createBlock","_component_bento_button","createSlots","withCtx","createVNode","_component_copy_icon","buttonText","createTextVNode","toDisplayString","_hoisted_1"],"mappings":";;;;;;;;;AAEY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACKR,IAAAE,IAAA;;EAGI,eAAA;8BAEIA,KAAA;AAAA;;;AAVR,SAAAC,EAAA,GAAAC,EAAA,OAAAC,EAAA,EAAA,MAAA,MAAA,GAAAC,EAAA,QAAA;AAAA,IAAgC,OAAA;AAAA,IAA2B,OAA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EAAA,SAAA,GAAA,MAAA,GAAA,CAAA,WAAA,CAAA;AAAA,MAAA,CAAA;AAAA,MAc4B+B,GAAAA;AAAAA,IAAAA,GAAAA;AAAAA,MAd5B/B,EAAA,aAAA;AAAA,QAAA,MAAA;AAAA,QAAA,IAAA4B,EAAA,MAAA;AAAA,UAAAI,EAAAC,EAAAjC,EAAA,UAAA,GAAA,CAAA;AAAA,QAAA,CAAA;AAAA,QAAA,KAAA;AAAA,MAAA,IAAA;AAAA;;IAkBwC,CAAA;AAAA,IAlBxCA,EAAA,yBAAAH,EAAA,GAAAC,EAAA,OAAAoC,GAAAD,EAAAjC,EAAA,EAAA,QAAA,CAAA,GAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as E, useSlots as C, ref as i, computed as p, watch as D, withDirectives as k, createElementBlock as w, openBlock as h, createElementVNode as T, createBlock as N, createCommentVNode as V, renderSlot as _, unref as t, withCtx as u, toHandlers as y, createVNode as B, createTextVNode as I, toDisplayString as z } from "vue";
|
|
2
2
|
import { B as F } from "./popover.maCMPyz8.js";
|
|
3
3
|
import "./events.FNmSWp_P.js";
|
|
4
|
-
import { B as L } from "./tooltip.
|
|
4
|
+
import { B as L } from "./tooltip.VYPUHERk.js";
|
|
5
5
|
import { B as M } from "./typography.DN5eC5ch.js";
|
|
6
6
|
import { u as U } from "./use-has-slot.B7eQSabc.js";
|
|
7
7
|
import { B as A } from "./teleport.CfGWjxe2.js";
|
|
@@ -113,4 +113,4 @@ const H = { class: "b-dashed-underline__content" }, R = {}, Y = /* @__PURE__ */
|
|
|
113
113
|
export {
|
|
114
114
|
ee as B
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=dashed-underline.
|
|
116
|
+
//# sourceMappingURL=dashed-underline.ywc0ydgS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashed-underline.
|
|
1
|
+
{"version":3,"file":"dashed-underline.ywc0ydgS.js","sources":["../../../vue2/src/components/dashed-underline/dashed-underline.vue"],"sourcesContent":["<template>\n <span\n ref=\"element\"\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n class=\"b-dashed-underline\"\n tabindex=\"0\"\n @mouseenter=\"openPopover\"\n @mouseleave=\"closePopover\"\n @focus=\"dashedUnderlineOnFocus\"\n @focusout=\"dashedUnderlineOnFocusOut\"\n >\n <span class=\"b-dashed-underline__content\">\n <slot></slot>\n </span>\n <bento-teleport v-if=\"element && hasPopover\" :disabled=\"teleport?.disabled\" :to=\"teleport?.to\">\n <span v-on=\"computedPopoverContainerEvents\">\n <bento-popover\n :open=\"isOpen\"\n :target-element=\"element\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n :fit-content=\"popoverSize === 'fit-content' || undefined\"\n :large=\"popoverSize === 'large' || undefined\"\n :small=\"popoverSize === 'small' || undefined\"\n :title=\"popoverTitle\"\n disable-focus-trap\n >\n <slot name=\"popover-content\">\n <bento-typography>\n {{ popoverText }}\n </bento-typography>\n </slot>\n </bento-popover>\n </span>\n </bento-teleport>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useSlots, watch } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives/tooltip/index';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { BentoTeleport } from '@/internal';\n import { BentoDashedUnderlineProps } from './dashed-underline.types';\n\n const CLOSING_POPOVER_DELAY_MS = 200;\n\n const props = withDefaults(defineProps<BentoDashedUnderlineProps>(), {\n popoverText: null,\n popoverTitle: null,\n popoverPosition: 'top',\n popoverSize: 'fit-content',\n teleport: () => ({\n disabled: true,\n }),\n tooltipText: null,\n tooltipPosition: 'top',\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const element = ref<HTMLSpanElement>(null);\n const isOpen = ref(false);\n\n const closingTimeOutId = ref();\n\n const openPopover = () => {\n isOpen.value = true;\n if (closingTimeOutId.value) {\n clearTimeout(closingTimeOutId.value);\n }\n };\n\n const closePopover = () => {\n // We want to delay closing for a couple of seconds so\n // it doesn't flicker if a user hovers over the icon and then inside the popover.\n const timeOutId = setTimeout(() => {\n isOpen.value = false;\n }, CLOSING_POPOVER_DELAY_MS);\n closingTimeOutId.value = timeOutId;\n };\n\n const dashedUnderlineOnFocus = () => {\n openPopover();\n };\n\n /**\n * Only close popover on blur if the newly focus element is not a child of this element\n * @param e - the event that contains the newly focused element\n */\n const dashedUnderlineOnFocusOut = (e: FocusEvent) => {\n if (!element.value || !(e?.relatedTarget instanceof Element) || !element.value.contains(e.relatedTarget)) {\n closePopover();\n }\n };\n\n const hasPopover = computed(() => props.popoverText || hasSlot('popover-content'));\n\n const shouldShowTooltipPopoverError = computed(() => !props.tooltipText && !hasPopover.value);\n\n watch(\n shouldShowTooltipPopoverError,\n value => {\n if (value) {\n throw new Error(\n 'BentoDashedUnderline requires either a tooltip or a popover to be configured. Check the docs for more info.'\n );\n }\n },\n { immediate: true }\n );\n\n /**\n * When the popover is teleported, it is no longer a DOM descendant of the trigger element.\n * We add these event listeners to the popover's container to keep the popover open when\n * the user moves their mouse or focuses out from the trigger to the popover BUT then mouses over\n * or focuses on the popover content.\n */\n const computedPopoverContainerEvents = computed(() =>\n props.teleport?.disabled === false\n ? {\n mouseenter: openPopover,\n mouseleave: closePopover,\n focus: dashedUnderlineOnFocus,\n focusout: dashedUnderlineOnFocusOut,\n }\n : {}\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Provides a dashed underline to text, indicating that more information is available on\n * hover or focus. The additional information is displayed in a tooltip or a popover.\n *\n * @example\n * import { BentoDashedUnderline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashedUnderline },\n * template: `\n * <p>\n * This is some <bento-dashed-underline tooltip-text=\"A short explanation\">annotated text</bento-dashed-underline>.\n * </p>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashed-underline.scss\" />\n"],"names":["__default__","props","__props","slots","useSlots","hasSlot","useHasSlot","element","ref","isOpen","closingTimeOutId","openPopover","closePopover","timeOutId","dashedUnderlineOnFocus","dashedUnderlineOnFocusOut","hasPopover","computed","shouldShowTooltipPopoverError","watch","value","computedPopoverContainerEvents","_a"],"mappings":";;;;;;;;;oDAsJIA,IAAA,CAAA;;;;;;;;;;;;;;;AArGA,UAAAC,IAAAC,GAYAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GAEAE,IAAAF,EAAA,GAEAG,IAAA,MAAA;AACI,MAAAF,EAAA,QAAA,IACAC,EAAA,SACI,aAAAA,EAAA,KAAA;AAAA,IACJ,GAGJE,IAAA,MAAA;AAGI,YAAAC,IAAA,WAAA,MAAA;AACI,QAAAJ,EAAA,QAAA;AAAA,MAAe,GAAA,GAAA;AAEnB,MAAAC,EAAA,QAAAG;AAAA,IAAyB,GAG7BC,IAAA,MAAA;AACI,MAAAH,EAAA;AAAA,IAAY,GAOhBI,IAAA,CAAA,MAAA;AACI,OAAA,CAAAR,EAAA,SAAA,GAAA,uBAAA,0BAAA,YAAA,CAAAA,EAAA,MAAA,SAAA,EAAA,aAAA,MACIK,EAAA;AAAA,IACJ,GAGJI,IAAAC,EAAA,MAAAhB,EAAA,eAAAI,EAAA,iBAAA,CAAA,GAEAa,IAAAD,EAAA,MAAA,CAAAhB,EAAA,eAAA,CAAAe,EAAA,KAAA;AAEA,IAAAG;AAAA,MAAAD;AAAA,MACI,CAAAE,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAStB,UAAAC,IAAAJ;AAAA,MAAuC,MAAA;;AAAA,iBAAAK,IAAArB,EAAA,aAAA,gBAAAqB,EAAA,cAAA,KAAA;AAAA,UAE7B,YA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