@wix/editor-react-components 1.2288.0 → 1.2290.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/AnimatedIcon/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +14 -1112
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- 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 +3 -117
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/Button/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 +5644 -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 +2 -4
- package/dist/site/components/Dropdown/manifest.js +1 -1
- package/dist/site/components/HTMLComponent/component.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 +1 -1
- 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 +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/Menu/manifest.js +1 -1
- package/dist/site/components/MultiStateBox/component.js +1 -1
- package/dist/site/components/MultiStateBox/manifest.js +1 -1
- 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 +1 -1
- package/dist/site/components/Tabs/component.js +1 -1
- package/dist/site/components/Tabs/manifest.js +1 -1
- package/dist/site/components/TextBox/component.js +2 -5
- 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/component.js +173 -465
- package/dist/site/components/TextInput/manifest.js +1 -1
- 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 +299 -0
- package/dist/site/components/chunks/DateField.js +6763 -0
- package/dist/site/components/chunks/DismissSmall.js +7 -0
- package/dist/site/components/chunks/Group.js +60 -101
- 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/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 +67 -17
- 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 +49 -14
- 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 +114 -46
- package/dist/site/components/chunks/constants33.js +154 -69
- package/dist/site/components/chunks/constants34.js +59 -81
- package/dist/site/components/chunks/constants35.js +73 -58
- package/dist/site/components/chunks/constants36.js +91 -0
- 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 +15 -9
- package/dist/site/components/chunks/manifestBase.js +1 -1
- package/dist/site/components/chunks/useFocusable.js +118 -0
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +122 -0
- package/dist/site/components/chunks/usePress.js +825 -0
- package/dist/site/components/chunks/utils.js +1 -1
- package/dist/site/components/extensions.js +59 -49
- package/package.json +4 -3
|
@@ -1,16 +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
|
-
import { $ as $
|
|
12
|
-
import {
|
|
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 { 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
|
+
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";
|
|
13
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
|
+
});
|
|
14
183
|
const ABORT_SIGNAL_TIMEOUT = 5e3;
|
|
15
184
|
function createTimeoutSignal(timeout) {
|
|
16
185
|
if (typeof AbortSignal.timeout === "function") {
|
|
@@ -394,467 +563,6 @@ const getPhoneFormatLengthValidationError = (phoneFormat, phoneFormatLengthValid
|
|
|
394
563
|
"{digits}",
|
|
395
564
|
`${phoneFormat ? phoneFormat.replace(/-/g, "").length : 0}`
|
|
396
565
|
);
|
|
397
|
-
const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
|
|
398
|
-
function $860f7da480e22816$export$b8473d3665f3a75a(props, state, ref) {
|
|
399
|
-
let { validationBehavior, focus } = props;
|
|
400
|
-
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
401
|
-
if (validationBehavior === "native" && (ref == null ? void 0 : ref.current) && !ref.current.disabled) {
|
|
402
|
-
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
|
|
403
|
-
ref.current.setCustomValidity(errorMessage);
|
|
404
|
-
if (!ref.current.hasAttribute("title")) ref.current.title = "";
|
|
405
|
-
if (!state.realtimeValidation.isInvalid) state.updateValidation($860f7da480e22816$var$getNativeValidity(ref.current));
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
let isIgnoredReset = useRef(false);
|
|
409
|
-
let onReset = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
410
|
-
if (!isIgnoredReset.current) state.resetValidation();
|
|
411
|
-
});
|
|
412
|
-
let onInvalid = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
413
|
-
var _a, _b;
|
|
414
|
-
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
415
|
-
let form = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.form;
|
|
416
|
-
if (!e.defaultPrevented && ref && form && $860f7da480e22816$var$getFirstInvalidInput(form) === ref.current) {
|
|
417
|
-
if (focus) focus();
|
|
418
|
-
else (_b = ref.current) == null ? void 0 : _b.focus();
|
|
419
|
-
$8f5a2122b0992be3$export$8397ddfc504fdb9a("keyboard");
|
|
420
|
-
}
|
|
421
|
-
e.preventDefault();
|
|
422
|
-
});
|
|
423
|
-
let onChange = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
424
|
-
state.commitValidation();
|
|
425
|
-
});
|
|
426
|
-
useEffect(() => {
|
|
427
|
-
let input2 = ref == null ? void 0 : ref.current;
|
|
428
|
-
if (!input2) return;
|
|
429
|
-
let form = input2.form;
|
|
430
|
-
let reset = form == null ? void 0 : form.reset;
|
|
431
|
-
if (form)
|
|
432
|
-
form.reset = () => {
|
|
433
|
-
isIgnoredReset.current = !window.event || window.event.type === "message" && $23f2114a1b82827e$export$e58f029f0fbfdb29(window.event) instanceof MessagePort;
|
|
434
|
-
reset == null ? void 0 : reset.call(form);
|
|
435
|
-
isIgnoredReset.current = false;
|
|
436
|
-
};
|
|
437
|
-
input2.addEventListener("invalid", onInvalid);
|
|
438
|
-
input2.addEventListener("change", onChange);
|
|
439
|
-
form == null ? void 0 : form.addEventListener("reset", onReset);
|
|
440
|
-
return () => {
|
|
441
|
-
input2.removeEventListener("invalid", onInvalid);
|
|
442
|
-
input2.removeEventListener("change", onChange);
|
|
443
|
-
form == null ? void 0 : form.removeEventListener("reset", onReset);
|
|
444
|
-
if (form)
|
|
445
|
-
form.reset = reset;
|
|
446
|
-
};
|
|
447
|
-
}, [
|
|
448
|
-
ref,
|
|
449
|
-
validationBehavior
|
|
450
|
-
]);
|
|
451
|
-
}
|
|
452
|
-
function $860f7da480e22816$var$getValidity(input2) {
|
|
453
|
-
let validity = input2.validity;
|
|
454
|
-
return {
|
|
455
|
-
badInput: validity.badInput,
|
|
456
|
-
customError: validity.customError,
|
|
457
|
-
patternMismatch: validity.patternMismatch,
|
|
458
|
-
rangeOverflow: validity.rangeOverflow,
|
|
459
|
-
rangeUnderflow: validity.rangeUnderflow,
|
|
460
|
-
stepMismatch: validity.stepMismatch,
|
|
461
|
-
tooLong: validity.tooLong,
|
|
462
|
-
tooShort: validity.tooShort,
|
|
463
|
-
typeMismatch: validity.typeMismatch,
|
|
464
|
-
valueMissing: validity.valueMissing,
|
|
465
|
-
valid: validity.valid
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
function $860f7da480e22816$var$getNativeValidity(input2) {
|
|
469
|
-
return {
|
|
470
|
-
isInvalid: !input2.validity.valid,
|
|
471
|
-
validationDetails: $860f7da480e22816$var$getValidity(input2),
|
|
472
|
-
validationErrors: input2.validationMessage ? [
|
|
473
|
-
input2.validationMessage
|
|
474
|
-
] : []
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function $860f7da480e22816$var$getFirstInvalidInput(form) {
|
|
478
|
-
var _a;
|
|
479
|
-
for (let i = 0; i < form.elements.length; i++) {
|
|
480
|
-
let element = form.elements[i];
|
|
481
|
-
if (((_a = element.validity) == null ? void 0 : _a.valid) === false) return element;
|
|
482
|
-
}
|
|
483
|
-
return null;
|
|
484
|
-
}
|
|
485
|
-
const $fd2148440a13ec26$export$aca958c65c314e6c = {
|
|
486
|
-
badInput: false,
|
|
487
|
-
customError: false,
|
|
488
|
-
patternMismatch: false,
|
|
489
|
-
rangeOverflow: false,
|
|
490
|
-
rangeUnderflow: false,
|
|
491
|
-
stepMismatch: false,
|
|
492
|
-
tooLong: false,
|
|
493
|
-
tooShort: false,
|
|
494
|
-
typeMismatch: false,
|
|
495
|
-
valueMissing: false,
|
|
496
|
-
valid: true
|
|
497
|
-
};
|
|
498
|
-
const $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE = {
|
|
499
|
-
...$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
500
|
-
customError: true,
|
|
501
|
-
valid: false
|
|
502
|
-
};
|
|
503
|
-
const $fd2148440a13ec26$export$dad6ae84456c676a = {
|
|
504
|
-
isInvalid: false,
|
|
505
|
-
validationDetails: $fd2148440a13ec26$export$aca958c65c314e6c,
|
|
506
|
-
validationErrors: []
|
|
507
|
-
};
|
|
508
|
-
const $fd2148440a13ec26$export$571b5131b7e65c11 = createContext({});
|
|
509
|
-
const $fd2148440a13ec26$export$a763b9476acd3eb = "__reactAriaFormValidationState";
|
|
510
|
-
function $fd2148440a13ec26$export$fc1a364ae1f3ff10(props) {
|
|
511
|
-
if (props[$fd2148440a13ec26$export$a763b9476acd3eb]) {
|
|
512
|
-
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$fd2148440a13ec26$export$a763b9476acd3eb];
|
|
513
|
-
return {
|
|
514
|
-
realtimeValidation,
|
|
515
|
-
displayValidation,
|
|
516
|
-
updateValidation,
|
|
517
|
-
resetValidation,
|
|
518
|
-
commitValidation
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
return $fd2148440a13ec26$var$useFormValidationStateImpl(props);
|
|
522
|
-
}
|
|
523
|
-
function $fd2148440a13ec26$var$useFormValidationStateImpl(props) {
|
|
524
|
-
let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
|
|
525
|
-
if (validationState) isInvalid || (isInvalid = validationState === "invalid");
|
|
526
|
-
let controlledError = isInvalid !== void 0 ? {
|
|
527
|
-
isInvalid,
|
|
528
|
-
validationErrors: [],
|
|
529
|
-
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
530
|
-
} : null;
|
|
531
|
-
let clientError = useMemo(() => {
|
|
532
|
-
if (!validate || value == null) return null;
|
|
533
|
-
let validateErrors = $fd2148440a13ec26$var$runValidate(validate, value);
|
|
534
|
-
return $fd2148440a13ec26$var$getValidationResult(validateErrors);
|
|
535
|
-
}, [
|
|
536
|
-
validate,
|
|
537
|
-
value
|
|
538
|
-
]);
|
|
539
|
-
if (builtinValidation == null ? void 0 : builtinValidation.validationDetails.valid) builtinValidation = void 0;
|
|
540
|
-
let serverErrors = useContext($fd2148440a13ec26$export$571b5131b7e65c11);
|
|
541
|
-
let serverErrorMessages = useMemo(() => {
|
|
542
|
-
if (name) return Array.isArray(name) ? name.flatMap((name2) => $fd2148440a13ec26$var$asArray(serverErrors[name2])) : $fd2148440a13ec26$var$asArray(serverErrors[name]);
|
|
543
|
-
return [];
|
|
544
|
-
}, [
|
|
545
|
-
serverErrors,
|
|
546
|
-
name
|
|
547
|
-
]);
|
|
548
|
-
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
|
|
549
|
-
let [isServerErrorCleared, setServerErrorCleared] = useState(false);
|
|
550
|
-
if (serverErrors !== lastServerErrors) {
|
|
551
|
-
setLastServerErrors(serverErrors);
|
|
552
|
-
setServerErrorCleared(false);
|
|
553
|
-
}
|
|
554
|
-
let serverError = useMemo(() => $fd2148440a13ec26$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
|
|
555
|
-
isServerErrorCleared,
|
|
556
|
-
serverErrorMessages
|
|
557
|
-
]);
|
|
558
|
-
let nextValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
559
|
-
let [currentValidity, setCurrentValidity] = useState($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
560
|
-
let lastError = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
561
|
-
let commitValidation = () => {
|
|
562
|
-
if (!commitQueued) return;
|
|
563
|
-
setCommitQueued(false);
|
|
564
|
-
let error = clientError || builtinValidation || nextValidation.current;
|
|
565
|
-
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
566
|
-
lastError.current = error;
|
|
567
|
-
setCurrentValidity(error);
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
let [commitQueued, setCommitQueued] = useState(false);
|
|
571
|
-
useEffect(commitValidation);
|
|
572
|
-
let realtimeValidation = controlledError || serverError || clientError || builtinValidation || $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
573
|
-
let displayValidation = validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity;
|
|
574
|
-
return {
|
|
575
|
-
realtimeValidation,
|
|
576
|
-
displayValidation,
|
|
577
|
-
updateValidation(value2) {
|
|
578
|
-
if (validationBehavior === "aria" && !$fd2148440a13ec26$var$isEqualValidation(currentValidity, value2)) setCurrentValidity(value2);
|
|
579
|
-
else nextValidation.current = value2;
|
|
580
|
-
},
|
|
581
|
-
resetValidation() {
|
|
582
|
-
let error = $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
583
|
-
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
584
|
-
lastError.current = error;
|
|
585
|
-
setCurrentValidity(error);
|
|
586
|
-
}
|
|
587
|
-
if (validationBehavior === "native") setCommitQueued(false);
|
|
588
|
-
setServerErrorCleared(true);
|
|
589
|
-
},
|
|
590
|
-
commitValidation() {
|
|
591
|
-
if (validationBehavior === "native") setCommitQueued(true);
|
|
592
|
-
setServerErrorCleared(true);
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function $fd2148440a13ec26$var$asArray(v) {
|
|
597
|
-
if (!v) return [];
|
|
598
|
-
return Array.isArray(v) ? v : [
|
|
599
|
-
v
|
|
600
|
-
];
|
|
601
|
-
}
|
|
602
|
-
function $fd2148440a13ec26$var$runValidate(validate, value) {
|
|
603
|
-
if (typeof validate === "function") {
|
|
604
|
-
let e = validate(value);
|
|
605
|
-
if (e && typeof e !== "boolean") return $fd2148440a13ec26$var$asArray(e);
|
|
606
|
-
}
|
|
607
|
-
return [];
|
|
608
|
-
}
|
|
609
|
-
function $fd2148440a13ec26$var$getValidationResult(errors) {
|
|
610
|
-
return errors.length ? {
|
|
611
|
-
isInvalid: true,
|
|
612
|
-
validationErrors: errors,
|
|
613
|
-
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
614
|
-
} : null;
|
|
615
|
-
}
|
|
616
|
-
function $fd2148440a13ec26$var$isEqualValidation(a, b) {
|
|
617
|
-
if (a === b) return true;
|
|
618
|
-
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);
|
|
619
|
-
}
|
|
620
|
-
function $191c9b6d48a0a4e2$export$294aa081a6c6f55d(props) {
|
|
621
|
-
let { description, errorMessage, isInvalid, validationState } = props;
|
|
622
|
-
let { labelProps, fieldProps } = $0beb20c9744a2065$export$8467354a121f1b9f(props);
|
|
623
|
-
let descriptionId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
624
|
-
Boolean(description),
|
|
625
|
-
Boolean(errorMessage),
|
|
626
|
-
isInvalid,
|
|
627
|
-
validationState
|
|
628
|
-
]);
|
|
629
|
-
let errorMessageId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
630
|
-
Boolean(description),
|
|
631
|
-
Boolean(errorMessage),
|
|
632
|
-
isInvalid,
|
|
633
|
-
validationState
|
|
634
|
-
]);
|
|
635
|
-
fieldProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(fieldProps, {
|
|
636
|
-
"aria-describedby": [
|
|
637
|
-
descriptionId,
|
|
638
|
-
// 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
|
|
639
|
-
errorMessageId,
|
|
640
|
-
props["aria-describedby"]
|
|
641
|
-
].filter(Boolean).join(" ") || void 0
|
|
642
|
-
});
|
|
643
|
-
return {
|
|
644
|
-
labelProps,
|
|
645
|
-
fieldProps,
|
|
646
|
-
descriptionProps: {
|
|
647
|
-
id: descriptionId
|
|
648
|
-
},
|
|
649
|
-
errorMessageProps: {
|
|
650
|
-
id: errorMessageId
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
function $054f71d2330da2e3$export$712718f7aec83d5(props, ref) {
|
|
655
|
-
let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, type = "text", validationBehavior = "aria" } = props;
|
|
656
|
-
let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || "", props.onChange);
|
|
657
|
-
let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
|
|
658
|
-
let validationState = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
|
|
659
|
-
...props,
|
|
660
|
-
value
|
|
661
|
-
});
|
|
662
|
-
let { isInvalid, validationErrors, validationDetails } = validationState.displayValidation;
|
|
663
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
|
|
664
|
-
...props,
|
|
665
|
-
isInvalid,
|
|
666
|
-
errorMessage: props.errorMessage || validationErrors
|
|
667
|
-
});
|
|
668
|
-
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
|
|
669
|
-
labelable: true
|
|
670
|
-
});
|
|
671
|
-
const inputOnlyProps = {
|
|
672
|
-
type,
|
|
673
|
-
pattern: props.pattern
|
|
674
|
-
};
|
|
675
|
-
let [initialValue] = useState(value);
|
|
676
|
-
$3274bf1495747a7b$export$5add1d006293d136(ref, props.defaultValue ?? initialValue, setValue);
|
|
677
|
-
$860f7da480e22816$export$b8473d3665f3a75a(props, validationState, ref);
|
|
678
|
-
return {
|
|
679
|
-
labelProps,
|
|
680
|
-
inputProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, inputElementType === "input" ? inputOnlyProps : void 0, {
|
|
681
|
-
disabled: isDisabled,
|
|
682
|
-
readOnly: isReadOnly,
|
|
683
|
-
required: isRequired && validationBehavior === "native",
|
|
684
|
-
"aria-required": isRequired && validationBehavior === "aria" || void 0,
|
|
685
|
-
"aria-invalid": isInvalid || void 0,
|
|
686
|
-
"aria-errormessage": props["aria-errormessage"],
|
|
687
|
-
"aria-activedescendant": props["aria-activedescendant"],
|
|
688
|
-
"aria-autocomplete": props["aria-autocomplete"],
|
|
689
|
-
"aria-haspopup": props["aria-haspopup"],
|
|
690
|
-
"aria-controls": props["aria-controls"],
|
|
691
|
-
value,
|
|
692
|
-
onChange: (e) => setValue($23f2114a1b82827e$export$e58f029f0fbfdb29(e).value),
|
|
693
|
-
autoComplete: props.autoComplete,
|
|
694
|
-
autoCapitalize: props.autoCapitalize,
|
|
695
|
-
maxLength: props.maxLength,
|
|
696
|
-
minLength: props.minLength,
|
|
697
|
-
name: props.name,
|
|
698
|
-
form: props.form,
|
|
699
|
-
placeholder: props.placeholder,
|
|
700
|
-
inputMode: props.inputMode,
|
|
701
|
-
autoCorrect: props.autoCorrect,
|
|
702
|
-
spellCheck: props.spellCheck,
|
|
703
|
-
[parseInt(React__default.version, 10) >= 17 ? "enterKeyHint" : "enterkeyhint"]: props.enterKeyHint,
|
|
704
|
-
// Clipboard events
|
|
705
|
-
onCopy: props.onCopy,
|
|
706
|
-
onCut: props.onCut,
|
|
707
|
-
onPaste: props.onPaste,
|
|
708
|
-
// Composition events
|
|
709
|
-
onCompositionEnd: props.onCompositionEnd,
|
|
710
|
-
onCompositionStart: props.onCompositionStart,
|
|
711
|
-
onCompositionUpdate: props.onCompositionUpdate,
|
|
712
|
-
// Selection events
|
|
713
|
-
onSelect: props.onSelect,
|
|
714
|
-
// Input events
|
|
715
|
-
onBeforeInput: props.onBeforeInput,
|
|
716
|
-
onInput: props.onInput,
|
|
717
|
-
...focusableProps,
|
|
718
|
-
...fieldProps
|
|
719
|
-
}),
|
|
720
|
-
descriptionProps,
|
|
721
|
-
errorMessageProps,
|
|
722
|
-
isInvalid,
|
|
723
|
-
validationErrors,
|
|
724
|
-
validationDetails
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
const $514c0188e459b4c0$export$9afb8bc826b033ea = /* @__PURE__ */ createContext({});
|
|
728
|
-
const $ee014567cb39d3f0$export$ff05c3ac10437e03 = /* @__PURE__ */ createContext(null);
|
|
729
|
-
const $d3e0e05bdfcf66bd$export$c24727297075ec6a = /* @__PURE__ */ createContext(null);
|
|
730
|
-
const $3985021b0ad6602f$export$37fb8590cf2c088c = /* @__PURE__ */ createContext({});
|
|
731
|
-
let $3985021b0ad6602f$var$filterHoverProps = (props) => {
|
|
732
|
-
let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
|
|
733
|
-
return otherProps;
|
|
734
|
-
};
|
|
735
|
-
const $3985021b0ad6602f$export$f5b8910cec6cf069 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Input(props, ref) {
|
|
736
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
737
|
-
let { hoverProps, isHovered } = $e969f22b6713ca4a$export$ae780daf29e6d456(props);
|
|
738
|
-
let { isFocused, isFocusVisible, focusProps } = $0c4a58759813079a$export$4e328f61c538687f({
|
|
739
|
-
isTextInput: true,
|
|
740
|
-
autoFocus: props.autoFocus
|
|
741
|
-
});
|
|
742
|
-
let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
|
|
743
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
744
|
-
...props,
|
|
745
|
-
values: {
|
|
746
|
-
isHovered,
|
|
747
|
-
isFocused,
|
|
748
|
-
isFocusVisible,
|
|
749
|
-
isDisabled: props.disabled || false,
|
|
750
|
-
isInvalid
|
|
751
|
-
},
|
|
752
|
-
defaultClassName: "react-aria-Input"
|
|
753
|
-
});
|
|
754
|
-
return /* @__PURE__ */ React__default.createElement("input", {
|
|
755
|
-
...$bbaa08b3cd72f041$export$9d1611c77c2fe928($3985021b0ad6602f$var$filterHoverProps(props), focusProps, hoverProps),
|
|
756
|
-
...renderProps,
|
|
757
|
-
ref,
|
|
758
|
-
"data-focused": isFocused || void 0,
|
|
759
|
-
"data-disabled": props.disabled || void 0,
|
|
760
|
-
"data-hovered": isHovered || void 0,
|
|
761
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
762
|
-
"data-invalid": isInvalid || void 0
|
|
763
|
-
});
|
|
764
|
-
});
|
|
765
|
-
const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
|
|
766
|
-
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
|
|
767
|
-
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
|
|
768
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
769
|
-
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
770
|
-
var _props_validationBehavior, _ref;
|
|
771
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
772
|
-
let inputRef = useRef(null);
|
|
773
|
-
[props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
|
|
774
|
-
let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
775
|
-
let [inputElementType, setInputElementType] = useState("input");
|
|
776
|
-
let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $054f71d2330da2e3$export$712718f7aec83d5({
|
|
777
|
-
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
778
|
-
inputElementType,
|
|
779
|
-
label: label2,
|
|
780
|
-
validationBehavior
|
|
781
|
-
}, inputRef);
|
|
782
|
-
let inputOrTextAreaRef = useCallback((el) => {
|
|
783
|
-
inputRef.current = el;
|
|
784
|
-
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
|
|
785
|
-
}, [
|
|
786
|
-
inputRef
|
|
787
|
-
]);
|
|
788
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
789
|
-
...props,
|
|
790
|
-
values: {
|
|
791
|
-
isDisabled: props.isDisabled || false,
|
|
792
|
-
isInvalid: validation.isInvalid,
|
|
793
|
-
isReadOnly: props.isReadOnly || false,
|
|
794
|
-
isRequired: props.isRequired || false
|
|
795
|
-
},
|
|
796
|
-
defaultClassName: "react-aria-TextField"
|
|
797
|
-
});
|
|
798
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
799
|
-
global: true
|
|
800
|
-
});
|
|
801
|
-
delete DOMProps.id;
|
|
802
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
803
|
-
...DOMProps,
|
|
804
|
-
...renderProps,
|
|
805
|
-
ref,
|
|
806
|
-
slot: props.slot || void 0,
|
|
807
|
-
"data-disabled": props.isDisabled || void 0,
|
|
808
|
-
"data-invalid": validation.isInvalid || void 0,
|
|
809
|
-
"data-readonly": props.isReadOnly || void 0,
|
|
810
|
-
"data-required": props.isRequired || void 0
|
|
811
|
-
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
812
|
-
values: [
|
|
813
|
-
[
|
|
814
|
-
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
815
|
-
{
|
|
816
|
-
...labelProps,
|
|
817
|
-
ref: labelRef
|
|
818
|
-
}
|
|
819
|
-
],
|
|
820
|
-
[
|
|
821
|
-
$3985021b0ad6602f$export$37fb8590cf2c088c,
|
|
822
|
-
{
|
|
823
|
-
...inputProps,
|
|
824
|
-
ref: inputOrTextAreaRef
|
|
825
|
-
}
|
|
826
|
-
],
|
|
827
|
-
[
|
|
828
|
-
$216918bed6669f72$export$2dc6166a7e65358c,
|
|
829
|
-
{
|
|
830
|
-
...inputProps,
|
|
831
|
-
ref: inputOrTextAreaRef
|
|
832
|
-
}
|
|
833
|
-
],
|
|
834
|
-
[
|
|
835
|
-
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
836
|
-
{
|
|
837
|
-
role: "presentation",
|
|
838
|
-
isInvalid: validation.isInvalid,
|
|
839
|
-
isDisabled: props.isDisabled || false
|
|
840
|
-
}
|
|
841
|
-
],
|
|
842
|
-
[
|
|
843
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
844
|
-
{
|
|
845
|
-
slots: {
|
|
846
|
-
description: descriptionProps,
|
|
847
|
-
errorMessage: errorMessageProps
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
],
|
|
851
|
-
[
|
|
852
|
-
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
853
|
-
validation
|
|
854
|
-
]
|
|
855
|
-
]
|
|
856
|
-
}, renderProps.children));
|
|
857
|
-
});
|
|
858
566
|
const useSdkState = (componentId, key, defaultValue) => {
|
|
859
567
|
const $sig = useService(SdkStateDefinition).for(componentId).getSignal(key, defaultValue);
|
|
860
568
|
return [$sig.get(), (value) => $sig.set(value)];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { I as INTERACTIONS, D as DATA, C as CSS_PROPERTIES, b as DISPLAY_GROUPS, L as LAYOUT, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
|
|
2
|
-
import { D as DisplayNames, s as selectors } from "../chunks/
|
|
2
|
+
import { D as DisplayNames, s as selectors } from "../chunks/constants3.js";
|
|
3
3
|
import { g as getSelector } from "../chunks/manifest.js";
|
|
4
4
|
const manifest = {
|
|
5
5
|
id: "b8f7e3d2-4a5c-4e8f-9b2d-1c3e5f7a9b4d",
|