@adyen/bento-vue3 1.75.0 → 1.76.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/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/button-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-meta.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/chunks/calendar.Tm7Cvpwu.js +2001 -0
- package/dist/chunks/calendar.Tm7Cvpwu.js.map +1 -0
- package/dist/chunks/constructNow.CHWWeLPc.js +8 -0
- package/dist/chunks/constructNow.CHWWeLPc.js.map +1 -0
- package/dist/chunks/{dashboard-section.CVttsom5.js → dashboard-section.Cqi0PWeJ.js} +2 -2
- package/dist/chunks/{dashboard-section.CVttsom5.js.map → dashboard-section.Cqi0PWeJ.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CFt1NV_4.js → data-grid-template.D7kB3S1u.js} +2 -2
- package/dist/chunks/{data-grid-template.CFt1NV_4.js.map → data-grid-template.D7kB3S1u.js.map} +1 -1
- package/dist/chunks/{data-grid.8Neri_45.js → data-grid.Bi4JDhQD.js} +17 -20
- package/dist/chunks/{data-grid.8Neri_45.js.map → data-grid.Bi4JDhQD.js.map} +1 -1
- package/dist/chunks/{date-picker.DSkvT_CA.js → date-picker.OI-sQ232.js} +4 -4
- package/dist/chunks/date-picker.OI-sQ232.js.map +1 -0
- package/dist/chunks/date-range-picker.DkEoczJ0.js +1114 -0
- package/dist/chunks/date-range-picker.DkEoczJ0.js.map +1 -0
- package/dist/chunks/{get-date-locale.CAyOIbcp.js → differenceInMonths.C8FyCrav.js} +580 -364
- package/dist/chunks/differenceInMonths.C8FyCrav.js.map +1 -0
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{filter-bar.C6A0MJ8m.js → filter-bar.DdSw_K3n.js} +733 -707
- package/dist/chunks/filter-bar.DdSw_K3n.js.map +1 -0
- package/dist/chunks/getRoundingMethod.C3eaeGLR.js +10 -0
- package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -0
- package/dist/chunks/{index.BrH1t1iu.js → getTimezoneOffsetInMilliseconds.BW7U6PxE.js} +254 -177
- package/dist/chunks/getTimezoneOffsetInMilliseconds.BW7U6PxE.js.map +1 -0
- package/dist/chunks/header-meta.BE6QfUNi.js +221 -0
- package/dist/chunks/header-meta.BE6QfUNi.js.map +1 -0
- package/dist/chunks/{header-with-views.f5BlTD7U.js → header-with-views.DLAINkjk.js} +2 -2
- package/dist/chunks/{header-with-views.f5BlTD7U.js.map → header-with-views.DLAINkjk.js.map} +1 -1
- package/dist/chunks/{header.DARVAeE9.js → header.3It50Clh.js} +2 -2
- package/dist/chunks/{header.DARVAeE9.js.map → header.3It50Clh.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.BK9AivIm.js → rich-text-editor.Bh7KS617.js} +353 -351
- package/dist/chunks/{rich-text-editor.BK9AivIm.js.map → rich-text-editor.Bh7KS617.js.map} +1 -1
- package/dist/chunks/timeline-item.DNjubXL2.js +556 -0
- package/dist/chunks/timeline-item.DNjubXL2.js.map +1 -0
- package/dist/dashboard-template.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +11 -11
- package/dist/internal.js +2 -2
- package/dist/rich-text-editor.js +1 -1
- package/dist/styles/bento-dark.css +7 -5
- package/dist/styles/bento-light.css +7 -5
- package/dist/styles/bento.css +7 -5
- package/dist/styles/legacy.css +7 -5
- package/dist/styles/styleguide.css +7 -5
- package/dist/timeline.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +8 -23
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +0 -7
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +0 -1
- package/dist/chunks/calendar.Cqjyxc69.js +0 -2223
- package/dist/chunks/calendar.Cqjyxc69.js.map +0 -1
- package/dist/chunks/date-picker.DSkvT_CA.js.map +0 -1
- package/dist/chunks/date-range-picker.DSMt6XMF.js +0 -1117
- package/dist/chunks/date-range-picker.DSMt6XMF.js.map +0 -1
- package/dist/chunks/filter-bar.C6A0MJ8m.js.map +0 -1
- package/dist/chunks/get-date-locale.CAyOIbcp.js.map +0 -1
- package/dist/chunks/header-meta.C4iaUsfq.js +0 -236
- package/dist/chunks/header-meta.C4iaUsfq.js.map +0 -1
- package/dist/chunks/index.BrH1t1iu.js.map +0 -1
- package/dist/chunks/index.BxBB1rsx.js +0 -15
- package/dist/chunks/index.BxBB1rsx.js.map +0 -1
- package/dist/chunks/timeline-item.C8PA_w7m.js +0 -568
- package/dist/chunks/timeline-item.C8PA_w7m.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructNow.CHWWeLPc.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructNow.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateArg<DateType>,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n"],"names":["constructNow","date","constructFrom"],"mappings":";AA8BO,SAASA,EAAaC,GAAM;AACjC,SAAOC,EAAcD,GAAM,KAAK,IAAG,CAAE;AACvC;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as I, useSlots as F, ref as u, computed as d, watch as g, onUnmounted as L, createElementBlock as l, openBlock as a, createVNode as $, createElementVNode as f, unref as s, mergeProps as R, createSlots as H, withCtx as _, renderSlot as i, normalizeClass as C, createCommentVNode as W, createBlock as w, Fragment as M, renderList as U, onMounted as q } from "vue";
|
|
2
|
-
import { B as E } from "./header.
|
|
2
|
+
import { B as E } from "./header.3It50Clh.js";
|
|
3
3
|
import { B as A, a as G } from "./tab.CD5Eu6ql.js";
|
|
4
4
|
import { c as J } from "./index.E60QniEu.js";
|
|
5
5
|
import { o as K } from "./resize.Bqks3WUm.js";
|
|
@@ -162,4 +162,4 @@ export {
|
|
|
162
162
|
vt as a,
|
|
163
163
|
pt as d
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=dashboard-section.
|
|
165
|
+
//# sourceMappingURL=dashboard-section.Cqi0PWeJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-section.CVttsom5.js","sources":["../../../vue2/src/templates/dashboard-template/dashboard-template.vue","../../../vue2/src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * The header that goes to the top of the template\n */\n header: BentoDashboardTemplateHeader;\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currently active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs?: BentoDashboardTemplateTabs;\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs?: boolean;\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyFilters?: boolean;\n }>(),\n {\n tabs: undefined,\n stickyTabs: false,\n stickyFilters: false,\n }\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * The header of the section\n */\n header: BentoDashboardTemplateHeader;\n\n /**\n * Renders the section to take only half of the page\n */\n halfWidth?: boolean;\n }>(),\n {\n halfWidth: false,\n }\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","props","__props","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","computedTabsOptions","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;;;;GAqKIA,IAAA,CAAA;;;;;;;;;;AArHA,UAAAC,IAAAC,GA+BAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,CAAA,GAEAK,IAAAC,EAAA,MAAAL,EAAA,SAAAR,EAAA,aAAA,GACAc,IAAAD,EAAA,MAAAP,EAAA,SAAAN,EAAA,UAAA,GAEAe,IAAAF,EAAA,OAAA;AAAA,MAA2D,yCAAAb,EAAA;AAAA,MACR,8CAAAY,EAAA,SAAA,CAAAE,EAAA,SAAAL,EAAA;AAAA,IAEuB,EAAA,GAG1EO,IAAAH,EAAA,OAAA;AAAA,MAA8D,6CAAAb,EAAA,cAAAA,EAAA;AAAA,IACa,EAAA,GAG3EiB,IAAAJ,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAgB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;;AAAA,eAAAC,KAAAC,IAAAtB,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAsB,EAAAF,OAAA,gBAAAC,EAAA,UAAA,OAAAD,IAAA,CAAA;AAAA,OAEAG,IAAAV,EAAA,MAAAF,EAAA,QAAA,EAAA,KAAAA,EAAA,MAAA,IAAA,MAAA,GAEA,EAAA,GAAAa,EAAA,IAAAC,EAAA;AAEA,WAAAC;AAAA,MAAA,MAAAlB,EAAA;AAAA,MACqB,MAAA;AAEb,QAAA,CAAAE,KAAAF,EAAA,UACIE,IAAAiB,EAAAnB,EAAA,OAAA,MAAA;AACI,cAAAA,EAAA,SAAAM,EAAA,OAAA;AACI,kBAAAc,IAAApB,EAAA,MAAA;AACA,YAAAG,EAAA,QAAAC,EAAA,QAAAgB,IAAA;AAAA,UAA8D;AAAA,QAClE,CAAA;AAAA,MAER;AAAA,IACJ,GAGJF;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAZ,EAAA,UACIH,EAAA,UAAAa,IAAAd,EAAA,UAAA,gBAAAc,EAAA,wBAAA,SAAA;AAAA,MACJ;AAAA,IACJ,GAGJO,EAAA,MAAA;AACI,MAAAnB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mGC/CvCoB,KAAA,CAAA;;;;;;;;AA1DA,UAAA9B,IAAAC,GAiBAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA6B,IAAAlB,EAAA,OAAA;AAAA,MAA2C,mCAAAb,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAgC,EAAA,MAAA;AACI,WAAA5B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAJ,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dashboard-section.Cqi0PWeJ.js","sources":["../../../vue2/src/templates/dashboard-template/dashboard-template.vue","../../../vue2/src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * The header that goes to the top of the template\n */\n header: BentoDashboardTemplateHeader;\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currently active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs?: BentoDashboardTemplateTabs;\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs?: boolean;\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyFilters?: boolean;\n }>(),\n {\n tabs: undefined,\n stickyTabs: false,\n stickyFilters: false,\n }\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * The header of the section\n */\n header: BentoDashboardTemplateHeader;\n\n /**\n * Renders the section to take only half of the page\n */\n halfWidth?: boolean;\n }>(),\n {\n halfWidth: false,\n }\n );\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","props","__props","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","computedTabsOptions","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;;;;GAqKIA,IAAA,CAAA;;;;;;;;;;AArHA,UAAAC,IAAAC,GA+BAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,CAAA,GAEAK,IAAAC,EAAA,MAAAL,EAAA,SAAAR,EAAA,aAAA,GACAc,IAAAD,EAAA,MAAAP,EAAA,SAAAN,EAAA,UAAA,GAEAe,IAAAF,EAAA,OAAA;AAAA,MAA2D,yCAAAb,EAAA;AAAA,MACR,8CAAAY,EAAA,SAAA,CAAAE,EAAA,SAAAL,EAAA;AAAA,IAEuB,EAAA,GAG1EO,IAAAH,EAAA,OAAA;AAAA,MAA8D,6CAAAb,EAAA,cAAAA,EAAA;AAAA,IACa,EAAA,GAG3EiB,IAAAJ,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAgB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;;AAAA,eAAAC,KAAAC,IAAAtB,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAsB,EAAAF,OAAA,gBAAAC,EAAA,UAAA,OAAAD,IAAA,CAAA;AAAA,OAEAG,IAAAV,EAAA,MAAAF,EAAA,QAAA,EAAA,KAAAA,EAAA,MAAA,IAAA,MAAA,GAEA,EAAA,GAAAa,EAAA,IAAAC,EAAA;AAEA,WAAAC;AAAA,MAAA,MAAAlB,EAAA;AAAA,MACqB,MAAA;AAEb,QAAA,CAAAE,KAAAF,EAAA,UACIE,IAAAiB,EAAAnB,EAAA,OAAA,MAAA;AACI,cAAAA,EAAA,SAAAM,EAAA,OAAA;AACI,kBAAAc,IAAApB,EAAA,MAAA;AACA,YAAAG,EAAA,QAAAC,EAAA,QAAAgB,IAAA;AAAA,UAA8D;AAAA,QAClE,CAAA;AAAA,MAER;AAAA,IACJ,GAGJF;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAZ,EAAA,UACIH,EAAA,UAAAa,IAAAd,EAAA,UAAA,gBAAAc,EAAA,wBAAA,SAAA;AAAA,MACJ;AAAA,IACJ,GAGJO,EAAA,MAAA;AACI,MAAAnB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mGC/CvCoB,KAAA,CAAA;;;;;;;;AA1DA,UAAA9B,IAAAC,GAiBAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA6B,IAAAlB,EAAA,OAAA;AAAA,MAA2C,mCAAAb,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAgC,EAAA,MAAA;AACI,WAAA5B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAJ,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as E, useSlots as G, ref as f, computed as o, provide as H, createElementBlock as m, openBlock as c, createVNode as T, unref as n, mergeProps as N, toHandlers as O, withCtx as l, renderSlot as s, createElementVNode as P, createCommentVNode as j, createBlock as _, normalizeProps as x, guardReactiveProps as V, createSlots as w, normalizeClass as z, Fragment as L, renderList as F, toRef as C } from "vue";
|
|
2
|
-
import { B as J } from "./header.
|
|
2
|
+
import { B as J } from "./header.3It50Clh.js";
|
|
3
3
|
import { B as K } from "./inspector.BKP15cx6.js";
|
|
4
4
|
import { B as M, a as U } from "./tab.CD5Eu6ql.js";
|
|
5
5
|
import { u as Y } from "./use-has-slot.B7eQSabc.js";
|
|
@@ -141,4 +141,4 @@ const W = { class: "b-data-grid-template" }, X = { class: "b-data-grid-template_
|
|
|
141
141
|
export {
|
|
142
142
|
lt as d
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=data-grid-template.
|
|
144
|
+
//# sourceMappingURL=data-grid-template.D7kB3S1u.js.map
|
package/dist/chunks/{data-grid-template.CFt1NV_4.js.map → data-grid-template.D7kB3S1u.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-template.CFt1NV_4.js","sources":["../../../vue2/src/templates/data-grid-template/data-grid-template.vue"],"sourcesContent":["<template>\n <main class=\"b-data-grid-template\">\n <bento-inspector v-bind=\"computedInspectorProps\" ref=\"inspectorRef\" v-on=\"inspectorEvents\">\n <template #page>\n <div class=\"b-data-grid-template__header\">\n <slot name=\"header\">\n <bento-header v-bind=\"header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n </slot>\n </div>\n\n <div\n v-if=\"hasSlot('additionalContent')\"\n ref=\"additionalContentRef\"\n class=\"b-data-grid-template__additional-content\"\n :class=\"additionalContentConditionalClasses\"\n >\n <slot name=\"additionalContent\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"stickyAdditionalContent ? { top: computedStickyAdditionalContentHeight } : null\"\n @update:active-tab-index=\"emitTabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <slot :name=\"`tab-${index + 1}`\" />\n </bento-tab>\n </bento-tabs>\n\n <slot v-else />\n </template>\n\n <template #content>\n <slot name=\"inspector-content\" />\n </template>\n </bento-inspector>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoHeader } from '@/components/header';\n import { BentoInspector } from '@/components/inspector';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useHasSlot } from '@/composables';\n import { computed, type PropType, provide, type Ref, ref, toRef, type UnwrapRef, useSlots } from 'vue';\n import { DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY } from './data-grid-template.keys';\n import type {\n BentoDataGridTemplateDataGrid,\n BentoDataGridTemplateHeader,\n BentoDataGridTemplateInspector,\n BentoDataGridTemplateTabs,\n } from './data-grid-template.types';\n\n const props = defineProps({\n /**\n * The header that goes to the top of the template\n */\n header: {\n type: Object as PropType<BentoDataGridTemplateHeader>,\n default: undefined,\n },\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currenly active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs: {\n type: Object as PropType<BentoDataGridTemplateTabs>,\n default: undefined,\n },\n\n /**\n * Renders the additional content slot with a sticky positioning\n */\n stickyAdditionalContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs: {\n type: Boolean,\n default: false,\n },\n\n /**\n * All the inspector properties that can be set on the inner inspector component.\n */\n inspector: {\n type: Object as PropType<BentoDataGridTemplateInspector>,\n default: undefined,\n },\n });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<{\n /**\n * Emits update event when activeTabIndex changes internally\n */\n (e: 'update:tabs', value: BentoDataGridTemplateTabs): void;\n\n /**\n * Emits update event when the inspector's `isOpen` state changes\n */\n (e: 'update:is-open:inspector', value: boolean): void;\n\n /**\n * Emits update event when the inspector's `activePage` changes\n */\n (e: 'update:active-page:inspector', value: string): void;\n\n /**\n * Emits event when the inspector's expand button is clicked\n */\n (e: 'expand:inspector', value: boolean): void;\n }>();\n\n const tabsRef = ref(null);\n const additionalContentRef = ref(null);\n const inspectorRef = ref(null);\n\n const additionalContentConditionalClasses = computed(() => ({\n 'b-data-grid-template__additional-content--sticky': props.stickyAdditionalContent,\n }));\n\n const computedInspectorProps = computed(() => ({\n title: '',\n ...props.inspector,\n }));\n\n const computedStickyAdditionalContentHeight = computed(() => additionalContentRef?.value?.offsetHeight);\n\n const computedTabsRef = computed(() => tabsRef.value?.$refs?.tablistwrapper);\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const inspectorEvents = computed(() => ({\n 'update:is-open': (value: boolean) => emit('update:is-open:inspector', value),\n 'update:active-page': (value: string) => emit('update:active-page:inspector', value),\n expand: (value: boolean) => emit('expand:inspector', value),\n }));\n\n const emitTabs = (newActiveTabIndex: number) => {\n emit('update:tabs', { ...props.tabs, activeTabIndex: newActiveTabIndex });\n };\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const registerDatagridInDataGridTemplate: BentoDataGridTemplateDataGrid = () => {\n const isDataGridTemplate = true;\n const stickyTabs: Ref<boolean> = toRef(props, 'stickyTabs');\n const stickyAdditionalContent: Ref<boolean> = toRef(props, 'stickyAdditionalContent');\n const tabsRef: Ref<UnwrapRef<HTMLDivElement>> | null = computedTabsRef;\n const additionalContentSlotRef: Ref<UnwrapRef<HTMLDivElement>> | null = additionalContentRef;\n\n // return values to the Tab component\n return {\n isDataGridTemplate,\n stickyTabs,\n tabsRef,\n stickyAdditionalContent,\n additionalContentSlotRef,\n };\n };\n\n provide(DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY, registerDatagridInDataGridTemplate);\n</script>\n\n<script lang=\"ts\">\n /**\n * The data grid template is a restrictive, full-page data grid used to display information from a data set.\n * You can use this data grid template when your user needs a clear overview of data or a way of organizing and analyzing the data in their own way.\n * This data grid template shouldn’t be confused with the data grid.\n *\n * @example\n * import { BentoDataGridTemplate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDataGridTemplate },\n * template: `\n * // If you want to display multiple data grids in the same page (they will be rendered in different tabs)\n * <bento-data-grid-template>\n * <template #tab-1><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 1\"/></template>\n * <template #tab-2><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 2\"/></template>\n * </bento-data-grid-template>\n * // Alternatively, if you only want to pass one data grid to your template:\n * <bento-data-grid-template>\n * <template #default><bento-data-grid v-bind=\"your-data-grid-args\"/></template>\n * </bento-data-grid-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./data-grid-template.scss\" />\n"],"names":["__default__","props","__props","slots","useSlots","hasSlot","useHasSlot","emit","__emit","tabsRef","ref","additionalContentRef","inspectorRef","additionalContentConditionalClasses","computed","computedInspectorProps","computedStickyAdditionalContentHeight","_a","computedTabsRef","_b","tabsSlots","el","inspectorEvents","value","emitTabs","newActiveTabIndex","getTabTitle","index","provide","DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY","stickyTabs","toRef","stickyAdditionalContent"],"mappings":";;;;;;;;4FA2MIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/IA,UAAAC,IAAAC,GA2CAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,GAsBAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GAEAG,IAAAC,EAAA,OAAA;AAAA,MAA4D,oDAAAb,EAAA;AAAA,IACE,EAAA,GAG9Dc,IAAAD,EAAA,OAAA;AAAA,MAA+C,OAAA;AAAA,MACpC,GAAAb,EAAA;AAAA,IACE,EAAA,GAGbe,IAAAF,EAAA,MAAA;;AAAA,cAAAG,IAAAN,KAAA,gBAAAA,EAAA,UAAA,gBAAAM,EAAA;AAAA,KAAA,GAEAC,IAAAJ,EAAA,MAAA;;AAAA,cAAAK,KAAAF,IAAAR,EAAA,UAAA,gBAAAQ,EAAA,UAAA,gBAAAE,EAAA;AAAA,KAAA,GAEAC,IAAAN,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAkB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAAR,EAAA,OAAA;AAAA,MAAwC,kBAAA,CAAAS,MAAAhB,EAAA,4BAAAgB,CAAA;AAAA,MACwC,sBAAA,CAAAA,MAAAhB,EAAA,gCAAAgB,CAAA;AAAA,MACO,QAAA,CAAAA,MAAAhB,EAAA,oBAAAgB,CAAA;AAAA,IACzB,EAAA,GAG9DC,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAA,eAAA,EAAA,GAAAN,EAAA,MAAA,gBAAAwB,EAAA,CAAA;AAAA,IAAwE,GAG5EC,IAAA,CAAAC,MAAA;;AAAA,eAAAR,KAAAF,IAAAhB,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAgB,EAAAU,OAAA,gBAAAR,EAAA,UAAA,OAAAQ,IAAA,CAAA;AAAA;AAmBA,WAAAC,EAAAC,GAjBA,MAAA;AAEI,YAAAC,IAAAC,EAAA9B,GAAA,YAAA,GACA+B,IAAAD,EAAA9B,GAAA,yBAAA;AAKA,aAAA;AAAA,QAAO;AAAA,QACH,YAAA6B;AAAA,QACA,SANJZ;AAAA,QAOI,yBAAAc;AAAA,QACA,0BAPJrB;AAAA,MAQI;AAAA,IACJ,CAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"data-grid-template.D7kB3S1u.js","sources":["../../../vue2/src/templates/data-grid-template/data-grid-template.vue"],"sourcesContent":["<template>\n <main class=\"b-data-grid-template\">\n <bento-inspector v-bind=\"computedInspectorProps\" ref=\"inspectorRef\" v-on=\"inspectorEvents\">\n <template #page>\n <div class=\"b-data-grid-template__header\">\n <slot name=\"header\">\n <bento-header v-bind=\"header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n </slot>\n </div>\n\n <div\n v-if=\"hasSlot('additionalContent')\"\n ref=\"additionalContentRef\"\n class=\"b-data-grid-template__additional-content\"\n :class=\"additionalContentConditionalClasses\"\n >\n <slot name=\"additionalContent\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"stickyAdditionalContent ? { top: computedStickyAdditionalContentHeight } : null\"\n @update:active-tab-index=\"emitTabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <slot :name=\"`tab-${index + 1}`\" />\n </bento-tab>\n </bento-tabs>\n\n <slot v-else />\n </template>\n\n <template #content>\n <slot name=\"inspector-content\" />\n </template>\n </bento-inspector>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoHeader } from '@/components/header';\n import { BentoInspector } from '@/components/inspector';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useHasSlot } from '@/composables';\n import { computed, type PropType, provide, type Ref, ref, toRef, type UnwrapRef, useSlots } from 'vue';\n import { DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY } from './data-grid-template.keys';\n import type {\n BentoDataGridTemplateDataGrid,\n BentoDataGridTemplateHeader,\n BentoDataGridTemplateInspector,\n BentoDataGridTemplateTabs,\n } from './data-grid-template.types';\n\n const props = defineProps({\n /**\n * The header that goes to the top of the template\n */\n header: {\n type: Object as PropType<BentoDataGridTemplateHeader>,\n default: undefined,\n },\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currenly active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs: {\n type: Object as PropType<BentoDataGridTemplateTabs>,\n default: undefined,\n },\n\n /**\n * Renders the additional content slot with a sticky positioning\n */\n stickyAdditionalContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs: {\n type: Boolean,\n default: false,\n },\n\n /**\n * All the inspector properties that can be set on the inner inspector component.\n */\n inspector: {\n type: Object as PropType<BentoDataGridTemplateInspector>,\n default: undefined,\n },\n });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<{\n /**\n * Emits update event when activeTabIndex changes internally\n */\n (e: 'update:tabs', value: BentoDataGridTemplateTabs): void;\n\n /**\n * Emits update event when the inspector's `isOpen` state changes\n */\n (e: 'update:is-open:inspector', value: boolean): void;\n\n /**\n * Emits update event when the inspector's `activePage` changes\n */\n (e: 'update:active-page:inspector', value: string): void;\n\n /**\n * Emits event when the inspector's expand button is clicked\n */\n (e: 'expand:inspector', value: boolean): void;\n }>();\n\n const tabsRef = ref(null);\n const additionalContentRef = ref(null);\n const inspectorRef = ref(null);\n\n const additionalContentConditionalClasses = computed(() => ({\n 'b-data-grid-template__additional-content--sticky': props.stickyAdditionalContent,\n }));\n\n const computedInspectorProps = computed(() => ({\n title: '',\n ...props.inspector,\n }));\n\n const computedStickyAdditionalContentHeight = computed(() => additionalContentRef?.value?.offsetHeight);\n\n const computedTabsRef = computed(() => tabsRef.value?.$refs?.tablistwrapper);\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const inspectorEvents = computed(() => ({\n 'update:is-open': (value: boolean) => emit('update:is-open:inspector', value),\n 'update:active-page': (value: string) => emit('update:active-page:inspector', value),\n expand: (value: boolean) => emit('expand:inspector', value),\n }));\n\n const emitTabs = (newActiveTabIndex: number) => {\n emit('update:tabs', { ...props.tabs, activeTabIndex: newActiveTabIndex });\n };\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const registerDatagridInDataGridTemplate: BentoDataGridTemplateDataGrid = () => {\n const isDataGridTemplate = true;\n const stickyTabs: Ref<boolean> = toRef(props, 'stickyTabs');\n const stickyAdditionalContent: Ref<boolean> = toRef(props, 'stickyAdditionalContent');\n const tabsRef: Ref<UnwrapRef<HTMLDivElement>> | null = computedTabsRef;\n const additionalContentSlotRef: Ref<UnwrapRef<HTMLDivElement>> | null = additionalContentRef;\n\n // return values to the Tab component\n return {\n isDataGridTemplate,\n stickyTabs,\n tabsRef,\n stickyAdditionalContent,\n additionalContentSlotRef,\n };\n };\n\n provide(DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY, registerDatagridInDataGridTemplate);\n</script>\n\n<script lang=\"ts\">\n /**\n * The data grid template is a restrictive, full-page data grid used to display information from a data set.\n * You can use this data grid template when your user needs a clear overview of data or a way of organizing and analyzing the data in their own way.\n * This data grid template shouldn’t be confused with the data grid.\n *\n * @example\n * import { BentoDataGridTemplate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDataGridTemplate },\n * template: `\n * // If you want to display multiple data grids in the same page (they will be rendered in different tabs)\n * <bento-data-grid-template>\n * <template #tab-1><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 1\"/></template>\n * <template #tab-2><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 2\"/></template>\n * </bento-data-grid-template>\n * // Alternatively, if you only want to pass one data grid to your template:\n * <bento-data-grid-template>\n * <template #default><bento-data-grid v-bind=\"your-data-grid-args\"/></template>\n * </bento-data-grid-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./data-grid-template.scss\" />\n"],"names":["__default__","props","__props","slots","useSlots","hasSlot","useHasSlot","emit","__emit","tabsRef","ref","additionalContentRef","inspectorRef","additionalContentConditionalClasses","computed","computedInspectorProps","computedStickyAdditionalContentHeight","_a","computedTabsRef","_b","tabsSlots","el","inspectorEvents","value","emitTabs","newActiveTabIndex","getTabTitle","index","provide","DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY","stickyTabs","toRef","stickyAdditionalContent"],"mappings":";;;;;;;;4FA2MIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/IA,UAAAC,IAAAC,GA2CAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,GAsBAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GAEAG,IAAAC,EAAA,OAAA;AAAA,MAA4D,oDAAAb,EAAA;AAAA,IACE,EAAA,GAG9Dc,IAAAD,EAAA,OAAA;AAAA,MAA+C,OAAA;AAAA,MACpC,GAAAb,EAAA;AAAA,IACE,EAAA,GAGbe,IAAAF,EAAA,MAAA;;AAAA,cAAAG,IAAAN,KAAA,gBAAAA,EAAA,UAAA,gBAAAM,EAAA;AAAA,KAAA,GAEAC,IAAAJ,EAAA,MAAA;;AAAA,cAAAK,KAAAF,IAAAR,EAAA,UAAA,gBAAAQ,EAAA,UAAA,gBAAAE,EAAA;AAAA,KAAA,GAEAC,IAAAN,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAkB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAAR,EAAA,OAAA;AAAA,MAAwC,kBAAA,CAAAS,MAAAhB,EAAA,4BAAAgB,CAAA;AAAA,MACwC,sBAAA,CAAAA,MAAAhB,EAAA,gCAAAgB,CAAA;AAAA,MACO,QAAA,CAAAA,MAAAhB,EAAA,oBAAAgB,CAAA;AAAA,IACzB,EAAA,GAG9DC,IAAA,CAAAC,MAAA;AACI,MAAAlB,EAAA,eAAA,EAAA,GAAAN,EAAA,MAAA,gBAAAwB,EAAA,CAAA;AAAA,IAAwE,GAG5EC,IAAA,CAAAC,MAAA;;AAAA,eAAAR,KAAAF,IAAAhB,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAgB,EAAAU,OAAA,gBAAAR,EAAA,UAAA,OAAAQ,IAAA,CAAA;AAAA;AAmBA,WAAAC,EAAAC,GAjBA,MAAA;AAEI,YAAAC,IAAAC,EAAA9B,GAAA,YAAA,GACA+B,IAAAD,EAAA9B,GAAA,yBAAA;AAKA,aAAA;AAAA,QAAO;AAAA,QACH,YAAA6B;AAAA,QACA,SANJZ;AAAA,QAOI,yBAAAc;AAAA,QACA,0BAPJrB;AAAA,MAQI;AAAA,IACJ,CAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,7 +15,7 @@ import { B as Tn } from "./pagination.BaBWNlIF.js";
|
|
|
15
15
|
import { B as ut } from "./loading-indicator.Db794TT5.js";
|
|
16
16
|
import { u as Rt } from "./use-has-slot.B7eQSabc.js";
|
|
17
17
|
import { g as ct } from "./generate-uid.NJ8tVoha.js";
|
|
18
|
-
import { B as _t } from "./filter-bar.
|
|
18
|
+
import { B as _t } from "./filter-bar.DdSw_K3n.js";
|
|
19
19
|
import { B as On } from "./empty-state.Be6M8ivH.js";
|
|
20
20
|
import { E as Nn } from "./tabs.keys.Cb4Vw5Jh.js";
|
|
21
21
|
import { D as In } from "./data-grid-template.keys.2_AkxuNT.js";
|
|
@@ -120,7 +120,7 @@ const jn = (e, s) => {
|
|
|
120
120
|
isResizing: t,
|
|
121
121
|
columnHoverEventToEmitAfterResizing: i
|
|
122
122
|
};
|
|
123
|
-
}, qn = 100, Kt = 50, Se = "b-actions-column", Kn =
|
|
123
|
+
}, qn = 100, Kt = 50, Se = "b-actions-column", Kn = 42, Yn = 56, Jn = 56, Xn = 80, Qn = 36, eo = 1, bl = 16, to = 20, lo = (e, s, i) => {
|
|
124
124
|
const t = {}, c = [], l = (v) => {
|
|
125
125
|
const g = t[v];
|
|
126
126
|
g && g.frozen !== !0 && (t[v].frozen = !0, c.push(v));
|
|
@@ -3237,20 +3237,17 @@ const oa = /* @__PURE__ */ fe(Qs, [["render", na]]), sa = ["aria-label"], aa = {
|
|
|
3237
3237
|
tooltipText: { default: null }
|
|
3238
3238
|
},
|
|
3239
3239
|
setup(e) {
|
|
3240
|
-
const { tc: s } = Ve({ messages: Tl }), i = e, t = y(), c = C(() => {
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
}
|
|
3252
|
-
};
|
|
3253
|
-
}), l = C(() => {
|
|
3240
|
+
const { tc: s } = Ve({ messages: Tl }), i = e, t = y(), c = C(() => ({
|
|
3241
|
+
popoverPosition: "right",
|
|
3242
|
+
// Setting popover defaults, but they are overriden if used passes dashedUnderline prop
|
|
3243
|
+
popoverTitle: i.label,
|
|
3244
|
+
popoverSize: "small",
|
|
3245
|
+
...i.dashedUnderline,
|
|
3246
|
+
// We force teleport as this is needed for the popover to appear above all the data grid elements
|
|
3247
|
+
teleport: {
|
|
3248
|
+
disabled: !1
|
|
3249
|
+
}
|
|
3250
|
+
})), l = C(() => {
|
|
3254
3251
|
var _;
|
|
3255
3252
|
return ((_ = i.searchTerm) == null ? void 0 : _.toLowerCase()) ?? "";
|
|
3256
3253
|
}), n = (_) => i.searchTerm && _.toLowerCase().includes(l.value) ? "mark" : "span", v = C(() => i.searchTerm ? i.items.filter((_) => _.toLowerCase().includes(l.value)).length : 0), g = C(
|
|
@@ -3297,7 +3294,7 @@ const oa = /* @__PURE__ */ fe(Qs, [["render", na]]), sa = ["aria-label"], aa = {
|
|
|
3297
3294
|
}, null, 8, ["content", "position", "is-shown", "target-element"])) : W("", !0)
|
|
3298
3295
|
]));
|
|
3299
3296
|
}
|
|
3300
|
-
}), mi = /* @__PURE__ */ fe(ca, [["__scopeId", "data-v-
|
|
3297
|
+
}), mi = /* @__PURE__ */ fe(ca, [["__scopeId", "data-v-5ea6289c"]]), fa = ["aria-busy"], ga = ["aria-controls", "aria-label"], va = {
|
|
3301
3298
|
key: 1,
|
|
3302
3299
|
class: "b-data-grid__header"
|
|
3303
3300
|
}, ma = ["id", "role", "aria-rowcount", "aria-colcount", "aria-label"], ha = {
|
|
@@ -3750,7 +3747,7 @@ const oa = /* @__PURE__ */ fe(Qs, [["render", na]]), sa = ["aria-label"], aa = {
|
|
|
3750
3747
|
), Gl = C(
|
|
3751
3748
|
() => {
|
|
3752
3749
|
var I, B;
|
|
3753
|
-
return ((I = D.value) == null ? void 0 : I.isClearAllVisible) || ((B = D.value) == null ? void 0 : B.isResetAllVisible);
|
|
3750
|
+
return ((I = D.value) == null ? void 0 : I.isClearAllVisible) || ((B = D.value) == null ? void 0 : B.isResetAllVisible) || !!t.filterSearchTerm;
|
|
3754
3751
|
}
|
|
3755
3752
|
), { navigationInput: ot } = io(
|
|
3756
3753
|
b,
|
|
@@ -4132,7 +4129,7 @@ const oa = /* @__PURE__ */ fe(Qs, [["render", na]]), sa = ["aria-label"], aa = {
|
|
|
4132
4129
|
], 42, fa);
|
|
4133
4130
|
};
|
|
4134
4131
|
}
|
|
4135
|
-
}), hi = /* @__PURE__ */ fe(ya, [["__scopeId", "data-v-
|
|
4132
|
+
}), hi = /* @__PURE__ */ fe(ya, [["__scopeId", "data-v-fee2c8a9"]]);
|
|
4136
4133
|
export {
|
|
4137
4134
|
$e as B,
|
|
4138
4135
|
vi as a,
|
|
@@ -4143,4 +4140,4 @@ export {
|
|
|
4143
4140
|
dt as f,
|
|
4144
4141
|
Et as g
|
|
4145
4142
|
};
|
|
4146
|
-
//# sourceMappingURL=data-grid.
|
|
4143
|
+
//# sourceMappingURL=data-grid.Bi4JDhQD.js.map
|