@react-aria/searchfield 3.4.4 → 3.5.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.
Files changed (2) hide show
  1. package/dist/import.mjs +328 -0
  2. package/package.json +15 -10
@@ -0,0 +1,328 @@
1
+ import {chain as $2Ol32$chain} from "@react-aria/utils";
2
+ import {useLocalizedStringFormatter as $2Ol32$useLocalizedStringFormatter} from "@react-aria/i18n";
3
+ import {useTextField as $2Ol32$useTextField} from "@react-aria/textfield";
4
+
5
+ function $parcel$interopDefault(a) {
6
+ return a && a.__esModule ? a.default : a;
7
+ }
8
+ /*
9
+ * Copyright 2020 Adobe. All rights reserved.
10
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License. You may obtain a copy
12
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software distributed under
15
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
16
+ * OF ANY KIND, either express or implied. See the License for the specific language
17
+ * governing permissions and limitations under the License.
18
+ */ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+ var $ad5aea03cc53c961$exports = {};
30
+ var $03c9a1a10de12f06$exports = {};
31
+ $03c9a1a10de12f06$exports = {
32
+ "Clear search": `مسح البحث`
33
+ };
34
+
35
+
36
+ var $4da0c2ffa4ba4159$exports = {};
37
+ $4da0c2ffa4ba4159$exports = {
38
+ "Clear search": `Изчистване на търсене`
39
+ };
40
+
41
+
42
+ var $8c59fd0c2c96821b$exports = {};
43
+ $8c59fd0c2c96821b$exports = {
44
+ "Clear search": `Vymazat hledání`
45
+ };
46
+
47
+
48
+ var $0a371f9c1df8120f$exports = {};
49
+ $0a371f9c1df8120f$exports = {
50
+ "Clear search": `Ryd søgning`
51
+ };
52
+
53
+
54
+ var $67f4d0b0de9f8a52$exports = {};
55
+ $67f4d0b0de9f8a52$exports = {
56
+ "Clear search": `Suche zurücksetzen`
57
+ };
58
+
59
+
60
+ var $72a312d948f0214b$exports = {};
61
+ $72a312d948f0214b$exports = {
62
+ "Clear search": `Απαλοιφή αναζήτησης`
63
+ };
64
+
65
+
66
+ var $5012d21d933388c1$exports = {};
67
+ $5012d21d933388c1$exports = {
68
+ "Clear search": `Clear search`
69
+ };
70
+
71
+
72
+ var $0159854399308e2e$exports = {};
73
+ $0159854399308e2e$exports = {
74
+ "Clear search": `Borrar búsqueda`
75
+ };
76
+
77
+
78
+ var $390613981d970276$exports = {};
79
+ $390613981d970276$exports = {
80
+ "Clear search": `Tühjenda otsing`
81
+ };
82
+
83
+
84
+ var $961ae0833f811705$exports = {};
85
+ $961ae0833f811705$exports = {
86
+ "Clear search": `Tyhjennä haku`
87
+ };
88
+
89
+
90
+ var $26d76742decfd829$exports = {};
91
+ $26d76742decfd829$exports = {
92
+ "Clear search": `Effacer la recherche`
93
+ };
94
+
95
+
96
+ var $92ef254c82a5c769$exports = {};
97
+ $92ef254c82a5c769$exports = {
98
+ "Clear search": `נקה חיפוש`
99
+ };
100
+
101
+
102
+ var $e0321b43bdefb8b3$exports = {};
103
+ $e0321b43bdefb8b3$exports = {
104
+ "Clear search": `Obriši pretragu`
105
+ };
106
+
107
+
108
+ var $0c1ee0b8d50940d9$exports = {};
109
+ $0c1ee0b8d50940d9$exports = {
110
+ "Clear search": `Keresés törlése`
111
+ };
112
+
113
+
114
+ var $b09198915a38946f$exports = {};
115
+ $b09198915a38946f$exports = {
116
+ "Clear search": `Cancella ricerca`
117
+ };
118
+
119
+
120
+ var $3a9a3d180c3145c0$exports = {};
121
+ $3a9a3d180c3145c0$exports = {
122
+ "Clear search": `検索をクリア`
123
+ };
124
+
125
+
126
+ var $b7a611726449f4a3$exports = {};
127
+ $b7a611726449f4a3$exports = {
128
+ "Clear search": `검색 지우기`
129
+ };
130
+
131
+
132
+ var $d9a3d49db610dd5c$exports = {};
133
+ $d9a3d49db610dd5c$exports = {
134
+ "Clear search": `Išvalyti iešką`
135
+ };
136
+
137
+
138
+ var $3ab64b73ea27c23a$exports = {};
139
+ $3ab64b73ea27c23a$exports = {
140
+ "Clear search": `Notīrīt meklēšanu`
141
+ };
142
+
143
+
144
+ var $bf5cce1b47d23baf$exports = {};
145
+ $bf5cce1b47d23baf$exports = {
146
+ "Clear search": `Tøm søk`
147
+ };
148
+
149
+
150
+ var $4e0c9a9a010e4598$exports = {};
151
+ $4e0c9a9a010e4598$exports = {
152
+ "Clear search": `Zoekactie wissen`
153
+ };
154
+
155
+
156
+ var $63cf4a75ec270508$exports = {};
157
+ $63cf4a75ec270508$exports = {
158
+ "Clear search": `Wyczyść zawartość wyszukiwania`
159
+ };
160
+
161
+
162
+ var $083b0cad27fdbd06$exports = {};
163
+ $083b0cad27fdbd06$exports = {
164
+ "Clear search": `Limpar pesquisa`
165
+ };
166
+
167
+
168
+ var $1b7f0864d830ba6d$exports = {};
169
+ $1b7f0864d830ba6d$exports = {
170
+ "Clear search": `Limpar pesquisa`
171
+ };
172
+
173
+
174
+ var $d6d2588377fc9718$exports = {};
175
+ $d6d2588377fc9718$exports = {
176
+ "Clear search": `Ştergeţi căutarea`
177
+ };
178
+
179
+
180
+ var $701c918a4653e946$exports = {};
181
+ $701c918a4653e946$exports = {
182
+ "Clear search": `Очистить поиск`
183
+ };
184
+
185
+
186
+ var $7cacc29a1e5f4fbe$exports = {};
187
+ $7cacc29a1e5f4fbe$exports = {
188
+ "Clear search": `Vymazať vyhľadávanie`
189
+ };
190
+
191
+
192
+ var $c63231bcc300d0df$exports = {};
193
+ $c63231bcc300d0df$exports = {
194
+ "Clear search": `Počisti iskanje`
195
+ };
196
+
197
+
198
+ var $b61510478bc0e6f6$exports = {};
199
+ $b61510478bc0e6f6$exports = {
200
+ "Clear search": `Obriši pretragu`
201
+ };
202
+
203
+
204
+ var $ce325e6dd3f9c37a$exports = {};
205
+ $ce325e6dd3f9c37a$exports = {
206
+ "Clear search": `Rensa sökning`
207
+ };
208
+
209
+
210
+ var $1f7e1cf2285af2b2$exports = {};
211
+ $1f7e1cf2285af2b2$exports = {
212
+ "Clear search": `Aramayı temizle`
213
+ };
214
+
215
+
216
+ var $2d999353ca652e34$exports = {};
217
+ $2d999353ca652e34$exports = {
218
+ "Clear search": `Очистити пошук`
219
+ };
220
+
221
+
222
+ var $117b536bfb1ae554$exports = {};
223
+ $117b536bfb1ae554$exports = {
224
+ "Clear search": `清除搜索`
225
+ };
226
+
227
+
228
+ var $525f6fa4ac26e278$exports = {};
229
+ $525f6fa4ac26e278$exports = {
230
+ "Clear search": `清除搜尋條件`
231
+ };
232
+
233
+
234
+ $ad5aea03cc53c961$exports = {
235
+ "ar-AE": $03c9a1a10de12f06$exports,
236
+ "bg-BG": $4da0c2ffa4ba4159$exports,
237
+ "cs-CZ": $8c59fd0c2c96821b$exports,
238
+ "da-DK": $0a371f9c1df8120f$exports,
239
+ "de-DE": $67f4d0b0de9f8a52$exports,
240
+ "el-GR": $72a312d948f0214b$exports,
241
+ "en-US": $5012d21d933388c1$exports,
242
+ "es-ES": $0159854399308e2e$exports,
243
+ "et-EE": $390613981d970276$exports,
244
+ "fi-FI": $961ae0833f811705$exports,
245
+ "fr-FR": $26d76742decfd829$exports,
246
+ "he-IL": $92ef254c82a5c769$exports,
247
+ "hr-HR": $e0321b43bdefb8b3$exports,
248
+ "hu-HU": $0c1ee0b8d50940d9$exports,
249
+ "it-IT": $b09198915a38946f$exports,
250
+ "ja-JP": $3a9a3d180c3145c0$exports,
251
+ "ko-KR": $b7a611726449f4a3$exports,
252
+ "lt-LT": $d9a3d49db610dd5c$exports,
253
+ "lv-LV": $3ab64b73ea27c23a$exports,
254
+ "nb-NO": $bf5cce1b47d23baf$exports,
255
+ "nl-NL": $4e0c9a9a010e4598$exports,
256
+ "pl-PL": $63cf4a75ec270508$exports,
257
+ "pt-BR": $083b0cad27fdbd06$exports,
258
+ "pt-PT": $1b7f0864d830ba6d$exports,
259
+ "ro-RO": $d6d2588377fc9718$exports,
260
+ "ru-RU": $701c918a4653e946$exports,
261
+ "sk-SK": $7cacc29a1e5f4fbe$exports,
262
+ "sl-SI": $c63231bcc300d0df$exports,
263
+ "sr-SP": $b61510478bc0e6f6$exports,
264
+ "sv-SE": $ce325e6dd3f9c37a$exports,
265
+ "tr-TR": $1f7e1cf2285af2b2$exports,
266
+ "uk-UA": $2d999353ca652e34$exports,
267
+ "zh-CN": $117b536bfb1ae554$exports,
268
+ "zh-TW": $525f6fa4ac26e278$exports
269
+ };
270
+
271
+
272
+
273
+
274
+ function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
275
+ let stringFormatter = (0, $2Ol32$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($ad5aea03cc53c961$exports))));
276
+ let { isDisabled: isDisabled , isReadOnly: isReadOnly , onSubmit: onSubmit = ()=>{} , onClear: onClear , type: type = "search" } = props;
277
+ let onKeyDown = (e)=>{
278
+ const key = e.key;
279
+ if (key === "Enter" || key === "Escape") e.preventDefault();
280
+ if (isDisabled || isReadOnly) return;
281
+ if (key === "Enter") onSubmit(state.value);
282
+ if (key === "Escape") {
283
+ state.setValue("");
284
+ if (onClear) onClear();
285
+ }
286
+ };
287
+ let onClearButtonClick = ()=>{
288
+ state.setValue("");
289
+ if (onClear) onClear();
290
+ };
291
+ let onPressStart = ()=>{
292
+ // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
293
+ // the input and close the keyboard
294
+ inputRef.current.focus();
295
+ };
296
+ let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $2Ol32$useTextField)({
297
+ ...props,
298
+ value: state.value,
299
+ onChange: state.setValue,
300
+ onKeyDown: (0, $2Ol32$chain)(onKeyDown, props.onKeyDown),
301
+ type: type
302
+ }, inputRef);
303
+ return {
304
+ labelProps: labelProps,
305
+ inputProps: {
306
+ ...inputProps,
307
+ // already handled by useSearchFieldState
308
+ defaultValue: undefined
309
+ },
310
+ clearButtonProps: {
311
+ "aria-label": stringFormatter.format("Clear search"),
312
+ excludeFromTabOrder: true,
313
+ // @ts-ignore
314
+ preventFocusOnPress: true,
315
+ isDisabled: isDisabled || isReadOnly,
316
+ onPress: onClearButtonClick,
317
+ onPressStart: onPressStart
318
+ },
319
+ descriptionProps: descriptionProps,
320
+ errorMessageProps: errorMessageProps
321
+ };
322
+ }
323
+
324
+
325
+
326
+
327
+ export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
328
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-aria/searchfield",
3
- "version": "3.4.4",
3
+ "version": "3.5.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -17,14 +22,14 @@
17
22
  "url": "https://github.com/adobe/react-spectrum"
18
23
  },
19
24
  "dependencies": {
20
- "@react-aria/i18n": "^3.6.3",
21
- "@react-aria/interactions": "^3.13.1",
22
- "@react-aria/textfield": "^3.8.1",
23
- "@react-aria/utils": "^3.14.2",
24
- "@react-stately/searchfield": "^3.3.4",
25
- "@react-types/button": "^3.7.0",
26
- "@react-types/searchfield": "^3.3.6",
27
- "@react-types/shared": "^3.16.0",
25
+ "@react-aria/i18n": "^3.7.0",
26
+ "@react-aria/interactions": "^3.14.0",
27
+ "@react-aria/textfield": "^3.9.0",
28
+ "@react-aria/utils": "^3.15.0",
29
+ "@react-stately/searchfield": "^3.4.0",
30
+ "@react-types/button": "^3.7.1",
31
+ "@react-types/searchfield": "^3.4.0",
32
+ "@react-types/shared": "^3.17.0",
28
33
  "@swc/helpers": "^0.4.14"
29
34
  },
30
35
  "peerDependencies": {
@@ -33,5 +38,5 @@
33
38
  "publishConfig": {
34
39
  "access": "public"
35
40
  },
36
- "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
41
+ "gitHead": "a0efee84aa178cb1a202951dfd6d8de02b292307"
37
42
  }