bkui-vue 0.0.1-beta.424 → 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
@@ -9900,9 +9900,13 @@ const vBkloading = {
9900
9900
  }
9901
9901
  },
9902
9902
  updated(el, binding) {
9903
+ var _a, _b, _c;
9903
9904
  const instance = el[INSTANCE_KEY];
9904
9905
  const { value } = binding;
9905
9906
  updateOptions(value, instance.options);
9907
+ if ((_c = (_b = (_a = instance == null ? void 0 : instance.vm) == null ? void 0 : _a.$el) == null ? void 0 : _b.parentNode) == null ? void 0 : _c.style) {
9908
+ instance.vm.$el.parentNode.style.display = value.loading ? "" : "none";
9909
+ }
9906
9910
  },
9907
9911
  unmounted(el) {
9908
9912
  var _a, _b, _c;
@@ -10757,7 +10761,7 @@ const propsCollapsePanel = __spreadValues({
10757
10761
  alone: PropTypes.bool.def(false),
10758
10762
  icon: PropTypes.string.def("angle-right")
10759
10763
  }, CollapsePanelEventProps);
10760
- function _isSlot$7(s2) {
10764
+ function _isSlot$8(s2) {
10761
10765
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
10762
10766
  }
10763
10767
  var CollapsePanel = defineComponent({
@@ -10868,7 +10872,7 @@ var CollapsePanel = defineComponent({
10868
10872
  "onClick": () => this.clickItem()
10869
10873
  }, [this.renderHeader(createVNode(this.collapseIcon, {
10870
10874
  "class": `bk-collapse-icon ${this.isActive && "rotate-icon" || ""}`
10871
- }, null))]), createVNode(CollapseTransition, null, _isSlot$7(_slot = this.renderPanel()) ? _slot : {
10875
+ }, null))]), createVNode(CollapseTransition, null, _isSlot$8(_slot = this.renderPanel()) ? _slot : {
10872
10876
  default: () => [_slot]
10873
10877
  })])]);
10874
10878
  }
@@ -11142,7 +11146,7 @@ const props$1 = __spreadProps(__spreadValues({}, propsMixin$1), {
11142
11146
  dialogType: dialogTypeUnion(),
11143
11147
  isLoading: PropTypes.bool.def(false)
11144
11148
  });
11145
- function _isSlot$6(s2) {
11149
+ function _isSlot$7(s2) {
11146
11150
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
11147
11151
  }
11148
11152
  var Dialog = defineComponent({
@@ -11395,7 +11399,7 @@ var Dialog = defineComponent({
11395
11399
  "onClose": this.handleClose,
11396
11400
  "isShow": this.isModalShow,
11397
11401
  "style": this.data.moveStyle
11398
- }), _isSlot$6(dialogSlot) ? dialogSlot : {
11402
+ }), _isSlot$7(dialogSlot) ? dialogSlot : {
11399
11403
  default: () => [dialogSlot]
11400
11404
  });
11401
11405
  }
@@ -14061,7 +14065,7 @@ const Line = (_2, {
14061
14065
  "style": titleStyle
14062
14066
  }, [showDefault()])])]), showDefault(false)]);
14063
14067
  };
14064
- function _isSlot$5(s2) {
14068
+ function _isSlot$6(s2) {
14065
14069
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
14066
14070
  }
14067
14071
  var Component$q = defineComponent({
@@ -14126,11 +14130,11 @@ var Component$q = defineComponent({
14126
14130
  const $props = __spreadProps(__spreadValues({}, this.$props), {
14127
14131
  percent: this.validPercent(this.percent)
14128
14132
  });
14129
- let progress2 = createVNode(Line, $props, _isSlot$5(progressInfo) ? progressInfo : {
14133
+ let progress2 = createVNode(Line, $props, _isSlot$6(progressInfo) ? progressInfo : {
14130
14134
  default: () => [progressInfo]
14131
14135
  });
14132
14136
  if (this.type === "circle" || this.type === "dashboard") {
14133
- progress2 = createVNode(Circle, $props, _isSlot$5(progressInfo) ? progressInfo : {
14137
+ progress2 = createVNode(Circle, $props, _isSlot$6(progressInfo) ? progressInfo : {
14134
14138
  default: () => [progressInfo]
14135
14139
  });
14136
14140
  }
@@ -16845,7 +16849,7 @@ var Component$k = defineComponent({
16845
16849
  }
16846
16850
  });
16847
16851
  const BkSelect = withInstallProps(Component$k, { Option: BkOption, Group: OptionGroup });
16848
- function _isSlot$4(s2) {
16852
+ function _isSlot$5(s2) {
16849
16853
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
16850
16854
  }
16851
16855
  const {
@@ -16939,7 +16943,7 @@ var Component$j = defineComponent({
16939
16943
  "onHidden": handleHidden,
16940
16944
  "onShown": handleShown,
16941
16945
  "onClose": handleClose
16942
- }), _isSlot$4(dialogSlot) ? dialogSlot : {
16946
+ }), _isSlot$5(dialogSlot) ? dialogSlot : {
16943
16947
  default: () => [dialogSlot]
16944
16948
  });
16945
16949
  };
@@ -17687,7 +17691,7 @@ var useScrollLoading = (props2, ctx) => {
17687
17691
  renderScrollLoading
17688
17692
  };
17689
17693
  };
17690
- function _isSlot$3(s2) {
17694
+ function _isSlot$4(s2) {
17691
17695
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
17692
17696
  }
17693
17697
  var useLimit = (t2) => {
@@ -17734,7 +17738,7 @@ var useLimit = (t2) => {
17734
17738
  "modelValue": localLimit.value,
17735
17739
  "onChange": handleLimitChange,
17736
17740
  "disabled": proxy.disabled
17737
- }, _isSlot$3(_slot = proxy.limitList.map((num, index2) => createVNode(BkOption, {
17741
+ }, _isSlot$4(_slot = proxy.limitList.map((num, index2) => createVNode(BkOption, {
17738
17742
  "value": num,
17739
17743
  "label": `${num}`,
17740
17744
  "key": `${index2}_${num}`
@@ -19317,7 +19321,7 @@ class TablePlugins {
19317
19321
  this.ctx = ctx;
19318
19322
  }
19319
19323
  }
19320
- function _isSlot$2(s2) {
19324
+ function _isSlot$3(s2) {
19321
19325
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
19322
19326
  }
19323
19327
  var Settings = defineComponent({
@@ -19501,7 +19505,7 @@ var Settings = defineComponent({
19501
19505
  "class": "setting-body-fields",
19502
19506
  "modelValue": checkedFields.value,
19503
19507
  "onUpdate:modelValue": ($event) => checkedFields.value = $event
19504
- }, _isSlot$2(_slot2 = renderFields.value.map((item, index2) => {
19508
+ }, _isSlot$3(_slot2 = renderFields.value.map((item, index2) => {
19505
19509
  let _slot;
19506
19510
  return createVNode("div", {
19507
19511
  "class": "field-item"
@@ -19509,7 +19513,7 @@ var Settings = defineComponent({
19509
19513
  "checked": checkedFields.value.includes(resolvedColVal(item, index2)),
19510
19514
  "label": resolvedColVal(item, index2),
19511
19515
  "disabled": isItemReadonly(item, index2)
19512
- }, _isSlot$2(_slot = resolvePropVal(item, "label", [item, index2])) ? _slot : {
19516
+ }, _isSlot$3(_slot = resolvePropVal(item, "label", [item, index2])) ? _slot : {
19513
19517
  default: () => [_slot]
19514
19518
  })]);
19515
19519
  })) ? _slot2 : {
@@ -19620,7 +19624,7 @@ var useFixedColumn = (_props, colgroups, hasScrollY) => {
19620
19624
  resolveColumnClass
19621
19625
  };
19622
19626
  };
19623
- function _isSlot$1(s2) {
19627
+ function _isSlot$2(s2) {
19624
19628
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
19625
19629
  }
19626
19630
  class TableRender {
@@ -19871,7 +19875,7 @@ class TableRender {
19871
19875
  "title": showTitle,
19872
19876
  "observerResize": this.props.observerResize,
19873
19877
  "resizerWay": this.props.resizerWay
19874
- }, _isSlot$1(cells) ? cells : {
19878
+ }, _isSlot$2(cells) ? cells : {
19875
19879
  default: () => [cells]
19876
19880
  });
19877
19881
  };
@@ -19979,7 +19983,7 @@ class TableRender {
19979
19983
  "row": row,
19980
19984
  "parentSetting": this.props.showOverflowTooltip,
19981
19985
  "observerResize": this.props.observerResize
19982
- }, _isSlot$1(_slot = this.renderCell(row, column, rowIndex, rows)) ? _slot : {
19986
+ }, _isSlot$2(_slot = this.renderCell(row, column, rowIndex, rows)) ? _slot : {
19983
19987
  default: () => [_slot]
19984
19988
  })]);
19985
19989
  }
@@ -29354,8 +29358,12 @@ const transferProps = {
29354
29358
  sortable: PropTypes.bool.def(false),
29355
29359
  sourceList: PropTypes.arrayOf(PropTypes.any).def([]),
29356
29360
  targetList: PropTypes.arrayOf(PropTypes.any).def([]),
29357
- emptyContent: PropTypes.arrayOf(PropTypes.string).def([])
29361
+ emptyContent: PropTypes.arrayOf(PropTypes.string).def([]),
29362
+ multiple: PropTypes.bool.def(false)
29358
29363
  };
29364
+ function _isSlot$1(s2) {
29365
+ return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
29366
+ }
29359
29367
  function useTransferData(sourceData, targetList, settingCode) {
29360
29368
  const selectList = ref([]);
29361
29369
  const selectedList = ref([]);
@@ -29407,6 +29415,14 @@ var Component$a = defineComponent({
29407
29415
  emit
29408
29416
  }) {
29409
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
+ });
29410
29426
  const sourceListType = computed(() => {
29411
29427
  if (Array.isArray(props2.sourceList)) {
29412
29428
  const isObjectArray = props2.sourceList.every((s2) => s2.toString().includes("[object Object]"));
@@ -29455,7 +29471,9 @@ var Component$a = defineComponent({
29455
29471
  });
29456
29472
  });
29457
29473
  watch(() => [selectList, selectedList], () => {
29458
- handleEmitUpdateTargetList();
29474
+ if (!props2.multiple) {
29475
+ handleEmitUpdateTargetList();
29476
+ }
29459
29477
  }, {
29460
29478
  deep: true
29461
29479
  });
@@ -29497,6 +29515,25 @@ var Component$a = defineComponent({
29497
29515
  emit("update:targetList", targetList2);
29498
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);
29499
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
+ };
29500
29537
  return {
29501
29538
  selectSearchQuery,
29502
29539
  selectListSearch,
@@ -29508,17 +29545,28 @@ var Component$a = defineComponent({
29508
29545
  allToRight,
29509
29546
  allToLeft,
29510
29547
  handleItemClick,
29511
- t: t2
29548
+ t: t2,
29549
+ handleAllChecked,
29550
+ multipleSelectAllValue,
29551
+ multipleSelectList,
29552
+ handleMultipleChange,
29553
+ handleItemChecked
29512
29554
  };
29513
29555
  },
29514
29556
  render() {
29557
+ const {
29558
+ multiple
29559
+ } = this.$props;
29515
29560
  const leftList = this.sortable ? this.selectListSort : this.selectListSearch;
29516
29561
  const rightList = this.sortable ? this.selectedListSort : this.selectedList;
29517
29562
  const getHeaderHtml = (dirct) => {
29518
29563
  var _a, _b;
29519
29564
  const isLeft = dirct === "left-header";
29565
+ const selectField = isLeft ? "source" : "target";
29520
29566
  const titleText = isLeft ? `${(_a = this.title[0]) != null ? _a : this.t.sourceList}` : `${(_b = this.title[1]) != null ? _b : this.t.targetList}`;
29521
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;
29522
29570
  const headerClick = () => {
29523
29571
  if (isDisabled)
29524
29572
  return;
@@ -29528,8 +29576,24 @@ var Component$a = defineComponent({
29528
29576
  "class": "slot-header"
29529
29577
  }, [this.$slots[dirct]()]) : createVNode("div", {
29530
29578
  "class": "header"
29531
- }, [`${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", {
29532
29595
  "class": {
29596
+ "select-all": true,
29533
29597
  disabled: isDisabled
29534
29598
  },
29535
29599
  "onClick": () => headerClick()
@@ -29551,7 +29615,7 @@ var Component$a = defineComponent({
29551
29615
  }, [createVNode("span", {
29552
29616
  "class": "content-text",
29553
29617
  "title": item[this.displayCode]
29554
- }, [item[this.displayCode]]), createVNode("span", {
29618
+ }, [item[this.displayCode]]), !multiple && createVNode("span", {
29555
29619
  "class": "icon-wrapper"
29556
29620
  }, [isLeft ? createVNode(arrowsRight, {
29557
29621
  "class": "bk-icon icon-move"
@@ -29560,11 +29624,28 @@ var Component$a = defineComponent({
29560
29624
  }, null)])]);
29561
29625
  };
29562
29626
  const getListContentHtml = (dirct) => {
29627
+ let _slot;
29563
29628
  const isLeft = dirct === "left";
29629
+ const selectField = dirct === "left" ? "source" : "target";
29564
29630
  const list = isLeft ? leftList : rightList;
29565
29631
  const slotName = isLeft ? "source-option" : "target-option";
29566
29632
  const emptySlotName = isLeft ? "left-empty-content" : "right-empty-content";
29567
- 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", {
29568
29649
  "class": ["content", this.searchable && isLeft ? "is-search" : ""]
29569
29650
  }, [list.map((item) => {
29570
29651
  var _a, _b, _c;
@@ -29573,7 +29654,8 @@ var Component$a = defineComponent({
29573
29654
  "class": [this.$slots[slotName] ? "custom-item" : ""],
29574
29655
  "onClick": () => this.handleItemClick(item, isLeft)
29575
29656
  }, [(_c = (_b = (_a = this.$slots)[slotName]) == null ? void 0 : _b.call(_a, item)) != null ? _c : getDefaultListHtml(item, isLeft)]);
29576
- })]) : getEmptyHtml(emptySlotName);
29657
+ })]);
29658
+ return list.length ? contentMode : getEmptyHtml(emptySlotName);
29577
29659
  };
29578
29660
  return createVNode("div", {
29579
29661
  "class": ["bk-transfer", this.extCls]
@@ -29589,7 +29671,19 @@ var Component$a = defineComponent({
29589
29671
  prefix: () => createVNode(search, {
29590
29672
  "class": "icon-search"
29591
29673
  }, null)
29592
- }), 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, {
29593
29687
  "class": "transfer"
29594
29688
  }, null), createVNode("div", {
29595
29689
  "class": "target-list"