@adyen/bento-vue3 1.66.0 → 1.68.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/index.d.ts +2017 -2206
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/footer-actions.css +1 -1
- package/dist/assets/header-meta.css +1 -0
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.OzhLTUKc.js → action-bar.C93kgr7l.js} +4 -4
- package/dist/chunks/{action-bar.OzhLTUKc.js.map → action-bar.C93kgr7l.js.map} +1 -1
- package/dist/chunks/{base-modal.CCwWuH6k.js → base-modal.C3_r3rmc.js} +120 -183
- package/dist/chunks/base-modal.C3_r3rmc.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.xZYmwO7S.js → button-actions-with-menu.DUccmaB2.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.xZYmwO7S.js.map → button-actions-with-menu.DUccmaB2.js.map} +1 -1
- package/dist/chunks/{button-actions.D1pXI1AJ.js → button-actions.CZdO9YOk.js} +7 -7
- package/dist/chunks/button-actions.CZdO9YOk.js.map +1 -0
- package/dist/chunks/{card.DiBtLuRU.js → card.CS34Mi_G.js} +2 -2
- package/dist/chunks/{card.DiBtLuRU.js.map → card.CS34Mi_G.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Dc5Olq0c.js → checkbox-group.JRo6xNpe.js} +2 -2
- package/dist/chunks/{checkbox-group.Dc5Olq0c.js.map → checkbox-group.JRo6xNpe.js.map} +1 -1
- package/dist/chunks/{checkbox.fkPJvdUo.js → checkbox.DGrG3GN1.js} +70 -67
- package/dist/chunks/checkbox.DGrG3GN1.js.map +1 -0
- package/dist/chunks/{code-snippet.DPIhpuKa.js → code-snippet.aucmPbLw.js} +3 -3
- package/dist/chunks/{code-snippet.DPIhpuKa.js.map → code-snippet.aucmPbLw.js.map} +1 -1
- package/dist/chunks/{country.BhAcCmRx.js → country.Q95voxeL.js} +2 -2
- package/dist/chunks/{country.BhAcCmRx.js.map → country.Q95voxeL.js.map} +1 -1
- package/dist/chunks/{dashboard-section.BmtN9b0B.js → dashboard-section.CUcq2ahu.js} +2 -2
- package/dist/chunks/{dashboard-section.BmtN9b0B.js.map → dashboard-section.CUcq2ahu.js.map} +1 -1
- package/dist/chunks/{dashed-underline.ywc0ydgS.js → dashed-underline.DkzQkpaf.js} +2 -2
- package/dist/chunks/{dashed-underline.ywc0ydgS.js.map → dashed-underline.DkzQkpaf.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DAuqLhPI.js → data-grid-template.CDsV2GFG.js} +2 -2
- package/dist/chunks/{data-grid-template.DAuqLhPI.js.map → data-grid-template.CDsV2GFG.js.map} +1 -1
- package/dist/chunks/data-grid.BJHcfrTG.js +3861 -0
- package/dist/chunks/data-grid.BJHcfrTG.js.map +1 -0
- package/dist/chunks/{date-picker.Bk4FNLyR.js → date-picker.DgpMAGYp.js} +3 -3
- package/dist/chunks/{date-picker.Bk4FNLyR.js.map → date-picker.DgpMAGYp.js.map} +1 -1
- package/dist/chunks/date-range-picker.Bxa_f6Q0.js +1225 -0
- package/dist/chunks/date-range-picker.Bxa_f6Q0.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.B05elQig.js → dropdown-default-textbox.Ce5D3ipi.js} +40 -39
- package/dist/chunks/dropdown-default-textbox.Ce5D3ipi.js.map +1 -0
- package/dist/chunks/dropdown-tag.AV8Pi1SS.js +230 -0
- package/dist/chunks/dropdown-tag.AV8Pi1SS.js.map +1 -0
- package/dist/chunks/dropdown.CJBk1euy.js +814 -0
- package/dist/chunks/dropdown.CJBk1euy.js.map +1 -0
- package/dist/chunks/es6.n1ewaW31.js.map +1 -1
- package/dist/chunks/{filter-bar.BxfaFHTk.js → filter-bar.6D-9UEng.js} +848 -833
- package/dist/chunks/filter-bar.6D-9UEng.js.map +1 -0
- package/dist/chunks/{footer-actions.vQ4flLqU.js → footer-actions.Bje-DDqw.js} +2 -2
- package/dist/chunks/{footer-actions.vQ4flLqU.js.map → footer-actions.Bje-DDqw.js.map} +1 -1
- package/dist/chunks/header-meta.Yt43-cUI.js +234 -0
- package/dist/chunks/header-meta.Yt43-cUI.js.map +1 -0
- package/dist/chunks/{header-with-views.COrWDbtU.js → header-with-views.DbBUHvvE.js} +959 -923
- package/dist/chunks/header-with-views.DbBUHvvE.js.map +1 -0
- package/dist/chunks/header.wiq0wlgm.js +141 -0
- package/dist/chunks/header.wiq0wlgm.js.map +1 -0
- package/dist/chunks/{input-field-password.XrXAnMpT.js → input-field-password.Cr3A_4n0.js} +86 -85
- package/dist/chunks/input-field-password.Cr3A_4n0.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.CNurVdiF.js → input-field-phone-number.DZp5IzU3.js} +548 -532
- package/dist/chunks/{input-field-phone-number.CNurVdiF.js.map → input-field-phone-number.DZp5IzU3.js.map} +1 -1
- package/dist/chunks/input-field.CmV2d_Zc.js +304 -0
- package/dist/chunks/input-field.CmV2d_Zc.js.map +1 -0
- package/dist/chunks/{menu.CiyYOoKd.js → menu.C-3obPGl.js} +182 -180
- package/dist/chunks/{menu.CiyYOoKd.js.map → menu.C-3obPGl.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CuL9oSAq.js → modal-fullscreen.DBTnoSX9.js} +90 -77
- package/dist/chunks/modal-fullscreen.DBTnoSX9.js.map +1 -0
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.LnD61fHp.js → modal.vue_vue_type_script_setup_true_lang.Cd-mQUJ8.js} +10 -10
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.LnD61fHp.js.map → modal.vue_vue_type_script_setup_true_lang.Cd-mQUJ8.js.map} +1 -1
- package/dist/chunks/{pagination._rYMF2W_.js → pagination.DLYrWpKr.js} +2 -2
- package/dist/chunks/{pagination._rYMF2W_.js.map → pagination.DLYrWpKr.js.map} +1 -1
- package/dist/chunks/popover.DYgCCUCJ.js +200 -0
- package/dist/chunks/popover.DYgCCUCJ.js.map +1 -0
- package/dist/chunks/popover.types.V8old-GW.js +6 -0
- package/dist/chunks/popover.types.V8old-GW.js.map +1 -0
- package/dist/chunks/promo-banner.CQp3z2CP.js.map +1 -1
- package/dist/chunks/{rich-text-editor.RD8aCPTi.js → rich-text-editor.Dx78coVL.js} +5 -4
- package/dist/chunks/{rich-text-editor.RD8aCPTi.js.map → rich-text-editor.Dx78coVL.js.map} +1 -1
- package/dist/chunks/{search-bar.i7BY4IGB.js → search-bar.CpQ_MEVj.js} +3 -3
- package/dist/chunks/{search-bar.i7BY4IGB.js.map → search-bar.CpQ_MEVj.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DkRQsIx7.js → secondary-nav.RTBLEukC.js} +2 -2
- package/dist/chunks/{secondary-nav.DkRQsIx7.js.map → secondary-nav.RTBLEukC.js.map} +1 -1
- package/dist/chunks/{sidepanel.CTIjklfG.js → sidepanel.DPN__L3Q.js} +2 -2
- package/dist/chunks/{sidepanel.CTIjklfG.js.map → sidepanel.DPN__L3Q.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BTr6x5cg.js → summary-grid.types.CjbbSZBJ.js} +4 -4
- package/dist/chunks/summary-grid.types.CjbbSZBJ.js.map +1 -0
- package/dist/chunks/{textarea.DXSe9MHH.js → textarea.BBhN67-I.js} +41 -40
- package/dist/chunks/textarea.BBhN67-I.js.map +1 -0
- package/dist/chunks/{timeline-item.Coz_LRD3.js → timeline-item.CuCII37W.js} +3 -3
- package/dist/chunks/{timeline-item.Coz_LRD3.js.map → timeline-item.CuCII37W.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.E8oBlhrC.js → tutorial.vue_vue_type_script_setup_true_lang.nYHtTHqy.js} +28 -27
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.E8oBlhrC.js.map → tutorial.vue_vue_type_script_setup_true_lang.nYHtTHqy.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.rqtiP4Nd.js → use-cached-selected-values.Dyoz6cUK.js} +591 -571
- package/dist/chunks/use-cached-selected-values.Dyoz6cUK.js.map +1 -0
- package/dist/chunks/{use-country-items.4kZgVg_l.js → use-country-items.Duh4bMqW.js} +2 -2
- package/dist/chunks/{use-country-items.4kZgVg_l.js.map → use-country-items.Duh4bMqW.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.DVgE19zT.js → use-country-phon-code.BOaJ9PDl.js} +507 -498
- package/dist/chunks/{use-country-phon-code.DVgE19zT.js.map → use-country-phon-code.BOaJ9PDl.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +2 -2
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +157 -156
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +15 -14
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +11 -11
- package/dist/pagination.js +1 -1
- package/dist/popover.js +3 -2
- package/dist/popover.js.map +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/styles/bento-dark.css +10 -2
- package/dist/styles/bento-light.css +10 -2
- package/dist/styles/bento.css +10 -2
- package/dist/styles/legacy.css +10 -2
- package/dist/styles/styleguide.css +10 -2
- package/dist/summary-grid.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +23 -6
- package/dist/assets/info-icon-with-popover.css +0 -1
- package/dist/chunks/base-modal.CCwWuH6k.js.map +0 -1
- package/dist/chunks/button-actions.D1pXI1AJ.js.map +0 -1
- package/dist/chunks/checkbox.fkPJvdUo.js.map +0 -1
- package/dist/chunks/data-grid.BrYCmbPR.js +0 -3779
- package/dist/chunks/data-grid.BrYCmbPR.js.map +0 -1
- package/dist/chunks/date-range-picker.-YsRuGmp.js +0 -1208
- package/dist/chunks/date-range-picker.-YsRuGmp.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.B05elQig.js.map +0 -1
- package/dist/chunks/dropdown-tag.BUDNO3d0.js +0 -202
- package/dist/chunks/dropdown-tag.BUDNO3d0.js.map +0 -1
- package/dist/chunks/dropdown.usAqDecC.js +0 -957
- package/dist/chunks/dropdown.usAqDecC.js.map +0 -1
- package/dist/chunks/filter-bar.BxfaFHTk.js.map +0 -1
- package/dist/chunks/header-with-views.COrWDbtU.js.map +0 -1
- package/dist/chunks/header.DAEUKoX5.js +0 -254
- package/dist/chunks/header.DAEUKoX5.js.map +0 -1
- package/dist/chunks/info-icon-with-popover.Duk1tj5G.js +0 -97
- package/dist/chunks/info-icon-with-popover.Duk1tj5G.js.map +0 -1
- package/dist/chunks/input-field-password.XrXAnMpT.js.map +0 -1
- package/dist/chunks/input-field.EOIwm2tq.js +0 -298
- package/dist/chunks/input-field.EOIwm2tq.js.map +0 -1
- package/dist/chunks/modal-fullscreen.CuL9oSAq.js.map +0 -1
- package/dist/chunks/popover.maCMPyz8.js +0 -350
- package/dist/chunks/popover.maCMPyz8.js.map +0 -1
- package/dist/chunks/summary-grid.types.BTr6x5cg.js.map +0 -1
- package/dist/chunks/textarea.DXSe9MHH.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.rqtiP4Nd.js.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { defineComponent as T, computed as u, resolveComponent as n, createElementBlock as g, openBlock as a, normalizeClass as P, createElementVNode as r, createBlock as i, createCommentVNode as s, createVNode as C, mergeProps as B, withCtx as p, createTextVNode as I, toDisplayString as S, createSlots as m, renderSlot as h } from "vue";
|
|
2
|
+
import { u as E } from "./use-has-slot.B7eQSabc.js";
|
|
3
|
+
import { B as N, a as k, c as f } from "./typography.DN5eC5ch.js";
|
|
4
|
+
import { B as O } from "./button-actions-with-menu.DUccmaB2.js";
|
|
5
|
+
import { I as t, H as w } from "./header-meta.Yt43-cUI.js";
|
|
6
|
+
import { _ as A } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import "../assets/header.css";
|
|
8
|
+
var e = /* @__PURE__ */ ((o) => (o.PAGE = "page", o.COMPONENT = "component", o))(e || {});
|
|
9
|
+
const $ = T({
|
|
10
|
+
name: "bento-header",
|
|
11
|
+
components: {
|
|
12
|
+
BentoTypography: N,
|
|
13
|
+
ButtonActionsWithMenu: O,
|
|
14
|
+
InfoIconWithPopover: t,
|
|
15
|
+
HeaderMeta: w
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
/**
|
|
19
|
+
* Array of BentoButtonActionsList to show to the right of the title
|
|
20
|
+
*/
|
|
21
|
+
actions: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: null
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Text showed under the title
|
|
27
|
+
*/
|
|
28
|
+
description: { type: String, default: null },
|
|
29
|
+
/**
|
|
30
|
+
* Text showed in the info-icon tooltip on hover
|
|
31
|
+
*/
|
|
32
|
+
infoIconTooltipText: { type: t.props.popoverText.type, default: null },
|
|
33
|
+
/**
|
|
34
|
+
* Popover position of the info icon text.
|
|
35
|
+
*/
|
|
36
|
+
infoIconPopoverPosition: {
|
|
37
|
+
type: t.props.popoverPosition.type,
|
|
38
|
+
default: t.props.popoverPosition.default,
|
|
39
|
+
validator: t.props.popoverPosition.validator
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* JavaScript "Date" object for when the content was last updated
|
|
43
|
+
*/
|
|
44
|
+
lastUpdated: { type: [Date, Number], default: null },
|
|
45
|
+
/**
|
|
46
|
+
* Variant represents type of Header
|
|
47
|
+
* @values page, component
|
|
48
|
+
*/
|
|
49
|
+
variant: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: e.PAGE,
|
|
52
|
+
validator: (o) => Object.values(e).includes(o)
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Text used as a title
|
|
56
|
+
*/
|
|
57
|
+
title: { type: String, required: !0 },
|
|
58
|
+
/**
|
|
59
|
+
* Reload button which shows next to the header's timestamp
|
|
60
|
+
* {@see BentoHeaderReloadButton}
|
|
61
|
+
*/
|
|
62
|
+
reloadButton: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
emits: ["reload"],
|
|
68
|
+
setup(o, { slots: l }) {
|
|
69
|
+
const d = u(() => ({
|
|
70
|
+
"b-header--component": o.variant === e.COMPONENT
|
|
71
|
+
})), c = u(() => ({
|
|
72
|
+
el: o.variant === e.PAGE ? f.H1 : f.H2,
|
|
73
|
+
variant: k.TITLE,
|
|
74
|
+
medium: o.variant === e.COMPONENT,
|
|
75
|
+
large: o.variant === e.PAGE
|
|
76
|
+
}));
|
|
77
|
+
return {
|
|
78
|
+
hasSlot: E(l),
|
|
79
|
+
conditionalClasses: d,
|
|
80
|
+
typography: c
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}), H = { class: "b-header__wrapper" }, M = { class: "b-header__title" };
|
|
84
|
+
function G(o, l, d, c, V, U) {
|
|
85
|
+
const y = n("bento-typography"), v = n("info-icon-with-popover"), _ = n("header-meta"), b = n("button-actions-with-menu");
|
|
86
|
+
return a(), g("header", {
|
|
87
|
+
class: P(["b-header", o.conditionalClasses])
|
|
88
|
+
}, [
|
|
89
|
+
r("div", H, [
|
|
90
|
+
r("div", M, [
|
|
91
|
+
r("div", null, [
|
|
92
|
+
C(y, B(o.typography, { class: "b-header__text" }), {
|
|
93
|
+
default: p(() => [
|
|
94
|
+
I(S(o.title), 1)
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
}, 16),
|
|
98
|
+
o.infoIconTooltipText || o.hasSlot("infoIconTooltipContent") ? (a(), i(v, {
|
|
99
|
+
key: 0,
|
|
100
|
+
class: "b-header__tooltip",
|
|
101
|
+
"popover-text": o.infoIconTooltipText
|
|
102
|
+
}, m({ _: 2 }, [
|
|
103
|
+
o.hasSlot("infoIconTooltipContent") ? {
|
|
104
|
+
name: "default",
|
|
105
|
+
fn: p(() => [
|
|
106
|
+
h(o.$slots, "infoIconTooltipContent", {}, void 0, !0)
|
|
107
|
+
]),
|
|
108
|
+
key: "0"
|
|
109
|
+
} : void 0
|
|
110
|
+
]), 1032, ["popover-text"])) : s("", !0)
|
|
111
|
+
])
|
|
112
|
+
]),
|
|
113
|
+
o.description || o.hasSlot("description") || o.lastUpdated ? (a(), i(_, {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: "b-header__meta-container",
|
|
116
|
+
description: o.description,
|
|
117
|
+
"last-updated": o.lastUpdated,
|
|
118
|
+
"reload-button": o.reloadButton
|
|
119
|
+
}, m({ _: 2 }, [
|
|
120
|
+
o.hasSlot("description") ? {
|
|
121
|
+
name: "description",
|
|
122
|
+
fn: p(() => [
|
|
123
|
+
h(o.$slots, "description", {}, void 0, !0)
|
|
124
|
+
]),
|
|
125
|
+
key: "0"
|
|
126
|
+
} : void 0
|
|
127
|
+
]), 1032, ["description", "last-updated", "reload-button"])) : s("", !0),
|
|
128
|
+
o.actions ? (a(), i(b, {
|
|
129
|
+
key: 1,
|
|
130
|
+
actions: o.actions,
|
|
131
|
+
"displayed-actions": 2,
|
|
132
|
+
class: "b-header__actions"
|
|
133
|
+
}, null, 8, ["actions"])) : s("", !0)
|
|
134
|
+
])
|
|
135
|
+
], 2);
|
|
136
|
+
}
|
|
137
|
+
const F = /* @__PURE__ */ A($, [["render", G], ["__scopeId", "data-v-346bb7c6"]]);
|
|
138
|
+
export {
|
|
139
|
+
F as B
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=header.wiq0wlgm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.wiq0wlgm.js","sources":["../../../vue2/src/components/header/header.types.ts","../../../vue2/src/components/header/header.vue"],"sourcesContent":["import { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoHeaderVariant {\n PAGE = 'page',\n COMPONENT = 'component',\n}\n\nexport interface BentoHeaderReloadButton {\n title: string;\n event?: (event: Event) => void;\n state?: `${BentoLoadingButtonState}`;\n}\n","<template>\n <header class=\"b-header\" :class=\"conditionalClasses\">\n <div class=\"b-header__wrapper\">\n <div class=\"b-header__title\">\n <div>\n <bento-typography v-bind=\"typography\" class=\"b-header__text\">{{ title }}</bento-typography>\n <info-icon-with-popover\n v-if=\"infoIconTooltipText || hasSlot('infoIconTooltipContent')\"\n class=\"b-header__tooltip\"\n :popover-text=\"infoIconTooltipText\"\n >\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #default\n ><slot name=\"infoIconTooltipContent\"\n /></template>\n </info-icon-with-popover>\n </div>\n </div>\n <header-meta\n v-if=\"description || hasSlot('description') || lastUpdated\"\n class=\"b-header__meta-container\"\n :description=\"description\"\n :last-updated=\"lastUpdated\"\n :reload-button=\"reloadButton\"\n >\n <template v-if=\"hasSlot('description')\" #description><slot name=\"description\" /></template>\n </header-meta>\n <button-actions-with-menu\n v-if=\"actions\"\n :actions=\"actions\"\n :displayed-actions=\"2\"\n class=\"b-header__actions\"\n />\n </div>\n </header>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { InfoIconWithPopover } from '@/internal';\n import { BentoButtonActionsList } from '@/components/button';\n import { useHasSlot } from '@/composables';\n import { BentoHeaderReloadButton, BentoHeaderVariant } from './header.types';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { HeaderMeta } from '@/internal/header-meta';\n import ButtonActionsWithMenu from '../internal/button-actions-with-menu/button-actions-with-menu.vue';\n\n export default defineComponent({\n name: 'bento-header',\n components: {\n BentoTypography,\n ButtonActionsWithMenu,\n InfoIconWithPopover,\n HeaderMeta,\n },\n props: {\n /**\n * Array of BentoButtonActionsList to show to the right of the title\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text showed under the title\n */\n description: { type: String, default: null },\n\n /**\n * Text showed in the info-icon tooltip on hover\n */\n infoIconTooltipText: { type: InfoIconWithPopover.props.popoverText.type, default: null },\n\n /**\n * Popover position of the info icon text.\n */\n infoIconPopoverPosition: {\n type: InfoIconWithPopover.props.popoverPosition.type,\n default: InfoIconWithPopover.props.popoverPosition.default,\n validator: InfoIconWithPopover.props.popoverPosition.validator,\n },\n\n /**\n * JavaScript \"Date\" object for when the content was last updated\n */\n lastUpdated: { type: [Date, Number], default: null },\n\n /**\n * Variant represents type of Header\n * @values page, component\n */\n variant: {\n type: String as PropType<BentoHeaderVariant | `${BentoHeaderVariant}`>,\n default: BentoHeaderVariant.PAGE,\n validator: (value: BentoHeaderVariant) => Object.values(BentoHeaderVariant).includes(value),\n },\n\n /**\n * Text used as a title\n */\n title: { type: String, required: true },\n\n /**\n * Reload button which shows next to the header's timestamp\n * {@see BentoHeaderReloadButton}\n */\n reloadButton: {\n type: Object as PropType<BentoHeaderReloadButton>,\n default: null,\n },\n },\n emits: ['reload'],\n setup(props, { slots }) {\n const conditionalClasses = computed(() => ({\n 'b-header--component': props.variant === BentoHeaderVariant.COMPONENT,\n }));\n\n const typography = computed(() => ({\n el: props.variant === BentoHeaderVariant.PAGE ? BentoTypographyElement.H1 : BentoTypographyElement.H2,\n variant: BentoTypographyVariant.TITLE,\n medium: props.variant === BentoHeaderVariant.COMPONENT,\n large: props.variant === BentoHeaderVariant.PAGE,\n }));\n return {\n hasSlot: useHasSlot(slots),\n conditionalClasses,\n typography,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./header.scss\" />\n"],"names":["BentoHeaderVariant","BentoHeaderVariant2","_sfc_main","defineComponent","BentoTypography","ButtonActionsWithMenu","InfoIconWithPopover","HeaderMeta","value","props","slots","conditionalClasses","computed","typography","BentoTypographyElement","BentoTypographyVariant","useHasSlot","_component_button_actions_with_menu","resolveComponent","normalizeClass","_ctx","createElementVNode","_hoisted_2","createVNode","_component_bento_typography","mergeProps","withCtx","createTextVNode","toDisplayString","infoIconTooltipText","openBlock","createBlock","_component_info_icon_with_popover","createSlots","renderSlot","createCommentVNode","description","_component_header_meta","reloadButton"],"mappings":";;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA;ACyCR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,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AAAM,GAAA;AAAA,QAmBgD,KAAA;AAAA,QAC/B,OAAA;AAAA,QACA,aAAAjB,EAAA;AAAA,QACekB,gBAAAA,EAAAA;AAAAA,QAtBhC,iBAAAlB,EAAA;AAAA,MAwBuC,GAAAa,EAAA,EAAA,GAAA,EAAA,GAAA;AAAA,QAxBvCb,EAAA,QAAA,aAAA,IAAA;AAAA,UAwBqE,MAAA;AAAA,UAAA,IAAAM,EAAA,MAAA;AAAA,YAxBrEQ,EAAAd,EAAA,QAAA,eAAA,CAAA,GAAA,QAAA,EAAA;AAAA,UAAA,CAAA;AAAA,UAAA,KAAA;AAAA,QAAA,IAAA;AAAA,MAAA,CAAA,GAAA,MAAA,CAAA,eAAA,gBAAA,eAAA,CAAA,KAAAe,EAAA,IAAA,EAAA;AAAA,MA+Bcf,EAAA,WAAAU,EAAA,GAAAC,EAAAd,GAAA;AAAA,QAHmB,KAAA;AAAA,QAChB,SAAAG,EAAA;AAAA,QACK,qBAAA;AAAA,QA9BtB,OAAA;AAAA,MAAA,GAAA,MAAA,GAAA,CAAA,SAAA,CAAA,KAAAe,EAAA,IAAA,EAAA;AAAA;;;;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as ge, useAttrs as ke, ref as
|
|
1
|
+
import { defineComponent as ge, useAttrs as ke, ref as s, provide as Ee, computed as p, watch as W, createElementBlock as S, openBlock as r, createVNode as P, createBlock as v, createCommentVNode as b, unref as t, mergeProps as we, createSlots as ye, withCtx as f, createTextVNode as A, toDisplayString as C, createElementVNode as U, normalizeClass as ae, Fragment as Ce, renderList as Re } from "vue";
|
|
2
2
|
import { B as Le } from "./button.AB0SOQMn.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
import { B as
|
|
5
|
-
import { B as
|
|
3
|
+
import { _ as Te } from "./image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js";
|
|
4
|
+
import { B as Ie } from "./input-field.CmV2d_Zc.js";
|
|
5
|
+
import { B as Oe } from "./popover.DYgCCUCJ.js";
|
|
6
6
|
import { B as x } from "./typography.DN5eC5ch.js";
|
|
7
7
|
import { C as Se } from "./checkmark-circle-fill._6-d40ru.js";
|
|
8
|
-
import { D as
|
|
9
|
-
import { S as Ae, H as
|
|
10
|
-
import { e as
|
|
11
|
-
import { u as
|
|
8
|
+
import { D as Pe } from "./dot.ob6N-5Um.js";
|
|
9
|
+
import { S as Ae, H as Ue } from "./show.CT4Augxb.js";
|
|
10
|
+
import { e as Ve, w as Ne } from "./index.FNUaPG4G.js";
|
|
11
|
+
import { u as qe } from "./i18n.B6g5VX0q.js";
|
|
12
12
|
import { g as te } from "./generate-uid.NJ8tVoha.js";
|
|
13
|
-
import { b as
|
|
14
|
-
import { T as
|
|
15
|
-
import { _ as
|
|
13
|
+
import { b as Me } from "./dropdown.CJBk1euy.js";
|
|
14
|
+
import { T as He } from "./tooltip.VYPUHERk.js";
|
|
15
|
+
import { _ as Be } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
16
16
|
import "../assets/input-field-password.css";
|
|
17
17
|
var R = /* @__PURE__ */ ((a) => (a.TEXT = "text", a.PASSWORD = "password", a))(R || {}), k = /* @__PURE__ */ ((a) => (a.MIN_LENGTH = "minLength", a.REQUIRE_LOWERCASE = "requireLowercase", a.REQUIRE_NUMERIC = "requireNumeric", a.REQUIRE_SPECIAL_CHARACTER = "requireSpecialCharacter", a.REQUIRE_UPPERCASE = "requireUppercase", a))(k || {});
|
|
18
18
|
const De = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
19
19
|
function L(a) {
|
|
20
20
|
return (a == null ? void 0 : a.toString()) ?? "";
|
|
21
21
|
}
|
|
22
|
-
function We(a,
|
|
23
|
-
return L(a).length >=
|
|
22
|
+
function We(a, V = 12) {
|
|
23
|
+
return L(a).length >= V;
|
|
24
24
|
}
|
|
25
25
|
function xe(a) {
|
|
26
26
|
return /[a-z]/.test(L(a));
|
|
@@ -78,13 +78,14 @@ const ie = {
|
|
|
78
78
|
key: 1,
|
|
79
79
|
class: "b-input-field-password__validation-status--valid",
|
|
80
80
|
role: "alert"
|
|
81
|
-
}, Ge = ["id"], Ke = { class: "b-input-field-password__validation-list-icon" }, Je = 12, $e = {
|
|
81
|
+
}, Ge = ["id"], Ke = { class: "b-input-field-password__validation-list-icon" }, Je = 12, $e = 500, Ye = 2e3, je = 2e3, ea = {
|
|
82
82
|
i18n: { messages: ie },
|
|
83
83
|
name: "bento-input-field-password"
|
|
84
|
-
},
|
|
85
|
-
|
|
84
|
+
}, aa = /* @__PURE__ */ ge({
|
|
85
|
+
...ea,
|
|
86
86
|
props: {
|
|
87
87
|
condensed: { type: Boolean, default: !1 },
|
|
88
|
+
debounceTime: { default: $e },
|
|
88
89
|
disabled: { type: Boolean, default: !1 },
|
|
89
90
|
disableValidation: { type: Boolean, default: !1 },
|
|
90
91
|
errorMessage: { default: null },
|
|
@@ -96,11 +97,11 @@ const ie = {
|
|
|
96
97
|
withHint: { type: Boolean, default: !0 }
|
|
97
98
|
},
|
|
98
99
|
emits: ["blur", "focus", "input:valid", "input:error", "input"],
|
|
99
|
-
setup(a, { emit:
|
|
100
|
-
const { t: o, n: E } =
|
|
101
|
-
Ee(
|
|
102
|
-
const { focused:
|
|
103
|
-
() =>
|
|
100
|
+
setup(a, { emit: V }) {
|
|
101
|
+
const { t: o, n: E } = qe({ messages: ie }), i = a, w = V, le = ke(), T = s(R.PASSWORD), _ = s(i.value), F = s(!1), oe = s(!1), I = s([]), Q = s({}), h = s(null), g = s(!1), Z = s(null), N = s(null), q = s(null), M = s(!1);
|
|
102
|
+
Ee(Me, "bento-input-field-password");
|
|
103
|
+
const { focused: ne } = Ve(Z), z = te("validationListId"), X = te("validationPopoverId"), H = p(() => T.value === R.TEXT), se = p(
|
|
104
|
+
() => I.value.map(
|
|
104
105
|
(e) => e ? "b-input-field-password__validation-list--valid" : "b-input-field-password__validation-list--invalid"
|
|
105
106
|
)
|
|
106
107
|
), re = p(
|
|
@@ -112,13 +113,13 @@ const ie = {
|
|
|
112
113
|
errorMessage: i.errorMessage,
|
|
113
114
|
placeholder: i.placeholder,
|
|
114
115
|
readonly: i.readonly,
|
|
115
|
-
type:
|
|
116
|
-
value:
|
|
117
|
-
"aria-haspopup":
|
|
118
|
-
"aria-describedby":
|
|
116
|
+
type: T.value,
|
|
117
|
+
value: _.value,
|
|
118
|
+
"aria-haspopup": B.value ? "dialog" : !1,
|
|
119
|
+
"aria-describedby": B.value ? X : "",
|
|
119
120
|
...le
|
|
120
121
|
})), m = p(() => {
|
|
121
|
-
var c, d,
|
|
122
|
+
var c, d, n, y, O, Y;
|
|
122
123
|
if (i.validation && !i.validation.extendDefaultValidation)
|
|
123
124
|
return i.validation;
|
|
124
125
|
const e = [
|
|
@@ -150,14 +151,14 @@ const ie = {
|
|
|
150
151
|
];
|
|
151
152
|
let l = e;
|
|
152
153
|
if (i.validation) {
|
|
153
|
-
const
|
|
154
|
+
const be = e.map((u) => u.key), D = (d = (c = i.validation) == null ? void 0 : c.list) == null ? void 0 : d.map((u) => u.key), _e = ((y = (n = i.validation) == null ? void 0 : n.list) == null ? void 0 : y.filter((u) => !be.includes(u.key))) ?? [];
|
|
154
155
|
l = [...e.map((u) => {
|
|
155
156
|
var j, ee;
|
|
156
157
|
return D != null && D.includes(u.key) ? (ee = (j = i.validation) == null ? void 0 : j.list) == null ? void 0 : ee.find((he) => he.key === u.key) : u;
|
|
157
|
-
}), ...
|
|
158
|
+
}), ..._e];
|
|
158
159
|
}
|
|
159
160
|
return {
|
|
160
|
-
title: ((
|
|
161
|
+
title: ((O = i.validation) == null ? void 0 : O.title) ?? o("validationTitle"),
|
|
161
162
|
suggestion: ((Y = i.validation) == null ? void 0 : Y.suggestion) ?? o("validationSuggestion"),
|
|
162
163
|
list: l
|
|
163
164
|
};
|
|
@@ -166,35 +167,35 @@ const ie = {
|
|
|
166
167
|
return (l = (e = m.value) == null ? void 0 : e.list) == null ? void 0 : l.filter((c) => !c.disabled);
|
|
167
168
|
}), K = p(() => {
|
|
168
169
|
var e;
|
|
169
|
-
return (e =
|
|
170
|
-
}),
|
|
170
|
+
return (e = I.value) == null ? void 0 : e.some((l) => !l);
|
|
171
|
+
}), B = p(
|
|
171
172
|
() => {
|
|
172
173
|
var e, l;
|
|
173
|
-
return
|
|
174
|
+
return N.value && ((l = (e = m.value) == null ? void 0 : e.list) == null ? void 0 : l.length) > 0;
|
|
174
175
|
}
|
|
175
176
|
), J = (e) => {
|
|
176
|
-
typeof e.getModifierState == "function" && (
|
|
177
|
+
typeof e.getModifierState == "function" && (M.value = e.getModifierState("CapsLock"));
|
|
177
178
|
}, ue = () => {
|
|
178
|
-
|
|
179
|
+
H.value ? T.value = R.PASSWORD : T.value = R.TEXT;
|
|
179
180
|
}, ce = (e) => {
|
|
180
|
-
i.disabled || (
|
|
181
|
+
i.disabled || (_.value = e, w("input", _.value));
|
|
181
182
|
}, pe = () => {
|
|
182
183
|
w("focus");
|
|
183
184
|
}, ve = () => {
|
|
184
185
|
w("blur");
|
|
185
186
|
}, $ = (e) => {
|
|
186
187
|
var d;
|
|
187
|
-
const l = (d = G.value) == null ? void 0 : d.map((
|
|
188
|
-
key:
|
|
189
|
-
label:
|
|
190
|
-
isValid:
|
|
188
|
+
const l = (d = G.value) == null ? void 0 : d.map((n) => ({
|
|
189
|
+
key: n.key,
|
|
190
|
+
label: n.label,
|
|
191
|
+
isValid: n.validate(e, ...n.additionalArgs ?? [])
|
|
191
192
|
}));
|
|
192
193
|
let c = 1;
|
|
193
|
-
|
|
194
|
-
const
|
|
194
|
+
I.value = l == null ? void 0 : l.map((n) => n.isValid), Q.value = l == null ? void 0 : l.filter((n) => !n.isValid).reduce((n, y) => {
|
|
195
|
+
const O = y.key ?? `custom-rule-${c++}`;
|
|
195
196
|
return {
|
|
196
|
-
...
|
|
197
|
-
[
|
|
197
|
+
...n,
|
|
198
|
+
[O]: y.label
|
|
198
199
|
};
|
|
199
200
|
}, {});
|
|
200
201
|
}, fe = () => {
|
|
@@ -205,28 +206,28 @@ const ie = {
|
|
|
205
206
|
return W(
|
|
206
207
|
() => i.value,
|
|
207
208
|
(e) => {
|
|
208
|
-
|
|
209
|
+
_.value = e;
|
|
209
210
|
}
|
|
210
|
-
), W(
|
|
211
|
-
e || (oe.value = !0), i.disableValidation || (i.withHint && (F.value = e), $(
|
|
212
|
-
}), W(
|
|
211
|
+
), W(ne, (e) => {
|
|
212
|
+
e || (oe.value = !0), i.disableValidation || (i.withHint && (F.value = e), $(_.value));
|
|
213
|
+
}), W(M, (e) => {
|
|
213
214
|
e ? (g.value = !0, h.value = setTimeout(() => {
|
|
214
215
|
h.value = null, g.value = !1;
|
|
215
|
-
},
|
|
216
|
-
}),
|
|
217
|
-
|
|
216
|
+
}, je)) : (clearTimeout(h.value), h.value = null, g.value = !1);
|
|
217
|
+
}), Ne(
|
|
218
|
+
_,
|
|
218
219
|
(e) => {
|
|
219
220
|
$(e), K.value ? w("input:error", Q.value) : w("input:valid");
|
|
220
221
|
},
|
|
221
222
|
// wait for 0.5s before checking validity OR 2s of continuous typing
|
|
222
|
-
{ debounce:
|
|
223
|
+
{ debounce: i.debounceTime, maxWait: Ye }
|
|
223
224
|
), (e, l) => (r(), S("div", {
|
|
224
225
|
ref_key: "inputFieldPasswordRef",
|
|
225
226
|
ref: Z
|
|
226
227
|
}, [
|
|
227
|
-
|
|
228
|
+
P(t(Ie), we({
|
|
228
229
|
ref_key: "inputFieldPasswordInputRef",
|
|
229
|
-
ref:
|
|
230
|
+
ref: N
|
|
230
231
|
}, de.value, {
|
|
231
232
|
class: "b-input-field-password__input",
|
|
232
233
|
spellcheck: "false",
|
|
@@ -235,55 +236,55 @@ const ie = {
|
|
|
235
236
|
onInput: ce,
|
|
236
237
|
onKeydown: J,
|
|
237
238
|
onKeyup: J
|
|
238
|
-
}),
|
|
239
|
+
}), ye({
|
|
239
240
|
default: f(() => [
|
|
240
|
-
A(
|
|
241
|
+
A(C(e.label), 1)
|
|
241
242
|
]),
|
|
242
243
|
_: 2
|
|
243
244
|
}, [
|
|
244
|
-
|
|
245
|
+
M.value ? {
|
|
245
246
|
name: "iconBefore",
|
|
246
247
|
fn: f(() => [
|
|
247
|
-
|
|
248
|
+
U("div", {
|
|
248
249
|
class: "b-input-field-password__caps-lock-indicator",
|
|
249
250
|
onMouseenter: me,
|
|
250
251
|
onMouseleave: fe
|
|
251
252
|
}, [
|
|
252
|
-
|
|
253
|
+
P(t(Te), {
|
|
253
254
|
ref_key: "inputFieldPasswordCapsLockIconRef",
|
|
254
|
-
ref:
|
|
255
|
+
ref: q,
|
|
255
256
|
src: t(De),
|
|
256
257
|
alt: t(o)("capsLockEnabled")
|
|
257
258
|
}, null, 8, ["src", "alt"])
|
|
258
259
|
], 32),
|
|
259
|
-
|
|
260
|
+
q.value ? (r(), v(t(He), {
|
|
260
261
|
key: 0,
|
|
261
262
|
class: ae(re.value),
|
|
262
263
|
content: t(o)("capsLockEnabled"),
|
|
263
264
|
"disabled-focus-trap": !0,
|
|
264
265
|
"fallback-position": ["top", "bottom"],
|
|
265
266
|
"is-shown": g.value,
|
|
266
|
-
"target-element":
|
|
267
|
-
}, null, 8, ["class", "content", "is-shown", "target-element"])) :
|
|
267
|
+
"target-element": q.value
|
|
268
|
+
}, null, 8, ["class", "content", "is-shown", "target-element"])) : b("", !0)
|
|
268
269
|
]),
|
|
269
270
|
key: "0"
|
|
270
271
|
} : void 0,
|
|
271
272
|
e.disabled ? void 0 : {
|
|
272
273
|
name: "iconAfter",
|
|
273
274
|
fn: f(() => [
|
|
274
|
-
|
|
275
|
+
P(t(Le), {
|
|
275
276
|
variant: "tertiary",
|
|
276
277
|
onClick: ue
|
|
277
278
|
}, {
|
|
278
279
|
iconLeft: f(() => [
|
|
279
|
-
|
|
280
|
+
H.value ? b("", !0) : (r(), v(t(Ae), {
|
|
280
281
|
key: 0,
|
|
281
282
|
"svg-title": t(o)("showPassword")
|
|
282
283
|
}, null, 8, ["svg-title"])),
|
|
283
|
-
|
|
284
|
+
H.value ? (r(), v(t(Ue), {
|
|
284
285
|
key: 1,
|
|
285
286
|
"svg-title": t(o)("hidePassword")
|
|
286
|
-
}, null, 8, ["svg-title"])) :
|
|
287
|
+
}, null, 8, ["svg-title"])) : b("", !0)
|
|
287
288
|
]),
|
|
288
289
|
_: 1
|
|
289
290
|
})
|
|
@@ -291,52 +292,52 @@ const ie = {
|
|
|
291
292
|
key: "1"
|
|
292
293
|
}
|
|
293
294
|
]), 1040),
|
|
294
|
-
|
|
295
|
+
B.value ? (r(), v(t(Oe), {
|
|
295
296
|
key: 0,
|
|
296
297
|
open: F.value,
|
|
297
|
-
"target-element":
|
|
298
|
+
"target-element": N.value,
|
|
298
299
|
"disable-focus-trap": !0,
|
|
299
300
|
"aria-label": m.value.title,
|
|
300
301
|
"aria-describedby": t(z),
|
|
301
302
|
position: "right-start"
|
|
302
303
|
}, {
|
|
303
304
|
default: f(() => [
|
|
304
|
-
|
|
305
|
+
U("div", { id: t(X) }, [
|
|
305
306
|
m.value.title ? (r(), v(t(x), {
|
|
306
307
|
key: 0,
|
|
307
308
|
class: "b-input-field-password__validation-title"
|
|
308
309
|
}, {
|
|
309
310
|
default: f(() => [
|
|
310
|
-
A(
|
|
311
|
+
A(C(m.value.title), 1)
|
|
311
312
|
]),
|
|
312
313
|
_: 1
|
|
313
|
-
})) :
|
|
314
|
-
K.value ?
|
|
315
|
-
|
|
314
|
+
})) : b("", !0),
|
|
315
|
+
K.value ? b("", !0) : (r(), S("p", Xe, C(t(o)("validationValid")), 1)),
|
|
316
|
+
U("ul", {
|
|
316
317
|
id: t(z),
|
|
317
318
|
class: "b-input-field-password__validation-list"
|
|
318
319
|
}, [
|
|
319
|
-
(r(!0), S(
|
|
320
|
+
(r(!0), S(Ce, null, Re(G.value, (c, d) => (r(), S("li", {
|
|
320
321
|
key: d,
|
|
321
|
-
class: ae(
|
|
322
|
+
class: ae(se.value[d]),
|
|
322
323
|
"aria-live": "polite",
|
|
323
324
|
"aria-atomic": "true"
|
|
324
325
|
}, [
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
U("span", Ke, [
|
|
327
|
+
I.value[d] ? (r(), v(t(Se), {
|
|
327
328
|
key: 0,
|
|
328
329
|
"svg-title": t(o)("validationChecked")
|
|
329
|
-
}, null, 8, ["svg-title"])) : (r(), v(t(
|
|
330
|
+
}, null, 8, ["svg-title"])) : (r(), v(t(Pe), {
|
|
330
331
|
key: 1,
|
|
331
332
|
"svg-title": t(o)("validationUnchecked")
|
|
332
333
|
}, null, 8, ["svg-title"]))
|
|
333
334
|
]),
|
|
334
|
-
|
|
335
|
+
P(t(x), {
|
|
335
336
|
class: "b-input-field-password__validation-list-text",
|
|
336
337
|
el: "span"
|
|
337
338
|
}, {
|
|
338
339
|
default: f(() => [
|
|
339
|
-
A(
|
|
340
|
+
A(C(c.label), 1)
|
|
340
341
|
]),
|
|
341
342
|
_: 2
|
|
342
343
|
}, 1024)
|
|
@@ -347,17 +348,17 @@ const ie = {
|
|
|
347
348
|
class: "b-input-field-password__validation-suggestion"
|
|
348
349
|
}, {
|
|
349
350
|
default: f(() => [
|
|
350
|
-
A(
|
|
351
|
+
A(C(m.value.suggestion), 1)
|
|
351
352
|
]),
|
|
352
353
|
_: 1
|
|
353
|
-
})) :
|
|
354
|
+
})) : b("", !0)
|
|
354
355
|
], 8, ze)
|
|
355
356
|
]),
|
|
356
357
|
_: 1
|
|
357
|
-
}, 8, ["open", "target-element", "aria-label", "aria-describedby"])) :
|
|
358
|
+
}, 8, ["open", "target-element", "aria-label", "aria-describedby"])) : b("", !0)
|
|
358
359
|
], 512));
|
|
359
360
|
}
|
|
360
|
-
}), ga = /* @__PURE__ */
|
|
361
|
+
}), ga = /* @__PURE__ */ Be(aa, [["__scopeId", "data-v-e34e62b5"]]);
|
|
361
362
|
export {
|
|
362
363
|
Fe as a,
|
|
363
364
|
Qe as b,
|
|
@@ -366,4 +367,4 @@ export {
|
|
|
366
367
|
We as m,
|
|
367
368
|
xe as r
|
|
368
369
|
};
|
|
369
|
-
//# sourceMappingURL=input-field-password.
|
|
370
|
+
//# sourceMappingURL=input-field-password.Cr3A_4n0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-field-password.Cr3A_4n0.js","sources":["../../../vue2/src/components/input-field-password/input-field-password.types.ts","../../../vue2/src/components/input-field-password/assets/capslock.svg","../../../vue2/src/components/input-field-password/utilities/input-field-password.validation.ts","../../../vue2/src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import type { BentoInputFieldProps, BentoInputFieldValue } from '@/components/input-field/input-field.types';\n\n/**\n * Public\n */\n\nexport interface BentoInputFieldPasswordValidationListItem {\n label?: string;\n key?: BentoInputFieldPasswordDefaultRuleKeys | string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validate?: (value: BentoInputFieldValue, ...args: any[]) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: any[];\n disabled?: boolean;\n}\n\nexport type BentoInputFieldPasswordDefaultRuleKeys =\n | 'minLength'\n | 'requireLowercase'\n | 'requireNumeric'\n | 'requireSpecialCharacter'\n | 'requireUppercase';\n\nexport type BentoInputFieldPasswordErrorsList = Record<BentoInputFieldPasswordDefaultRuleKeys | string, string>;\n\nexport interface BentoInputFieldPasswordValidation {\n title?: string;\n suggestion?: string;\n extendDefaultValidation?: boolean;\n list: BentoInputFieldPasswordValidationListItem[];\n}\n\nexport interface BentoInputFieldPasswordProps {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * The debounce time in milliseconds for running validation and emitting the `input` event after the user has stopped typing.\n * This helps to avoid excessive validation checks on every keystroke. Defaults to `500`.\n */\n debounceTime?: number;\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled?: BentoInputFieldProps['disabled'];\n\n /**\n * Performs real-time validations over the input value. Default: `false`.\n * Disabling the option (set to `true`) will not run pre-defined validations or custom validations defined in the `validation` field.\n */\n disableValidation?: boolean;\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage?: BentoInputFieldProps['errorMessage'];\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: BentoInputFieldProps['placeholder'];\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly?: BentoInputFieldProps['readonly'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Label to be shown with the input field\n */\n label?: string;\n\n /**\n * Configuration object for password field validation.\n *\n * This object defines the validation criteria and associated messages for a password field.\n * It includes the following properties:\n *\n * - `title`: The title displayed at the top of the validation hint.\n * - `suggestion`: The message displayed at the bottom of the validation hint, providing additional guidance.\n * - `extendDefaultValidation`: Set to true if you want to add your custom rules to the default validation instead of overriding the list.\n * - `list`: An array of callback functions to be executed on the value after each user input, validating the password against the specified rules.\n *\n * By default, the validation checks that:\n *\n * - The value has a minimum length of 12 characters.\n * - The value contains at least one lowercase letter.\n * - The value contains at least one uppercase letter.\n * - The value contains at least one numeric digit.\n * - The value contains at least one special character.\n *\n *\n */\n validation?: BentoInputFieldPasswordValidation;\n\n /**\n * Whether the password validation hint is displayed when the input field is activated via focus or input\n */\n withHint?: boolean;\n}\n\n/**\n * Private\n */\n\nexport enum BentoInputFieldPasswordType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport enum BentoInputFieldPasswordDefaultRule {\n MIN_LENGTH = 'minLength',\n REQUIRE_LOWERCASE = 'requireLowercase',\n REQUIRE_NUMERIC = 'requireNumeric',\n REQUIRE_SPECIAL_CHARACTER = 'requireSpecialCharacter',\n REQUIRE_UPPERCASE = 'requireUppercase',\n}\n","export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","import { BentoInputFieldValue } from '@/components/input-field';\n\nfunction stringifyValue(value: BentoInputFieldValue): string {\n return value?.toString() ?? '';\n}\n\n/**\n * Validates if the length of the provided value is greater than or equal to the specified length.\n *\n * @param value - The input value to check.\n * @param length - The minimum required length of the value. Defaults to 12.\n * @returns `true` if the length of the value is greater than or equal to the specified length, `false` otherwise.\n */\nexport function minLength(value: BentoInputFieldValue, length = 12): boolean {\n return stringifyValue(value).length >= length;\n}\n\n/**\n * Validates if the provided value contains at least one lowercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one lowercase letter, `false` otherwise.\n */\nexport function requireLowercase(value: BentoInputFieldValue): boolean {\n return /[a-z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one uppercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one uppercase letter, `false` otherwise.\n */\nexport function requireUppercase(value: BentoInputFieldValue): boolean {\n return /[A-Z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one numerical digit.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one numerical digit, `false` otherwise.\n */\nexport function requireNumeric(value: BentoInputFieldValue): boolean {\n return /\\d/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one special character (non-alphanumeric).\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one special character, `false` otherwise.\n */\nexport function requireSpecialCharacter(value: BentoInputFieldValue): boolean {\n return /[^a-zA-Z0-9]/.test(stringifyValue(value));\n}\n","<template>\n <div ref=\"inputFieldPasswordRef\">\n <bento-input-field\n ref=\"inputFieldPasswordInputRef\"\n v-bind=\"inputFieldArgs\"\n class=\"b-input-field-password__input\"\n spellcheck=\"false\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @input=\"onInput\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template #default>{{ label }}</template>\n\n <template v-if=\"isCapsLockOn\" #iconBefore>\n <div\n class=\"b-input-field-password__caps-lock-indicator\"\n @mouseenter=\"handleCapsLockMouseEnter\"\n @mouseleave=\"handleCapsLockMouseLeave\"\n >\n <bento-image\n ref=\"inputFieldPasswordCapsLockIconRef\"\n :src=\"CapsLockIcon\"\n :alt=\"t('capsLockEnabled')\"\n />\n </div>\n\n <tooltip\n v-if=\"inputFieldPasswordCapsLockIconRef\"\n :class=\"tooltipConditionalClass\"\n :content=\"t('capsLockEnabled')\"\n :disabled-focus-trap=\"true\"\n :fallback-position=\"['top', 'bottom']\"\n :is-shown=\"isTooltipDisplayed\"\n :target-element=\"inputFieldPasswordCapsLockIconRef\"\n />\n </template>\n\n <template v-if=\"!disabled\" #iconAfter>\n <bento-button variant=\"tertiary\" @click=\"toggleInputType\">\n <template #iconLeft>\n <show-icon v-if=\"!isPasswordReadable\" :svg-title=\"t('showPassword')\" />\n <hide-icon v-if=\"isPasswordReadable\" :svg-title=\"t('hidePassword')\" />\n </template>\n </bento-button>\n </template>\n </bento-input-field>\n\n <bento-popover\n v-if=\"hasValidations\"\n :open=\"isHintDisplayed\"\n :target-element=\"inputFieldPasswordInputRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"computedValidations.title\"\n :aria-describedby=\"validationListId\"\n position=\"right-start\"\n >\n <div :id=\"validationPopoverId\">\n <bento-typography v-if=\"computedValidations.title\" class=\"b-input-field-password__validation-title\">\n {{ computedValidations.title }}\n </bento-typography>\n\n <p v-if=\"!hasErrors\" class=\"b-input-field-password__validation-status--valid\" role=\"alert\">\n {{ t('validationValid') }}\n </p>\n\n <ul :id=\"validationListId\" class=\"b-input-field-password__validation-list\">\n <li\n v-for=\"(rule, index) in computedValidationList\"\n :key=\"index\"\n :class=\"passwordValidityConditionalClass[index]\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <span class=\"b-input-field-password__validation-list-icon\">\n <checkmark-circle-fill-icon\n v-if=\"passwordValidity[index]\"\n :svg-title=\"t('validationChecked')\"\n />\n\n <dot-icon v-else :svg-title=\"t('validationUnchecked')\" />\n </span>\n\n <bento-typography class=\"b-input-field-password__validation-list-text\" el=\"span\">\n {{ rule.label }}\n </bento-typography>\n </li>\n </ul>\n\n <bento-typography\n v-if=\"computedValidations.suggestion\"\n class=\"b-input-field-password__validation-suggestion\"\n >\n {{ computedValidations.suggestion }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButton } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { BentoInputField } from '@/components/input-field';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { Tooltip } from '@/internal';\n import type { BentoInputFieldProps } from '@/components/input-field/input-field.types';\n import {\n BentoInputFieldPasswordDefaultRule,\n BentoInputFieldPasswordErrorsList,\n type BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n BentoInputFieldPasswordValidation,\n BentoInputFieldPasswordValidationListItem,\n } from './input-field-password.types';\n import CheckmarkCircleFillIcon from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n import HideIcon from '@adyen/ui-assets-icons-16/vue/hide';\n import ShowIcon from '@adyen/ui-assets-icons-16/vue/show';\n import CapsLockIcon from './assets/capslock.svg';\n\n import { useFocusWithin, watchDebounced } from '@vueuse/core';\n import { computed, provide, ref, SetupContext, useAttrs, watch } from 'vue';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import {\n minLength,\n requireLowercase,\n requireNumeric,\n requireSpecialCharacter,\n requireUppercase,\n } from '@/components/input-field-password/utilities/input-field-password.validation';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n import { INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t, n } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoInputFieldPasswordProps>(), {\n condensed: false,\n debounceTime: DEBOUNCE_DURATION,\n disabled: false,\n disableValidation: false,\n label: null,\n errorMessage: null,\n placeholder: '',\n readonly: false,\n validation: undefined,\n value: undefined,\n withHint: true,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emits an `input:valid` event when the value is validated against the provided validations.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:valid'): void;\n\n /**\n * Emits an `input:error` event when the value fails the validation.\n * This emit has a debounce and is emitted after an `input` event.\n */\n (e: 'input:error', errors: BentoInputFieldPasswordErrorsList): void;\n\n /**\n * Emits an `input` event whenever the value in the input is changed.\n */\n (e: 'input', value: BentoInputFieldPasswordProps['value']): void;\n }>();\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<boolean[]>([]);\n const errorsList = ref<BentoInputFieldPasswordErrorsList>({});\n const capsLockTooltipTimeoutID = ref<ReturnType<typeof setTimeout>>(null);\n const isTooltipDisplayed = ref(false);\n const inputFieldPasswordRef = ref(null);\n const inputFieldPasswordInputRef = ref(null);\n const inputFieldPasswordCapsLockIconRef = ref(null);\n const isCapsLockOn = ref(false);\n\n provide(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, 'bento-input-field-password');\n\n const { focused } = useFocusWithin(inputFieldPasswordRef);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\n\n const passwordValidityConditionalClass = computed(() =>\n passwordValidity.value.map(validity =>\n validity\n ? 'b-input-field-password__validation-list--valid'\n : 'b-input-field-password__validation-list--invalid'\n )\n );\n\n const tooltipConditionalClass = computed(() =>\n capsLockTooltipTimeoutID.value ? 'b-input-field-password__input-tooltip--timed' : ''\n );\n\n const inputFieldArgs = computed<BentoInputFieldProps & SetupContext['attrs']>(() => ({\n ariaHidden: false,\n condensed: props.condensed,\n disabled: props.disabled,\n errorMessage: props.errorMessage,\n placeholder: props.placeholder,\n readonly: props.readonly,\n type: inputType.value,\n value: inputValue.value,\n\n 'aria-haspopup': hasValidations.value ? 'dialog' : false,\n 'aria-describedby': hasValidations.value ? validationPopoverId : '',\n\n ...attrs,\n }));\n\n const computedValidations = computed<BentoInputFieldPasswordValidation>(() => {\n if (props.validation && !props.validation.extendDefaultValidation) {\n return props.validation;\n }\n\n const defaultValidationList = [\n {\n label: t('validationMinLength', { numberOfCharacters: n(MIN_PASSWORD_LENGTH) }),\n key: BentoInputFieldPasswordDefaultRule.MIN_LENGTH,\n validate: minLength,\n },\n {\n label: t('validationRequireLowercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_LOWERCASE,\n validate: requireLowercase,\n },\n {\n label: t('validationRequireUppercase', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_UPPERCASE,\n validate: requireUppercase,\n },\n {\n label: t('validationRequireNumeric', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_NUMERIC,\n validate: requireNumeric,\n },\n {\n label: t('validationRequireSpecialCharacter', { numberOne: n(1) }),\n key: BentoInputFieldPasswordDefaultRule.REQUIRE_SPECIAL_CHARACTER,\n validate: requireSpecialCharacter,\n },\n ];\n\n let validationList: BentoInputFieldPasswordValidationListItem[] = defaultValidationList;\n\n if (props.validation) {\n const defaultValidationKeys: string[] = defaultValidationList.map(rule => rule.key);\n const customRuleKeys = props.validation?.list?.map(rule => rule.key);\n // remove from the custom list any rules with default keys (rules that are overriding existent rules)\n const customValidationList =\n props.validation?.list?.filter(rule => !defaultValidationKeys.includes(rule.key)) ?? [];\n\n // loop through the default list and replace default rule with the custom rule if it exists\n const validationListWithOverrides = defaultValidationList.map(rule => {\n if (customRuleKeys?.includes(rule.key)) {\n const customRule = props.validation?.list?.find(customRule => customRule.key === rule.key);\n return customRule;\n } else {\n return rule;\n }\n });\n validationList = [...validationListWithOverrides, ...customValidationList];\n }\n\n return {\n title: props.validation?.title ?? t('validationTitle'),\n suggestion: props.validation?.suggestion ?? t('validationSuggestion'),\n list: validationList,\n };\n });\n\n const computedValidationList = computed(() => computedValidations.value?.list?.filter(rule => !rule.disabled));\n\n const hasErrors = computed(() => passwordValidity.value?.some(validation => !validation));\n const hasValidations = computed(\n () => inputFieldPasswordInputRef.value && computedValidations.value?.list?.length > 0\n );\n\n const checkCapsLock = (e: KeyboardEvent) => {\n // Check if getModifierState exists and is a function in case the user's browser is autofilling\n if (typeof e.getModifierState === 'function') {\n isCapsLockOn.value = e.getModifierState('CapsLock');\n }\n };\n\n const toggleInputType = () => {\n if (isPasswordReadable.value) {\n inputType.value = BentoInputFieldPasswordType.PASSWORD;\n } else {\n inputType.value = BentoInputFieldPasswordType.TEXT;\n }\n };\n\n const onInput = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emit('input', inputValue.value);\n };\n\n const onFocus = () => {\n emit('focus');\n };\n\n const onBlur = () => {\n emit('blur');\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n const rulesValidityObj = computedValidationList.value?.map(validationItem => ({\n key: validationItem.key,\n label: validationItem.label,\n isValid: validationItem.validate(value, ...(validationItem.additionalArgs ?? [])),\n }));\n let customRuleIndex = 1;\n\n passwordValidity.value = rulesValidityObj?.map(error => error.isValid);\n\n errorsList.value = rulesValidityObj\n ?.filter(rule => !rule.isValid)\n .reduce((errorsObject, error) => {\n const key = error.key ?? `custom-rule-${customRuleIndex++}`;\n return {\n ...errorsObject,\n [key]: error.label,\n };\n }, {});\n };\n\n const handleCapsLockMouseLeave = () => {\n isTooltipDisplayed.value = false;\n capsLockTooltipTimeoutID.value = null;\n };\n\n const handleCapsLockMouseEnter = () => {\n isTooltipDisplayed.value = true;\n };\n\n watch(\n () => props.value,\n newValue => {\n inputValue.value = newValue;\n }\n );\n\n watch(focused, focused => {\n // Always set dirty to true when blur occurs\n if (!focused) {\n isTouched.value = true;\n }\n\n // Disable validations & hint if \"disableValidation\" is \"true\"\n if (!props.disableValidation) {\n if (props.withHint) {\n isHintDisplayed.value = focused;\n }\n checkValidity(inputValue.value);\n }\n });\n\n watch(isCapsLockOn, isCapsLockOn => {\n if (!isCapsLockOn) {\n clearTimeout(capsLockTooltipTimeoutID.value);\n\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n } else {\n isTooltipDisplayed.value = true;\n\n capsLockTooltipTimeoutID.value = setTimeout(() => {\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n }, TOOLTIP_TIMEOUT);\n }\n });\n\n watchDebounced(\n inputValue,\n inputValue => {\n checkValidity(inputValue);\n\n if (!hasErrors.value) {\n emit('input:valid');\n } else {\n emit('input:error', errorsList.value);\n }\n },\n // wait for 0.5s before checking validity OR 2s of continuous typing\n { debounce: props.debounceTime, maxWait: DEBOUNCE_MAX_WAIT }\n );\n</script>\n\n<script lang=\"ts\">\n const MIN_PASSWORD_LENGTH = 12;\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\n /**\n * The input field password is a component designed to support users' preference for entering values securely.\n * This is an extension of the `bento-input-field` component.\n *\n * @example\n * import { BentoInputFieldPassword } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInputFieldPassword },\n * template: `\n * <bento-input-field-password\n * label=\"Label\"\n * error-message=\"Error\"\n * :validation=\"{\n * extendDefaultValidation: true,\n * list: [\n * { label: '18 characters', key: 'minLength', validate: minLength, additionalArgs: [18] },\n * { label: 'Always true', key: 'alwaysTrue', validate: () => true },\n * { key: 'requireSpecialCharacter', disabled: true }\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field-password.scss\" />\n"],"names":["BentoInputFieldPasswordType","BentoInputFieldPasswordType2","BentoInputFieldPasswordDefaultRule","BentoInputFieldPasswordDefaultRule2","CapsLockIcon","stringifyValue","value","minLength","length","requireLowercase","requireUppercase","requireNumeric","requireSpecialCharacter","MIN_PASSWORD_LENGTH","DEBOUNCE_DURATION","DEBOUNCE_MAX_WAIT","TOOLTIP_TIMEOUT","__default__","messages","t","n","useI18n","props","__props","emit","__emit","attrs","useAttrs","inputType","ref","inputValue","isHintDisplayed","isTouched","passwordValidity","errorsList","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","provide","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","focused","useFocusWithin","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","defaultValidationList","validationList","defaultValidationKeys","rule","customRuleKeys","_b","_a","customValidationList","_d","_c","customRule2","_e","_f","computedValidationList","hasErrors","validation","checkCapsLock","toggleInputType","onInput","onFocus","onBlur","checkValidity","rulesValidityObj","validationItem","customRuleIndex","error","errorsObject","key","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","newValue","focused2","isCapsLockOn2","watchDebounced","inputValue2"],"mappings":";;;;;;;;;;;;;;;;AAiHY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,aAAA,aACAA,EAAA,oBAAA,oBACAA,EAAA,kBAAA,kBACAA,EAAA,4BAAA,2BACAA,EAAA,oBAAA,oBALQA,IAAAD,KAAA,CAAA,CAAA;ACtHZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASgB,SAAAC,GAAAD,GAAAE,IAAA,IAAA;AACZ,SAAAH,EAAAC,CAAA,EAAA,UAAAE;AACJ;AAQO,SAAAC,GAAAH,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAI,GAAAJ,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAK,GAAAL,GAAA;AACH,SAAA,KAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAM,GAAAN,GAAA;AACH,SAAA,eAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gFCiXIO,KAAA,IACAC,KAAA,KACAC,KAAA,KACAC,KAAA,KA2BAC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;AA5TA,UAAA,EAAA,GAAAC,GAAA,GAAAC,EAAA,IAAAC,GAAA,EAAA,UAAAH,GAAA,CAAA,GAEAI,IAAAC,GAcAC,IAAAC,GA6BAC,KAAAC,GAAA,GAEAC,IAAAC,EAAA7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