@wix/editor-react-components 1.2775.0 → 1.2776.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/AudioPlayer/component.js +5 -4
- package/dist/site/components/Breadcrumbs/component.js +1 -1
- package/dist/site/components/Button/component.js +1 -1
- package/dist/site/components/Checkbox/component.js +1 -1
- package/dist/site/components/CheckboxGroup/component.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/DatePicker/component.js +622 -7
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/RadioButtons/component.js +1 -1
- package/dist/site/components/Slideshow/component.js +1 -1
- package/dist/site/components/TextBox/component.js +1 -1
- package/dist/site/components/TextInput/component.js +3 -2
- package/dist/site/components/TextMarquee/component.js +6 -6
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +14 -39
- package/dist/site/components/TimePicker/component.js +81 -547
- package/dist/site/components/TimePicker/component.preview.d.ts +7 -2
- package/dist/site/components/TimePicker/components/TimePickerField.d.ts +1 -2
- package/dist/site/components/TimePicker/constants.d.ts +35 -68
- package/dist/site/components/TimePicker/css.css +17 -169
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +3 -5
- package/dist/site/components/TimePicker/manifest.js +246 -152
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +8 -8
- package/dist/site/components/chunks/Button.js +466 -1055
- package/dist/site/components/chunks/Button2.js +284 -471
- package/dist/site/components/chunks/DateField.js +51 -673
- package/dist/site/components/chunks/Group.js +46 -160
- package/dist/site/components/chunks/I18nProvider.js +1 -1
- package/dist/site/components/chunks/Input.js +2 -2
- package/dist/site/components/chunks/constants2.js +40 -70
- package/dist/site/components/chunks/filterDOMProps.js +13 -13
- package/dist/site/components/chunks/useFocusable.js +70 -0
- package/dist/site/components/chunks/usePress.js +825 -0
- package/package.json +2 -2
- package/dist/site/components/TimePicker/hooks/useTimeConstraints.d.ts +0 -8
- package/dist/site/components/chunks/VisuallyHidden.js +0 -47
- package/dist/site/components/chunks/{RequiredIndicator.js → useValidatedField.js} +19 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React__default, { useRef, useCallback, useEffect, useState,
|
|
2
|
-
import {
|
|
1
|
+
import React__default, { useRef, useCallback, useEffect, useState, useReducer, useMemo, createContext, forwardRef } from "react";
|
|
2
|
+
import { j 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
|
};
|
|
@@ -944,77 +944,6 @@ function $0c4a58759813079a$export$4e328f61c538687f(props = {}) {
|
|
|
944
944
|
focusProps: within ? focusWithinProps : focusProps
|
|
945
945
|
};
|
|
946
946
|
}
|
|
947
|
-
function $8dba16319206abb6$export$48d1ea6320830260(handler) {
|
|
948
|
-
if (!handler) return void 0;
|
|
949
|
-
let shouldStopPropagation = true;
|
|
950
|
-
return (e) => {
|
|
951
|
-
let event = {
|
|
952
|
-
...e,
|
|
953
|
-
preventDefault() {
|
|
954
|
-
e.preventDefault();
|
|
955
|
-
},
|
|
956
|
-
isDefaultPrevented() {
|
|
957
|
-
return e.isDefaultPrevented();
|
|
958
|
-
},
|
|
959
|
-
stopPropagation() {
|
|
960
|
-
if (shouldStopPropagation && process.env.NODE_ENV !== "production") console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
|
|
961
|
-
else shouldStopPropagation = true;
|
|
962
|
-
},
|
|
963
|
-
continuePropagation() {
|
|
964
|
-
shouldStopPropagation = false;
|
|
965
|
-
},
|
|
966
|
-
isPropagationStopped() {
|
|
967
|
-
return shouldStopPropagation;
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
handler(event);
|
|
971
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
function $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props) {
|
|
975
|
-
return {
|
|
976
|
-
keyboardProps: props.isDisabled ? {} : {
|
|
977
|
-
onKeyDown: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyDown),
|
|
978
|
-
onKeyUp: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyUp)
|
|
979
|
-
}
|
|
980
|
-
};
|
|
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
|
-
}
|
|
1018
947
|
function $b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref) {
|
|
1019
948
|
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
1020
949
|
if (context && context.ref && ref) {
|
|
@@ -1025,46 +954,6 @@ function $b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref) {
|
|
|
1025
954
|
}
|
|
1026
955
|
});
|
|
1027
956
|
}
|
|
1028
|
-
let $d1116acdf220c2da$export$f9762fab77588ecb = /* @__PURE__ */ React__default.createContext(null);
|
|
1029
|
-
function $d1116acdf220c2da$var$useFocusableContext(ref) {
|
|
1030
|
-
let context = useContext($d1116acdf220c2da$export$f9762fab77588ecb) || {};
|
|
1031
|
-
$b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref);
|
|
1032
|
-
let { ref: _, ...otherProps } = context;
|
|
1033
|
-
return otherProps;
|
|
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
|
-
});
|
|
1046
|
-
function $d1116acdf220c2da$export$4c014de7c8940b4c(props, domRef) {
|
|
1047
|
-
let { focusProps } = $1e74c67db218ce67$export$f8168d8dd8fd66e6(props);
|
|
1048
|
-
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props);
|
|
1049
|
-
let interactions = $bbaa08b3cd72f041$export$9d1611c77c2fe928(focusProps, keyboardProps);
|
|
1050
|
-
let domProps = $d1116acdf220c2da$var$useFocusableContext(domRef);
|
|
1051
|
-
let interactionProps = props.isDisabled ? {} : domProps;
|
|
1052
|
-
let autoFocusRef = useRef(props.autoFocus);
|
|
1053
|
-
useEffect(() => {
|
|
1054
|
-
if (autoFocusRef.current && domRef.current) $f192c2f16961cbe0$export$80f3e147d781571c(domRef.current);
|
|
1055
|
-
autoFocusRef.current = false;
|
|
1056
|
-
}, [
|
|
1057
|
-
domRef
|
|
1058
|
-
]);
|
|
1059
|
-
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
|
|
1060
|
-
if (props.isDisabled) tabIndex = void 0;
|
|
1061
|
-
return {
|
|
1062
|
-
focusableProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928({
|
|
1063
|
-
...interactions,
|
|
1064
|
-
tabIndex
|
|
1065
|
-
}, interactionProps)
|
|
1066
|
-
};
|
|
1067
|
-
}
|
|
1068
957
|
const $fe16bffc7a557bf0$var$useEarlyEffect = React__default["useInsertionEffect"] ?? $c4867b2f328c2698$export$e5c5a5f917a5871c;
|
|
1069
958
|
function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
|
|
1070
959
|
const ref = useRef(null);
|
|
@@ -1338,52 +1227,49 @@ const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /* @__PURE__ */ forwardRef(fun
|
|
|
1338
1227
|
}, renderProps.children);
|
|
1339
1228
|
});
|
|
1340
1229
|
export {
|
|
1341
|
-
$
|
|
1342
|
-
$
|
|
1343
|
-
$
|
|
1344
|
-
$
|
|
1345
|
-
$
|
|
1346
|
-
$
|
|
1347
|
-
$
|
|
1348
|
-
$
|
|
1349
|
-
$
|
|
1350
|
-
$
|
|
1351
|
-
$
|
|
1352
|
-
$
|
|
1353
|
-
$
|
|
1354
|
-
$
|
|
1355
|
-
$
|
|
1356
|
-
$
|
|
1357
|
-
$
|
|
1230
|
+
$a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as $,
|
|
1231
|
+
$0c4a58759813079a$export$4e328f61c538687f as A,
|
|
1232
|
+
$e969f22b6713ca4a$export$ae780daf29e6d456 as B,
|
|
1233
|
+
$8f5a2122b0992be3$export$8397ddfc504fdb9a as C,
|
|
1234
|
+
$0beb20c9744a2065$export$8467354a121f1b9f as D,
|
|
1235
|
+
$390e54f620492c70$export$b4cc09c592e8fdb8 as E,
|
|
1236
|
+
$081cb5757e08788e$export$24490316f764c430 as F,
|
|
1237
|
+
$a92dc41f639950be$export$c2b7abe5d61ec696 as G,
|
|
1238
|
+
$a92dc41f639950be$export$525bc4921d56d4a as H,
|
|
1239
|
+
$b5c62b033c25b96d$export$29bf1b5f2c56cf63 as I,
|
|
1240
|
+
$a92dc41f639950be$export$cabe61c495ee3649 as J,
|
|
1241
|
+
$1969ac565cfec8d0$export$de79e2c695e052f3 as K,
|
|
1242
|
+
$b5c62b033c25b96d$export$60278871457622de as L,
|
|
1243
|
+
$b7115c395c64f7b5$export$4debdb1a3f0fa79e as M,
|
|
1244
|
+
$caaf0dd3060ed57c$export$95185d699e05d4d7 as N,
|
|
1245
|
+
$a4e76a5424781910$export$e08e3b67e392101e as O,
|
|
1246
|
+
$1e74c67db218ce67$export$f8168d8dd8fd66e6 as P,
|
|
1358
1247
|
$23f2114a1b82827e$export$b4f377a2b6254582 as Q,
|
|
1359
|
-
$
|
|
1360
|
-
$
|
|
1361
|
-
$
|
|
1362
|
-
$
|
|
1363
|
-
$bbaa08b3cd72f041$export$9d1611c77c2fe928 as
|
|
1364
|
-
$
|
|
1365
|
-
$
|
|
1366
|
-
$
|
|
1367
|
-
$
|
|
1368
|
-
$
|
|
1369
|
-
$
|
|
1370
|
-
$
|
|
1371
|
-
$
|
|
1372
|
-
$
|
|
1373
|
-
$
|
|
1374
|
-
$
|
|
1375
|
-
$
|
|
1376
|
-
$2add3ce32c6007eb$export$
|
|
1377
|
-
$
|
|
1378
|
-
$
|
|
1379
|
-
$
|
|
1380
|
-
$
|
|
1381
|
-
$
|
|
1382
|
-
$
|
|
1383
|
-
$
|
|
1384
|
-
$
|
|
1385
|
-
$
|
|
1386
|
-
$a92dc41f639950be$export$cabe61c495ee3649 as x,
|
|
1387
|
-
$1969ac565cfec8d0$export$de79e2c695e052f3 as y,
|
|
1388
|
-
$b5c62b033c25b96d$export$60278871457622de as z
|
|
1248
|
+
$2add3ce32c6007eb$export$78551043582a6a98 as R,
|
|
1249
|
+
$01b77f81d0f07f68$export$b04be29aa201d4f5 as a,
|
|
1250
|
+
$3e6197669829fe11$export$40bfa8c7b0832715 as b,
|
|
1251
|
+
$3274bf1495747a7b$export$5add1d006293d136 as c,
|
|
1252
|
+
$bbaa08b3cd72f041$export$9d1611c77c2fe928 as d,
|
|
1253
|
+
$23f2114a1b82827e$export$e58f029f0fbfdb29 as e,
|
|
1254
|
+
$01b77f81d0f07f68$export$75b6ee27786ba447 as f,
|
|
1255
|
+
$a049562f99e7db0e$export$f9c6924e160136d1 as g,
|
|
1256
|
+
$6a20a7989e6c817a$export$98658e8c59125e6a as h,
|
|
1257
|
+
$23f2114a1b82827e$export$4282f70798064fe0 as i,
|
|
1258
|
+
$23f2114a1b82827e$export$cd4e5573fbe2b576 as j,
|
|
1259
|
+
$d447af545b77c9f1$export$b204af158042fbac as k,
|
|
1260
|
+
$3b8b240c1bf84ab9$export$bebd5a1431fec25d as l,
|
|
1261
|
+
$3b8b240c1bf84ab9$export$4c063cf1350e6fed as m,
|
|
1262
|
+
$f192c2f16961cbe0$export$80f3e147d781571c as n,
|
|
1263
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c as o,
|
|
1264
|
+
$d447af545b77c9f1$export$f21a1ffae260145a as p,
|
|
1265
|
+
$2add3ce32c6007eb$export$a11b0059900ceec8 as q,
|
|
1266
|
+
$2add3ce32c6007eb$export$6446a186d09e379e as r,
|
|
1267
|
+
$8f5a2122b0992be3$export$630ff653c5ada6a9 as s,
|
|
1268
|
+
$fe16bffc7a557bf0$export$7f54fc3180508a52 as t,
|
|
1269
|
+
$2add3ce32c6007eb$export$fedb369cb70207f1 as u,
|
|
1270
|
+
$48a7d519b337145d$export$4eaf04e54aa8eed6 as v,
|
|
1271
|
+
$2c9edc598a03d523$export$420e68273165f4ec as w,
|
|
1272
|
+
$390e54f620492c70$export$f680877a34711e37 as x,
|
|
1273
|
+
$e8ac3c3f5d4bae7f$export$d6875122194c7b44 as y,
|
|
1274
|
+
$2add3ce32c6007eb$export$9ac100e40613ea10 as z
|
|
1389
1275
|
};
|
|
@@ -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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as $c4867b2f328c2698$export$e5c5a5f917a5871c, t as $fe16bffc7a557bf0$export$7f54fc3180508a52, C as $8f5a2122b0992be3$export$8397ddfc504fdb9a, e as $23f2114a1b82827e$export$e58f029f0fbfdb29, D as $0beb20c9744a2065$export$8467354a121f1b9f, E as $390e54f620492c70$export$b4cc09c592e8fdb8, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, B as $e969f22b6713ca4a$export$ae780daf29e6d456, A as $0c4a58759813079a$export$4e328f61c538687f } from "./Group.js";
|
|
2
2
|
import React__default, { useRef, useEffect, useMemo, useContext, useState, createContext, forwardRef } from "react";
|
|
3
|
-
import {
|
|
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
4
|
function $860f7da480e22816$export$b8473d3665f3a75a(props, state, ref) {
|
|
5
5
|
let { validationBehavior, focus } = props;
|
|
6
6
|
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
@@ -1,70 +1,48 @@
|
|
|
1
|
+
const TEXT_PROP_STATIC_VALUE_MAX_LENGTH = 400;
|
|
1
2
|
const DisplayNames = {
|
|
2
3
|
root: {
|
|
3
4
|
elementDisplayName: "Time Picker",
|
|
4
5
|
data: {
|
|
5
6
|
value: "Selected time",
|
|
6
|
-
|
|
7
|
-
granularity: {
|
|
8
|
-
displayName: "Time precision",
|
|
9
|
-
options: {
|
|
10
|
-
hour: "Hours only",
|
|
11
|
-
minute: "Hours and minutes",
|
|
12
|
-
second: "Hours, minutes and seconds"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
hourCycle: {
|
|
16
|
-
displayName: "Hour format",
|
|
17
|
-
options: {
|
|
18
|
-
auto: "Auto (locale)",
|
|
19
|
-
h12: "12-hour",
|
|
20
|
-
h24: "24-hour"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
shouldForceLeadingZeros: "Always show leading zeros",
|
|
24
|
-
tooltip: "Tooltip",
|
|
7
|
+
onValueChange: "On Value Change",
|
|
25
8
|
label: "Label",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
maxTime: "Latest time (HH:MM)",
|
|
29
|
-
required: "Required",
|
|
9
|
+
helperText: "Helper text",
|
|
10
|
+
errorMessage: "Error message",
|
|
30
11
|
readOnly: "Read only",
|
|
31
|
-
disabled: "Disabled"
|
|
32
|
-
|
|
12
|
+
disabled: "Disabled"
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
value: "Value"
|
|
33
16
|
},
|
|
34
17
|
designStates: {
|
|
35
18
|
hover: "Hover",
|
|
36
19
|
focus: "Focus",
|
|
20
|
+
error: "Error",
|
|
37
21
|
disabled: "Disabled"
|
|
38
22
|
},
|
|
39
23
|
elements: {
|
|
40
24
|
label: "Label",
|
|
41
25
|
timeInput: "Time input",
|
|
42
|
-
|
|
26
|
+
helperText: "Helper text",
|
|
27
|
+
errorMessage: "Error message",
|
|
43
28
|
segment: "Segment"
|
|
44
29
|
},
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
presets: {
|
|
31
|
+
baseTimePicker: "Base Time Picker"
|
|
47
32
|
}
|
|
48
33
|
}
|
|
49
34
|
};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
disabled: false,
|
|
60
|
-
clearable: false
|
|
35
|
+
const Descriptions = {
|
|
36
|
+
component: "A time picker input. Visitors type a time into hour/minute segments or step them with arrow keys. The selected time is exposed as a local time value and can be connected to a data field.",
|
|
37
|
+
root: {
|
|
38
|
+
data: {
|
|
39
|
+
value: "This field’s current value. Connect it to your context to save the data your visitors provide. A value typed in this panel stays fixed.",
|
|
40
|
+
helperText: "A hint shown under this field, like a format example. It’s always visible, so keep it short.",
|
|
41
|
+
errorMessage: "The message shown when this field is invalid. Connect it to your context so it appears only when something’s wrong. A message typed in this panel always shows."
|
|
42
|
+
}
|
|
43
|
+
}
|
|
61
44
|
};
|
|
62
|
-
|
|
63
|
-
HourCycleValues2["Auto"] = "auto";
|
|
64
|
-
HourCycleValues2["H12"] = "12";
|
|
65
|
-
HourCycleValues2["H24"] = "24";
|
|
66
|
-
return HourCycleValues2;
|
|
67
|
-
})(HourCycleValues || {});
|
|
45
|
+
const PREVIEW_ERROR_MESSAGE = "Error message";
|
|
68
46
|
const DesignStates = {
|
|
69
47
|
timeInput: {
|
|
70
48
|
hover: {
|
|
@@ -75,9 +53,14 @@ const DesignStates = {
|
|
|
75
53
|
displayName: DisplayNames.root.designStates.focus,
|
|
76
54
|
className: "timePicker__group--focus"
|
|
77
55
|
},
|
|
56
|
+
error: {
|
|
57
|
+
displayName: DisplayNames.root.designStates.error,
|
|
58
|
+
className: "timePicker__group--error"
|
|
59
|
+
},
|
|
78
60
|
disabled: {
|
|
79
61
|
displayName: DisplayNames.root.designStates.disabled,
|
|
80
|
-
className: "timePicker__group--disabled"
|
|
62
|
+
className: "timePicker__group--disabled",
|
|
63
|
+
props: { disabled: true }
|
|
81
64
|
}
|
|
82
65
|
},
|
|
83
66
|
segment: {
|
|
@@ -87,45 +70,32 @@ const DesignStates = {
|
|
|
87
70
|
}
|
|
88
71
|
}
|
|
89
72
|
};
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const TranslationKeys = {
|
|
93
|
-
ariaLabel: "timePicker_aria_label",
|
|
94
|
-
clearButton: "timePicker_clear_button"
|
|
95
|
-
};
|
|
96
|
-
const DefaultTranslations = {
|
|
97
|
-
ariaLabel: "Time picker",
|
|
98
|
-
clearButton: "Clear"
|
|
73
|
+
const AriaLabels = {
|
|
74
|
+
root: { key: "TimePicker_AriaLabel", default: "Time picker" }
|
|
99
75
|
};
|
|
76
|
+
const DEFAULT_LOCALE = "en-US";
|
|
100
77
|
const TestIds = {
|
|
101
78
|
root: "timepicker-root",
|
|
102
79
|
group: "timepicker-group",
|
|
103
80
|
field: "timepicker-field",
|
|
104
|
-
|
|
105
|
-
tooltipButton: "timepicker-tooltip-button",
|
|
106
|
-
errorMessage: "timepicker-error-message",
|
|
107
|
-
requiredIndicator: "timepicker-required-indicator"
|
|
81
|
+
errorMessage: "timepicker-error-message"
|
|
108
82
|
};
|
|
109
83
|
const selectors = {
|
|
110
84
|
root: "timePicker",
|
|
111
85
|
label: "timePicker__label",
|
|
112
|
-
requiredIndicator: "timePicker__required-indicator",
|
|
113
86
|
group: "timePicker__group",
|
|
114
87
|
description: "timePicker__description",
|
|
115
88
|
segment: "timePicker__segment",
|
|
116
89
|
errorMessage: "timePicker__error-message"
|
|
117
90
|
};
|
|
118
|
-
const VALUE_MISSING_MESSAGE = "This field is required";
|
|
119
91
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
92
|
+
AriaLabels as A,
|
|
93
|
+
DesignStates as D,
|
|
94
|
+
PREVIEW_ERROR_MESSAGE as P,
|
|
123
95
|
TestIds as T,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
defaultValues as d,
|
|
129
|
-
DesignStates as e,
|
|
96
|
+
DEFAULT_LOCALE as a,
|
|
97
|
+
DisplayNames as b,
|
|
98
|
+
Descriptions as c,
|
|
99
|
+
TEXT_PROP_STATIC_VALUE_MAX_LENGTH as d,
|
|
130
100
|
selectors as s
|
|
131
101
|
};
|
|
@@ -465,19 +465,19 @@ function $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
|
465
465
|
return filteredProps;
|
|
466
466
|
}
|
|
467
467
|
export {
|
|
468
|
-
$
|
|
469
|
-
$
|
|
470
|
-
$64fa3d84918910a7$export$
|
|
471
|
-
$64fa3d84918910a7$export$
|
|
472
|
-
$64fa3d84918910a7$export$
|
|
473
|
-
$
|
|
474
|
-
$
|
|
475
|
-
$
|
|
476
|
-
$64fa3d84918910a7$export$
|
|
477
|
-
$
|
|
478
|
-
$
|
|
479
|
-
$
|
|
480
|
-
$
|
|
468
|
+
$8e9d2fae0ecb9001$export$457c3d6518dd4c6f as $,
|
|
469
|
+
$f39a9eba43920ace$export$86427a43e3e48ebb as a,
|
|
470
|
+
$64fa3d84918910a7$export$29f1550f4b0d4415 as b,
|
|
471
|
+
$64fa3d84918910a7$export$fabf2dc03a41866e as c,
|
|
472
|
+
$64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as d,
|
|
473
|
+
$64fa3d84918910a7$export$ef03459518577ad4 as e,
|
|
474
|
+
$64fa3d84918910a7$export$4d86445c2cf5e3 as f,
|
|
475
|
+
$65484d02dcb7eb3e$export$457c3d6518dd4c6f as g,
|
|
476
|
+
$64fa3d84918910a7$export$2881499e37b75b9a as h,
|
|
477
|
+
$df56164dff5785e2$export$4338b53315abf666 as i,
|
|
478
|
+
$c7eafbbe1ea5834e$export$619500959fc48b26 as j,
|
|
479
|
+
$c7eafbbe1ea5834e$export$535bd6ca7f90a273 as k,
|
|
480
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as l,
|
|
481
481
|
$f39a9eba43920ace$export$b5d7cc18bb8d2b59 as m,
|
|
482
482
|
$3ef42575df84b30b$export$9d1611c77c2fe928 as n,
|
|
483
483
|
$64fa3d84918910a7$export$c62b8e45d58ddad9 as o,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { P as $1e74c67db218ce67$export$f8168d8dd8fd66e6, d as $bbaa08b3cd72f041$export$9d1611c77c2fe928, n as $f192c2f16961cbe0$export$80f3e147d781571c, M as $b7115c395c64f7b5$export$4debdb1a3f0fa79e } from "./Group.js";
|
|
2
|
+
import React__default, { useRef, useEffect, useContext } from "react";
|
|
3
|
+
function $8dba16319206abb6$export$48d1ea6320830260(handler) {
|
|
4
|
+
if (!handler) return void 0;
|
|
5
|
+
let shouldStopPropagation = true;
|
|
6
|
+
return (e) => {
|
|
7
|
+
let event = {
|
|
8
|
+
...e,
|
|
9
|
+
preventDefault() {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
},
|
|
12
|
+
isDefaultPrevented() {
|
|
13
|
+
return e.isDefaultPrevented();
|
|
14
|
+
},
|
|
15
|
+
stopPropagation() {
|
|
16
|
+
if (shouldStopPropagation && process.env.NODE_ENV !== "production") console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
|
|
17
|
+
else shouldStopPropagation = true;
|
|
18
|
+
},
|
|
19
|
+
continuePropagation() {
|
|
20
|
+
shouldStopPropagation = false;
|
|
21
|
+
},
|
|
22
|
+
isPropagationStopped() {
|
|
23
|
+
return shouldStopPropagation;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
handler(event);
|
|
27
|
+
if (shouldStopPropagation) e.stopPropagation();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props) {
|
|
31
|
+
return {
|
|
32
|
+
keyboardProps: props.isDisabled ? {} : {
|
|
33
|
+
onKeyDown: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyDown),
|
|
34
|
+
onKeyUp: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyUp)
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let $d1116acdf220c2da$export$f9762fab77588ecb = /* @__PURE__ */ React__default.createContext(null);
|
|
39
|
+
function $d1116acdf220c2da$var$useFocusableContext(ref) {
|
|
40
|
+
let context = useContext($d1116acdf220c2da$export$f9762fab77588ecb) || {};
|
|
41
|
+
$b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref);
|
|
42
|
+
let { ref: _, ...otherProps } = context;
|
|
43
|
+
return otherProps;
|
|
44
|
+
}
|
|
45
|
+
function $d1116acdf220c2da$export$4c014de7c8940b4c(props, domRef) {
|
|
46
|
+
let { focusProps } = $1e74c67db218ce67$export$f8168d8dd8fd66e6(props);
|
|
47
|
+
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props);
|
|
48
|
+
let interactions = $bbaa08b3cd72f041$export$9d1611c77c2fe928(focusProps, keyboardProps);
|
|
49
|
+
let domProps = $d1116acdf220c2da$var$useFocusableContext(domRef);
|
|
50
|
+
let interactionProps = props.isDisabled ? {} : domProps;
|
|
51
|
+
let autoFocusRef = useRef(props.autoFocus);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (autoFocusRef.current && domRef.current) $f192c2f16961cbe0$export$80f3e147d781571c(domRef.current);
|
|
54
|
+
autoFocusRef.current = false;
|
|
55
|
+
}, [
|
|
56
|
+
domRef
|
|
57
|
+
]);
|
|
58
|
+
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
|
|
59
|
+
if (props.isDisabled) tabIndex = void 0;
|
|
60
|
+
return {
|
|
61
|
+
focusableProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928({
|
|
62
|
+
...interactions,
|
|
63
|
+
tabIndex
|
|
64
|
+
}, interactionProps)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
$d1116acdf220c2da$export$4c014de7c8940b4c as $,
|
|
69
|
+
$8296dad1a4c5e0dc$export$8f71654801c2f7cd as a
|
|
70
|
+
};
|