@wix/editor-react-components 1.2764.0 → 1.2765.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/site/components/AccordionComponent/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +4 -3
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/BoxContainer/component.js +2 -2
- package/dist/site/components/Breadcrumbs/component.js +3 -3
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/Button/component.js +1 -1
- package/dist/site/components/Button/manifest.js +1 -1
- package/dist/site/components/Checkbox/component.js +2 -2
- package/dist/site/components/CheckboxGroup/component.js +2 -2
- package/dist/site/components/CollapsibleText/component.js +2 -2
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/component.js +6 -4
- package/dist/site/components/Dropdown/component.js +1 -1
- package/dist/site/components/Dropdown/manifest.js +1 -1
- package/dist/site/components/GoogleMap/manifest.js +1 -1
- package/dist/site/components/HTMLComponent/manifest.js +1 -1
- package/dist/site/components/HeadingTextBlock/component.js +2 -2
- package/dist/site/components/HipaaIcon/component.js +1 -1
- package/dist/site/components/Image3/component.js +1 -1
- package/dist/site/components/ImageReveal/component.js +2 -2
- package/dist/site/components/LegacyAppWidget/component.js +1 -1
- package/dist/site/components/LegacyContainer/component.js +1 -1
- package/dist/site/components/LegacyMultiStateBox/component.js +2 -2
- package/dist/site/components/Line/component.js +1 -1
- package/dist/site/components/LinkBar/manifest.js +1 -1
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Lottie/manifest.js +1 -1
- package/dist/site/components/MarkdownBlock/component.js +1 -1
- package/dist/site/components/Menu/component.js +3 -3
- package/dist/site/components/Menu/manifest.js +1 -1
- package/dist/site/components/MultiStateBox/manifest.js +1 -1
- package/dist/site/components/RadioButtons/component.js +2 -2
- package/dist/site/components/ShareButtons/component.js +1 -1
- package/dist/site/components/ShareButtons/manifest.js +1 -1
- package/dist/site/components/Slideshow/component.js +1 -1
- package/dist/site/components/Slideshow/manifest.js +1 -1
- package/dist/site/components/Tabs/manifest.js +1 -1
- package/dist/site/components/TestComp/manifest.js +1 -1
- package/dist/site/components/TextBox/component.js +1 -1
- package/dist/site/components/TextEffects3d/component.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
- package/dist/site/components/TextEffectsGlass/component.js +1 -1
- package/dist/site/components/TextEffectsGlitch/component.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
- package/dist/site/components/TextEffectsMatrix/component.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
- package/dist/site/components/TextEffectsNoisy/component.js +1 -1
- package/dist/site/components/TextEffectsOutlineOut/component.js +1 -1
- package/dist/site/components/TextEffectsRetro/component.js +1 -1
- package/dist/site/components/TextEffectsShook/component.js +1 -1
- package/dist/site/components/TextEffectsSticker/component.js +1 -1
- package/dist/site/components/TextEffectsStriped/component.js +1 -1
- package/dist/site/components/TextInput/TextInput.d.ts +3 -7
- package/dist/site/components/TextInput/TextInput.types.d.ts +38 -105
- package/dist/site/components/TextInput/component.js +104 -780
- package/dist/site/components/TextInput/component.preview.d.ts +1 -4
- package/dist/site/components/TextInput/constants.d.ts +17 -65
- package/dist/site/components/TextInput/css.css +25 -223
- package/dist/site/components/TextInput/manifest.js +181 -367
- package/dist/site/components/TimePicker/component.js +6 -5
- package/dist/site/components/chunks/AnimatedIcon.js +1 -1
- package/dist/site/components/chunks/Button.js +1055 -466
- package/dist/site/components/chunks/Button2.js +486 -0
- package/dist/site/components/chunks/Group.js +46 -970
- package/dist/site/components/chunks/I18nProvider.js +125 -0
- package/dist/site/components/chunks/Input.js +369 -0
- package/dist/site/components/chunks/Link.js +1 -1
- package/dist/site/components/chunks/ResponsiveBox.js +1 -1
- package/dist/site/components/chunks/ResponsiveContainer.js +1 -1
- package/dist/site/components/chunks/TextEffectsShared.js +1 -1
- package/dist/site/components/chunks/Tooltip.js +6745 -351
- package/dist/site/components/chunks/VisuallyHidden.js +1 -1
- package/dist/site/components/chunks/a11y.js +4 -5
- package/dist/site/components/chunks/constants3.js +23 -63
- package/dist/site/components/chunks/filterDOMProps.js +18 -139
- package/dist/site/components/chunks/index10.js +3 -2020
- package/dist/site/components/chunks/index11.js +31184 -232
- package/dist/site/components/chunks/index12.js +3 -31191
- package/dist/site/components/chunks/index13.js +44 -3
- package/dist/site/components/chunks/index3.js +1 -1
- package/dist/site/components/chunks/index4.js +1 -1
- package/dist/site/components/chunks/index5.js +1 -1
- package/dist/site/components/chunks/index7.js +67 -3
- package/dist/site/components/chunks/index8.js +2020 -3
- package/dist/site/components/chunks/index9.js +232 -60
- package/dist/site/components/chunks/manifestSdkMixins.js +4 -4
- package/dist/site/components/chunks/parseHtml.js +1 -1
- package/dist/site/components/chunks/parseSvg.js +1 -1
- package/dist/site/components/chunks/staticService.js +1 -1
- package/dist/site/components/chunks/useConsentPolicyProps.js +1 -1
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +1 -1
- package/package.json +2 -2
- package/dist/site/components/TextInput/TextInput.viewer.constants.d.ts +0 -24
- package/dist/site/components/TextInput/sdk.d.ts +0 -4
- package/dist/site/components/TextInput/sdk.js +0 -91
- package/dist/site/components/TextInput/utils.d.ts +0 -9
- package/dist/site/components/chunks/DateField.js +0 -6762
- package/dist/site/components/chunks/NumberFormatter.js +0 -140
- package/dist/site/components/chunks/index14.js +0 -46
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { j as $c7eafbbe1ea5834e$export$535bd6ca7f90a273 } from "./filterDOMProps.js";
|
|
2
|
+
import React__default, { useState, useEffect, useContext } from "react";
|
|
3
|
+
const $d805ff57cab8bee2$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
|
|
4
|
+
"Arab",
|
|
5
|
+
"Syrc",
|
|
6
|
+
"Samr",
|
|
7
|
+
"Mand",
|
|
8
|
+
"Thaa",
|
|
9
|
+
"Mend",
|
|
10
|
+
"Nkoo",
|
|
11
|
+
"Adlm",
|
|
12
|
+
"Rohg",
|
|
13
|
+
"Hebr"
|
|
14
|
+
]);
|
|
15
|
+
const $d805ff57cab8bee2$var$RTL_LANGS = /* @__PURE__ */ new Set([
|
|
16
|
+
"ae",
|
|
17
|
+
"ar",
|
|
18
|
+
"arc",
|
|
19
|
+
"bcc",
|
|
20
|
+
"bqi",
|
|
21
|
+
"ckb",
|
|
22
|
+
"dv",
|
|
23
|
+
"fa",
|
|
24
|
+
"glk",
|
|
25
|
+
"he",
|
|
26
|
+
"ku",
|
|
27
|
+
"mzn",
|
|
28
|
+
"nqo",
|
|
29
|
+
"pnb",
|
|
30
|
+
"ps",
|
|
31
|
+
"sd",
|
|
32
|
+
"ug",
|
|
33
|
+
"ur",
|
|
34
|
+
"yi"
|
|
35
|
+
]);
|
|
36
|
+
function $d805ff57cab8bee2$export$702d680b21cbd764(localeString) {
|
|
37
|
+
if (Intl.Locale) {
|
|
38
|
+
let locale = new Intl.Locale(localeString).maximize();
|
|
39
|
+
let textInfo = typeof locale.getTextInfo === "function" ? locale.getTextInfo() : locale.textInfo;
|
|
40
|
+
if (textInfo) return textInfo.direction === "rtl";
|
|
41
|
+
if (locale.script) return $d805ff57cab8bee2$var$RTL_SCRIPTS.has(locale.script);
|
|
42
|
+
}
|
|
43
|
+
let lang = localeString.split("-")[0];
|
|
44
|
+
return $d805ff57cab8bee2$var$RTL_LANGS.has(lang);
|
|
45
|
+
}
|
|
46
|
+
const $520a025cdb0d710d$var$localeSymbol = Symbol.for("react-aria.i18n.locale");
|
|
47
|
+
function $520a025cdb0d710d$export$f09106e7c6677ec5() {
|
|
48
|
+
let locale = typeof window !== "undefined" && window[$520a025cdb0d710d$var$localeSymbol] || typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
49
|
+
try {
|
|
50
|
+
Intl.DateTimeFormat.supportedLocalesOf([
|
|
51
|
+
locale
|
|
52
|
+
]);
|
|
53
|
+
} catch {
|
|
54
|
+
locale = "en-US";
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
locale,
|
|
58
|
+
direction: $d805ff57cab8bee2$export$702d680b21cbd764(locale) ? "rtl" : "ltr"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
let $520a025cdb0d710d$var$currentLocale = $520a025cdb0d710d$export$f09106e7c6677ec5();
|
|
62
|
+
let $520a025cdb0d710d$var$listeners = /* @__PURE__ */ new Set();
|
|
63
|
+
function $520a025cdb0d710d$var$updateLocale() {
|
|
64
|
+
$520a025cdb0d710d$var$currentLocale = $520a025cdb0d710d$export$f09106e7c6677ec5();
|
|
65
|
+
for (let listener of $520a025cdb0d710d$var$listeners) listener($520a025cdb0d710d$var$currentLocale);
|
|
66
|
+
}
|
|
67
|
+
function $520a025cdb0d710d$export$188ec29ebc2bdc3a() {
|
|
68
|
+
let isSSR = $c7eafbbe1ea5834e$export$535bd6ca7f90a273();
|
|
69
|
+
let [defaultLocale, setDefaultLocale] = useState($520a025cdb0d710d$var$currentLocale);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if ($520a025cdb0d710d$var$listeners.size === 0) window.addEventListener("languagechange", $520a025cdb0d710d$var$updateLocale);
|
|
72
|
+
$520a025cdb0d710d$var$listeners.add(setDefaultLocale);
|
|
73
|
+
return () => {
|
|
74
|
+
$520a025cdb0d710d$var$listeners.delete(setDefaultLocale);
|
|
75
|
+
if ($520a025cdb0d710d$var$listeners.size === 0) window.removeEventListener("languagechange", $520a025cdb0d710d$var$updateLocale);
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
if (isSSR) {
|
|
79
|
+
let locale = typeof window !== "undefined" && window[$520a025cdb0d710d$var$localeSymbol];
|
|
80
|
+
return {
|
|
81
|
+
locale: locale || "en-US",
|
|
82
|
+
direction: "ltr"
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return defaultLocale;
|
|
86
|
+
}
|
|
87
|
+
const $2eb8e6d23f3d0cb0$var$I18nContext = /* @__PURE__ */ React__default.createContext(null);
|
|
88
|
+
function $2eb8e6d23f3d0cb0$var$I18nProviderWithLocale(props) {
|
|
89
|
+
let { locale, children } = props;
|
|
90
|
+
let value = React__default.useMemo(() => ({
|
|
91
|
+
locale,
|
|
92
|
+
direction: $d805ff57cab8bee2$export$702d680b21cbd764(locale) ? "rtl" : "ltr"
|
|
93
|
+
}), [
|
|
94
|
+
locale
|
|
95
|
+
]);
|
|
96
|
+
return /* @__PURE__ */ React__default.createElement($2eb8e6d23f3d0cb0$var$I18nContext.Provider, {
|
|
97
|
+
value
|
|
98
|
+
}, children);
|
|
99
|
+
}
|
|
100
|
+
function $2eb8e6d23f3d0cb0$var$I18nProviderWithDefaultLocale(props) {
|
|
101
|
+
let { children } = props;
|
|
102
|
+
let defaultLocale = $520a025cdb0d710d$export$188ec29ebc2bdc3a();
|
|
103
|
+
return /* @__PURE__ */ React__default.createElement($2eb8e6d23f3d0cb0$var$I18nContext.Provider, {
|
|
104
|
+
value: defaultLocale
|
|
105
|
+
}, children);
|
|
106
|
+
}
|
|
107
|
+
function $2eb8e6d23f3d0cb0$export$a54013f0d02a8f82(props) {
|
|
108
|
+
let { locale, children } = props;
|
|
109
|
+
if (locale) return /* @__PURE__ */ React__default.createElement($2eb8e6d23f3d0cb0$var$I18nProviderWithLocale, {
|
|
110
|
+
locale,
|
|
111
|
+
children
|
|
112
|
+
});
|
|
113
|
+
return /* @__PURE__ */ React__default.createElement($2eb8e6d23f3d0cb0$var$I18nProviderWithDefaultLocale, {
|
|
114
|
+
children
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7() {
|
|
118
|
+
let defaultLocale = $520a025cdb0d710d$export$188ec29ebc2bdc3a();
|
|
119
|
+
let context = useContext($2eb8e6d23f3d0cb0$var$I18nContext);
|
|
120
|
+
return context || defaultLocale;
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
$2eb8e6d23f3d0cb0$export$a54013f0d02a8f82 as $,
|
|
124
|
+
$2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 as a
|
|
125
|
+
};
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { H as $c4867b2f328c2698$export$e5c5a5f917a5871c, n as $fe16bffc7a557bf0$export$7f54fc3180508a52, R as $8f5a2122b0992be3$export$8397ddfc504fdb9a, f as $23f2114a1b82827e$export$e58f029f0fbfdb29, S as $0beb20c9744a2065$export$8467354a121f1b9f, T as $390e54f620492c70$export$b4cc09c592e8fdb8, e as $bbaa08b3cd72f041$export$9d1611c77c2fe928, A as $e969f22b6713ca4a$export$ae780daf29e6d456, z as $0c4a58759813079a$export$4e328f61c538687f } from "./Group.js";
|
|
2
|
+
import React__default, { useRef, useEffect, useMemo, useContext, useState, createContext, forwardRef } from "react";
|
|
3
|
+
import { b as $64fa3d84918910a7$export$29f1550f4b0d4415, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, f as $64fa3d84918910a7$export$4d86445c2cf5e3, a as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./filterDOMProps.js";
|
|
4
|
+
function $860f7da480e22816$export$b8473d3665f3a75a(props, state, ref) {
|
|
5
|
+
let { validationBehavior, focus } = props;
|
|
6
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
7
|
+
if (validationBehavior === "native" && (ref == null ? void 0 : ref.current) && !ref.current.disabled) {
|
|
8
|
+
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
|
|
9
|
+
ref.current.setCustomValidity(errorMessage);
|
|
10
|
+
if (!ref.current.hasAttribute("title")) ref.current.title = "";
|
|
11
|
+
if (!state.realtimeValidation.isInvalid) state.updateValidation($860f7da480e22816$var$getNativeValidity(ref.current));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
let isIgnoredReset = useRef(false);
|
|
15
|
+
let onReset = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
16
|
+
if (!isIgnoredReset.current) state.resetValidation();
|
|
17
|
+
});
|
|
18
|
+
let onInvalid = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
21
|
+
let form = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.form;
|
|
22
|
+
if (!e.defaultPrevented && ref && form && $860f7da480e22816$var$getFirstInvalidInput(form) === ref.current) {
|
|
23
|
+
if (focus) focus();
|
|
24
|
+
else (_b = ref.current) == null ? void 0 : _b.focus();
|
|
25
|
+
$8f5a2122b0992be3$export$8397ddfc504fdb9a("keyboard");
|
|
26
|
+
}
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
});
|
|
29
|
+
let onChange = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
30
|
+
state.commitValidation();
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
let input = ref == null ? void 0 : ref.current;
|
|
34
|
+
if (!input) return;
|
|
35
|
+
let form = input.form;
|
|
36
|
+
let reset = form == null ? void 0 : form.reset;
|
|
37
|
+
if (form)
|
|
38
|
+
form.reset = () => {
|
|
39
|
+
isIgnoredReset.current = !window.event || window.event.type === "message" && $23f2114a1b82827e$export$e58f029f0fbfdb29(window.event) instanceof MessagePort;
|
|
40
|
+
reset == null ? void 0 : reset.call(form);
|
|
41
|
+
isIgnoredReset.current = false;
|
|
42
|
+
};
|
|
43
|
+
input.addEventListener("invalid", onInvalid);
|
|
44
|
+
input.addEventListener("change", onChange);
|
|
45
|
+
form == null ? void 0 : form.addEventListener("reset", onReset);
|
|
46
|
+
return () => {
|
|
47
|
+
input.removeEventListener("invalid", onInvalid);
|
|
48
|
+
input.removeEventListener("change", onChange);
|
|
49
|
+
form == null ? void 0 : form.removeEventListener("reset", onReset);
|
|
50
|
+
if (form)
|
|
51
|
+
form.reset = reset;
|
|
52
|
+
};
|
|
53
|
+
}, [
|
|
54
|
+
ref,
|
|
55
|
+
validationBehavior
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
function $860f7da480e22816$var$getValidity(input) {
|
|
59
|
+
let validity = input.validity;
|
|
60
|
+
return {
|
|
61
|
+
badInput: validity.badInput,
|
|
62
|
+
customError: validity.customError,
|
|
63
|
+
patternMismatch: validity.patternMismatch,
|
|
64
|
+
rangeOverflow: validity.rangeOverflow,
|
|
65
|
+
rangeUnderflow: validity.rangeUnderflow,
|
|
66
|
+
stepMismatch: validity.stepMismatch,
|
|
67
|
+
tooLong: validity.tooLong,
|
|
68
|
+
tooShort: validity.tooShort,
|
|
69
|
+
typeMismatch: validity.typeMismatch,
|
|
70
|
+
valueMissing: validity.valueMissing,
|
|
71
|
+
valid: validity.valid
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function $860f7da480e22816$var$getNativeValidity(input) {
|
|
75
|
+
return {
|
|
76
|
+
isInvalid: !input.validity.valid,
|
|
77
|
+
validationDetails: $860f7da480e22816$var$getValidity(input),
|
|
78
|
+
validationErrors: input.validationMessage ? [
|
|
79
|
+
input.validationMessage
|
|
80
|
+
] : []
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function $860f7da480e22816$var$getFirstInvalidInput(form) {
|
|
84
|
+
var _a;
|
|
85
|
+
for (let i = 0; i < form.elements.length; i++) {
|
|
86
|
+
let element = form.elements[i];
|
|
87
|
+
if (((_a = element.validity) == null ? void 0 : _a.valid) === false) return element;
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const $fd2148440a13ec26$export$aca958c65c314e6c = {
|
|
92
|
+
badInput: false,
|
|
93
|
+
customError: false,
|
|
94
|
+
patternMismatch: false,
|
|
95
|
+
rangeOverflow: false,
|
|
96
|
+
rangeUnderflow: false,
|
|
97
|
+
stepMismatch: false,
|
|
98
|
+
tooLong: false,
|
|
99
|
+
tooShort: false,
|
|
100
|
+
typeMismatch: false,
|
|
101
|
+
valueMissing: false,
|
|
102
|
+
valid: true
|
|
103
|
+
};
|
|
104
|
+
const $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE = {
|
|
105
|
+
...$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
106
|
+
customError: true,
|
|
107
|
+
valid: false
|
|
108
|
+
};
|
|
109
|
+
const $fd2148440a13ec26$export$dad6ae84456c676a = {
|
|
110
|
+
isInvalid: false,
|
|
111
|
+
validationDetails: $fd2148440a13ec26$export$aca958c65c314e6c,
|
|
112
|
+
validationErrors: []
|
|
113
|
+
};
|
|
114
|
+
const $fd2148440a13ec26$export$571b5131b7e65c11 = createContext({});
|
|
115
|
+
const $fd2148440a13ec26$export$a763b9476acd3eb = "__reactAriaFormValidationState";
|
|
116
|
+
function $fd2148440a13ec26$export$fc1a364ae1f3ff10(props) {
|
|
117
|
+
if (props[$fd2148440a13ec26$export$a763b9476acd3eb]) {
|
|
118
|
+
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$fd2148440a13ec26$export$a763b9476acd3eb];
|
|
119
|
+
return {
|
|
120
|
+
realtimeValidation,
|
|
121
|
+
displayValidation,
|
|
122
|
+
updateValidation,
|
|
123
|
+
resetValidation,
|
|
124
|
+
commitValidation
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return $fd2148440a13ec26$var$useFormValidationStateImpl(props);
|
|
128
|
+
}
|
|
129
|
+
function $fd2148440a13ec26$var$useFormValidationStateImpl(props) {
|
|
130
|
+
let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
|
|
131
|
+
if (validationState) isInvalid || (isInvalid = validationState === "invalid");
|
|
132
|
+
let controlledError = isInvalid !== void 0 ? {
|
|
133
|
+
isInvalid,
|
|
134
|
+
validationErrors: [],
|
|
135
|
+
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
136
|
+
} : null;
|
|
137
|
+
let clientError = useMemo(() => {
|
|
138
|
+
if (!validate || value == null) return null;
|
|
139
|
+
let validateErrors = $fd2148440a13ec26$var$runValidate(validate, value);
|
|
140
|
+
return $fd2148440a13ec26$var$getValidationResult(validateErrors);
|
|
141
|
+
}, [
|
|
142
|
+
validate,
|
|
143
|
+
value
|
|
144
|
+
]);
|
|
145
|
+
if (builtinValidation == null ? void 0 : builtinValidation.validationDetails.valid) builtinValidation = void 0;
|
|
146
|
+
let serverErrors = useContext($fd2148440a13ec26$export$571b5131b7e65c11);
|
|
147
|
+
let serverErrorMessages = useMemo(() => {
|
|
148
|
+
if (name) return Array.isArray(name) ? name.flatMap((name2) => $fd2148440a13ec26$var$asArray(serverErrors[name2])) : $fd2148440a13ec26$var$asArray(serverErrors[name]);
|
|
149
|
+
return [];
|
|
150
|
+
}, [
|
|
151
|
+
serverErrors,
|
|
152
|
+
name
|
|
153
|
+
]);
|
|
154
|
+
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
|
|
155
|
+
let [isServerErrorCleared, setServerErrorCleared] = useState(false);
|
|
156
|
+
if (serverErrors !== lastServerErrors) {
|
|
157
|
+
setLastServerErrors(serverErrors);
|
|
158
|
+
setServerErrorCleared(false);
|
|
159
|
+
}
|
|
160
|
+
let serverError = useMemo(() => $fd2148440a13ec26$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
|
|
161
|
+
isServerErrorCleared,
|
|
162
|
+
serverErrorMessages
|
|
163
|
+
]);
|
|
164
|
+
let nextValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
165
|
+
let [currentValidity, setCurrentValidity] = useState($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
166
|
+
let lastError = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
167
|
+
let commitValidation = () => {
|
|
168
|
+
if (!commitQueued) return;
|
|
169
|
+
setCommitQueued(false);
|
|
170
|
+
let error = clientError || builtinValidation || nextValidation.current;
|
|
171
|
+
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
172
|
+
lastError.current = error;
|
|
173
|
+
setCurrentValidity(error);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
let [commitQueued, setCommitQueued] = useState(false);
|
|
177
|
+
useEffect(commitValidation);
|
|
178
|
+
let realtimeValidation = controlledError || serverError || clientError || builtinValidation || $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
179
|
+
let displayValidation = validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity;
|
|
180
|
+
return {
|
|
181
|
+
realtimeValidation,
|
|
182
|
+
displayValidation,
|
|
183
|
+
updateValidation(value2) {
|
|
184
|
+
if (validationBehavior === "aria" && !$fd2148440a13ec26$var$isEqualValidation(currentValidity, value2)) setCurrentValidity(value2);
|
|
185
|
+
else nextValidation.current = value2;
|
|
186
|
+
},
|
|
187
|
+
resetValidation() {
|
|
188
|
+
let error = $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
189
|
+
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
190
|
+
lastError.current = error;
|
|
191
|
+
setCurrentValidity(error);
|
|
192
|
+
}
|
|
193
|
+
if (validationBehavior === "native") setCommitQueued(false);
|
|
194
|
+
setServerErrorCleared(true);
|
|
195
|
+
},
|
|
196
|
+
commitValidation() {
|
|
197
|
+
if (validationBehavior === "native") setCommitQueued(true);
|
|
198
|
+
setServerErrorCleared(true);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function $fd2148440a13ec26$var$asArray(v) {
|
|
203
|
+
if (!v) return [];
|
|
204
|
+
return Array.isArray(v) ? v : [
|
|
205
|
+
v
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
function $fd2148440a13ec26$var$runValidate(validate, value) {
|
|
209
|
+
if (typeof validate === "function") {
|
|
210
|
+
let e = validate(value);
|
|
211
|
+
if (e && typeof e !== "boolean") return $fd2148440a13ec26$var$asArray(e);
|
|
212
|
+
}
|
|
213
|
+
return [];
|
|
214
|
+
}
|
|
215
|
+
function $fd2148440a13ec26$var$getValidationResult(errors) {
|
|
216
|
+
return errors.length ? {
|
|
217
|
+
isInvalid: true,
|
|
218
|
+
validationErrors: errors,
|
|
219
|
+
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
220
|
+
} : null;
|
|
221
|
+
}
|
|
222
|
+
function $fd2148440a13ec26$var$isEqualValidation(a, b) {
|
|
223
|
+
if (a === b) return true;
|
|
224
|
+
return !!a && !!b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a2, i) => a2 === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);
|
|
225
|
+
}
|
|
226
|
+
function $fd2148440a13ec26$export$75ee7c75d68f5b0e(...results) {
|
|
227
|
+
let errors = /* @__PURE__ */ new Set();
|
|
228
|
+
let isInvalid = false;
|
|
229
|
+
let validationDetails = {
|
|
230
|
+
...$fd2148440a13ec26$export$aca958c65c314e6c
|
|
231
|
+
};
|
|
232
|
+
for (let v of results) {
|
|
233
|
+
for (let e of v.validationErrors) errors.add(e);
|
|
234
|
+
isInvalid || (isInvalid = v.isInvalid);
|
|
235
|
+
for (let key in validationDetails) validationDetails[key] || (validationDetails[key] = v.validationDetails[key]);
|
|
236
|
+
}
|
|
237
|
+
validationDetails.valid = !isInvalid;
|
|
238
|
+
return {
|
|
239
|
+
isInvalid,
|
|
240
|
+
validationErrors: [
|
|
241
|
+
...errors
|
|
242
|
+
],
|
|
243
|
+
validationDetails
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function $191c9b6d48a0a4e2$export$294aa081a6c6f55d(props) {
|
|
247
|
+
let { description, errorMessage, isInvalid, validationState } = props;
|
|
248
|
+
let { labelProps, fieldProps } = $0beb20c9744a2065$export$8467354a121f1b9f(props);
|
|
249
|
+
let descriptionId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
250
|
+
Boolean(description),
|
|
251
|
+
Boolean(errorMessage),
|
|
252
|
+
isInvalid,
|
|
253
|
+
validationState
|
|
254
|
+
]);
|
|
255
|
+
let errorMessageId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
256
|
+
Boolean(description),
|
|
257
|
+
Boolean(errorMessage),
|
|
258
|
+
isInvalid,
|
|
259
|
+
validationState
|
|
260
|
+
]);
|
|
261
|
+
fieldProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(fieldProps, {
|
|
262
|
+
"aria-describedby": [
|
|
263
|
+
descriptionId,
|
|
264
|
+
// Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
|
|
265
|
+
errorMessageId,
|
|
266
|
+
props["aria-describedby"]
|
|
267
|
+
].filter(Boolean).join(" ") || void 0
|
|
268
|
+
});
|
|
269
|
+
return {
|
|
270
|
+
labelProps,
|
|
271
|
+
fieldProps,
|
|
272
|
+
descriptionProps: {
|
|
273
|
+
id: descriptionId
|
|
274
|
+
},
|
|
275
|
+
errorMessageProps: {
|
|
276
|
+
id: errorMessageId
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const $514c0188e459b4c0$export$9afb8bc826b033ea = /* @__PURE__ */ createContext({});
|
|
281
|
+
const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /* @__PURE__ */ forwardRef(function Text(props, ref) {
|
|
282
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $514c0188e459b4c0$export$9afb8bc826b033ea);
|
|
283
|
+
let { elementType: ElementType = "span", ...domProps } = props;
|
|
284
|
+
return /* @__PURE__ */ React__default.createElement(ElementType, {
|
|
285
|
+
className: "react-aria-Text",
|
|
286
|
+
...domProps,
|
|
287
|
+
ref
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
const $ee014567cb39d3f0$export$ff05c3ac10437e03 = /* @__PURE__ */ createContext(null);
|
|
291
|
+
const $ee014567cb39d3f0$export$f551688fc98f2e09 = /* @__PURE__ */ forwardRef(function FieldError(props, ref) {
|
|
292
|
+
let validation = useContext($ee014567cb39d3f0$export$ff05c3ac10437e03);
|
|
293
|
+
if (!(validation === null || validation === void 0 ? void 0 : validation.isInvalid)) return null;
|
|
294
|
+
return /* @__PURE__ */ React__default.createElement($ee014567cb39d3f0$var$FieldErrorInner, {
|
|
295
|
+
...props,
|
|
296
|
+
ref
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
const $ee014567cb39d3f0$var$FieldErrorInner = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
300
|
+
let validation = useContext($ee014567cb39d3f0$export$ff05c3ac10437e03);
|
|
301
|
+
let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
302
|
+
global: true
|
|
303
|
+
});
|
|
304
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
305
|
+
...props,
|
|
306
|
+
defaultClassName: "react-aria-FieldError",
|
|
307
|
+
defaultChildren: validation.validationErrors.length === 0 ? void 0 : validation.validationErrors.join(" "),
|
|
308
|
+
values: validation
|
|
309
|
+
});
|
|
310
|
+
if (renderProps.children == null) return null;
|
|
311
|
+
return /* @__PURE__ */ React__default.createElement($514c0188e459b4c0$export$5f1af8db9871e1d6, {
|
|
312
|
+
slot: "errorMessage",
|
|
313
|
+
...domProps,
|
|
314
|
+
...renderProps,
|
|
315
|
+
ref
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
const $d3e0e05bdfcf66bd$export$c24727297075ec6a = /* @__PURE__ */ createContext(null);
|
|
319
|
+
const $3985021b0ad6602f$export$37fb8590cf2c088c = /* @__PURE__ */ createContext({});
|
|
320
|
+
let $3985021b0ad6602f$var$filterHoverProps = (props) => {
|
|
321
|
+
let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
|
|
322
|
+
return otherProps;
|
|
323
|
+
};
|
|
324
|
+
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Input(props, ref) {
|
|
325
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
326
|
+
let { hoverProps, isHovered } = $e969f22b6713ca4a$export$ae780daf29e6d456(props);
|
|
327
|
+
let { isFocused, isFocusVisible, focusProps } = $0c4a58759813079a$export$4e328f61c538687f({
|
|
328
|
+
isTextInput: true,
|
|
329
|
+
autoFocus: props.autoFocus
|
|
330
|
+
});
|
|
331
|
+
let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
|
|
332
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
333
|
+
...props,
|
|
334
|
+
values: {
|
|
335
|
+
isHovered,
|
|
336
|
+
isFocused,
|
|
337
|
+
isFocusVisible,
|
|
338
|
+
isDisabled: props.disabled || false,
|
|
339
|
+
isInvalid
|
|
340
|
+
},
|
|
341
|
+
defaultClassName: "react-aria-Input"
|
|
342
|
+
});
|
|
343
|
+
return /* @__PURE__ */ React__default.createElement("input", {
|
|
344
|
+
...$bbaa08b3cd72f041$export$9d1611c77c2fe928($3985021b0ad6602f$var$filterHoverProps(props), focusProps, hoverProps),
|
|
345
|
+
...renderProps,
|
|
346
|
+
ref,
|
|
347
|
+
"data-focused": isFocused || void 0,
|
|
348
|
+
"data-disabled": props.disabled || void 0,
|
|
349
|
+
"data-hovered": isHovered || void 0,
|
|
350
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
351
|
+
"data-invalid": isInvalid || void 0
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
export {
|
|
355
|
+
$514c0188e459b4c0$export$5f1af8db9871e1d6 as $,
|
|
356
|
+
$ee014567cb39d3f0$export$f551688fc98f2e09 as a,
|
|
357
|
+
$fd2148440a13ec26$export$fc1a364ae1f3ff10 as b,
|
|
358
|
+
$191c9b6d48a0a4e2$export$294aa081a6c6f55d as c,
|
|
359
|
+
$860f7da480e22816$export$b8473d3665f3a75a as d,
|
|
360
|
+
$d3e0e05bdfcf66bd$export$c24727297075ec6a as e,
|
|
361
|
+
$3985021b0ad6602f$export$37fb8590cf2c088c as f,
|
|
362
|
+
$514c0188e459b4c0$export$9afb8bc826b033ea as g,
|
|
363
|
+
$ee014567cb39d3f0$export$ff05c3ac10437e03 as h,
|
|
364
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069 as i,
|
|
365
|
+
$fd2148440a13ec26$export$75ee7c75d68f5b0e as j,
|
|
366
|
+
$fd2148440a13ec26$export$aca958c65c314e6c as k,
|
|
367
|
+
$fd2148440a13ec26$export$a763b9476acd3eb as l,
|
|
368
|
+
$fd2148440a13ec26$export$dad6ae84456c676a as m
|
|
369
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { a as activateBySpaceOrEnterButton,
|
|
3
|
+
import { a as activateBySpaceOrEnterButton, b as activateBySpaceButton, d as activateByEnterButton } from "./a11y.js";
|
|
4
4
|
import { a as getDataAttributes } from "./dataUtils.js";
|
|
5
5
|
const TestIds = {
|
|
6
6
|
root: "linkElement"
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { c as clsx } from "./clsx.js";
|
|
4
4
|
import { f as formatClassNames } from "./classNames.js";
|
|
5
|
-
import {
|
|
5
|
+
import { e as getTabIndexAttribute, f as getAriaAttributes } from "./a11y.js";
|
|
6
6
|
import { a as getDataAttributes } from "./dataUtils.js";
|
|
7
7
|
const clickable = "clickable__Nql0c";
|
|
8
8
|
const commonStyles = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { useCallback } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { f as getAriaAttributes } from "./a11y.js";
|
|
4
4
|
import { c as clsx } from "./clsx.js";
|
|
5
5
|
const TestIds = {
|
|
6
6
|
overflow: "responsive-container-overflow",
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { f as formatClassNames } from "./classNames.js";
|
|
4
4
|
import { a as getDataAttributes } from "./dataUtils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { e as getTabIndexAttribute } from "./a11y.js";
|
|
6
6
|
import { D as DEFAULT_TEXT_DIRECTION, a as DEFAULT_HTML_TAG, d as dataHooks, T as TestIds } from "./constants9.js";
|
|
7
7
|
import { c as clsx } from "./clsx.js";
|
|
8
8
|
import { L as Link } from "./Link.js";
|