@adyen/bento-vue3 1.5.0 → 1.6.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/avatar-image/avatar-image.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +77 -77
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +7 -1
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateStickyElementHeight/useCalculateStickyElementHeight.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +49 -11
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +32 -33
- 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/dropdown.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +60 -60
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/boolean-filter/boolean-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +7 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +11 -1
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue.d.ts +17 -1
- package/dist/@types/packages/vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-tip.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/composables/useFixedScroller.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/fixed-scroller.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/fixed-scroller/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +4 -5
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +10 -1
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +24 -52
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +13 -13
- package/dist/@types/packages/vue2/src/composables/use-expandable-content-height/use-expandable-content-height.d.ts +4 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.types.d.ts +6 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +77 -1
- package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/utils/ts/truncate.d.ts +1 -1
- package/dist/accordion.js +42 -47
- package/dist/accordion.js.map +1 -1
- package/dist/alert.js +4 -4
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/controls-group.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/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 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/loading-button.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 +135 -121
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +24 -25
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.9740f320.js → base-button.90687c75.js} +3 -3
- package/dist/chunks/{base-button.9740f320.js.map → base-button.90687c75.js.map} +1 -1
- package/dist/chunks/{base-modal.be77971f.js → base-modal.c956b084.js} +58 -58
- package/dist/chunks/base-modal.c956b084.js.map +1 -0
- package/dist/chunks/{button.7072457f.js → button.9d72e2d7.js} +3 -3
- package/dist/chunks/{button.7072457f.js.map → button.9d72e2d7.js.map} +1 -1
- package/dist/chunks/{calendar.1e50c7d1.js → calendar.e7db78d0.js} +6 -5
- package/dist/chunks/{calendar.1e50c7d1.js.map → calendar.e7db78d0.js.map} +1 -1
- package/dist/chunks/{checkbox.638bab98.js → checkbox.ecbb4f0c.js} +4 -4
- package/dist/chunks/{checkbox.638bab98.js.map → checkbox.ecbb4f0c.js.map} +1 -1
- package/dist/chunks/{controls-group.efcf4e8d.js → controls-group.34f1f82a.js} +2 -2
- package/dist/chunks/{controls-group.efcf4e8d.js.map → controls-group.34f1f82a.js.map} +1 -1
- package/dist/chunks/{copy.527c3d76.js → copy.aaec57b6.js} +3 -3
- package/dist/chunks/{copy.527c3d76.js.map → copy.aaec57b6.js.map} +1 -1
- package/dist/chunks/date-input.9186a0bf.js.map +1 -1
- package/dist/chunks/{dropdown-default-textbox.a1789dc7.js → dropdown-default-textbox.88a42e9b.js} +3 -3
- package/dist/chunks/{dropdown-default-textbox.a1789dc7.js.map → dropdown-default-textbox.88a42e9b.js.map} +1 -1
- package/dist/chunks/{dropdown.22e51667.js → dropdown.6a484461.js} +182 -177
- package/dist/chunks/dropdown.6a484461.js.map +1 -0
- package/dist/chunks/{error-message.37b6c7aa.js → error-message.11e1fa1f.js} +2 -2
- package/dist/chunks/{error-message.37b6c7aa.js.map → error-message.11e1fa1f.js.map} +1 -1
- package/dist/chunks/{footer-actions.5275203a.js → footer-actions.a65cb2e3.js} +3 -3
- package/dist/chunks/{footer-actions.5275203a.js.map → footer-actions.a65cb2e3.js.map} +1 -1
- package/dist/chunks/{grid-layout.c98e6bc7.js → grid-layout.7c919507.js} +2 -2
- package/dist/chunks/{grid-layout.c98e6bc7.js.map → grid-layout.7c919507.js.map} +1 -1
- package/dist/chunks/{index.c22c4278.js → index.424e2ea4.js} +6 -6
- package/dist/chunks/{index.c22c4278.js.map → index.424e2ea4.js.map} +1 -1
- package/dist/chunks/{index.dd20095f.js → index.655b761f.js} +3 -3
- package/dist/chunks/{index.dd20095f.js.map → index.655b761f.js.map} +1 -1
- package/dist/chunks/{index.c62ea69f.js → index.754349ff.js} +2 -2
- package/dist/chunks/{index.c62ea69f.js.map → index.754349ff.js.map} +1 -1
- package/dist/chunks/{index.a57930ba.js → index.84f6360f.js} +11 -10
- package/dist/chunks/{index.a57930ba.js.map → index.84f6360f.js.map} +1 -1
- package/dist/chunks/{index.32ed68b7.js → index.9fc54b60.js} +2 -2
- package/dist/chunks/{index.32ed68b7.js.map → index.9fc54b60.js.map} +1 -1
- package/dist/chunks/{index.604da8e9.js → index.bc9e0cde.js} +3 -3
- package/dist/chunks/{index.604da8e9.js.map → index.bc9e0cde.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.fa70334e.js → listbox-option-tag.ea9f377f.js} +3 -3
- package/dist/chunks/{listbox-option-tag.fa70334e.js.map → listbox-option-tag.ea9f377f.js.map} +1 -1
- package/dist/chunks/{listbox.4205c0de.js → listbox.a7255ce1.js} +4 -4
- package/dist/chunks/{listbox.4205c0de.js.map → listbox.a7255ce1.js.map} +1 -1
- package/dist/chunks/{loading-button.41c15584.js → loading-button.fb1f20a3.js} +32 -32
- package/dist/chunks/loading-button.fb1f20a3.js.map +1 -0
- package/dist/chunks/on-click-outside.3e0c3e2a.js.map +1 -1
- package/dist/chunks/{tooltip.c8350cd0.js → tooltip.6af06509.js} +64 -63
- package/dist/chunks/tooltip.6af06509.js.map +1 -0
- package/dist/chunks/use-expandable-content-height.62fc84e5.js +17 -0
- package/dist/chunks/use-expandable-content-height.62fc84e5.js.map +1 -0
- package/dist/chunks/use-has-slot.4d98bf29.js +15 -0
- package/dist/chunks/use-has-slot.4d98bf29.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.js +944 -888
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +7 -7
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +990 -904
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +81 -70
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +92 -87
- package/dist/header.js.map +1 -1
- package/dist/index.js +14 -14
- package/dist/info-icon.js +12 -12
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +115 -110
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +144 -18
- package/dist/internal.js.map +1 -1
- package/dist/link.js +38 -35
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +8 -6
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +52 -44
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +4 -4
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/search-bar.js +7 -7
- package/dist/search-bar.js.map +1 -1
- package/dist/segmented-control.js +4 -4
- package/dist/sidepanel.js +19 -19
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +5 -5
- package/dist/tabs.js +64 -64
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +188 -229
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +37 -37
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +4 -4
- package/dist/toggle.js +3 -3
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnHeadersTopPosition/useCalculateColumnHeadersTopPosition.d.ts +0 -2
- package/dist/chunks/base-modal.be77971f.js.map +0 -1
- package/dist/chunks/dropdown.22e51667.js.map +0 -1
- package/dist/chunks/loading-button.41c15584.js.map +0 -1
- package/dist/chunks/tooltip.c8350cd0.js.map +0 -1
- package/dist/chunks/use-has-slot.3daaffc6.js +0 -17
- package/dist/chunks/use-has-slot.3daaffc6.js.map +0 -1
package/dist/focus-trap.js
CHANGED
package/dist/form-layout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as d, useSlots as
|
|
2
|
-
import { BentoAlert as
|
|
3
|
-
import { u as
|
|
4
|
-
import { F as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { B as y, c as k } from "./chunks/index.
|
|
7
|
-
import "./assets/
|
|
1
|
+
import { defineComponent as d, useSlots as b, computed as u, provide as I, toRef as $, openBlock as i, createBlock as v, resolveDynamicComponent as O, unref as a, withCtx as _, renderSlot as n, createCommentVNode as g, createElementBlock as p, createElementVNode as L, createVNode as B, onMounted as S, ref as E, normalizeClass as T } from "vue";
|
|
2
|
+
import { BentoAlert as F } from "./alert.js";
|
|
3
|
+
import { u as C } from "./chunks/use-has-slot.4d98bf29.js";
|
|
4
|
+
import { F as N } from "./chunks/form-layout.types.a7a1438d.js";
|
|
5
|
+
import { _ as m } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
6
|
+
import { B as y, c as k } from "./chunks/index.9fc54b60.js";
|
|
7
|
+
import "./assets/index6.css";
|
|
8
8
|
const G = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "b-form-layout__actions-container"
|
|
@@ -22,56 +22,67 @@ const G = {
|
|
|
22
22
|
*/
|
|
23
23
|
loading: { type: Boolean, default: !1 }
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
return I(
|
|
25
|
+
setup(t) {
|
|
26
|
+
const o = t, r = b(), l = C(r), e = u(() => o.form ? "form" : "div"), c = u(() => l("actions-left") || l("actions-right"));
|
|
27
|
+
return I(N, $(o, "loading")), (s, f) => (i(), v(O(a(e)), {
|
|
28
28
|
class: "b-form-layout",
|
|
29
29
|
role: "form"
|
|
30
30
|
}, {
|
|
31
|
-
default:
|
|
32
|
-
a(
|
|
31
|
+
default: _(() => [
|
|
32
|
+
a(l)("error-message") ? (i(), v(a(F), {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "b-form-layout__error-message",
|
|
35
35
|
type: "critical"
|
|
36
36
|
}, {
|
|
37
|
-
description:
|
|
38
|
-
|
|
37
|
+
description: _(() => [
|
|
38
|
+
n(s.$slots, "error-message", {}, void 0, !0)
|
|
39
39
|
]),
|
|
40
40
|
_: 3
|
|
41
|
-
})) :
|
|
42
|
-
|
|
43
|
-
a(c) ? (i(),
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
})) : g("", !0),
|
|
42
|
+
n(s.$slots, "default", {}, void 0, !0),
|
|
43
|
+
a(c) ? (i(), p("div", G, [
|
|
44
|
+
L("div", A, [
|
|
45
|
+
n(s.$slots, "actions-left", {}, void 0, !0)
|
|
46
46
|
]),
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
L("div", V, [
|
|
48
|
+
n(s.$slots, "actions-right", {}, void 0, !0)
|
|
49
49
|
])
|
|
50
|
-
])) :
|
|
50
|
+
])) : g("", !0)
|
|
51
51
|
]),
|
|
52
52
|
_: 3
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
...
|
|
56
|
+
const tt = /* @__PURE__ */ m(D, [["__scopeId", "data-v-f0c8b741"]]), P = ["warning", "critical", "highlight", "success"], R = { class: "b-form-layout-field-tip" }, q = {}, x = /* @__PURE__ */ d({
|
|
57
|
+
...q,
|
|
58
58
|
__name: "form-layout-field-tip",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
props: {
|
|
60
|
+
/**
|
|
61
|
+
* Type of a alert; set a distinctive icon and color. Defaults to highlight.
|
|
62
|
+
* @values highlight, success, critical, warning
|
|
63
|
+
*/
|
|
64
|
+
type: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "highlight",
|
|
67
|
+
validator: (t) => P.includes(t)
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
setup(t) {
|
|
71
|
+
return (o, r) => (i(), p("div", R, [
|
|
72
|
+
n(o.$slots, "default", {}, void 0, !0),
|
|
73
|
+
B(a(F), {
|
|
63
74
|
variant: "tip",
|
|
64
|
-
type:
|
|
75
|
+
type: t.type
|
|
65
76
|
}, {
|
|
66
|
-
description:
|
|
67
|
-
|
|
77
|
+
description: _(() => [
|
|
78
|
+
n(o.$slots, "message", {}, void 0, !0)
|
|
68
79
|
]),
|
|
69
80
|
_: 3
|
|
70
|
-
})
|
|
81
|
+
}, 8, ["type"])
|
|
71
82
|
]));
|
|
72
83
|
}
|
|
73
84
|
});
|
|
74
|
-
const
|
|
85
|
+
const ot = /* @__PURE__ */ m(x, [["__scopeId", "data-v-16c7e9c2"]]), h = [
|
|
75
86
|
"100",
|
|
76
87
|
"50",
|
|
77
88
|
"33",
|
|
@@ -82,21 +93,21 @@ const oo = /* @__PURE__ */ p(q, [["__scopeId", "data-v-80229079"]]), L = [
|
|
|
82
93
|
"25-75",
|
|
83
94
|
"50-50",
|
|
84
95
|
"33-33-33"
|
|
85
|
-
],
|
|
96
|
+
], M = 100, U = (t, o) => {
|
|
86
97
|
const r = (e) => {
|
|
87
98
|
var c;
|
|
88
99
|
return (c = e.split) == null ? void 0 : c.call(e, "-").map((s) => parseInt(s, 10));
|
|
89
|
-
},
|
|
90
|
-
() =>
|
|
100
|
+
}, l = u(
|
|
101
|
+
() => h.includes(t.value) ? r(t.value) : M
|
|
91
102
|
);
|
|
92
|
-
|
|
93
|
-
const e =
|
|
94
|
-
|
|
95
|
-
s.classList.add(`${e}--${
|
|
103
|
+
S(() => {
|
|
104
|
+
const e = o.value.classList[0];
|
|
105
|
+
o.value.querySelectorAll(`.${e} > *`).forEach((s, f) => {
|
|
106
|
+
s.classList.add(`${e}--${l.value[f] || "100"}`);
|
|
96
107
|
});
|
|
97
108
|
});
|
|
98
|
-
},
|
|
99
|
-
...
|
|
109
|
+
}, Y = {}, j = /* @__PURE__ */ d({
|
|
110
|
+
...Y,
|
|
100
111
|
__name: "form-layout-group",
|
|
101
112
|
props: {
|
|
102
113
|
/**
|
|
@@ -125,28 +136,28 @@ const oo = /* @__PURE__ */ p(q, [["__scopeId", "data-v-80229079"]]), L = [
|
|
|
125
136
|
layout: {
|
|
126
137
|
type: String,
|
|
127
138
|
default: "100",
|
|
128
|
-
validator: (
|
|
139
|
+
validator: (t) => h.includes(t)
|
|
129
140
|
}
|
|
130
141
|
},
|
|
131
|
-
setup(
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const
|
|
142
|
+
setup(t) {
|
|
143
|
+
const o = t, r = E(null);
|
|
144
|
+
U($(o, "layout"), r);
|
|
145
|
+
const l = u(() => ({
|
|
135
146
|
// Transform into column if the layout is unsopprted
|
|
136
147
|
// "form-layout.scss" depends on this class
|
|
137
|
-
"b-form-layout-group--column": !
|
|
148
|
+
"b-form-layout-group--column": !h.includes(o.layout)
|
|
138
149
|
}));
|
|
139
|
-
return (e, c) => (i(),
|
|
150
|
+
return (e, c) => (i(), p("div", {
|
|
140
151
|
ref_key: "formLayoutGroup",
|
|
141
152
|
ref: r,
|
|
142
|
-
class: T(["b-form-layout-group", a(
|
|
153
|
+
class: T(["b-form-layout-group", a(l)])
|
|
143
154
|
}, [
|
|
144
|
-
|
|
155
|
+
n(e.$slots, "default", {}, void 0, !0)
|
|
145
156
|
], 2));
|
|
146
157
|
}
|
|
147
158
|
});
|
|
148
|
-
const
|
|
149
|
-
...
|
|
159
|
+
const et = /* @__PURE__ */ m(j, [["__scopeId", "data-v-f602fe24"]]), z = {}, H = /* @__PURE__ */ d({
|
|
160
|
+
...z,
|
|
150
161
|
__name: "form-layout-title",
|
|
151
162
|
props: {
|
|
152
163
|
/**
|
|
@@ -165,23 +176,23 @@ const to = /* @__PURE__ */ p(Y, [["__scopeId", "data-v-d4db03b2"]]), j = {}, z =
|
|
|
165
176
|
el: {
|
|
166
177
|
type: y.props.el.type,
|
|
167
178
|
required: !0,
|
|
168
|
-
validator: (
|
|
179
|
+
validator: (t) => Object.values(k).includes(t)
|
|
169
180
|
}
|
|
170
181
|
},
|
|
171
|
-
setup(
|
|
172
|
-
const
|
|
173
|
-
"b-form-layout-title--subsection":
|
|
182
|
+
setup(t) {
|
|
183
|
+
const o = t, r = b(), l = u(() => !o.subsection), e = C(r), c = u(() => ({
|
|
184
|
+
"b-form-layout-title--subsection": o.subsection
|
|
174
185
|
}));
|
|
175
|
-
return (s, f) => (i(),
|
|
186
|
+
return (s, f) => (i(), p("div", {
|
|
176
187
|
class: T(["b-form-layout-title", a(c)])
|
|
177
188
|
}, [
|
|
178
189
|
B(a(y), {
|
|
179
|
-
el:
|
|
190
|
+
el: t.el,
|
|
180
191
|
variant: "title",
|
|
181
|
-
medium: a(
|
|
192
|
+
medium: a(l)
|
|
182
193
|
}, {
|
|
183
|
-
default:
|
|
184
|
-
|
|
194
|
+
default: _(() => [
|
|
195
|
+
n(s.$slots, "default", {}, void 0, !0)
|
|
185
196
|
]),
|
|
186
197
|
_: 3
|
|
187
198
|
}, 8, ["el", "medium"]),
|
|
@@ -191,19 +202,19 @@ const to = /* @__PURE__ */ p(Y, [["__scopeId", "data-v-d4db03b2"]]), j = {}, z =
|
|
|
191
202
|
el: "span",
|
|
192
203
|
wide: ""
|
|
193
204
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
|
|
205
|
+
default: _(() => [
|
|
206
|
+
n(s.$slots, "description", {}, void 0, !0)
|
|
196
207
|
]),
|
|
197
208
|
_: 3
|
|
198
|
-
})) :
|
|
209
|
+
})) : g("", !0)
|
|
199
210
|
], 2));
|
|
200
211
|
}
|
|
201
212
|
});
|
|
202
|
-
const
|
|
213
|
+
const st = /* @__PURE__ */ m(H, [["__scopeId", "data-v-fbc939de"]]);
|
|
203
214
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
215
|
+
tt as BentoFormLayout,
|
|
216
|
+
ot as BentoFormLayoutFieldTip,
|
|
217
|
+
et as BentoFormLayoutGroup,
|
|
218
|
+
st as BentoFormLayoutTitle
|
|
208
219
|
};
|
|
209
220
|
//# sourceMappingURL=form-layout.js.map
|
package/dist/form-layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-layout.js","sources":["../../vue2/src/components/form-layout/form-layout.vue","../../vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue","../../vue2/src/components/form-layout/components/form-layout-group/form-layout-group.types.ts","../../vue2/src/components/form-layout/components/form-layout-group/composable/use-form-layout-group-percentage.ts","../../vue2/src/components/form-layout/components/form-layout-group/form-layout-group.vue","../../vue2/src/components/form-layout/components/form-layout-title/form-layout-title.vue"],"sourcesContent":["<template>\n <component :is=\"formLayoutElement\" class=\"b-form-layout\" role=\"form\">\n <bento-alert v-if=\"hasSlot('error-message')\" class=\"b-form-layout__error-message\" type=\"critical\">\n <template #description>\n <slot name=\"error-message\" />\n </template>\n </bento-alert>\n\n <slot />\n\n <div v-if=\"hasActions\" class=\"b-form-layout__actions-container\">\n <div class=\"b-form-layout__actions\">\n <slot name=\"actions-left\" />\n </div>\n\n <div class=\"b-form-layout__actions\">\n <slot name=\"actions-right\" />\n </div>\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef, useSlots } from 'vue';\n import { BentoAlert } from '@/components/alert';\n import { useHasSlot } from '@/composables';\n import { FORM_LAYOUT_LOADING_INJECTION_KEY } from './form-layout.types';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * Renders the form layout as an HTML `form`\n */\n form: { type: Boolean, default: false },\n\n /**\n * Sets the state of the form and its fields to\n * a read only status.\n */\n loading: { type: Boolean, default: false },\n });\n\n const formLayoutElement = computed(() => (props.form ? 'form' : 'div'));\n const hasActions = computed(() => hasSlot('actions-left') || hasSlot('actions-right'));\n\n provide(FORM_LAYOUT_LOADING_INJECTION_KEY, toRef(props, 'loading'));\n</script>\n\n<script lang=\"ts\">\n /**\n * Form layout component is a pre-designed layout that serves\n * as a starting point for creating a form.\n *\n * It can include various common form components:\n * input field, dropdown, date picker, checkbox group, radio group,\n * textarea, etc.\n *\n * Form layout is context agnostic and can be dropped in different\n * places, for example in modals, side panels or pages.\n *\n * @example\n * import { BentoFormLayout, BentoFormLayoutFieldTip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayout, BentoFormLayoutFieldTip },\n * template: `\n * <bento-form-layout>\n * <template #error-message>There is an error. Correct the highlighted field.</template>\n *\n * <bento-input-field>Input field</bento-input-field>\n *\n * <bento-form-layout-field-tip>\n * <bento-dropdown label=\"Dropdown\" :items=\"dropdownItems\" placeholder=\"Select an animal\" />\n * <template #message>This is a small tip that can be used in small spaces</template>\n * </bento-form-layout-field-tip>\n *\n * <bento-form-layout-title subsection>\n * Section title\n * <template #description>Optional section description</template>\n * </bento-form-layout-title>\n * </bento-form-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout.scss\" />\n","<template>\n <div class=\"b-form-layout-field-tip\">\n <slot />\n <bento-alert variant=\"tip\" type=\"warning\">\n <template #description>\n <slot name=\"message\" />\n </template>\n </bento-alert>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoAlert } from '@/components/alert';\n</script>\n\n<script lang=\"ts\">\n /**\n * You can help users provide accurate and well formatted information\n * by using various elements that come with an input field.\n *\n * Use description/supporting text to add additional context to the\n * field or guidance how to format the input correctly.\n * Because description is always visible it should be the first\n * choice in providing guidance.\n *\n * @example\n * import { BentoFormLayoutFieldTip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutFieldTip },\n * template: `\n * <bento-form-layout-field-tip>\n * <bento-dropdown label=\"Dropdown\" :items=\"dropdownItems\" placeholder=\"Select an animal\" />\n *\n * <template #message>This is a small tip that can be used in small spaces</template>\n * </bento-form-layout-field-tip>\n * `\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-field-tip.scss\" />\n","export type BentoLayoutGroupProportions =\n | '33-33-33'\n | '50-50'\n | '25-75'\n | '75-25'\n | '33-66'\n | '66-33'\n | '25'\n | '33'\n | '50'\n | '100';\n\nexport const BentoLayoutGroupProportions = [\n '100',\n '50',\n '33',\n '25',\n '66-33',\n '33-66',\n '75-25',\n '25-75',\n '50-50',\n '33-33-33',\n];\n","import { computed, onMounted, Ref } from 'vue';\nimport { BentoLayoutGroupProportions } from '../form-layout-group.types';\n\nconst DEFAULT_PROPORTION = 100;\n\n/**\n * Calculates the CSS classes based on the percentage\n * for each one of the layouts in format `##-##` or `##`.\n *\n * It receives a layout of type @see BentoLayoutGroupProportions to\n * generate the class and apply it to the children of the @see BentoFormLayoutGroup component\n *\n * @param {Ref<BentoLayoutGroupProportions>} layoutProp Layout string in the format `##` or `##-##`\n * @param {Ref<HTMLElement>} formLayoutGroupRef Reference to an HTML element of type BentoFormLayoutGroup\n */\nexport const useFormLayoutGroupPercentage = (\n layoutProp: Ref<BentoLayoutGroupProportions>,\n formLayoutGroupRef: Ref<HTMLElement>\n) => {\n // Split the `##-##` format into individual values [##, ##]\n const getLayoutValues = layout => layout.split?.('-').map(value => parseInt(value, 10));\n // Split the values only if the are in BentoLayoutGroupProportions, otherwise return 100%\n const layout = computed(() =>\n BentoLayoutGroupProportions.includes(layoutProp.value) ? getLayoutValues(layoutProp.value) : DEFAULT_PROPORTION\n );\n\n onMounted(() => {\n // Apply class to every immediate child\n const layoutClassName = formLayoutGroupRef.value.classList[0];\n const immediateChildren = formLayoutGroupRef.value.querySelectorAll(`.${layoutClassName} > *`); // Get immediate children\n immediateChildren.forEach((child, index) => {\n child.classList.add(`${layoutClassName}--${layout.value[index] || '100'}`); // 100% default\n });\n });\n};\n","<template>\n <div ref=\"formLayoutGroup\" class=\"b-form-layout-group\" :class=\"conditionalClasses\">\n <slot></slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineProps, PropType, ref, toRef } from 'vue';\n import { useFormLayoutGroupPercentage } from './composable/use-form-layout-group-percentage';\n import { BentoLayoutGroupProportions } from './form-layout-group.types';\n\n const props = defineProps({\n /**\n * The layout of the pair group of components.\n * This will render the components within the width of the proportions.\n * Only two colums are available.\n *\n * If only one value is entered, then it will assume there's only one child in the group.\n * If two values are entered, the first value will be use for the first child and the second\n * value for the second child.\n *\n * If the value entered is not listed in the example\n * list below it will use 100% by default.\n * @example\n * '33-33-33'\n * '50-50'\n * '25-75'\n * '75-25'\n * '33-66'\n * '66-33'\n * '25'\n * '33'\n * '50'\n * '100'\n */\n layout: {\n type: String as PropType<BentoLayoutGroupProportions>,\n default: '100',\n validator: (value: BentoLayoutGroupProportions) => BentoLayoutGroupProportions.includes(value),\n },\n });\n\n const formLayoutGroup = ref(null);\n useFormLayoutGroupPercentage(toRef(props, 'layout'), formLayoutGroup);\n\n const conditionalClasses = computed(() => ({\n // Transform into column if the layout is unsopprted\n // \"form-layout.scss\" depends on this class\n 'b-form-layout-group--column': !BentoLayoutGroupProportions.includes(props.layout),\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Use to provide horizontal layouts to build forms\n * with two fields per line.\n *\n * These can be used for field combinations,\n * such as post code and city or title and first name.\n *\n * @example\n * import { BentoFormLayoutGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutGroup },\n * template: `\n * <bento-form-layout-group>\n * <first-element />\n * <second-element />\n * </bento-form-layout-group>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-group.scss\" />\n","<template>\n <div class=\"b-form-layout-title\" :class=\"conditionalClasses\">\n <bento-typography :el=\"el\" variant=\"title\" :medium=\"isSection\">\n <slot />\n </bento-typography>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-form-layout-title__description\" el=\"span\" wide>\n <slot name=\"description\" />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { BentoTypography, BentoTypographyElement } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Defines if the Form Layout title is\n * a \"section\" or a \"subsection\".\n * Default is \"section\" (false). Turn into \"true\" for \"subsection\"\n */\n subsection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the HTML DOM element.\n * @values h1, h2, h3, h4, h5, h6, div, p, span\n */\n el: {\n type: BentoTypography.props.el.type,\n required: true,\n validator: (value: BentoTypographyElement) => Object.values(BentoTypographyElement).includes(value),\n },\n });\n\n // Uses \"medium\" typography if it is a section title\n const isSection = computed(() => !props.subsection);\n const hasSlot = useHasSlot(slots);\n const conditionalClasses = computed(() => ({\n 'b-form-layout-title--subsection': props.subsection,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * If you’re building a lengthy form, organise related\n * fields into sections and, if needed, subsections.\n *\n * A form can have a \"Section Title\" and multiple \"Subsection titles\".\n *\n * One of the values provided in @see BentoTypographyElement must always be provided as a string\n * to define correct HTML sementic from the application's context\n *\n * @example\n * import { BentoFormLayoutTitle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutTitle },\n * template: `\n * <bento-form-layout-title subsection el=\"h2\">\n * Title\n * <template #description>Description text</template>\n * </bento-form-layout-title>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-title.scss\" />\n"],"names":["__default__$3","slots","useSlots","hasSlot","useHasSlot","formLayoutElement","computed","props","hasActions","provide","FORM_LAYOUT_LOADING_INJECTION_KEY","toRef","__default__$2","BentoLayoutGroupProportions","DEFAULT_PROPORTION","useFormLayoutGroupPercentage","layoutProp","formLayoutGroupRef","getLayoutValues","layout2","_a","value","layout","onMounted","layoutClassName","child","index","__default__$1","formLayoutGroup","ref","conditionalClasses","__default__","isSection"],"mappings":";;;;;;;;;;qFAsFIA,IAAA,CAAA;;;;;;;;;;;;;;;iBA1DAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAeAI,IAAAC,EAAA,MAAAC,EAAA,OAAA,SAAA,KAAA,GACAC,IAAAF,EAAA,MAAAH,EAAA,cAAA,KAAAA,EAAA,eAAA,CAAA;AAEA,WAAAM,EAAAC,GAAAC,EAAAJ,GAAA,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8GCTAK,IAAA,CAAA;;;;;;;;;;;;;;;;;;qEC1BGC,IAAA;AAAA,EAAoC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAEJ,GCpBAC,IAAA,KAYaC,IAAA,CAAAC,GAAAC,MAAA;AAKT,QAAAC,IAAA,CAAAC,MAAA;;AAAA,YAAAC,IAAAD,EAAA,UAAA,gBAAAC,EAAA,KAAAD,GAAA,KAAA,IAAA,CAAAE,MAAA,SAAAA,GAAA,EAAA;AAAA,KAEAC,IAAAhB;AAAA,IAAe,MAAAO,EAAA,SAAAG,EAAA,KAAA,IAAAE,EAAAF,EAAA,KAAA,IAAAF;AAAA,EACkF;AAGjG,EAAAS,EAAA,MAAA;AAEI,UAAAC,IAAAP,EAAA,MAAA,UAAA,CAAA;AAEA,IADAA,EAAA,MAAA,iBAAA,IAAAO,OAAA,EACA,QAAA,CAAAC,GAAAC,MAAA;AACI,MAAAD,EAAA,UAAA,IAAA,GAAAD,MAAAF,EAAA,MAAAI,CAAA,KAAA,OAAA;AAAA,IAAyE,CAAA;AAAA,EAC5E,CAAA;AAET,GCuCIC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/BAC,IAAAC,EAAA,IAAA;AACA,IAAAd,EAAAJ,EAAAJ,GAAA,QAAA,GAAAqB,CAAA;AAEA,UAAAE,IAAAxB,EAAA,OAAA;AAAA;AAAA;AAAA,MAA2C,+BAAA,CAAAO,EAAA,SAAAN,EAAA,MAAA;AAAA,IAG0C,EAAA;;;;;;;;;;qECwBrFwB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;iBAvDA9B,IAAAC,EAAA,GAyBA8B,IAAA1B,EAAA,MAAA,CAAAC,EAAA,UAAA,GACAJ,IAAAC,EAAAH,CAAA,GACA6B,IAAAxB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"form-layout.js","sources":["../../vue2/src/components/form-layout/form-layout.vue","../../vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-tip.types.ts","../../vue2/src/components/form-layout/components/form-layout-field-tip/form-layout-field-tip.vue","../../vue2/src/components/form-layout/components/form-layout-group/form-layout-group.types.ts","../../vue2/src/components/form-layout/components/form-layout-group/composable/use-form-layout-group-percentage.ts","../../vue2/src/components/form-layout/components/form-layout-group/form-layout-group.vue","../../vue2/src/components/form-layout/components/form-layout-title/form-layout-title.vue"],"sourcesContent":["<template>\n <component :is=\"formLayoutElement\" class=\"b-form-layout\" role=\"form\">\n <bento-alert v-if=\"hasSlot('error-message')\" class=\"b-form-layout__error-message\" type=\"critical\">\n <template #description>\n <slot name=\"error-message\" />\n </template>\n </bento-alert>\n\n <slot />\n\n <div v-if=\"hasActions\" class=\"b-form-layout__actions-container\">\n <div class=\"b-form-layout__actions\">\n <slot name=\"actions-left\" />\n </div>\n\n <div class=\"b-form-layout__actions\">\n <slot name=\"actions-right\" />\n </div>\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef, useSlots } from 'vue';\n import { BentoAlert } from '@/components/alert';\n import { useHasSlot } from '@/composables';\n import { FORM_LAYOUT_LOADING_INJECTION_KEY } from './form-layout.types';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * Renders the form layout as an HTML `form`\n */\n form: { type: Boolean, default: false },\n\n /**\n * Sets the state of the form and its fields to\n * a read only status.\n */\n loading: { type: Boolean, default: false },\n });\n\n const formLayoutElement = computed(() => (props.form ? 'form' : 'div'));\n const hasActions = computed(() => hasSlot('actions-left') || hasSlot('actions-right'));\n\n provide(FORM_LAYOUT_LOADING_INJECTION_KEY, toRef(props, 'loading'));\n</script>\n\n<script lang=\"ts\">\n /**\n * Form layout component is a pre-designed layout that serves\n * as a starting point for creating a form.\n *\n * It can include various common form components:\n * input field, dropdown, date picker, checkbox group, radio group,\n * textarea, etc.\n *\n * Form layout is context agnostic and can be dropped in different\n * places, for example in modals, side panels or pages.\n *\n * @example\n * import { BentoFormLayout, BentoFormLayoutFieldTip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayout, BentoFormLayoutFieldTip },\n * template: `\n * <bento-form-layout>\n * <template #error-message>There is an error. Correct the highlighted field.</template>\n *\n * <bento-input-field>Input field</bento-input-field>\n *\n * <bento-form-layout-field-tip>\n * <bento-dropdown label=\"Dropdown\" :items=\"dropdownItems\" placeholder=\"Select an animal\" />\n * <template #message>This is a small tip that can be used in small spaces</template>\n * </bento-form-layout-field-tip>\n *\n * <bento-form-layout-title subsection>\n * Section title\n * <template #description>Optional section description</template>\n * </bento-form-layout-title>\n * </bento-form-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout.scss\" />\n","import { BentoAlertTypeOption } from '@/components/alert/alert.types';\n\nexport type BentoFormLayoutFieldTipTypeOption = `${BentoAlertTypeOption}`;\nexport const BentoFormLayoutFieldTipTypeOptions = ['warning', 'critical', 'highlight', 'success'];\n","<template>\n <div class=\"b-form-layout-field-tip\">\n <slot />\n <bento-alert variant=\"tip\" :type=\"type\">\n <template #description>\n <slot name=\"message\" />\n </template>\n </bento-alert>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { PropType } from 'vue';\n import { BentoFormLayoutFieldTipTypeOption, BentoFormLayoutFieldTipTypeOptions } from './form-layout-tip.types';\n import { BentoAlert } from '@/components/alert';\n\n defineProps({\n /**\n * Type of a alert; set a distinctive icon and color. Defaults to highlight.\n * @values highlight, success, critical, warning\n */\n type: {\n type: String as PropType<BentoFormLayoutFieldTipTypeOption>,\n default: 'highlight',\n validator: (value: BentoFormLayoutFieldTipTypeOption) => BentoFormLayoutFieldTipTypeOptions.includes(value),\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * You can help users provide accurate and well formatted information\n * by using various elements that come with an input field.\n *\n * Use description/supporting text to add additional context to the\n * field or guidance how to format the input correctly.\n * Because description is always visible it should be the first\n * choice in providing guidance.\n *\n * @example\n * import { BentoFormLayoutFieldTip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutFieldTip },\n * template: `\n * <bento-form-layout-field-tip>\n * <bento-dropdown label=\"Dropdown\" :items=\"dropdownItems\" placeholder=\"Select an animal\" />\n *\n * <template #message>This is a small tip that can be used in small spaces</template>\n * </bento-form-layout-field-tip>\n * `\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-field-tip.scss\" />\n","export type BentoLayoutGroupProportions =\n | '33-33-33'\n | '50-50'\n | '25-75'\n | '75-25'\n | '33-66'\n | '66-33'\n | '25'\n | '33'\n | '50'\n | '100';\n\nexport const BentoLayoutGroupProportions = [\n '100',\n '50',\n '33',\n '25',\n '66-33',\n '33-66',\n '75-25',\n '25-75',\n '50-50',\n '33-33-33',\n];\n","import { computed, onMounted, Ref } from 'vue';\nimport { BentoLayoutGroupProportions } from '../form-layout-group.types';\n\nconst DEFAULT_PROPORTION = 100;\n\n/**\n * Calculates the CSS classes based on the percentage\n * for each one of the layouts in format `##-##` or `##`.\n *\n * It receives a layout of type @see BentoLayoutGroupProportions to\n * generate the class and apply it to the children of the @see BentoFormLayoutGroup component\n *\n * @param {Ref<BentoLayoutGroupProportions>} layoutProp Layout string in the format `##` or `##-##`\n * @param {Ref<HTMLElement>} formLayoutGroupRef Reference to an HTML element of type BentoFormLayoutGroup\n */\nexport const useFormLayoutGroupPercentage = (\n layoutProp: Ref<BentoLayoutGroupProportions>,\n formLayoutGroupRef: Ref<HTMLElement>\n) => {\n // Split the `##-##` format into individual values [##, ##]\n const getLayoutValues = layout => layout.split?.('-').map(value => parseInt(value, 10));\n // Split the values only if the are in BentoLayoutGroupProportions, otherwise return 100%\n const layout = computed(() =>\n BentoLayoutGroupProportions.includes(layoutProp.value) ? getLayoutValues(layoutProp.value) : DEFAULT_PROPORTION\n );\n\n onMounted(() => {\n // Apply class to every immediate child\n const layoutClassName = formLayoutGroupRef.value.classList[0];\n const immediateChildren = formLayoutGroupRef.value.querySelectorAll(`.${layoutClassName} > *`); // Get immediate children\n immediateChildren.forEach((child, index) => {\n child.classList.add(`${layoutClassName}--${layout.value[index] || '100'}`); // 100% default\n });\n });\n};\n","<template>\n <div ref=\"formLayoutGroup\" class=\"b-form-layout-group\" :class=\"conditionalClasses\">\n <slot></slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, ref, toRef } from 'vue';\n import { useFormLayoutGroupPercentage } from './composable/use-form-layout-group-percentage';\n import { BentoLayoutGroupProportions } from './form-layout-group.types';\n\n const props = defineProps({\n /**\n * The layout of the pair group of components.\n * This will render the components within the width of the proportions.\n * Only two colums are available.\n *\n * If only one value is entered, then it will assume there's only one child in the group.\n * If two values are entered, the first value will be use for the first child and the second\n * value for the second child.\n *\n * If the value entered is not listed in the example\n * list below it will use 100% by default.\n * @example\n * '33-33-33'\n * '50-50'\n * '25-75'\n * '75-25'\n * '33-66'\n * '66-33'\n * '25'\n * '33'\n * '50'\n * '100'\n */\n layout: {\n type: String as PropType<BentoLayoutGroupProportions>,\n default: '100',\n validator: (value: BentoLayoutGroupProportions) => BentoLayoutGroupProportions.includes(value),\n },\n });\n\n const formLayoutGroup = ref(null);\n useFormLayoutGroupPercentage(toRef(props, 'layout'), formLayoutGroup);\n\n const conditionalClasses = computed(() => ({\n // Transform into column if the layout is unsopprted\n // \"form-layout.scss\" depends on this class\n 'b-form-layout-group--column': !BentoLayoutGroupProportions.includes(props.layout),\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Use to provide horizontal layouts to build forms\n * with two fields per line.\n *\n * These can be used for field combinations,\n * such as post code and city or title and first name.\n *\n * @example\n * import { BentoFormLayoutGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutGroup },\n * template: `\n * <bento-form-layout-group>\n * <first-element />\n * <second-element />\n * </bento-form-layout-group>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-group.scss\" />\n","<template>\n <div class=\"b-form-layout-title\" :class=\"conditionalClasses\">\n <bento-typography :el=\"el\" variant=\"title\" :medium=\"isSection\">\n <slot />\n </bento-typography>\n\n <bento-typography v-if=\"hasSlot('description')\" class=\"b-form-layout-title__description\" el=\"span\" wide>\n <slot name=\"description\" />\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import { BentoTypography, BentoTypographyElement } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Defines if the Form Layout title is\n * a \"section\" or a \"subsection\".\n * Default is \"section\" (false). Turn into \"true\" for \"subsection\"\n */\n subsection: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the HTML DOM element.\n * @values h1, h2, h3, h4, h5, h6, div, p, span\n */\n el: {\n type: BentoTypography.props.el.type,\n required: true,\n validator: (value: BentoTypographyElement) => Object.values(BentoTypographyElement).includes(value),\n },\n });\n\n // Uses \"medium\" typography if it is a section title\n const isSection = computed(() => !props.subsection);\n const hasSlot = useHasSlot(slots);\n const conditionalClasses = computed(() => ({\n 'b-form-layout-title--subsection': props.subsection,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * If you’re building a lengthy form, organise related\n * fields into sections and, if needed, subsections.\n *\n * A form can have a \"Section Title\" and multiple \"Subsection titles\".\n *\n * One of the values provided in @see BentoTypographyElement must always be provided as a string\n * to define correct HTML sementic from the application's context\n *\n * @example\n * import { BentoFormLayoutTitle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoFormLayoutTitle },\n * template: `\n * <bento-form-layout-title subsection el=\"h2\">\n * Title\n * <template #description>Description text</template>\n * </bento-form-layout-title>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./form-layout-title.scss\" />\n"],"names":["__default__$3","slots","useSlots","hasSlot","useHasSlot","formLayoutElement","computed","props","hasActions","provide","FORM_LAYOUT_LOADING_INJECTION_KEY","toRef","BentoFormLayoutFieldTipTypeOptions","__default__$2","BentoLayoutGroupProportions","DEFAULT_PROPORTION","useFormLayoutGroupPercentage","layoutProp","formLayoutGroupRef","getLayoutValues","layout2","_a","value","layout","onMounted","layoutClassName","child","index","__default__$1","formLayoutGroup","ref","conditionalClasses","__default__","isSection"],"mappings":";;;;;;;;;;qFAsFIA,IAAA,CAAA;;;;;;;;;;;;;;;iBA1DAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAeAI,IAAAC,EAAA,MAAAC,EAAA,OAAA,SAAA,KAAA,GACAC,IAAAF,EAAA,MAAAH,EAAA,cAAA,KAAAA,EAAA,eAAA,CAAA;AAEA,WAAAM,EAAAC,GAAAC,EAAAJ,GAAA,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEC5CGK,IAAA,CAAA,WAAA,YAAA,aAAA,SAAA,6CCiDHC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qECxCGC,IAAA;AAAA,EAAoC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAEJ,GCpBAC,IAAA,KAYaC,IAAA,CAAAC,GAAAC,MAAA;AAKT,QAAAC,IAAA,CAAAC,MAAA;;AAAA,YAAAC,IAAAD,EAAA,UAAA,gBAAAC,EAAA,KAAAD,GAAA,KAAA,IAAA,CAAAE,MAAA,SAAAA,GAAA,EAAA;AAAA,KAEAC,IAAAjB;AAAA,IAAe,MAAAQ,EAAA,SAAAG,EAAA,KAAA,IAAAE,EAAAF,EAAA,KAAA,IAAAF;AAAA,EACkF;AAGjG,EAAAS,EAAA,MAAA;AAEI,UAAAC,IAAAP,EAAA,MAAA,UAAA,CAAA;AAEA,IADAA,EAAA,MAAA,iBAAA,IAAAO,OAAA,EACA,QAAA,CAAAC,GAAAC,MAAA;AACI,MAAAD,EAAA,UAAA,IAAA,GAAAD,MAAAF,EAAA,MAAAI,CAAA,KAAA,OAAA;AAAA,IAAyE,CAAA;AAAA,EAC5E,CAAA;AAET,GCuCIC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/BAC,IAAAC,EAAA,IAAA;AACA,IAAAd,EAAAL,EAAAJ,GAAA,QAAA,GAAAsB,CAAA;AAEA,UAAAE,IAAAzB,EAAA,OAAA;AAAA;AAAA;AAAA,MAA2C,+BAAA,CAAAQ,EAAA,SAAAP,EAAA,MAAA;AAAA,IAG0C,EAAA;;;;;;;;;;qECwBrFyB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;iBAvDA/B,IAAAC,EAAA,GAyBA+B,IAAA3B,EAAA,MAAA,CAAAC,EAAA,UAAA,GACAJ,IAAAC,EAAAH,CAAA,GACA8B,IAAAzB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|