bkui-vue 0.0.1-beta.425 → 0.0.1-beta.426

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/index.esm.js CHANGED
@@ -10761,7 +10761,7 @@ const propsCollapsePanel = __spreadValues({
10761
10761
  alone: PropTypes.bool.def(false),
10762
10762
  icon: PropTypes.string.def("angle-right")
10763
10763
  }, CollapsePanelEventProps);
10764
- function _isSlot$7(s2) {
10764
+ function _isSlot$8(s2) {
10765
10765
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
10766
10766
  }
10767
10767
  var CollapsePanel = defineComponent({
@@ -10872,7 +10872,7 @@ var CollapsePanel = defineComponent({
10872
10872
  "onClick": () => this.clickItem()
10873
10873
  }, [this.renderHeader(createVNode(this.collapseIcon, {
10874
10874
  "class": `bk-collapse-icon ${this.isActive && "rotate-icon" || ""}`
10875
- }, null))]), createVNode(CollapseTransition, null, _isSlot$7(_slot = this.renderPanel()) ? _slot : {
10875
+ }, null))]), createVNode(CollapseTransition, null, _isSlot$8(_slot = this.renderPanel()) ? _slot : {
10876
10876
  default: () => [_slot]
10877
10877
  })])]);
10878
10878
  }
@@ -11146,7 +11146,7 @@ const props$1 = __spreadProps(__spreadValues({}, propsMixin$1), {
11146
11146
  dialogType: dialogTypeUnion(),
11147
11147
  isLoading: PropTypes.bool.def(false)
11148
11148
  });
11149
- function _isSlot$6(s2) {
11149
+ function _isSlot$7(s2) {
11150
11150
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
11151
11151
  }
11152
11152
  var Dialog = defineComponent({
@@ -11399,7 +11399,7 @@ var Dialog = defineComponent({
11399
11399
  "onClose": this.handleClose,
11400
11400
  "isShow": this.isModalShow,
11401
11401
  "style": this.data.moveStyle
11402
- }), _isSlot$6(dialogSlot) ? dialogSlot : {
11402
+ }), _isSlot$7(dialogSlot) ? dialogSlot : {
11403
11403
  default: () => [dialogSlot]
11404
11404
  });
11405
11405
  }
@@ -14065,7 +14065,7 @@ const Line = (_2, {
14065
14065
  "style": titleStyle
14066
14066
  }, [showDefault()])])]), showDefault(false)]);
14067
14067
  };
14068
- function _isSlot$5(s2) {
14068
+ function _isSlot$6(s2) {
14069
14069
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
14070
14070
  }
14071
14071
  var Component$q = defineComponent({
@@ -14130,11 +14130,11 @@ var Component$q = defineComponent({
14130
14130
  const $props = __spreadProps(__spreadValues({}, this.$props), {
14131
14131
  percent: this.validPercent(this.percent)
14132
14132
  });
14133
- let progress2 = createVNode(Line, $props, _isSlot$5(progressInfo) ? progressInfo : {
14133
+ let progress2 = createVNode(Line, $props, _isSlot$6(progressInfo) ? progressInfo : {
14134
14134
  default: () => [progressInfo]
14135
14135
  });
14136
14136
  if (this.type === "circle" || this.type === "dashboard") {
14137
- progress2 = createVNode(Circle, $props, _isSlot$5(progressInfo) ? progressInfo : {
14137
+ progress2 = createVNode(Circle, $props, _isSlot$6(progressInfo) ? progressInfo : {
14138
14138
  default: () => [progressInfo]
14139
14139
  });
14140
14140
  }
@@ -16849,7 +16849,7 @@ var Component$k = defineComponent({
16849
16849
  }
16850
16850
  });
16851
16851
  const BkSelect = withInstallProps(Component$k, { Option: BkOption, Group: OptionGroup });
16852
- function _isSlot$4(s2) {
16852
+ function _isSlot$5(s2) {
16853
16853
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
16854
16854
  }
16855
16855
  const {
@@ -16943,7 +16943,7 @@ var Component$j = defineComponent({
16943
16943
  "onHidden": handleHidden,
16944
16944
  "onShown": handleShown,
16945
16945
  "onClose": handleClose
16946
- }), _isSlot$4(dialogSlot) ? dialogSlot : {
16946
+ }), _isSlot$5(dialogSlot) ? dialogSlot : {
16947
16947
  default: () => [dialogSlot]
16948
16948
  });
16949
16949
  };
@@ -17691,7 +17691,7 @@ var useScrollLoading = (props2, ctx) => {
17691
17691
  renderScrollLoading
17692
17692
  };
17693
17693
  };
17694
- function _isSlot$3(s2) {
17694
+ function _isSlot$4(s2) {
17695
17695
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
17696
17696
  }
17697
17697
  var useLimit = (t2) => {
@@ -17738,7 +17738,7 @@ var useLimit = (t2) => {
17738
17738
  "modelValue": localLimit.value,
17739
17739
  "onChange": handleLimitChange,
17740
17740
  "disabled": proxy.disabled
17741
- }, _isSlot$3(_slot = proxy.limitList.map((num, index2) => createVNode(BkOption, {
17741
+ }, _isSlot$4(_slot = proxy.limitList.map((num, index2) => createVNode(BkOption, {
17742
17742
  "value": num,
17743
17743
  "label": `${num}`,
17744
17744
  "key": `${index2}_${num}`
@@ -19321,7 +19321,7 @@ class TablePlugins {
19321
19321
  this.ctx = ctx;
19322
19322
  }
19323
19323
  }
19324
- function _isSlot$2(s2) {
19324
+ function _isSlot$3(s2) {
19325
19325
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
19326
19326
  }
19327
19327
  var Settings = defineComponent({
@@ -19505,7 +19505,7 @@ var Settings = defineComponent({
19505
19505
  "class": "setting-body-fields",
19506
19506
  "modelValue": checkedFields.value,
19507
19507
  "onUpdate:modelValue": ($event) => checkedFields.value = $event
19508
- }, _isSlot$2(_slot2 = renderFields.value.map((item, index2) => {
19508
+ }, _isSlot$3(_slot2 = renderFields.value.map((item, index2) => {
19509
19509
  let _slot;
19510
19510
  return createVNode("div", {
19511
19511
  "class": "field-item"
@@ -19513,7 +19513,7 @@ var Settings = defineComponent({
19513
19513
  "checked": checkedFields.value.includes(resolvedColVal(item, index2)),
19514
19514
  "label": resolvedColVal(item, index2),
19515
19515
  "disabled": isItemReadonly(item, index2)
19516
- }, _isSlot$2(_slot = resolvePropVal(item, "label", [item, index2])) ? _slot : {
19516
+ }, _isSlot$3(_slot = resolvePropVal(item, "label", [item, index2])) ? _slot : {
19517
19517
  default: () => [_slot]
19518
19518
  })]);
19519
19519
  })) ? _slot2 : {
@@ -19624,7 +19624,7 @@ var useFixedColumn = (_props, colgroups, hasScrollY) => {
19624
19624
  resolveColumnClass
19625
19625
  };
19626
19626
  };
19627
- function _isSlot$1(s2) {
19627
+ function _isSlot$2(s2) {
19628
19628
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
19629
19629
  }
19630
19630
  class TableRender {
@@ -19875,7 +19875,7 @@ class TableRender {
19875
19875
  "title": showTitle,
19876
19876
  "observerResize": this.props.observerResize,
19877
19877
  "resizerWay": this.props.resizerWay
19878
- }, _isSlot$1(cells) ? cells : {
19878
+ }, _isSlot$2(cells) ? cells : {
19879
19879
  default: () => [cells]
19880
19880
  });
19881
19881
  };
@@ -19983,7 +19983,7 @@ class TableRender {
19983
19983
  "row": row,
19984
19984
  "parentSetting": this.props.showOverflowTooltip,
19985
19985
  "observerResize": this.props.observerResize
19986
- }, _isSlot$1(_slot = this.renderCell(row, column, rowIndex, rows)) ? _slot : {
19986
+ }, _isSlot$2(_slot = this.renderCell(row, column, rowIndex, rows)) ? _slot : {
19987
19987
  default: () => [_slot]
19988
19988
  })]);
19989
19989
  }
@@ -29358,8 +29358,12 @@ const transferProps = {
29358
29358
  sortable: PropTypes.bool.def(false),
29359
29359
  sourceList: PropTypes.arrayOf(PropTypes.any).def([]),
29360
29360
  targetList: PropTypes.arrayOf(PropTypes.any).def([]),
29361
- emptyContent: PropTypes.arrayOf(PropTypes.string).def([])
29361
+ emptyContent: PropTypes.arrayOf(PropTypes.string).def([]),
29362
+ multiple: PropTypes.bool.def(false)
29362
29363
  };
29364
+ function _isSlot$1(s2) {
29365
+ return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
29366
+ }
29363
29367
  function useTransferData(sourceData, targetList, settingCode) {
29364
29368
  const selectList = ref([]);
29365
29369
  const selectedList = ref([]);
@@ -29411,6 +29415,14 @@ var Component$a = defineComponent({
29411
29415
  emit
29412
29416
  }) {
29413
29417
  const t2 = useLocale("transfer");
29418
+ const multipleSelectAllValue = ref({
29419
+ source: false,
29420
+ target: false
29421
+ });
29422
+ const multipleSelectList = ref({
29423
+ source: [],
29424
+ target: []
29425
+ });
29414
29426
  const sourceListType = computed(() => {
29415
29427
  if (Array.isArray(props2.sourceList)) {
29416
29428
  const isObjectArray = props2.sourceList.every((s2) => s2.toString().includes("[object Object]"));
@@ -29459,7 +29471,9 @@ var Component$a = defineComponent({
29459
29471
  });
29460
29472
  });
29461
29473
  watch(() => [selectList, selectedList], () => {
29462
- handleEmitUpdateTargetList();
29474
+ if (!props2.multiple) {
29475
+ handleEmitUpdateTargetList();
29476
+ }
29463
29477
  }, {
29464
29478
  deep: true
29465
29479
  });
@@ -29501,6 +29515,25 @@ var Component$a = defineComponent({
29501
29515
  emit("update:targetList", targetList2);
29502
29516
  emit("change", sourceListType.value === ArrayType.BASE_ARRAY ? restList : selectList.value.map((v2) => toRaw(v2)), sourceListType.value === ArrayType.BASE_ARRAY ? targetList2 : selectedList.value.map((v2) => toRaw(v2)), targetList2);
29503
29517
  };
29518
+ const handleItemChecked = (dirct) => {
29519
+ const target = dirct === "source" ? selectList : selectedList;
29520
+ multipleSelectAllValue.value[dirct] = multipleSelectList.value[dirct].length === target.value.length;
29521
+ };
29522
+ const handleAllChecked = (value, dirct) => {
29523
+ const target = dirct === "source" ? selectList : selectedList;
29524
+ multipleSelectList.value[dirct] = value ? target.value.map((item) => item[settingCode.value]) : [];
29525
+ };
29526
+ const handleMultipleChange = (dirct) => {
29527
+ const isLeft = dirct === "left";
29528
+ const from = isLeft ? selectList : selectedList;
29529
+ const to = isLeft ? selectedList : selectList;
29530
+ const checkeds = multipleSelectList.value[isLeft ? "source" : "target"];
29531
+ const items = from.value.filter((val) => checkeds.includes(val[settingCode.value]));
29532
+ from.value = from.value.filter((val) => !checkeds.includes(val[settingCode.value]));
29533
+ to.value.push(...items);
29534
+ multipleSelectList.value[isLeft ? "source" : "target"] = [];
29535
+ handleEmitUpdateTargetList();
29536
+ };
29504
29537
  return {
29505
29538
  selectSearchQuery,
29506
29539
  selectListSearch,
@@ -29512,17 +29545,28 @@ var Component$a = defineComponent({
29512
29545
  allToRight,
29513
29546
  allToLeft,
29514
29547
  handleItemClick,
29515
- t: t2
29548
+ t: t2,
29549
+ handleAllChecked,
29550
+ multipleSelectAllValue,
29551
+ multipleSelectList,
29552
+ handleMultipleChange,
29553
+ handleItemChecked
29516
29554
  };
29517
29555
  },
29518
29556
  render() {
29557
+ const {
29558
+ multiple
29559
+ } = this.$props;
29519
29560
  const leftList = this.sortable ? this.selectListSort : this.selectListSearch;
29520
29561
  const rightList = this.sortable ? this.selectedListSort : this.selectedList;
29521
29562
  const getHeaderHtml = (dirct) => {
29522
29563
  var _a, _b;
29523
29564
  const isLeft = dirct === "left-header";
29565
+ const selectField = isLeft ? "source" : "target";
29524
29566
  const titleText = isLeft ? `${(_a = this.title[0]) != null ? _a : this.t.sourceList}` : `${(_b = this.title[1]) != null ? _b : this.t.targetList}`;
29525
29567
  const isDisabled = isLeft ? !leftList.length : !rightList.length;
29568
+ const isIndeterminate = !!this.multipleSelectList[selectField].length && !this.multipleSelectAllValue[selectField];
29569
+ const selectCount = this.multipleSelectList[selectField].length;
29526
29570
  const headerClick = () => {
29527
29571
  if (isDisabled)
29528
29572
  return;
@@ -29532,8 +29576,24 @@ var Component$a = defineComponent({
29532
29576
  "class": "slot-header"
29533
29577
  }, [this.$slots[dirct]()]) : createVNode("div", {
29534
29578
  "class": "header"
29535
- }, [`${titleText}\uFF08${isLeft ? leftList.length : rightList.length}\uFF09`, createVNode("span", {
29579
+ }, [this.multiple ? createVNode(BkCheckbox, {
29580
+ "class": "header-checkbox",
29581
+ "label": titleText,
29582
+ "modelValue": this.multipleSelectAllValue[selectField],
29583
+ "onUpdate:modelValue": ($event) => this.multipleSelectAllValue[selectField] = $event,
29584
+ "indeterminate": isIndeterminate,
29585
+ "onChange": (val) => this.handleAllChecked(val, selectField)
29586
+ }, null) : createVNode(Fragment, null, [`${titleText}\uFF08${isLeft ? leftList.length : rightList.length}\uFF09`]), this.multiple ? createVNode("div", {
29587
+ "class": "select-total-count"
29588
+ }, [createVNode("span", {
29589
+ "class": "select-count"
29590
+ }, [selectCount]), createVNode("span", {
29591
+ "class": "count-delimiter"
29592
+ }, [createTextVNode("/")]), createVNode("span", {
29593
+ "class": "total-count"
29594
+ }, [isLeft ? leftList.length : rightList.length])]) : createVNode("span", {
29536
29595
  "class": {
29596
+ "select-all": true,
29537
29597
  disabled: isDisabled
29538
29598
  },
29539
29599
  "onClick": () => headerClick()
@@ -29555,7 +29615,7 @@ var Component$a = defineComponent({
29555
29615
  }, [createVNode("span", {
29556
29616
  "class": "content-text",
29557
29617
  "title": item[this.displayCode]
29558
- }, [item[this.displayCode]]), createVNode("span", {
29618
+ }, [item[this.displayCode]]), !multiple && createVNode("span", {
29559
29619
  "class": "icon-wrapper"
29560
29620
  }, [isLeft ? createVNode(arrowsRight, {
29561
29621
  "class": "bk-icon icon-move"
@@ -29564,11 +29624,28 @@ var Component$a = defineComponent({
29564
29624
  }, null)])]);
29565
29625
  };
29566
29626
  const getListContentHtml = (dirct) => {
29627
+ let _slot;
29567
29628
  const isLeft = dirct === "left";
29629
+ const selectField = dirct === "left" ? "source" : "target";
29568
29630
  const list = isLeft ? leftList : rightList;
29569
29631
  const slotName = isLeft ? "source-option" : "target-option";
29570
29632
  const emptySlotName = isLeft ? "left-empty-content" : "right-empty-content";
29571
- return list.length ? createVNode("ul", {
29633
+ const contentMode = multiple ? createVNode(BkCheckboxGroup, {
29634
+ "class": "content is-flex",
29635
+ "modelValue": this.multipleSelectList[selectField],
29636
+ "onUpdate:modelValue": ($event) => this.multipleSelectList[selectField] = $event,
29637
+ "onChange": () => this.handleItemChecked(selectField)
29638
+ }, _isSlot$1(_slot = list.map((item) => createVNode("div", null, [createVNode(BkCheckbox, {
29639
+ "class": "checkbox-item",
29640
+ "label": item[this.settingCode]
29641
+ }, {
29642
+ default: () => {
29643
+ var _a, _b, _c;
29644
+ return [(_c = (_b = (_a = this.$slots)[slotName]) == null ? void 0 : _b.call(_a, item)) != null ? _c : getDefaultListHtml(item, isLeft)];
29645
+ }
29646
+ })]))) ? _slot : {
29647
+ default: () => [_slot]
29648
+ }) : createVNode("ul", {
29572
29649
  "class": ["content", this.searchable && isLeft ? "is-search" : ""]
29573
29650
  }, [list.map((item) => {
29574
29651
  var _a, _b, _c;
@@ -29577,7 +29654,8 @@ var Component$a = defineComponent({
29577
29654
  "class": [this.$slots[slotName] ? "custom-item" : ""],
29578
29655
  "onClick": () => this.handleItemClick(item, isLeft)
29579
29656
  }, [(_c = (_b = (_a = this.$slots)[slotName]) == null ? void 0 : _b.call(_a, item)) != null ? _c : getDefaultListHtml(item, isLeft)]);
29580
- })]) : getEmptyHtml(emptySlotName);
29657
+ })]);
29658
+ return list.length ? contentMode : getEmptyHtml(emptySlotName);
29581
29659
  };
29582
29660
  return createVNode("div", {
29583
29661
  "class": ["bk-transfer", this.extCls]
@@ -29593,7 +29671,19 @@ var Component$a = defineComponent({
29593
29671
  prefix: () => createVNode(search, {
29594
29672
  "class": "icon-search"
29595
29673
  }, null)
29596
- }), getListContentHtml("left")]), createVNode(transfer, {
29674
+ }), getListContentHtml("left")]), multiple ? createVNode("div", {
29675
+ "class": "transfer-button-group"
29676
+ }, [createVNode("div", {
29677
+ "class": ["transfer-button", {
29678
+ disabled: !this.multipleSelectList.source.length
29679
+ }],
29680
+ "onClick": () => this.handleMultipleChange("left")
29681
+ }, [createVNode(angleRight, null, null)]), createVNode("div", {
29682
+ "class": ["transfer-button", {
29683
+ disabled: !this.multipleSelectList.target.length
29684
+ }],
29685
+ "onClick": () => this.handleMultipleChange("right")
29686
+ }, [createVNode(angleLeft, null, null)])]) : createVNode(transfer, {
29597
29687
  "class": "transfer"
29598
29688
  }, null), createVNode("div", {
29599
29689
  "class": "target-list"