@telefonica/mistica 16.0.0 → 16.1.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/README.md +11 -9
- package/css/mistica.css +1 -1
- package/dist/box.d.ts +1 -0
- package/dist/box.js +12 -12
- package/dist/card.d.ts +14 -2
- package/dist/card.js +210 -206
- package/dist/credit-card-expiration-field.d.ts +1 -1
- package/dist/credit-card-expiration-field.js +53 -52
- package/dist/credit-card-number-field.d.ts +1 -1
- package/dist/credit-card-number-field.js +47 -45
- package/dist/cvv-field.d.ts +1 -1
- package/dist/cvv-field.js +38 -37
- package/dist/date-field.d.ts +1 -1
- package/dist/date-field.js +15 -13
- package/dist/date-time-field.d.ts +1 -1
- package/dist/date-time-field.js +13 -11
- package/dist/decimal-field.d.ts +1 -1
- package/dist/decimal-field.js +39 -38
- package/dist/email-field.d.ts +1 -1
- package/dist/email-field.js +21 -19
- package/dist/form-context.d.ts +7 -2
- package/dist/form-context.js +69 -62
- package/dist/form.d.ts +2 -1
- package/dist/form.js +94 -80
- package/dist/iban-field.d.ts +1 -1
- package/dist/iban-field.js +32 -30
- package/dist/index.d.ts +12 -3
- package/dist/index.js +19 -8
- package/dist/inline.d.ts +2 -1
- package/dist/inline.js +16 -15
- package/dist/integer-field.d.ts +1 -1
- package/dist/integer-field.js +30 -30
- package/dist/month-field.d.ts +1 -1
- package/dist/month-field.js +15 -13
- package/dist/package-version.js +1 -1
- package/dist/password-field.d.ts +1 -1
- package/dist/password-field.js +24 -22
- package/dist/phone-number-field.d.ts +4 -1
- package/dist/phone-number-field.js +84 -52
- package/dist/pin-field.js +21 -20
- package/dist/radio-button.d.ts +1 -0
- package/dist/radio-button.js +42 -41
- package/dist/rating.css-mistica.js +44 -0
- package/dist/rating.css.d.ts +11 -0
- package/dist/rating.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/rating.d.ts +37 -0
- package/dist/rating.js +320 -0
- package/dist/search-field.d.ts +1 -0
- package/dist/search-field.js +18 -16
- package/dist/select.js +36 -33
- package/dist/sheet-action-row.css-mistica.js +13 -0
- package/dist/sheet-action-row.css.d.ts +1 -0
- package/dist/sheet-actions-list.d.ts +26 -0
- package/dist/sheet-actions-list.js +147 -0
- package/dist/sheet-actions.d.ts +23 -0
- package/dist/sheet-actions.js +175 -0
- package/dist/{sheet.css-mistica.js → sheet-common.css-mistica.js} +15 -21
- package/dist/{sheet.css.d.ts → sheet-common.css.d.ts} +0 -2
- package/dist/sheet-common.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/sheet-common.d.ts +24 -0
- package/dist/sheet-common.js +429 -0
- package/dist/sheet-info.css-mistica.js +12 -0
- package/dist/sheet-info.css.d.ts +1 -0
- package/dist/sheet-info.d.ts +28 -0
- package/dist/sheet-info.js +156 -0
- package/dist/sheet-native.d.ts +2 -0
- package/dist/sheet-native.js +173 -0
- package/dist/sheet-radio-list.d.ts +22 -0
- package/dist/sheet-radio-list.js +143 -0
- package/dist/sheet-root.d.ts +4 -85
- package/dist/sheet-root.js +48 -322
- package/dist/sheet-types.d.ts +88 -0
- package/dist/sheet-web.d.ts +8 -0
- package/dist/sheet-web.js +183 -0
- package/dist/slider.js +40 -39
- package/dist/switch-component.js +18 -17
- package/dist/text-field-base.d.ts +3 -1
- package/dist/text-field-base.js +74 -66
- package/dist/text-field-components.css-mistica.js +14 -14
- package/dist/text-field-components.css.d.ts +2 -2
- package/dist/text-field-components.js +49 -39
- package/dist/text-field.d.ts +1 -0
- package/dist/text-field.js +24 -22
- package/dist/text-tokens.d.ts +14 -0
- package/dist/text-tokens.js +145 -89
- package/dist/theme-context-provider.js +6 -5
- package/dist/theme.d.ts +2 -0
- package/dist/utils/credit-card.d.ts +2 -2
- package/dist/utils/credit-card.js +1 -1
- package/dist/vivinho-loading-animation/in-lottie.json.js +544 -612
- package/dist/vivinho-loading-animation/out-lottie.json.js +828 -896
- package/dist/vivinho-loading-animation/pulse-lottie.json.js +798 -866
- package/dist/vivinho-loading-animation/wave-lottie.json.js +4303 -4409
- package/dist-es/box.js +18 -18
- package/dist-es/card.js +305 -301
- package/dist-es/credit-card-expiration-field.js +57 -56
- package/dist-es/credit-card-number-field.js +74 -72
- package/dist-es/cvv-field.js +82 -81
- package/dist-es/date-field.js +29 -27
- package/dist-es/date-time-field.js +29 -27
- package/dist-es/decimal-field.js +46 -45
- package/dist-es/email-field.js +26 -24
- package/dist-es/form-context.js +70 -63
- package/dist-es/form.js +102 -88
- package/dist-es/iban-field.js +35 -33
- package/dist-es/index.js +1822 -1817
- package/dist-es/inline.js +26 -25
- package/dist-es/integer-field.js +31 -31
- package/dist-es/month-field.js +28 -26
- package/dist-es/package-version.js +1 -1
- package/dist-es/password-field.js +37 -35
- package/dist-es/phone-number-field.js +92 -60
- package/dist-es/pin-field.js +32 -31
- package/dist-es/radio-button.js +42 -41
- package/dist-es/rating.css-mistica.js +6 -0
- package/dist-es/rating.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/rating.js +257 -0
- package/dist-es/search-field.js +33 -31
- package/dist-es/select.js +49 -46
- package/dist-es/sheet-action-row.css-mistica.js +4 -0
- package/dist-es/sheet-actions-list.js +92 -0
- package/dist-es/sheet-actions.js +125 -0
- package/dist-es/sheet-common.css-mistica.js +4 -0
- package/dist-es/sheet-common.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/sheet-common.js +366 -0
- package/dist-es/sheet-info.css-mistica.js +3 -0
- package/dist-es/sheet-info.js +101 -0
- package/dist-es/sheet-native.js +164 -0
- package/dist-es/sheet-radio-list.js +88 -0
- package/dist-es/sheet-root.js +50 -319
- package/dist-es/sheet-web.js +128 -0
- package/dist-es/slider.js +49 -48
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.js +27 -26
- package/dist-es/text-field-base.js +108 -100
- package/dist-es/text-field-components.css-mistica.js +2 -2
- package/dist-es/text-field-components.js +70 -60
- package/dist-es/text-field.js +33 -31
- package/dist-es/text-tokens.js +80 -45
- package/dist-es/theme-context-provider.js +20 -19
- package/dist-es/utils/credit-card.js +1 -1
- package/dist-es/vivinho-loading-animation/in-lottie.json.js +534 -599
- package/dist-es/vivinho-loading-animation/out-lottie.json.js +821 -886
- package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +790 -855
- package/dist-es/vivinho-loading-animation/wave-lottie.json.js +4297 -4400
- package/package.json +4 -3
- package/dist/sheet.d.ts +0 -107
- package/dist/sheet.js +0 -642
- package/dist-es/sheet.css-mistica.js +0 -4
- package/dist-es/sheet.js +0 -567
- /package/dist/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
- /package/dist-es/{sheet.css.ts.vanilla.css-mistica.js → sheet-action-row.css.ts.vanilla.css-mistica.js} +0 -0
package/dist/form.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function() {
|
|
9
|
-
return
|
|
9
|
+
return oe;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -16,6 +16,7 @@ const _formcontext = require("./form-context.js");
|
|
|
16
16
|
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
17
17
|
const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
|
|
18
18
|
const _texttokens = require("./text-tokens.js");
|
|
19
|
+
const _screenreaderonly = /*#__PURE__*/ _interop_require_default(require("./screen-reader-only.js"));
|
|
19
20
|
function _interop_require_default(obj) {
|
|
20
21
|
return obj && obj.__esModule ? obj : {
|
|
21
22
|
default: obj
|
|
@@ -115,118 +116,131 @@ function _object_spread_props(target, source) {
|
|
|
115
116
|
return target;
|
|
116
117
|
}
|
|
117
118
|
process.env.NODE_ENV !== "test" && typeof document < "u" && !("scrollBehavior" in document.documentElement.style) && Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("scroll-behavior-polyfill"))).finally(()=>{});
|
|
118
|
-
const
|
|
119
|
-
let { children:
|
|
120
|
-
const f = _react.useRef(!0), [
|
|
119
|
+
const X = (param)=>{
|
|
120
|
+
let { children: S, className: j, onSubmit: g, initialValues: E = {}, autoJump: O = !1, onValidationErrors: a, getErrorMessageForScreenReader: v, id: M } = param;
|
|
121
|
+
const f = _react.useRef(!0), [u, w] = _react.useState(E), [c, V] = _react.useState(E), [P, m] = _react.useState("filling"), [d, F] = _react.useState({}), l = _react.useRef(/* @__PURE__ */ new Map()), p = _react.useRef(null), { texts: b, t: h } = (0, _hooks.useTheme)(), T = _react.useId(), I = M || T;
|
|
121
122
|
_react.useEffect(()=>(f.current = !0, ()=>{
|
|
122
123
|
f.current = !1;
|
|
123
124
|
}), []);
|
|
124
|
-
const
|
|
125
|
-
let { input:
|
|
126
|
-
|
|
127
|
-
input:
|
|
128
|
-
validator:
|
|
129
|
-
focusableElement:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
const A = _react.useCallback((e, param)=>{
|
|
126
|
+
let { input: t, validator: s, focusableElement: r, label: o } = param;
|
|
127
|
+
t || r ? l.current.set(e, {
|
|
128
|
+
input: t,
|
|
129
|
+
validator: s,
|
|
130
|
+
focusableElement: r,
|
|
131
|
+
label: o
|
|
132
|
+
}) : l.current.delete(e);
|
|
133
|
+
}, []), D = _react.useCallback((param)=>{
|
|
134
|
+
let { name: e, error: t } = param;
|
|
135
|
+
return F((s)=>_object_spread_props(_object_spread({}, s), {
|
|
136
|
+
[e]: t
|
|
135
137
|
}));
|
|
136
|
-
}, []),
|
|
137
|
-
var
|
|
138
|
+
}, []), y = _react.useCallback(()=>{
|
|
139
|
+
var s;
|
|
138
140
|
const e = {};
|
|
139
|
-
for (const [
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
141
|
+
for (const [r, { input: o, validator: i }] of l.current)if (o) {
|
|
142
|
+
if (o.disabled) continue;
|
|
143
|
+
if (o.required && !((s = c[r]) != null && s.trim())) e[r] = b.formFieldErrorIsMandatory || h(_texttokens.formFieldErrorIsMandatory);
|
|
142
144
|
else {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
+
const R = i == null ? void 0 : i(u[r], c[r]);
|
|
146
|
+
R && (e[r] = R);
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
return (
|
|
149
|
+
const t = Object.keys(e).map((r)=>{
|
|
150
|
+
const o = l.current.get(r);
|
|
151
|
+
return (o == null ? void 0 : o.focusableElement) || (o == null ? void 0 : o.input);
|
|
150
152
|
}).filter(Boolean);
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
+
if (t.length) {
|
|
154
|
+
t.sort((r, o)=>r.compareDocumentPosition(o) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), t[0].focus();
|
|
153
155
|
try {
|
|
154
|
-
|
|
156
|
+
t[0].scrollIntoView({
|
|
155
157
|
behavior: "smooth",
|
|
156
158
|
block: "center",
|
|
157
159
|
inline: "center"
|
|
158
160
|
});
|
|
159
161
|
} catch (e) {}
|
|
160
162
|
}
|
|
161
|
-
return
|
|
163
|
+
return F(e), a && Object.keys(e).length > 0 && a(e), e;
|
|
162
164
|
}, [
|
|
163
165
|
a,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
]),
|
|
166
|
+
c,
|
|
167
|
+
b,
|
|
168
|
+
u,
|
|
169
|
+
h
|
|
170
|
+
]), B = _react.useCallback((e)=>{
|
|
169
171
|
setTimeout(()=>{
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
|
|
172
|
+
var t;
|
|
173
|
+
if (O && p.current) {
|
|
174
|
+
const s = Array.from(p.current.querySelectorAll("input, select")), r = (t = l.current.get(e)) == null ? void 0 : t.input, o = s.indexOf(r);
|
|
175
|
+
if (o >= 0) {
|
|
176
|
+
const i = s[o + 1];
|
|
177
|
+
i ? i.focus() : r == null || r.blur();
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
}, 100);
|
|
179
181
|
}, [
|
|
180
|
-
|
|
181
|
-
]),
|
|
182
|
-
...
|
|
183
|
-
].reduce((
|
|
184
|
-
var
|
|
185
|
-
return (
|
|
186
|
-
[
|
|
182
|
+
O
|
|
183
|
+
]), x = (e)=>[
|
|
184
|
+
...l.current.keys()
|
|
185
|
+
].reduce((t, s)=>{
|
|
186
|
+
var r, o;
|
|
187
|
+
return (o = (r = l.current.get(s)) == null ? void 0 : r.input) != null && o.disabled ? t : _object_spread_props(_object_spread({}, t), {
|
|
188
|
+
[s]: e[s]
|
|
187
189
|
});
|
|
188
|
-
}, {}),
|
|
190
|
+
}, {}), C = _react.useCallback((e)=>(e == null || e.preventDefault(), m("sending"), Object.keys(y()).length > 0 ? (m("filling"), Promise.resolve()) : Promise.resolve(g(x(u), x(c))).finally(()=>{
|
|
189
191
|
f.current && m("filling");
|
|
190
192
|
})), [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
]),
|
|
196
|
-
let { name: e, value:
|
|
197
|
-
|
|
198
|
-
[e]:
|
|
193
|
+
g,
|
|
194
|
+
c,
|
|
195
|
+
y,
|
|
196
|
+
u
|
|
197
|
+
]), L = _react.useCallback((param)=>{
|
|
198
|
+
let { name: e, value: t } = param;
|
|
199
|
+
w((s)=>_object_spread_props(_object_spread({}, s), {
|
|
200
|
+
[e]: t
|
|
199
201
|
}));
|
|
200
|
-
}, []),
|
|
201
|
-
let { name: e, value:
|
|
202
|
-
|
|
203
|
-
[e]:
|
|
202
|
+
}, []), W = _react.useCallback((param)=>{
|
|
203
|
+
let { name: e, value: t } = param;
|
|
204
|
+
V((s)=>_object_spread_props(_object_spread({}, s), {
|
|
205
|
+
[e]: t
|
|
204
206
|
}));
|
|
205
|
-
}, [])
|
|
207
|
+
}, []), N = Object.entries(d).map((param)=>{
|
|
208
|
+
let [e, t] = param;
|
|
209
|
+
var s;
|
|
210
|
+
return t && ((s = l.current.get(e)) == null ? void 0 : s.label);
|
|
211
|
+
}).filter(Boolean), _ = N.length > 1;
|
|
206
212
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_formcontext.FormContext.Provider, {
|
|
207
213
|
value: {
|
|
208
|
-
formStatus:
|
|
209
|
-
values:
|
|
210
|
-
setValue:
|
|
211
|
-
rawValues:
|
|
212
|
-
setRawValue:
|
|
213
|
-
formErrors:
|
|
214
|
-
setFormError:
|
|
215
|
-
register:
|
|
216
|
-
jumpToNext:
|
|
217
|
-
validate:
|
|
218
|
-
submit:
|
|
219
|
-
formId:
|
|
214
|
+
formStatus: P,
|
|
215
|
+
values: u,
|
|
216
|
+
setValue: L,
|
|
217
|
+
rawValues: c,
|
|
218
|
+
setRawValue: W,
|
|
219
|
+
formErrors: d,
|
|
220
|
+
setFormError: D,
|
|
221
|
+
register: A,
|
|
222
|
+
jumpToNext: B,
|
|
223
|
+
validate: y,
|
|
224
|
+
submit: C,
|
|
225
|
+
formId: I
|
|
220
226
|
},
|
|
221
|
-
children: /* @__PURE__ */ (0, _jsxruntime.
|
|
222
|
-
id:
|
|
223
|
-
onSubmit:
|
|
224
|
-
ref:
|
|
227
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("form", {
|
|
228
|
+
id: I,
|
|
229
|
+
onSubmit: C,
|
|
230
|
+
ref: p,
|
|
225
231
|
className: (0, _classnames.default)((0, _sprinklescssmistica.sprinkles)({
|
|
226
232
|
width: "100%"
|
|
227
|
-
}),
|
|
233
|
+
}), j),
|
|
228
234
|
noValidate: !0,
|
|
229
|
-
children:
|
|
235
|
+
children: [
|
|
236
|
+
_ ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_screenreaderonly.default, {
|
|
237
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("span", {
|
|
238
|
+
role: "alert",
|
|
239
|
+
children: v ? v(d) : `${b.formErrorsAlertMessage || h(_texttokens.formErrorsAlertMessage)} ${N.join(", ")}`
|
|
240
|
+
})
|
|
241
|
+
}) : null,
|
|
242
|
+
S
|
|
243
|
+
]
|
|
230
244
|
})
|
|
231
245
|
});
|
|
232
|
-
},
|
|
246
|
+
}, oe = X;
|
package/dist/iban-field.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export interface IbanFieldProps extends CommonFormFieldProps {
|
|
|
5
5
|
prefix?: string;
|
|
6
6
|
getSuggestions?: (value: string) => Array<string>;
|
|
7
7
|
}
|
|
8
|
-
declare const IbanField: ({ disabled, error, helperText, name, optional, validate: customValidate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IbanFieldProps) => JSX.Element;
|
|
8
|
+
declare const IbanField: ({ disabled, error, helperText, name, label, optional, validate: customValidate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IbanFieldProps) => JSX.Element;
|
|
9
9
|
export default IbanField;
|
package/dist/iban-field.js
CHANGED
|
@@ -138,16 +138,16 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
138
138
|
}
|
|
139
139
|
return target;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const A = {
|
|
142
142
|
ES: 24,
|
|
143
143
|
GB: 22,
|
|
144
144
|
DE: 22,
|
|
145
145
|
BR: 29
|
|
146
|
-
},
|
|
146
|
+
}, R = 32, S = (t, e)=>{
|
|
147
147
|
let n = 0;
|
|
148
148
|
for(let r = 0; r < t.length; r++)n = (n * 10 + Number(t[r])) % e;
|
|
149
149
|
return n;
|
|
150
|
-
},
|
|
150
|
+
}, v = (t)=>/^[A-Z]{2}$/.test(t), T = (t)=>/^\d{2}$/.test(t), z = (t)=>{
|
|
151
151
|
let e = t.substr(4) + t.substr(0, 4);
|
|
152
152
|
const n = "A".charCodeAt(0);
|
|
153
153
|
return e = Array.from(e).map((r)=>{
|
|
@@ -156,12 +156,12 @@ const I = {
|
|
|
156
156
|
return String(10 + s - n);
|
|
157
157
|
}
|
|
158
158
|
return r;
|
|
159
|
-
}).join(""),
|
|
160
|
-
},
|
|
159
|
+
}).join(""), S(e, 97) === 1;
|
|
160
|
+
}, F = (t)=>{
|
|
161
161
|
const e = t.substr(0, 2), n = t.substr(2, 2);
|
|
162
|
-
if (!
|
|
163
|
-
const r =
|
|
164
|
-
return !(r && r !== t.length || !
|
|
162
|
+
if (!v(e) || !T(n)) return !1;
|
|
163
|
+
const r = A[e];
|
|
164
|
+
return !(r && r !== t.length || !z(t));
|
|
165
165
|
}, Z = (t)=>{
|
|
166
166
|
var n;
|
|
167
167
|
const e = t.replace(/[^\dA-Za-z]/g, "");
|
|
@@ -169,9 +169,9 @@ const I = {
|
|
|
169
169
|
return (_ref = (n = e.match(/.{1,4}/g)) == null ? void 0 : n.join(" ")) !== null && _ref !== void 0 ? _ref : e;
|
|
170
170
|
}, j = (t)=>{
|
|
171
171
|
const e = t.substr(0, 2);
|
|
172
|
-
let n =
|
|
173
|
-
if (e &&
|
|
174
|
-
const s =
|
|
172
|
+
let n = R;
|
|
173
|
+
if (e && v(e)) {
|
|
174
|
+
const s = A[e];
|
|
175
175
|
s && (n = s);
|
|
176
176
|
}
|
|
177
177
|
const r = Math.ceil(n / 4) - 1;
|
|
@@ -183,8 +183,8 @@ const I = {
|
|
|
183
183
|
"defaultValue",
|
|
184
184
|
"onChange"
|
|
185
185
|
]);
|
|
186
|
-
const [
|
|
187
|
-
i ||
|
|
186
|
+
const [m, u] = _react.useState(n !== null && n !== void 0 ? n : ""), c = _react.useRef(null), i = typeof e < "u", d = i ? e : m, g = _react.useCallback((o)=>{
|
|
187
|
+
i || u(o), c.current && (r == null || r((0, _dom.createChangeEvent)(c.current, o)));
|
|
188
188
|
}, [
|
|
189
189
|
i,
|
|
190
190
|
r
|
|
@@ -199,19 +199,20 @@ const I = {
|
|
|
199
199
|
maxLength: j(a.value),
|
|
200
200
|
value: a.value,
|
|
201
201
|
onChange: (o)=>{
|
|
202
|
-
var
|
|
203
|
-
const
|
|
204
|
-
return
|
|
202
|
+
var f;
|
|
203
|
+
const h = o.target.value, l = a.value;
|
|
204
|
+
return h.length - l.length > 1 && ((f = o.nativeEvent) == null ? void 0 : f.inputType) === "insertText" && (o.target.value = l), a.onChange(o);
|
|
205
205
|
},
|
|
206
206
|
type: "text",
|
|
207
207
|
ref: (0, _common.combineRefs)(t, c)
|
|
208
208
|
}));
|
|
209
|
-
},
|
|
210
|
-
var { disabled: t, error: e, helperText: n, name: r,
|
|
209
|
+
}, M = (_param)=>{
|
|
210
|
+
var { disabled: t, error: e, helperText: n, name: r, label: s, optional: m, validate: u, onChange: c, onChangeValue: i, onBlur: d, value: g, defaultValue: a, dataAttributes: o } = _param, h = _object_without_properties(_param, [
|
|
211
211
|
"disabled",
|
|
212
212
|
"error",
|
|
213
213
|
"helperText",
|
|
214
214
|
"name",
|
|
215
|
+
"label",
|
|
215
216
|
"optional",
|
|
216
217
|
"validate",
|
|
217
218
|
"onChange",
|
|
@@ -221,24 +222,25 @@ const I = {
|
|
|
221
222
|
"defaultValue",
|
|
222
223
|
"dataAttributes"
|
|
223
224
|
]);
|
|
224
|
-
const { texts:
|
|
225
|
+
const { texts: l, t: f } = (0, _hooks.useTheme)(), I = (0, _formcontext.useFieldProps)({
|
|
225
226
|
name: r,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
label: s,
|
|
228
|
+
value: g,
|
|
229
|
+
defaultValue: a,
|
|
230
|
+
processValue: (p)=>p.replace(/[^\dA-Za-z]/g, ""),
|
|
229
231
|
helperText: n,
|
|
230
|
-
optional:
|
|
232
|
+
optional: m,
|
|
231
233
|
error: e,
|
|
232
234
|
disabled: t,
|
|
233
|
-
onBlur:
|
|
234
|
-
validate: (
|
|
235
|
-
onChange:
|
|
236
|
-
onChangeValue:
|
|
235
|
+
onBlur: d,
|
|
236
|
+
validate: (p, y)=>F(p !== null && p !== void 0 ? p : "") ? u == null ? void 0 : u(p, y) : l.formIbanError || f(_texttokens.formIbanError),
|
|
237
|
+
onChange: c,
|
|
238
|
+
onChangeValue: i
|
|
237
239
|
});
|
|
238
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({},
|
|
240
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, h, I), {
|
|
239
241
|
inputComponent: D,
|
|
240
242
|
dataAttributes: _object_spread({
|
|
241
243
|
"component-name": "IbanField"
|
|
242
|
-
},
|
|
244
|
+
}, o)
|
|
243
245
|
}));
|
|
244
|
-
}, J =
|
|
246
|
+
}, J = M;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,9 +56,11 @@ export { default as HorizontalScroll } from './horizontal-scroll';
|
|
|
56
56
|
export { default as HighlightedCard } from './highlighted-card';
|
|
57
57
|
export { default as Stepper } from './stepper';
|
|
58
58
|
export { ProgressBar, ProgressBarStepped } from './progress-bar';
|
|
59
|
+
export { Rating, InfoRating } from './rating';
|
|
59
60
|
export { VerticalMosaic, HorizontalMosaic } from './mosaic';
|
|
60
61
|
export { Timer, TextTimer } from './timer';
|
|
61
62
|
export { MediaCard, DataCard, SnapCard, DisplayDataCard, DisplayMediaCard, PosterCard, NakedCard, SmallNakedCard, CardActionSpinner, CardActionIconButton, } from './card';
|
|
63
|
+
export { default as StackingGroup } from './stacking-group';
|
|
62
64
|
export { default as Hero } from './hero';
|
|
63
65
|
export { default as CoverHero } from './cover-hero';
|
|
64
66
|
export { Table } from './table';
|
|
@@ -78,10 +80,17 @@ export { default as Video } from './video';
|
|
|
78
80
|
export type { VideoElement } from './video';
|
|
79
81
|
export { Carousel, CenteredCarousel, Slideshow, PageBullets, CarouselContextProvider, useCarouselContext, CarouselContextConsumer, } from './carousel';
|
|
80
82
|
export { Grid, GridItem } from './grid';
|
|
81
|
-
export { default as Sheet, ActionsSheet, InfoSheet, ActionsListSheet, RadioListSheet, SheetBody, } from './sheet';
|
|
82
83
|
export { default as SheetRoot, showSheet } from './sheet-root';
|
|
83
|
-
export type { NativeSheetImplementation } from './sheet-
|
|
84
|
-
export { default as
|
|
84
|
+
export type { NativeSheetImplementation } from './sheet-types';
|
|
85
|
+
export { default as Sheet, SheetBody } from './sheet-common';
|
|
86
|
+
/** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
|
|
87
|
+
export { default as ActionsSheet } from './sheet-actions';
|
|
88
|
+
/** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
|
|
89
|
+
export { default as InfoSheet } from './sheet-info';
|
|
90
|
+
/** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
|
|
91
|
+
export { default as ActionsListSheet } from './sheet-actions-list';
|
|
92
|
+
/** @deprecated use showSheet. It is easier to use and uses the app native implementation if available */
|
|
93
|
+
export { default as RadioListSheet } from './sheet-radio-list';
|
|
85
94
|
export { default as Form } from './form';
|
|
86
95
|
export { default as Select } from './select';
|
|
87
96
|
export { default as TextField } from './text-field';
|
package/dist/index.js
CHANGED
|
@@ -16,10 +16,10 @@ _export(exports, {
|
|
|
16
16
|
return _accordion.AccordionItem;
|
|
17
17
|
},
|
|
18
18
|
ActionsListSheet: function() {
|
|
19
|
-
return
|
|
19
|
+
return _sheetactionslist.default;
|
|
20
20
|
},
|
|
21
21
|
ActionsSheet: function() {
|
|
22
|
-
return
|
|
22
|
+
return _sheetactions.default;
|
|
23
23
|
},
|
|
24
24
|
Avatar: function() {
|
|
25
25
|
return _avatar.default;
|
|
@@ -5487,8 +5487,11 @@ _export(exports, {
|
|
|
5487
5487
|
InfoFeedbackScreen: function() {
|
|
5488
5488
|
return _feedback.InfoFeedbackScreen;
|
|
5489
5489
|
},
|
|
5490
|
+
InfoRating: function() {
|
|
5491
|
+
return _rating.InfoRating;
|
|
5492
|
+
},
|
|
5490
5493
|
InfoSheet: function() {
|
|
5491
|
-
return
|
|
5494
|
+
return _sheetinfo.default;
|
|
5492
5495
|
},
|
|
5493
5496
|
Inline: function() {
|
|
5494
5497
|
return _inline.default;
|
|
@@ -5611,7 +5614,10 @@ _export(exports, {
|
|
|
5611
5614
|
return _radiobutton.RadioGroup;
|
|
5612
5615
|
},
|
|
5613
5616
|
RadioListSheet: function() {
|
|
5614
|
-
return
|
|
5617
|
+
return _sheetradiolist.default;
|
|
5618
|
+
},
|
|
5619
|
+
Rating: function() {
|
|
5620
|
+
return _rating.Rating;
|
|
5615
5621
|
},
|
|
5616
5622
|
ResponsiveLayout: function() {
|
|
5617
5623
|
return _responsivelayout.default;
|
|
@@ -5632,10 +5638,10 @@ _export(exports, {
|
|
|
5632
5638
|
return _select.default;
|
|
5633
5639
|
},
|
|
5634
5640
|
Sheet: function() {
|
|
5635
|
-
return
|
|
5641
|
+
return _sheetcommon.default;
|
|
5636
5642
|
},
|
|
5637
5643
|
SheetBody: function() {
|
|
5638
|
-
return
|
|
5644
|
+
return _sheetcommon.SheetBody;
|
|
5639
5645
|
},
|
|
5640
5646
|
SheetRoot: function() {
|
|
5641
5647
|
return _sheetroot.default;
|
|
@@ -6002,9 +6008,11 @@ const _horizontalscroll = /*#__PURE__*/ _interop_require_default(require("./hori
|
|
|
6002
6008
|
const _highlightedcard = /*#__PURE__*/ _interop_require_default(require("./highlighted-card.js"));
|
|
6003
6009
|
const _stepper = /*#__PURE__*/ _interop_require_default(require("./stepper.js"));
|
|
6004
6010
|
const _progressbar = require("./progress-bar.js");
|
|
6011
|
+
const _rating = require("./rating.js");
|
|
6005
6012
|
const _mosaic = require("./mosaic.js");
|
|
6006
6013
|
const _timer = require("./timer.js");
|
|
6007
6014
|
const _card = require("./card.js");
|
|
6015
|
+
const _stackinggroup = /*#__PURE__*/ _interop_require_default(require("./stacking-group.js"));
|
|
6008
6016
|
const _hero = /*#__PURE__*/ _interop_require_default(require("./hero.js"));
|
|
6009
6017
|
const _coverhero = /*#__PURE__*/ _interop_require_default(require("./cover-hero.js"));
|
|
6010
6018
|
const _table = require("./table.js");
|
|
@@ -6023,9 +6031,12 @@ const _chip = /*#__PURE__*/ _interop_require_default(require("./chip.js"));
|
|
|
6023
6031
|
const _video = /*#__PURE__*/ _interop_require_default(require("./video.js"));
|
|
6024
6032
|
const _carousel = require("./carousel.js");
|
|
6025
6033
|
const _grid = require("./grid.js");
|
|
6026
|
-
const _sheet = /*#__PURE__*/ _interop_require_wildcard(require("./sheet.js"));
|
|
6027
6034
|
const _sheetroot = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-root.js"));
|
|
6028
|
-
const
|
|
6035
|
+
const _sheetcommon = /*#__PURE__*/ _interop_require_wildcard(require("./sheet-common.js"));
|
|
6036
|
+
const _sheetactions = /*#__PURE__*/ _interop_require_default(require("./sheet-actions.js"));
|
|
6037
|
+
const _sheetinfo = /*#__PURE__*/ _interop_require_default(require("./sheet-info.js"));
|
|
6038
|
+
const _sheetactionslist = /*#__PURE__*/ _interop_require_default(require("./sheet-actions-list.js"));
|
|
6039
|
+
const _sheetradiolist = /*#__PURE__*/ _interop_require_default(require("./sheet-radio-list.js"));
|
|
6029
6040
|
const _form = /*#__PURE__*/ _interop_require_default(require("./form.js"));
|
|
6030
6041
|
const _select = /*#__PURE__*/ _interop_require_default(require("./select.js"));
|
|
6031
6042
|
const _textfield = /*#__PURE__*/ _interop_require_default(require("./text-field.js"));
|
package/dist/inline.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ type Props = {
|
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
role?: string;
|
|
11
|
+
'aria-label'?: string;
|
|
11
12
|
'aria-labelledby'?: string;
|
|
12
13
|
fullWidth?: boolean;
|
|
13
14
|
dataAttributes?: DataAttributes;
|
|
14
15
|
wrap?: boolean;
|
|
15
16
|
};
|
|
16
|
-
declare const Inline: ({ space, className, children, role, alignItems, "aria-labelledby": ariaLabelledBy, fullWidth, wrap, dataAttributes, }: Props) => JSX.Element;
|
|
17
|
+
declare const Inline: ({ space, className, children, role, alignItems, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, fullWidth, wrap, dataAttributes, }: Props) => JSX.Element;
|
|
17
18
|
export default Inline;
|
package/dist/inline.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function() {
|
|
9
|
-
return
|
|
9
|
+
return z;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -116,7 +116,7 @@ function _object_spread_props(target, source) {
|
|
|
116
116
|
}
|
|
117
117
|
return target;
|
|
118
118
|
}
|
|
119
|
-
const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`,
|
|
119
|
+
const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`, R = (t)=>{
|
|
120
120
|
if (typeof t == "number" || typeof t == "string") return {
|
|
121
121
|
[_inlinecssmistica.vars.space]: i(t)
|
|
122
122
|
};
|
|
@@ -125,25 +125,26 @@ const i = (t)=>typeof t == "number" ? `${t}px` : `space-${t}`, D = (t)=>{
|
|
|
125
125
|
[_inlinecssmistica.vars.spaceDesktop]: i(t.desktop)
|
|
126
126
|
};
|
|
127
127
|
return t.tablet && (e[_inlinecssmistica.vars.spaceTablet] = i(t.tablet)), e;
|
|
128
|
-
},
|
|
129
|
-
let { space: t, className: e, children:
|
|
130
|
-
const { platformOverrides:
|
|
128
|
+
}, j = (param)=>{
|
|
129
|
+
let { space: t, className: e, children: p, role: l, alignItems: f = "stretch", "aria-label": o, "aria-labelledby": c, fullWidth: d, wrap: s, dataAttributes: u } = param;
|
|
130
|
+
const { platformOverrides: a } = (0, _hooks.useTheme)(), b = typeof t == "string";
|
|
131
131
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
132
132
|
className: (0, _classnames.default)(e, _inlinecssmistica.inline, (0, _sprinklescssmistica.sprinkles)({
|
|
133
|
-
alignItems:
|
|
134
|
-
}),
|
|
135
|
-
style: (0, _css.applyCssVars)(
|
|
136
|
-
role:
|
|
137
|
-
"aria-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
alignItems: f
|
|
134
|
+
}), s ? _inlinecssmistica.wrap : d ? _inlinecssmistica.fullWidth : _inlinecssmistica.noFullWidth, b ? s ? _inlinecssmistica.stringSpaceWithWrap : _inlinecssmistica.stringSpace : _inlinecssmistica.marginInline),
|
|
135
|
+
style: (0, _css.applyCssVars)(R(t)),
|
|
136
|
+
role: l,
|
|
137
|
+
"aria-label": o,
|
|
138
|
+
"aria-labelledby": o ? void 0 : c
|
|
139
|
+
}, (0, _dom.getPrefixedDataAttributes)(u, "Inline")), {
|
|
140
|
+
children: _react.Children.map(p, (n)=>n || n === 0 ? /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
141
|
+
role: l === "list" ? "listitem" : void 0,
|
|
141
142
|
style: {
|
|
142
143
|
// Hack to fix https://jira.tid.es/browse/WEB-1683
|
|
143
144
|
// In iOS the inline component sometimes cuts the last line of the content
|
|
144
|
-
paddingBottom: (0, _platform.isIos)(
|
|
145
|
+
paddingBottom: (0, _platform.isIos)(a) && !(0, _platform.isRunningAcceptanceTest)(a) ? 1 : void 0
|
|
145
146
|
},
|
|
146
147
|
children: n
|
|
147
148
|
}) : null)
|
|
148
149
|
}));
|
|
149
|
-
},
|
|
150
|
+
}, z = j;
|
package/dist/integer-field.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export declare const IntegerInput: ({ inputRef, value, defaultValue, type, ...re
|
|
|
8
8
|
export interface IntegerFieldProps extends CommonFormFieldProps {
|
|
9
9
|
onChangeValue?: (value: string, rawValue: string) => void;
|
|
10
10
|
}
|
|
11
|
-
declare const IntegerField: ({ disabled, error, helperText, name, optional, validate
|
|
11
|
+
declare const IntegerField: ({ disabled, error, helperText, name, label, optional, validate, onChange, onChangeValue, onBlur, value, defaultValue, dataAttributes, ...rest }: IntegerFieldProps) => JSX.Element;
|
|
12
12
|
export default IntegerField;
|