@react-aria/searchfield 3.7.3 → 3.7.5
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/import.mjs +1 -182
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/main.js +2 -183
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -182
- package/dist/module.js.map +1 -1
- package/dist/useSearchField.main.js +86 -0
- package/dist/useSearchField.main.js.map +1 -0
- package/dist/useSearchField.mjs +81 -0
- package/dist/useSearchField.module.js +81 -0
- package/dist/useSearchField.module.js.map +1 -0
- package/package.json +9 -9
package/dist/import.mjs
CHANGED
|
@@ -1,56 +1,6 @@
|
|
|
1
|
-
import $
|
|
2
|
-
import $4da0c2ffa4ba4159$exports from "./bg-BG.mjs";
|
|
3
|
-
import $8c59fd0c2c96821b$exports from "./cs-CZ.mjs";
|
|
4
|
-
import $0a371f9c1df8120f$exports from "./da-DK.mjs";
|
|
5
|
-
import $67f4d0b0de9f8a52$exports from "./de-DE.mjs";
|
|
6
|
-
import $72a312d948f0214b$exports from "./el-GR.mjs";
|
|
7
|
-
import $5012d21d933388c1$exports from "./en-US.mjs";
|
|
8
|
-
import $0159854399308e2e$exports from "./es-ES.mjs";
|
|
9
|
-
import $390613981d970276$exports from "./et-EE.mjs";
|
|
10
|
-
import $961ae0833f811705$exports from "./fi-FI.mjs";
|
|
11
|
-
import $26d76742decfd829$exports from "./fr-FR.mjs";
|
|
12
|
-
import $92ef254c82a5c769$exports from "./he-IL.mjs";
|
|
13
|
-
import $e0321b43bdefb8b3$exports from "./hr-HR.mjs";
|
|
14
|
-
import $0c1ee0b8d50940d9$exports from "./hu-HU.mjs";
|
|
15
|
-
import $b09198915a38946f$exports from "./it-IT.mjs";
|
|
16
|
-
import $3a9a3d180c3145c0$exports from "./ja-JP.mjs";
|
|
17
|
-
import $b7a611726449f4a3$exports from "./ko-KR.mjs";
|
|
18
|
-
import $d9a3d49db610dd5c$exports from "./lt-LT.mjs";
|
|
19
|
-
import $3ab64b73ea27c23a$exports from "./lv-LV.mjs";
|
|
20
|
-
import $bf5cce1b47d23baf$exports from "./nb-NO.mjs";
|
|
21
|
-
import $4e0c9a9a010e4598$exports from "./nl-NL.mjs";
|
|
22
|
-
import $63cf4a75ec270508$exports from "./pl-PL.mjs";
|
|
23
|
-
import $083b0cad27fdbd06$exports from "./pt-BR.mjs";
|
|
24
|
-
import $1b7f0864d830ba6d$exports from "./pt-PT.mjs";
|
|
25
|
-
import $d6d2588377fc9718$exports from "./ro-RO.mjs";
|
|
26
|
-
import $701c918a4653e946$exports from "./ru-RU.mjs";
|
|
27
|
-
import $7cacc29a1e5f4fbe$exports from "./sk-SK.mjs";
|
|
28
|
-
import $c63231bcc300d0df$exports from "./sl-SI.mjs";
|
|
29
|
-
import $b61510478bc0e6f6$exports from "./sr-SP.mjs";
|
|
30
|
-
import $ce325e6dd3f9c37a$exports from "./sv-SE.mjs";
|
|
31
|
-
import $1f7e1cf2285af2b2$exports from "./tr-TR.mjs";
|
|
32
|
-
import $2d999353ca652e34$exports from "./uk-UA.mjs";
|
|
33
|
-
import $117b536bfb1ae554$exports from "./zh-CN.mjs";
|
|
34
|
-
import $525f6fa4ac26e278$exports from "./zh-TW.mjs";
|
|
35
|
-
import {chain as $2Ol32$chain} from "@react-aria/utils";
|
|
36
|
-
import {useLocalizedStringFormatter as $2Ol32$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
37
|
-
import {useTextField as $2Ol32$useTextField} from "@react-aria/textfield";
|
|
1
|
+
import {useSearchField as $4d52238874b24f86$export$9bb30bbe003b82e0} from "./useSearchField.mjs";
|
|
38
2
|
|
|
39
|
-
|
|
40
|
-
function $parcel$interopDefault(a) {
|
|
41
|
-
return a && a.__esModule ? a.default : a;
|
|
42
|
-
}
|
|
43
3
|
/*
|
|
44
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
45
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
46
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
47
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
48
|
-
*
|
|
49
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
50
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
51
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
52
|
-
* governing permissions and limitations under the License.
|
|
53
|
-
*/ /*
|
|
54
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
55
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
56
6
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -61,137 +11,6 @@ function $parcel$interopDefault(a) {
|
|
|
61
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
62
12
|
* governing permissions and limitations under the License.
|
|
63
13
|
*/
|
|
64
|
-
var $8112f8b883c0272d$exports = {};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
$8112f8b883c0272d$exports = {
|
|
100
|
-
"ar-AE": $03c9a1a10de12f06$exports,
|
|
101
|
-
"bg-BG": $4da0c2ffa4ba4159$exports,
|
|
102
|
-
"cs-CZ": $8c59fd0c2c96821b$exports,
|
|
103
|
-
"da-DK": $0a371f9c1df8120f$exports,
|
|
104
|
-
"de-DE": $67f4d0b0de9f8a52$exports,
|
|
105
|
-
"el-GR": $72a312d948f0214b$exports,
|
|
106
|
-
"en-US": $5012d21d933388c1$exports,
|
|
107
|
-
"es-ES": $0159854399308e2e$exports,
|
|
108
|
-
"et-EE": $390613981d970276$exports,
|
|
109
|
-
"fi-FI": $961ae0833f811705$exports,
|
|
110
|
-
"fr-FR": $26d76742decfd829$exports,
|
|
111
|
-
"he-IL": $92ef254c82a5c769$exports,
|
|
112
|
-
"hr-HR": $e0321b43bdefb8b3$exports,
|
|
113
|
-
"hu-HU": $0c1ee0b8d50940d9$exports,
|
|
114
|
-
"it-IT": $b09198915a38946f$exports,
|
|
115
|
-
"ja-JP": $3a9a3d180c3145c0$exports,
|
|
116
|
-
"ko-KR": $b7a611726449f4a3$exports,
|
|
117
|
-
"lt-LT": $d9a3d49db610dd5c$exports,
|
|
118
|
-
"lv-LV": $3ab64b73ea27c23a$exports,
|
|
119
|
-
"nb-NO": $bf5cce1b47d23baf$exports,
|
|
120
|
-
"nl-NL": $4e0c9a9a010e4598$exports,
|
|
121
|
-
"pl-PL": $63cf4a75ec270508$exports,
|
|
122
|
-
"pt-BR": $083b0cad27fdbd06$exports,
|
|
123
|
-
"pt-PT": $1b7f0864d830ba6d$exports,
|
|
124
|
-
"ro-RO": $d6d2588377fc9718$exports,
|
|
125
|
-
"ru-RU": $701c918a4653e946$exports,
|
|
126
|
-
"sk-SK": $7cacc29a1e5f4fbe$exports,
|
|
127
|
-
"sl-SI": $c63231bcc300d0df$exports,
|
|
128
|
-
"sr-SP": $b61510478bc0e6f6$exports,
|
|
129
|
-
"sv-SE": $ce325e6dd3f9c37a$exports,
|
|
130
|
-
"tr-TR": $1f7e1cf2285af2b2$exports,
|
|
131
|
-
"uk-UA": $2d999353ca652e34$exports,
|
|
132
|
-
"zh-CN": $117b536bfb1ae554$exports,
|
|
133
|
-
"zh-TW": $525f6fa4ac26e278$exports
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
140
|
-
let stringFormatter = (0, $2Ol32$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($8112f8b883c0272d$exports))), "@react-aria/searchfield");
|
|
141
|
-
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = "search" } = props;
|
|
142
|
-
let onKeyDown = (e)=>{
|
|
143
|
-
const key = e.key;
|
|
144
|
-
if (key === "Enter") e.preventDefault();
|
|
145
|
-
if (isDisabled || isReadOnly) return;
|
|
146
|
-
if (key === "Enter") onSubmit(state.value);
|
|
147
|
-
if (key === "Escape") {
|
|
148
|
-
if (state.value === "") e.continuePropagation();
|
|
149
|
-
else {
|
|
150
|
-
state.setValue("");
|
|
151
|
-
if (onClear) onClear();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
let onClearButtonClick = ()=>{
|
|
156
|
-
state.setValue("");
|
|
157
|
-
if (onClear) onClear();
|
|
158
|
-
};
|
|
159
|
-
let onPressStart = ()=>{
|
|
160
|
-
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
161
|
-
// the input and close the keyboard
|
|
162
|
-
_inputRef_current;
|
|
163
|
-
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
164
|
-
};
|
|
165
|
-
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $2Ol32$useTextField)({
|
|
166
|
-
...props,
|
|
167
|
-
value: state.value,
|
|
168
|
-
onChange: state.setValue,
|
|
169
|
-
onKeyDown: !isReadOnly ? (0, $2Ol32$chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
170
|
-
type: type
|
|
171
|
-
}, inputRef);
|
|
172
|
-
return {
|
|
173
|
-
labelProps: labelProps,
|
|
174
|
-
inputProps: {
|
|
175
|
-
...inputProps,
|
|
176
|
-
// already handled by useSearchFieldState
|
|
177
|
-
defaultValue: undefined
|
|
178
|
-
},
|
|
179
|
-
clearButtonProps: {
|
|
180
|
-
"aria-label": stringFormatter.format("Clear search"),
|
|
181
|
-
excludeFromTabOrder: true,
|
|
182
|
-
// @ts-ignore
|
|
183
|
-
preventFocusOnPress: true,
|
|
184
|
-
isDisabled: isDisabled || isReadOnly,
|
|
185
|
-
onPress: onClearButtonClick,
|
|
186
|
-
onPressStart: onPressStart
|
|
187
|
-
},
|
|
188
|
-
descriptionProps: descriptionProps,
|
|
189
|
-
errorMessageProps: errorMessageProps,
|
|
190
|
-
...validation
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
14
|
|
|
196
15
|
|
|
197
16
|
export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var $bd6662502a469b02$exports = require("./ar-AE.main.js");
|
|
2
|
+
var $360cd10b99b1ec90$exports = require("./bg-BG.main.js");
|
|
3
|
+
var $ffecf95c9ab0a601$exports = require("./cs-CZ.main.js");
|
|
4
|
+
var $a8c1807afa0c6ad0$exports = require("./da-DK.main.js");
|
|
5
|
+
var $0e885ea91b94ae2b$exports = require("./de-DE.main.js");
|
|
6
|
+
var $a313361aefc92d6a$exports = require("./el-GR.main.js");
|
|
7
|
+
var $aca1149af311369c$exports = require("./en-US.main.js");
|
|
8
|
+
var $fcf49eac878c2dd4$exports = require("./es-ES.main.js");
|
|
9
|
+
var $a4cc5fda0ae4bc39$exports = require("./et-EE.main.js");
|
|
10
|
+
var $3490cbf44d66e748$exports = require("./fi-FI.main.js");
|
|
11
|
+
var $7139336f2276b57b$exports = require("./fr-FR.main.js");
|
|
12
|
+
var $2cfd40eac86ffaf9$exports = require("./he-IL.main.js");
|
|
13
|
+
var $ad5cd81fb4b71e02$exports = require("./hr-HR.main.js");
|
|
14
|
+
var $efa4f2797ecc2e40$exports = require("./hu-HU.main.js");
|
|
15
|
+
var $7d0d440111d7eb6f$exports = require("./it-IT.main.js");
|
|
16
|
+
var $15bb9dd1255c87e0$exports = require("./ja-JP.main.js");
|
|
17
|
+
var $662038034d042bc2$exports = require("./ko-KR.main.js");
|
|
18
|
+
var $469701bdc0ecd008$exports = require("./lt-LT.main.js");
|
|
19
|
+
var $bddb04e2df050d62$exports = require("./lv-LV.main.js");
|
|
20
|
+
var $a295a578d307d4b5$exports = require("./nb-NO.main.js");
|
|
21
|
+
var $e0731003f5c0bbc3$exports = require("./nl-NL.main.js");
|
|
22
|
+
var $9acaf16c6e495332$exports = require("./pl-PL.main.js");
|
|
23
|
+
var $1087013ecb748501$exports = require("./pt-BR.main.js");
|
|
24
|
+
var $71e9e5edc2bbe98a$exports = require("./pt-PT.main.js");
|
|
25
|
+
var $a4bd32ef01b4a9e1$exports = require("./ro-RO.main.js");
|
|
26
|
+
var $0807874c8146beee$exports = require("./ru-RU.main.js");
|
|
27
|
+
var $3ed5a8cd509d389e$exports = require("./sk-SK.main.js");
|
|
28
|
+
var $1cc960210efc0d20$exports = require("./sl-SI.main.js");
|
|
29
|
+
var $18a26c027bd07b1a$exports = require("./sr-SP.main.js");
|
|
30
|
+
var $2ca3577ce1438e9b$exports = require("./sv-SE.main.js");
|
|
31
|
+
var $ced44bcac3738390$exports = require("./tr-TR.main.js");
|
|
32
|
+
var $abd2f08b465610a9$exports = require("./uk-UA.main.js");
|
|
33
|
+
var $becec37c237a6c53$exports = require("./zh-CN.main.js");
|
|
34
|
+
var $f7dff162f8d4dac5$exports = require("./zh-TW.main.js");
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
module.exports = {
|
|
71
|
+
"ar-AE": $bd6662502a469b02$exports,
|
|
72
|
+
"bg-BG": $360cd10b99b1ec90$exports,
|
|
73
|
+
"cs-CZ": $ffecf95c9ab0a601$exports,
|
|
74
|
+
"da-DK": $a8c1807afa0c6ad0$exports,
|
|
75
|
+
"de-DE": $0e885ea91b94ae2b$exports,
|
|
76
|
+
"el-GR": $a313361aefc92d6a$exports,
|
|
77
|
+
"en-US": $aca1149af311369c$exports,
|
|
78
|
+
"es-ES": $fcf49eac878c2dd4$exports,
|
|
79
|
+
"et-EE": $a4cc5fda0ae4bc39$exports,
|
|
80
|
+
"fi-FI": $3490cbf44d66e748$exports,
|
|
81
|
+
"fr-FR": $7139336f2276b57b$exports,
|
|
82
|
+
"he-IL": $2cfd40eac86ffaf9$exports,
|
|
83
|
+
"hr-HR": $ad5cd81fb4b71e02$exports,
|
|
84
|
+
"hu-HU": $efa4f2797ecc2e40$exports,
|
|
85
|
+
"it-IT": $7d0d440111d7eb6f$exports,
|
|
86
|
+
"ja-JP": $15bb9dd1255c87e0$exports,
|
|
87
|
+
"ko-KR": $662038034d042bc2$exports,
|
|
88
|
+
"lt-LT": $469701bdc0ecd008$exports,
|
|
89
|
+
"lv-LV": $bddb04e2df050d62$exports,
|
|
90
|
+
"nb-NO": $a295a578d307d4b5$exports,
|
|
91
|
+
"nl-NL": $e0731003f5c0bbc3$exports,
|
|
92
|
+
"pl-PL": $9acaf16c6e495332$exports,
|
|
93
|
+
"pt-BR": $1087013ecb748501$exports,
|
|
94
|
+
"pt-PT": $71e9e5edc2bbe98a$exports,
|
|
95
|
+
"ro-RO": $a4bd32ef01b4a9e1$exports,
|
|
96
|
+
"ru-RU": $0807874c8146beee$exports,
|
|
97
|
+
"sk-SK": $3ed5a8cd509d389e$exports,
|
|
98
|
+
"sl-SI": $1cc960210efc0d20$exports,
|
|
99
|
+
"sr-SP": $18a26c027bd07b1a$exports,
|
|
100
|
+
"sv-SE": $2ca3577ce1438e9b$exports,
|
|
101
|
+
"tr-TR": $ced44bcac3738390$exports,
|
|
102
|
+
"uk-UA": $abd2f08b465610a9$exports,
|
|
103
|
+
"zh-CN": $becec37c237a6c53$exports,
|
|
104
|
+
"zh-TW": $f7dff162f8d4dac5$exports
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=intlStrings.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,iBAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/searchfield/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.main.js.map"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import $03K6r$arAEmodulejs from "./ar-AE.mjs";
|
|
2
|
+
import $03K6r$bgBGmodulejs from "./bg-BG.mjs";
|
|
3
|
+
import $03K6r$csCZmodulejs from "./cs-CZ.mjs";
|
|
4
|
+
import $03K6r$daDKmodulejs from "./da-DK.mjs";
|
|
5
|
+
import $03K6r$deDEmodulejs from "./de-DE.mjs";
|
|
6
|
+
import $03K6r$elGRmodulejs from "./el-GR.mjs";
|
|
7
|
+
import $03K6r$enUSmodulejs from "./en-US.mjs";
|
|
8
|
+
import $03K6r$esESmodulejs from "./es-ES.mjs";
|
|
9
|
+
import $03K6r$etEEmodulejs from "./et-EE.mjs";
|
|
10
|
+
import $03K6r$fiFImodulejs from "./fi-FI.mjs";
|
|
11
|
+
import $03K6r$frFRmodulejs from "./fr-FR.mjs";
|
|
12
|
+
import $03K6r$heILmodulejs from "./he-IL.mjs";
|
|
13
|
+
import $03K6r$hrHRmodulejs from "./hr-HR.mjs";
|
|
14
|
+
import $03K6r$huHUmodulejs from "./hu-HU.mjs";
|
|
15
|
+
import $03K6r$itITmodulejs from "./it-IT.mjs";
|
|
16
|
+
import $03K6r$jaJPmodulejs from "./ja-JP.mjs";
|
|
17
|
+
import $03K6r$koKRmodulejs from "./ko-KR.mjs";
|
|
18
|
+
import $03K6r$ltLTmodulejs from "./lt-LT.mjs";
|
|
19
|
+
import $03K6r$lvLVmodulejs from "./lv-LV.mjs";
|
|
20
|
+
import $03K6r$nbNOmodulejs from "./nb-NO.mjs";
|
|
21
|
+
import $03K6r$nlNLmodulejs from "./nl-NL.mjs";
|
|
22
|
+
import $03K6r$plPLmodulejs from "./pl-PL.mjs";
|
|
23
|
+
import $03K6r$ptBRmodulejs from "./pt-BR.mjs";
|
|
24
|
+
import $03K6r$ptPTmodulejs from "./pt-PT.mjs";
|
|
25
|
+
import $03K6r$roROmodulejs from "./ro-RO.mjs";
|
|
26
|
+
import $03K6r$ruRUmodulejs from "./ru-RU.mjs";
|
|
27
|
+
import $03K6r$skSKmodulejs from "./sk-SK.mjs";
|
|
28
|
+
import $03K6r$slSImodulejs from "./sl-SI.mjs";
|
|
29
|
+
import $03K6r$srSPmodulejs from "./sr-SP.mjs";
|
|
30
|
+
import $03K6r$svSEmodulejs from "./sv-SE.mjs";
|
|
31
|
+
import $03K6r$trTRmodulejs from "./tr-TR.mjs";
|
|
32
|
+
import $03K6r$ukUAmodulejs from "./uk-UA.mjs";
|
|
33
|
+
import $03K6r$zhCNmodulejs from "./zh-CN.mjs";
|
|
34
|
+
import $03K6r$zhTWmodulejs from "./zh-TW.mjs";
|
|
35
|
+
|
|
36
|
+
var $8112f8b883c0272d$exports = {};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
$8112f8b883c0272d$exports = {
|
|
72
|
+
"ar-AE": $03K6r$arAEmodulejs,
|
|
73
|
+
"bg-BG": $03K6r$bgBGmodulejs,
|
|
74
|
+
"cs-CZ": $03K6r$csCZmodulejs,
|
|
75
|
+
"da-DK": $03K6r$daDKmodulejs,
|
|
76
|
+
"de-DE": $03K6r$deDEmodulejs,
|
|
77
|
+
"el-GR": $03K6r$elGRmodulejs,
|
|
78
|
+
"en-US": $03K6r$enUSmodulejs,
|
|
79
|
+
"es-ES": $03K6r$esESmodulejs,
|
|
80
|
+
"et-EE": $03K6r$etEEmodulejs,
|
|
81
|
+
"fi-FI": $03K6r$fiFImodulejs,
|
|
82
|
+
"fr-FR": $03K6r$frFRmodulejs,
|
|
83
|
+
"he-IL": $03K6r$heILmodulejs,
|
|
84
|
+
"hr-HR": $03K6r$hrHRmodulejs,
|
|
85
|
+
"hu-HU": $03K6r$huHUmodulejs,
|
|
86
|
+
"it-IT": $03K6r$itITmodulejs,
|
|
87
|
+
"ja-JP": $03K6r$jaJPmodulejs,
|
|
88
|
+
"ko-KR": $03K6r$koKRmodulejs,
|
|
89
|
+
"lt-LT": $03K6r$ltLTmodulejs,
|
|
90
|
+
"lv-LV": $03K6r$lvLVmodulejs,
|
|
91
|
+
"nb-NO": $03K6r$nbNOmodulejs,
|
|
92
|
+
"nl-NL": $03K6r$nlNLmodulejs,
|
|
93
|
+
"pl-PL": $03K6r$plPLmodulejs,
|
|
94
|
+
"pt-BR": $03K6r$ptBRmodulejs,
|
|
95
|
+
"pt-PT": $03K6r$ptPTmodulejs,
|
|
96
|
+
"ro-RO": $03K6r$roROmodulejs,
|
|
97
|
+
"ru-RU": $03K6r$ruRUmodulejs,
|
|
98
|
+
"sk-SK": $03K6r$skSKmodulejs,
|
|
99
|
+
"sl-SI": $03K6r$slSImodulejs,
|
|
100
|
+
"sr-SP": $03K6r$srSPmodulejs,
|
|
101
|
+
"sv-SE": $03K6r$svSEmodulejs,
|
|
102
|
+
"tr-TR": $03K6r$trTRmodulejs,
|
|
103
|
+
"uk-UA": $03K6r$ukUAmodulejs,
|
|
104
|
+
"zh-CN": $03K6r$zhCNmodulejs,
|
|
105
|
+
"zh-TW": $03K6r$zhTWmodulejs
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export {$8112f8b883c0272d$exports as default};
|
|
110
|
+
//# sourceMappingURL=intlStrings.module.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import $03K6r$arAEmodulejs from "./ar-AE.module.js";
|
|
2
|
+
import $03K6r$bgBGmodulejs from "./bg-BG.module.js";
|
|
3
|
+
import $03K6r$csCZmodulejs from "./cs-CZ.module.js";
|
|
4
|
+
import $03K6r$daDKmodulejs from "./da-DK.module.js";
|
|
5
|
+
import $03K6r$deDEmodulejs from "./de-DE.module.js";
|
|
6
|
+
import $03K6r$elGRmodulejs from "./el-GR.module.js";
|
|
7
|
+
import $03K6r$enUSmodulejs from "./en-US.module.js";
|
|
8
|
+
import $03K6r$esESmodulejs from "./es-ES.module.js";
|
|
9
|
+
import $03K6r$etEEmodulejs from "./et-EE.module.js";
|
|
10
|
+
import $03K6r$fiFImodulejs from "./fi-FI.module.js";
|
|
11
|
+
import $03K6r$frFRmodulejs from "./fr-FR.module.js";
|
|
12
|
+
import $03K6r$heILmodulejs from "./he-IL.module.js";
|
|
13
|
+
import $03K6r$hrHRmodulejs from "./hr-HR.module.js";
|
|
14
|
+
import $03K6r$huHUmodulejs from "./hu-HU.module.js";
|
|
15
|
+
import $03K6r$itITmodulejs from "./it-IT.module.js";
|
|
16
|
+
import $03K6r$jaJPmodulejs from "./ja-JP.module.js";
|
|
17
|
+
import $03K6r$koKRmodulejs from "./ko-KR.module.js";
|
|
18
|
+
import $03K6r$ltLTmodulejs from "./lt-LT.module.js";
|
|
19
|
+
import $03K6r$lvLVmodulejs from "./lv-LV.module.js";
|
|
20
|
+
import $03K6r$nbNOmodulejs from "./nb-NO.module.js";
|
|
21
|
+
import $03K6r$nlNLmodulejs from "./nl-NL.module.js";
|
|
22
|
+
import $03K6r$plPLmodulejs from "./pl-PL.module.js";
|
|
23
|
+
import $03K6r$ptBRmodulejs from "./pt-BR.module.js";
|
|
24
|
+
import $03K6r$ptPTmodulejs from "./pt-PT.module.js";
|
|
25
|
+
import $03K6r$roROmodulejs from "./ro-RO.module.js";
|
|
26
|
+
import $03K6r$ruRUmodulejs from "./ru-RU.module.js";
|
|
27
|
+
import $03K6r$skSKmodulejs from "./sk-SK.module.js";
|
|
28
|
+
import $03K6r$slSImodulejs from "./sl-SI.module.js";
|
|
29
|
+
import $03K6r$srSPmodulejs from "./sr-SP.module.js";
|
|
30
|
+
import $03K6r$svSEmodulejs from "./sv-SE.module.js";
|
|
31
|
+
import $03K6r$trTRmodulejs from "./tr-TR.module.js";
|
|
32
|
+
import $03K6r$ukUAmodulejs from "./uk-UA.module.js";
|
|
33
|
+
import $03K6r$zhCNmodulejs from "./zh-CN.module.js";
|
|
34
|
+
import $03K6r$zhTWmodulejs from "./zh-TW.module.js";
|
|
35
|
+
|
|
36
|
+
var $8112f8b883c0272d$exports = {};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
$8112f8b883c0272d$exports = {
|
|
72
|
+
"ar-AE": $03K6r$arAEmodulejs,
|
|
73
|
+
"bg-BG": $03K6r$bgBGmodulejs,
|
|
74
|
+
"cs-CZ": $03K6r$csCZmodulejs,
|
|
75
|
+
"da-DK": $03K6r$daDKmodulejs,
|
|
76
|
+
"de-DE": $03K6r$deDEmodulejs,
|
|
77
|
+
"el-GR": $03K6r$elGRmodulejs,
|
|
78
|
+
"en-US": $03K6r$enUSmodulejs,
|
|
79
|
+
"es-ES": $03K6r$esESmodulejs,
|
|
80
|
+
"et-EE": $03K6r$etEEmodulejs,
|
|
81
|
+
"fi-FI": $03K6r$fiFImodulejs,
|
|
82
|
+
"fr-FR": $03K6r$frFRmodulejs,
|
|
83
|
+
"he-IL": $03K6r$heILmodulejs,
|
|
84
|
+
"hr-HR": $03K6r$hrHRmodulejs,
|
|
85
|
+
"hu-HU": $03K6r$huHUmodulejs,
|
|
86
|
+
"it-IT": $03K6r$itITmodulejs,
|
|
87
|
+
"ja-JP": $03K6r$jaJPmodulejs,
|
|
88
|
+
"ko-KR": $03K6r$koKRmodulejs,
|
|
89
|
+
"lt-LT": $03K6r$ltLTmodulejs,
|
|
90
|
+
"lv-LV": $03K6r$lvLVmodulejs,
|
|
91
|
+
"nb-NO": $03K6r$nbNOmodulejs,
|
|
92
|
+
"nl-NL": $03K6r$nlNLmodulejs,
|
|
93
|
+
"pl-PL": $03K6r$plPLmodulejs,
|
|
94
|
+
"pt-BR": $03K6r$ptBRmodulejs,
|
|
95
|
+
"pt-PT": $03K6r$ptPTmodulejs,
|
|
96
|
+
"ro-RO": $03K6r$roROmodulejs,
|
|
97
|
+
"ru-RU": $03K6r$ruRUmodulejs,
|
|
98
|
+
"sk-SK": $03K6r$skSKmodulejs,
|
|
99
|
+
"sl-SI": $03K6r$slSImodulejs,
|
|
100
|
+
"sr-SP": $03K6r$srSPmodulejs,
|
|
101
|
+
"sv-SE": $03K6r$svSEmodulejs,
|
|
102
|
+
"tr-TR": $03K6r$trTRmodulejs,
|
|
103
|
+
"uk-UA": $03K6r$ukUAmodulejs,
|
|
104
|
+
"zh-CN": $03K6r$zhCNmodulejs,
|
|
105
|
+
"zh-TW": $03K6r$zhTWmodulejs
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export {$8112f8b883c0272d$exports as default};
|
|
110
|
+
//# sourceMappingURL=intlStrings.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/searchfield/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.module.js.map"}
|
package/dist/main.js
CHANGED
|
@@ -1,62 +1,12 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $360cd10b99b1ec90$exports = require("./bg-BG.main.js");
|
|
3
|
-
var $ffecf95c9ab0a601$exports = require("./cs-CZ.main.js");
|
|
4
|
-
var $a8c1807afa0c6ad0$exports = require("./da-DK.main.js");
|
|
5
|
-
var $0e885ea91b94ae2b$exports = require("./de-DE.main.js");
|
|
6
|
-
var $a313361aefc92d6a$exports = require("./el-GR.main.js");
|
|
7
|
-
var $aca1149af311369c$exports = require("./en-US.main.js");
|
|
8
|
-
var $fcf49eac878c2dd4$exports = require("./es-ES.main.js");
|
|
9
|
-
var $a4cc5fda0ae4bc39$exports = require("./et-EE.main.js");
|
|
10
|
-
var $3490cbf44d66e748$exports = require("./fi-FI.main.js");
|
|
11
|
-
var $7139336f2276b57b$exports = require("./fr-FR.main.js");
|
|
12
|
-
var $2cfd40eac86ffaf9$exports = require("./he-IL.main.js");
|
|
13
|
-
var $ad5cd81fb4b71e02$exports = require("./hr-HR.main.js");
|
|
14
|
-
var $efa4f2797ecc2e40$exports = require("./hu-HU.main.js");
|
|
15
|
-
var $7d0d440111d7eb6f$exports = require("./it-IT.main.js");
|
|
16
|
-
var $15bb9dd1255c87e0$exports = require("./ja-JP.main.js");
|
|
17
|
-
var $662038034d042bc2$exports = require("./ko-KR.main.js");
|
|
18
|
-
var $469701bdc0ecd008$exports = require("./lt-LT.main.js");
|
|
19
|
-
var $bddb04e2df050d62$exports = require("./lv-LV.main.js");
|
|
20
|
-
var $a295a578d307d4b5$exports = require("./nb-NO.main.js");
|
|
21
|
-
var $e0731003f5c0bbc3$exports = require("./nl-NL.main.js");
|
|
22
|
-
var $9acaf16c6e495332$exports = require("./pl-PL.main.js");
|
|
23
|
-
var $1087013ecb748501$exports = require("./pt-BR.main.js");
|
|
24
|
-
var $71e9e5edc2bbe98a$exports = require("./pt-PT.main.js");
|
|
25
|
-
var $a4bd32ef01b4a9e1$exports = require("./ro-RO.main.js");
|
|
26
|
-
var $0807874c8146beee$exports = require("./ru-RU.main.js");
|
|
27
|
-
var $3ed5a8cd509d389e$exports = require("./sk-SK.main.js");
|
|
28
|
-
var $1cc960210efc0d20$exports = require("./sl-SI.main.js");
|
|
29
|
-
var $18a26c027bd07b1a$exports = require("./sr-SP.main.js");
|
|
30
|
-
var $2ca3577ce1438e9b$exports = require("./sv-SE.main.js");
|
|
31
|
-
var $ced44bcac3738390$exports = require("./tr-TR.main.js");
|
|
32
|
-
var $abd2f08b465610a9$exports = require("./uk-UA.main.js");
|
|
33
|
-
var $becec37c237a6c53$exports = require("./zh-CN.main.js");
|
|
34
|
-
var $f7dff162f8d4dac5$exports = require("./zh-TW.main.js");
|
|
35
|
-
var $9UOFb$reactariautils = require("@react-aria/utils");
|
|
36
|
-
var $9UOFb$reactariai18n = require("@react-aria/i18n");
|
|
37
|
-
var $9UOFb$reactariatextfield = require("@react-aria/textfield");
|
|
1
|
+
var $ccae92a71d96d51a$exports = require("./useSearchField.main.js");
|
|
38
2
|
|
|
39
3
|
|
|
40
4
|
function $parcel$export(e, n, v, s) {
|
|
41
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
42
6
|
}
|
|
43
7
|
|
|
44
|
-
|
|
45
|
-
return a && a.__esModule ? a.default : a;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
$parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$export$9bb30bbe003b82e0);
|
|
8
|
+
$parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$exports.useSearchField);
|
|
49
9
|
/*
|
|
50
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
51
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
52
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
53
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
54
|
-
*
|
|
55
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
56
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
57
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
58
|
-
* governing permissions and limitations under the License.
|
|
59
|
-
*/ /*
|
|
60
10
|
* Copyright 2020 Adobe. All rights reserved.
|
|
61
11
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
62
12
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -67,137 +17,6 @@ $parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$export$
|
|
|
67
17
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
68
18
|
* governing permissions and limitations under the License.
|
|
69
19
|
*/
|
|
70
|
-
var $8e80a08ea739bb00$exports = {};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
$8e80a08ea739bb00$exports = {
|
|
106
|
-
"ar-AE": $bd6662502a469b02$exports,
|
|
107
|
-
"bg-BG": $360cd10b99b1ec90$exports,
|
|
108
|
-
"cs-CZ": $ffecf95c9ab0a601$exports,
|
|
109
|
-
"da-DK": $a8c1807afa0c6ad0$exports,
|
|
110
|
-
"de-DE": $0e885ea91b94ae2b$exports,
|
|
111
|
-
"el-GR": $a313361aefc92d6a$exports,
|
|
112
|
-
"en-US": $aca1149af311369c$exports,
|
|
113
|
-
"es-ES": $fcf49eac878c2dd4$exports,
|
|
114
|
-
"et-EE": $a4cc5fda0ae4bc39$exports,
|
|
115
|
-
"fi-FI": $3490cbf44d66e748$exports,
|
|
116
|
-
"fr-FR": $7139336f2276b57b$exports,
|
|
117
|
-
"he-IL": $2cfd40eac86ffaf9$exports,
|
|
118
|
-
"hr-HR": $ad5cd81fb4b71e02$exports,
|
|
119
|
-
"hu-HU": $efa4f2797ecc2e40$exports,
|
|
120
|
-
"it-IT": $7d0d440111d7eb6f$exports,
|
|
121
|
-
"ja-JP": $15bb9dd1255c87e0$exports,
|
|
122
|
-
"ko-KR": $662038034d042bc2$exports,
|
|
123
|
-
"lt-LT": $469701bdc0ecd008$exports,
|
|
124
|
-
"lv-LV": $bddb04e2df050d62$exports,
|
|
125
|
-
"nb-NO": $a295a578d307d4b5$exports,
|
|
126
|
-
"nl-NL": $e0731003f5c0bbc3$exports,
|
|
127
|
-
"pl-PL": $9acaf16c6e495332$exports,
|
|
128
|
-
"pt-BR": $1087013ecb748501$exports,
|
|
129
|
-
"pt-PT": $71e9e5edc2bbe98a$exports,
|
|
130
|
-
"ro-RO": $a4bd32ef01b4a9e1$exports,
|
|
131
|
-
"ru-RU": $0807874c8146beee$exports,
|
|
132
|
-
"sk-SK": $3ed5a8cd509d389e$exports,
|
|
133
|
-
"sl-SI": $1cc960210efc0d20$exports,
|
|
134
|
-
"sr-SP": $18a26c027bd07b1a$exports,
|
|
135
|
-
"sv-SE": $2ca3577ce1438e9b$exports,
|
|
136
|
-
"tr-TR": $ced44bcac3738390$exports,
|
|
137
|
-
"uk-UA": $abd2f08b465610a9$exports,
|
|
138
|
-
"zh-CN": $becec37c237a6c53$exports,
|
|
139
|
-
"zh-TW": $f7dff162f8d4dac5$exports
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
function $ccae92a71d96d51a$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
146
|
-
let stringFormatter = (0, $9UOFb$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($8e80a08ea739bb00$exports))), "@react-aria/searchfield");
|
|
147
|
-
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = "search" } = props;
|
|
148
|
-
let onKeyDown = (e)=>{
|
|
149
|
-
const key = e.key;
|
|
150
|
-
if (key === "Enter") e.preventDefault();
|
|
151
|
-
if (isDisabled || isReadOnly) return;
|
|
152
|
-
if (key === "Enter") onSubmit(state.value);
|
|
153
|
-
if (key === "Escape") {
|
|
154
|
-
if (state.value === "") e.continuePropagation();
|
|
155
|
-
else {
|
|
156
|
-
state.setValue("");
|
|
157
|
-
if (onClear) onClear();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
let onClearButtonClick = ()=>{
|
|
162
|
-
state.setValue("");
|
|
163
|
-
if (onClear) onClear();
|
|
164
|
-
};
|
|
165
|
-
let onPressStart = ()=>{
|
|
166
|
-
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
167
|
-
// the input and close the keyboard
|
|
168
|
-
_inputRef_current;
|
|
169
|
-
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
170
|
-
};
|
|
171
|
-
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $9UOFb$reactariatextfield.useTextField)({
|
|
172
|
-
...props,
|
|
173
|
-
value: state.value,
|
|
174
|
-
onChange: state.setValue,
|
|
175
|
-
onKeyDown: !isReadOnly ? (0, $9UOFb$reactariautils.chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
176
|
-
type: type
|
|
177
|
-
}, inputRef);
|
|
178
|
-
return {
|
|
179
|
-
labelProps: labelProps,
|
|
180
|
-
inputProps: {
|
|
181
|
-
...inputProps,
|
|
182
|
-
// already handled by useSearchFieldState
|
|
183
|
-
defaultValue: undefined
|
|
184
|
-
},
|
|
185
|
-
clearButtonProps: {
|
|
186
|
-
"aria-label": stringFormatter.format("Clear search"),
|
|
187
|
-
excludeFromTabOrder: true,
|
|
188
|
-
// @ts-ignore
|
|
189
|
-
preventFocusOnPress: true,
|
|
190
|
-
isDisabled: isDisabled || isReadOnly,
|
|
191
|
-
onPress: onClearButtonClick,
|
|
192
|
-
onPressStart: onPressStart
|
|
193
|
-
},
|
|
194
|
-
descriptionProps: descriptionProps,
|
|
195
|
-
errorMessageProps: errorMessageProps,
|
|
196
|
-
...validation
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
20
|
|
|
202
21
|
|
|
203
22
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/searchfield/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useSearchField} from './useSearchField';\nexport type {AriaSearchFieldProps} from '@react-types/searchfield';\nexport type {SearchFieldAria} from './useSearchField';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,56 +1,6 @@
|
|
|
1
|
-
import $
|
|
2
|
-
import $4da0c2ffa4ba4159$exports from "./bg-BG.module.js";
|
|
3
|
-
import $8c59fd0c2c96821b$exports from "./cs-CZ.module.js";
|
|
4
|
-
import $0a371f9c1df8120f$exports from "./da-DK.module.js";
|
|
5
|
-
import $67f4d0b0de9f8a52$exports from "./de-DE.module.js";
|
|
6
|
-
import $72a312d948f0214b$exports from "./el-GR.module.js";
|
|
7
|
-
import $5012d21d933388c1$exports from "./en-US.module.js";
|
|
8
|
-
import $0159854399308e2e$exports from "./es-ES.module.js";
|
|
9
|
-
import $390613981d970276$exports from "./et-EE.module.js";
|
|
10
|
-
import $961ae0833f811705$exports from "./fi-FI.module.js";
|
|
11
|
-
import $26d76742decfd829$exports from "./fr-FR.module.js";
|
|
12
|
-
import $92ef254c82a5c769$exports from "./he-IL.module.js";
|
|
13
|
-
import $e0321b43bdefb8b3$exports from "./hr-HR.module.js";
|
|
14
|
-
import $0c1ee0b8d50940d9$exports from "./hu-HU.module.js";
|
|
15
|
-
import $b09198915a38946f$exports from "./it-IT.module.js";
|
|
16
|
-
import $3a9a3d180c3145c0$exports from "./ja-JP.module.js";
|
|
17
|
-
import $b7a611726449f4a3$exports from "./ko-KR.module.js";
|
|
18
|
-
import $d9a3d49db610dd5c$exports from "./lt-LT.module.js";
|
|
19
|
-
import $3ab64b73ea27c23a$exports from "./lv-LV.module.js";
|
|
20
|
-
import $bf5cce1b47d23baf$exports from "./nb-NO.module.js";
|
|
21
|
-
import $4e0c9a9a010e4598$exports from "./nl-NL.module.js";
|
|
22
|
-
import $63cf4a75ec270508$exports from "./pl-PL.module.js";
|
|
23
|
-
import $083b0cad27fdbd06$exports from "./pt-BR.module.js";
|
|
24
|
-
import $1b7f0864d830ba6d$exports from "./pt-PT.module.js";
|
|
25
|
-
import $d6d2588377fc9718$exports from "./ro-RO.module.js";
|
|
26
|
-
import $701c918a4653e946$exports from "./ru-RU.module.js";
|
|
27
|
-
import $7cacc29a1e5f4fbe$exports from "./sk-SK.module.js";
|
|
28
|
-
import $c63231bcc300d0df$exports from "./sl-SI.module.js";
|
|
29
|
-
import $b61510478bc0e6f6$exports from "./sr-SP.module.js";
|
|
30
|
-
import $ce325e6dd3f9c37a$exports from "./sv-SE.module.js";
|
|
31
|
-
import $1f7e1cf2285af2b2$exports from "./tr-TR.module.js";
|
|
32
|
-
import $2d999353ca652e34$exports from "./uk-UA.module.js";
|
|
33
|
-
import $117b536bfb1ae554$exports from "./zh-CN.module.js";
|
|
34
|
-
import $525f6fa4ac26e278$exports from "./zh-TW.module.js";
|
|
35
|
-
import {chain as $2Ol32$chain} from "@react-aria/utils";
|
|
36
|
-
import {useLocalizedStringFormatter as $2Ol32$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
37
|
-
import {useTextField as $2Ol32$useTextField} from "@react-aria/textfield";
|
|
1
|
+
import {useSearchField as $4d52238874b24f86$export$9bb30bbe003b82e0} from "./useSearchField.module.js";
|
|
38
2
|
|
|
39
|
-
|
|
40
|
-
function $parcel$interopDefault(a) {
|
|
41
|
-
return a && a.__esModule ? a.default : a;
|
|
42
|
-
}
|
|
43
3
|
/*
|
|
44
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
45
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
46
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
47
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
48
|
-
*
|
|
49
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
50
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
51
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
52
|
-
* governing permissions and limitations under the License.
|
|
53
|
-
*/ /*
|
|
54
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
55
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
56
6
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -61,137 +11,6 @@ function $parcel$interopDefault(a) {
|
|
|
61
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
62
12
|
* governing permissions and limitations under the License.
|
|
63
13
|
*/
|
|
64
|
-
var $8112f8b883c0272d$exports = {};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
$8112f8b883c0272d$exports = {
|
|
100
|
-
"ar-AE": $03c9a1a10de12f06$exports,
|
|
101
|
-
"bg-BG": $4da0c2ffa4ba4159$exports,
|
|
102
|
-
"cs-CZ": $8c59fd0c2c96821b$exports,
|
|
103
|
-
"da-DK": $0a371f9c1df8120f$exports,
|
|
104
|
-
"de-DE": $67f4d0b0de9f8a52$exports,
|
|
105
|
-
"el-GR": $72a312d948f0214b$exports,
|
|
106
|
-
"en-US": $5012d21d933388c1$exports,
|
|
107
|
-
"es-ES": $0159854399308e2e$exports,
|
|
108
|
-
"et-EE": $390613981d970276$exports,
|
|
109
|
-
"fi-FI": $961ae0833f811705$exports,
|
|
110
|
-
"fr-FR": $26d76742decfd829$exports,
|
|
111
|
-
"he-IL": $92ef254c82a5c769$exports,
|
|
112
|
-
"hr-HR": $e0321b43bdefb8b3$exports,
|
|
113
|
-
"hu-HU": $0c1ee0b8d50940d9$exports,
|
|
114
|
-
"it-IT": $b09198915a38946f$exports,
|
|
115
|
-
"ja-JP": $3a9a3d180c3145c0$exports,
|
|
116
|
-
"ko-KR": $b7a611726449f4a3$exports,
|
|
117
|
-
"lt-LT": $d9a3d49db610dd5c$exports,
|
|
118
|
-
"lv-LV": $3ab64b73ea27c23a$exports,
|
|
119
|
-
"nb-NO": $bf5cce1b47d23baf$exports,
|
|
120
|
-
"nl-NL": $4e0c9a9a010e4598$exports,
|
|
121
|
-
"pl-PL": $63cf4a75ec270508$exports,
|
|
122
|
-
"pt-BR": $083b0cad27fdbd06$exports,
|
|
123
|
-
"pt-PT": $1b7f0864d830ba6d$exports,
|
|
124
|
-
"ro-RO": $d6d2588377fc9718$exports,
|
|
125
|
-
"ru-RU": $701c918a4653e946$exports,
|
|
126
|
-
"sk-SK": $7cacc29a1e5f4fbe$exports,
|
|
127
|
-
"sl-SI": $c63231bcc300d0df$exports,
|
|
128
|
-
"sr-SP": $b61510478bc0e6f6$exports,
|
|
129
|
-
"sv-SE": $ce325e6dd3f9c37a$exports,
|
|
130
|
-
"tr-TR": $1f7e1cf2285af2b2$exports,
|
|
131
|
-
"uk-UA": $2d999353ca652e34$exports,
|
|
132
|
-
"zh-CN": $117b536bfb1ae554$exports,
|
|
133
|
-
"zh-TW": $525f6fa4ac26e278$exports
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
140
|
-
let stringFormatter = (0, $2Ol32$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($8112f8b883c0272d$exports))), "@react-aria/searchfield");
|
|
141
|
-
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = "search" } = props;
|
|
142
|
-
let onKeyDown = (e)=>{
|
|
143
|
-
const key = e.key;
|
|
144
|
-
if (key === "Enter") e.preventDefault();
|
|
145
|
-
if (isDisabled || isReadOnly) return;
|
|
146
|
-
if (key === "Enter") onSubmit(state.value);
|
|
147
|
-
if (key === "Escape") {
|
|
148
|
-
if (state.value === "") e.continuePropagation();
|
|
149
|
-
else {
|
|
150
|
-
state.setValue("");
|
|
151
|
-
if (onClear) onClear();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
let onClearButtonClick = ()=>{
|
|
156
|
-
state.setValue("");
|
|
157
|
-
if (onClear) onClear();
|
|
158
|
-
};
|
|
159
|
-
let onPressStart = ()=>{
|
|
160
|
-
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
161
|
-
// the input and close the keyboard
|
|
162
|
-
_inputRef_current;
|
|
163
|
-
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
164
|
-
};
|
|
165
|
-
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $2Ol32$useTextField)({
|
|
166
|
-
...props,
|
|
167
|
-
value: state.value,
|
|
168
|
-
onChange: state.setValue,
|
|
169
|
-
onKeyDown: !isReadOnly ? (0, $2Ol32$chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
170
|
-
type: type
|
|
171
|
-
}, inputRef);
|
|
172
|
-
return {
|
|
173
|
-
labelProps: labelProps,
|
|
174
|
-
inputProps: {
|
|
175
|
-
...inputProps,
|
|
176
|
-
// already handled by useSearchFieldState
|
|
177
|
-
defaultValue: undefined
|
|
178
|
-
},
|
|
179
|
-
clearButtonProps: {
|
|
180
|
-
"aria-label": stringFormatter.format("Clear search"),
|
|
181
|
-
excludeFromTabOrder: true,
|
|
182
|
-
// @ts-ignore
|
|
183
|
-
preventFocusOnPress: true,
|
|
184
|
-
isDisabled: isDisabled || isReadOnly,
|
|
185
|
-
onPress: onClearButtonClick,
|
|
186
|
-
onPressStart: onPressStart
|
|
187
|
-
},
|
|
188
|
-
descriptionProps: descriptionProps,
|
|
189
|
-
errorMessageProps: errorMessageProps,
|
|
190
|
-
...validation
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
14
|
|
|
196
15
|
|
|
197
16
|
export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/searchfield/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useSearchField} from './useSearchField';\nexport type {AriaSearchFieldProps} from '@react-types/searchfield';\nexport type {SearchFieldAria} from './useSearchField';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var $8e80a08ea739bb00$exports = require("./intlStrings.main.js");
|
|
2
|
+
var $2KtRb$reactariautils = require("@react-aria/utils");
|
|
3
|
+
var $2KtRb$reactariai18n = require("@react-aria/i18n");
|
|
4
|
+
var $2KtRb$reactariatextfield = require("@react-aria/textfield");
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$export$9bb30bbe003b82e0);
|
|
16
|
+
/*
|
|
17
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
18
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
20
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
*
|
|
22
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
23
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
24
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
|
+
* governing permissions and limitations under the License.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
function $ccae92a71d96d51a$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
31
|
+
let stringFormatter = (0, $2KtRb$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($8e80a08ea739bb00$exports))), '@react-aria/searchfield');
|
|
32
|
+
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = 'search' } = props;
|
|
33
|
+
let onKeyDown = (e)=>{
|
|
34
|
+
const key = e.key;
|
|
35
|
+
if (key === 'Enter') e.preventDefault();
|
|
36
|
+
if (isDisabled || isReadOnly) return;
|
|
37
|
+
if (key === 'Enter') onSubmit(state.value);
|
|
38
|
+
if (key === 'Escape') {
|
|
39
|
+
if (state.value === '') e.continuePropagation();
|
|
40
|
+
else {
|
|
41
|
+
state.setValue('');
|
|
42
|
+
if (onClear) onClear();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
let onClearButtonClick = ()=>{
|
|
47
|
+
state.setValue('');
|
|
48
|
+
if (onClear) onClear();
|
|
49
|
+
};
|
|
50
|
+
let onPressStart = ()=>{
|
|
51
|
+
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
52
|
+
// the input and close the keyboard
|
|
53
|
+
_inputRef_current;
|
|
54
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
55
|
+
};
|
|
56
|
+
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $2KtRb$reactariatextfield.useTextField)({
|
|
57
|
+
...props,
|
|
58
|
+
value: state.value,
|
|
59
|
+
onChange: state.setValue,
|
|
60
|
+
onKeyDown: !isReadOnly ? (0, $2KtRb$reactariautils.chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
61
|
+
type: type
|
|
62
|
+
}, inputRef);
|
|
63
|
+
return {
|
|
64
|
+
labelProps: labelProps,
|
|
65
|
+
inputProps: {
|
|
66
|
+
...inputProps,
|
|
67
|
+
// already handled by useSearchFieldState
|
|
68
|
+
defaultValue: undefined
|
|
69
|
+
},
|
|
70
|
+
clearButtonProps: {
|
|
71
|
+
'aria-label': stringFormatter.format('Clear search'),
|
|
72
|
+
excludeFromTabOrder: true,
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
preventFocusOnPress: true,
|
|
75
|
+
isDisabled: isDisabled || isReadOnly,
|
|
76
|
+
onPress: onClearButtonClick,
|
|
77
|
+
onPressStart: onPressStart
|
|
78
|
+
},
|
|
79
|
+
descriptionProps: descriptionProps,
|
|
80
|
+
errorMessageProps: errorMessageProps,
|
|
81
|
+
...validation
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=useSearchField.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAgCM,SAAS,0CACd,KAA2B,EAC3B,KAAuB,EACvB,QAAqC;IAErC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cACF,UAAU,cACV,UAAU,YACV,WAAW,KAAO,YAClB,OAAO,QACP,OAAO,UACR,GAAG;IAEJ,IAAI,YAAY,CAAC;QACf,MAAM,MAAM,EAAE,GAAG;QAEjB,IAAI,QAAQ,SACV,EAAE,cAAc;QAGlB,IAAI,cAAc,YAChB;QAGF,IAAI,QAAQ,SACV,SAAS,MAAM,KAAK;QAGtB,IAAI,QAAQ;YACV,IAAI,MAAM,KAAK,KAAK,IAClB,EAAE,mBAAmB;iBAChB;gBACL,MAAM,QAAQ,CAAC;gBACf,IAAI,SACF;YAEJ;;IAEJ;IAEA,IAAI,qBAAqB;QACvB,MAAM,QAAQ,CAAC;QAEf,IAAI,SACF;IAEJ;IAEA,IAAI,eAAe;YACjB,+FAA+F;QAC/F,mCAAmC;QACnC;SAAA,oBAAA,SAAS,OAAO,cAAhB,wCAAA,kBAAkB,KAAK;IACzB;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,sCAAW,EAAE;QAC9F,GAAG,KAAK;QACR,OAAO,MAAM,KAAK;QAClB,UAAU,MAAM,QAAQ;QACxB,WAAW,CAAC,aAAa,CAAA,GAAA,2BAAI,EAAE,WAAW,MAAM,SAAS,IAAI,MAAM,SAAS;cAC5E;IACF,GAAG;IAEH,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,yCAAyC;YACzC,cAAc;QAChB;QACA,kBAAkB;YAChB,cAAc,gBAAgB,MAAM,CAAC;YACrC,qBAAqB;YACrB,aAAa;YACb,qBAAqB;YACrB,YAAY,cAAc;YAC1B,SAAS;0BACT;QACF;0BACA;2BACA;QACA,GAAG,UAAU;IACf;AACF","sources":["packages/@react-aria/searchfield/src/useSearchField.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaSearchFieldProps} from '@react-types/searchfield';\nimport {chain} from '@react-aria/utils';\nimport {DOMAttributes, ValidationResult} from '@react-types/shared';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {SearchFieldState} from '@react-stately/searchfield';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTextField} from '@react-aria/textfield';\n\nexport interface SearchFieldAria extends ValidationResult {\n /** Props for the text field's visible label element (if any). */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the clear button. */\n clearButtonProps: AriaButtonProps,\n /** Props for the searchfield's description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the searchfield's error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a search field.\n * @param props - Props for the search field.\n * @param state - State for the search field, as returned by `useSearchFieldState`.\n * @param inputRef - A ref to the input element.\n */\nexport function useSearchField(\n props: AriaSearchFieldProps,\n state: SearchFieldState,\n inputRef: RefObject<HTMLInputElement>\n): SearchFieldAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/searchfield');\n let {\n isDisabled,\n isReadOnly,\n onSubmit = () => {},\n onClear,\n type = 'search'\n } = props;\n\n let onKeyDown = (e) => {\n const key = e.key;\n\n if (key === 'Enter') {\n e.preventDefault();\n }\n\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (key === 'Enter') {\n onSubmit(state.value);\n }\n\n if (key === 'Escape') {\n if (state.value === '') {\n e.continuePropagation();\n } else {\n state.setValue('');\n if (onClear) {\n onClear();\n }\n }\n }\n };\n\n let onClearButtonClick = () => {\n state.setValue('');\n\n if (onClear) {\n onClear();\n }\n };\n\n let onPressStart = () => {\n // this is in PressStart for mobile so that touching the clear button doesn't remove focus from\n // the input and close the keyboard\n inputRef.current?.focus();\n };\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTextField({\n ...props,\n value: state.value,\n onChange: state.setValue,\n onKeyDown: !isReadOnly ? chain(onKeyDown, props.onKeyDown) : props.onKeyDown,\n type\n }, inputRef);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n // already handled by useSearchFieldState\n defaultValue: undefined\n },\n clearButtonProps: {\n 'aria-label': stringFormatter.format('Clear search'),\n excludeFromTabOrder: true,\n // @ts-ignore\n preventFocusOnPress: true,\n isDisabled: isDisabled || isReadOnly,\n onPress: onClearButtonClick,\n onPressStart\n },\n descriptionProps,\n errorMessageProps,\n ...validation\n };\n}\n"],"names":[],"version":3,"file":"useSearchField.main.js.map"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import $kTEqN$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
+
import {chain as $kTEqN$chain} from "@react-aria/utils";
|
|
3
|
+
import {useLocalizedStringFormatter as $kTEqN$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
4
|
+
import {useTextField as $kTEqN$useTextField} from "@react-aria/textfield";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
25
|
+
let stringFormatter = (0, $kTEqN$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kTEqN$intlStringsmodulejs))), '@react-aria/searchfield');
|
|
26
|
+
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = 'search' } = props;
|
|
27
|
+
let onKeyDown = (e)=>{
|
|
28
|
+
const key = e.key;
|
|
29
|
+
if (key === 'Enter') e.preventDefault();
|
|
30
|
+
if (isDisabled || isReadOnly) return;
|
|
31
|
+
if (key === 'Enter') onSubmit(state.value);
|
|
32
|
+
if (key === 'Escape') {
|
|
33
|
+
if (state.value === '') e.continuePropagation();
|
|
34
|
+
else {
|
|
35
|
+
state.setValue('');
|
|
36
|
+
if (onClear) onClear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
let onClearButtonClick = ()=>{
|
|
41
|
+
state.setValue('');
|
|
42
|
+
if (onClear) onClear();
|
|
43
|
+
};
|
|
44
|
+
let onPressStart = ()=>{
|
|
45
|
+
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
46
|
+
// the input and close the keyboard
|
|
47
|
+
_inputRef_current;
|
|
48
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
49
|
+
};
|
|
50
|
+
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $kTEqN$useTextField)({
|
|
51
|
+
...props,
|
|
52
|
+
value: state.value,
|
|
53
|
+
onChange: state.setValue,
|
|
54
|
+
onKeyDown: !isReadOnly ? (0, $kTEqN$chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
55
|
+
type: type
|
|
56
|
+
}, inputRef);
|
|
57
|
+
return {
|
|
58
|
+
labelProps: labelProps,
|
|
59
|
+
inputProps: {
|
|
60
|
+
...inputProps,
|
|
61
|
+
// already handled by useSearchFieldState
|
|
62
|
+
defaultValue: undefined
|
|
63
|
+
},
|
|
64
|
+
clearButtonProps: {
|
|
65
|
+
'aria-label': stringFormatter.format('Clear search'),
|
|
66
|
+
excludeFromTabOrder: true,
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
preventFocusOnPress: true,
|
|
69
|
+
isDisabled: isDisabled || isReadOnly,
|
|
70
|
+
onPress: onClearButtonClick,
|
|
71
|
+
onPressStart: onPressStart
|
|
72
|
+
},
|
|
73
|
+
descriptionProps: descriptionProps,
|
|
74
|
+
errorMessageProps: errorMessageProps,
|
|
75
|
+
...validation
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
|
|
81
|
+
//# sourceMappingURL=useSearchField.module.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import $kTEqN$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
+
import {chain as $kTEqN$chain} from "@react-aria/utils";
|
|
3
|
+
import {useLocalizedStringFormatter as $kTEqN$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
4
|
+
import {useTextField as $kTEqN$useTextField} from "@react-aria/textfield";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
|
|
25
|
+
let stringFormatter = (0, $kTEqN$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kTEqN$intlStringsmodulejs))), '@react-aria/searchfield');
|
|
26
|
+
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = 'search' } = props;
|
|
27
|
+
let onKeyDown = (e)=>{
|
|
28
|
+
const key = e.key;
|
|
29
|
+
if (key === 'Enter') e.preventDefault();
|
|
30
|
+
if (isDisabled || isReadOnly) return;
|
|
31
|
+
if (key === 'Enter') onSubmit(state.value);
|
|
32
|
+
if (key === 'Escape') {
|
|
33
|
+
if (state.value === '') e.continuePropagation();
|
|
34
|
+
else {
|
|
35
|
+
state.setValue('');
|
|
36
|
+
if (onClear) onClear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
let onClearButtonClick = ()=>{
|
|
41
|
+
state.setValue('');
|
|
42
|
+
if (onClear) onClear();
|
|
43
|
+
};
|
|
44
|
+
let onPressStart = ()=>{
|
|
45
|
+
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
|
|
46
|
+
// the input and close the keyboard
|
|
47
|
+
_inputRef_current;
|
|
48
|
+
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
49
|
+
};
|
|
50
|
+
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $kTEqN$useTextField)({
|
|
51
|
+
...props,
|
|
52
|
+
value: state.value,
|
|
53
|
+
onChange: state.setValue,
|
|
54
|
+
onKeyDown: !isReadOnly ? (0, $kTEqN$chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
|
|
55
|
+
type: type
|
|
56
|
+
}, inputRef);
|
|
57
|
+
return {
|
|
58
|
+
labelProps: labelProps,
|
|
59
|
+
inputProps: {
|
|
60
|
+
...inputProps,
|
|
61
|
+
// already handled by useSearchFieldState
|
|
62
|
+
defaultValue: undefined
|
|
63
|
+
},
|
|
64
|
+
clearButtonProps: {
|
|
65
|
+
'aria-label': stringFormatter.format('Clear search'),
|
|
66
|
+
excludeFromTabOrder: true,
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
preventFocusOnPress: true,
|
|
69
|
+
isDisabled: isDisabled || isReadOnly,
|
|
70
|
+
onPress: onClearButtonClick,
|
|
71
|
+
onPressStart: onPressStart
|
|
72
|
+
},
|
|
73
|
+
descriptionProps: descriptionProps,
|
|
74
|
+
errorMessageProps: errorMessageProps,
|
|
75
|
+
...validation
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
|
|
81
|
+
//# sourceMappingURL=useSearchField.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAgCM,SAAS,0CACd,KAA2B,EAC3B,KAAuB,EACvB,QAAqC;IAErC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,cACF,UAAU,cACV,UAAU,YACV,WAAW,KAAO,YAClB,OAAO,QACP,OAAO,UACR,GAAG;IAEJ,IAAI,YAAY,CAAC;QACf,MAAM,MAAM,EAAE,GAAG;QAEjB,IAAI,QAAQ,SACV,EAAE,cAAc;QAGlB,IAAI,cAAc,YAChB;QAGF,IAAI,QAAQ,SACV,SAAS,MAAM,KAAK;QAGtB,IAAI,QAAQ;YACV,IAAI,MAAM,KAAK,KAAK,IAClB,EAAE,mBAAmB;iBAChB;gBACL,MAAM,QAAQ,CAAC;gBACf,IAAI,SACF;YAEJ;;IAEJ;IAEA,IAAI,qBAAqB;QACvB,MAAM,QAAQ,CAAC;QAEf,IAAI,SACF;IAEJ;IAEA,IAAI,eAAe;YACjB,+FAA+F;QAC/F,mCAAmC;QACnC;SAAA,oBAAA,SAAS,OAAO,cAAhB,wCAAA,kBAAkB,KAAK;IACzB;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC9F,GAAG,KAAK;QACR,OAAO,MAAM,KAAK;QAClB,UAAU,MAAM,QAAQ;QACxB,WAAW,CAAC,aAAa,CAAA,GAAA,YAAI,EAAE,WAAW,MAAM,SAAS,IAAI,MAAM,SAAS;cAC5E;IACF,GAAG;IAEH,OAAO;oBACL;QACA,YAAY;YACV,GAAG,UAAU;YACb,yCAAyC;YACzC,cAAc;QAChB;QACA,kBAAkB;YAChB,cAAc,gBAAgB,MAAM,CAAC;YACrC,qBAAqB;YACrB,aAAa;YACb,qBAAqB;YACrB,YAAY,cAAc;YAC1B,SAAS;0BACT;QACF;0BACA;2BACA;QACA,GAAG,UAAU;IACf;AACF","sources":["packages/@react-aria/searchfield/src/useSearchField.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaSearchFieldProps} from '@react-types/searchfield';\nimport {chain} from '@react-aria/utils';\nimport {DOMAttributes, ValidationResult} from '@react-types/shared';\nimport {InputHTMLAttributes, LabelHTMLAttributes, RefObject} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {SearchFieldState} from '@react-stately/searchfield';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTextField} from '@react-aria/textfield';\n\nexport interface SearchFieldAria extends ValidationResult {\n /** Props for the text field's visible label element (if any). */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the clear button. */\n clearButtonProps: AriaButtonProps,\n /** Props for the searchfield's description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the searchfield's error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a search field.\n * @param props - Props for the search field.\n * @param state - State for the search field, as returned by `useSearchFieldState`.\n * @param inputRef - A ref to the input element.\n */\nexport function useSearchField(\n props: AriaSearchFieldProps,\n state: SearchFieldState,\n inputRef: RefObject<HTMLInputElement>\n): SearchFieldAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/searchfield');\n let {\n isDisabled,\n isReadOnly,\n onSubmit = () => {},\n onClear,\n type = 'search'\n } = props;\n\n let onKeyDown = (e) => {\n const key = e.key;\n\n if (key === 'Enter') {\n e.preventDefault();\n }\n\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (key === 'Enter') {\n onSubmit(state.value);\n }\n\n if (key === 'Escape') {\n if (state.value === '') {\n e.continuePropagation();\n } else {\n state.setValue('');\n if (onClear) {\n onClear();\n }\n }\n }\n };\n\n let onClearButtonClick = () => {\n state.setValue('');\n\n if (onClear) {\n onClear();\n }\n };\n\n let onPressStart = () => {\n // this is in PressStart for mobile so that touching the clear button doesn't remove focus from\n // the input and close the keyboard\n inputRef.current?.focus();\n };\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTextField({\n ...props,\n value: state.value,\n onChange: state.setValue,\n onKeyDown: !isReadOnly ? chain(onKeyDown, props.onKeyDown) : props.onKeyDown,\n type\n }, inputRef);\n\n return {\n labelProps,\n inputProps: {\n ...inputProps,\n // already handled by useSearchFieldState\n defaultValue: undefined\n },\n clearButtonProps: {\n 'aria-label': stringFormatter.format('Clear search'),\n excludeFromTabOrder: true,\n // @ts-ignore\n preventFocusOnPress: true,\n isDisabled: isDisabled || isReadOnly,\n onPress: onClearButtonClick,\n onPressStart\n },\n descriptionProps,\n errorMessageProps,\n ...validation\n };\n}\n"],"names":[],"version":3,"file":"useSearchField.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/searchfield",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.5",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/i18n": "^3.
|
|
26
|
-
"@react-aria/textfield": "^3.14.
|
|
27
|
-
"@react-aria/utils": "^3.
|
|
28
|
-
"@react-stately/searchfield": "^3.5.
|
|
29
|
-
"@react-types/button": "^3.9.
|
|
30
|
-
"@react-types/searchfield": "^3.5.
|
|
31
|
-
"@react-types/shared": "^3.
|
|
25
|
+
"@react-aria/i18n": "^3.11.1",
|
|
26
|
+
"@react-aria/textfield": "^3.14.5",
|
|
27
|
+
"@react-aria/utils": "^3.24.1",
|
|
28
|
+
"@react-stately/searchfield": "^3.5.3",
|
|
29
|
+
"@react-types/button": "^3.9.4",
|
|
30
|
+
"@react-types/searchfield": "^3.5.5",
|
|
31
|
+
"@react-types/shared": "^3.23.1",
|
|
32
32
|
"@swc/helpers": "^0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
41
41
|
}
|