@react-aria/searchfield 3.7.3 → 3.7.4
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/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- 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/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- 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/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +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/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +9 -9
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
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"}
|
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/uk-UA.mjs
CHANGED
|
@@ -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
|