@telefonica/mistica 14.15.0 → 14.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/mistica.css +1 -1
- package/dist/card.d.ts +3 -3
- package/dist/card.js +86 -90
- package/dist/checkbox.css-mistica.js +4 -4
- package/dist/checkbox.js +10 -9
- package/dist/credit-card-number-field.js +22 -19
- package/dist/cvv-field.js +60 -47
- package/dist/date-time-picker.d.ts +10 -0
- package/dist/date-time-picker.js +54 -35
- package/dist/hooks.d.ts +1 -1
- package/dist/icons/icon-cvv-amex.d.ts +1 -0
- package/dist/icons/icon-cvv-amex.js +5 -4
- package/dist/icons/icon-cvv-visa-mc.d.ts +1 -0
- package/dist/icons/icon-cvv-visa-mc.js +7 -6
- package/dist/index.d.ts +1 -0
- package/dist/list.css-mistica.js +1 -1
- package/dist/list.js +90 -91
- package/dist/package-version.js +1 -1
- package/dist/radio-button.css-mistica.js +12 -12
- package/dist/radio-button.js +34 -33
- package/dist/search-field.js +8 -8
- package/dist/select.css-mistica.js +6 -6
- package/dist/select.js +145 -142
- package/dist/skins/blau.js +10 -0
- package/dist/skins/defaults.js +10 -0
- package/dist/skins/movistar-legacy.js +10 -0
- package/dist/skins/movistar.js +10 -0
- package/dist/skins/o2.js +10 -0
- package/dist/skins/telefonica.js +12 -2
- package/dist/skins/types/index.d.ts +10 -0
- package/dist/skins/vivo-new.js +10 -0
- package/dist/skins/vivo.js +10 -0
- package/dist/switch-component.css-mistica.js +9 -9
- package/dist/switch-component.js +16 -15
- package/dist/tabs.js +32 -28
- package/dist/text-field-base.js +44 -44
- package/dist/theme-context-provider.js +25 -24
- package/dist/theme.d.ts +5 -2
- package/dist/theme.js +73 -24
- package/dist/video.d.ts +7 -1
- package/dist/video.js +116 -76
- package/dist-es/card.js +115 -119
- package/dist-es/checkbox.css-mistica.js +4 -4
- package/dist-es/checkbox.js +21 -20
- package/dist-es/credit-card-number-field.js +23 -20
- package/dist-es/cvv-field.js +74 -61
- package/dist-es/date-time-picker.js +66 -47
- package/dist-es/icons/icon-cvv-amex.js +5 -4
- package/dist-es/icons/icon-cvv-visa-mc.js +9 -8
- package/dist-es/list.css-mistica.js +1 -1
- package/dist-es/list.js +114 -115
- package/dist-es/package-version.js +1 -1
- package/dist-es/radio-button.css-mistica.js +6 -6
- package/dist-es/radio-button.js +38 -37
- package/dist-es/search-field.js +7 -7
- package/dist-es/select.css-mistica.js +5 -5
- package/dist-es/select.js +173 -170
- package/dist-es/skins/blau.js +10 -0
- package/dist-es/skins/defaults.js +10 -0
- package/dist-es/skins/movistar-legacy.js +10 -0
- package/dist-es/skins/movistar.js +10 -0
- package/dist-es/skins/o2.js +10 -0
- package/dist-es/skins/telefonica.js +12 -2
- package/dist-es/skins/vivo-new.js +10 -0
- package/dist-es/skins/vivo.js +10 -0
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +7 -7
- package/dist-es/switch-component.js +37 -36
- package/dist-es/tabs.js +49 -45
- package/dist-es/text-field-base.js +64 -64
- package/dist-es/theme-context-provider.js +56 -55
- package/dist-es/theme.js +69 -20
- package/dist-es/video.js +121 -81
- package/package.json +2 -2
- package/dist/cvv-field.css-mistica.js +0 -21
- package/dist/cvv-field.css.d.ts +0 -2
- package/dist/cvv-field.css.ts.vanilla.css-mistica.js +0 -11
- package/dist/icons/icon-creditcard.d.ts +0 -7
- package/dist/icons/icon-creditcard.js +0 -33
- package/dist/icons/icon-info-cvv.d.ts +0 -7
- package/dist/icons/icon-info-cvv.js +0 -26
- package/dist/icons/icon-search.d.ts +0 -7
- package/dist/icons/icon-search.js +0 -32
- package/dist-es/cvv-field.css-mistica.js +0 -4
- package/dist-es/cvv-field.css.ts.vanilla.css-mistica.js +0 -2
- package/dist-es/icons/icon-creditcard.js +0 -24
- package/dist-es/icons/icon-info-cvv.js +0 -17
- package/dist-es/icons/icon-search.js +0 -23
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./checkbox.css.ts.vanilla.css-mistica.js";
|
|
3
3
|
var n = {
|
|
4
|
-
ios: "_1rz9b15
|
|
5
|
-
rest: "
|
|
6
|
-
checked: "
|
|
7
|
-
}, r = "
|
|
4
|
+
ios: "_1rz9b16 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
|
|
5
|
+
rest: "_1rz9b17 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30",
|
|
6
|
+
checked: "_1rz9b18 _1rz9b15 _1y2v1nf65 _1y2v1nf6d _1y2v1nf6j _1y2v1nf6m _1y2v1nfam _1y2v1nf30"
|
|
7
|
+
}, r = "_1rz9b1a _1y2v1nf66", f = "_1rz9b1b", y = "_1rz9b12 _1rz9b11 _1y2v1nf67", b = "_1rz9b13 _1rz9b11 _1y2v1nf67", a = "_1rz9b1c";
|
|
8
8
|
export { n as boxVariant, r as check, f as checkChecked, y as checkboxContainer, b as checkboxContainerDisabled, a as disabled };
|
package/dist-es/checkbox.js
CHANGED
|
@@ -52,18 +52,18 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { jsx as a, jsxs as w } from "react/jsx-runtime";
|
|
54
54
|
import * as I from "react";
|
|
55
|
-
import { SPACE as
|
|
56
|
-
import { useControlProps as
|
|
57
|
-
import
|
|
55
|
+
import { SPACE as A } from "./utils/key-codes.js";
|
|
56
|
+
import { useControlProps as D } from "./form-context.js";
|
|
57
|
+
import L from "./inline.js";
|
|
58
58
|
import { Text3 as m } from "./text.js";
|
|
59
|
-
import { useAriaId as
|
|
59
|
+
import { useAriaId as N, useTheme as P } from "./hooks.js";
|
|
60
60
|
import n from "classnames";
|
|
61
61
|
import { getPrefixedDataAttributes as S } from "./utils/dom.js";
|
|
62
|
-
import {
|
|
63
|
-
import { vars as
|
|
62
|
+
import { checkboxContainerDisabled as E, checkboxContainer as V, disabled as v, check as f, checkChecked as u, boxVariant as j } from "./checkbox.css-mistica.js";
|
|
63
|
+
import { vars as k } from "./skins/skin-contract.css-mistica.js";
|
|
64
64
|
const z = (param)=>{
|
|
65
65
|
let { isChecked: e , disabled: o } = param;
|
|
66
|
-
const { isIos: l } = P(),
|
|
66
|
+
const { isIos: l } = P(), r = l ? /* @__PURE__ */ a("svg", {
|
|
67
67
|
viewBox: "0 0 10 8",
|
|
68
68
|
width: "10",
|
|
69
69
|
height: "8",
|
|
@@ -72,7 +72,7 @@ const z = (param)=>{
|
|
|
72
72
|
}),
|
|
73
73
|
children: /* @__PURE__ */ a("path", {
|
|
74
74
|
d: "M2.659 7.724c.33.366.92.368 1.254.005L9.79 1.336A.782.782 0 009.719.202a.858.858 0 00-1.178.069l-5.236 5.72-1.841-2.038a.857.857 0 00-1.177-.078.782.782 0 00-.082 1.133l2.454 2.716z",
|
|
75
|
-
fill:
|
|
75
|
+
fill: k.colors.inverse
|
|
76
76
|
})
|
|
77
77
|
}) : /* @__PURE__ */ a("svg", {
|
|
78
78
|
viewBox: "0 0 14 10",
|
|
@@ -83,17 +83,17 @@ const z = (param)=>{
|
|
|
83
83
|
}),
|
|
84
84
|
children: /* @__PURE__ */ a("path", {
|
|
85
85
|
d: "M5 10L0 5.192l1.4-1.346L5 7.308 12.6 0 14 1.346z",
|
|
86
|
-
fill:
|
|
86
|
+
fill: k.colors.inverse
|
|
87
87
|
})
|
|
88
88
|
});
|
|
89
89
|
return /* @__PURE__ */ a("div", {
|
|
90
90
|
className: n(j[e ? "checked" : l ? "ios" : "rest"], {
|
|
91
|
-
[
|
|
91
|
+
[v]: o
|
|
92
92
|
}),
|
|
93
|
-
children:
|
|
93
|
+
children: r
|
|
94
94
|
});
|
|
95
95
|
}, B = (e)=>{
|
|
96
|
-
const o =
|
|
96
|
+
const o = N(e["aria-labelledby"]), l = e["aria-label"], r = l || e["aria-labelledby"], { defaultValue: x , value: t , onChange: s , focusableRef: C , disabled: i } = D({
|
|
97
97
|
name: e.name,
|
|
98
98
|
value: e.checked,
|
|
99
99
|
defaultValue: e.defaultChecked,
|
|
@@ -101,8 +101,8 @@ const z = (param)=>{
|
|
|
101
101
|
disabled: e.disabled
|
|
102
102
|
}), [d, g] = I.useState(!!x), h = ()=>{
|
|
103
103
|
t === void 0 ? (g(!d), s(!d)) : s(!t);
|
|
104
|
-
}, y = (
|
|
105
|
-
|
|
104
|
+
}, y = (c)=>{
|
|
105
|
+
c.keyCode === A && (c.preventDefault(), c.stopPropagation(), h());
|
|
106
106
|
}, b = /* @__PURE__ */ a(z, {
|
|
107
107
|
disabled: i,
|
|
108
108
|
isChecked: t !== null && t !== void 0 ? t : d
|
|
@@ -114,10 +114,12 @@ const z = (param)=>{
|
|
|
114
114
|
role: "checkbox",
|
|
115
115
|
"aria-checked": t !== null && t !== void 0 ? t : d,
|
|
116
116
|
onKeyDown: i ? void 0 : y,
|
|
117
|
-
onClick:
|
|
117
|
+
onClick: (c)=>{
|
|
118
|
+
c.stopPropagation(), i || h();
|
|
119
|
+
},
|
|
118
120
|
tabIndex: i ? void 0 : 0,
|
|
119
121
|
ref: C,
|
|
120
|
-
className: E,
|
|
122
|
+
className: i ? E : V,
|
|
121
123
|
"aria-label": l,
|
|
122
124
|
"aria-labelledby": l ? void 0 : o,
|
|
123
125
|
"aria-disabled": i
|
|
@@ -127,9 +129,8 @@ const z = (param)=>{
|
|
|
127
129
|
labelId: o,
|
|
128
130
|
checked: t !== null && t !== void 0 ? t : d,
|
|
129
131
|
disabled: !!i
|
|
130
|
-
}) : /* @__PURE__ */ w(
|
|
132
|
+
}) : /* @__PURE__ */ w(L, {
|
|
131
133
|
space: 16,
|
|
132
|
-
className: i ? V : "",
|
|
133
134
|
children: [
|
|
134
135
|
/* @__PURE__ */ a(m, {
|
|
135
136
|
regular: !0,
|
|
@@ -146,9 +147,9 @@ const z = (param)=>{
|
|
|
146
147
|
regular: !0,
|
|
147
148
|
as: "div",
|
|
148
149
|
id: o,
|
|
149
|
-
role:
|
|
150
|
+
role: r ? "presentation" : void 0,
|
|
150
151
|
children: /* @__PURE__ */ a("span", {
|
|
151
|
-
className: i ?
|
|
152
|
+
className: i ? v : "",
|
|
152
153
|
children: e.children
|
|
153
154
|
})
|
|
154
155
|
})
|
|
@@ -79,11 +79,11 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
79
79
|
}
|
|
80
80
|
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
81
81
|
import * as l from "react";
|
|
82
|
-
import { useForm as
|
|
82
|
+
import { useForm as M, useFieldProps as j } from "./form-context.js";
|
|
83
83
|
import { useTheme as D } from "./hooks.js";
|
|
84
84
|
import { getCreditCardNumberLength as T, isAmericanExpress as I, isVisa as x, isMasterCard as A, isValidCreditCardNumber as L } from "./utils/credit-card.js";
|
|
85
85
|
import { TextFieldBaseAutosuggest as O } from "./text-field-base.js";
|
|
86
|
-
import V from "./icons/icon-
|
|
86
|
+
import V from "./generated/mistica-icons/icon-credit-card-visa-regular.js";
|
|
87
87
|
import U from "./icons/icon-visa.js";
|
|
88
88
|
import _ from "./icons/icon-mastercard.js";
|
|
89
89
|
import z from "./icons/icon-amex.js";
|
|
@@ -91,12 +91,13 @@ import { useRifm as P } from "rifm";
|
|
|
91
91
|
import { createChangeEvent as $ } from "./utils/dom.js";
|
|
92
92
|
import { combineRefs as q } from "./utils/common.js";
|
|
93
93
|
import { flip as G, variants as H, flipFront as J, flipBack as K } from "./credit-card-number-field.css-mistica.js";
|
|
94
|
-
|
|
94
|
+
import { vars as Q } from "./skins/skin-contract.css-mistica.js";
|
|
95
|
+
const W = (r)=>{
|
|
95
96
|
var t;
|
|
96
97
|
const i = String(r !== null && r !== void 0 ? r : "").replace(/[^\d]/g, "");
|
|
97
98
|
var _ref;
|
|
98
99
|
return (_ref = (t = i.match(/.{1,4}/g)) == null ? void 0 : t.join(" ")) !== null && _ref !== void 0 ? _ref : i;
|
|
99
|
-
},
|
|
100
|
+
}, X = (_param)=>{
|
|
100
101
|
var { inputRef: r , value: i , defaultValue: t , onChange: e } = _param, a = _object_without_properties(_param, [
|
|
101
102
|
"inputRef",
|
|
102
103
|
"value",
|
|
@@ -109,7 +110,7 @@ const Q = (r)=>{
|
|
|
109
110
|
f,
|
|
110
111
|
e
|
|
111
112
|
]), d = P({
|
|
112
|
-
format:
|
|
113
|
+
format: W,
|
|
113
114
|
value: u,
|
|
114
115
|
onChange: p,
|
|
115
116
|
accept: /[\d]+/g
|
|
@@ -122,14 +123,14 @@ const Q = (r)=>{
|
|
|
122
123
|
value: d.value,
|
|
123
124
|
ref: q(r, m)
|
|
124
125
|
}));
|
|
125
|
-
},
|
|
126
|
+
}, Y = (r)=>x(r) ? /* @__PURE__ */ o(U, {}) : A(r) ? /* @__PURE__ */ o(_, {}) : I(r) ? /* @__PURE__ */ o(z, {}) : null, Z = {
|
|
126
127
|
showBackface: !1,
|
|
127
128
|
animationTarget: /* @__PURE__ */ o(V, {}),
|
|
128
129
|
isAnimating: !1
|
|
129
|
-
},
|
|
130
|
+
}, v = (r, param)=>{
|
|
130
131
|
let { type: i , value: t } = param;
|
|
131
132
|
if (i === "INPUT") {
|
|
132
|
-
const e =
|
|
133
|
+
const e = Y(t);
|
|
133
134
|
if (e && !r.showBackface) return {
|
|
134
135
|
animationTarget: e,
|
|
135
136
|
showBackface: !0,
|
|
@@ -147,9 +148,9 @@ const Q = (r)=>{
|
|
|
147
148
|
return i === "TRANSITION_END" ? _object_spread_props(_object_spread({}, r), {
|
|
148
149
|
isAnimating: !1
|
|
149
150
|
}) : r;
|
|
150
|
-
},
|
|
151
|
+
}, rr = (param)=>{
|
|
151
152
|
let { value: r } = param;
|
|
152
|
-
const [{ showBackface: i , animationTarget: t , isAnimating: e }, a] = l.useReducer(
|
|
153
|
+
const [{ showBackface: i , animationTarget: t , isAnimating: e }, a] = l.useReducer(v, Z);
|
|
153
154
|
return l.useEffect(()=>{
|
|
154
155
|
a({
|
|
155
156
|
type: "INPUT",
|
|
@@ -167,7 +168,9 @@ const Q = (r)=>{
|
|
|
167
168
|
children: [
|
|
168
169
|
/* @__PURE__ */ o("div", {
|
|
169
170
|
className: J,
|
|
170
|
-
children: /* @__PURE__ */ o(V, {
|
|
171
|
+
children: /* @__PURE__ */ o(V, {
|
|
172
|
+
color: Q.colors.neutralMedium
|
|
173
|
+
})
|
|
171
174
|
}),
|
|
172
175
|
/* @__PURE__ */ o("div", {
|
|
173
176
|
className: K,
|
|
@@ -176,7 +179,7 @@ const Q = (r)=>{
|
|
|
176
179
|
]
|
|
177
180
|
})
|
|
178
181
|
});
|
|
179
|
-
},
|
|
182
|
+
}, er = (_param)=>{
|
|
180
183
|
var { disabled: r , error: i , helperText: t , name: e , optional: a , validate: c , onChange: N , onChangeValue: m , onBlur: f , acceptedCards: u = {
|
|
181
184
|
americanExpress: !0,
|
|
182
185
|
visa: !0,
|
|
@@ -196,10 +199,10 @@ const Q = (r)=>{
|
|
|
196
199
|
"autoComplete",
|
|
197
200
|
"defaultValue"
|
|
198
201
|
]);
|
|
199
|
-
const { texts: E } = D(), { jumpToNext:
|
|
202
|
+
const { texts: E } = D(), { jumpToNext: R , rawValues: F , setFormError: S } = M(), h = (n, C)=>{
|
|
200
203
|
const s = E.formCreditCardNumberError;
|
|
201
204
|
return n ? I(n) && !u.americanExpress || x(n) && !u.visa || A(n) && !u.masterCard || !L(n) || T(n) !== n.length ? s : c == null ? void 0 : c(n, C) : a ? "" : E.formFieldErrorIsMandatory;
|
|
202
|
-
}, b = (n)=>n.replace(/\s/g, ""), k =
|
|
205
|
+
}, b = (n)=>n.replace(/\s/g, ""), k = j({
|
|
203
206
|
name: e,
|
|
204
207
|
value: p,
|
|
205
208
|
defaultValue: g,
|
|
@@ -223,14 +226,14 @@ const Q = (r)=>{
|
|
|
223
226
|
B ? S({
|
|
224
227
|
name: e,
|
|
225
228
|
error: B
|
|
226
|
-
}) :
|
|
229
|
+
}) : R(e);
|
|
227
230
|
}
|
|
228
231
|
},
|
|
229
|
-
inputComponent:
|
|
232
|
+
inputComponent: X,
|
|
230
233
|
autoComplete: d,
|
|
231
|
-
endIcon: /* @__PURE__ */ o(
|
|
232
|
-
value: (_ref = p !== null && p !== void 0 ? p :
|
|
234
|
+
endIcon: /* @__PURE__ */ o(rr, {
|
|
235
|
+
value: (_ref = p !== null && p !== void 0 ? p : F[e]) !== null && _ref !== void 0 ? _ref : ""
|
|
233
236
|
})
|
|
234
237
|
}));
|
|
235
|
-
},
|
|
236
|
-
export {
|
|
238
|
+
}, hr = er;
|
|
239
|
+
export { hr as default };
|
package/dist-es/cvv-field.js
CHANGED
|
@@ -77,56 +77,68 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
import { jsx as r,
|
|
81
|
-
import { useTheme as
|
|
82
|
-
import
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import { useForm as
|
|
88
|
-
import { TextFieldBaseAutosuggest as
|
|
89
|
-
import { IntegerInput as
|
|
90
|
-
import
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
80
|
+
import { jsx as r, Fragment as A, jsxs as c } from "react/jsx-runtime";
|
|
81
|
+
import { useTheme as h } from "./hooks.js";
|
|
82
|
+
import w from "./icons/icon-cvv-visa-mc.js";
|
|
83
|
+
import b from "./icons/icon-cvv-amex.js";
|
|
84
|
+
import k from "./tooltip.js";
|
|
85
|
+
import D from "./icon-button.js";
|
|
86
|
+
import N from "./generated/mistica-icons/icon-information-regular.js";
|
|
87
|
+
import { useForm as R, useFieldProps as S } from "./form-context.js";
|
|
88
|
+
import { TextFieldBaseAutosuggest as $ } from "./text-field-base.js";
|
|
89
|
+
import { IntegerInput as q } from "./integer-field.js";
|
|
90
|
+
import C from "./inline.js";
|
|
91
|
+
import G from "./stack.js";
|
|
92
|
+
import H from "./box.js";
|
|
93
|
+
import J from "./divider.js";
|
|
94
|
+
import g from "./text.js";
|
|
95
|
+
import { vars as K } from "./skins/skin-contract.css-mistica.js";
|
|
96
|
+
const O = (param)=>{
|
|
97
|
+
let { acceptedCards: t } = param;
|
|
98
|
+
const { texts: e } = h();
|
|
99
|
+
return /* @__PURE__ */ r(A, {
|
|
100
|
+
children: /* @__PURE__ */ r(H, {
|
|
101
|
+
padding: 8,
|
|
102
|
+
children: /* @__PURE__ */ c(G, {
|
|
103
|
+
space: 8,
|
|
98
104
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ r(w, {
|
|
113
|
-
size: 48,
|
|
114
|
-
role: "img"
|
|
105
|
+
/* @__PURE__ */ c(C, {
|
|
106
|
+
space: 16,
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ r(w, {
|
|
110
|
+
size: 48,
|
|
111
|
+
role: "img"
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ r(g, {
|
|
114
|
+
children: e.formCreditCardCvvTooltipVisaMc
|
|
115
|
+
})
|
|
116
|
+
]
|
|
115
117
|
}),
|
|
116
|
-
/* @__PURE__ */ r(
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
/* @__PURE__ */ r(J, {}),
|
|
119
|
+
(t == null ? void 0 : t.americanExpress) && /* @__PURE__ */ c(C, {
|
|
120
|
+
space: 16,
|
|
121
|
+
alignItems: "center",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ r(b, {
|
|
124
|
+
size: 48,
|
|
125
|
+
role: "img"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ r(g, {
|
|
128
|
+
children: e.formCreditCardCvvTooltipAmex
|
|
129
|
+
})
|
|
130
|
+
]
|
|
119
131
|
})
|
|
120
132
|
]
|
|
121
133
|
})
|
|
122
|
-
|
|
134
|
+
})
|
|
123
135
|
});
|
|
124
|
-
},
|
|
125
|
-
var { disabled:
|
|
136
|
+
}, Q = (_param)=>{
|
|
137
|
+
var { disabled: t , error: e , helperText: I , name: n , optional: f , validate: s , onChange: x , onChangeValue: T , onBlur: F , acceptedCards: y = {
|
|
126
138
|
americanExpress: !0,
|
|
127
139
|
visa: !0,
|
|
128
140
|
masterCard: !0
|
|
129
|
-
} , maxLength: m = 4 , value: E , autoComplete:
|
|
141
|
+
} , maxLength: m = 4 , value: E , autoComplete: M = "cc-csc" , defaultValue: V } = _param, j = _object_without_properties(_param, [
|
|
130
142
|
"disabled",
|
|
131
143
|
"error",
|
|
132
144
|
"helperText",
|
|
@@ -142,36 +154,36 @@ const J = (param)=>{
|
|
|
142
154
|
"autoComplete",
|
|
143
155
|
"defaultValue"
|
|
144
156
|
]);
|
|
145
|
-
const { texts: l } =
|
|
146
|
-
name:
|
|
157
|
+
const { texts: l } = h(), { setFormError: z , jumpToNext: B } = R(), p = (o, i)=>o ? o.length !== m ? l.formCreditCardCvvError : s == null ? void 0 : s(o, i) : f ? "" : l.formFieldErrorIsMandatory, a = (o)=>o, u = S({
|
|
158
|
+
name: n,
|
|
147
159
|
value: E,
|
|
148
160
|
defaultValue: V,
|
|
149
161
|
processValue: a,
|
|
150
|
-
helperText:
|
|
162
|
+
helperText: I,
|
|
151
163
|
optional: f,
|
|
152
164
|
error: e,
|
|
153
|
-
disabled:
|
|
165
|
+
disabled: t,
|
|
154
166
|
onBlur: F,
|
|
155
167
|
validate: p,
|
|
156
|
-
onChange:
|
|
168
|
+
onChange: x,
|
|
157
169
|
onChangeValue: T
|
|
158
170
|
});
|
|
159
|
-
return /* @__PURE__ */ r(
|
|
171
|
+
return /* @__PURE__ */ r($, _object_spread_props(_object_spread({}, j, u), {
|
|
160
172
|
maxLength: m,
|
|
161
|
-
onChange: (
|
|
162
|
-
u.onChange(
|
|
163
|
-
const i =
|
|
173
|
+
onChange: (o)=>{
|
|
174
|
+
u.onChange(o);
|
|
175
|
+
const i = o.currentTarget.value, d = a(i);
|
|
164
176
|
if (d.length === m) {
|
|
165
177
|
const v = p(d, i);
|
|
166
178
|
v ? z({
|
|
167
|
-
name:
|
|
179
|
+
name: n,
|
|
168
180
|
error: v
|
|
169
|
-
}) :
|
|
181
|
+
}) : B(n);
|
|
170
182
|
}
|
|
171
183
|
},
|
|
172
|
-
endIcon: /* @__PURE__ */ r(
|
|
184
|
+
endIcon: /* @__PURE__ */ r(k, {
|
|
173
185
|
position: "top",
|
|
174
|
-
children: /* @__PURE__ */ r(
|
|
186
|
+
children: /* @__PURE__ */ r(O, {
|
|
175
187
|
acceptedCards: y
|
|
176
188
|
}),
|
|
177
189
|
targetLabel: l.formCreditCardCvvTooltipVisaMcButton,
|
|
@@ -180,7 +192,7 @@ const J = (param)=>{
|
|
|
180
192
|
width: 16,
|
|
181
193
|
height: 16
|
|
182
194
|
},
|
|
183
|
-
children: /* @__PURE__ */ r(
|
|
195
|
+
children: /* @__PURE__ */ r(D, {
|
|
184
196
|
size: 40,
|
|
185
197
|
style: {
|
|
186
198
|
display: "flex",
|
|
@@ -191,14 +203,15 @@ const J = (param)=>{
|
|
|
191
203
|
// (40 - 16) / 2
|
|
192
204
|
top: -12
|
|
193
205
|
},
|
|
194
|
-
children: /* @__PURE__ */ r(
|
|
195
|
-
size:
|
|
206
|
+
children: /* @__PURE__ */ r(N, {
|
|
207
|
+
size: 16,
|
|
208
|
+
color: K.colors.neutralMedium
|
|
196
209
|
})
|
|
197
210
|
})
|
|
198
211
|
})
|
|
199
212
|
}),
|
|
200
|
-
autoComplete:
|
|
201
|
-
inputComponent:
|
|
213
|
+
autoComplete: M,
|
|
214
|
+
inputComponent: q
|
|
202
215
|
}));
|
|
203
|
-
},
|
|
204
|
-
export {
|
|
216
|
+
}, lr = Q;
|
|
217
|
+
export { lr as default };
|
|
@@ -77,65 +77,84 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
import { jsxs as
|
|
80
|
+
import { jsxs as P, Fragment as R, jsx as r } from "react/jsx-runtime";
|
|
81
81
|
import * as d from "react";
|
|
82
82
|
import { TextFieldBaseAutosuggest as H } from "./text-field-base.js";
|
|
83
83
|
import S from "./generated/mistica-icons/icon-calendar-regular.js";
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import { DEFAULT_WIDTH as
|
|
87
|
-
import
|
|
88
|
-
import { cancelEvent as
|
|
89
|
-
import { useTheme as
|
|
84
|
+
import F from "react-datetime";
|
|
85
|
+
import I from "./overlay.js";
|
|
86
|
+
import { DEFAULT_WIDTH as L } from "./text-field-components.css-mistica.js";
|
|
87
|
+
import g from "./icon-button.js";
|
|
88
|
+
import { cancelEvent as T, createChangeEvent as B } from "./utils/dom.js";
|
|
89
|
+
import { useTheme as E, useElementDimensions as V } from "./hooks.js";
|
|
90
90
|
import Y from "./generated/mistica-icons/icon-close-regular.js";
|
|
91
91
|
import { reactDatePicker as j } from "./date-time-picker.css-mistica.js";
|
|
92
92
|
import { vars as z } from "./skins/skin-contract.css-mistica.js";
|
|
93
|
-
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
import "moment/locale/es";
|
|
94
|
+
import "moment/locale/de";
|
|
95
|
+
import "moment/locale/pt-br";
|
|
96
|
+
import "moment/locale/en-gb";
|
|
97
|
+
const A = {
|
|
98
|
+
es: "es",
|
|
99
|
+
// spanish
|
|
100
|
+
ca: "es",
|
|
101
|
+
// catalan
|
|
102
|
+
eu: "es",
|
|
103
|
+
// euskera
|
|
104
|
+
gl: "es",
|
|
105
|
+
// gallego
|
|
106
|
+
de: "de",
|
|
107
|
+
// german
|
|
108
|
+
pt: "pt-br",
|
|
109
|
+
// portuguese
|
|
110
|
+
en: "en-gb"
|
|
111
|
+
}, O = (a)=>{
|
|
112
|
+
const i = a.toLocaleLowerCase().split("-")[0];
|
|
113
|
+
return A[i] || "en-gb";
|
|
114
|
+
}, ie = (_param)=>{
|
|
115
|
+
var { withTime: a , mode: i , isValidDate: h , optional: u } = _param, t = _object_without_properties(_param, [
|
|
97
116
|
"withTime",
|
|
98
117
|
"mode",
|
|
99
118
|
"isValidDate",
|
|
100
119
|
"optional"
|
|
101
120
|
]);
|
|
102
|
-
const [m,
|
|
103
|
-
t.disabled ||
|
|
104
|
-
},
|
|
105
|
-
var
|
|
106
|
-
const { top: e = 0 , bottom: o = 0 , left:
|
|
121
|
+
const [m, y] = d.useState(!1), { texts: x , i18n: { locale: b } } = E(), n = d.useRef(null), { height: k , ref: v } = V(), l = (e)=>{
|
|
122
|
+
t.disabled || y(e);
|
|
123
|
+
}, C = ()=>{
|
|
124
|
+
var f;
|
|
125
|
+
const { top: e = 0 , bottom: o = 0 , left: c = 0 } = ((f = n.current) == null ? void 0 : f.getBoundingClientRect()) || {}, M = 260 + o < window.innerHeight;
|
|
107
126
|
return {
|
|
108
|
-
width:
|
|
109
|
-
top:
|
|
110
|
-
left:
|
|
127
|
+
width: L,
|
|
128
|
+
top: M ? o : e - k,
|
|
129
|
+
left: c,
|
|
111
130
|
position: "absolute",
|
|
112
131
|
borderRadius: z.borderRadii.input,
|
|
113
132
|
overflow: "hidden",
|
|
114
133
|
boxShadow: "0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)"
|
|
115
134
|
};
|
|
116
|
-
},
|
|
135
|
+
}, s = ()=>{
|
|
117
136
|
var o;
|
|
118
137
|
const e = (o = n.current) == null ? void 0 : o.value;
|
|
119
138
|
return e ? new Date(e) : void 0;
|
|
120
|
-
},
|
|
121
|
-
var
|
|
122
|
-
const o = typeof e == "string" ? e :
|
|
123
|
-
n.current && (n.current.focus(), (
|
|
124
|
-
},
|
|
125
|
-
"aria-label":
|
|
139
|
+
}, D = (e)=>a ? e.format("yyyy-MM-DD HH:mm") : i === "year-month" ? e.format("yyyy-MM") : e.format("yyyy-MM-DD"), p = (e)=>{
|
|
140
|
+
var c;
|
|
141
|
+
const o = typeof e == "string" ? e : D(e);
|
|
142
|
+
n.current && (n.current.focus(), (c = t.onChange) == null || c.call(t, B(n.current, o)));
|
|
143
|
+
}, w = ()=>s() && u ? /* @__PURE__ */ r(g, {
|
|
144
|
+
"aria-label": x.clearButton,
|
|
126
145
|
size: 32,
|
|
127
146
|
onPress: ()=>{
|
|
128
|
-
|
|
147
|
+
p("");
|
|
129
148
|
},
|
|
130
149
|
children: /* @__PURE__ */ r(Y, {})
|
|
131
|
-
}) : /* @__PURE__ */ r(
|
|
150
|
+
}) : /* @__PURE__ */ r(g, {
|
|
132
151
|
disabled: t.disabled,
|
|
133
152
|
"aria-label": "",
|
|
134
153
|
size: 32,
|
|
135
|
-
onPress: ()=>
|
|
154
|
+
onPress: ()=>l(!m),
|
|
136
155
|
children: /* @__PURE__ */ r(S, {})
|
|
137
156
|
});
|
|
138
|
-
return /* @__PURE__ */ R
|
|
157
|
+
return /* @__PURE__ */ P(R, {
|
|
139
158
|
children: [
|
|
140
159
|
/* @__PURE__ */ r(H, _object_spread_props(_object_spread({}, t), {
|
|
141
160
|
style: {
|
|
@@ -144,40 +163,40 @@ const Z = (_param)=>{
|
|
|
144
163
|
required: !u,
|
|
145
164
|
type: "text",
|
|
146
165
|
autoComplete: "off",
|
|
147
|
-
shrinkLabel: !!
|
|
148
|
-
endIcon:
|
|
166
|
+
shrinkLabel: !!s(),
|
|
167
|
+
endIcon: w(),
|
|
149
168
|
inputRef: (e)=>{
|
|
150
169
|
var o;
|
|
151
170
|
(o = t == null ? void 0 : t.inputRef) == null || o.call(t, e), n.current = e;
|
|
152
171
|
},
|
|
153
172
|
readOnly: !0,
|
|
154
|
-
onKeyDown: ()=>
|
|
173
|
+
onKeyDown: ()=>l(!0),
|
|
155
174
|
onClick: ()=>{
|
|
156
|
-
|
|
175
|
+
l(!0);
|
|
157
176
|
}
|
|
158
177
|
})),
|
|
159
|
-
m && /* @__PURE__ */ r(
|
|
178
|
+
m && /* @__PURE__ */ r(I, {
|
|
160
179
|
onPress: (e)=>{
|
|
161
|
-
|
|
180
|
+
T(e), l(!1);
|
|
162
181
|
},
|
|
163
182
|
disableScroll: !0,
|
|
164
183
|
children: /* @__PURE__ */ r("div", {
|
|
165
|
-
ref:
|
|
166
|
-
style:
|
|
184
|
+
ref: v,
|
|
185
|
+
style: C(),
|
|
167
186
|
className: j,
|
|
168
|
-
children: /* @__PURE__ */ r(
|
|
169
|
-
initialViewMode:
|
|
170
|
-
dateFormat:
|
|
171
|
-
timeFormat:
|
|
172
|
-
initialValue:
|
|
173
|
-
locale:
|
|
187
|
+
children: /* @__PURE__ */ r(F, {
|
|
188
|
+
initialViewMode: i === "year-month" ? "months" : void 0,
|
|
189
|
+
dateFormat: i === "year-month" ? "YYYY-MM" : void 0,
|
|
190
|
+
timeFormat: a ? "HH:mm" : !1,
|
|
191
|
+
initialValue: s(),
|
|
192
|
+
locale: O(b),
|
|
174
193
|
input: !1,
|
|
175
|
-
onChange:
|
|
176
|
-
isValidDate:
|
|
194
|
+
onChange: p,
|
|
195
|
+
isValidDate: h
|
|
177
196
|
})
|
|
178
197
|
})
|
|
179
198
|
})
|
|
180
199
|
]
|
|
181
200
|
});
|
|
182
201
|
};
|
|
183
|
-
export {
|
|
202
|
+
export { ie as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as h, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { vars as a } from "../skins/skin-contract.css-mistica.js";
|
|
2
3
|
const l = (param)=>/* @__PURE__ */ {
|
|
3
|
-
let { role: t = "presentation" , size: c = 48 } = param;
|
|
4
|
+
let { role: t = "presentation" , size: c = 48 , color: r } = param;
|
|
4
5
|
return h("svg", {
|
|
5
6
|
width: c,
|
|
6
7
|
height: c,
|
|
@@ -10,7 +11,7 @@ const l = (param)=>/* @__PURE__ */ {
|
|
|
10
11
|
flexShrink: 0
|
|
11
12
|
},
|
|
12
13
|
children: /* @__PURE__ */ v("g", {
|
|
13
|
-
fill:
|
|
14
|
+
fill: r || a.colors.brand,
|
|
14
15
|
children: [
|
|
15
16
|
/* @__PURE__ */ h("path", {
|
|
16
17
|
d: "M2.571 0H45.43C46.849 0 48 1.075 48 2.4v27.2c0 1.325-1.151 2.4-2.571 2.4H2.57C1.151 32 0 30.925 0 29.6V2.4C0 1.075 1.151 0 2.571 0zm0 1.2c-.71 0-1.285.537-1.285 1.2v27.2c0 .663.575 1.2 1.285 1.2H45.43c.71 0 1.285-.537 1.285-1.2V2.4c0-.663-.575-1.2-1.285-1.2H2.57z",
|
|
@@ -27,5 +28,5 @@ const l = (param)=>/* @__PURE__ */ {
|
|
|
27
28
|
]
|
|
28
29
|
})
|
|
29
30
|
});
|
|
30
|
-
},
|
|
31
|
-
export {
|
|
31
|
+
}, s = l;
|
|
32
|
+
export { s as default };
|