@wix/editor-react-components 1.2288.0 → 1.2289.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/component.js +1 -1
- package/dist/site/components/AccordionComponent/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +5 -1105
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +3 -117
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/site/components/DatePicker/DatePicker.types.d.ts +91 -0
- package/dist/site/components/DatePicker/component.d.ts +2 -0
- package/dist/site/components/DatePicker/component.js +12181 -0
- package/dist/site/components/DatePicker/component.preview.d.ts +2 -0
- package/dist/site/components/DatePicker/components/DatePickerCalendar.d.ts +5 -0
- package/dist/site/components/DatePicker/components/DatePickerField.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerLabel.d.ts +6 -0
- package/dist/site/components/DatePicker/components/DatePickerTooltip.d.ts +5 -0
- package/dist/site/components/DatePicker/constants.d.ts +177 -0
- package/dist/site/components/DatePicker/css.css +349 -0
- package/dist/site/components/DatePicker/datePickerUtils.d.ts +26 -0
- package/dist/site/components/DatePicker/hooks/useDateConstraints.d.ts +12 -0
- package/dist/site/components/DatePicker/hooks/useDatePickerValue.d.ts +15 -0
- package/dist/site/components/DatePicker/hooks/useUnavailableDates.d.ts +3 -0
- package/dist/site/components/DatePicker/index.d.ts +2 -0
- package/dist/site/components/DatePicker/index.js +6 -0
- package/dist/site/components/DatePicker/manifest.d.ts +5 -0
- package/dist/site/components/DatePicker/manifest.js +370 -0
- package/dist/site/components/Dropdown/component.js +1 -3
- package/dist/site/components/TextBox/component.js +1 -4
- package/dist/site/components/TextInput/component.js +4 -297
- package/dist/site/components/chunks/Button2.js +1118 -0
- package/dist/site/components/chunks/DismissSmall.js +7 -0
- package/dist/site/components/chunks/Group.js +108 -36
- package/dist/site/components/chunks/I18nProvider.js +32 -2
- package/dist/site/components/chunks/InfoCircleSmall.js +7 -0
- package/dist/site/components/chunks/Input.js +341 -0
- package/dist/site/components/chunks/constants32.js +152 -49
- package/dist/site/components/chunks/constants33.js +53 -71
- package/dist/site/components/chunks/constants34.js +73 -77
- package/dist/site/components/chunks/constants35.js +76 -57
- package/dist/site/components/chunks/constants36.js +72 -0
- package/dist/site/components/chunks/filterDOMProps.js +14 -8
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +122 -0
- package/dist/site/components/extensions.js +53 -48
- package/package.json +3 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const DismissSmall = ({ size, ...props }) => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 18 18", fill: "currentColor", width: size || "18", height: size || "18", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M8.43933983,9.5 L6,7.06066017 C5.70710678,6.76776695 5.70710678,6.29289322 6,6 C6.29289322,5.70710678 6.76776695,5.70710678 7.06066017,6 L9.5,8.43933983 L11.9393398,6 C12.232233,5.70710678 12.7071068,5.70710678 13,6 C13.2928932,6.29289322 13.2928932,6.76776695 13,7.06066017 L10.5606602,9.5 L13,11.9393398 C13.2928932,12.232233 13.2928932,12.7071068 13,13 C12.7071068,13.2928932 12.232233,13.2928932 11.9393398,13 L9.5,10.5606602 L7.06066017,13 C6.76776695,13.2928932 6.29289322,13.2928932 6,13 C5.70710678,12.7071068 5.70710678,12.232233 6,11.9393398 L8.43933983,9.5 Z" }));
|
|
3
|
+
DismissSmall.displayName = "DismissSmall";
|
|
4
|
+
var DismissSmall_default = DismissSmall;
|
|
5
|
+
export {
|
|
6
|
+
DismissSmall_default as D
|
|
7
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React__default, { useRef, useCallback, useEffect, useState, useContext, useReducer,
|
|
2
|
-
import { i as $c7eafbbe1ea5834e$export$619500959fc48b26, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415,
|
|
1
|
+
import React__default, { useRef, useCallback, useEffect, useState, useMemo, useContext, useReducer, createContext, forwardRef } from "react";
|
|
2
|
+
import { i as $c7eafbbe1ea5834e$export$619500959fc48b26, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415, f as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "./filterDOMProps.js";
|
|
3
3
|
const $d447af545b77c9f1$export$b204af158042fbac = (el) => {
|
|
4
4
|
return (el == null ? void 0 : el.ownerDocument) ?? document;
|
|
5
5
|
};
|
|
@@ -46,6 +46,14 @@ function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
|
|
|
46
46
|
}
|
|
47
47
|
return event.target;
|
|
48
48
|
}
|
|
49
|
+
function $23f2114a1b82827e$export$b4f377a2b6254582(node) {
|
|
50
|
+
if (!node) return false;
|
|
51
|
+
let root = node.getRootNode();
|
|
52
|
+
let ownerWindow = $d447af545b77c9f1$export$f21a1ffae260145a(node);
|
|
53
|
+
if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) return false;
|
|
54
|
+
let activeElement = root.activeElement;
|
|
55
|
+
return activeElement != null && node.contains(activeElement);
|
|
56
|
+
}
|
|
49
57
|
function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
|
|
50
58
|
if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
|
|
51
59
|
preventScroll: true
|
|
@@ -139,9 +147,13 @@ const $3b8b240c1bf84ab9$var$focusableElements = [
|
|
|
139
147
|
];
|
|
140
148
|
const $3b8b240c1bf84ab9$var$FOCUSABLE_ELEMENT_SELECTOR = $3b8b240c1bf84ab9$var$focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
141
149
|
$3b8b240c1bf84ab9$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
150
|
+
const $3b8b240c1bf84ab9$var$TABBABLE_ELEMENT_SELECTOR = $3b8b240c1bf84ab9$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
142
151
|
function $3b8b240c1bf84ab9$export$4c063cf1350e6fed(element, options) {
|
|
143
152
|
return element.matches($3b8b240c1bf84ab9$var$FOCUSABLE_ELEMENT_SELECTOR) && !$3b8b240c1bf84ab9$var$isInert(element) && ((options == null ? void 0 : options.skipVisibilityCheck) || $ae77152785188400$export$e989c0fffaa6b27a(element));
|
|
144
153
|
}
|
|
154
|
+
function $3b8b240c1bf84ab9$export$bebd5a1431fec25d(element) {
|
|
155
|
+
return element.matches($3b8b240c1bf84ab9$var$TABBABLE_ELEMENT_SELECTOR) && $ae77152785188400$export$e989c0fffaa6b27a(element) && !$3b8b240c1bf84ab9$var$isInert(element);
|
|
156
|
+
}
|
|
145
157
|
function $3b8b240c1bf84ab9$var$isInert(element) {
|
|
146
158
|
let node = element;
|
|
147
159
|
while (node != null) {
|
|
@@ -967,6 +979,42 @@ function $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props) {
|
|
|
967
979
|
}
|
|
968
980
|
};
|
|
969
981
|
}
|
|
982
|
+
function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
|
|
983
|
+
const objRef = useRef(null);
|
|
984
|
+
const cleanupRef = useRef(void 0);
|
|
985
|
+
const refEffect = useCallback((instance) => {
|
|
986
|
+
if (typeof ref === "function") {
|
|
987
|
+
const refCallback = ref;
|
|
988
|
+
const refCleanup = refCallback(instance);
|
|
989
|
+
return () => {
|
|
990
|
+
if (typeof refCleanup === "function") refCleanup();
|
|
991
|
+
else refCallback(null);
|
|
992
|
+
};
|
|
993
|
+
} else if (ref) {
|
|
994
|
+
ref.current = instance;
|
|
995
|
+
return () => {
|
|
996
|
+
ref.current = null;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
}, [
|
|
1000
|
+
ref
|
|
1001
|
+
]);
|
|
1002
|
+
return useMemo(() => ({
|
|
1003
|
+
get current() {
|
|
1004
|
+
return objRef.current;
|
|
1005
|
+
},
|
|
1006
|
+
set current(value) {
|
|
1007
|
+
objRef.current = value;
|
|
1008
|
+
if (cleanupRef.current) {
|
|
1009
|
+
cleanupRef.current();
|
|
1010
|
+
cleanupRef.current = void 0;
|
|
1011
|
+
}
|
|
1012
|
+
if (value != null) cleanupRef.current = refEffect(value);
|
|
1013
|
+
}
|
|
1014
|
+
}), [
|
|
1015
|
+
refEffect
|
|
1016
|
+
]);
|
|
1017
|
+
}
|
|
970
1018
|
function $b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref) {
|
|
971
1019
|
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
972
1020
|
if (context && context.ref && ref) {
|
|
@@ -984,6 +1032,17 @@ function $d1116acdf220c2da$var$useFocusableContext(ref) {
|
|
|
984
1032
|
let { ref: _, ...otherProps } = context;
|
|
985
1033
|
return otherProps;
|
|
986
1034
|
}
|
|
1035
|
+
const $d1116acdf220c2da$export$13f3202a3e5ddd5 = /* @__PURE__ */ React__default.forwardRef(function FocusableProvider(props, ref) {
|
|
1036
|
+
let { children, ...otherProps } = props;
|
|
1037
|
+
let objRef = $03e8ab2d84d7657a$export$4338b53315abf666(ref);
|
|
1038
|
+
let context = {
|
|
1039
|
+
...otherProps,
|
|
1040
|
+
ref: objRef
|
|
1041
|
+
};
|
|
1042
|
+
return /* @__PURE__ */ React__default.createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, {
|
|
1043
|
+
value: context
|
|
1044
|
+
}, children);
|
|
1045
|
+
});
|
|
987
1046
|
function $d1116acdf220c2da$export$4c014de7c8940b4c(props, domRef) {
|
|
988
1047
|
let { focusProps } = $1e74c67db218ce67$export$f8168d8dd8fd66e6(props);
|
|
989
1048
|
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props);
|
|
@@ -1279,39 +1338,52 @@ const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /* @__PURE__ */ forwardRef(fun
|
|
|
1279
1338
|
}, renderProps.children);
|
|
1280
1339
|
});
|
|
1281
1340
|
export {
|
|
1282
|
-
$
|
|
1283
|
-
$
|
|
1284
|
-
$
|
|
1285
|
-
$
|
|
1286
|
-
$
|
|
1341
|
+
$3e6197669829fe11$export$40bfa8c7b0832715 as $,
|
|
1342
|
+
$2add3ce32c6007eb$export$fedb369cb70207f1 as A,
|
|
1343
|
+
$1969ac565cfec8d0$export$de79e2c695e052f3 as B,
|
|
1344
|
+
$23f2114a1b82827e$export$b4f377a2b6254582 as C,
|
|
1345
|
+
$48a7d519b337145d$export$4eaf04e54aa8eed6 as D,
|
|
1287
1346
|
$2c9edc598a03d523$export$420e68273165f4ec as E,
|
|
1288
|
-
$
|
|
1289
|
-
$
|
|
1290
|
-
$
|
|
1291
|
-
$
|
|
1292
|
-
$8f5a2122b0992be3$export$
|
|
1293
|
-
$
|
|
1294
|
-
$
|
|
1295
|
-
$
|
|
1296
|
-
$
|
|
1297
|
-
$
|
|
1298
|
-
$
|
|
1299
|
-
$
|
|
1300
|
-
$
|
|
1301
|
-
$
|
|
1302
|
-
$
|
|
1303
|
-
$
|
|
1304
|
-
$
|
|
1305
|
-
$
|
|
1306
|
-
$
|
|
1307
|
-
$
|
|
1308
|
-
$
|
|
1309
|
-
$
|
|
1310
|
-
$
|
|
1311
|
-
$
|
|
1312
|
-
$
|
|
1313
|
-
$
|
|
1314
|
-
$
|
|
1315
|
-
$
|
|
1316
|
-
$
|
|
1347
|
+
$390e54f620492c70$export$f680877a34711e37 as F,
|
|
1348
|
+
$2add3ce32c6007eb$export$9ac100e40613ea10 as G,
|
|
1349
|
+
$a4e76a5424781910$export$e08e3b67e392101e as H,
|
|
1350
|
+
$2add3ce32c6007eb$export$78551043582a6a98 as I,
|
|
1351
|
+
$8f5a2122b0992be3$export$b9b3dfddab17db27 as J,
|
|
1352
|
+
$a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as K,
|
|
1353
|
+
$d1116acdf220c2da$export$13f3202a3e5ddd5 as L,
|
|
1354
|
+
$081cb5757e08788e$export$24490316f764c430 as M,
|
|
1355
|
+
$a92dc41f639950be$export$c2b7abe5d61ec696 as N,
|
|
1356
|
+
$a92dc41f639950be$export$525bc4921d56d4a as O,
|
|
1357
|
+
$b5c62b033c25b96d$export$29bf1b5f2c56cf63 as P,
|
|
1358
|
+
$a92dc41f639950be$export$cabe61c495ee3649 as Q,
|
|
1359
|
+
$b5c62b033c25b96d$export$60278871457622de as R,
|
|
1360
|
+
$b7115c395c64f7b5$export$4debdb1a3f0fa79e as S,
|
|
1361
|
+
$caaf0dd3060ed57c$export$95185d699e05d4d7 as T,
|
|
1362
|
+
$8296dad1a4c5e0dc$export$8f71654801c2f7cd as U,
|
|
1363
|
+
$d1116acdf220c2da$export$4c014de7c8940b4c as a,
|
|
1364
|
+
$3274bf1495747a7b$export$5add1d006293d136 as b,
|
|
1365
|
+
$bbaa08b3cd72f041$export$9d1611c77c2fe928 as c,
|
|
1366
|
+
$23f2114a1b82827e$export$e58f029f0fbfdb29 as d,
|
|
1367
|
+
$01b77f81d0f07f68$export$75b6ee27786ba447 as e,
|
|
1368
|
+
$a049562f99e7db0e$export$f9c6924e160136d1 as f,
|
|
1369
|
+
$01b77f81d0f07f68$export$b04be29aa201d4f5 as g,
|
|
1370
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c as h,
|
|
1371
|
+
$fe16bffc7a557bf0$export$7f54fc3180508a52 as i,
|
|
1372
|
+
$8f5a2122b0992be3$export$8397ddfc504fdb9a as j,
|
|
1373
|
+
$0beb20c9744a2065$export$8467354a121f1b9f as k,
|
|
1374
|
+
$390e54f620492c70$export$b4cc09c592e8fdb8 as l,
|
|
1375
|
+
$e969f22b6713ca4a$export$ae780daf29e6d456 as m,
|
|
1376
|
+
$0c4a58759813079a$export$4e328f61c538687f as n,
|
|
1377
|
+
$6a20a7989e6c817a$export$98658e8c59125e6a as o,
|
|
1378
|
+
$23f2114a1b82827e$export$4282f70798064fe0 as p,
|
|
1379
|
+
$23f2114a1b82827e$export$cd4e5573fbe2b576 as q,
|
|
1380
|
+
$d447af545b77c9f1$export$b204af158042fbac as r,
|
|
1381
|
+
$3b8b240c1bf84ab9$export$bebd5a1431fec25d as s,
|
|
1382
|
+
$3b8b240c1bf84ab9$export$4c063cf1350e6fed as t,
|
|
1383
|
+
$f192c2f16961cbe0$export$80f3e147d781571c as u,
|
|
1384
|
+
$d447af545b77c9f1$export$f21a1ffae260145a as v,
|
|
1385
|
+
$2add3ce32c6007eb$export$a11b0059900ceec8 as w,
|
|
1386
|
+
$2add3ce32c6007eb$export$6446a186d09e379e as x,
|
|
1387
|
+
$8f5a2122b0992be3$export$630ff653c5ada6a9 as y,
|
|
1388
|
+
$e8ac3c3f5d4bae7f$export$d6875122194c7b44 as z
|
|
1317
1389
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as $c7eafbbe1ea5834e$export$535bd6ca7f90a273 } from "./filterDOMProps.js";
|
|
2
2
|
import React__default, { useState, useEffect, useContext } from "react";
|
|
3
3
|
const $d805ff57cab8bee2$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
|
|
4
4
|
"Arab",
|
|
@@ -85,11 +85,41 @@ function $520a025cdb0d710d$export$188ec29ebc2bdc3a() {
|
|
|
85
85
|
return defaultLocale;
|
|
86
86
|
}
|
|
87
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
|
+
}
|
|
88
117
|
function $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7() {
|
|
89
118
|
let defaultLocale = $520a025cdb0d710d$export$188ec29ebc2bdc3a();
|
|
90
119
|
let context = useContext($2eb8e6d23f3d0cb0$var$I18nContext);
|
|
91
120
|
return context || defaultLocale;
|
|
92
121
|
}
|
|
93
122
|
export {
|
|
94
|
-
$2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 as
|
|
123
|
+
$2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 as $,
|
|
124
|
+
$2eb8e6d23f3d0cb0$export$a54013f0d02a8f82 as a
|
|
95
125
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const InfoCircleSmall = ({ size, ...props }) => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 18 18", fill: "currentColor", width: size || "18", height: size || "18", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M9,16 C5.13400675,16 2,12.8659932 2,9 C2,5.13400675 5.13400675,2 9,2 C12.8659932,2 16,5.13400675 16,9 C16,12.8659932 12.8659932,16 9,16 Z M9,15 C12.3137085,15 15,12.3137085 15,9 C15,5.6862915 12.3137085,3 9,3 C5.6862915,3 3,5.6862915 3,9 C3,12.3137085 5.6862915,15 9,15 Z M8,8 L10,8 L10,12 L11,13 L7,13 L8,12 L8,8.85714286 L7,8.85714286 L8,8 Z M9,5 C9.55228475,5 10,5.44771525 10,6 C10,6.55228475 9.55228475,7 9,7 C8.44771525,7 8,6.55228475 8,6 C8,5.44771525 8.44771525,5 9,5 Z" }));
|
|
3
|
+
InfoCircleSmall.displayName = "InfoCircleSmall";
|
|
4
|
+
var InfoCircleSmall_default = InfoCircleSmall;
|
|
5
|
+
export {
|
|
6
|
+
InfoCircleSmall_default as I
|
|
7
|
+
};
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, i as $fe16bffc7a557bf0$export$7f54fc3180508a52, j as $8f5a2122b0992be3$export$8397ddfc504fdb9a, d as $23f2114a1b82827e$export$e58f029f0fbfdb29, k as $0beb20c9744a2065$export$8467354a121f1b9f, l as $390e54f620492c70$export$b4cc09c592e8fdb8, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, m as $e969f22b6713ca4a$export$ae780daf29e6d456, n 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, a as $f39a9eba43920ace$export$86427a43e3e48ebb, f as $64fa3d84918910a7$export$4d86445c2cf5e3 } 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 $d3e0e05bdfcf66bd$export$c24727297075ec6a = /* @__PURE__ */ createContext(null);
|
|
292
|
+
const $3985021b0ad6602f$export$37fb8590cf2c088c = /* @__PURE__ */ createContext({});
|
|
293
|
+
let $3985021b0ad6602f$var$filterHoverProps = (props) => {
|
|
294
|
+
let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
|
|
295
|
+
return otherProps;
|
|
296
|
+
};
|
|
297
|
+
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Input(props, ref) {
|
|
298
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
299
|
+
let { hoverProps, isHovered } = $e969f22b6713ca4a$export$ae780daf29e6d456(props);
|
|
300
|
+
let { isFocused, isFocusVisible, focusProps } = $0c4a58759813079a$export$4e328f61c538687f({
|
|
301
|
+
isTextInput: true,
|
|
302
|
+
autoFocus: props.autoFocus
|
|
303
|
+
});
|
|
304
|
+
let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
|
|
305
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
306
|
+
...props,
|
|
307
|
+
values: {
|
|
308
|
+
isHovered,
|
|
309
|
+
isFocused,
|
|
310
|
+
isFocusVisible,
|
|
311
|
+
isDisabled: props.disabled || false,
|
|
312
|
+
isInvalid
|
|
313
|
+
},
|
|
314
|
+
defaultClassName: "react-aria-Input"
|
|
315
|
+
});
|
|
316
|
+
return /* @__PURE__ */ React__default.createElement("input", {
|
|
317
|
+
...$bbaa08b3cd72f041$export$9d1611c77c2fe928($3985021b0ad6602f$var$filterHoverProps(props), focusProps, hoverProps),
|
|
318
|
+
...renderProps,
|
|
319
|
+
ref,
|
|
320
|
+
"data-focused": isFocused || void 0,
|
|
321
|
+
"data-disabled": props.disabled || void 0,
|
|
322
|
+
"data-hovered": isHovered || void 0,
|
|
323
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
324
|
+
"data-invalid": isInvalid || void 0
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
export {
|
|
328
|
+
$fd2148440a13ec26$export$fc1a364ae1f3ff10 as $,
|
|
329
|
+
$191c9b6d48a0a4e2$export$294aa081a6c6f55d as a,
|
|
330
|
+
$860f7da480e22816$export$b8473d3665f3a75a as b,
|
|
331
|
+
$d3e0e05bdfcf66bd$export$c24727297075ec6a as c,
|
|
332
|
+
$3985021b0ad6602f$export$37fb8590cf2c088c as d,
|
|
333
|
+
$514c0188e459b4c0$export$9afb8bc826b033ea as e,
|
|
334
|
+
$ee014567cb39d3f0$export$ff05c3ac10437e03 as f,
|
|
335
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069 as g,
|
|
336
|
+
$fd2148440a13ec26$export$a763b9476acd3eb as h,
|
|
337
|
+
$fd2148440a13ec26$export$dad6ae84456c676a as i,
|
|
338
|
+
$fd2148440a13ec26$export$75ee7c75d68f5b0e as j,
|
|
339
|
+
$fd2148440a13ec26$export$aca958c65c314e6c as k,
|
|
340
|
+
$514c0188e459b4c0$export$5f1af8db9871e1d6 as l
|
|
341
|
+
};
|