@adyen/bento-vue3 1.4.1 → 1.5.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/@types/components.d.ts +4 -0
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-lazy-load/data-grid-lazy-load.vue.d.ts +17 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnHeadersTopPosition/useCalculateColumnHeadersTopPosition.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useLazyLoading/useLazyLoading.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +28 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +455 -123
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/components/all-filters-modal-button/all-filters-modal-button.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +5 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/filter-bar-button/filter-bar-button.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/form-layout-group.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-group/form-layout-group.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/image/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue.d.ts +24 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +14 -3
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.types.d.ts +1 -9
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.utils.d.ts +5 -21
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +122 -72
- package/dist/@types/packages/vue2/src/components/segmented-control/segmented-control.vue.d.ts +3 -2
- package/dist/@types/packages/vue2/src/components/stepper/components/step/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/stepper/components/step/step.vue.d.ts +35 -0
- package/dist/@types/packages/vue2/src/components/stepper/composables/useKeyboardNavigation/useKeyboardNavigation.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/stepper/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/stepper/stepper.keys.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/stepper/stepper.types.d.ts +24 -0
- package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +44 -0
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +363 -82
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/types/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/types/lazy-load.d.ts +1 -0
- package/dist/accordion.js +3 -3
- package/dist/alert.js +4 -4
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +4 -4
- package/dist/checkbox.js +6 -6
- package/dist/chunks/base-button.9740f320.js +116 -0
- package/dist/chunks/base-button.9740f320.js.map +1 -0
- package/dist/chunks/base-modal.be77971f.js +296 -0
- package/dist/chunks/base-modal.be77971f.js.map +1 -0
- package/dist/chunks/{button.7d09c245.js → button.7072457f.js} +3 -3
- package/dist/chunks/{button.7d09c245.js.map → button.7072457f.js.map} +1 -1
- package/dist/chunks/{calendar.0e42130b.js → calendar.1e50c7d1.js} +5 -5
- package/dist/chunks/{calendar.0e42130b.js.map → calendar.1e50c7d1.js.map} +1 -1
- package/dist/chunks/{checkbox.17462cb0.js → checkbox.638bab98.js} +24 -24
- package/dist/chunks/{checkbox.17462cb0.js.map → checkbox.638bab98.js.map} +1 -1
- package/dist/chunks/{chevron-up.c03b58f8.js → chevron-up.9bf21068.js} +3 -3
- package/dist/chunks/{chevron-up.c03b58f8.js.map → chevron-up.9bf21068.js.map} +1 -1
- package/dist/chunks/{controls-group.0d6db9c0.js → controls-group.efcf4e8d.js} +2 -2
- package/dist/chunks/{controls-group.0d6db9c0.js.map → controls-group.efcf4e8d.js.map} +1 -1
- package/dist/chunks/{copy.c9a29be0.js → copy.527c3d76.js} +3 -3
- package/dist/chunks/{copy.c9a29be0.js.map → copy.527c3d76.js.map} +1 -1
- package/dist/chunks/debounce.b5ef6acf.js +10 -0
- package/dist/chunks/debounce.b5ef6acf.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.cd789a95.js → dropdown-default-textbox.a1789dc7.js} +19 -18
- package/dist/chunks/{dropdown-default-textbox.cd789a95.js.map → dropdown-default-textbox.a1789dc7.js.map} +1 -1
- package/dist/chunks/{dropdown.ff4f94a8.js → dropdown.22e51667.js} +9 -7
- package/dist/chunks/dropdown.22e51667.js.map +1 -0
- package/dist/chunks/{error-message.8c67a507.js → error-message.37b6c7aa.js} +2 -2
- package/dist/chunks/{error-message.8c67a507.js.map → error-message.37b6c7aa.js.map} +1 -1
- package/dist/chunks/{footer-actions.a587e374.js → footer-actions.5275203a.js} +3 -3
- package/dist/chunks/{footer-actions.a587e374.js.map → footer-actions.5275203a.js.map} +1 -1
- package/dist/chunks/{grid-layout.984317d7.js → grid-layout.c98e6bc7.js} +2 -2
- package/dist/chunks/{grid-layout.984317d7.js.map → grid-layout.c98e6bc7.js.map} +1 -1
- package/dist/chunks/{index.77c651df.js → index.32ed68b7.js} +2 -2
- package/dist/chunks/{index.77c651df.js.map → index.32ed68b7.js.map} +1 -1
- package/dist/chunks/{index.fdb0c13d.js → index.604da8e9.js} +3 -3
- package/dist/chunks/{index.fdb0c13d.js.map → index.604da8e9.js.map} +1 -1
- package/dist/chunks/{index.fd1cd23a.js → index.a57930ba.js} +197 -188
- package/dist/chunks/index.a57930ba.js.map +1 -0
- package/dist/chunks/{index.ee69b530.js → index.c22c4278.js} +6 -6
- package/dist/chunks/{index.ee69b530.js.map → index.c22c4278.js.map} +1 -1
- package/dist/chunks/{index.140bf28f.js → index.c62ea69f.js} +2 -2
- package/dist/chunks/{index.140bf28f.js.map → index.c62ea69f.js.map} +1 -1
- package/dist/chunks/{index.450b70d5.js → index.dd20095f.js} +3 -3
- package/dist/chunks/{index.450b70d5.js.map → index.dd20095f.js.map} +1 -1
- package/dist/chunks/{debounce.f8d92e44.js → keyboard-navigation.ca47dfa8.js} +11 -17
- package/dist/chunks/keyboard-navigation.ca47dfa8.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.ffe70226.js → listbox-option-tag.fa70334e.js} +3 -3
- package/dist/chunks/{listbox-option-tag.ffe70226.js.map → listbox-option-tag.fa70334e.js.map} +1 -1
- package/dist/chunks/{listbox.f535a736.js → listbox.4205c0de.js} +12 -11
- package/dist/chunks/{listbox.f535a736.js.map → listbox.4205c0de.js.map} +1 -1
- package/dist/chunks/{loading-button.bc6e3967.js → loading-button.41c15584.js} +2 -2
- package/dist/chunks/{loading-button.bc6e3967.js.map → loading-button.41c15584.js.map} +1 -1
- package/dist/chunks/{tooltip.973c86d3.js → tooltip.c8350cd0.js} +37 -36
- package/dist/chunks/{tooltip.973c86d3.js.map → tooltip.c8350cd0.js.map} +1 -1
- package/dist/chunks/use-has-slot.3daaffc6.js +17 -0
- package/dist/chunks/use-has-slot.3daaffc6.js.map +1 -0
- package/dist/code-snippet.js +469 -466
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +963 -834
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +8 -8
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +21 -21
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +853 -784
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +72 -51
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +190 -112
- package/dist/header.js.map +1 -1
- package/dist/image.js +3 -1
- package/dist/index.js +219 -211
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +2 -2
- package/dist/input-field.js +5 -5
- package/dist/internal.js +7 -7
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +114 -104
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +33 -30
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +72 -61
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +1238 -192
- package/dist/popper-container.js.map +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/search-bar.js +3 -3
- package/dist/segmented-control.js +15 -15
- package/dist/segmented-control.js.map +1 -1
- package/dist/sidepanel.js +7 -7
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +276 -0
- package/dist/stepper.js.map +1 -0
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +5 -5
- package/dist/tabs.js +2 -2
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +5 -5
- package/dist/toast.js +4 -4
- package/dist/toggle.js +12 -12
- package/dist/toggle.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/chunks/base-button.c4ac1ad1.js +0 -108
- package/dist/chunks/base-button.c4ac1ad1.js.map +0 -1
- package/dist/chunks/base-modal.db7a9829.js +0 -291
- package/dist/chunks/base-modal.db7a9829.js.map +0 -1
- package/dist/chunks/debounce.f8d92e44.js.map +0 -1
- package/dist/chunks/dropdown.ff4f94a8.js.map +0 -1
- package/dist/chunks/index.fd1cd23a.js.map +0 -1
- package/dist/chunks/use-has-slot.9fac7123.js +0 -16
- package/dist/chunks/use-has-slot.9fac7123.js.map +0 -1
package/dist/sidepanel.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as K, ref as u, inject as V, onUnmounted as W, computed as r, watch as N, openBlock as h, createBlock as U, Transition as X, unref as s, withCtx as f, withDirectives as Z, createElementVNode as S, normalizeClass as B, createVNode as d, createCommentVNode as x, createTextVNode as ee, toDisplayString as ae, renderSlot as F, createElementBlock as H, vShow as te, nextTick as R, toRefs as se, provide as G, withKeys as le } from "vue";
|
|
2
|
-
import { a as j } from "./chunks/button.
|
|
3
|
-
import { B as $ } from "./chunks/index.
|
|
4
|
-
import { F as ne } from "./chunks/footer-actions.
|
|
2
|
+
import { a as j } from "./chunks/button.7072457f.js";
|
|
3
|
+
import { B as $ } from "./chunks/index.32ed68b7.js";
|
|
4
|
+
import { F as ne } from "./chunks/footer-actions.5275203a.js";
|
|
5
5
|
import { A as oe } from "./chunks/arrow-left.cdbcc128.js";
|
|
6
6
|
import { u as J } from "./chunks/i18n.6c402773.js";
|
|
7
7
|
import { _ as Y } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
8
|
-
import { B as ie } from "./chunks/index.
|
|
8
|
+
import { B as ie } from "./chunks/index.604da8e9.js";
|
|
9
9
|
import { C as ue } from "./chunks/cross.5c36a670.js";
|
|
10
|
-
import "./assets/
|
|
10
|
+
import "./assets/index10.css";
|
|
11
11
|
var b = /* @__PURE__ */ ((a) => (a.UPDATE_ACTIVE_PAGE = "update:active-page", a.UPDATE_IS_OPEN = "update:is-open", a))(b || {}), P = /* @__PURE__ */ ((a) => (a.TRANSITION_LEVEL_DEEPER = "b-sidepanel-page__animation--level-deeper", a.TRANSITION_LEVEL_UPPER = "b-sidepanel-page__animation--level-upper", a))(P || {});
|
|
12
12
|
const z = Symbol("sidepanel registerPage injection key"), M = Symbol("sidepanel config data injection key"), q = {
|
|
13
13
|
"en-US": {
|
|
@@ -215,7 +215,7 @@ const Se = /* @__PURE__ */ Y(de, [["__scopeId", "data-v-364351c8"]]), Q = {
|
|
|
215
215
|
{ immediate: !0 }
|
|
216
216
|
);
|
|
217
217
|
const O = r(() => ({
|
|
218
|
-
"b-
|
|
218
|
+
"b-sidepanel--hide": _.value
|
|
219
219
|
})), k = (e) => {
|
|
220
220
|
_.value && e.pseudoElement === "::backdrop" && (i.value.close(), l.value[0] && o(b.UPDATE_ACTIVE_PAGE, l.value[0]), l.value = [], _.value = !1, o(b.UPDATE_IS_OPEN, !1));
|
|
221
221
|
}, g = (e) => {
|
|
@@ -270,7 +270,7 @@ const Se = /* @__PURE__ */ Y(de, [["__scopeId", "data-v-364351c8"]]), Q = {
|
|
|
270
270
|
], 42, ve));
|
|
271
271
|
}
|
|
272
272
|
});
|
|
273
|
-
const be = /* @__PURE__ */ Y(ge, [["__scopeId", "data-v-
|
|
273
|
+
const be = /* @__PURE__ */ Y(ge, [["__scopeId", "data-v-ab46acaa"]]);
|
|
274
274
|
export {
|
|
275
275
|
be as BentoSidepanel,
|
|
276
276
|
P as BentoSidepanelAnimation,
|
package/dist/sidepanel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.js","sources":["../../vue2/src/components/sidepanel/sidepanel.types.ts","../../vue2/src/components/sidepanel/sidepanel.keys.ts","../../vue2/src/components/sidepanel/components/sidepanel-page.vue","../../vue2/src/components/sidepanel/sidepanel.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nexport interface BentoSidepanelPageObject {\n title: string;\n pageId: string;\n}\n\nexport enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n\nexport enum BentoSidepanelAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-sidepanel-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-sidepanel-page__animation--level-upper',\n}\n\nexport interface BentoSidepanelConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n goToPreviousPage: (page: string) => void;\n hasPreviousPages: Ref<boolean>;\n isOpen: Ref<boolean>;\n}\n\nexport type BentoSidepanelRegisterPage = (props: BentoSidepanelPageObject) => { unregisterPage: () => void };\n","export const SIDEPANEL_REGISTER_PAGE_INJECTION_KEY = Symbol('sidepanel registerPage injection key');\nexport const SIDEPANEL_CONFIG_INJECTION_KEY = Symbol('sidepanel config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\">\n <div v-show=\"showPage\" class=\"b-sidepanel-page\">\n <div class=\"b-sidepanel-page__header\" :class=\"headerConditionalClasses\">\n <bento-button v-if=\"showBackButton\" variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n <div ref=\"contentElement\" class=\"b-sidepanel-page__content\" @scroll=\"onScroll\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n <div v-if=\"actions\" class=\"b-sidepanel-page__actions\" :class=\"actionsConditionalClasses\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onUnmounted, PropType, ref, watch } from 'vue';\n\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { BentoSidepanelAnimation, BentoSidepanelConfigData, BentoSidepanelRegisterPage } from '../sidepanel.types';\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from '../sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isScrollAtTop = ref(true);\n const isScrollAtBottom = ref(false);\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoSidepanelRegisterPage>(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage({ title: props.title, pageId: props.pageId });\n\n // Unregister page on unmounting the page\n onUnmounted(() => unregisterPage());\n\n const { activePage, animation, goToPreviousPage, hasPreviousPages, isOpen } =\n inject<BentoSidepanelConfigData>(SIDEPANEL_CONFIG_INJECTION_KEY);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-sidepanel-page__header--with-border': hasScroll.value && !isScrollAtTop.value,\n }));\n\n const actionsConditionalClasses = computed(() => ({\n 'b-sidepanel-page__actions--with-border': hasScroll.value && !isScrollAtBottom.value,\n }));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n isScrollAtTop.value = contentElement.value.scrollTop === 0;\n isScrollAtBottom.value =\n contentElement.value.scrollHeight - contentElement.value.clientHeight === contentElement.value.scrollTop;\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Animation\n const updateAnimation = () => {\n if (animation.value === BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER) {\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @click=\"isDismissible && closeSidepanelOnClickOutside($event)\"\n @keydown.esc=\"startCloseSidepanelAnimation\"\n >\n <bento-focus-trap>\n <div class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import {\n BentoSidepanelAnimation,\n BentoSidepanelEvent,\n BentoSidepanelPageObject,\n BentoSidepanelRegisterPage,\n } from './sidepanel.types';\n\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from './sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<BentoSidepanelPageObject[]>([]);\n const previousPages = ref([]);\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const animation = ref(BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n\n // Previous page/back button logic\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page.pageId === activePage.value));\n\n const goToPreviousPage = (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER;\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n\n if (!!activePage.value && !isActivePageValid.value) {\n // eslint-disable-next-line no-console\n console.error(`The activePage passed \"${activePage.value}\" does not match the id of any SidepanelPage`);\n return;\n }\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel__hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = (event: AnimationEvent) => {\n if (isClosing.value && event.pseudoElement === '::backdrop') {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeSidepanelOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === 'DIALOG') {\n startCloseSidepanelAnimation();\n }\n };\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n () => isOpen.value,\n async () => {\n // Wait for sidepanel ref to be created\n await nextTick();\n\n if (!sidepanel.value) {\n return;\n }\n\n if (isOpen.value) {\n sidepanel.value.showModal();\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (sidepanel.value.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true }\n );\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(({ pageId }) => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoSidepanelRegisterPage = ({ title, pageId }) => {\n pages.value.push({ title, pageId });\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(SIDEPANEL_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n goToPreviousPage,\n hasPreviousPages,\n isOpen,\n });\n provide(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["BentoSidepanelEvent","BentoSidepanelEvent2","BentoSidepanelAnimation","BentoSidepanelAnimation2","SIDEPANEL_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_CONFIG_INJECTION_KEY","__default__$1","messages$1","t","useI18n","contentElement","ref","hasScroll","isScrollAtTop","isScrollAtBottom","registerPage","inject","unregisterPage","props","onUnmounted","activePage","animation","goToPreviousPage","hasPreviousPages","isOpen","showPage","computed","showBackButton","headerConditionalClasses","actionsConditionalClasses","onScroll","calculateScroll","watchedValue","nextTick","watch","updateAnimation","__default__","messages","toRefs","sidepanel","pages","previousPages","isClosing","lastPage","isActivePageValid","page","index","emit","conditionalClasses","closeSidepanelAfterAnimation","event","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","target","pageIdToRemove","_a","pageId","title","provide"],"mappings":";;;;;;;;;;AAOY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,qBAAA,sBACAA,EAAA,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AA,KACJmB,EAAA,MAAA,QAEAY,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAlC,IAAA,CAAAqC,MAAA,MAAA;;AACI,MAAAd,EAAA,SAAAe,IAAAf,EAAA,UAAA,gBAAAe,EAAA,OAAA,CAAA,EAAA,QAAAC,EAAA,MAAAA,MAAAF;AAAA,IAA2E,GAI/EvC,IAAA,CAAA,EAAA,OAAA0C,GAAA,QAAAD,EAAA,OACIhB,EAAA,MAAA,KAAA,EAAA,OAAAiB,GAAA,QAAAD,EAAA,CAAA,GAEA,EAAA,gBAAAvC,EAAAuC,CAAA,EAAA;AAGJ,WAAAE,EAAArD,GAAA;AAAA,MAAwC,YAAAe;AAAA,MACpC,WAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,QAAAC;AAAA,IACA,CAAA,GAEJkC,EAAAtD,GAAAW,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sidepanel.js","sources":["../../vue2/src/components/sidepanel/sidepanel.types.ts","../../vue2/src/components/sidepanel/sidepanel.keys.ts","../../vue2/src/components/sidepanel/components/sidepanel-page.vue","../../vue2/src/components/sidepanel/sidepanel.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nexport interface BentoSidepanelPageObject {\n title: string;\n pageId: string;\n}\n\nexport enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n\nexport enum BentoSidepanelAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-sidepanel-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-sidepanel-page__animation--level-upper',\n}\n\nexport interface BentoSidepanelConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n goToPreviousPage: (page: string) => void;\n hasPreviousPages: Ref<boolean>;\n isOpen: Ref<boolean>;\n}\n\nexport type BentoSidepanelRegisterPage = (props: BentoSidepanelPageObject) => { unregisterPage: () => void };\n","export const SIDEPANEL_REGISTER_PAGE_INJECTION_KEY = Symbol('sidepanel registerPage injection key');\nexport const SIDEPANEL_CONFIG_INJECTION_KEY = Symbol('sidepanel config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\">\n <div v-show=\"showPage\" class=\"b-sidepanel-page\">\n <div class=\"b-sidepanel-page__header\" :class=\"headerConditionalClasses\">\n <bento-button v-if=\"showBackButton\" variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n <div ref=\"contentElement\" class=\"b-sidepanel-page__content\" @scroll=\"onScroll\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n <div v-if=\"actions\" class=\"b-sidepanel-page__actions\" :class=\"actionsConditionalClasses\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onUnmounted, PropType, ref, watch } from 'vue';\n\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { BentoSidepanelAnimation, BentoSidepanelConfigData, BentoSidepanelRegisterPage } from '../sidepanel.types';\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from '../sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isScrollAtTop = ref(true);\n const isScrollAtBottom = ref(false);\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoSidepanelRegisterPage>(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage({ title: props.title, pageId: props.pageId });\n\n // Unregister page on unmounting the page\n onUnmounted(() => unregisterPage());\n\n const { activePage, animation, goToPreviousPage, hasPreviousPages, isOpen } =\n inject<BentoSidepanelConfigData>(SIDEPANEL_CONFIG_INJECTION_KEY);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-sidepanel-page__header--with-border': hasScroll.value && !isScrollAtTop.value,\n }));\n\n const actionsConditionalClasses = computed(() => ({\n 'b-sidepanel-page__actions--with-border': hasScroll.value && !isScrollAtBottom.value,\n }));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n isScrollAtTop.value = contentElement.value.scrollTop === 0;\n isScrollAtBottom.value =\n contentElement.value.scrollHeight - contentElement.value.clientHeight === contentElement.value.scrollTop;\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Animation\n const updateAnimation = () => {\n if (animation.value === BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER) {\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @click=\"isDismissible && closeSidepanelOnClickOutside($event)\"\n @keydown.esc=\"startCloseSidepanelAnimation\"\n >\n <bento-focus-trap>\n <div class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import {\n BentoSidepanelAnimation,\n BentoSidepanelEvent,\n BentoSidepanelPageObject,\n BentoSidepanelRegisterPage,\n } from './sidepanel.types';\n\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from './sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<BentoSidepanelPageObject[]>([]);\n const previousPages = ref([]);\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const animation = ref(BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n\n // Previous page/back button logic\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page.pageId === activePage.value));\n\n const goToPreviousPage = (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER;\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n\n if (!!activePage.value && !isActivePageValid.value) {\n // eslint-disable-next-line no-console\n console.error(`The activePage passed \"${activePage.value}\" does not match the id of any SidepanelPage`);\n return;\n }\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = (event: AnimationEvent) => {\n if (isClosing.value && event.pseudoElement === '::backdrop') {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeSidepanelOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === 'DIALOG') {\n startCloseSidepanelAnimation();\n }\n };\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n () => isOpen.value,\n async () => {\n // Wait for sidepanel ref to be created\n await nextTick();\n\n if (!sidepanel.value) {\n return;\n }\n\n if (isOpen.value) {\n sidepanel.value.showModal();\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (sidepanel.value.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true }\n );\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(({ pageId }) => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoSidepanelRegisterPage = ({ title, pageId }) => {\n pages.value.push({ title, pageId });\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(SIDEPANEL_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n goToPreviousPage,\n hasPreviousPages,\n isOpen,\n });\n provide(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["BentoSidepanelEvent","BentoSidepanelEvent2","BentoSidepanelAnimation","BentoSidepanelAnimation2","SIDEPANEL_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_CONFIG_INJECTION_KEY","__default__$1","messages$1","t","useI18n","contentElement","ref","hasScroll","isScrollAtTop","isScrollAtBottom","registerPage","inject","unregisterPage","props","onUnmounted","activePage","animation","goToPreviousPage","hasPreviousPages","isOpen","showPage","computed","showBackButton","headerConditionalClasses","actionsConditionalClasses","onScroll","calculateScroll","watchedValue","nextTick","watch","updateAnimation","__default__","messages","toRefs","sidepanel","pages","previousPages","isClosing","lastPage","isActivePageValid","page","index","emit","conditionalClasses","closeSidepanelAfterAnimation","event","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","target","pageIdToRemove","_a","pageId","title","provide"],"mappings":";;;;;;;;;;AAOY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,0BAAA,6CACAA,EAAA,yBAAA,4CAFQA,IAAAD,KAAA,CAAA,CAAA;ACZC,MAAAE,IAAA,OAAA,sCAAA,GACAC,IAAA,OAAA,qCAAA;;;;uCCwNTC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7GA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAGAG,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAF,EAAA,EAAA,GACAG,IAAAH,EAAA,EAAA,GAGAI,IAAAC,EAAAZ,CAAA,GACA,EAAA,gBAAAa,EAAA,IAAAF,EAAA,EAAA,OAAAG,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AA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/status.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as n, computed as r, resolveComponent as a, openBlock as l, createElementBlock as c, createElementVNode as p, normalizeClass as _, createVNode as d, withCtx as i, renderSlot as u } from "vue";
|
|
2
|
-
import { B as m } from "./chunks/index.
|
|
2
|
+
import { B as m } from "./chunks/index.32ed68b7.js";
|
|
3
3
|
import { _ as b } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
4
|
-
import "./assets/
|
|
4
|
+
import "./assets/index31.css";
|
|
5
5
|
var t = /* @__PURE__ */ ((e) => (e.BLUE = "blue", e.GREEN = "green", e.GREY = "grey", e.ORANGE = "orange", e.RED = "red", e.YELLOW = "yellow", e))(t || {});
|
|
6
6
|
const y = n({
|
|
7
7
|
name: "bento-status",
|
package/dist/stepper.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { defineComponent as K, ref as i, computed as a, watch as $, provide as Z, readonly as se, openBlock as d, createElementBlock as S, withDirectives as M, mergeProps as U, unref as n, toHandlers as ne, renderSlot as w, createVNode as A, withCtx as x, createTextVNode as j, toDisplayString as P, createCommentVNode as oe, pushScopeId as ae, popScopeId as le, createElementVNode as G, useSlots as ue, inject as re, onMounted as ie, normalizeClass as pe, createBlock as z, Fragment as ce, vShow as de } from "vue";
|
|
2
|
+
import { B as V } from "./chunks/index.32ed68b7.js";
|
|
3
|
+
import { B as N, a as ve } from "./chunks/keyboard-navigation.ca47dfa8.js";
|
|
4
|
+
import { u as _e } from "./chunks/i18n.6c402773.js";
|
|
5
|
+
import { _ as H } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
|
+
import { B as be } from "./chunks/base-button.9740f320.js";
|
|
7
|
+
import { C as fe } from "./chunks/checkmark-small.3e93a119.js";
|
|
8
|
+
import "./assets/index33.css";
|
|
9
|
+
const me = (s) => {
|
|
10
|
+
function v(r) {
|
|
11
|
+
return ({ detail: u }) => {
|
|
12
|
+
var e;
|
|
13
|
+
u.preventDefault();
|
|
14
|
+
const p = s.value.indexOf(document.activeElement);
|
|
15
|
+
p < 0 || (e = s.value[p + r]) == null || e.focus();
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const l = v(-1), _ = v(1);
|
|
19
|
+
return {
|
|
20
|
+
[N.ARROW_DOWN]: _,
|
|
21
|
+
[N.ARROW_RIGHT]: _,
|
|
22
|
+
[N.ARROW_UP]: l,
|
|
23
|
+
[N.ARROW_LEFT]: l
|
|
24
|
+
};
|
|
25
|
+
}, L = Symbol("stepper state");
|
|
26
|
+
var D = /* @__PURE__ */ ((s) => (s.LINEAR = "linear", s.NON_LINEAR = "non-linear", s))(D || {}), W = /* @__PURE__ */ ((s) => (s.HORIZONTAL = "horizontal", s.VERTICAL = "vertical", s))(W || {});
|
|
27
|
+
const q = {
|
|
28
|
+
"en-US": {
|
|
29
|
+
step: "Step {currentIndex}/{totalSteps} {content}"
|
|
30
|
+
}
|
|
31
|
+
}, Se = { class: "b-stepper" }, ye = {
|
|
32
|
+
i18n: { messages: q },
|
|
33
|
+
name: "stepper"
|
|
34
|
+
}, ge = /* @__PURE__ */ K({
|
|
35
|
+
...ye,
|
|
36
|
+
props: {
|
|
37
|
+
/**
|
|
38
|
+
* Type of stepper; defines how the stepper should behave. Default: linear
|
|
39
|
+
* @values linear, non-linear
|
|
40
|
+
*/
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "linear"
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Stepper variant; defines how the stepper should be displayed. Default: vertical
|
|
47
|
+
* @values vertical, horizontal
|
|
48
|
+
*/
|
|
49
|
+
variant: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "vertical"
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Active step index
|
|
55
|
+
*/
|
|
56
|
+
index: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 0
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
emits: ["update:index"],
|
|
62
|
+
setup(s, { emit: v }) {
|
|
63
|
+
const l = s, { t: _ } = _e({ messages: q }), r = i([]), u = i(l.index), p = i(u.value), e = (t) => {
|
|
64
|
+
t > p.value && (p.value = t), u.value = t;
|
|
65
|
+
}, C = a(() => {
|
|
66
|
+
var t;
|
|
67
|
+
return (t = r.value[u.value]) == null ? void 0 : t.stepContent;
|
|
68
|
+
}), c = a(() => r.value.length), R = a(() => r.value.map(({ buttonElement: t }) => t)), I = a(() => l.variant === W.HORIZONTAL), b = a(
|
|
69
|
+
() => r.value.map(({ buttonElement: t, substeps: f }, m) => {
|
|
70
|
+
const T = u.value === m;
|
|
71
|
+
return !I.value && T ? [t].concat(f.map((g) => g.buttonElement)) : [t];
|
|
72
|
+
}).flat()
|
|
73
|
+
), y = (t) => {
|
|
74
|
+
r.value.push({
|
|
75
|
+
stepContent: t.stepContent,
|
|
76
|
+
buttonElement: t.buttonElement,
|
|
77
|
+
substeps: t.substeps
|
|
78
|
+
});
|
|
79
|
+
}, h = i({
|
|
80
|
+
activeStepIndex: u,
|
|
81
|
+
latestActiveStep: p,
|
|
82
|
+
steps: R,
|
|
83
|
+
type: l.type,
|
|
84
|
+
variant: l.variant,
|
|
85
|
+
navigateToStep: e,
|
|
86
|
+
registerStep: y
|
|
87
|
+
}), B = a(() => ({
|
|
88
|
+
"b-stepper__list--horizontal": I.value
|
|
89
|
+
}));
|
|
90
|
+
$(() => l.index, e), $(u, (t) => {
|
|
91
|
+
v("update:index", t);
|
|
92
|
+
});
|
|
93
|
+
const O = me(b);
|
|
94
|
+
return Z(L, se(h)), (t, f) => (d(), S("nav", Se, [
|
|
95
|
+
M((d(), S("ol", U({
|
|
96
|
+
class: ["b-stepper__list", n(B)]
|
|
97
|
+
}, ne(n(O), !0)), [
|
|
98
|
+
w(t.$slots, "default", {}, void 0, !0)
|
|
99
|
+
], 16)), [
|
|
100
|
+
[n(ve)]
|
|
101
|
+
]),
|
|
102
|
+
A(n(V), {
|
|
103
|
+
el: "span",
|
|
104
|
+
variant: "body",
|
|
105
|
+
stronger: "",
|
|
106
|
+
class: "b-stepper__text-stepper"
|
|
107
|
+
}, {
|
|
108
|
+
default: x(() => [
|
|
109
|
+
j(P(n(_)("step", { currentIndex: u.value + 1, totalSteps: n(c), content: n(C) })), 1)
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
})
|
|
113
|
+
]));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const De = /* @__PURE__ */ H(ge, [["__scopeId", "data-v-5197d91f"]]);
|
|
117
|
+
let F = 0;
|
|
118
|
+
const xe = {
|
|
119
|
+
beforeCreate() {
|
|
120
|
+
this.uuid = F.toString(), F += 1;
|
|
121
|
+
}
|
|
122
|
+
}, Ce = (s) => (ae("data-v-750b7c68"), s = s(), le(), s), Ie = { key: 0 }, he = /* @__PURE__ */ Ce(() => /* @__PURE__ */ G("path", {
|
|
123
|
+
fill: "#00112C",
|
|
124
|
+
"fill-rule": "evenodd",
|
|
125
|
+
d: "M8 5.25C6.48122 5.25 5.25 6.48122 5.25 8C5.25 9.51878 6.48122 10.75 8 10.75C9.51878 10.75 10.75 9.51878 10.75 8C10.75 6.48122 9.51878 5.25 8 5.25Z",
|
|
126
|
+
"clip-rule": "evenodd"
|
|
127
|
+
}, null, -1));
|
|
128
|
+
function Ee(s, v, l, _, r, u) {
|
|
129
|
+
return d(), S("svg", U({ role: "img" }, s.$attrs, {
|
|
130
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
131
|
+
width: "16",
|
|
132
|
+
height: "16",
|
|
133
|
+
fill: "none"
|
|
134
|
+
}), [
|
|
135
|
+
s.$attrs["svg-title"] ? (d(), S("title", Ie, P(s.$attrs["svg-title"]), 1)) : oe("", !0),
|
|
136
|
+
he
|
|
137
|
+
], 16);
|
|
138
|
+
}
|
|
139
|
+
const Ne = /* @__PURE__ */ H(xe, [["render", Ee], ["__scopeId", "data-v-750b7c68"]]), Ae = {
|
|
140
|
+
ref: "substepList",
|
|
141
|
+
class: "b-step__substep-list"
|
|
142
|
+
}, $e = {
|
|
143
|
+
name: "step"
|
|
144
|
+
}, Re = /* @__PURE__ */ K({
|
|
145
|
+
...$e,
|
|
146
|
+
props: {
|
|
147
|
+
/**
|
|
148
|
+
* Completed status. Used on non-linear steppers to indicate if the step is completed.
|
|
149
|
+
*/
|
|
150
|
+
completed: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: !1
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Active substep index
|
|
156
|
+
*/
|
|
157
|
+
substepIndex: {
|
|
158
|
+
type: Number,
|
|
159
|
+
default: 0
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
emits: ["update:substep-index"],
|
|
163
|
+
setup(s, { emit: v }) {
|
|
164
|
+
const l = s, _ = ue(), r = i(null), u = i(null), p = i([]), e = re(L), C = a(() => {
|
|
165
|
+
var o;
|
|
166
|
+
return (o = r.value) == null ? void 0 : o.$el;
|
|
167
|
+
}), c = a(() => e == null ? void 0 : e.value.steps.indexOf(C.value)), R = a(() => {
|
|
168
|
+
var o;
|
|
169
|
+
return (o = u.value) == null ? void 0 : o.$el.textContent;
|
|
170
|
+
}), I = a(() => p.value.map(({ buttonElement: o }) => o)), b = i(l.substepIndex), y = i(b.value), h = (o) => {
|
|
171
|
+
o > y.value && (y.value = o), b.value = o;
|
|
172
|
+
}, B = (o) => {
|
|
173
|
+
p.value.push({
|
|
174
|
+
stepContent: o.stepContent,
|
|
175
|
+
buttonElement: o.buttonElement,
|
|
176
|
+
substeps: o.substeps
|
|
177
|
+
});
|
|
178
|
+
}, O = i({
|
|
179
|
+
activeStepIndex: b,
|
|
180
|
+
latestActiveStep: y,
|
|
181
|
+
type: e.value.type,
|
|
182
|
+
variant: e.value.variant,
|
|
183
|
+
steps: I,
|
|
184
|
+
isParentStep: !0,
|
|
185
|
+
navigateToStep: h,
|
|
186
|
+
registerStep: B
|
|
187
|
+
});
|
|
188
|
+
Z(L, O), $(() => l.substepIndex, h), $(b, (o) => {
|
|
189
|
+
v("update:substep-index", o);
|
|
190
|
+
}), ie(() => {
|
|
191
|
+
if (!e)
|
|
192
|
+
throw new Error(
|
|
193
|
+
"BentoStep components should only be used inside BentoStepper or other BentoStep components."
|
|
194
|
+
);
|
|
195
|
+
e.value.registerStep({
|
|
196
|
+
buttonElement: C,
|
|
197
|
+
stepContent: R,
|
|
198
|
+
substeps: p
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
const t = a(() => e.value.isParentStep), f = i(!1), m = a(() => (e == null ? void 0 : e.value.activeStepIndex) === c.value), T = a(
|
|
202
|
+
() => m.value && e.value.variant !== W.HORIZONTAL && !t.value && _.substeps
|
|
203
|
+
), k = a(() => (e == null ? void 0 : e.value.type) === D.NON_LINEAR ? l.completed : (e == null ? void 0 : e.value.latestActiveStep) > c.value), g = a(
|
|
204
|
+
() => (e == null ? void 0 : e.value.type) === D.LINEAR && c.value > (e == null ? void 0 : e.value.latestActiveStep)
|
|
205
|
+
), J = () => {
|
|
206
|
+
g.value || e.value.navigateToStep(c.value);
|
|
207
|
+
}, Q = a(() => m.value ? "step" : "false"), X = a(() => g.value.toString()), Y = a(() => f.value || c.value === 0 && !t.value ? "0" : "-1"), ee = a(() => ({
|
|
208
|
+
"b-step--active": m.value,
|
|
209
|
+
"b-step--completed": k.value,
|
|
210
|
+
"b-step--substep": t.value
|
|
211
|
+
}));
|
|
212
|
+
return (o, E) => (d(), S("li", {
|
|
213
|
+
class: pe([n(ee), "b-step"])
|
|
214
|
+
}, [
|
|
215
|
+
A(n(be), {
|
|
216
|
+
ref_key: "buttonComponent",
|
|
217
|
+
ref: r,
|
|
218
|
+
"aria-current": n(Q),
|
|
219
|
+
"aria-disabled": n(X),
|
|
220
|
+
class: "b-step__button",
|
|
221
|
+
type: "button",
|
|
222
|
+
tabindex: n(Y),
|
|
223
|
+
disabled: n(g),
|
|
224
|
+
onClick: J,
|
|
225
|
+
onFocus: E[0] || (E[0] = (te) => f.value = !0),
|
|
226
|
+
onBlur: E[1] || (E[1] = (te) => f.value = !1)
|
|
227
|
+
}, {
|
|
228
|
+
iconLeft: x(() => [
|
|
229
|
+
A(n(V), {
|
|
230
|
+
el: "span",
|
|
231
|
+
variant: "body",
|
|
232
|
+
stronger: "",
|
|
233
|
+
class: "b-step__index",
|
|
234
|
+
"aria-hidden": "true"
|
|
235
|
+
}, {
|
|
236
|
+
default: x(() => [
|
|
237
|
+
n(k) ? (d(), z(n(fe), { key: 0 })) : n(t) ? (d(), z(n(Ne), { key: 2 })) : (d(), S(ce, { key: 1 }, [
|
|
238
|
+
j(P(n(c) + 1), 1)
|
|
239
|
+
], 64))
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
})
|
|
243
|
+
]),
|
|
244
|
+
default: x(() => [
|
|
245
|
+
A(n(V), {
|
|
246
|
+
ref_key: "stepContent",
|
|
247
|
+
ref: u,
|
|
248
|
+
el: "span",
|
|
249
|
+
variant: "body",
|
|
250
|
+
stronger: n(m),
|
|
251
|
+
class: "b-step__content"
|
|
252
|
+
}, {
|
|
253
|
+
default: x(() => [
|
|
254
|
+
w(o.$slots, "default", {}, void 0, !0)
|
|
255
|
+
]),
|
|
256
|
+
_: 3
|
|
257
|
+
}, 8, ["stronger"])
|
|
258
|
+
]),
|
|
259
|
+
_: 3
|
|
260
|
+
}, 8, ["aria-current", "aria-disabled", "tabindex", "disabled"]),
|
|
261
|
+
M(G("ul", Ae, [
|
|
262
|
+
w(o.$slots, "substeps", {}, void 0, !0)
|
|
263
|
+
], 512), [
|
|
264
|
+
[de, n(T)]
|
|
265
|
+
])
|
|
266
|
+
], 2));
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
const Pe = /* @__PURE__ */ H(Re, [["__scopeId", "data-v-8874f961"]]);
|
|
270
|
+
export {
|
|
271
|
+
Pe as BentoStep,
|
|
272
|
+
De as BentoStepper,
|
|
273
|
+
D as BentoStepperTypeOption,
|
|
274
|
+
W as BentoStepperVariantOption
|
|
275
|
+
};
|
|
276
|
+
//# sourceMappingURL=stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.js","sources":["../../vue2/src/components/stepper/composables/useKeyboardNavigation/useKeyboardNavigation.ts","../../vue2/src/components/stepper/stepper.keys.ts","../../vue2/src/components/stepper/stepper.types.ts","../../vue2/src/components/stepper/stepper.vue","../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/dot.vue","../../vue2/src/components/stepper/components/step/step.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nimport { BentoKeyboardNavigationKeyDownEvent } from '@/types';\n\n/**\n * Returns keyboard navigation's event handlers to navigate through the steps\n *\n * @param steps the list of bento-steps DOM elements to focus on the navigation\n * @returns\n */\nexport const useKeyboardNavigation = (steps: Ref<HTMLButtonElement[]>) => {\n // Returns the event handler that moves the focus on a given step offset\n function focusOnStep(indexOffset: number) {\n return ({ detail: event }) => {\n event.preventDefault();\n\n const currentIndex = steps.value.indexOf(document.activeElement as HTMLButtonElement);\n if (currentIndex < 0) {\n return;\n }\n\n steps.value[currentIndex + indexOffset]?.focus();\n };\n }\n\n const focusOnPreviousStep = focusOnStep(-1);\n const focusOnNextStep = focusOnStep(1);\n\n return {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_RIGHT]: focusOnNextStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: focusOnPreviousStep,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_LEFT]: focusOnPreviousStep,\n };\n};\n","import type { InjectionKey } from 'vue';\n\nimport type { BentoStepperState } from './stepper.types';\n\nexport const STEPPER_STATE = Symbol('stepper state') as InjectionKey<BentoStepperState>;\n","import type { ComputedRef, Ref } from 'vue';\n\nexport enum BentoStepperTypeOption {\n LINEAR = 'linear',\n NON_LINEAR = 'non-linear',\n}\n\nexport enum BentoStepperVariantOption {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoStepperStepExposeState {\n buttonElement: HTMLButtonElement | Ref<HTMLButtonElement>;\n substeps: BentoStepperStepExposeState[] | Ref<BentoStepperStepExposeState[]>;\n stepContent: string | ComputedRef<string>;\n}\n\nexport type BentoStepperState = Ref<{\n activeStepIndex: number;\n latestActiveStep: number;\n type: `${BentoStepperTypeOption}`;\n variant: `${BentoStepperVariantOption}`;\n steps: HTMLElement[];\n isParentStep?: boolean;\n navigateToStep: (index: number) => void;\n registerStep: (stepState: BentoStepperStepExposeState) => void;\n}>;\n","<template>\n <nav class=\"b-stepper\">\n <ol\n v-bento-keyboard-navigation-directive\n class=\"b-stepper__list\"\n :class=\"conditionalClasses\"\n v-on=\"keyboardNavigationListeners\"\n >\n <slot></slot>\n </ol>\n\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-stepper__text-stepper\"\n >{{\n t('step', { currentIndex: activeStepIndex + 1, totalSteps: stepsAmount, content: currentStepContent })\n }}\n </bento-typography>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n\n import { computed, PropType, provide, readonly, ref, watch } from 'vue';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import { useKeyboardNavigation } from './composables/useKeyboardNavigation/useKeyboardNavigation';\n import { useI18n } from '@/utils/ts/i18n';\n\n import { STEPPER_STATE } from './stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from './stepper.types';\n\n import messages from './messages.json';\n\n const props = defineProps({\n /**\n * Type of stepper; defines how the stepper should behave. Default: linear\n * @values linear, non-linear\n */\n type: {\n type: String as PropType<`${BentoStepperTypeOption}`>,\n default: 'linear',\n },\n /**\n * Stepper variant; defines how the stepper should be displayed. Default: vertical\n * @values vertical, horizontal\n */\n variant: {\n type: String as PropType<`${BentoStepperVariantOption}`>,\n default: 'vertical',\n },\n /**\n * Active step index\n */\n index: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when step is updated by the stepper\n */\n (e: 'update:index', index: number): void;\n }>();\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const childrenSteps = ref<BentoStepperStepExposeState[]>([]);\n const activeStepIndex = ref(props.index);\n const latestActiveStep = ref(activeStepIndex.value);\n\n const navigateToStep = (index: number) => {\n // Stores latest active step index so users can navigate backwards and forwards on linear stepper\n if (index > latestActiveStep.value) {\n latestActiveStep.value = index;\n }\n activeStepIndex.value = index;\n };\n\n const currentStepContent = computed(() => childrenSteps.value[activeStepIndex.value]?.stepContent);\n const stepsAmount = computed(() => childrenSteps.value.length);\n const childrenStepsElements = computed(() => childrenSteps.value.map(({ buttonElement }) => buttonElement));\n const isHorizontalVariant = computed(() => props.variant === BentoStepperVariantOption.HORIZONTAL);\n\n // List of all visible steps nested on the stepper, including the substeps of the children steps\n // Flattening the steps on a single list makes the keyboard navigation easier to be handled\n const allVisibleStepsElements = computed(() =>\n childrenSteps.value\n .map(({ buttonElement, substeps }, index) => {\n const isStepActive = activeStepIndex.value === index;\n const isSubstepsVisible = !isHorizontalVariant.value && isStepActive;\n\n if (!isSubstepsVisible) {\n return [buttonElement];\n }\n\n return [buttonElement].concat(substeps.map(step => step.buttonElement));\n })\n .flat()\n );\n\n // Maps BentoStep children components whenever the DOM is updated to keep track of steps indexes\n const registerStep = (stepState: BentoStepperStepExposeState) => {\n childrenSteps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepperState: BentoStepperState = ref({\n activeStepIndex,\n latestActiveStep,\n steps: childrenStepsElements,\n type: props.type,\n variant: props.variant,\n navigateToStep,\n registerStep,\n });\n\n const conditionalClasses = computed(() => ({\n 'b-stepper__list--horizontal': isHorizontalVariant.value,\n }));\n\n watch(() => props.index, navigateToStep);\n watch(activeStepIndex, index => {\n emit('update:index', index);\n });\n\n const keyboardNavigationListeners = useKeyboardNavigation(allVisibleStepsElements);\n\n // Provides stepper state to BentoStep children components\n provide(STEPPER_STATE, readonly(stepperState));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steppers break down complex processes into manageable steps to guide users through a sequential or multi-step process.\n *\n * @example\n * import { BentoStep, BentoStepper } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep, BentoStepper },\n * template: `\n * <bento-stepper :index=\"1\">\n * <bento-step>Step 1</bento-step>\n * <bento-step>Step 2</bento-step>\n * <bento-step>Step 3</bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n i18n: { messages },\n name: 'stepper',\n };\n</script>\n\n<style scoped src=\"./stepper.scss\" />\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" 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=\"#00112C\" fill-rule=\"evenodd\" d=\"M8 5.25C6.48122 5.25 5.25 6.48122 5.25 8C5.25 9.51878 6.48122 10.75 8 10.75C9.51878 10.75 10.75 9.51878 10.75 8C10.75 6.48122 9.51878 5.25 8 5.25Z\" clip-rule=\"evenodd\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\n","<template>\n <li :class=\"conditionalClasses\" class=\"b-step\">\n <base-button\n ref=\"buttonComponent\"\n :aria-current=\"ariaCurrentValue\"\n :aria-disabled=\"ariaDisabledValue\"\n class=\"b-step__button\"\n type=\"button\"\n :tabindex=\"tabIndexValue\"\n :disabled=\"isDisabled\"\n @click=\"navigateToStep\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n >\n <template #iconLeft>\n <bento-typography el=\"span\" variant=\"body\" stronger class=\"b-step__index\" aria-hidden=\"true\">\n <checkmark-small-icon v-if=\"isCompleted\" />\n <template v-else-if=\"!isSubstep\">{{ index + 1 }}</template>\n <dot-icon v-else />\n </bento-typography>\n </template>\n\n <bento-typography ref=\"stepContent\" el=\"span\" variant=\"body\" :stronger=\"isActive\" class=\"b-step__content\">\n <slot></slot>\n </bento-typography>\n </base-button>\n\n <ul v-show=\"isSubstepsVisible\" ref=\"substepList\" class=\"b-step__substep-list\">\n <slot name=\"substeps\"></slot>\n </ul>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import CheckmarkSmallIcon from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n\n import { STEPPER_STATE } from '../../stepper.keys';\n import {\n BentoStepperState,\n BentoStepperStepExposeState,\n BentoStepperTypeOption,\n BentoStepperVariantOption,\n } from '../../stepper.types';\n import { Booleanish } from '@/types';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Completed status. Used on non-linear steppers to indicate if the step is completed.\n */\n completed: {\n type: Boolean,\n default: false,\n },\n /**\n * Active substep index\n */\n substepIndex: {\n type: Number,\n default: 0,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event triggered when substep is updated by the parent step\n */\n (e: 'update:substep-index', index: number): void;\n }>();\n\n // Element refs\n const buttonComponent = ref<InstanceType<typeof BaseButton> | null>(null);\n const stepContent = ref<InstanceType<typeof BentoTypography> | null>(null);\n const substeps = ref<BentoStepperStepExposeState[]>([]);\n\n // Injects parent BentoStepper state data\n const stepper = inject(STEPPER_STATE);\n\n const buttonElement = computed(() => buttonComponent.value?.$el as HTMLButtonElement);\n const index = computed(() => stepper?.value.steps.indexOf(buttonElement.value));\n\n const stepContentValue = computed(() => stepContent.value?.$el.textContent);\n\n // Substep logic\n const substepsButtonElements = computed(() => substeps.value.map(({ buttonElement }) => buttonElement));\n\n const activeSubStepIndex = ref(props.substepIndex);\n const latestActiveSubStepIndex = ref(activeSubStepIndex.value);\n\n const navigateToSubstep = (value: number) => {\n if (value > latestActiveSubStepIndex.value) {\n latestActiveSubStepIndex.value = value;\n }\n\n activeSubStepIndex.value = value;\n };\n\n const registerSubstep = (stepState: BentoStepperStepExposeState) => {\n substeps.value.push({\n stepContent: stepState.stepContent as string,\n buttonElement: stepState.buttonElement as HTMLButtonElement,\n substeps: stepState.substeps as BentoStepperStepExposeState[],\n });\n };\n\n const stepState: BentoStepperState = ref({\n activeStepIndex: activeSubStepIndex,\n latestActiveStep: latestActiveSubStepIndex,\n type: stepper.value.type,\n variant: stepper.value.variant,\n steps: substepsButtonElements,\n isParentStep: true,\n navigateToStep: navigateToSubstep,\n registerStep: registerSubstep,\n });\n\n provide(STEPPER_STATE, stepState);\n\n watch(() => props.substepIndex, navigateToSubstep);\n watch(activeSubStepIndex, value => {\n emit('update:substep-index', value);\n });\n\n onMounted(() => {\n if (!stepper) {\n throw new Error(\n 'BentoStep components should only be used inside BentoStepper or other BentoStep components.'\n );\n }\n\n stepper.value.registerStep({\n buttonElement,\n stepContent: stepContentValue,\n substeps,\n });\n });\n\n // Step states\n const isSubstep = computed(() => stepper.value.isParentStep);\n const isFocused = ref(false);\n const isActive = computed(() => stepper?.value.activeStepIndex === index.value);\n const isSubstepsVisible = computed(\n () =>\n isActive.value &&\n stepper.value.variant !== BentoStepperVariantOption.HORIZONTAL &&\n !isSubstep.value &&\n slots.substeps\n );\n const isCompleted = computed(() => {\n if (stepper?.value.type === BentoStepperTypeOption.NON_LINEAR) {\n return props.completed;\n }\n\n return stepper?.value.latestActiveStep > index.value;\n });\n const isDisabled = computed(\n () => stepper?.value.type === BentoStepperTypeOption.LINEAR && index.value > stepper?.value.latestActiveStep\n );\n\n const navigateToStep = () => {\n if (isDisabled.value) {\n return;\n }\n\n stepper.value.navigateToStep(index.value);\n };\n\n // Styling and a11y\n const ariaCurrentValue = computed(() => (isActive.value ? 'step' : ('false' as Booleanish)));\n const ariaDisabledValue = computed(() => isDisabled.value.toString() as Booleanish);\n const tabIndexValue = computed(() => (isFocused.value || (index.value === 0 && !isSubstep.value) ? '0' : '-1'));\n\n const conditionalClasses = computed(() => ({\n 'b-step--active': isActive.value,\n 'b-step--completed': isCompleted.value,\n 'b-step--substep': isSubstep.value,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Steps are components placed inside BentoSteppers to break down complex processes\n *\n * @example\n * import { BentoStep } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStep },\n * template: `\n * <bento-stepper>\n * <bento-step>Step 1</bento-step>\n * <bento-step>\n * Step 2\n * <template #substeps>\n * <bento-step>Substep 1</bento-step>\n * <bento-step>Substep 2</bento-step>\n * </template>\n * </bento-step>\n * </bento-stepper>\n * `\n * }\n */\n\n export default {\n name: 'step',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./step.scss\" />\n"],"names":["useKeyboardNavigation","steps","focusOnStep","indexOffset","event","currentIndex","_a","focusOnPreviousStep","focusOnNextStep","BentoKeyboardNavigationKeyDownEvent","STEPPER_STATE","BentoStepperTypeOption","BentoStepperTypeOption2","BentoStepperVariantOption","BentoStepperVariantOption2","__default__$1","messages","t","useI18n","childrenSteps","ref","activeStepIndex","props","latestActiveStep","navigateToStep","index","currentStepContent","computed","stepsAmount","childrenStepsElements","buttonElement","isHorizontalVariant","allVisibleStepsElements","substeps","isStepActive","step","registerStep","stepState","stepperState","conditionalClasses","watch","emit","keyboardNavigationListeners","provide","readonly","uuid","openBlock","createElementBlock","mergeProps","_ctx","_hoisted_1$1","toDisplayString","__default__","slots","useSlots","buttonComponent","stepContent","stepper","inject","stepContentValue","substepsButtonElements","buttonElement2","activeSubStepIndex","latestActiveSubStepIndex","navigateToSubstep","value","registerSubstep","stepState2","onMounted","isSubstep","isFocused","isActive","isSubstepsVisible","isCompleted","isDisabled","ariaCurrentValue","ariaDisabledValue","tabIndexValue"],"mappings":";;;;;;;;AAUa,MAAAA,KAAA,CAAAC,MAAA;AAET,WAAAC,EAAAC,GAAA;AACI,WAAA,CAAA,EAAA,QAAAC,EAAA,MAAA;;AACI,MAAAA,EAAA,eAAA;AAEA,YAAAC,IAAAJ,EAAA,MAAA,QAAA,SAAA,aAAA;AACA,MAAAI,IAAA,MAIAC,IAAAL,EAAA,MAAAI,IAAAF,CAAA,MAAA,QAAAG,EAAA;AAAA,IAA+C;AAAA,EACnD;AAGJ,QAAAC,IAAAL,EAAA,EAAA,GACAM,IAAAN,EAAA,CAAA;AAEA,SAAA;AAAA,IAAO,CAAAO,EAAA,UAAA,GAAAD;AAAA,IAC+C,CAAAC,EAAA,WAAA,GAAAD;AAAA,IACC,CAAAC,EAAA,QAAA,GAAAF;AAAA,IACH,CAAAE,EAAA,UAAA,GAAAF;AAAA,EACE;AAE1D,GC9BaG,IAAA,OAAA,eAAA;ACFD,IAAAC,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,aAAA,cAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;gCC0JRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5FA,EAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,EAAA,CAAA,CAAA,GACAC,IAAAD,EAAAE,EAAA,KAAA,GACAC,IAAAH,EAAAC,EAAA,KAAA,GAEAG,IAAA,CAAAC,MAAA;AAEI,MAAAA,IAAAF,EAAA,UACIA,EA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A,UAAA9C,EAAA,UAAAc,EAAA,SAAAgC,KAAA,gBAAAA,EAAA,MAAA;AAAA,IAC6E,GAGhGjC,IAAA,MAAA;AACI,MAAAkD,EAAA,SAIAjB,EAAA,MAAA,eAAAhC,EAAA,KAAA;AAAA,IAAwC,GAI5CkD,IAAAhD,EAAA,MAAA4C,EAAA,QAAA,SAAA,OAAA,GACAK,IAAAjD,EAAA,MAAA+C,EAAA,MAAA,SAAA,CAAA,GACAG,IAAAlD,EAAA,MAAA2C,EAAA,SAAA7C,EAAA,UAAA,KAAA,CAAA4C,EAAA,QAAA,MAAA,IAAA,GAEA9B,KAAAZ,EAAA,OAAA;AAAA,MAA2C,kBAAA4C,EAAA;AAAA,MACZ,qBAAAE,EAAA;AAAA,MACM,mBAAAJ,EAAA;AAAA,IACJ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[4]}
|
package/dist/structured-list.js
CHANGED
package/dist/summary-grid.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as S, resolveComponent as p, openBlock as i, createElementBlock as E, Fragment as N, renderList as j, createBlock as m, createSlots as O, withCtx as r, renderSlot as y, toRefs as w, computed as v, normalizeStyle as R, createElementVNode as h, createVNode as M, createTextVNode as _, toDisplayString as f, createCommentVNode as $, mergeProps as z } from "vue";
|
|
2
|
-
import { u as k } from "./chunks/use-has-slot.
|
|
3
|
-
import { G as q } from "./chunks/grid-layout.
|
|
2
|
+
import { u as k } from "./chunks/use-has-slot.3daaffc6.js";
|
|
3
|
+
import { G as q } from "./chunks/grid-layout.c98e6bc7.js";
|
|
4
4
|
import { _ as b } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import { BentoInfoIcon as U } from "./info-icon.js";
|
|
6
|
-
import { B as X, a as V } from "./chunks/index.
|
|
6
|
+
import { B as X, a as V } from "./chunks/index.32ed68b7.js";
|
|
7
7
|
import { BentoTag as W, BentoTagVariant as L } from "./tag.js";
|
|
8
|
-
import { C as F } from "./chunks/copy.
|
|
9
|
-
import "./assets/
|
|
8
|
+
import { C as F } from "./chunks/copy.527c3d76.js";
|
|
9
|
+
import "./assets/index35.css";
|
|
10
10
|
const H = S({
|
|
11
11
|
name: "bento-summary-grid",
|
|
12
12
|
components: { GridLayout: q },
|
package/dist/tabs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as I, ref as _, provide as v, computed as K, inject as m, onUnmounted as R, withDirectives as h, openBlock as T, createElementBlock as p, renderSlot as y, vShow as E, watch as S, nextTick as k, resolveComponent as x, createElementVNode as g, Fragment as D, renderList as L, normalizeClass as X, withKeys as Y, createVNode as O, withCtx as V, createTextVNode as G, toDisplayString as J } from "vue";
|
|
2
2
|
import { E as U, T as A, a as w } from "./chunks/tabs.keys.358742f2.js";
|
|
3
3
|
import { _ as N } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
4
|
-
import { B as j } from "./chunks/index.
|
|
4
|
+
import { B as j } from "./chunks/index.32ed68b7.js";
|
|
5
5
|
import { g as q } from "./chunks/unique-id.a2a2b458.js";
|
|
6
|
-
import "./assets/
|
|
6
|
+
import "./assets/index34.css";
|
|
7
7
|
const z = I({
|
|
8
8
|
props: {
|
|
9
9
|
/**
|
package/dist/tag.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as d, computed as o, resolveComponent as p, resolveDirective as m, withDirectives as _, openBlock as b, createElementBlock as v, normalizeClass as f, createVNode as g, withCtx as h, createTextVNode as y, toDisplayString as E } from "vue";
|
|
2
|
-
import { B as C } from "./chunks/index.
|
|
3
|
-
import { b as S } from "./chunks/tooltip.
|
|
2
|
+
import { B as C } from "./chunks/index.32ed68b7.js";
|
|
3
|
+
import { b as S } from "./chunks/tooltip.c8350cd0.js";
|
|
4
4
|
import { u as x } from "./chunks/aria-label.ac9651a5.js";
|
|
5
5
|
import { g as c } from "./chunks/get-slot-text.bead058f.js";
|
|
6
6
|
import { _ as $ } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
7
|
-
import "./assets/
|
|
7
|
+
import "./assets/index36.css";
|
|
8
8
|
var n = /* @__PURE__ */ ((e) => (e.GREY = "grey", e.BLUE = "blue", e.GREEN = "green", e.ORANGE = "orange", e.RED = "red", e.WHITE = "white", e))(n || {});
|
|
9
9
|
const w = d({
|
|
10
10
|
name: "bento-tag",
|
package/dist/textarea.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { openBlock as s, createElementBlock as L, mergeProps as le, toDisplayString as f, createCommentVNode as u, pushScopeId as re, popScopeId as oe, createElementVNode as k, defineComponent as se, toRefs as F, ref as C, toRef as ne, computed as i, watch as B, nextTick as ie, onMounted as ue, resolveComponent as E, normalizeClass as S, normalizeStyle as H, createVNode as I, withCtx as c, createTextVNode as y, createBlock as p, withKeys as N } from "vue";
|
|
2
|
-
import { B as de } from "./chunks/index.
|
|
3
|
-
import { a as ce } from "./chunks/button.
|
|
2
|
+
import { B as de } from "./chunks/index.32ed68b7.js";
|
|
3
|
+
import { a as ce } from "./chunks/button.7072457f.js";
|
|
4
4
|
import { _ as M } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import { g as be } from "./chunks/unique-id.a2a2b458.js";
|
|
6
6
|
import { o as pe } from "./chunks/resize.a041304d.js";
|
|
7
7
|
import { u as fe } from "./chunks/i18n.6c402773.js";
|
|
8
8
|
import { u as me } from "./chunks/aria-label.ac9651a5.js";
|
|
9
9
|
import { u as ve } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
10
|
-
import { E as ge } from "./chunks/error-message.
|
|
11
|
-
import "./assets/
|
|
10
|
+
import { E as ge } from "./chunks/error-message.37b6c7aa.js";
|
|
11
|
+
import "./assets/index37.css";
|
|
12
12
|
var O = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e.BOTH = "both", e.NONE = "none", e))(O || {}), m = /* @__PURE__ */ ((e) => (e.CLEARABLE = "clearable", e.DISABLED = "disabled", e.ERROR = "error", e.READONLY = "readonly", e))(m || {}), t = /* @__PURE__ */ ((e) => (e.BLUR = "blur", e.CHANGE = "change", e.CLEAR = "clear", e.ESCAPE_PRESSED = "escape-pressed", e.FOCUS = "focus", e.INPUT = "input", e))(t || {});
|
|
13
13
|
let U = 0;
|
|
14
14
|
const he = {
|
package/dist/timeline.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as X, ref as V, computed as _, toRefs as ae, provide as U, openBlock as a, createElementBlock as f, renderSlot as oe, mergeProps as G, toDisplayString as y, createCommentVNode as b, pushScopeId as x, popScopeId as ee, createElementVNode as v, inject as q, onUnmounted as re, resolveComponent as T, createVNode as E, withCtx as I, createTextVNode as S, createBlock as M, resolveDynamicComponent as le, normalizeClass as z, Fragment as F, renderList as me } from "vue";
|
|
2
2
|
import { _ as B } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
3
|
-
import { a as de } from "./chunks/button.
|
|
4
|
-
import { B as ue } from "./chunks/index.
|
|
3
|
+
import { a as de } from "./chunks/button.7072457f.js";
|
|
4
|
+
import { B as ue } from "./chunks/index.c62ea69f.js";
|
|
5
5
|
import { BentoTag as ce } from "./tag.js";
|
|
6
|
-
import { B as _e } from "./chunks/index.
|
|
7
|
-
import { B as fe, a as ve, S as he } from "./chunks/index.
|
|
6
|
+
import { B as _e } from "./chunks/index.32ed68b7.js";
|
|
7
|
+
import { B as fe, a as ve, S as he } from "./chunks/index.c22c4278.js";
|
|
8
8
|
import { C as pe } from "./chunks/checkmark-circle-fill.e6b84561.js";
|
|
9
9
|
import { C as ge } from "./chunks/cross-circle-fill.0feb37b3.js";
|
|
10
10
|
import { r as be, e as Ie, t as A, g as H } from "./chunks/index.f55fdc32.js";
|
|
11
11
|
import { c as ye, a as Se } from "./chunks/index.86453263.js";
|
|
12
12
|
import { g as Ee } from "./chunks/unique-id.a2a2b458.js";
|
|
13
13
|
import { u as we } from "./chunks/i18n.6c402773.js";
|
|
14
|
-
import "./assets/
|
|
14
|
+
import "./assets/index43.css";
|
|
15
15
|
var J = 1e3 * 60, O = 60 * 24, K = O * 30, Z = O * 365;
|
|
16
16
|
function P(e, t) {
|
|
17
17
|
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
package/dist/toast.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as C, resolveComponent as _, openBlock as u, createElementBlock as d, createElementVNode as b, createVNode as l, withCtx as p, createTextVNode as T, toDisplayString as y, createBlock as D, createCommentVNode as S, ref as k, computed as v, onMounted as H, watch as N, normalizeStyle as $, TransitionGroup as E, Fragment as O, renderList as V, normalizeClass as A } from "vue";
|
|
2
2
|
import { u as q } from "./chunks/toastController.0b01d2e8.js";
|
|
3
3
|
import { C as z, I as L } from "./chunks/info-filled.514a2db6.js";
|
|
4
|
-
import { a as P } from "./chunks/button.
|
|
5
|
-
import { B as U } from "./chunks/index.
|
|
6
|
-
import { u as j } from "./chunks/use-has-slot.
|
|
4
|
+
import { a as P } from "./chunks/button.7072457f.js";
|
|
5
|
+
import { B as U } from "./chunks/index.32ed68b7.js";
|
|
6
|
+
import { u as j } from "./chunks/use-has-slot.3daaffc6.js";
|
|
7
7
|
import { _ as w } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
8
|
-
import "./assets/
|
|
8
|
+
import "./assets/index38.css";
|
|
9
9
|
const F = {
|
|
10
10
|
"en-US": {
|
|
11
11
|
dismiss: "Dismiss"
|