@react-stately/searchfield 3.5.1 → 3.5.3
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 -24
- package/dist/main.js +2 -25
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -24
- package/dist/module.js.map +1 -1
- package/dist/useSearchFieldState.main.js +33 -0
- package/dist/useSearchFieldState.main.js.map +1 -0
- package/dist/useSearchFieldState.mjs +28 -0
- package/dist/useSearchFieldState.module.js +28 -0
- package/dist/useSearchFieldState.module.js.map +1 -0
- package/package.json +4 -4
package/dist/import.mjs
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useSearchFieldState as $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2} from "./useSearchFieldState.mjs";
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/ /*
|
|
14
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
15
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
6
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -21,19 +11,6 @@ import {useControlledState as $ihOoW$useControlledState} from "@react-stately/ut
|
|
|
21
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
12
|
* governing permissions and limitations under the License.
|
|
23
13
|
*/
|
|
24
|
-
function $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2(props) {
|
|
25
|
-
let [value, setValue] = (0, $ihOoW$useControlledState)($0b2218c4e3fe7d7e$var$toString(props.value), $0b2218c4e3fe7d7e$var$toString(props.defaultValue) || "", props.onChange);
|
|
26
|
-
return {
|
|
27
|
-
value: value,
|
|
28
|
-
setValue: setValue
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function $0b2218c4e3fe7d7e$var$toString(val) {
|
|
32
|
-
if (val == null) return;
|
|
33
|
-
return val.toString();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
14
|
|
|
38
15
|
|
|
39
16
|
export {$0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2 as useSearchFieldState};
|
package/dist/main.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
var $
|
|
1
|
+
var $1fa0a0eef7fd0825$exports = require("./useSearchFieldState.main.js");
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
$parcel$export(module.exports, "useSearchFieldState", () => $1fa0a0eef7fd0825$
|
|
8
|
+
$parcel$export(module.exports, "useSearchFieldState", () => $1fa0a0eef7fd0825$exports.useSearchFieldState);
|
|
9
9
|
/*
|
|
10
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
11
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
-
* governing permissions and limitations under the License.
|
|
19
|
-
*/ /*
|
|
20
10
|
* Copyright 2020 Adobe. All rights reserved.
|
|
21
11
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
12
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -27,19 +17,6 @@ $parcel$export(module.exports, "useSearchFieldState", () => $1fa0a0eef7fd0825$ex
|
|
|
27
17
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
18
|
* governing permissions and limitations under the License.
|
|
29
19
|
*/
|
|
30
|
-
function $1fa0a0eef7fd0825$export$3f8be18b0f41eaf2(props) {
|
|
31
|
-
let [value, setValue] = (0, $lgnI8$reactstatelyutils.useControlledState)($1fa0a0eef7fd0825$var$toString(props.value), $1fa0a0eef7fd0825$var$toString(props.defaultValue) || "", props.onChange);
|
|
32
|
-
return {
|
|
33
|
-
value: value,
|
|
34
|
-
setValue: setValue
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function $1fa0a0eef7fd0825$var$toString(val) {
|
|
38
|
-
if (val == null) return;
|
|
39
|
-
return val.toString();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
20
|
|
|
44
21
|
|
|
45
22
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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 */\n\nexport {useSearchFieldState} from './useSearchFieldState';\n\nexport type {SearchFieldProps} from '@react-types/searchfield';\nexport type {SearchFieldState} from './useSearchFieldState';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useSearchFieldState as $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2} from "./useSearchFieldState.module.js";
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
-
* governing permissions and limitations under the License.
|
|
13
|
-
*/ /*
|
|
14
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
15
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
6
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -21,19 +11,6 @@ import {useControlledState as $ihOoW$useControlledState} from "@react-stately/ut
|
|
|
21
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
12
|
* governing permissions and limitations under the License.
|
|
23
13
|
*/
|
|
24
|
-
function $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2(props) {
|
|
25
|
-
let [value, setValue] = (0, $ihOoW$useControlledState)($0b2218c4e3fe7d7e$var$toString(props.value), $0b2218c4e3fe7d7e$var$toString(props.defaultValue) || "", props.onChange);
|
|
26
|
-
return {
|
|
27
|
-
value: value,
|
|
28
|
-
setValue: setValue
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function $0b2218c4e3fe7d7e$var$toString(val) {
|
|
32
|
-
if (val == null) return;
|
|
33
|
-
return val.toString();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
14
|
|
|
38
15
|
|
|
39
16
|
export {$0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2 as useSearchFieldState};
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-stately/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 */\n\nexport {useSearchFieldState} from './useSearchFieldState';\n\nexport type {SearchFieldProps} from '@react-types/searchfield';\nexport type {SearchFieldState} from './useSearchFieldState';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var $5voL7$reactstatelyutils = require("@react-stately/utils");
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
$parcel$export(module.exports, "useSearchFieldState", () => $1fa0a0eef7fd0825$export$3f8be18b0f41eaf2);
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
function $1fa0a0eef7fd0825$export$3f8be18b0f41eaf2(props) {
|
|
21
|
+
let [value, setValue] = (0, $5voL7$reactstatelyutils.useControlledState)($1fa0a0eef7fd0825$var$toString(props.value), $1fa0a0eef7fd0825$var$toString(props.defaultValue) || '', props.onChange);
|
|
22
|
+
return {
|
|
23
|
+
value: value,
|
|
24
|
+
setValue: setValue
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function $1fa0a0eef7fd0825$var$toString(val) {
|
|
28
|
+
if (val == null) return;
|
|
29
|
+
return val.toString();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=useSearchFieldState.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAgBM,SAAS,0CAAoB,KAAuB;IACzD,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,2CAAiB,EAAE,+BAAS,MAAM,KAAK,GAAG,+BAAS,MAAM,YAAY,KAAK,IAAI,MAAM,QAAQ;IAEpH,OAAO;eACL;kBACA;IACF;AACF;AAEA,SAAS,+BAAS,GAAG;IACnB,IAAI,OAAO,MACT;IAGF,OAAO,IAAI,QAAQ;AACrB","sources":["packages/@react-stately/searchfield/src/useSearchFieldState.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 {SearchFieldProps} from '@react-types/searchfield';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface SearchFieldState {\n /** The current value of the search field. */\n readonly value: string,\n\n /** Sets the value of the search field. */\n setValue(value: string): void\n}\n\n/**\n * Provides state management for a search field.\n */\nexport function useSearchFieldState(props: SearchFieldProps): SearchFieldState {\n let [value, setValue] = useControlledState(toString(props.value), toString(props.defaultValue) || '', props.onChange);\n\n return {\n value,\n setValue\n };\n}\n\nfunction toString(val) {\n if (val == null) {\n return;\n }\n\n return val.toString();\n}\n"],"names":[],"version":3,"file":"useSearchFieldState.main.js.map"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {useControlledState as $58ylH$useControlledState} from "@react-stately/utils";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
function $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2(props) {
|
|
15
|
+
let [value, setValue] = (0, $58ylH$useControlledState)($0b2218c4e3fe7d7e$var$toString(props.value), $0b2218c4e3fe7d7e$var$toString(props.defaultValue) || '', props.onChange);
|
|
16
|
+
return {
|
|
17
|
+
value: value,
|
|
18
|
+
setValue: setValue
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function $0b2218c4e3fe7d7e$var$toString(val) {
|
|
22
|
+
if (val == null) return;
|
|
23
|
+
return val.toString();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export {$0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2 as useSearchFieldState};
|
|
28
|
+
//# sourceMappingURL=useSearchFieldState.module.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {useControlledState as $58ylH$useControlledState} from "@react-stately/utils";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
function $0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2(props) {
|
|
15
|
+
let [value, setValue] = (0, $58ylH$useControlledState)($0b2218c4e3fe7d7e$var$toString(props.value), $0b2218c4e3fe7d7e$var$toString(props.defaultValue) || '', props.onChange);
|
|
16
|
+
return {
|
|
17
|
+
value: value,
|
|
18
|
+
setValue: setValue
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function $0b2218c4e3fe7d7e$var$toString(val) {
|
|
22
|
+
if (val == null) return;
|
|
23
|
+
return val.toString();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export {$0b2218c4e3fe7d7e$export$3f8be18b0f41eaf2 as useSearchFieldState};
|
|
28
|
+
//# sourceMappingURL=useSearchFieldState.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAgBM,SAAS,0CAAoB,KAAuB;IACzD,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,yBAAiB,EAAE,+BAAS,MAAM,KAAK,GAAG,+BAAS,MAAM,YAAY,KAAK,IAAI,MAAM,QAAQ;IAEpH,OAAO;eACL;kBACA;IACF;AACF;AAEA,SAAS,+BAAS,GAAG;IACnB,IAAI,OAAO,MACT;IAGF,OAAO,IAAI,QAAQ;AACrB","sources":["packages/@react-stately/searchfield/src/useSearchFieldState.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 {SearchFieldProps} from '@react-types/searchfield';\nimport {useControlledState} from '@react-stately/utils';\n\nexport interface SearchFieldState {\n /** The current value of the search field. */\n readonly value: string,\n\n /** Sets the value of the search field. */\n setValue(value: string): void\n}\n\n/**\n * Provides state management for a search field.\n */\nexport function useSearchFieldState(props: SearchFieldProps): SearchFieldState {\n let [value, setValue] = useControlledState(toString(props.value), toString(props.defaultValue) || '', props.onChange);\n\n return {\n value,\n setValue\n };\n}\n\nfunction toString(val) {\n if (val == null) {\n return;\n }\n\n return val.toString();\n}\n"],"names":[],"version":3,"file":"useSearchFieldState.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/searchfield",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-stately/utils": "^3.
|
|
26
|
-
"@react-types/searchfield": "^3.5.
|
|
25
|
+
"@react-stately/utils": "^3.10.1",
|
|
26
|
+
"@react-types/searchfield": "^3.5.5",
|
|
27
27
|
"@swc/helpers": "^0.5.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
36
36
|
}
|