@adyen/bento-vue3 1.24.0 → 1.26.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/packages/vue2/src/components/alert/alert.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +46 -54
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +86 -179
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.types.d.ts +8 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.vue.d.ts +7 -4
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +10 -2
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +8 -6
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +26 -11
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-hovering/use-column-hovering.d.ts +18 -6
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +36 -12
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +18 -6
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-resizer.d.ts +18 -6
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +19 -53
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/use-dropdown-options-listbox.d.ts +13 -7
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +14 -14
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.types.d.ts +3 -24
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/select-filter-button/select-filter-button.vue.d.ts +148 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/components/select-filter-dropdown/select-filter-dropdown.vue.d.ts +150 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +28 -27
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +11 -7
- package/dist/@types/packages/vue2/src/components/internal/checkbox-input/checkbox-input.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/dialog-page/dialog-page.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/field-label/field-label.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-chips/listbox-multi-select-chips.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +1 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +45 -9
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -9
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-cached-selected-values/use-cached-selected-values.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +15 -15
- package/dist/@types/packages/vue2/src/components/internal/radio-input/radio-input.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item-list/menu-item-list.vue.d.ts +3 -2
- package/dist/@types/packages/vue2/src/components/menu/components/menu-list-container/menu-list-container.vue.d.ts +8 -1
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/selection-card/components/selection-card-group/selection-card-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/tutorial/tutorial.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tutorial/tutorial.vue.d.ts +22 -2
- package/dist/@types/packages/vue2/src/components/typography/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/composables/use-click-outside/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/accordion.js +3 -3
- package/dist/action-bar.js +7 -7
- package/dist/alert.js +126 -166
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/dialog-page.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 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- 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/{listbox.css → use-cached-selected-values.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 +168 -267
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.ab9c947e.js → base-button.e84acf30.js} +2 -2
- package/dist/chunks/{base-button.ab9c947e.js.map → base-button.e84acf30.js.map} +1 -1
- package/dist/chunks/{base-modal.28b5ff83.js → base-modal.29e062d0.js} +7 -7
- package/dist/chunks/{base-modal.28b5ff83.js.map → base-modal.29e062d0.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.305991e5.js → button-actions-with-menu.7fce47a2.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.305991e5.js.map → button-actions-with-menu.7fce47a2.js.map} +1 -1
- package/dist/chunks/{button-actions.ea025810.js → button-actions.642b37de.js} +3 -3
- package/dist/chunks/{button-actions.ea025810.js.map → button-actions.642b37de.js.map} +1 -1
- package/dist/chunks/{button.ce5d1f5e.js → button.60dad578.js} +3 -3
- package/dist/chunks/{button.ce5d1f5e.js.map → button.60dad578.js.map} +1 -1
- package/dist/chunks/{calendar.24a492f1.js → calendar.f38cdab9.js} +5 -5
- package/dist/chunks/{calendar.24a492f1.js.map → calendar.f38cdab9.js.map} +1 -1
- package/dist/chunks/{checkbox-input.99336948.js → checkbox-input.ab758a81.js} +2 -2
- package/dist/chunks/{checkbox-input.99336948.js.map → checkbox-input.ab758a81.js.map} +1 -1
- package/dist/chunks/{checkbox.d0f897e0.js → checkbox.f55ee3a5.js} +4 -4
- package/dist/chunks/{checkbox.d0f897e0.js.map → checkbox.f55ee3a5.js.map} +1 -1
- package/dist/chunks/{checkmark-circle-fill.c45a999d.js → checkmark-circle-fill.f3a69c6a.js} +2 -2
- package/dist/chunks/{checkmark-circle-fill.c45a999d.js.map → checkmark-circle-fill.f3a69c6a.js.map} +1 -1
- package/dist/chunks/{checkmark-small.c79220d9.js → checkmark-small.d7e31e5e.js} +2 -2
- package/dist/chunks/{checkmark-small.c79220d9.js.map → checkmark-small.d7e31e5e.js.map} +1 -1
- package/dist/chunks/{checkmark.eb3c7a06.js → checkmark.87919b24.js} +2 -2
- package/dist/chunks/{checkmark.eb3c7a06.js.map → checkmark.87919b24.js.map} +1 -1
- package/dist/chunks/{chevron-left.4ee92950.js → chevron-left.963d35e9.js} +2 -2
- package/dist/chunks/{chevron-left.4ee92950.js.map → chevron-left.963d35e9.js.map} +1 -1
- package/dist/chunks/{chevron-up.638a9f34.js → chevron-up.05ca20db.js} +2 -2
- package/dist/chunks/{chevron-up.638a9f34.js.map → chevron-up.05ca20db.js.map} +1 -1
- package/dist/chunks/{controls-group.2b31233c.js → controls-group.9e0f17b2.js} +3 -3
- package/dist/chunks/{controls-group.2b31233c.js.map → controls-group.9e0f17b2.js.map} +1 -1
- package/dist/chunks/{copy.9003ed59.js → copy.852d4cb8.js} +4 -4
- package/dist/chunks/{copy.9003ed59.js.map → copy.852d4cb8.js.map} +1 -1
- package/dist/chunks/{cross-circle-fill.1abec1a2.js → cross-circle-fill.81925c7f.js} +2 -2
- package/dist/chunks/{cross-circle-fill.1abec1a2.js.map → cross-circle-fill.81925c7f.js.map} +1 -1
- package/dist/chunks/{cross-small.b85406fe.js → cross-small.9bc6a02f.js} +2 -2
- package/dist/chunks/{cross-small.b85406fe.js.map → cross-small.9bc6a02f.js.map} +1 -1
- package/dist/chunks/{cross.26509efc.js → cross.a60533f6.js} +2 -2
- package/dist/chunks/{cross.26509efc.js.map → cross.a60533f6.js.map} +1 -1
- package/dist/chunks/dialog-page.ea67bb14.js +173 -0
- package/dist/chunks/dialog-page.ea67bb14.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.311443a8.js → dropdown-default-textbox.ad5063c2.js} +4 -4
- package/dist/chunks/{dropdown-default-textbox.311443a8.js.map → dropdown-default-textbox.ad5063c2.js.map} +1 -1
- package/dist/chunks/{dropdown.170b43c4.js → dropdown.d8587f36.js} +295 -317
- package/dist/chunks/dropdown.d8587f36.js.map +1 -0
- package/dist/chunks/{error-message.4678cbdc.js → error-message.3fb5573a.js} +3 -3
- package/dist/chunks/{error-message.4678cbdc.js.map → error-message.3fb5573a.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.f09618f2.js → fixed-scroller.59aefd1b.js} +3 -3
- package/dist/chunks/{fixed-scroller.f09618f2.js.map → fixed-scroller.59aefd1b.js.map} +1 -1
- package/dist/chunks/{footer-actions.2efe610e.js → footer-actions.89e68269.js} +4 -4
- package/dist/chunks/{footer-actions.2efe610e.js.map → footer-actions.89e68269.js.map} +1 -1
- package/dist/chunks/{index.1b1646bf.js → index.030c1dd7.js} +212 -191
- package/dist/chunks/index.030c1dd7.js.map +1 -0
- package/dist/chunks/{index.70c91b3b.js → index.07122048.js} +2 -2
- package/dist/chunks/{index.70c91b3b.js.map → index.07122048.js.map} +1 -1
- package/dist/chunks/{index.c41d1bbb.js → index.146f967e.js} +2 -2
- package/dist/chunks/{index.c41d1bbb.js.map → index.146f967e.js.map} +1 -1
- package/dist/chunks/{index.920cc1ee.js → index.5bdebf9d.js} +7 -7
- package/dist/chunks/{index.920cc1ee.js.map → index.5bdebf9d.js.map} +1 -1
- package/dist/chunks/{index.b772214b.js → index.6e0e9d21.js} +3 -3
- package/dist/chunks/{index.b772214b.js.map → index.6e0e9d21.js.map} +1 -1
- package/dist/chunks/{index.44f2aca7.js → index.8be283d5.js} +2 -2
- package/dist/chunks/{index.44f2aca7.js.map → index.8be283d5.js.map} +1 -1
- package/dist/chunks/{index.0d513625.js → index.96cd0d4c.js} +9 -9
- package/dist/chunks/{index.0d513625.js.map → index.96cd0d4c.js.map} +1 -1
- package/dist/chunks/{index.b3cb905c.js → index.9bf04b01.js} +3 -3
- package/dist/chunks/{index.b3cb905c.js.map → index.9bf04b01.js.map} +1 -1
- package/dist/chunks/{index.51fe0fc2.js → index.a3d60e4f.js} +17 -17
- package/dist/chunks/index.a3d60e4f.js.map +1 -0
- package/dist/chunks/{index.c5b58864.js → index.ba3396d3.js} +3 -3
- package/dist/chunks/{index.c5b58864.js.map → index.ba3396d3.js.map} +1 -1
- package/dist/chunks/{index.6987f880.js → index.c8ffede1.js} +7 -7
- package/dist/chunks/{index.6987f880.js.map → index.c8ffede1.js.map} +1 -1
- package/dist/chunks/{info.550f9511.js → info.205b4496.js} +2 -2
- package/dist/chunks/{info.550f9511.js.map → info.205b4496.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.bf77e0c4.js → listbox-option-tag.b6182b2e.js} +3 -3
- package/dist/chunks/{listbox-option-tag.bf77e0c4.js.map → listbox-option-tag.b6182b2e.js.map} +1 -1
- package/dist/chunks/{loading-button.cdc193c6.js → loading-button.0391ad8b.js} +4 -4
- package/dist/chunks/{loading-button.cdc193c6.js.map → loading-button.0391ad8b.js.map} +1 -1
- package/dist/chunks/{payment-method.ea1788f7.js → payment-method.31a68b9b.js} +2 -2
- package/dist/chunks/{payment-method.ea1788f7.js.map → payment-method.31a68b9b.js.map} +1 -1
- package/dist/chunks/{refresh.bd60f6a8.js → refresh.53691839.js} +2 -2
- package/dist/chunks/{refresh.bd60f6a8.js.map → refresh.53691839.js.map} +1 -1
- package/dist/chunks/{search.ade93bda.js → search.4e4ee4dd.js} +2 -2
- package/dist/chunks/{search.ade93bda.js.map → search.4e4ee4dd.js.map} +1 -1
- package/dist/chunks/{tooltip.10210728.js → tooltip.1084d92b.js} +3 -3
- package/dist/chunks/{tooltip.10210728.js.map → tooltip.1084d92b.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.3275a505.js → use-bento-toast-controller.98d8613c.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.3275a505.js.map → use-bento-toast-controller.98d8613c.js.map} +1 -1
- package/dist/chunks/use-cached-selected-values.852aeafe.js +1537 -0
- package/dist/chunks/use-cached-selected-values.852aeafe.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1317 -1256
- 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 +7 -7
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +1260 -1108
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +53 -51
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +5 -5
- package/dist/index.js +141 -133
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +4 -4
- package/dist/input-field.js +50 -48
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +31 -78
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +7 -7
- package/dist/modal.js +6 -6
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +112 -112
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +4 -4
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +4 -4
- package/dist/selection-card.js +5 -5
- package/dist/sidepanel.js +64 -62
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +4 -4
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +22 -20
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +7 -7
- package/dist/toast.js +5 -5
- package/dist/toggle.js +3 -3
- package/dist/tutorial.js +145 -124
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +7 -3
- package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +0 -8
- package/dist/chunks/dialog-page.2c07d294.js +0 -172
- package/dist/chunks/dialog-page.2c07d294.js.map +0 -1
- package/dist/chunks/dropdown.170b43c4.js.map +0 -1
- package/dist/chunks/index.1b1646bf.js.map +0 -1
- package/dist/chunks/index.51fe0fc2.js.map +0 -1
- package/dist/chunks/listbox.b6a1aea2.js +0 -1466
- package/dist/chunks/listbox.b6a1aea2.js.map +0 -1
- /package/dist/@types/packages/{vue2 → core}/src/components/typography/typography.types.d.ts +0 -0
- /package/dist/assets/{cross.css → checkmark-circle-fill.css} +0 -0
package/dist/card.js
CHANGED
|
@@ -1,305 +1,206 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { B as
|
|
3
|
-
import { C as
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { _ as
|
|
11
|
-
import "./assets/
|
|
12
|
-
var
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as W, useSlots as Y, ref as S, watch as B, computed as d, openBlock as s, createElementBlock as c, normalizeClass as i, unref as a, renderSlot as p, createCommentVNode as l, withKeys as L, createElementVNode as m, createBlock as h, mergeProps as j, withCtx as y, createVNode as A, Transition as q, normalizeStyle as G } from "vue";
|
|
2
|
+
import { B as E } from "./chunks/index.a3d60e4f.js";
|
|
3
|
+
import { C as J, a as Q } from "./chunks/chevron-up.05ca20db.js";
|
|
4
|
+
import { u as X } from "./chunks/use-expandable-content-height.62fc84e5.js";
|
|
5
|
+
import { u as Z } from "./chunks/use-has-slot.4d98bf29.js";
|
|
6
|
+
import { g as ee } from "./chunks/unique-id.a2a2b458.js";
|
|
7
|
+
import { u as ae } from "./chunks/i18n.f7e6533e.js";
|
|
8
|
+
import { o as te } from "./chunks/resize.a041304d.js";
|
|
9
|
+
import { c as ne, B as oe } from "./chunks/button-actions.642b37de.js";
|
|
10
|
+
import { _ as de } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
11
|
+
import "./assets/index26.css";
|
|
12
|
+
var T = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t))(T || {}), b = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.SMALL = "small", t))(b || {});
|
|
13
|
+
const D = {
|
|
14
14
|
"en-US": {
|
|
15
15
|
showCardContent: "Show card content",
|
|
16
16
|
hideCardContent: "Hide card content"
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
}, se = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "b-card__image"
|
|
21
|
+
}, le = ["tabindex", "aria-controls", "aria-expanded", "role", "onKeypress"], re = { class: "b-card__header-wrapper" }, ce = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "b-card__header-slot-wrapper"
|
|
24
|
+
}, ie = ["id"], ue = {
|
|
25
|
+
i18n: { messages: D },
|
|
26
|
+
name: "bento-card"
|
|
27
|
+
}, be = /* @__PURE__ */ W({
|
|
28
|
+
...ue,
|
|
22
29
|
props: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* Defines the title size of the card header
|
|
33
|
-
*/
|
|
34
|
-
titleSize: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: p.DEFAULT,
|
|
37
|
-
validator: (e) => Object.values(p).includes(e)
|
|
38
|
-
},
|
|
39
|
-
/**
|
|
40
|
-
* The whole content of the card will be expandable in accordion manner
|
|
41
|
-
*/
|
|
42
|
-
expandable: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: !1
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Sets the expandable card in a closed state
|
|
48
|
-
*/
|
|
49
|
-
closed: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: !1
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* Disables the expandable card
|
|
55
|
-
*/
|
|
56
|
-
disabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: !1
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* List of actions that will be used to render the buttons.
|
|
62
|
-
* First element in the list will be rendered as "primary".
|
|
63
|
-
* All elements after the first will be rendered as "secondary".
|
|
64
|
-
*
|
|
65
|
-
* Each object in the list should have a `title`, an `event` and
|
|
66
|
-
* (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
|
|
67
|
-
*
|
|
68
|
-
* `title`: Button's text.
|
|
69
|
-
*
|
|
70
|
-
* `event`: Event triggered when clicking the Button.
|
|
71
|
-
*
|
|
72
|
-
* `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.
|
|
73
|
-
*
|
|
74
|
-
* ```
|
|
75
|
-
* [{
|
|
76
|
-
* title: 'Primary',
|
|
77
|
-
* event: () => { ... },
|
|
78
|
-
* icon: FourPeopleIcon
|
|
79
|
-
* }, {
|
|
80
|
-
* title: 'Secondary',
|
|
81
|
-
* event: () => { ... }
|
|
82
|
-
* }]
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
actions: {
|
|
86
|
-
type: Array,
|
|
87
|
-
default: null
|
|
88
|
-
},
|
|
89
|
-
/**
|
|
90
|
-
* Defines the layout in which the button actions is presented.
|
|
91
|
-
* It can be one of:
|
|
92
|
-
*
|
|
93
|
-
* @values BUTTONS_START
|
|
94
|
-
* @values BUTTONS_END
|
|
95
|
-
* @values FILL_CONTAINER
|
|
96
|
-
* @values SPACE_BETWEEN
|
|
97
|
-
* @values VERTICAL_STACK
|
|
98
|
-
*/
|
|
99
|
-
actionsLayout: {
|
|
100
|
-
type: String,
|
|
101
|
-
default: H.BUTTONS_END,
|
|
102
|
-
validator: (e) => Object.values(H).includes(e)
|
|
103
|
-
}
|
|
30
|
+
actions: { default: null },
|
|
31
|
+
actionsLayout: { default: ne.BUTTONS_END },
|
|
32
|
+
background: { default: T.PRIMARY },
|
|
33
|
+
closed: { type: Boolean, default: !1 },
|
|
34
|
+
disabled: { type: Boolean, default: !1 },
|
|
35
|
+
expandable: { type: Boolean, default: !1 },
|
|
36
|
+
titleSize: { default: b.DEFAULT }
|
|
104
37
|
},
|
|
105
38
|
emits: ["click", "expanded"],
|
|
106
|
-
setup(
|
|
107
|
-
const { t:
|
|
108
|
-
|
|
39
|
+
setup(t, { emit: f }) {
|
|
40
|
+
const e = t, { t: x } = ae({ messages: D }), H = Y(), o = Z(H), u = S(null), C = ee("card"), r = S(!e.closed);
|
|
41
|
+
B(
|
|
109
42
|
() => e.closed,
|
|
110
|
-
(
|
|
111
|
-
|
|
43
|
+
(n) => {
|
|
44
|
+
r.value = !n;
|
|
112
45
|
}
|
|
113
46
|
);
|
|
114
|
-
const
|
|
47
|
+
const _ = d(() => o("default") || o("description") || o("header")), I = d(() => o("default") || o("header")), g = d(
|
|
115
48
|
() => {
|
|
116
|
-
var
|
|
117
|
-
return (o("content") || ((
|
|
49
|
+
var n;
|
|
50
|
+
return (o("content") || ((n = e.actions) == null ? void 0 : n.length)) && (!e.expandable || e.expandable && r.value);
|
|
118
51
|
}
|
|
119
|
-
),
|
|
52
|
+
), z = d(() => e.expandable && !e.disabled ? 0 : -1), M = d(() => ({
|
|
120
53
|
[`b-card--${e.background}`]: e.background,
|
|
121
54
|
"b-card--expandable": e.expandable,
|
|
122
55
|
"b-card--disabled": e.expandable && e.disabled
|
|
123
|
-
})),
|
|
56
|
+
})), N = d(() => ({
|
|
124
57
|
"b-card__header--expandable": e.expandable,
|
|
125
|
-
"b-card__header--without-body": !e.expandable && !
|
|
126
|
-
})),
|
|
127
|
-
"b-card__toggle--small-text": e.titleSize ===
|
|
128
|
-
})),
|
|
58
|
+
"b-card__header--without-body": !e.expandable && !g.value
|
|
59
|
+
})), U = d(() => ({
|
|
60
|
+
"b-card__toggle--small-text": e.titleSize === b.SMALL
|
|
61
|
+
})), $ = d(() => ({
|
|
129
62
|
"b-card__body--expandable": e.expandable && o("content"),
|
|
130
|
-
"b-card__body--without-header": !e.expandable && !
|
|
131
|
-
})),
|
|
132
|
-
"b-card__content--without-header": !e.expandable && !
|
|
63
|
+
"b-card__body--without-header": !e.expandable && !_.value
|
|
64
|
+
})), R = d(() => ({
|
|
65
|
+
"b-card__content--without-header": !e.expandable && !_.value,
|
|
133
66
|
"b-card__content--expandable": e.expandable
|
|
134
|
-
})),
|
|
135
|
-
const
|
|
67
|
+
})), F = d(() => {
|
|
68
|
+
const n = !e.expandable && e.actions && !o("content");
|
|
136
69
|
return {
|
|
137
|
-
"b-card__actions--without-content":
|
|
138
|
-
"b-card__actions--without-content-and-with-header":
|
|
70
|
+
"b-card__actions--without-content": n,
|
|
71
|
+
"b-card__actions--without-content-and-with-header": n && _.value
|
|
139
72
|
};
|
|
140
|
-
}),
|
|
73
|
+
}), K = d(() => ({
|
|
141
74
|
"b-card__title-wrapper--truncated": o("header")
|
|
142
|
-
})),
|
|
75
|
+
})), O = d(
|
|
143
76
|
() => ({
|
|
144
77
|
el: "div",
|
|
145
|
-
variant: e.titleSize ===
|
|
146
|
-
strongest: e.titleSize ===
|
|
147
|
-
wide: e.titleSize ===
|
|
78
|
+
variant: e.titleSize === b.DEFAULT ? "title" : "body",
|
|
79
|
+
strongest: e.titleSize === b.SMALL,
|
|
80
|
+
wide: e.titleSize === b.SMALL
|
|
148
81
|
})
|
|
149
|
-
), { updateContentHeight:
|
|
150
|
-
() => e.expandable &&
|
|
82
|
+
), { updateContentHeight: w, contentHeight: k } = X(u, r), P = d(
|
|
83
|
+
() => e.expandable && k.value ? { "max-height": k.value } : {}
|
|
151
84
|
);
|
|
152
|
-
|
|
153
|
-
() =>
|
|
85
|
+
B(
|
|
86
|
+
() => u.value,
|
|
154
87
|
() => {
|
|
155
|
-
let
|
|
156
|
-
!
|
|
157
|
-
|
|
88
|
+
let n = null;
|
|
89
|
+
!n && u.value && (n = te(u.value, () => {
|
|
90
|
+
u.value && w();
|
|
158
91
|
}));
|
|
159
92
|
}
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
cardHeaderConditionalClasses: M,
|
|
166
|
-
cardContentConditionalClasses: U,
|
|
167
|
-
cardActionsConditionalClasses: x,
|
|
168
|
-
cardTitleWrapperConditionalClasses: O,
|
|
169
|
-
cardToggleConditionalClasses: z,
|
|
170
|
-
showCardBody: d,
|
|
171
|
-
showContent: i,
|
|
172
|
-
tabIndex: $,
|
|
173
|
-
showHeader: u,
|
|
174
|
-
showTitleWrapper: y,
|
|
175
|
-
typography: R,
|
|
176
|
-
// Expand animation
|
|
177
|
-
contentDiv: c,
|
|
178
|
-
contentMaxHeight: W,
|
|
179
|
-
// Methods
|
|
180
|
-
hasSlot: o,
|
|
181
|
-
onClick: () => {
|
|
182
|
-
e.disabled || n("click");
|
|
183
|
-
},
|
|
184
|
-
t: k,
|
|
185
|
-
toggleExpansion: () => {
|
|
186
|
-
!e.disabled && e.expandable && (i.value = !i.value, n("expanded", i.value), S());
|
|
187
|
-
}
|
|
93
|
+
);
|
|
94
|
+
const v = () => {
|
|
95
|
+
!e.disabled && e.expandable && (r.value = !r.value, f("expanded", r.value), w());
|
|
96
|
+
}, V = () => {
|
|
97
|
+
e.disabled || f("click");
|
|
188
98
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
class: "b-card__image"
|
|
194
|
-
}, oe = ["tabindex", "aria-controls", "aria-expanded", "role"], de = { class: "b-card__header-wrapper" }, le = {
|
|
195
|
-
key: 0,
|
|
196
|
-
class: "b-card__header-slot-wrapper"
|
|
197
|
-
}, se = ["id"];
|
|
198
|
-
function ie(e, n, w, k, o, c) {
|
|
199
|
-
const g = v("chevron-up-icon"), i = v("chevron-down-icon"), u = v("bento-typography"), y = v("bento-button-actions");
|
|
200
|
-
return t(), r("div", {
|
|
201
|
-
class: b(["b-card", e.cardConditionalClasses]),
|
|
202
|
-
"data-testid": "card",
|
|
203
|
-
onClick: n[3] || (n[3] = (...d) => e.onClick && e.onClick(...d))
|
|
204
|
-
}, [
|
|
205
|
-
e.hasSlot("image") ? (t(), r("div", ne, [
|
|
206
|
-
h(e.$slots, "image", {}, void 0, !0)
|
|
207
|
-
])) : s("", !0),
|
|
208
|
-
e.showHeader ? (t(), r("div", {
|
|
209
|
-
key: 1,
|
|
210
|
-
class: b(["b-card__header", e.cardHeaderConditionalClasses]),
|
|
211
|
-
tabindex: e.tabIndex,
|
|
212
|
-
"aria-controls": e.expandable ? e.cardId : null,
|
|
213
|
-
"aria-expanded": e.expandable ? `${e.showContent}` : null,
|
|
214
|
-
role: e.expandable ? "button" : null,
|
|
215
|
-
onClick: n[0] || (n[0] = (...d) => e.toggleExpansion && e.toggleExpansion(...d)),
|
|
216
|
-
onKeypress: [
|
|
217
|
-
n[1] || (n[1] = L((...d) => e.toggleExpansion && e.toggleExpansion(...d), ["enter"])),
|
|
218
|
-
n[2] || (n[2] = L((...d) => e.toggleExpansion && e.toggleExpansion(...d), ["space"]))
|
|
219
|
-
]
|
|
99
|
+
return (n, pe) => (s(), c("div", {
|
|
100
|
+
class: i(["b-card", a(M)]),
|
|
101
|
+
"data-testid": "card",
|
|
102
|
+
onClick: V
|
|
220
103
|
}, [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
104
|
+
a(o)("image") ? (s(), c("div", se, [
|
|
105
|
+
p(n.$slots, "image", {}, void 0, !0)
|
|
106
|
+
])) : l("", !0),
|
|
107
|
+
a(_) ? (s(), c("div", {
|
|
108
|
+
key: 1,
|
|
109
|
+
class: i(["b-card__header", a(N)]),
|
|
110
|
+
tabindex: a(z),
|
|
111
|
+
"aria-controls": t.expandable ? a(C) : null,
|
|
112
|
+
"aria-expanded": t.expandable ? `${r.value}` : null,
|
|
113
|
+
role: t.expandable ? "button" : null,
|
|
114
|
+
onClick: v,
|
|
115
|
+
onKeypress: [
|
|
116
|
+
L(v, ["enter"]),
|
|
117
|
+
L(v, ["space"])
|
|
118
|
+
]
|
|
119
|
+
}, [
|
|
120
|
+
m("div", re, [
|
|
121
|
+
a(I) ? (s(), c("div", ce, [
|
|
122
|
+
m("div", {
|
|
123
|
+
class: i(["b-card__title-wrapper", a(K)])
|
|
229
124
|
}, [
|
|
230
|
-
|
|
125
|
+
t.expandable ? (s(), c("div", {
|
|
231
126
|
key: 0,
|
|
232
|
-
"
|
|
233
|
-
|
|
234
|
-
|
|
127
|
+
class: i(["b-card__toggle", a(U)])
|
|
128
|
+
}, [
|
|
129
|
+
r.value ? (s(), h(a(J), {
|
|
130
|
+
key: 0,
|
|
131
|
+
"svg-title": a(x)("hideCardContent"),
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}, null, 8, ["svg-title"])) : (s(), h(a(Q), {
|
|
134
|
+
key: 1,
|
|
135
|
+
"svg-title": a(x)("showCardContent"),
|
|
136
|
+
"aria-hidden": "true"
|
|
137
|
+
}, null, 8, ["svg-title"]))
|
|
138
|
+
], 2)) : l("", !0),
|
|
139
|
+
a(o)("default") ? (s(), h(a(E), j({
|
|
235
140
|
key: 1,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
T(P, { name: "b-card__animation" }, {
|
|
266
|
-
default: _(() => [
|
|
267
|
-
e.showCardBody ? (t(), r("div", {
|
|
268
|
-
key: 0,
|
|
269
|
-
class: "b-card__wrapper",
|
|
270
|
-
style: V(e.contentMaxHeight)
|
|
271
|
-
}, [
|
|
272
|
-
m("div", {
|
|
273
|
-
id: e.expandable ? e.cardId : null,
|
|
274
|
-
ref: "contentDiv",
|
|
275
|
-
class: b(["b-card__body", e.cardBodyConditionalClasses])
|
|
141
|
+
class: "b-card__title"
|
|
142
|
+
}, a(O)), {
|
|
143
|
+
default: y(() => [
|
|
144
|
+
p(n.$slots, "default", {}, void 0, !0)
|
|
145
|
+
]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 16)) : l("", !0)
|
|
148
|
+
], 2),
|
|
149
|
+
a(o)("header") ? p(n.$slots, "header", { key: 0 }, void 0, !0) : l("", !0)
|
|
150
|
+
])) : l("", !0),
|
|
151
|
+
a(o)("description") ? (s(), h(a(E), {
|
|
152
|
+
key: 1,
|
|
153
|
+
class: "b-card__description",
|
|
154
|
+
el: "div",
|
|
155
|
+
variant: "body"
|
|
156
|
+
}, {
|
|
157
|
+
default: y(() => [
|
|
158
|
+
p(n.$slots, "description", {}, void 0, !0)
|
|
159
|
+
]),
|
|
160
|
+
_: 3
|
|
161
|
+
})) : l("", !0)
|
|
162
|
+
])
|
|
163
|
+
], 42, le)) : l("", !0),
|
|
164
|
+
A(q, { name: "b-card__animation" }, {
|
|
165
|
+
default: y(() => [
|
|
166
|
+
a(g) ? (s(), c("div", {
|
|
167
|
+
key: 0,
|
|
168
|
+
class: "b-card__wrapper",
|
|
169
|
+
style: G(a(P))
|
|
276
170
|
}, [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
171
|
+
m("div", {
|
|
172
|
+
id: t.expandable ? a(C) : null,
|
|
173
|
+
ref_key: "contentDiv",
|
|
174
|
+
ref: u,
|
|
175
|
+
class: i(["b-card__body", a($)])
|
|
280
176
|
}, [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
177
|
+
a(o)("content") ? (s(), c("div", {
|
|
178
|
+
key: 0,
|
|
179
|
+
class: i(["b-card__content", a(R)])
|
|
180
|
+
}, [
|
|
181
|
+
p(n.$slots, "content", {}, void 0, !0)
|
|
182
|
+
], 2)) : l("", !0),
|
|
183
|
+
t.actions ? (s(), c("div", {
|
|
184
|
+
key: 1,
|
|
185
|
+
class: i(["b-card__actions", a(F)])
|
|
186
|
+
}, [
|
|
187
|
+
A(a(oe), {
|
|
188
|
+
actions: t.actions,
|
|
189
|
+
layout: t.actionsLayout
|
|
190
|
+
}, null, 8, ["actions", "layout"])
|
|
191
|
+
], 2)) : l("", !0)
|
|
192
|
+
], 10, ie)
|
|
193
|
+
], 4)) : l("", !0)
|
|
194
|
+
]),
|
|
195
|
+
_: 3
|
|
196
|
+
})
|
|
197
|
+
], 2));
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
const ke = /* @__PURE__ */ de(be, [["__scopeId", "data-v-2cdd9489"]]);
|
|
300
201
|
export {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
202
|
+
ke as BentoCard,
|
|
203
|
+
T as BentoCardBackground,
|
|
204
|
+
b as BentoCardTitleSize
|
|
304
205
|
};
|
|
305
206
|
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-card',\n components: { ChevronUpIcon, ChevronDownIcon, BentoTypography, BentoButtonActions },\n props: {\n /**\n * Defines the color of card background\n */\n background: {\n type: String as PropType<BentoCardBackground | `${BentoCardBackground}`>,\n default: BentoCardBackground.PRIMARY,\n validator: (value: BentoCardBackground) => Object.values(BentoCardBackground).includes(value),\n },\n /**\n * Defines the title size of the card header\n */\n titleSize: {\n type: String as PropType<BentoCardTitleSize | `${BentoCardTitleSize}`>,\n default: BentoCardTitleSize.DEFAULT,\n validator: (value: BentoCardTitleSize) => Object.values(BentoCardTitleSize).includes(value),\n },\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Sets the expandable card in a closed state\n */\n closed: {\n type: Boolean,\n default: false,\n },\n /**\n * Disables the expandable card\n */\n disabled: {\n type: Boolean,\n default: false,\n },\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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\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 * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (value: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(value),\n },\n },\n emits: ['click', 'expanded'],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header':\n isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n\n return {\n // Values\n cardId,\n cardConditionalClasses,\n cardBodyConditionalClasses,\n cardHeaderConditionalClasses,\n cardContentConditionalClasses,\n cardActionsConditionalClasses,\n cardTitleWrapperConditionalClasses,\n cardToggleConditionalClasses,\n showCardBody,\n showContent,\n tabIndex,\n showHeader,\n showTitleWrapper,\n typography,\n\n // Expand animation\n contentDiv,\n contentMaxHeight,\n\n // Methods\n hasSlot,\n onClick,\n t,\n toggleExpansion,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","_sfc_main","defineComponent","messages","ChevronUpIcon","ChevronDownIcon","BentoTypography","BentoButtonActions","value","BentoButtonActionsLayout","props","emit","slots","t","useI18n","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","watch","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createElementVNode","_hoisted_3","_hoisted_4","createBlock","_component_chevron_up_icon","_component_chevron_down_icon","createCommentVNode","_component_bento_typography","mergeProps","withCtx","renderSlot","_hoisted_2","createVNode","Transition"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,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,UAAO,OAAA;AAAA;QAc7C,GAAA;AAAA,UAXcK,EAAA,OAAA;AAAA,YAAA,IAAAH,EAAA,aAAAA,EAAA,SAAA;AAAA,YACV,KAAA;AAAA;UAGY,GAAA;AAAA;cAAmB,KAAA;AAAA;YACV,GAAA;AAAA;;YAG3BA,EAAA,WAAAH,EAAA,GAAAC,EAAA,OAAA;AAAA,cAA0B,KAAA;AAAA;YACkE,GAAA;AAAA;gBAAzB,SAAAE,EAAA;AAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../vue2/src/components/card/card.types.ts","../../vue2/src/components/card/card.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardBackground {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCardTitleSize {\n DEFAULT = 'default',\n SMALL = 'small',\n}\n","<template>\n <div class=\"b-card\" :class=\"cardConditionalClasses\" data-testid=\"card\" @click=\"onClick\">\n <div v-if=\"hasSlot('image')\" class=\"b-card__image\">\n <slot name=\"image\"></slot>\n </div>\n <div\n v-if=\"showHeader\"\n class=\"b-card__header\"\n :class=\"cardHeaderConditionalClasses\"\n :tabindex=\"tabIndex\"\n :aria-controls=\"expandable ? cardId : null\"\n :aria-expanded=\"expandable ? `${showContent}` : null\"\n :role=\"expandable ? 'button' : null\"\n @click=\"toggleExpansion\"\n @keypress.enter=\"toggleExpansion\"\n @keypress.space=\"toggleExpansion\"\n >\n <div class=\"b-card__header-wrapper\">\n <div v-if=\"showTitleWrapper\" class=\"b-card__header-slot-wrapper\">\n <div class=\"b-card__title-wrapper\" :class=\"cardTitleWrapperConditionalClasses\">\n <div v-if=\"expandable\" class=\"b-card__toggle\" :class=\"cardToggleConditionalClasses\">\n <chevron-up-icon v-if=\"showContent\" :svg-title=\"t('hideCardContent')\" aria-hidden=\"true\" />\n <chevron-down-icon v-else :svg-title=\"t('showCardContent')\" aria-hidden=\"true\" />\n </div>\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-card__title\" v-bind=\"typography\">\n <slot />\n </bento-typography>\n </div>\n\n <template v-if=\"hasSlot('header')\">\n <slot name=\"header\"></slot>\n </template>\n </div>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-card__description\" el=\"div\" variant=\"body\">\n <slot name=\"description\" />\n </bento-typography>\n </div>\n </div>\n\n <Transition name=\"b-card__animation\">\n <div v-if=\"showCardBody\" class=\"b-card__wrapper\" :style=\"contentMaxHeight\">\n <div\n :id=\"expandable ? cardId : null\"\n ref=\"contentDiv\"\n class=\"b-card__body\"\n :class=\"cardBodyConditionalClasses\"\n >\n <div v-if=\"hasSlot('content')\" class=\"b-card__content\" :class=\"cardContentConditionalClasses\">\n <slot name=\"content\" />\n </div>\n\n <div v-if=\"actions\" class=\"b-card__actions\" :class=\"cardActionsConditionalClasses\">\n <bento-button-actions :actions=\"actions\" :layout=\"actionsLayout\"></bento-button-actions>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, useSlots, watch } from 'vue';\n\n // Components\n import { BentoTypography } from '@/components/typography';\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoCardBackground, BentoCardTitleSize } from '@/components/card/card.types';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n\n // Composables\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useI18n } from '@/utils/ts/i18n';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = withDefaults(\n 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions?: BentoButtonActionsList;\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n actionsLayout?: BentoButtonActionsLayout | `${BentoButtonActionsLayout}`;\n\n /**\n * Defines the color of card background\n */\n background?: BentoCardBackground | `${BentoCardBackground}`;\n\n /**\n * Sets the expandable card in a closed state\n */\n closed?: boolean;\n\n /**\n * Disables the expandable card\n */\n disabled?: boolean;\n\n /**\n * The whole content of the card will be expandable in accordion manner\n */\n expandable?: boolean;\n\n /**\n * Defines the title size of the card header\n */\n titleSize?: BentoCardTitleSize | `${BentoCardTitleSize}`;\n }>(),\n {\n actions: null,\n actionsLayout: BentoButtonActionsLayout.BUTTONS_END,\n background: BentoCardBackground.PRIMARY,\n closed: false,\n disabled: false,\n expandable: false,\n titleSize: BentoCardTitleSize.DEFAULT,\n }\n );\n\n const emit = defineEmits<{\n (e: 'click');\n (e: 'expanded', isExpanded: boolean);\n }>();\n\n const contentDiv = ref<HTMLDivElement>(null);\n\n const cardId = generateUid('card');\n const showContent = ref(!props.closed);\n watch(\n () => props.closed,\n value => {\n showContent.value = !value;\n }\n );\n const showHeader = computed(() => hasSlot('default') || hasSlot('description') || hasSlot('header'));\n const showTitleWrapper = computed(() => hasSlot('default') || hasSlot('header'));\n const showCardBody = computed(\n () =>\n (hasSlot('content') || props.actions?.length) &&\n (!props.expandable || (props.expandable && showContent.value))\n );\n const tabIndex = computed(() => (props.expandable && !props.disabled ? 0 : -1));\n\n const cardConditionalClasses = computed(() => ({\n [`b-card--${props.background}`]: props.background,\n 'b-card--expandable': props.expandable,\n 'b-card--disabled': props.expandable && props.disabled,\n }));\n\n const cardHeaderConditionalClasses = computed(() => ({\n 'b-card__header--expandable': props.expandable,\n 'b-card__header--without-body': !props.expandable && !showCardBody.value,\n }));\n\n const cardToggleConditionalClasses = computed(() => ({\n 'b-card__toggle--small-text': props.titleSize === BentoCardTitleSize.SMALL,\n }));\n\n const cardBodyConditionalClasses = computed(() => ({\n 'b-card__body--expandable': props.expandable && hasSlot('content'),\n 'b-card__body--without-header': !props.expandable && !showHeader.value,\n }));\n\n const cardContentConditionalClasses = computed(() => ({\n 'b-card__content--without-header': !props.expandable && !showHeader.value,\n 'b-card__content--expandable': props.expandable,\n }));\n\n const cardActionsConditionalClasses = computed(() => {\n const isNotExpandableWithoutContent = !props.expandable && props.actions && !hasSlot('content');\n\n return {\n 'b-card__actions--without-content': isNotExpandableWithoutContent,\n 'b-card__actions--without-content-and-with-header': isNotExpandableWithoutContent && showHeader.value,\n };\n });\n\n const cardTitleWrapperConditionalClasses = computed(() => ({\n 'b-card__title-wrapper--truncated': hasSlot('header'),\n }));\n\n const typography = computed(\n () =>\n ({\n el: 'div',\n variant: props.titleSize === BentoCardTitleSize.DEFAULT ? 'title' : 'body',\n strongest: props.titleSize === BentoCardTitleSize.SMALL,\n wide: props.titleSize === BentoCardTitleSize.SMALL,\n } as InstanceType<typeof BentoTypography>['$props'])\n );\n\n // Toggle open and close logic and animation\n const { updateContentHeight, contentHeight } = useExpandableContentHeight(contentDiv, showContent);\n\n const contentMaxHeight = computed(() =>\n props.expandable && contentHeight.value ? { 'max-height': contentHeight.value } : {}\n );\n\n watch(\n () => contentDiv.value,\n () => {\n let observer: ResizeObserver | null = null;\n if (!observer && contentDiv.value) {\n observer = observeSizeOfElement(contentDiv.value, () => {\n if (contentDiv.value) {\n updateContentHeight();\n }\n });\n }\n }\n );\n\n const toggleExpansion = () => {\n if (!props.disabled && props.expandable) {\n showContent.value = !showContent.value;\n emit('expanded', showContent.value);\n updateContentHeight();\n }\n };\n\n const onClick = () => {\n if (!props.disabled) {\n emit('click');\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * A card is a flexible and composable container.\n * Use cards to represent a single object or to visually group certain content, like legal information within company settings.\n *\n * @example\n * import { BentoCard } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCard },\n * template: `\n * <bento-card>\n * Title of the Card\n * </bento-card>\n * `\n * };\n */\n export default {\n i18n: { messages },\n name: 'bento-card',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./card.scss\" />\n"],"names":["BentoCardBackground","BentoCardBackground2","BentoCardTitleSize","BentoCardTitleSize2","__default__","messages","t","useI18n","slots","useSlots","hasSlot","useHasSlot","contentDiv","ref","cardId","generateUid","showContent","props","watch","value","showHeader","computed","showTitleWrapper","showCardBody","_a","tabIndex","cardConditionalClasses","cardHeaderConditionalClasses","cardToggleConditionalClasses","cardBodyConditionalClasses","cardContentConditionalClasses","cardActionsConditionalClasses","isNotExpandableWithoutContent","cardTitleWrapperConditionalClasses","typography","updateContentHeight","contentHeight","useExpandableContentHeight","contentMaxHeight","observer","observeSizeOfElement","toggleExpansion","emit","onClick"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;gBCwRRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;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AAA,OAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/checkbox.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B, a as l } from "./chunks/checkbox.
|
|
2
|
-
import { C as le } from "./chunks/checkbox-input.
|
|
1
|
+
import { B, a as l } from "./chunks/checkbox.f55ee3a5.js";
|
|
2
|
+
import { C as le } from "./chunks/checkbox-input.ab758a81.js";
|
|
3
3
|
import { defineComponent as M, toRef as I, computed as s, watch as y, ref as T, resolveComponent as m, openBlock as n, createElementBlock as v, createVNode as N, normalizeClass as V, withCtx as d, Fragment as w, renderList as G, createBlock as E, createSlots as O, createTextVNode as k, toDisplayString as C, renderSlot as A, normalizeProps as L, guardReactiveProps as P, createCommentVNode as R } from "vue";
|
|
4
4
|
import { g as U } from "./chunks/unique-id.a2a2b458.js";
|
|
5
|
-
import { d as q } from "./chunks/index.
|
|
5
|
+
import { d as q } from "./chunks/index.a3d60e4f.js";
|
|
6
6
|
import { u as x } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
7
|
-
import { C as $ } from "./chunks/controls-group.
|
|
8
|
-
import { E as z } from "./chunks/error-message.
|
|
7
|
+
import { C as $ } from "./chunks/controls-group.9e0f17b2.js";
|
|
8
|
+
import { E as z } from "./chunks/error-message.3fb5573a.js";
|
|
9
9
|
import { _ as D } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
10
|
-
import "./assets/
|
|
10
|
+
import "./assets/index5.css";
|
|
11
11
|
var i = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e))(i || {});
|
|
12
12
|
const S = "bento-checkbox-group", F = M({
|
|
13
13
|
name: S,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as B, computed as C, ref as y, resolveComponent as _, openBlock as r, createElementBlock as l, normalizeClass as m, renderSlot as u, createCommentVNode as d, createBlock as S, withCtx as k } from "vue";
|
|
2
|
-
import { B as g } from "./index.
|
|
2
|
+
import { B as g } from "./index.a3d60e4f.js";
|
|
3
3
|
import { u as h } from "./use-has-slot.4d98bf29.js";
|
|
4
4
|
import { _ as L } from "./_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import "../assets/base-button.css";
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
T as B,
|
|
114
114
|
n as a
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=base-button.
|
|
116
|
+
//# sourceMappingURL=base-button.e84acf30.js.map
|