bm-admin-ui 1.0.82-alpha → 1.0.84-alpha

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.
Files changed (41) hide show
  1. package/es/components/attachment/index.js +273 -0
  2. package/es/components/breadcrumb/index.js +158 -0
  3. package/es/components/button/index.js +49 -0
  4. package/es/components/edit-form/index.js +1186 -0
  5. package/es/components/editor/index.js +12554 -0
  6. package/es/components/feedback/index.js +295 -0
  7. package/es/components/float-table/index.js +3511 -0
  8. package/es/components/flow-designer/index.js +1317 -0
  9. package/es/components/form-create/index.js +20978 -0
  10. package/es/components/form-designer/index.js +4514 -0
  11. package/es/components/index.js +19 -0
  12. package/es/components/input-tags-display/index.js +226 -0
  13. package/es/components/over-tooltips/index.js +133 -0
  14. package/es/components/search-filter/index.js +449 -0
  15. package/es/components/select-all/index.js +172 -0
  16. package/es/components/shops-filter/index.js +453 -0
  17. package/es/components/staffs-selector/index.js +728 -0
  18. package/es/components/timeline/index.js +168 -0
  19. package/es/components/upload/index.js +909 -0
  20. package/es/components/videoView/index.js +100 -0
  21. package/lib/components/attachment/index.js +278 -0
  22. package/lib/components/breadcrumb/index.js +168 -0
  23. package/lib/components/button/index.js +58 -0
  24. package/lib/components/edit-form/index.js +1195 -0
  25. package/lib/components/editor/index.js +12559 -0
  26. package/lib/components/feedback/index.js +309 -0
  27. package/lib/components/float-table/index.js +3516 -0
  28. package/lib/components/flow-designer/index.js +1329 -0
  29. package/lib/components/form-create/index.js +20990 -0
  30. package/lib/components/form-designer/index.js +4525 -0
  31. package/lib/components/index.js +140 -0
  32. package/lib/components/input-tags-display/index.js +237 -0
  33. package/lib/components/over-tooltips/index.js +138 -0
  34. package/lib/components/search-filter/index.js +459 -0
  35. package/lib/components/select-all/index.js +181 -0
  36. package/lib/components/shops-filter/index.js +465 -0
  37. package/lib/components/staffs-selector/index.js +733 -0
  38. package/lib/components/timeline/index.js +174 -0
  39. package/lib/components/upload/index.js +914 -0
  40. package/lib/components/videoView/index.js +105 -0
  41. package/package.json +1 -1
@@ -0,0 +1,459 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var withInstall = require('bm-admin-ui/lib/utils/with-install');
6
+ var vue = require('vue');
7
+ var FormCreateCtr = require('@form-create/ant-design-vue');
8
+ var iconsVue = require('@ant-design/icons-vue');
9
+ var ASelect = require('ant-design-vue/lib/select');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var FormCreateCtr__default = /*#__PURE__*/_interopDefaultLegacy(FormCreateCtr);
14
+ var ASelect__default = /*#__PURE__*/_interopDefaultLegacy(ASelect);
15
+
16
+ const searchResetBtnProps = {
17
+ showExpandBtn: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ showSearchIcon: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+ expandPlacement: {
26
+ type: String,
27
+ default: 'left',
28
+ },
29
+ expandText: {
30
+ type: String,
31
+ default: '展开',
32
+ },
33
+ collapseText: {
34
+ type: String,
35
+ default: '收起',
36
+ },
37
+ gutter: {
38
+ type: Array,
39
+ default() {
40
+ return [24, 16];
41
+ },
42
+ },
43
+ loading: {
44
+ type: Boolean,
45
+ default: false,
46
+ },
47
+ };
48
+ const searchFilterProps = Object.assign({ userRule: {
49
+ type: Array,
50
+ default() {
51
+ return [];
52
+ },
53
+ }, labelCol: {
54
+ type: Object,
55
+ default() {
56
+ return {
57
+ flex: '0 0 auto',
58
+ };
59
+ },
60
+ }, value: {
61
+ type: Object,
62
+ default() {
63
+ return {};
64
+ },
65
+ }, ruleSpan: {
66
+ type: Object,
67
+ default() {
68
+ return {};
69
+ },
70
+ }, fixedCount: {
71
+ type: Number,
72
+ default: 999999,
73
+ }, fixedFields: {
74
+ type: Array,
75
+ default() {
76
+ return [];
77
+ },
78
+ } }, searchResetBtnProps);
79
+
80
+ var _export_sfc = (sfc, props) => {
81
+ const target = sfc.__vccOpts || sfc;
82
+ for (const [key, val] of props) {
83
+ target[key] = val;
84
+ }
85
+ return target;
86
+ };
87
+
88
+ const _hoisted_1$1 = { class: "bm-search-filter-actions" };
89
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
90
+ __name: "search-reset-btn",
91
+ props: searchResetBtnProps,
92
+ emits: ["submit", "reset", "expand"],
93
+ setup(__props, { emit: emits }) {
94
+ const props = __props;
95
+ const isExpand = vue.ref(false);
96
+ const wrapperStyle = vue.computed(() => {
97
+ let gutter = props.gutter?.[0] || 24;
98
+ return { paddingLeft: gutter / 2 + "px", paddingRight: gutter / 2 + "px" };
99
+ });
100
+ function handleExpandBtnChange() {
101
+ isExpand.value = !isExpand.value;
102
+ emits("expand", isExpand.value);
103
+ }
104
+ function handleSubmit() {
105
+ emits("submit");
106
+ }
107
+ function handleReset() {
108
+ emits("reset");
109
+ }
110
+ return (_ctx, _cache) => {
111
+ const _component_a_button = vue.resolveComponent("a-button");
112
+ return vue.openBlock(), vue.createElementBlock("div", {
113
+ class: "bm-search-filter-btn",
114
+ style: vue.normalizeStyle(vue.unref(wrapperStyle))
115
+ }, [
116
+ props.showExpandBtn ? (vue.openBlock(), vue.createElementBlock("span", {
117
+ key: 0,
118
+ class: "bm-search-filter-expand",
119
+ onClick: handleExpandBtnChange
120
+ }, [
121
+ vue.createTextVNode(vue.toDisplayString(isExpand.value ? props.collapseText : props.expandText), 1),
122
+ isExpand.value ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.UpOutlined), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DownOutlined), { key: 1 }))
123
+ ])) : vue.createCommentVNode("v-if", true),
124
+ vue.createElementVNode("span", _hoisted_1$1, [
125
+ vue.createVNode(_component_a_button, { onClick: handleReset }, {
126
+ default: vue.withCtx(() => [
127
+ vue.createTextVNode("\u91CD\u7F6E")
128
+ ]),
129
+ _: 1
130
+ }),
131
+ vue.createVNode(_component_a_button, {
132
+ type: "primary",
133
+ loading: props.loading,
134
+ onClick: handleSubmit
135
+ }, {
136
+ default: vue.withCtx(() => [
137
+ props.showSearchIcon && !props.loading ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.SearchOutlined), { key: 0 })) : vue.createCommentVNode("v-if", true),
138
+ vue.createTextVNode("\u67E5\u8BE2 ")
139
+ ]),
140
+ _: 1
141
+ }, 8, ["loading"])
142
+ ])
143
+ ], 4);
144
+ };
145
+ }
146
+ });
147
+ var SearchResetBtn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "search-reset-btn.vue"]]);
148
+
149
+ const _hoisted_1 = { class: "bm-select-header" };
150
+ const _hoisted_2 = { class: "bm-select-header-btn" };
151
+ const _hoisted_3 = ["onClick"];
152
+ const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("span", { class: "checkbox-label" }, "\u5168\u9009", -1);
153
+ const _hoisted_5 = ["onClick"];
154
+ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "checkbox-label" }, "\u53CD\u9009", -1);
155
+ const _hoisted_7 = { class: "blue" };
156
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
157
+ __name: "form-select-all",
158
+ props: {
159
+ modelValue: {
160
+ type: Array || String || Number || void 0
161
+ },
162
+ disabled: Boolean
163
+ },
164
+ emits: ["onSelectAll", "onChange", "update:modelValue"],
165
+ setup(__props, { emit }) {
166
+ const props = __props;
167
+ const instance = vue.getCurrentInstance();
168
+ const state = vue.reactive({
169
+ search: {
170
+ indeterminate: false,
171
+ checkedAll: false,
172
+ checkedReverse: false
173
+ }
174
+ });
175
+ let selectValue = vue.ref([]);
176
+ vue.watch(
177
+ () => props.modelValue,
178
+ (val) => {
179
+ selectValue.value = val;
180
+ if (!selectValue.value || selectValue.value.length <= 0) {
181
+ state.search = {
182
+ indeterminate: false,
183
+ checkedAll: false,
184
+ checkedReverse: false
185
+ };
186
+ }
187
+ },
188
+ {
189
+ immediate: true
190
+ }
191
+ );
192
+ const selectAll = (e) => {
193
+ let key = "value";
194
+ if (instance?.attrs.fieldNames || instance?.attrs["field-names"])
195
+ key = (instance?.attrs).fieldNames?.value || (instance?.attrs)["field-names"].value;
196
+ state.search.checkedAll = !state.search.checkedAll;
197
+ state.search.indeterminate = false;
198
+ state.search.checkedReverse = false;
199
+ if (state.search.checkedAll) {
200
+ selectValue.value = (instance?.attrs.options).map(
201
+ (v) => {
202
+ return v[key];
203
+ }
204
+ );
205
+ } else {
206
+ selectValue.value = [];
207
+ }
208
+ emit("update:modelValue", selectValue.value);
209
+ emit("onSelectAll", {
210
+ type: "all",
211
+ value: selectValue.value
212
+ });
213
+ };
214
+ const reverseAll = (e) => {
215
+ let key = "value";
216
+ if (instance?.attrs.fieldNames || instance?.attrs["field-names"])
217
+ key = (instance?.attrs).fieldNames?.value || (instance?.attrs)["field-names"].value;
218
+ if (selectValue.value.length <= 0)
219
+ return state.search.checkedReverse = false;
220
+ state.search.checkedReverse = !state.search.checkedReverse;
221
+ if (state.search.checkedReverse) {
222
+ state.search.indeterminate = false;
223
+ state.search.checkedAll = false;
224
+ } else {
225
+ state.search.indeterminate = !!selectValue.value.length && selectValue.value.length < (instance?.attrs.options).length;
226
+ state.search.checkedAll = selectValue.value.length === (instance?.attrs.options).length;
227
+ }
228
+ selectValue.value = (instance?.attrs.options).filter(
229
+ (v) => !selectValue.value.some((ele) => ele === v[key])
230
+ ).map((x) => x[key]);
231
+ emit("update:modelValue", selectValue.value);
232
+ emit("onSelectAll", {
233
+ type: "reverse",
234
+ value: selectValue.value
235
+ });
236
+ };
237
+ const onChange = (value, option) => {
238
+ state.search.checkedReverse = false;
239
+ state.search.indeterminate = !!value.length && value.length < (instance?.attrs.options).length;
240
+ state.search.checkedAll = value.length === (instance?.attrs.options).length;
241
+ emit("update:modelValue", value);
242
+ emit("onChange", {
243
+ value,
244
+ option
245
+ });
246
+ };
247
+ const VNodes = (_, { attrs }) => {
248
+ return vue.h(attrs.vnodes);
249
+ };
250
+ return (_ctx, _cache) => {
251
+ const _component_a_checkbox = vue.resolveComponent("a-checkbox");
252
+ const _component_a_form_item_rest = vue.resolveComponent("a-form-item-rest");
253
+ return vue.openBlock(), vue.createBlock(vue.unref(ASelect__default["default"]), vue.mergeProps({
254
+ value: vue.unref(selectValue),
255
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => vue.isRef(selectValue) ? selectValue.value = $event : selectValue = $event),
256
+ class: "bm-select search"
257
+ }, _ctx.$attrs, {
258
+ mode: "multiple",
259
+ disabled: props.disabled,
260
+ placeholder: vue.unref(instance)?.attrs.placeholder ? vue.unref(instance)?.attrs.placeholder : "\u8BF7\u9009\u62E9",
261
+ "get-popup-container": (nodes) => nodes.parentNode,
262
+ onChange
263
+ }), {
264
+ dropdownRender: vue.withCtx(({ menuNode: menu }) => [
265
+ vue.createElementVNode("div", _hoisted_1, [
266
+ vue.createVNode(_component_a_form_item_rest, null, {
267
+ default: vue.withCtx(() => [
268
+ vue.createElementVNode("div", _hoisted_2, [
269
+ vue.createElementVNode("div", {
270
+ onClick: vue.withModifiers(selectAll, ["prevent"]),
271
+ onMousedown: _cache[1] || (_cache[1] = (e) => e.preventDefault())
272
+ }, [
273
+ vue.createVNode(_component_a_checkbox, {
274
+ checked: state.search.checkedAll,
275
+ "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => state.search.checkedAll = $event),
276
+ indeterminate: state.search.indeterminate
277
+ }, null, 8, ["checked", "indeterminate"]),
278
+ _hoisted_4
279
+ ], 40, _hoisted_3),
280
+ vue.createElementVNode("div", {
281
+ onClick: vue.withModifiers(reverseAll, ["prevent"]),
282
+ onMousedown: _cache[3] || (_cache[3] = (e) => e.preventDefault())
283
+ }, [
284
+ vue.createVNode(_component_a_checkbox, {
285
+ checked: state.search.checkedReverse,
286
+ "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => state.search.checkedReverse = $event)
287
+ }, null, 8, ["checked"]),
288
+ _hoisted_6
289
+ ], 40, _hoisted_5)
290
+ ])
291
+ ]),
292
+ _: 1
293
+ }),
294
+ vue.createElementVNode("div", null, [
295
+ vue.createTextVNode(" \u5DF2\u9009\u62E9 "),
296
+ vue.createElementVNode("span", _hoisted_7, vue.toDisplayString(vue.unref(selectValue)?.length || 0), 1),
297
+ vue.createTextVNode(" \u9879 ")
298
+ ])
299
+ ]),
300
+ vue.createVNode(VNodes, { vnodes: menu }, null, 8, ["vnodes"])
301
+ ]),
302
+ _: 1
303
+ }, 16, ["value", "disabled", "placeholder", "get-popup-container"]);
304
+ };
305
+ }
306
+ });
307
+ var SelectAll = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "form-select-all.vue"]]);
308
+
309
+ const __default__ = {
310
+ name: "BmSearchFilter"
311
+ };
312
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
313
+ ...__default__,
314
+ props: searchFilterProps,
315
+ emits: ["update:value", "submit", "reset", "expand"],
316
+ setup(__props, { expose, emit: emits }) {
317
+ const props = __props;
318
+ FormCreateCtr__default["default"].component("SearchResetBtn", SearchResetBtn);
319
+ FormCreateCtr__default["default"].component("SelectAll", SelectAll);
320
+ FormCreateCtr__default["default"].maker.create("SelectAll", "field", "\u5168\u9009\u53CD\u9009\u7EC4\u4EF6").value([]);
321
+ const isExpand = vue.ref(false);
322
+ const searchResetBtnRule = vue.reactive([
323
+ {
324
+ type: "SearchResetBtn",
325
+ props: {
326
+ showExpandBtn: props.showExpandBtn,
327
+ showSearchIcon: props.showSearchIcon,
328
+ expandText: props.expandText,
329
+ collapseText: props.collapseText,
330
+ gutter: props.gutter,
331
+ loading: props.loading
332
+ },
333
+ on: {
334
+ submit() {
335
+ emits("submit", fApi.value.formData());
336
+ },
337
+ reset() {
338
+ fApi.value?.resetFields?.();
339
+ console.log(1112);
340
+ emits("reset");
341
+ },
342
+ expand(value) {
343
+ isExpand.value = value;
344
+ emits("expand", value);
345
+ }
346
+ }
347
+ }
348
+ ]);
349
+ const fApi = vue.ref({});
350
+ const option = vue.reactive({
351
+ col: {
352
+ span: 8
353
+ },
354
+ row: {
355
+ gutter: props.gutter
356
+ },
357
+ form: {
358
+ labelCol: props.labelCol,
359
+ labelAlign: "right",
360
+ wrapperCol: {
361
+ span: 24
362
+ }
363
+ },
364
+ submitBtn: false
365
+ });
366
+ const rule = vue.computed(() => {
367
+ if (!props.userRule)
368
+ return [];
369
+ return [...props.userRule, ...searchResetBtnRule];
370
+ });
371
+ function handleShowExpandBtn(val) {
372
+ searchResetBtnRule[0].props.showExpandBtn = val;
373
+ }
374
+ function handleChange() {
375
+ emits("update:value", fApi.value.formData());
376
+ }
377
+ function handleResize() {
378
+ const bodyClientWidth = document.body.clientWidth;
379
+ if (bodyClientWidth < 1680) {
380
+ option.col.span = 8;
381
+ } else {
382
+ option.col.span = 6;
383
+ }
384
+ props.userRule.forEach((rule2) => {
385
+ if (!rule2.field || rule2.col)
386
+ return;
387
+ const spanNum = props.ruleSpan[rule2.field];
388
+ if (spanNum) {
389
+ (rule2.col = rule2.col || {}).span = option.col.span * spanNum;
390
+ }
391
+ });
392
+ }
393
+ handleResize();
394
+ window.addEventListener("resize", handleResize);
395
+ vue.onBeforeUnmount(() => {
396
+ window.removeEventListener("resize", handleResize);
397
+ });
398
+ vue.watch(
399
+ () => props.showExpandBtn,
400
+ (val) => {
401
+ handleShowExpandBtn(val);
402
+ },
403
+ {
404
+ immediate: true
405
+ }
406
+ );
407
+ const expandRule = vue.computed(() => {
408
+ const fixedCount = props.fixedCount && props.fixedCount >= 0 ? props.fixedCount : 0;
409
+ const fixedFields = props.fixedFields?.length ? props.fixedFields : [];
410
+ return (props.userRule || []).filter((ruleItem, index) => {
411
+ return index + 1 > fixedCount && !fixedFields.includes(ruleItem.field || ruleItem.name);
412
+ });
413
+ });
414
+ function handleChangeExpand(value) {
415
+ if (value) {
416
+ expandRule.value.forEach((ruleItem) => {
417
+ ruleItem.hidden = false;
418
+ });
419
+ } else {
420
+ expandRule.value.forEach((ruleItem) => {
421
+ ruleItem.hidden = true;
422
+ });
423
+ }
424
+ }
425
+ vue.watch(
426
+ isExpand,
427
+ (val) => {
428
+ vue.nextTick(() => handleChangeExpand(val));
429
+ },
430
+ {
431
+ immediate: true
432
+ }
433
+ );
434
+ expose({
435
+ fApi
436
+ });
437
+ return (_ctx, _cache) => {
438
+ const _component_form_create = vue.resolveComponent("form-create");
439
+ return vue.openBlock(), vue.createElementBlock("div", {
440
+ class: vue.normalizeClass(["bm-search-filter", ["bm-search-filter-expand-" + props.expandPlacement]])
441
+ }, [
442
+ vue.createVNode(_component_form_create, {
443
+ api: fApi.value,
444
+ "onUpdate:api": _cache[0] || (_cache[0] = ($event) => fApi.value = $event),
445
+ "model-value": props.value,
446
+ rule: vue.unref(rule),
447
+ option,
448
+ onChange: handleChange
449
+ }, null, 8, ["api", "model-value", "rule", "option"])
450
+ ], 2);
451
+ };
452
+ }
453
+ });
454
+ var SearchFilter = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "search-filter.vue"]]);
455
+
456
+ const BmSearchFilter = withInstall.withInstall(SearchFilter);
457
+
458
+ exports.BmSearchFilter = BmSearchFilter;
459
+ exports["default"] = BmSearchFilter;
@@ -0,0 +1,181 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var withInstall = require('bm-admin-ui/lib/utils/with-install');
6
+ var vue = require('vue');
7
+ var ASelect = require('ant-design-vue/lib/select');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var ASelect__default = /*#__PURE__*/_interopDefaultLegacy(ASelect);
12
+
13
+ var _export_sfc = (sfc, props) => {
14
+ const target = sfc.__vccOpts || sfc;
15
+ for (const [key, val] of props) {
16
+ target[key] = val;
17
+ }
18
+ return target;
19
+ };
20
+
21
+ const _hoisted_1 = { class: "bm-select-header" };
22
+ const _hoisted_2 = { class: "bm-select-header-btn" };
23
+ const _hoisted_3 = ["onClick"];
24
+ const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("span", { class: "checkbox-label" }, "\u5168\u9009", -1);
25
+ const _hoisted_5 = ["onClick"];
26
+ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "checkbox-label" }, "\u53CD\u9009", -1);
27
+ const _hoisted_7 = { class: "blue" };
28
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
+ __name: "selectAll",
30
+ props: {
31
+ value: {
32
+ type: Array || String || Number || void 0,
33
+ required: true
34
+ },
35
+ showSelectAll: {
36
+ type: Boolean,
37
+ default: false
38
+ }
39
+ },
40
+ emits: ["onSelectAll", "update:value", "onChange"],
41
+ setup(__props, { emit }) {
42
+ const props = __props;
43
+ const instance = vue.getCurrentInstance();
44
+ const state = vue.reactive({
45
+ search: {
46
+ indeterminate: false,
47
+ checkedAll: false,
48
+ checkedReverse: false
49
+ }
50
+ });
51
+ let selectValue = vue.ref([]);
52
+ vue.watch(
53
+ () => props.value,
54
+ (val) => {
55
+ selectValue.value = val;
56
+ if (!selectValue.value || selectValue.value.length <= 0) {
57
+ state.search = {
58
+ indeterminate: false,
59
+ checkedAll: false,
60
+ checkedReverse: false
61
+ };
62
+ }
63
+ },
64
+ {
65
+ immediate: true
66
+ }
67
+ );
68
+ const selectAll = (e) => {
69
+ let key = "value";
70
+ if (instance?.attrs.fieldNames || instance?.attrs["field-names"])
71
+ key = (instance?.attrs).fieldNames?.value || (instance?.attrs)["field-names"].value;
72
+ state.search.checkedAll = !state.search.checkedAll;
73
+ state.search.indeterminate = false;
74
+ state.search.checkedReverse = false;
75
+ if (state.search.checkedAll) {
76
+ selectValue.value = (instance?.attrs.options).map(
77
+ (v) => {
78
+ return v[key];
79
+ }
80
+ );
81
+ } else {
82
+ selectValue.value = [];
83
+ }
84
+ emit("update:value", selectValue.value);
85
+ emit("onSelectAll", {
86
+ type: "all",
87
+ value: selectValue.value
88
+ });
89
+ };
90
+ const reverseAll = (e) => {
91
+ let key = "value";
92
+ if (instance?.attrs.fieldNames || instance?.attrs["field-names"])
93
+ key = (instance?.attrs).fieldNames?.value || (instance?.attrs)["field-names"].value;
94
+ if (selectValue.value.length <= 0)
95
+ return state.search.checkedReverse = false;
96
+ state.search.checkedReverse = !state.search.checkedReverse;
97
+ if (state.search.checkedReverse) {
98
+ state.search.indeterminate = false;
99
+ state.search.checkedAll = false;
100
+ } else {
101
+ state.search.indeterminate = !!selectValue.value.length && selectValue.value.length < (instance?.attrs.options).length;
102
+ state.search.checkedAll = selectValue.value.length === (instance?.attrs.options).length;
103
+ }
104
+ selectValue.value = (instance?.attrs.options).filter(
105
+ (v) => !selectValue.value.some((ele) => ele === v[key])
106
+ ).map((x) => x[key]);
107
+ emit("update:value", selectValue.value);
108
+ emit("onSelectAll", {
109
+ type: "reverse",
110
+ value: selectValue.value
111
+ });
112
+ };
113
+ const onChange = (value, option) => {
114
+ state.search.checkedReverse = false;
115
+ state.search.indeterminate = !!value.length && value.length < (instance?.attrs.options).length;
116
+ state.search.checkedAll = value.length === (instance?.attrs.options).length;
117
+ emit("update:value", value);
118
+ emit("onChange", {
119
+ value,
120
+ option
121
+ });
122
+ };
123
+ const VNodes = (_, { attrs }) => {
124
+ return vue.h(attrs.vnodes);
125
+ };
126
+ return (_ctx, _cache) => {
127
+ const _component_a_checkbox = vue.resolveComponent("a-checkbox");
128
+ return vue.openBlock(), vue.createBlock(vue.unref(ASelect__default["default"]), vue.mergeProps({
129
+ value: vue.unref(selectValue),
130
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => vue.isRef(selectValue) ? selectValue.value = $event : selectValue = $event),
131
+ class: "bm-select"
132
+ }, _ctx.$attrs, {
133
+ mode: "multiple",
134
+ placeholder: vue.unref(instance)?.attrs.placeholder ? vue.unref(instance)?.attrs.placeholder : "\u8BF7\u9009\u62E9",
135
+ "get-popup-container": (nodes) => nodes.parentNode,
136
+ onChange
137
+ }), {
138
+ dropdownRender: vue.withCtx(({ menuNode: menu }) => [
139
+ vue.createElementVNode("div", _hoisted_1, [
140
+ vue.createElementVNode("div", _hoisted_2, [
141
+ vue.createElementVNode("div", {
142
+ onClick: vue.withModifiers(selectAll, ["prevent"]),
143
+ onMousedown: _cache[1] || (_cache[1] = (e) => e.preventDefault())
144
+ }, [
145
+ vue.createVNode(_component_a_checkbox, {
146
+ checked: state.search.checkedAll,
147
+ "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => state.search.checkedAll = $event),
148
+ indeterminate: state.search.indeterminate
149
+ }, null, 8, ["checked", "indeterminate"]),
150
+ _hoisted_4
151
+ ], 40, _hoisted_3),
152
+ vue.createElementVNode("div", {
153
+ onClick: vue.withModifiers(reverseAll, ["prevent"]),
154
+ onMousedown: _cache[3] || (_cache[3] = (e) => e.preventDefault())
155
+ }, [
156
+ vue.createVNode(_component_a_checkbox, {
157
+ checked: state.search.checkedReverse,
158
+ "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => state.search.checkedReverse = $event)
159
+ }, null, 8, ["checked"]),
160
+ _hoisted_6
161
+ ], 40, _hoisted_5)
162
+ ]),
163
+ vue.createElementVNode("div", null, [
164
+ vue.createTextVNode(" \u5DF2\u9009\u62E9 "),
165
+ vue.createElementVNode("span", _hoisted_7, vue.toDisplayString(vue.unref(selectValue)?.length || 0), 1),
166
+ vue.createTextVNode(" \u9879 ")
167
+ ])
168
+ ]),
169
+ vue.createVNode(VNodes, { vnodes: menu }, null, 8, ["vnodes"])
170
+ ]),
171
+ _: 1
172
+ }, 16, ["value", "placeholder", "get-popup-container"]);
173
+ };
174
+ }
175
+ });
176
+ var selectAll = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "selectAll.vue"]]);
177
+
178
+ const BmSelectAll = withInstall.withInstall(selectAll);
179
+
180
+ exports.BmSelectAll = BmSelectAll;
181
+ exports["default"] = BmSelectAll;