@wix/editor-react-components 1.2289.0 → 1.2291.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 +2 -2
- package/dist/site/components/AnimatedIcon/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +12 -10
- package/dist/site/components/AudioPlayer/manifest.js +2 -2
- package/dist/site/components/BoxContainer/component.js +1 -1
- package/dist/site/components/BoxContainer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +2 -2
- package/dist/site/components/Breadcrumbs/manifest.js +2 -2
- package/dist/site/components/Button/manifest.js +2 -2
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/CollapsibleText/manifest.js +2 -2
- package/dist/site/components/DatePicker/component.js +3290 -9827
- package/dist/site/components/DatePicker/manifest.js +1 -1
- package/dist/site/components/Dropdown/component.js +1 -1
- package/dist/site/components/Dropdown/manifest.js +2 -2
- package/dist/site/components/GoogleMap/manifest.js +1 -1
- package/dist/site/components/HTMLComponent/component.js +1 -1
- package/dist/site/components/HTMLComponent/manifest.js +1 -1
- package/dist/site/components/HipaaIcon/component.js +1 -1
- package/dist/site/components/HipaaIcon/manifest.js +1 -1
- package/dist/site/components/LinkBar/component.js +1 -1
- package/dist/site/components/LinkBar/manifest.js +2 -2
- package/dist/site/components/Logo/component.js +1 -1
- package/dist/site/components/Logo/manifest.js +1 -1
- package/dist/site/components/Logo/sdk.js +1 -1
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Lottie/manifest.js +2 -2
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/Menu/manifest.js +2 -2
- package/dist/site/components/MultiStateBox/component.js +1 -1
- package/dist/site/components/MultiStateBox/manifest.js +2 -2
- package/dist/site/components/ProgressBar/component.js +1 -1
- package/dist/site/components/ProgressBar/manifest.js +1 -1
- package/dist/site/components/ProgressBar/sdk.js +1 -1
- package/dist/site/components/Repeater/component.js +1 -1
- package/dist/site/components/Repeater/manifest.js +1 -1
- package/dist/site/components/ShareButtons/component.js +1 -1
- package/dist/site/components/ShareButtons/manifest.js +2 -2
- package/dist/site/components/Slideshow/manifest.js +1 -1
- package/dist/site/components/Tabs/component.js +1 -1
- package/dist/site/components/Tabs/manifest.js +2 -2
- package/dist/site/components/TestComp/manifest.js +1 -1
- package/dist/site/components/TextBox/component.js +1 -1
- package/dist/site/components/TextBox/manifest.js +1 -1
- package/dist/site/components/TextEffects3d/component.js +1 -1
- package/dist/site/components/TextEffects3d/manifest.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlass/component.js +1 -1
- package/dist/site/components/TextEffectsGlass/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlitch/component.js +1 -1
- package/dist/site/components/TextEffectsGlitch/manifest.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/manifest.js +1 -1
- package/dist/site/components/TextEffectsMatrix/component.js +1 -1
- package/dist/site/components/TextEffectsMatrix/manifest.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/manifest.js +1 -1
- package/dist/site/components/TextEffectsNoisy/component.js +1 -1
- package/dist/site/components/TextEffectsNoisy/manifest.js +1 -1
- package/dist/site/components/TextEffectsOutlineOut/component.js +2 -2
- package/dist/site/components/TextEffectsOutlineOut/manifest.js +1 -1
- package/dist/site/components/TextEffectsRetro/component.js +1 -1
- package/dist/site/components/TextEffectsRetro/manifest.js +1 -1
- package/dist/site/components/TextEffectsShook/component.js +1 -1
- package/dist/site/components/TextEffectsShook/manifest.js +1 -1
- package/dist/site/components/TextEffectsSticker/component.js +1 -1
- package/dist/site/components/TextEffectsSticker/manifest.js +2 -2
- package/dist/site/components/TextEffectsStriped/component.js +1 -1
- package/dist/site/components/TextEffectsStriped/manifest.js +1 -1
- package/dist/site/components/TextInput/TextInput.types.d.ts +3 -0
- package/dist/site/components/TextInput/component.js +190 -179
- package/dist/site/components/TextInput/component.preview.d.ts +4 -0
- package/dist/site/components/TextInput/constants.d.ts +27 -0
- package/dist/site/components/TextInput/css.css +36 -13
- package/dist/site/components/TextInput/manifest.js +103 -4
- package/dist/site/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +29 -0
- package/dist/site/components/TimePicker/component.d.ts +2 -0
- package/dist/site/components/TimePicker/component.js +146 -0
- package/dist/site/components/TimePicker/component.preview.d.ts +2 -0
- package/dist/site/components/TimePicker/components/TimePickerField.d.ts +4 -0
- package/dist/site/components/TimePicker/constants.d.ts +32 -0
- package/dist/site/components/TimePicker/css.css +64 -0
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +10 -0
- package/dist/site/components/TimePicker/index.d.ts +2 -0
- package/dist/site/components/TimePicker/index.js +6 -0
- package/dist/site/components/TimePicker/manifest.d.ts +5 -0
- package/dist/site/components/TimePicker/manifest.js +113 -0
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +15 -0
- package/dist/site/components/chunks/AnimatedIcon.js +1 -1
- package/dist/site/components/chunks/Button.js +1 -1
- package/dist/site/components/chunks/Button2.js +10 -829
- package/dist/site/components/chunks/DateField.js +6763 -0
- package/dist/site/components/chunks/Group.js +42 -155
- package/dist/site/components/chunks/I18nProvider.js +3 -3
- package/dist/site/components/chunks/Input.js +5 -5
- package/dist/site/components/chunks/Patterns.js +1 -1
- package/dist/site/components/chunks/TextEffectsShared.js +1 -1
- package/dist/site/components/chunks/constants10.js +14 -12
- package/dist/site/components/chunks/constants11.js +9 -9
- package/dist/site/components/chunks/constants12.js +10 -8
- package/dist/site/components/chunks/constants13.js +9 -13
- package/dist/site/components/chunks/constants14.js +14 -17
- package/dist/site/components/chunks/constants15.js +17 -12
- package/dist/site/components/chunks/constants16.js +11 -13
- package/dist/site/components/chunks/constants17.js +20 -66
- package/dist/site/components/chunks/constants18.js +66 -16
- package/dist/site/components/chunks/constants19.js +15 -50
- package/dist/site/components/chunks/constants2.js +30 -50
- package/dist/site/components/chunks/constants20.js +43 -45
- package/dist/site/components/chunks/constants21.js +48 -297
- package/dist/site/components/chunks/constants22.js +299 -41
- package/dist/site/components/chunks/constants23.js +44 -29
- package/dist/site/components/chunks/constants24.js +32 -17
- package/dist/site/components/chunks/constants25.js +16 -402
- package/dist/site/components/chunks/constants26.js +393 -73
- package/dist/site/components/chunks/constants27.js +80 -15
- package/dist/site/components/chunks/constants28.js +11 -42
- package/dist/site/components/chunks/constants29.js +44 -23
- package/dist/site/components/chunks/constants3.js +64 -13
- package/dist/site/components/chunks/constants30.js +28 -10
- package/dist/site/components/chunks/constants31.js +10 -132
- package/dist/site/components/chunks/constants32.js +112 -147
- package/dist/site/components/chunks/constants33.js +152 -49
- package/dist/site/components/chunks/constants34.js +53 -71
- package/dist/site/components/chunks/constants35.js +73 -77
- package/dist/site/components/chunks/constants36.js +76 -57
- package/dist/site/components/chunks/constants37.js +72 -0
- package/dist/site/components/chunks/constants4.js +10 -19
- package/dist/site/components/chunks/constants5.js +14 -14
- package/dist/site/components/chunks/constants6.js +11 -10
- package/dist/site/components/chunks/constants7.js +14 -14
- package/dist/site/components/chunks/constants8.js +22 -65
- package/dist/site/components/chunks/constants9.js +65 -20
- package/dist/site/components/chunks/filterDOMProps.js +7 -7
- package/dist/site/components/chunks/manifestBase.js +1 -1
- package/dist/site/components/chunks/manifestSdkMixins.js +3 -3
- package/dist/site/components/chunks/useFocusable.js +118 -0
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +1 -1
- package/dist/site/components/chunks/usePress.js +825 -0
- package/dist/site/components/chunks/utils.js +1 -1
- package/dist/site/components/extensions.js +9 -4
- package/package.json +3 -3
|
@@ -1,17 +1,185 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, {
|
|
3
|
+
import React__default, { createContext, useState, useRef, useCallback, Component, createElement, Suspense, useContext } from "react";
|
|
4
4
|
import { c as clsx } from "../chunks/clsx.js";
|
|
5
5
|
import { E as EnvironmentDefinition } from "../chunks/index2.js";
|
|
6
6
|
import { b as getAccessibilityAttributes, H as HAS_CUSTOM_FOCUS_CLASSNAME } from "../chunks/a11y.js";
|
|
7
7
|
import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
8
|
-
import { s as selectors } from "../chunks/
|
|
8
|
+
import { s as selectors } from "../chunks/constants3.js";
|
|
9
9
|
import { useService } from "@wix/services-manager-react";
|
|
10
10
|
import { T as TranslationsDefinition } from "../chunks/index5.js";
|
|
11
11
|
import { $ as $fd2148440a13ec26$export$fc1a364ae1f3ff10, a as $191c9b6d48a0a4e2$export$294aa081a6c6f55d, b as $860f7da480e22816$export$b8473d3665f3a75a, c as $d3e0e05bdfcf66bd$export$c24727297075ec6a, d as $3985021b0ad6602f$export$37fb8590cf2c088c, e as $514c0188e459b4c0$export$9afb8bc826b033ea, f as $ee014567cb39d3f0$export$ff05c3ac10437e03, g as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../chunks/Input.js";
|
|
12
|
-
import {
|
|
12
|
+
import { a as $3e6197669829fe11$export$40bfa8c7b0832715, b as $3274bf1495747a7b$export$5add1d006293d136, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, d as $23f2114a1b82827e$export$e58f029f0fbfdb29, e as $01b77f81d0f07f68$export$75b6ee27786ba447, f as $a049562f99e7db0e$export$f9c6924e160136d1, g as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../chunks/Group.js";
|
|
13
13
|
import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$fabf2dc03a41866e, d as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, e as $64fa3d84918910a7$export$ef03459518577ad4, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "../chunks/filterDOMProps.js";
|
|
14
|
+
import { $ as $d1116acdf220c2da$export$4c014de7c8940b4c } from "../chunks/useFocusable.js";
|
|
14
15
|
import { S as SdkStateDefinition } from "../chunks/index6.js";
|
|
16
|
+
const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
|
|
17
|
+
function $054f71d2330da2e3$export$712718f7aec83d5(props, ref) {
|
|
18
|
+
let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, type = "text", validationBehavior = "aria" } = props;
|
|
19
|
+
let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || "", props.onChange);
|
|
20
|
+
let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
|
|
21
|
+
let validationState = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
|
|
22
|
+
...props,
|
|
23
|
+
value
|
|
24
|
+
});
|
|
25
|
+
let { isInvalid, validationErrors, validationDetails } = validationState.displayValidation;
|
|
26
|
+
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
|
|
27
|
+
...props,
|
|
28
|
+
isInvalid,
|
|
29
|
+
errorMessage: props.errorMessage || validationErrors
|
|
30
|
+
});
|
|
31
|
+
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
|
|
32
|
+
labelable: true
|
|
33
|
+
});
|
|
34
|
+
const inputOnlyProps = {
|
|
35
|
+
type,
|
|
36
|
+
pattern: props.pattern
|
|
37
|
+
};
|
|
38
|
+
let [initialValue] = useState(value);
|
|
39
|
+
$3274bf1495747a7b$export$5add1d006293d136(ref, props.defaultValue ?? initialValue, setValue);
|
|
40
|
+
$860f7da480e22816$export$b8473d3665f3a75a(props, validationState, ref);
|
|
41
|
+
return {
|
|
42
|
+
labelProps,
|
|
43
|
+
inputProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, inputElementType === "input" ? inputOnlyProps : void 0, {
|
|
44
|
+
disabled: isDisabled,
|
|
45
|
+
readOnly: isReadOnly,
|
|
46
|
+
required: isRequired && validationBehavior === "native",
|
|
47
|
+
"aria-required": isRequired && validationBehavior === "aria" || void 0,
|
|
48
|
+
"aria-invalid": isInvalid || void 0,
|
|
49
|
+
"aria-errormessage": props["aria-errormessage"],
|
|
50
|
+
"aria-activedescendant": props["aria-activedescendant"],
|
|
51
|
+
"aria-autocomplete": props["aria-autocomplete"],
|
|
52
|
+
"aria-haspopup": props["aria-haspopup"],
|
|
53
|
+
"aria-controls": props["aria-controls"],
|
|
54
|
+
value,
|
|
55
|
+
onChange: (e) => setValue($23f2114a1b82827e$export$e58f029f0fbfdb29(e).value),
|
|
56
|
+
autoComplete: props.autoComplete,
|
|
57
|
+
autoCapitalize: props.autoCapitalize,
|
|
58
|
+
maxLength: props.maxLength,
|
|
59
|
+
minLength: props.minLength,
|
|
60
|
+
name: props.name,
|
|
61
|
+
form: props.form,
|
|
62
|
+
placeholder: props.placeholder,
|
|
63
|
+
inputMode: props.inputMode,
|
|
64
|
+
autoCorrect: props.autoCorrect,
|
|
65
|
+
spellCheck: props.spellCheck,
|
|
66
|
+
[parseInt(React__default.version, 10) >= 17 ? "enterKeyHint" : "enterkeyhint"]: props.enterKeyHint,
|
|
67
|
+
// Clipboard events
|
|
68
|
+
onCopy: props.onCopy,
|
|
69
|
+
onCut: props.onCut,
|
|
70
|
+
onPaste: props.onPaste,
|
|
71
|
+
// Composition events
|
|
72
|
+
onCompositionEnd: props.onCompositionEnd,
|
|
73
|
+
onCompositionStart: props.onCompositionStart,
|
|
74
|
+
onCompositionUpdate: props.onCompositionUpdate,
|
|
75
|
+
// Selection events
|
|
76
|
+
onSelect: props.onSelect,
|
|
77
|
+
// Input events
|
|
78
|
+
onBeforeInput: props.onBeforeInput,
|
|
79
|
+
onInput: props.onInput,
|
|
80
|
+
...focusableProps,
|
|
81
|
+
...fieldProps
|
|
82
|
+
}),
|
|
83
|
+
descriptionProps,
|
|
84
|
+
errorMessageProps,
|
|
85
|
+
isInvalid,
|
|
86
|
+
validationErrors,
|
|
87
|
+
validationDetails
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
|
|
91
|
+
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
|
|
92
|
+
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
|
|
93
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
94
|
+
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
95
|
+
var _props_validationBehavior, _ref;
|
|
96
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
97
|
+
let inputRef = useRef(null);
|
|
98
|
+
[props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
|
|
99
|
+
let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
100
|
+
let [inputElementType, setInputElementType] = useState("input");
|
|
101
|
+
let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $054f71d2330da2e3$export$712718f7aec83d5({
|
|
102
|
+
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
103
|
+
inputElementType,
|
|
104
|
+
label: label2,
|
|
105
|
+
validationBehavior
|
|
106
|
+
}, inputRef);
|
|
107
|
+
let inputOrTextAreaRef = useCallback((el) => {
|
|
108
|
+
inputRef.current = el;
|
|
109
|
+
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
|
|
110
|
+
}, [
|
|
111
|
+
inputRef
|
|
112
|
+
]);
|
|
113
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
114
|
+
...props,
|
|
115
|
+
values: {
|
|
116
|
+
isDisabled: props.isDisabled || false,
|
|
117
|
+
isInvalid: validation.isInvalid,
|
|
118
|
+
isReadOnly: props.isReadOnly || false,
|
|
119
|
+
isRequired: props.isRequired || false
|
|
120
|
+
},
|
|
121
|
+
defaultClassName: "react-aria-TextField"
|
|
122
|
+
});
|
|
123
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
124
|
+
global: true
|
|
125
|
+
});
|
|
126
|
+
delete DOMProps.id;
|
|
127
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
128
|
+
...DOMProps,
|
|
129
|
+
...renderProps,
|
|
130
|
+
ref,
|
|
131
|
+
slot: props.slot || void 0,
|
|
132
|
+
"data-disabled": props.isDisabled || void 0,
|
|
133
|
+
"data-invalid": validation.isInvalid || void 0,
|
|
134
|
+
"data-readonly": props.isReadOnly || void 0,
|
|
135
|
+
"data-required": props.isRequired || void 0
|
|
136
|
+
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
137
|
+
values: [
|
|
138
|
+
[
|
|
139
|
+
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
140
|
+
{
|
|
141
|
+
...labelProps,
|
|
142
|
+
ref: labelRef
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
$3985021b0ad6602f$export$37fb8590cf2c088c,
|
|
147
|
+
{
|
|
148
|
+
...inputProps,
|
|
149
|
+
ref: inputOrTextAreaRef
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
[
|
|
153
|
+
$216918bed6669f72$export$2dc6166a7e65358c,
|
|
154
|
+
{
|
|
155
|
+
...inputProps,
|
|
156
|
+
ref: inputOrTextAreaRef
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
161
|
+
{
|
|
162
|
+
role: "presentation",
|
|
163
|
+
isInvalid: validation.isInvalid,
|
|
164
|
+
isDisabled: props.isDisabled || false
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
[
|
|
168
|
+
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
169
|
+
{
|
|
170
|
+
slots: {
|
|
171
|
+
description: descriptionProps,
|
|
172
|
+
errorMessage: errorMessageProps
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
178
|
+
validation
|
|
179
|
+
]
|
|
180
|
+
]
|
|
181
|
+
}, renderProps.children));
|
|
182
|
+
});
|
|
15
183
|
const ABORT_SIGNAL_TIMEOUT = 5e3;
|
|
16
184
|
function createTimeoutSignal(timeout) {
|
|
17
185
|
if (typeof AbortSignal.timeout === "function") {
|
|
@@ -395,173 +563,6 @@ const getPhoneFormatLengthValidationError = (phoneFormat, phoneFormatLengthValid
|
|
|
395
563
|
"{digits}",
|
|
396
564
|
`${phoneFormat ? phoneFormat.replace(/-/g, "").length : 0}`
|
|
397
565
|
);
|
|
398
|
-
const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
|
|
399
|
-
function $054f71d2330da2e3$export$712718f7aec83d5(props, ref) {
|
|
400
|
-
let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, type = "text", validationBehavior = "aria" } = props;
|
|
401
|
-
let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || "", props.onChange);
|
|
402
|
-
let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
|
|
403
|
-
let validationState = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
|
|
404
|
-
...props,
|
|
405
|
-
value
|
|
406
|
-
});
|
|
407
|
-
let { isInvalid, validationErrors, validationDetails } = validationState.displayValidation;
|
|
408
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
|
|
409
|
-
...props,
|
|
410
|
-
isInvalid,
|
|
411
|
-
errorMessage: props.errorMessage || validationErrors
|
|
412
|
-
});
|
|
413
|
-
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
|
|
414
|
-
labelable: true
|
|
415
|
-
});
|
|
416
|
-
const inputOnlyProps = {
|
|
417
|
-
type,
|
|
418
|
-
pattern: props.pattern
|
|
419
|
-
};
|
|
420
|
-
let [initialValue] = useState(value);
|
|
421
|
-
$3274bf1495747a7b$export$5add1d006293d136(ref, props.defaultValue ?? initialValue, setValue);
|
|
422
|
-
$860f7da480e22816$export$b8473d3665f3a75a(props, validationState, ref);
|
|
423
|
-
return {
|
|
424
|
-
labelProps,
|
|
425
|
-
inputProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, inputElementType === "input" ? inputOnlyProps : void 0, {
|
|
426
|
-
disabled: isDisabled,
|
|
427
|
-
readOnly: isReadOnly,
|
|
428
|
-
required: isRequired && validationBehavior === "native",
|
|
429
|
-
"aria-required": isRequired && validationBehavior === "aria" || void 0,
|
|
430
|
-
"aria-invalid": isInvalid || void 0,
|
|
431
|
-
"aria-errormessage": props["aria-errormessage"],
|
|
432
|
-
"aria-activedescendant": props["aria-activedescendant"],
|
|
433
|
-
"aria-autocomplete": props["aria-autocomplete"],
|
|
434
|
-
"aria-haspopup": props["aria-haspopup"],
|
|
435
|
-
"aria-controls": props["aria-controls"],
|
|
436
|
-
value,
|
|
437
|
-
onChange: (e) => setValue($23f2114a1b82827e$export$e58f029f0fbfdb29(e).value),
|
|
438
|
-
autoComplete: props.autoComplete,
|
|
439
|
-
autoCapitalize: props.autoCapitalize,
|
|
440
|
-
maxLength: props.maxLength,
|
|
441
|
-
minLength: props.minLength,
|
|
442
|
-
name: props.name,
|
|
443
|
-
form: props.form,
|
|
444
|
-
placeholder: props.placeholder,
|
|
445
|
-
inputMode: props.inputMode,
|
|
446
|
-
autoCorrect: props.autoCorrect,
|
|
447
|
-
spellCheck: props.spellCheck,
|
|
448
|
-
[parseInt(React__default.version, 10) >= 17 ? "enterKeyHint" : "enterkeyhint"]: props.enterKeyHint,
|
|
449
|
-
// Clipboard events
|
|
450
|
-
onCopy: props.onCopy,
|
|
451
|
-
onCut: props.onCut,
|
|
452
|
-
onPaste: props.onPaste,
|
|
453
|
-
// Composition events
|
|
454
|
-
onCompositionEnd: props.onCompositionEnd,
|
|
455
|
-
onCompositionStart: props.onCompositionStart,
|
|
456
|
-
onCompositionUpdate: props.onCompositionUpdate,
|
|
457
|
-
// Selection events
|
|
458
|
-
onSelect: props.onSelect,
|
|
459
|
-
// Input events
|
|
460
|
-
onBeforeInput: props.onBeforeInput,
|
|
461
|
-
onInput: props.onInput,
|
|
462
|
-
...focusableProps,
|
|
463
|
-
...fieldProps
|
|
464
|
-
}),
|
|
465
|
-
descriptionProps,
|
|
466
|
-
errorMessageProps,
|
|
467
|
-
isInvalid,
|
|
468
|
-
validationErrors,
|
|
469
|
-
validationDetails
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
|
|
473
|
-
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
|
|
474
|
-
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
|
|
475
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
476
|
-
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
477
|
-
var _props_validationBehavior, _ref;
|
|
478
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
479
|
-
let inputRef = useRef(null);
|
|
480
|
-
[props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
|
|
481
|
-
let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
482
|
-
let [inputElementType, setInputElementType] = useState("input");
|
|
483
|
-
let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $054f71d2330da2e3$export$712718f7aec83d5({
|
|
484
|
-
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
485
|
-
inputElementType,
|
|
486
|
-
label: label2,
|
|
487
|
-
validationBehavior
|
|
488
|
-
}, inputRef);
|
|
489
|
-
let inputOrTextAreaRef = useCallback((el) => {
|
|
490
|
-
inputRef.current = el;
|
|
491
|
-
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
|
|
492
|
-
}, [
|
|
493
|
-
inputRef
|
|
494
|
-
]);
|
|
495
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
496
|
-
...props,
|
|
497
|
-
values: {
|
|
498
|
-
isDisabled: props.isDisabled || false,
|
|
499
|
-
isInvalid: validation.isInvalid,
|
|
500
|
-
isReadOnly: props.isReadOnly || false,
|
|
501
|
-
isRequired: props.isRequired || false
|
|
502
|
-
},
|
|
503
|
-
defaultClassName: "react-aria-TextField"
|
|
504
|
-
});
|
|
505
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
506
|
-
global: true
|
|
507
|
-
});
|
|
508
|
-
delete DOMProps.id;
|
|
509
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
510
|
-
...DOMProps,
|
|
511
|
-
...renderProps,
|
|
512
|
-
ref,
|
|
513
|
-
slot: props.slot || void 0,
|
|
514
|
-
"data-disabled": props.isDisabled || void 0,
|
|
515
|
-
"data-invalid": validation.isInvalid || void 0,
|
|
516
|
-
"data-readonly": props.isReadOnly || void 0,
|
|
517
|
-
"data-required": props.isRequired || void 0
|
|
518
|
-
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
519
|
-
values: [
|
|
520
|
-
[
|
|
521
|
-
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
522
|
-
{
|
|
523
|
-
...labelProps,
|
|
524
|
-
ref: labelRef
|
|
525
|
-
}
|
|
526
|
-
],
|
|
527
|
-
[
|
|
528
|
-
$3985021b0ad6602f$export$37fb8590cf2c088c,
|
|
529
|
-
{
|
|
530
|
-
...inputProps,
|
|
531
|
-
ref: inputOrTextAreaRef
|
|
532
|
-
}
|
|
533
|
-
],
|
|
534
|
-
[
|
|
535
|
-
$216918bed6669f72$export$2dc6166a7e65358c,
|
|
536
|
-
{
|
|
537
|
-
...inputProps,
|
|
538
|
-
ref: inputOrTextAreaRef
|
|
539
|
-
}
|
|
540
|
-
],
|
|
541
|
-
[
|
|
542
|
-
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
543
|
-
{
|
|
544
|
-
role: "presentation",
|
|
545
|
-
isInvalid: validation.isInvalid,
|
|
546
|
-
isDisabled: props.isDisabled || false
|
|
547
|
-
}
|
|
548
|
-
],
|
|
549
|
-
[
|
|
550
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
551
|
-
{
|
|
552
|
-
slots: {
|
|
553
|
-
description: descriptionProps,
|
|
554
|
-
errorMessage: errorMessageProps
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
],
|
|
558
|
-
[
|
|
559
|
-
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
560
|
-
validation
|
|
561
|
-
]
|
|
562
|
-
]
|
|
563
|
-
}, renderProps.children));
|
|
564
|
-
});
|
|
565
566
|
const useSdkState = (componentId, key, defaultValue) => {
|
|
566
567
|
const $sig = useService(SdkStateDefinition).for(componentId).getSignal(key, defaultValue);
|
|
567
568
|
return [$sig.get(), (value) => $sig.set(value)];
|
|
@@ -584,7 +585,9 @@ const TextInput = (props, ref) => {
|
|
|
584
585
|
pattern,
|
|
585
586
|
autoComplete,
|
|
586
587
|
autoComplete_,
|
|
588
|
+
autocompleteToken,
|
|
587
589
|
maxLength,
|
|
590
|
+
minLength,
|
|
588
591
|
min,
|
|
589
592
|
max,
|
|
590
593
|
step,
|
|
@@ -623,6 +626,13 @@ const TextInput = (props, ref) => {
|
|
|
623
626
|
const [shouldShowValidityIndication, setValidityIndication] = React.useState(
|
|
624
627
|
sdkValidityIndication
|
|
625
628
|
);
|
|
629
|
+
const boundValue = props.value;
|
|
630
|
+
React.useEffect(() => {
|
|
631
|
+
if (boundValue !== void 0 && boundValue !== value) {
|
|
632
|
+
setValue(boundValue);
|
|
633
|
+
setSdkValue(boundValue);
|
|
634
|
+
}
|
|
635
|
+
}, [boundValue]);
|
|
626
636
|
const isTextInputAutoFillFixExperimentEnabled = isExperimentOpen(
|
|
627
637
|
"specs.thunderbolt.TextInputAutoFillFix"
|
|
628
638
|
);
|
|
@@ -671,9 +681,10 @@ const TextInput = (props, ref) => {
|
|
|
671
681
|
};
|
|
672
682
|
});
|
|
673
683
|
const valueChanged = React.useRef();
|
|
684
|
+
const activePhoneFormat = inputType === "tel" ? phoneFormat : "";
|
|
674
685
|
const formattedValue = React.useMemo(() => {
|
|
675
|
-
return
|
|
676
|
-
}, [value,
|
|
686
|
+
return activePhoneFormat ? formatPhoneNumber(value, activePhoneFormat) : value;
|
|
687
|
+
}, [value, activePhoneFormat]);
|
|
677
688
|
const handleAutoFillChange = (event) => {
|
|
678
689
|
if (isTextInputAutoFillFixExperimentEnabled && !hasFocus()) {
|
|
679
690
|
onChange({
|
|
@@ -687,11 +698,11 @@ const TextInput = (props, ref) => {
|
|
|
687
698
|
shouldCallOnInput
|
|
688
699
|
}) => (newValue) => {
|
|
689
700
|
let unformattedNumber = newValue;
|
|
690
|
-
if (
|
|
701
|
+
if (activePhoneFormat) {
|
|
691
702
|
const didDeleteChars = newValue.length < formattedValue.length;
|
|
692
703
|
unformattedNumber = getUnformattedNumber(
|
|
693
704
|
newValue,
|
|
694
|
-
|
|
705
|
+
activePhoneFormat,
|
|
695
706
|
didDeleteChars
|
|
696
707
|
);
|
|
697
708
|
if (hasNonNumericChar(unformattedNumber)) {
|
|
@@ -716,7 +727,7 @@ const TextInput = (props, ref) => {
|
|
|
716
727
|
}
|
|
717
728
|
if (shouldCallOnInput) {
|
|
718
729
|
const syntheticEvent = {
|
|
719
|
-
target: { value },
|
|
730
|
+
target: { value: unformattedNumber },
|
|
720
731
|
type: "input"
|
|
721
732
|
};
|
|
722
733
|
onInput(syntheticEvent);
|
|
@@ -770,12 +781,12 @@ const TextInput = (props, ref) => {
|
|
|
770
781
|
});
|
|
771
782
|
const getMaxLength = () => {
|
|
772
783
|
let updatedMaxLength = maxLength === null ? void 0 : maxLength;
|
|
773
|
-
if (
|
|
774
|
-
updatedMaxLength =
|
|
784
|
+
if (activePhoneFormat) {
|
|
785
|
+
updatedMaxLength = activePhoneFormat.length;
|
|
775
786
|
}
|
|
776
787
|
return updatedMaxLength;
|
|
777
788
|
};
|
|
778
|
-
const getMinLength = () =>
|
|
789
|
+
const getMinLength = () => activePhoneFormat ? activePhoneFormat.length : minLength ?? void 0;
|
|
779
790
|
const {
|
|
780
791
|
ariaAttributes: { "aria-label": ariaLabel, ...restAriaAttributes }
|
|
781
792
|
} = getAccessibilityAttributes({ ariaAttributes });
|
|
@@ -806,7 +817,7 @@ const TextInput = (props, ref) => {
|
|
|
806
817
|
pattern,
|
|
807
818
|
maxLength: getMaxLength(),
|
|
808
819
|
minLength: getMinLength(),
|
|
809
|
-
autoComplete: autoComplete ? "on" : autoComplete_ || "off",
|
|
820
|
+
autoComplete: autoComplete ? autocompleteToken || "on" : autoComplete_ || "off",
|
|
810
821
|
step: step === null ? void 0 : step,
|
|
811
822
|
min: min === null ? void 0 : min,
|
|
812
823
|
max: max === null ? void 0 : max,
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
export declare const selectors: {
|
|
2
2
|
readonly root: "textInput";
|
|
3
3
|
};
|
|
4
|
+
export declare const DesignStates: {
|
|
5
|
+
readonly root: {
|
|
6
|
+
readonly hover: {
|
|
7
|
+
readonly displayName: "Hover";
|
|
8
|
+
readonly className: "textInput--hover";
|
|
9
|
+
};
|
|
10
|
+
readonly focus: {
|
|
11
|
+
readonly displayName: "Focus";
|
|
12
|
+
readonly className: "textInput--focus";
|
|
13
|
+
};
|
|
14
|
+
readonly error: {
|
|
15
|
+
readonly displayName: "Error";
|
|
16
|
+
readonly className: "textInput--error";
|
|
17
|
+
};
|
|
18
|
+
readonly disabled: {
|
|
19
|
+
readonly displayName: "Disabled";
|
|
20
|
+
readonly className: "textInput--disabled";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
4
24
|
export declare const DisplayNames: {
|
|
5
25
|
root: {
|
|
6
26
|
elementDisplayName: string;
|
|
@@ -20,6 +40,12 @@ export declare const DisplayNames: {
|
|
|
20
40
|
inputAlign: string;
|
|
21
41
|
};
|
|
22
42
|
data: {
|
|
43
|
+
value: string;
|
|
44
|
+
isDisabled: string;
|
|
45
|
+
name: string;
|
|
46
|
+
minLength: string;
|
|
47
|
+
autocompleteToken: string;
|
|
48
|
+
numberSpinnerHidden: string;
|
|
23
49
|
labelDirection: string;
|
|
24
50
|
inputDirection: string;
|
|
25
51
|
inputType: string;
|
|
@@ -30,6 +56,7 @@ export declare const DisplayNames: {
|
|
|
30
56
|
phoneFormat: string;
|
|
31
57
|
label: string;
|
|
32
58
|
placeholder: string;
|
|
59
|
+
tooltip: string;
|
|
33
60
|
autoComplete: string;
|
|
34
61
|
readOnly: string;
|
|
35
62
|
required: string;
|
|
@@ -103,15 +103,15 @@
|
|
|
103
103
|
opacity: 0.6;
|
|
104
104
|
}
|
|
105
105
|
.root__zQlRz .input__fyTfx:hover {
|
|
106
|
-
background-color: #ffffff;
|
|
107
|
-
border-color: #a3d9f6;
|
|
108
|
-
border-width: 1px;
|
|
106
|
+
background-color: var(--hoverBackground, #ffffff);
|
|
107
|
+
border-color: var(--hoverBorderColor, #a3d9f6);
|
|
108
|
+
border-width: var(--hoverBorderWidth, 1px);
|
|
109
109
|
}
|
|
110
110
|
.root__zQlRz .input__fyTfx:disabled {
|
|
111
|
-
background-color: #f5f5f5;
|
|
112
|
-
color: #999;
|
|
113
|
-
border-color: #e3e3e3;
|
|
114
|
-
border-width: 1px;
|
|
111
|
+
background-color: var(--disabledBackground, #f5f5f5);
|
|
112
|
+
color: var(--disabledTextColor, #999);
|
|
113
|
+
border-color: var(--disabledBorderColor, #e3e3e3);
|
|
114
|
+
border-width: var(--disabledBorderWidth, 1px);
|
|
115
115
|
opacity: 0.6;
|
|
116
116
|
cursor: not-allowed;
|
|
117
117
|
}
|
|
@@ -128,9 +128,32 @@
|
|
|
128
128
|
padding-inline-end: calc(var(--textPaddingInlineEnd) + var(--prefixWidth));
|
|
129
129
|
}
|
|
130
130
|
.root__zQlRz:not(.validation-indication__QMvkt) .input__fyTfx:focus {
|
|
131
|
-
background-color: #ffffff;
|
|
132
|
-
border-color: #a3d9f6;
|
|
133
|
-
border-width: 1px;
|
|
131
|
+
background-color: var(--focusBackground, #ffffff);
|
|
132
|
+
border-color: var(--focusBorderColor, #a3d9f6);
|
|
133
|
+
border-width: var(--focusBorderWidth, 1px);
|
|
134
|
+
}
|
|
135
|
+
.root__zQlRz.textInput--hover .input__fyTfx {
|
|
136
|
+
background-color: var(--hoverBackground, #ffffff);
|
|
137
|
+
border-color: var(--hoverBorderColor, #a3d9f6);
|
|
138
|
+
border-width: var(--hoverBorderWidth, 1px);
|
|
139
|
+
}
|
|
140
|
+
.root__zQlRz.textInput--focus .input__fyTfx {
|
|
141
|
+
background-color: var(--focusBackground, #ffffff);
|
|
142
|
+
border-color: var(--focusBorderColor, #a3d9f6);
|
|
143
|
+
border-width: var(--focusBorderWidth, 1px);
|
|
144
|
+
}
|
|
145
|
+
.root__zQlRz.textInput--error .input__fyTfx {
|
|
146
|
+
background-color: var(--errorBackground, #ffffff);
|
|
147
|
+
border-color: var(--errorBorderColor, #e3e3e3);
|
|
148
|
+
border-width: var(--errorBorderWidth, 1px);
|
|
149
|
+
}
|
|
150
|
+
.root__zQlRz.textInput--disabled .input__fyTfx {
|
|
151
|
+
background-color: var(--disabledBackground, #f5f5f5);
|
|
152
|
+
color: var(--disabledTextColor, #999);
|
|
153
|
+
border-color: var(--disabledBorderColor, #e3e3e3);
|
|
154
|
+
border-width: var(--disabledBorderWidth, 1px);
|
|
155
|
+
opacity: 0.6;
|
|
156
|
+
cursor: not-allowed;
|
|
134
157
|
}
|
|
135
158
|
.root__zQlRz.validation-indication__QMvkt .input__fyTfx:invalid {
|
|
136
159
|
background-color: #ffffff;
|
|
@@ -162,7 +185,7 @@
|
|
|
162
185
|
color: var(--requiredTextColor);
|
|
163
186
|
}
|
|
164
187
|
.root__zQlRz.validationIndication__GE20D .input__fyTfx:invalid {
|
|
165
|
-
background-color: #ffffff;
|
|
166
|
-
border-color: #e3e3e3;
|
|
167
|
-
border-width: 1px;
|
|
188
|
+
background-color: var(--errorBackground, #ffffff);
|
|
189
|
+
border-color: var(--errorBorderColor, #e3e3e3);
|
|
190
|
+
border-width: var(--errorBorderWidth, 1px);
|
|
168
191
|
}
|