@react-spectrum/label 3.6.2-nightly.3368 → 3.6.2-nightly.3378
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/main.css +1 -1
- package/dist/main.js +152 -168
- package/dist/main.js.map +1 -1
- package/dist/module.js +153 -169
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -14
- package/src/Field.tsx +11 -27
- package/src/Label.tsx +4 -4
- package/src/ReadOnlyField.tsx +0 -82
package/dist/module.js
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
import "./main.css";
|
2
2
|
import {useStyleProps as $6WzO6$useStyleProps, classNames as $6WzO6$classNames, useDOMRef as $6WzO6$useDOMRef} from "@react-spectrum/utils";
|
3
3
|
import {Flex as $6WzO6$Flex} from "@react-spectrum/layout";
|
4
|
-
import {mergeProps as $6WzO6$mergeProps, mergeRefs as $6WzO6$mergeRefs, filterDOMProps as $6WzO6$filterDOMProps
|
4
|
+
import {mergeProps as $6WzO6$mergeProps, mergeRefs as $6WzO6$mergeRefs, filterDOMProps as $6WzO6$filterDOMProps} from "@react-aria/utils";
|
5
5
|
import $6WzO6$react, {useCallback as $6WzO6$useCallback} from "react";
|
6
6
|
import {useFormProps as $6WzO6$useFormProps} from "@react-spectrum/form";
|
7
|
-
import {useMessageFormatter as $6WzO6$useMessageFormatter} from "@react-aria/i18n";
|
8
7
|
import $6WzO6$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
9
8
|
import $6WzO6$spectrumiconsuiAsterisk from "@spectrum-icons/ui/Asterisk";
|
9
|
+
import {useLocalizedStringFormatter as $6WzO6$useLocalizedStringFormatter} from "@react-aria/i18n";
|
10
10
|
import {useProviderProps as $6WzO6$useProviderProps} from "@react-spectrum/provider";
|
11
|
-
import {FocusRing as $6WzO6$FocusRing} from "@react-aria/focus";
|
12
|
-
import {useHover as $6WzO6$useHover} from "@react-aria/interactions";
|
13
11
|
|
14
12
|
function $parcel$interopDefault(a) {
|
15
13
|
return a && a.__esModule ? a.default : a;
|
@@ -70,141 +68,246 @@ function $8e50676506611310$var$HelpText(props, ref) {
|
|
70
68
|
*/ const $8e50676506611310$export$a67c0bc59081311a = /*#__PURE__*/ $6WzO6$react.forwardRef($8e50676506611310$var$HelpText);
|
71
69
|
|
72
70
|
|
71
|
+
|
72
|
+
|
73
|
+
|
73
74
|
var $79b4ff1b6ea94ffc$exports = {};
|
74
75
|
var $dfe96401c0c81db3$exports = {};
|
75
|
-
$dfe96401c0c81db3$exports =
|
76
|
+
$dfe96401c0c81db3$exports = {
|
77
|
+
"(optional)": `(اختياري)`,
|
78
|
+
"(required)": `(مطلوب)`
|
79
|
+
};
|
76
80
|
|
77
81
|
|
78
82
|
var $f504605657ece833$exports = {};
|
79
|
-
$f504605657ece833$exports =
|
83
|
+
$f504605657ece833$exports = {
|
84
|
+
"(optional)": `(незадължително)`,
|
85
|
+
"(required)": `(задължително)`
|
86
|
+
};
|
80
87
|
|
81
88
|
|
82
89
|
var $ed0ab9e7c53f9351$exports = {};
|
83
|
-
$ed0ab9e7c53f9351$exports =
|
90
|
+
$ed0ab9e7c53f9351$exports = {
|
91
|
+
"(optional)": `(volitelně)`,
|
92
|
+
"(required)": `(požadováno)`
|
93
|
+
};
|
84
94
|
|
85
95
|
|
86
96
|
var $59d9df99e04ee555$exports = {};
|
87
|
-
$59d9df99e04ee555$exports =
|
97
|
+
$59d9df99e04ee555$exports = {
|
98
|
+
"(optional)": `(valgfrit)`,
|
99
|
+
"(required)": `(obligatorisk)`
|
100
|
+
};
|
88
101
|
|
89
102
|
|
90
103
|
var $c5df0169c370d169$exports = {};
|
91
|
-
$c5df0169c370d169$exports =
|
104
|
+
$c5df0169c370d169$exports = {
|
105
|
+
"(optional)": `(optional)`,
|
106
|
+
"(required)": `(erforderlich)`
|
107
|
+
};
|
92
108
|
|
93
109
|
|
94
110
|
var $3c9af509a01a8d08$exports = {};
|
95
|
-
$3c9af509a01a8d08$exports =
|
111
|
+
$3c9af509a01a8d08$exports = {
|
112
|
+
"(optional)": `(προαιρετικό)`,
|
113
|
+
"(required)": `(απαιτείται)`
|
114
|
+
};
|
96
115
|
|
97
116
|
|
98
117
|
var $aa36476f91664a08$exports = {};
|
99
|
-
$aa36476f91664a08$exports =
|
118
|
+
$aa36476f91664a08$exports = {
|
119
|
+
"(required)": `(required)`,
|
120
|
+
"(optional)": `(optional)`
|
121
|
+
};
|
100
122
|
|
101
123
|
|
102
124
|
var $d96f2251ced25e45$exports = {};
|
103
|
-
$d96f2251ced25e45$exports =
|
125
|
+
$d96f2251ced25e45$exports = {
|
126
|
+
"(optional)": `(opcional)`,
|
127
|
+
"(required)": `(necesario)`
|
128
|
+
};
|
104
129
|
|
105
130
|
|
106
131
|
var $16ec4ffbd4b2ca4b$exports = {};
|
107
|
-
$16ec4ffbd4b2ca4b$exports =
|
132
|
+
$16ec4ffbd4b2ca4b$exports = {
|
133
|
+
"(optional)": `(valikuline)`,
|
134
|
+
"(required)": `(nõutav)`
|
135
|
+
};
|
108
136
|
|
109
137
|
|
110
138
|
var $60f372f660e937e4$exports = {};
|
111
|
-
$60f372f660e937e4$exports =
|
139
|
+
$60f372f660e937e4$exports = {
|
140
|
+
"(optional)": `(valinnainen)`,
|
141
|
+
"(required)": `(pakollinen)`
|
142
|
+
};
|
112
143
|
|
113
144
|
|
114
145
|
var $d87c5f1e899f6af1$exports = {};
|
115
|
-
$d87c5f1e899f6af1$exports =
|
146
|
+
$d87c5f1e899f6af1$exports = {
|
147
|
+
"(optional)": `(facultatif)`,
|
148
|
+
"(required)": `(requis)`
|
149
|
+
};
|
116
150
|
|
117
151
|
|
118
152
|
var $6899669fa63c7816$exports = {};
|
119
|
-
$6899669fa63c7816$exports =
|
153
|
+
$6899669fa63c7816$exports = {
|
154
|
+
"(optional)": `(אופציונלי)`,
|
155
|
+
"(required)": `(נדרש)`
|
156
|
+
};
|
120
157
|
|
121
158
|
|
122
159
|
var $3597d722a30a8081$exports = {};
|
123
|
-
$3597d722a30a8081$exports =
|
160
|
+
$3597d722a30a8081$exports = {
|
161
|
+
"(optional)": `(opcionalno)`,
|
162
|
+
"(required)": `(obvezno)`
|
163
|
+
};
|
124
164
|
|
125
165
|
|
126
166
|
var $3ef905a2ce0921cb$exports = {};
|
127
|
-
$3ef905a2ce0921cb$exports =
|
167
|
+
$3ef905a2ce0921cb$exports = {
|
168
|
+
"(optional)": `(opcionális)`,
|
169
|
+
"(required)": `(kötelező)`
|
170
|
+
};
|
128
171
|
|
129
172
|
|
130
173
|
var $e59d2e4af9ff1c28$exports = {};
|
131
|
-
$e59d2e4af9ff1c28$exports =
|
174
|
+
$e59d2e4af9ff1c28$exports = {
|
175
|
+
"(optional)": `(facoltativo)`,
|
176
|
+
"(required)": `(obbligatorio)`
|
177
|
+
};
|
132
178
|
|
133
179
|
|
134
180
|
var $422a7013ab2cb36d$exports = {};
|
135
|
-
$422a7013ab2cb36d$exports =
|
181
|
+
$422a7013ab2cb36d$exports = {
|
182
|
+
"(optional)": `(オプション)`,
|
183
|
+
"(required)": `(必須)`
|
184
|
+
};
|
136
185
|
|
137
186
|
|
138
187
|
var $a58a7ab9570c5a18$exports = {};
|
139
|
-
$a58a7ab9570c5a18$exports =
|
188
|
+
$a58a7ab9570c5a18$exports = {
|
189
|
+
"(optional)": `(선택 사항)`,
|
190
|
+
"(required)": `(필수 사항)`
|
191
|
+
};
|
140
192
|
|
141
193
|
|
142
194
|
var $24e660c5a5be82af$exports = {};
|
143
|
-
$24e660c5a5be82af$exports =
|
195
|
+
$24e660c5a5be82af$exports = {
|
196
|
+
"(optional)": `(pasirenkama)`,
|
197
|
+
"(required)": `(privaloma)`
|
198
|
+
};
|
144
199
|
|
145
200
|
|
146
201
|
var $a222e05de6d8dce8$exports = {};
|
147
|
-
$a222e05de6d8dce8$exports =
|
202
|
+
$a222e05de6d8dce8$exports = {
|
203
|
+
"(optional)": `(neobligāti)`,
|
204
|
+
"(required)": `(obligāti)`
|
205
|
+
};
|
148
206
|
|
149
207
|
|
150
208
|
var $524caea23ab94ad7$exports = {};
|
151
|
-
$524caea23ab94ad7$exports =
|
209
|
+
$524caea23ab94ad7$exports = {
|
210
|
+
"(optional)": `(valgfritt)`,
|
211
|
+
"(required)": `(obligatorisk)`
|
212
|
+
};
|
152
213
|
|
153
214
|
|
154
215
|
var $572079ed86210ca9$exports = {};
|
155
|
-
$572079ed86210ca9$exports =
|
216
|
+
$572079ed86210ca9$exports = {
|
217
|
+
"(optional)": `(optioneel)`,
|
218
|
+
"(required)": `(vereist)`
|
219
|
+
};
|
156
220
|
|
157
221
|
|
158
222
|
var $6a0777ee77a74b18$exports = {};
|
159
|
-
$6a0777ee77a74b18$exports =
|
223
|
+
$6a0777ee77a74b18$exports = {
|
224
|
+
"(optional)": `(opcjonalne)`,
|
225
|
+
"(required)": `(wymagane)`
|
226
|
+
};
|
160
227
|
|
161
228
|
|
162
229
|
var $ea0401974d81b469$exports = {};
|
163
|
-
$ea0401974d81b469$exports =
|
230
|
+
$ea0401974d81b469$exports = {
|
231
|
+
"(optional)": `(opcional)`,
|
232
|
+
"(required)": `(obrigatório)`
|
233
|
+
};
|
164
234
|
|
165
235
|
|
166
236
|
var $701d0854e4f18979$exports = {};
|
167
|
-
$701d0854e4f18979$exports =
|
237
|
+
$701d0854e4f18979$exports = {
|
238
|
+
"(optional)": `(opcional)`,
|
239
|
+
"(required)": `(obrigatório)`
|
240
|
+
};
|
168
241
|
|
169
242
|
|
170
243
|
var $dd9fccd10d0a4be3$exports = {};
|
171
|
-
$dd9fccd10d0a4be3$exports =
|
244
|
+
$dd9fccd10d0a4be3$exports = {
|
245
|
+
"(optional)": `(opţional)`,
|
246
|
+
"(required)": `(obligatoriu)`
|
247
|
+
};
|
172
248
|
|
173
249
|
|
174
250
|
var $3cd1eab3b0ecc980$exports = {};
|
175
|
-
$3cd1eab3b0ecc980$exports =
|
251
|
+
$3cd1eab3b0ecc980$exports = {
|
252
|
+
"(optional)": `(дополнительно)`,
|
253
|
+
"(required)": `(обязательно)`
|
254
|
+
};
|
176
255
|
|
177
256
|
|
178
257
|
var $d109f3d68ba24ffc$exports = {};
|
179
|
-
$d109f3d68ba24ffc$exports =
|
258
|
+
$d109f3d68ba24ffc$exports = {
|
259
|
+
"(optional)": `(nepovinné)`,
|
260
|
+
"(required)": `(povinné)`
|
261
|
+
};
|
180
262
|
|
181
263
|
|
182
264
|
var $6382c2117e9fd1b6$exports = {};
|
183
|
-
$6382c2117e9fd1b6$exports =
|
265
|
+
$6382c2117e9fd1b6$exports = {
|
266
|
+
"(optional)": `(opcijsko)`,
|
267
|
+
"(required)": `(obvezno)`
|
268
|
+
};
|
184
269
|
|
185
270
|
|
186
271
|
var $ba796dd79114e2d4$exports = {};
|
187
|
-
$ba796dd79114e2d4$exports =
|
272
|
+
$ba796dd79114e2d4$exports = {
|
273
|
+
"(optional)": `(opciono)`,
|
274
|
+
"(required)": `(obavezno)`
|
275
|
+
};
|
188
276
|
|
189
277
|
|
190
278
|
var $916521e9800ac46c$exports = {};
|
191
|
-
$916521e9800ac46c$exports =
|
279
|
+
$916521e9800ac46c$exports = {
|
280
|
+
"(optional)": `(valfritt)`,
|
281
|
+
"(required)": `(krävs)`
|
282
|
+
};
|
192
283
|
|
193
284
|
|
194
285
|
var $acd72b88f580fe64$exports = {};
|
195
|
-
$acd72b88f580fe64$exports =
|
286
|
+
$acd72b88f580fe64$exports = {
|
287
|
+
"(optional)": `(isteğe bağlı)`,
|
288
|
+
"(required)": `(gerekli)`
|
289
|
+
};
|
196
290
|
|
197
291
|
|
198
292
|
var $bd065904f1420f31$exports = {};
|
199
|
-
$bd065904f1420f31$exports =
|
293
|
+
$bd065904f1420f31$exports = {
|
294
|
+
"(optional)": `(необов’язково)`,
|
295
|
+
"(required)": `(обов’язково)`
|
296
|
+
};
|
200
297
|
|
201
298
|
|
202
299
|
var $0128cc194bc107bb$exports = {};
|
203
|
-
$0128cc194bc107bb$exports =
|
300
|
+
$0128cc194bc107bb$exports = {
|
301
|
+
"(optional)": `(可选)`,
|
302
|
+
"(required)": `(必填)`
|
303
|
+
};
|
204
304
|
|
205
305
|
|
206
306
|
var $c57738f6094a3d25$exports = {};
|
207
|
-
$c57738f6094a3d25$exports =
|
307
|
+
$c57738f6094a3d25$exports = {
|
308
|
+
"(optional)": `(選填)`,
|
309
|
+
"(required)": `(必填)`
|
310
|
+
};
|
208
311
|
|
209
312
|
|
210
313
|
$79b4ff1b6ea94ffc$exports = {
|
@@ -246,10 +349,6 @@ $79b4ff1b6ea94ffc$exports = {
|
|
246
349
|
|
247
350
|
|
248
351
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
352
|
var $cd231e464c886c86$exports = {};
|
254
353
|
|
255
354
|
$parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel", () => $cd231e464c886c86$export$493d18e796ae054, (v) => $cd231e464c886c86$export$493d18e796ae054 = v);
|
@@ -306,11 +405,11 @@ function $00af9ba397a66f43$var$Label(props, ref) {
|
|
306
405
|
let { children: children , labelPosition: labelPosition = 'top' , labelAlign: labelAlign = labelPosition === 'side' ? 'start' : null , isRequired: isRequired , necessityIndicator: necessityIndicator = isRequired != null ? 'icon' : null , includeNecessityIndicatorInAccessibilityName: includeNecessityIndicatorInAccessibilityName = false , htmlFor: htmlFor , for: labelFor , elementType: ElementType = 'label' , onClick: onClick , ...otherProps } = props;
|
307
406
|
let domRef = $6WzO6$useDOMRef(ref);
|
308
407
|
let { styleProps: styleProps } = $6WzO6$useStyleProps(otherProps);
|
309
|
-
let
|
310
|
-
let necessityLabel = isRequired ?
|
408
|
+
let stringFormatter = $6WzO6$useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($79b4ff1b6ea94ffc$exports)));
|
409
|
+
let necessityLabel = isRequired ? stringFormatter.format('(required)') : stringFormatter.format('(optional)');
|
311
410
|
let icon = /*#__PURE__*/ $6WzO6$react.createElement($6WzO6$spectrumiconsuiAsterisk, {
|
312
411
|
UNSAFE_className: $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)), 'spectrum-FieldLabel-requiredIcon'),
|
313
|
-
"aria-label": includeNecessityIndicatorInAccessibilityName ?
|
412
|
+
"aria-label": includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('(required)') : undefined
|
314
413
|
});
|
315
414
|
let labelClassNames = $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)), 'spectrum-FieldLabel', {
|
316
415
|
'spectrum-FieldLabel--positionSide': labelPosition === 'side',
|
@@ -334,125 +433,15 @@ let $00af9ba397a66f43$export$b04be29aa201d4f5 = /*#__PURE__*/ $6WzO6$react.forwa
|
|
334
433
|
|
335
434
|
|
336
435
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
var $c14528ddc146317f$exports = {};
|
341
|
-
|
342
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-input", () => $c14528ddc146317f$export$1ac009feb2b0bd0c, (v) => $c14528ddc146317f$export$1ac009feb2b0bd0c = v);
|
343
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield", () => $c14528ddc146317f$export$2c8a10299d8b3418, (v) => $c14528ddc146317f$export$2c8a10299d8b3418 = v);
|
344
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--quiet", () => $c14528ddc146317f$export$bffd5e3d61a81737, (v) => $c14528ddc146317f$export$bffd5e3d61a81737 = v);
|
345
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--readonly", () => $c14528ddc146317f$export$ed65520848a7d1ae, (v) => $c14528ddc146317f$export$ed65520848a7d1ae = v);
|
346
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--multiline", () => $c14528ddc146317f$export$9699f1c538a448a0, (v) => $c14528ddc146317f$export$9699f1c538a448a0 = v);
|
347
|
-
$parcel$export($c14528ddc146317f$exports, "is-placeholder", () => $c14528ddc146317f$export$e5b2f5233e4e5194, (v) => $c14528ddc146317f$export$e5b2f5233e4e5194 = v);
|
348
|
-
$parcel$export($c14528ddc146317f$exports, "is-hovered", () => $c14528ddc146317f$export$b8813cd5d7824ce7, (v) => $c14528ddc146317f$export$b8813cd5d7824ce7 = v);
|
349
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--valid", () => $c14528ddc146317f$export$c2abbc3f970170b7, (v) => $c14528ddc146317f$export$c2abbc3f970170b7 = v);
|
350
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--invalid", () => $c14528ddc146317f$export$58e50b10d30123df, (v) => $c14528ddc146317f$export$58e50b10d30123df = v);
|
351
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--loadable", () => $c14528ddc146317f$export$14fd30fea6f1348c, (v) => $c14528ddc146317f$export$14fd30fea6f1348c = v);
|
352
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-validationIcon", () => $c14528ddc146317f$export$cf0ead5b44db0da3, (v) => $c14528ddc146317f$export$cf0ead5b44db0da3 = v);
|
353
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-icon", () => $c14528ddc146317f$export$222d1ccd1870be1d, (v) => $c14528ddc146317f$export$222d1ccd1870be1d = v);
|
354
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-inputIcon", () => $c14528ddc146317f$export$c1cdcaa5fe76a871, (v) => $c14528ddc146317f$export$c1cdcaa5fe76a871 = v);
|
355
|
-
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-circleLoader", () => $c14528ddc146317f$export$82a249fb4d6127, (v) => $c14528ddc146317f$export$82a249fb4d6127 = v);
|
356
|
-
$parcel$export($c14528ddc146317f$exports, "is-focused", () => $c14528ddc146317f$export$e7dc768d35940237, (v) => $c14528ddc146317f$export$e7dc768d35940237 = v);
|
357
|
-
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
358
|
-
$parcel$export($c14528ddc146317f$exports, "is-disabled", () => $c14528ddc146317f$export$d35bc1e505d1ebbf, (v) => $c14528ddc146317f$export$d35bc1e505d1ebbf = v);
|
359
|
-
var $c14528ddc146317f$export$1ac009feb2b0bd0c;
|
360
|
-
var $c14528ddc146317f$export$2c8a10299d8b3418;
|
361
|
-
var $c14528ddc146317f$export$bffd5e3d61a81737;
|
362
|
-
var $c14528ddc146317f$export$ed65520848a7d1ae;
|
363
|
-
var $c14528ddc146317f$export$9699f1c538a448a0;
|
364
|
-
var $c14528ddc146317f$export$e5b2f5233e4e5194;
|
365
|
-
var $c14528ddc146317f$export$b8813cd5d7824ce7;
|
366
|
-
var $c14528ddc146317f$export$c2abbc3f970170b7;
|
367
|
-
var $c14528ddc146317f$export$58e50b10d30123df;
|
368
|
-
var $c14528ddc146317f$export$14fd30fea6f1348c;
|
369
|
-
var $c14528ddc146317f$export$cf0ead5b44db0da3;
|
370
|
-
var $c14528ddc146317f$export$222d1ccd1870be1d;
|
371
|
-
var $c14528ddc146317f$export$c1cdcaa5fe76a871;
|
372
|
-
var $c14528ddc146317f$export$82a249fb4d6127;
|
373
|
-
var $c14528ddc146317f$export$e7dc768d35940237;
|
374
|
-
var $c14528ddc146317f$export$f39a09f249340e2a;
|
375
|
-
var $c14528ddc146317f$export$d35bc1e505d1ebbf;
|
376
|
-
$c14528ddc146317f$export$1ac009feb2b0bd0c = "spectrum-Textfield-input_73bc77";
|
377
|
-
$c14528ddc146317f$export$2c8a10299d8b3418 = "spectrum-Textfield_73bc77";
|
378
|
-
$c14528ddc146317f$export$bffd5e3d61a81737 = "spectrum-Textfield--quiet_73bc77";
|
379
|
-
$c14528ddc146317f$export$ed65520848a7d1ae = "spectrum-Textfield--readonly_73bc77";
|
380
|
-
$c14528ddc146317f$export$9699f1c538a448a0 = "spectrum-Textfield--multiline_73bc77";
|
381
|
-
$c14528ddc146317f$export$e5b2f5233e4e5194 = "is-placeholder_73bc77";
|
382
|
-
$c14528ddc146317f$export$b8813cd5d7824ce7 = "is-hovered_73bc77";
|
383
|
-
$c14528ddc146317f$export$c2abbc3f970170b7 = "spectrum-Textfield--valid_73bc77";
|
384
|
-
$c14528ddc146317f$export$58e50b10d30123df = "spectrum-Textfield--invalid_73bc77";
|
385
|
-
$c14528ddc146317f$export$14fd30fea6f1348c = "spectrum-Textfield--loadable_73bc77";
|
386
|
-
$c14528ddc146317f$export$cf0ead5b44db0da3 = "spectrum-Textfield-validationIcon_73bc77";
|
387
|
-
$c14528ddc146317f$export$222d1ccd1870be1d = "spectrum-Textfield-icon_73bc77";
|
388
|
-
$c14528ddc146317f$export$c1cdcaa5fe76a871 = "spectrum-Textfield-inputIcon_73bc77";
|
389
|
-
$c14528ddc146317f$export$82a249fb4d6127 = "spectrum-Textfield-circleLoader_73bc77";
|
390
|
-
$c14528ddc146317f$export$e7dc768d35940237 = "is-focused_73bc77";
|
391
|
-
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
392
|
-
$c14528ddc146317f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
function $7eed1d699290e79c$var$ReadOnlyField(props, ref) {
|
399
|
-
props = $6WzO6$useFormProps(props);
|
400
|
-
let { isDisabled: isDisabled , readOnlyText: readOnlyText , inputProps: inputProps , autoFocus: autoFocus } = props;
|
401
|
-
delete inputProps.defaultValue;
|
402
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $6WzO6$useHover({
|
403
|
-
isDisabled: isDisabled
|
404
|
-
});
|
405
|
-
let onHeightChange = $6WzO6$useCallback(()=>{
|
406
|
-
let input = ref.current;
|
407
|
-
let prevAlignment = input.style.alignSelf;
|
408
|
-
input.style.alignSelf = 'start';
|
409
|
-
input.style.height = 'auto';
|
410
|
-
input.style.height = `${input.scrollHeight}px`;
|
411
|
-
input.style.alignSelf = prevAlignment;
|
412
|
-
}, [
|
413
|
-
ref
|
414
|
-
]);
|
415
|
-
$6WzO6$useLayoutEffect(()=>{
|
416
|
-
if (ref.current) onHeightChange();
|
417
|
-
}, [
|
418
|
-
onHeightChange,
|
419
|
-
readOnlyText,
|
420
|
-
ref
|
421
|
-
]);
|
422
|
-
return(/*#__PURE__*/ $6WzO6$react.createElement("div", {
|
423
|
-
className: $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'spectrum-Textfield', {
|
424
|
-
'spectrum-Textfield--quiet': true,
|
425
|
-
'spectrum-Textfield--readonly': true
|
426
|
-
})
|
427
|
-
}, /*#__PURE__*/ $6WzO6$react.createElement($6WzO6$FocusRing, {
|
428
|
-
focusRingClass: $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'focus-ring'),
|
429
|
-
isTextInput: true,
|
430
|
-
autoFocus: autoFocus
|
431
|
-
}, /*#__PURE__*/ $6WzO6$react.createElement("textarea", {
|
432
|
-
...$6WzO6$mergeProps(inputProps, hoverProps),
|
433
|
-
rows: 1,
|
434
|
-
ref: ref,
|
435
|
-
value: readOnlyText,
|
436
|
-
className: $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'spectrum-Textfield-input', {
|
437
|
-
'is-hovered': isHovered
|
438
|
-
})
|
439
|
-
}))));
|
440
|
-
}
|
441
|
-
let $7eed1d699290e79c$export$18fbc9a75a2c46ae = /*#__PURE__*/ $6WzO6$react.forwardRef($7eed1d699290e79c$var$ReadOnlyField);
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
436
|
function $b7ca5b4454a2009d$var$Field(props, ref) {
|
447
437
|
props = $6WzO6$useFormProps(props);
|
448
|
-
let { label: label , labelPosition: labelPosition = 'top' , labelAlign: labelAlign , isRequired: isRequired , necessityIndicator: necessityIndicator , includeNecessityIndicatorInAccessibilityName: includeNecessityIndicatorInAccessibilityName , validationState: validationState , description: description , errorMessage: errorMessage , isDisabled: isDisabled , showErrorIcon: showErrorIcon , children: children , labelProps: labelProps ,
|
438
|
+
let { label: label , labelPosition: labelPosition = 'top' , labelAlign: labelAlign , isRequired: isRequired , necessityIndicator: necessityIndicator , includeNecessityIndicatorInAccessibilityName: includeNecessityIndicatorInAccessibilityName , validationState: validationState , description: description , errorMessage: errorMessage , isDisabled: isDisabled , showErrorIcon: showErrorIcon , children: children , labelProps: labelProps , descriptionProps: // Not every component that uses <Field> supports help text.
|
449
439
|
descriptionProps = {
|
450
440
|
} , errorMessageProps: errorMessageProps = {
|
451
441
|
} , elementType: elementType , wrapperClassName: wrapperClassName , ...otherProps } = props;
|
452
442
|
let { styleProps: styleProps } = $6WzO6$useStyleProps(otherProps);
|
453
443
|
let hasHelpText = !!description || errorMessage && validationState === 'invalid';
|
454
|
-
let
|
455
|
-
let displayReadOnly = isReadOnly && (readOnlyText || readOnlyText === '');
|
444
|
+
let mergedRefs = $b7ca5b4454a2009d$var$useMergeRefs(children.ref, ref);
|
456
445
|
if (label || hasHelpText) {
|
457
446
|
let labelWrapperClass = $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)), 'spectrum-Field', {
|
458
447
|
'spectrum-Field--positionTop': labelPosition === 'top',
|
@@ -471,19 +460,10 @@ function $b7ca5b4454a2009d$var$Field(props, ref) {
|
|
471
460
|
showErrorIcon: showErrorIcon
|
472
461
|
})
|
473
462
|
;
|
474
|
-
if (displayReadOnly) {
|
475
|
-
if (readOnlyText === '') readOnlyText = formatMessage('(None)');
|
476
|
-
children = /*#__PURE__*/ $6WzO6$react.createElement($7eed1d699290e79c$export$18fbc9a75a2c46ae, {
|
477
|
-
...props,
|
478
|
-
readOnlyText: readOnlyText,
|
479
|
-
inputProps: inputProps,
|
480
|
-
ref: inputRef
|
481
|
-
});
|
482
|
-
}
|
483
463
|
let renderChildren = ()=>/*#__PURE__*/ $6WzO6$react.createElement($6WzO6$Flex, {
|
484
464
|
direction: "column",
|
485
465
|
UNSAFE_className: $6WzO6$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)), 'spectrum-Field-wrapper')
|
486
|
-
}, children, hasHelpText &&
|
466
|
+
}, children, hasHelpText && renderHelpText())
|
487
467
|
;
|
488
468
|
return(/*#__PURE__*/ $6WzO6$react.createElement("div", {
|
489
469
|
...styleProps,
|
@@ -501,10 +481,14 @@ function $b7ca5b4454a2009d$var$Field(props, ref) {
|
|
501
481
|
}
|
502
482
|
return(/*#__PURE__*/ $6WzO6$react.cloneElement(children, $6WzO6$mergeProps(children.props, {
|
503
483
|
...styleProps,
|
504
|
-
|
505
|
-
ref: $6WzO6$mergeRefs(children.ref, ref)
|
484
|
+
ref: mergedRefs
|
506
485
|
})));
|
507
486
|
}
|
487
|
+
function $b7ca5b4454a2009d$var$useMergeRefs(...refs) {
|
488
|
+
return $6WzO6$useCallback($6WzO6$mergeRefs(...refs), [
|
489
|
+
...refs
|
490
|
+
]);
|
491
|
+
}
|
508
492
|
let $b7ca5b4454a2009d$export$a455218a85c89869 = /*#__PURE__*/ $6WzO6$react.forwardRef($b7ca5b4454a2009d$var$Field);
|
509
493
|
|
510
494
|
|