@kne/super-select 0.1.19 → 0.1.20
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 +82 -40
- package/dist/index.css +17 -5
- package/dist/index.css.map +1 -1
- package/dist/index.js +44 -29
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -8
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,44 +115,86 @@ const { Space, Button } = antd;
|
|
|
115
115
|
|
|
116
116
|
const optionList = Array.from({ length: 20 }).map((item, key) => {
|
|
117
117
|
return {
|
|
118
|
-
label: `第${key + 1}项`,
|
|
118
|
+
label: `第${key + 1}项`,
|
|
119
|
+
value: key + 1,
|
|
120
|
+
disabled: key === 1
|
|
119
121
|
};
|
|
120
122
|
});
|
|
121
123
|
|
|
122
124
|
const BaseExample = () => {
|
|
123
|
-
return
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
125
|
+
return (
|
|
126
|
+
<Space wrap>
|
|
127
|
+
<SuperSelect options={optionList} suffix={<Button type="text">预览</Button>} prefix={<Button type="text">查看</Button>} />
|
|
128
|
+
<SuperSelect
|
|
129
|
+
single
|
|
130
|
+
options={[
|
|
131
|
+
...optionList,
|
|
132
|
+
{
|
|
133
|
+
value: 'other',
|
|
134
|
+
label: '超长label项超长label项超长label项超长label项超长label项超长label项超长label项超长label项'
|
|
135
|
+
}
|
|
136
|
+
]}
|
|
137
|
+
/>
|
|
138
|
+
<SuperSelect
|
|
139
|
+
allowSelectedAll
|
|
140
|
+
options={optionList}
|
|
141
|
+
maxLength={10}
|
|
142
|
+
getSearchCallback={({ searchText }, item) => {
|
|
143
|
+
return !searchText || item.label.indexOf(searchText) > -1;
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
<SuperSelect
|
|
147
|
+
allowSelectedAll
|
|
148
|
+
options={optionList}
|
|
149
|
+
isPopup={false}
|
|
150
|
+
getSearchCallback={({ searchText }, item) => {
|
|
151
|
+
return !searchText || item.label.indexOf(searchText) > -1;
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
<SuperSelect
|
|
155
|
+
api={{
|
|
156
|
+
data: {},
|
|
157
|
+
loader: ({ data }) => {
|
|
158
|
+
const searchText = data.searchProps && data.searchProps.searchText;
|
|
159
|
+
if (!searchText) {
|
|
160
|
+
return {
|
|
161
|
+
pageData: optionList,
|
|
162
|
+
totalCount: optionList.length
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
const newOptionList = optionList.filter(item => !searchText || item.label.indexOf(searchText) > -1);
|
|
166
|
+
return {
|
|
167
|
+
pageData: newOptionList,
|
|
168
|
+
totalCount: newOptionList.length
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}}
|
|
172
|
+
isPopup={false}
|
|
173
|
+
getSearchProps={({ searchText }) => {
|
|
174
|
+
return { searchText };
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
|
|
178
|
+
<SuperSelect
|
|
179
|
+
defaultOpen
|
|
180
|
+
options={optionList}
|
|
181
|
+
inputRender={({ value }) => {
|
|
182
|
+
return <Button type="link">编辑</Button>;
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<SuperSelect
|
|
187
|
+
options={optionList}
|
|
188
|
+
footer={({ close, reload }) => {
|
|
189
|
+
return (
|
|
190
|
+
<Button type="link" onClick={reload}>
|
|
191
|
+
添加
|
|
192
|
+
</Button>
|
|
193
|
+
);
|
|
194
|
+
}}
|
|
195
|
+
/>
|
|
196
|
+
</Space>
|
|
197
|
+
);
|
|
156
198
|
};
|
|
157
199
|
|
|
158
200
|
render(<BaseExample />);
|
|
@@ -183,12 +225,12 @@ const columns = [{
|
|
|
183
225
|
|
|
184
226
|
const BaseExample = () => {
|
|
185
227
|
return <Space wrap>
|
|
186
|
-
<SelectTableList options={optionList} columns={columns} valueKey="id" />
|
|
187
|
-
<SelectTableList single options={optionList} columns={columns} valueKey="id" />
|
|
188
|
-
<SelectTableList allowSelectedAll options={optionList} columns={columns} valueKey="id" />
|
|
189
|
-
<SelectTableList options={optionList} columns={columns} isPopup={false} valueKey="id" />
|
|
190
|
-
<SelectTableList allowSelectedAll options={optionList} columns={columns} isPopup={false} valueKey="id" />
|
|
191
|
-
<SelectTableList single options={optionList} columns={columns} isPopup={false} valueKey="id" />
|
|
228
|
+
<SelectTableList options={optionList} columns={columns} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
229
|
+
<SelectTableList single options={optionList} columns={columns} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
230
|
+
<SelectTableList allowSelectedAll options={optionList} columns={columns} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
231
|
+
<SelectTableList options={optionList} columns={columns} isPopup={false} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
232
|
+
<SelectTableList allowSelectedAll options={optionList} columns={columns} isPopup={false} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
233
|
+
<SelectTableList single options={optionList} columns={columns} isPopup={false} valueKey="id" footer={<Button type="link">预览</Button>}/>
|
|
192
234
|
</Space>;
|
|
193
235
|
};
|
|
194
236
|
|
package/dist/index.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
background-color: #fff;
|
|
4
4
|
font-size: var(--font-size-default);
|
|
5
5
|
border: 1px solid var(--font-color-grey-3);
|
|
6
|
-
border-radius: 2px;
|
|
6
|
+
border-radius: var(--radius-default, 2px);
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
min-width: 150px;
|
|
9
9
|
position: relative;
|
|
@@ -210,6 +210,10 @@
|
|
|
210
210
|
overflow: hidden;
|
|
211
211
|
text-overflow: ellipsis;
|
|
212
212
|
}
|
|
213
|
+
|
|
214
|
+
._v3f23 {
|
|
215
|
+
border-top: solid 1px var(--font-color-grey-4);
|
|
216
|
+
}
|
|
213
217
|
._DrEYJ {
|
|
214
218
|
max-height: 300px;
|
|
215
219
|
}
|
|
@@ -303,8 +307,8 @@
|
|
|
303
307
|
}
|
|
304
308
|
|
|
305
309
|
._ttNK9 {
|
|
306
|
-
border-bottom: 1px solid
|
|
307
|
-
border-right: 1px solid
|
|
310
|
+
border-bottom: 1px solid var(--font-color-grey-4);
|
|
311
|
+
border-right: 1px solid var(--font-color-grey-4);
|
|
308
312
|
line-height: 20px;
|
|
309
313
|
}
|
|
310
314
|
._ttNK9:not(:last-child) {
|
|
@@ -315,8 +319,8 @@
|
|
|
315
319
|
._SvfzQ {
|
|
316
320
|
font-size: var(--font-size-default);
|
|
317
321
|
padding: 8px 16px;
|
|
318
|
-
border-top: 1px solid
|
|
319
|
-
border-left: 1px solid
|
|
322
|
+
border-top: 1px solid var(--font-color-grey-4);
|
|
323
|
+
border-left: 1px solid var(--font-color-grey-4);
|
|
320
324
|
line-height: 20px;
|
|
321
325
|
word-break: break-all;
|
|
322
326
|
}
|
|
@@ -330,4 +334,12 @@
|
|
|
330
334
|
word-break: break-all;
|
|
331
335
|
white-space: pre-line;
|
|
332
336
|
}
|
|
337
|
+
|
|
338
|
+
._lISfA {
|
|
339
|
+
border-top: 1px solid var(--font-color-grey-4);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
._UXi-g ._lISfA {
|
|
343
|
+
margin-top: 12px;
|
|
344
|
+
}
|
|
333
345
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,sBAAsB;EACtB,mCAAmC;EACnC,0CAA0C;EAC1C,
|
|
1
|
+
{"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,sBAAsB;EACtB,mCAAmC;EACnC,0CAA0C;EAC1C,yCAAyC;EACzC,eAAe;EACf,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,uBAAuB;AACzB;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;EAClC,+BAA+B;EAC/B,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,aAAa;AACf;AACA;EACE,eAAe;AACjB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,8BAA8B;EAC9B,mBAAmB;EACnB,uBAAuB;EACvB,OAAO;AACT;AACA;EACE,qBAAqB;AACvB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;EACf,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;EAChB,2BAA2B;EAC3B,mBAAmB;AACrB;;AAEA;EACE,oHAAoH;EACpH,2BAA2B;EAC3B,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,UAAU;AACZ;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,2BAA2B;AAC7B;AArFA;EACE,qBAAqB;AACvB;AACA;EACE,+BAA+B;AACjC;AALA;EACE,iBAAiB;AACnB;;AAEA;EACE,sBAAsB;AACxB;AACA;EACE,kCAAkC;AACpC;;AAEA;EACE,iBAAiB;EACjB,OAAO;AACT;;AAEA;EACE,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,cAAc;EACd,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;AAClB;AA/BA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,4BAA4B;EAC5B,mBAAmB;EACnB,eAAe;EACf,4BAA4B;EAC5B,kBAAkB;EAClB,2CAA2C;AAC7C;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;;EAEE,2BAA2B;AAC7B;AACA;EACE,+BAA+B;EAC/B,mBAAmB;AACrB;AACA;EACE,gBAAgB;EAChB,iBAAiB;AACnB;AACA;;EAEE,uBAAuB;AACzB;AACA;EACE,+BAA+B;AACjC;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,eAAe;AACjB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;;AAEA;EACE,8CAA8C;AAChD;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,aAAa;AACf;AACA;EACE,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,8CAA8C;AAChD;AA3FA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;;AAEA;EACE,8BAA8B;AAChC;AACA;EACE,kCAAkC;EAClC,kCAAkC;AACpC;;AAEA;EACE,8BAA8B;AAChC;AACA;EACE,eAAe;AACjB;AACA;EACE,mBAAmB;EACnB,kCAAkC;AACpC;AACA;EACE,oBAAoB;EACpB,+BAA+B;AACjC;AACA;EACE,kCAAkC;EAClC,2BAA2B;AAC7B;AACA;EACE,mBAAmB;AACrB;AACA;EACE,oBAAoB;EACpB,+BAA+B;AACjC;AACA;EACE,kCAAkC;AACpC;;AAEA;EACE,YAAY;EACZ,gCAAgC;AAClC;;AAEA;EACE,8BAA8B;EAC9B,YAAY;AACd;AACA;EACE,cAAc;AAChB;AACA;EACE,UAAU;AACZ;AACA;EACE,kCAAkC;AACpC;;AAEA;EACE,aAAa;EACb,oBAAoB;AACtB;;AAEA;EACE,cAAc;EACd,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,eAAe;AACjB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;AACA;EACE,YAAY;AACd;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,iDAAiD;EACjD,gDAAgD;EAChD,iBAAiB;AACnB;AACA;EACE,mBAAmB;AACrB;;AAEA;;EAEE,mCAAmC;EACnC,iBAAiB;EACjB,8CAA8C;EAC9C,+CAA+C;EAC/C,iBAAiB;EACjB,qBAAqB;AACvB;;AAEA;EACE,kCAAkC;EAClC,6BAA6B;AAC/B;;AAEA;EACE,qBAAqB;EACrB,qBAAqB;AACvB;;AAEA;EACE,8CAA8C;AAChD;;AAEA;EACE,gBAAgB;AAClB","file":"index.css","sourcesContent":[".list {\n max-height: 300px;\n}\n.list:not(.is-popup) {\n max-height: 400px;\n}\n\n.header {\n border-left: 1px solid #f0f0f0;\n}\n.header .col {\n background: var(--bg-color-grey-1);\n transition: background-color 300ms;\n}\n\n.body {\n border-left: 1px solid #f0f0f0;\n}\n.body .col {\n cursor: pointer;\n}\n.body.is-selected-all {\n cursor: not-allowed;\n background: var(--bg-color-grey-3);\n}\n.body.is-selected-all .col {\n pointer-events: none;\n color: var(--font-color-grey-2);\n}\n.body.is-selected {\n background: var(--primary-color-1);\n color: var(--primary-color);\n}\n.body.is-disabled {\n cursor: not-allowed;\n}\n.body.is-disabled .col {\n pointer-events: none;\n color: var(--font-color-grey-2);\n}\n.body:hover:not(.is-selected-all):not(.is-selected):not(.is-disabled) .col {\n background: var(--bg-color-grey-1);\n}\n\n.col {\n padding: 8px;\n border-bottom: 1px solid #f0f0f0;\n}\n\n.right-options {\n border-left: 1px solid #f0f0f0;\n padding: 8px;\n}\n.right-options:not(.right-options:global(.is-popup)) {\n padding-top: 0;\n}\n.right-options .no-padding-btn:global(.ant-btn) {\n padding: 0;\n}\n.right-options :global .ant-tag {\n background: var(--bg-color-grey-3);\n}\n\n.tag {\n display: flex;\n margin-inline-end: 0;\n}\n\n.tag-inner {\n display: block;\n max-width: 100px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: pointer;\n}\n\n.single-checked {\n flex: 0 0 30px;\n}\n\n.select-search {\n display: flex;\n}\n.select-search:global(.is-popup) {\n padding: 8px;\n}\n\n.tags-search {\n display: flex;\n}\n\n.descriptions {\n border-bottom: 1px solid var(--font-color-grey-4);\n border-right: 1px solid var(--font-color-grey-4);\n line-height: 20px;\n}\n.descriptions:not(:last-child) {\n border-bottom: none;\n}\n\n.descriptions-col-label,\n.descriptions-col-content {\n font-size: var(--font-size-default);\n padding: 8px 16px;\n border-top: 1px solid var(--font-color-grey-4);\n border-left: 1px solid var(--font-color-grey-4);\n line-height: 20px;\n word-break: break-all;\n}\n\n.descriptions-col-label {\n background: var(--bg-color-grey-1);\n color: var(--font-color-grey);\n}\n\n.descriptions-col-content {\n word-break: break-all;\n white-space: pre-line;\n}\n\n.footer {\n border-top: 1px solid var(--font-color-grey-4);\n}\n\n.right-options .footer {\n margin-top: 12px;\n}"]}
|
package/dist/index.js
CHANGED
|
@@ -37,15 +37,6 @@ function _extends() {
|
|
|
37
37
|
return n;
|
|
38
38
|
}, _extends.apply(null, arguments);
|
|
39
39
|
}
|
|
40
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
41
|
-
if (null == r) return {};
|
|
42
|
-
var t = {};
|
|
43
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
44
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
45
|
-
t[n] = r[n];
|
|
46
|
-
}
|
|
47
|
-
return t;
|
|
48
|
-
}
|
|
49
40
|
|
|
50
41
|
const context = globalContext.createContext();
|
|
51
42
|
const {
|
|
@@ -75,9 +66,8 @@ const locale = {
|
|
|
75
66
|
defaultChildren: 'Dropdown content, to be implemented by the caller'
|
|
76
67
|
};
|
|
77
68
|
|
|
78
|
-
const _excluded$1 = ["children"];
|
|
79
69
|
const numberToPx = val => {
|
|
80
|
-
return typeof val === 'number' ? val
|
|
70
|
+
return typeof val === 'number' ? `${val}px` : val;
|
|
81
71
|
};
|
|
82
72
|
const pxToNumber = value => {
|
|
83
73
|
if (!value) return 0;
|
|
@@ -89,9 +79,9 @@ const pxToNumber = value => {
|
|
|
89
79
|
};
|
|
90
80
|
const ModalContent = _ref => {
|
|
91
81
|
let {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
82
|
+
children,
|
|
83
|
+
...others
|
|
84
|
+
} = _ref;
|
|
95
85
|
const {
|
|
96
86
|
open,
|
|
97
87
|
value: propsValue
|
|
@@ -438,7 +428,7 @@ const computedIsSelectAll = function (value, selectedAllValue, valueKey) {
|
|
|
438
428
|
if (valueKey === void 0) {
|
|
439
429
|
valueKey = 'value';
|
|
440
430
|
}
|
|
441
|
-
return
|
|
431
|
+
return value?.length === 1 && get__default["default"](value, `[0][${valueKey}]`) === selectedAllValue[valueKey];
|
|
442
432
|
};
|
|
443
433
|
|
|
444
434
|
var style$2 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-container":"_dKZHi","tag-container-inner":"_oijCI","tag":"_WmnnS","tag-inner":"_TMcFl"};
|
|
@@ -465,7 +455,7 @@ const SelectedTagList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
465
455
|
className: style$2['label']
|
|
466
456
|
}, formatMessage({
|
|
467
457
|
id: 'selected'
|
|
468
|
-
}), !single && value.length > 0 &&
|
|
458
|
+
}), !single && value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React__default["default"].createElement(SimpleBar__default["default"], {
|
|
469
459
|
className: style$2['tag-container']
|
|
470
460
|
}, /*#__PURE__*/React__default["default"].createElement(antd.Flex, {
|
|
471
461
|
gap: 8,
|
|
@@ -487,14 +477,14 @@ const SelectedTagList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
487
477
|
}))));
|
|
488
478
|
});
|
|
489
479
|
|
|
490
|
-
var style$1 = {"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","select-list-item-description":"_TCkeJ"};
|
|
480
|
+
var style$1 = {"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","select-list-item-description":"_TCkeJ","footer":"_v3f23"};
|
|
491
481
|
|
|
492
|
-
const _excluded = ["children"];
|
|
493
482
|
const SelectList = React.forwardRef((_ref, ref) => {
|
|
494
483
|
let {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
484
|
+
children,
|
|
485
|
+
...p
|
|
486
|
+
} = _ref;
|
|
487
|
+
const fetchListRef = React.useRef(null);
|
|
498
488
|
const props = Object.assign({}, {
|
|
499
489
|
renderItemContent: _ref2 => {
|
|
500
490
|
let {
|
|
@@ -589,9 +579,11 @@ const SelectList = React.forwardRef((_ref, ref) => {
|
|
|
589
579
|
props,
|
|
590
580
|
value,
|
|
591
581
|
searchProps,
|
|
592
|
-
setSearchProps
|
|
582
|
+
setSearchProps,
|
|
583
|
+
onOpenChange
|
|
593
584
|
} = targetProps;
|
|
594
585
|
const {
|
|
586
|
+
footer,
|
|
595
587
|
isPopup,
|
|
596
588
|
getSearchProps,
|
|
597
589
|
getSearchCallback,
|
|
@@ -654,7 +646,8 @@ const SelectList = React.forwardRef((_ref, ref) => {
|
|
|
654
646
|
pageData: options
|
|
655
647
|
};
|
|
656
648
|
}
|
|
657
|
-
} : api)
|
|
649
|
+
} : api),
|
|
650
|
+
ref: fetchListRef
|
|
658
651
|
}), fetchProps => {
|
|
659
652
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
660
653
|
return renderList(Object.assign({}, fetchProps, targetProps, {
|
|
@@ -674,17 +667,27 @@ const SelectList = React.forwardRef((_ref, ref) => {
|
|
|
674
667
|
}
|
|
675
668
|
return /*#__PURE__*/React__default["default"].createElement(antd.Flex, {
|
|
676
669
|
vertical: true
|
|
677
|
-
}, components.search, components.selectedAll, components.fetchList,
|
|
670
|
+
}, components.search, components.selectedAll, components.fetchList, footer && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
671
|
+
className: classnames__default["default"](style$1['footer'], 'select-list-footer')
|
|
672
|
+
}, typeof footer === 'function' ? footer({
|
|
673
|
+
reload: () => {
|
|
674
|
+
fetchListRef.current && fetchListRef.current.reload();
|
|
675
|
+
},
|
|
676
|
+
close: () => {
|
|
677
|
+
onOpenChange(false);
|
|
678
|
+
}
|
|
679
|
+
}) : footer), components.selectedTag);
|
|
678
680
|
});
|
|
679
681
|
});
|
|
680
682
|
|
|
681
|
-
var style = {"list":"_DrEYJ","is-popup":"_KgWTX","header":"_Vmbrg","col":"_dJmfs","body":"_704J1","is-selected-all":"_qU5zU","is-selected":"_MzyWg","is-disabled":"_5luTv","right-options":"_UXi-g","no-padding-btn":"_iaCir","tag":"_JkYqS","tag-inner":"_VZlBL","single-checked":"_Eiz-u","select-search":"_temy6","tags-search":"_7phL2","descriptions":"_ttNK9","descriptions-col-label":"_xU-i7","descriptions-col-content":"_SvfzQ"};
|
|
683
|
+
var style = {"list":"_DrEYJ","is-popup":"_KgWTX","header":"_Vmbrg","col":"_dJmfs","body":"_704J1","is-selected-all":"_qU5zU","is-selected":"_MzyWg","is-disabled":"_5luTv","right-options":"_UXi-g","no-padding-btn":"_iaCir","tag":"_JkYqS","tag-inner":"_VZlBL","single-checked":"_Eiz-u","select-search":"_temy6","tags-search":"_7phL2","descriptions":"_ttNK9","descriptions-col-label":"_xU-i7","descriptions-col-content":"_SvfzQ","footer":"_lISfA"};
|
|
682
684
|
|
|
683
685
|
const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'super-select')(React.forwardRef((p, ref) => {
|
|
684
686
|
const {
|
|
685
687
|
formatMessage
|
|
686
688
|
} = reactIntl.useIntl();
|
|
687
689
|
const [tagSearchText, setTagSearchText] = React.useState('');
|
|
690
|
+
const fetchListRef = React.useRef();
|
|
688
691
|
const props = Object.assign({}, {
|
|
689
692
|
overlayWidth: '600px',
|
|
690
693
|
filterRender: contextProps => {
|
|
@@ -746,6 +749,7 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
746
749
|
onOpenChange
|
|
747
750
|
} = targetProps;
|
|
748
751
|
const {
|
|
752
|
+
footer,
|
|
749
753
|
filterRender,
|
|
750
754
|
columns,
|
|
751
755
|
options,
|
|
@@ -764,6 +768,16 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
764
768
|
searchProps
|
|
765
769
|
} = props;
|
|
766
770
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
771
|
+
const footerEl = footer && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
772
|
+
className: classnames__default["default"](style['footer'], 'select-table-footer')
|
|
773
|
+
}, typeof footer === 'function' ? footer({
|
|
774
|
+
reload: () => {
|
|
775
|
+
fetchListRef.current && fetchListRef.current.reload();
|
|
776
|
+
},
|
|
777
|
+
close: () => {
|
|
778
|
+
onOpenChange(false);
|
|
779
|
+
}
|
|
780
|
+
}) : footer);
|
|
767
781
|
return /*#__PURE__*/React__default["default"].createElement(antd.Row, {
|
|
768
782
|
wrap: false,
|
|
769
783
|
ref: bodyRef
|
|
@@ -832,7 +846,8 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
832
846
|
pageData: options
|
|
833
847
|
};
|
|
834
848
|
}
|
|
835
|
-
} : api)
|
|
849
|
+
} : api),
|
|
850
|
+
ref: fetchListRef
|
|
836
851
|
}), fetchProps => {
|
|
837
852
|
const {
|
|
838
853
|
list
|
|
@@ -890,7 +905,7 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
890
905
|
className: classnames__default["default"](style['col'], style['single-checked'], 'select-table-list-col')
|
|
891
906
|
}, isChecked && /*#__PURE__*/React__default["default"].createElement(icons.CheckOutlined, null)));
|
|
892
907
|
});
|
|
893
|
-
})), !single && /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
908
|
+
}), single && footerEl), !single && /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
894
909
|
className: classnames__default["default"](style['right-options'], {
|
|
895
910
|
'is-popup': isPopup
|
|
896
911
|
}),
|
|
@@ -909,7 +924,7 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
909
924
|
align: 'middle'
|
|
910
925
|
}, /*#__PURE__*/React__default["default"].createElement(antd.Col, null, formatMessage({
|
|
911
926
|
id: 'selected'
|
|
912
|
-
}), value.length > 0 &&
|
|
927
|
+
}), value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React__default["default"].createElement(antd.Col, null, /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
913
928
|
className: style['no-padding-btn'],
|
|
914
929
|
type: "link",
|
|
915
930
|
onClick: () => {
|
|
@@ -951,7 +966,7 @@ const SelectTableList = reactIntl.createWithIntlProvider('zh-CN', locale$1, 'sup
|
|
|
951
966
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
952
967
|
className: style['tag-inner']
|
|
953
968
|
}, item[labelKey])));
|
|
954
|
-
})))));
|
|
969
|
+
}))), footerEl));
|
|
955
970
|
});
|
|
956
971
|
}));
|
|
957
972
|
|