@kne/super-select 0.1.11 → 0.1.12
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/README.md +6 -6
- package/dist/index.js +57 -2594
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +54 -2594
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -76,21 +76,21 @@ const BaseExample = () => {
|
|
|
76
76
|
<SuperSelect single options={[...optionList, {
|
|
77
77
|
value: 'other', label: '超长label项超长label项超长label项超长label项超长label项超长label项超长label项超长label项'
|
|
78
78
|
}]} />
|
|
79
|
-
<SuperSelect allowSelectedAll options={optionList} maxLength={10} getSearchCallback={(searchText, item) => {
|
|
80
|
-
return item.label.indexOf(searchText) > -1;
|
|
79
|
+
<SuperSelect allowSelectedAll options={optionList} maxLength={10} getSearchCallback={({ searchText }, item) => {
|
|
80
|
+
return !searchText || item.label.indexOf(searchText) > -1;
|
|
81
81
|
}} />
|
|
82
|
-
<SuperSelect allowSelectedAll options={optionList} isPopup={false} getSearchCallback={(searchText, item) => {
|
|
83
|
-
return item.label.indexOf(searchText) > -1;
|
|
82
|
+
<SuperSelect allowSelectedAll options={optionList} isPopup={false} getSearchCallback={({ searchText }, item) => {
|
|
83
|
+
return !searchText || item.label.indexOf(searchText) > -1;
|
|
84
84
|
}} />
|
|
85
85
|
<SuperSelect api={{
|
|
86
86
|
data: {}, loader: ({ data }) => {
|
|
87
|
-
const { searchText } = data;
|
|
87
|
+
const { searchText } = data.searchProps;
|
|
88
88
|
if (!searchText) {
|
|
89
89
|
return {
|
|
90
90
|
pageData: optionList, totalCount: optionList.length
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
const newOptionList = optionList.filter((item) => item.label.indexOf(searchText) > -1);
|
|
93
|
+
const newOptionList = optionList.filter((item) => !searchText || item.label.indexOf(searchText) > -1);
|
|
94
94
|
return {
|
|
95
95
|
pageData: newOptionList, totalCount: newOptionList.length
|
|
96
96
|
};
|