@kne/super-select 0.1.5 → 0.1.7
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 -3
- package/dist/index.css +30 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +34 -17
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -17
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2240,7 +2240,7 @@ function isEqual(value, other) {
|
|
|
2240
2240
|
|
|
2241
2241
|
var isEqual_1 = isEqual;
|
|
2242
2242
|
|
|
2243
|
-
var style$3 = {"select-input":"_d8lGc","disabled":"_3kjwO","wrap":"_dsTM2","select-input-inner":"_NQoX9","large":"_T8ZX8","small":"_1B72H","select-input-icon":"_g8QC-","placeholder":"_r3q69","overlay-content":"_zEqGe","overlay":"_ybN30"};
|
|
2243
|
+
var style$3 = {"select-input":"_d8lGc","disabled":"_3kjwO","wrap":"_dsTM2","select-input-inner":"_NQoX9","large":"_T8ZX8","small":"_1B72H","select-input-icon":"_g8QC-","placeholder":"_r3q69","overlay-content":"_zEqGe","overlay":"_ybN30","select-input-prefix":"_4Pw75","select-input-suffix":"_Wd4pE"};
|
|
2244
2244
|
|
|
2245
2245
|
const _excluded$1 = ["children"];
|
|
2246
2246
|
const numberToPx = val => {
|
|
@@ -2307,6 +2307,8 @@ const SelectInput = p => {
|
|
|
2307
2307
|
labelWrap: true,
|
|
2308
2308
|
showSelectedTag: true,
|
|
2309
2309
|
allowClear: true,
|
|
2310
|
+
prefix: null,
|
|
2311
|
+
suffix: null,
|
|
2310
2312
|
extra: null,
|
|
2311
2313
|
renderModal: contextProps => {
|
|
2312
2314
|
const {
|
|
@@ -2346,6 +2348,8 @@ const SelectInput = p => {
|
|
|
2346
2348
|
});
|
|
2347
2349
|
const {
|
|
2348
2350
|
children,
|
|
2351
|
+
prefix,
|
|
2352
|
+
suffix,
|
|
2349
2353
|
className,
|
|
2350
2354
|
maxLength,
|
|
2351
2355
|
overlayClassName,
|
|
@@ -2422,7 +2426,12 @@ const SelectInput = p => {
|
|
|
2422
2426
|
onMouseOut: () => {
|
|
2423
2427
|
setHover(false);
|
|
2424
2428
|
}
|
|
2425
|
-
}), /*#__PURE__*/React.createElement("
|
|
2429
|
+
}), prefix && /*#__PURE__*/React.createElement("span", {
|
|
2430
|
+
className: classnames(style$3['select-input-prefix'], 'select-input-prefix'),
|
|
2431
|
+
onClick: e => {
|
|
2432
|
+
e.stopPropagation();
|
|
2433
|
+
}
|
|
2434
|
+
}, typeof prefix === 'function' ? prefix(contextProps) : prefix), /*#__PURE__*/React.createElement("div", {
|
|
2426
2435
|
className: classnames(style$3['select-input-inner'], 'select-input-inner')
|
|
2427
2436
|
}, value.length > 0 ? single || value[0].value === selectedAllValue.value ? value[0].label : value.map(item => {
|
|
2428
2437
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
@@ -2443,7 +2452,12 @@ const SelectInput = p => {
|
|
|
2443
2452
|
e.stopPropagation();
|
|
2444
2453
|
setValue([]);
|
|
2445
2454
|
}
|
|
2446
|
-
}) : /*#__PURE__*/React.createElement(DownOutlined, null))
|
|
2455
|
+
}) : /*#__PURE__*/React.createElement(DownOutlined, null)), suffix && /*#__PURE__*/React.createElement("span", {
|
|
2456
|
+
className: classnames(style$3['select-input-suffix'], 'select-input-suffix'),
|
|
2457
|
+
onClick: e => {
|
|
2458
|
+
e.stopPropagation();
|
|
2459
|
+
}
|
|
2460
|
+
}, typeof suffix === 'function' ? suffix(contextProps) : suffix));
|
|
2447
2461
|
const contextProps = {
|
|
2448
2462
|
props,
|
|
2449
2463
|
value: value,
|
|
@@ -2871,7 +2885,7 @@ const computedIsSelectAll = (value, selectedAllValue) => {
|
|
|
2871
2885
|
return (value == null ? void 0 : value.length) === 1 && get_1(value, '[0].value') === selectedAllValue.value;
|
|
2872
2886
|
};
|
|
2873
2887
|
|
|
2874
|
-
var style$1 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-container":"_dKZHi","tag-container-inner":"_oijCI"};
|
|
2888
|
+
var style$1 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-container":"_dKZHi","tag-container-inner":"_oijCI","tag":"_WmnnS","tag-inner":"_TMcFl"};
|
|
2875
2889
|
|
|
2876
2890
|
const SelectedTagList = () => {
|
|
2877
2891
|
const {
|
|
@@ -2897,6 +2911,7 @@ const SelectedTagList = () => {
|
|
|
2897
2911
|
className: style$1['tag-container-inner']
|
|
2898
2912
|
}, value.map(item => {
|
|
2899
2913
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
2914
|
+
className: style$1['tag'],
|
|
2900
2915
|
key: item.value,
|
|
2901
2916
|
closable: true,
|
|
2902
2917
|
bordered: false,
|
|
@@ -2904,7 +2919,9 @@ const SelectedTagList = () => {
|
|
|
2904
2919
|
e.preventDefault();
|
|
2905
2920
|
onRemove(item);
|
|
2906
2921
|
}
|
|
2907
|
-
},
|
|
2922
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
2923
|
+
className: style$1['tag-inner']
|
|
2924
|
+
}, item.label));
|
|
2908
2925
|
}))));
|
|
2909
2926
|
};
|
|
2910
2927
|
|
|
@@ -3822,7 +3839,7 @@ _createAssigner(function(object, source, srcIndex) {
|
|
|
3822
3839
|
_baseMerge(object, source, srcIndex);
|
|
3823
3840
|
});
|
|
3824
3841
|
|
|
3825
|
-
var style = {"list":"_IsXdU","is-popup":"_-dvpa","default-list":"_QD1Mz","is-selected-all":"_M-mOy","
|
|
3842
|
+
var style = {"list":"_IsXdU","is-popup":"_-dvpa","default-list":"_QD1Mz","is-selected-all":"_M-mOy","default-list-item":"_KtOsz","is-selected":"_TQhBB","single-checked":"_2rUrh","is-disabled":"_NbwX5","selected-all":"_vN2Fx","selected-tag":"_6oITk","select-search":"_iAH9D"};
|
|
3826
3843
|
|
|
3827
3844
|
const _excluded = ["children"];
|
|
3828
3845
|
const SelectList = _ref => {
|
|
@@ -3834,11 +3851,7 @@ const SelectList = _ref => {
|
|
|
3834
3851
|
renderItemContent: ({
|
|
3835
3852
|
item
|
|
3836
3853
|
}) => {
|
|
3837
|
-
return /*#__PURE__*/React.createElement(
|
|
3838
|
-
vertical: true,
|
|
3839
|
-
gag: 8,
|
|
3840
|
-
flex: 1
|
|
3841
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
3854
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
3842
3855
|
className: 'select-list-item-label'
|
|
3843
3856
|
}, item.label), item.description && /*#__PURE__*/React.createElement("div", {
|
|
3844
3857
|
className: 'select-list-item-description'
|
|
@@ -3884,7 +3897,12 @@ const SelectList = _ref => {
|
|
|
3884
3897
|
}, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3885
3898
|
checked: isSelectedAll || isChecked,
|
|
3886
3899
|
disabled: isSelectedAll || item.disabled
|
|
3887
|
-
})),
|
|
3900
|
+
})), /*#__PURE__*/React.createElement(Flex, {
|
|
3901
|
+
vertical: true,
|
|
3902
|
+
gag: 8,
|
|
3903
|
+
flex: 1,
|
|
3904
|
+
className: 'select-list-item-content'
|
|
3905
|
+
}, renderItemContent(contextProps)), single && /*#__PURE__*/React.createElement("div", {
|
|
3888
3906
|
className: style['single-checked']
|
|
3889
3907
|
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
3890
3908
|
},
|
|
@@ -3950,7 +3968,7 @@ const SelectList = _ref => {
|
|
|
3950
3968
|
})
|
|
3951
3969
|
}, !single && allowSelectedAll && /*#__PURE__*/React.createElement(SelectedAll, null)),
|
|
3952
3970
|
fetchList: /*#__PURE__*/React.createElement(FetchScrollLoader, _extends({}, props, {
|
|
3953
|
-
className: classnames(style['list'], 'select-list', {
|
|
3971
|
+
className: classnames(style['list'], 'select-list-scroll-list', {
|
|
3954
3972
|
'is-popup': isPopup
|
|
3955
3973
|
}),
|
|
3956
3974
|
searchText: searchText,
|
|
@@ -3963,6 +3981,7 @@ const SelectList = _ref => {
|
|
|
3963
3981
|
loader: ({
|
|
3964
3982
|
data
|
|
3965
3983
|
}) => {
|
|
3984
|
+
console.log(data);
|
|
3966
3985
|
const {
|
|
3967
3986
|
options,
|
|
3968
3987
|
searchText
|
|
@@ -3970,13 +3989,11 @@ const SelectList = _ref => {
|
|
|
3970
3989
|
if (typeof getSearchCallback === 'function') {
|
|
3971
3990
|
const newOptions = options.filter(item => getSearchCallback(searchText, item));
|
|
3972
3991
|
return {
|
|
3973
|
-
pageData: newOptions
|
|
3974
|
-
totalCount: newOptions.length
|
|
3992
|
+
pageData: newOptions
|
|
3975
3993
|
};
|
|
3976
3994
|
}
|
|
3977
3995
|
return {
|
|
3978
|
-
pageData: options
|
|
3979
|
-
totalCount: options.length
|
|
3996
|
+
pageData: options
|
|
3980
3997
|
};
|
|
3981
3998
|
}
|
|
3982
3999
|
} : api)
|