bkui-vue 0.0.1-beta.453 → 0.0.1-beta.455

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
@@ -31753,6 +31753,7 @@ var FormItem = defineComponent({
31753
31753
  }
31754
31754
  });
31755
31755
  const BkForm = withInstallProps(Form, { FormItem, ComposeFormItem });
31756
+ const containerKey = Symbol("containerProps");
31756
31757
  const colProps = {
31757
31758
  span: PropTypes.number.def(1),
31758
31759
  offset: PropTypes.number.def(0),
@@ -31768,7 +31769,7 @@ var Col = defineComponent({
31768
31769
  col,
31769
31770
  gutter,
31770
31771
  flex
31771
- } = inject("containerProps");
31772
+ } = inject(containerKey);
31772
31773
  const {
31773
31774
  span,
31774
31775
  offset: offset2,
@@ -31819,7 +31820,7 @@ var Container = defineComponent({
31819
31820
  flex,
31820
31821
  extCls
31821
31822
  } = props2;
31822
- provide("containerProps", {
31823
+ provide(containerKey, {
31823
31824
  col,
31824
31825
  gutter,
31825
31826
  flex
@@ -31851,7 +31852,7 @@ var Row = defineComponent({
31851
31852
  col,
31852
31853
  gutter,
31853
31854
  flex
31854
- } = inject("containerProps");
31855
+ } = inject(containerKey);
31855
31856
  provide("containerProps", {
31856
31857
  col,
31857
31858
  gutter,
@@ -32028,18 +32029,32 @@ var CascaderPanel = defineComponent({
32028
32029
  menus.list = menus.list.slice(0, 1);
32029
32030
  activePath.value = [];
32030
32031
  }
32031
- value.forEach((id) => {
32032
+ expandByNodeList(value);
32033
+ checkValue.value = value;
32034
+ };
32035
+ const expandByNodeList = (value) => {
32036
+ let targetList = [];
32037
+ if (store.config.multiple) {
32038
+ for (const subArray of value) {
32039
+ if (subArray.length > targetList.length) {
32040
+ targetList = subArray;
32041
+ }
32042
+ }
32043
+ } else {
32044
+ targetList = value;
32045
+ }
32046
+ targetList.forEach((id) => {
32032
32047
  const node = store.getNodeById(id);
32033
32048
  nodeExpandHandler(node);
32034
32049
  });
32035
- checkValue.value = value;
32036
32050
  };
32037
32051
  const nodeCheckHandler = (node) => {
32038
32052
  if (node.isDisabled) {
32039
32053
  return;
32040
32054
  }
32041
32055
  if (node.config.multiple) {
32042
- checkValue.value = store.getCheckedNodes().map((node2) => node2.path);
32056
+ const targets = store.config.checkAnyLevel ? store.getCheckedNodes() : store.getCheckedLeafNodes();
32057
+ checkValue.value = targets.map((node2) => node2.path);
32043
32058
  } else {
32044
32059
  checkValue.value = node.path;
32045
32060
  }
@@ -32148,6 +32163,7 @@ var CascaderPanel = defineComponent({
32148
32163
  panelWidth,
32149
32164
  panelHeight,
32150
32165
  searchPanelEvents,
32166
+ expandByNodeList,
32151
32167
  noDataText
32152
32168
  };
32153
32169
  },
@@ -32290,15 +32306,13 @@ class Node$1 {
32290
32306
  this.isIndeterminate = checkedNum !== totalNum && checkedNum > 0;
32291
32307
  }
32292
32308
  setNodeCheck(status) {
32293
- if (this.checked !== status) {
32294
- if (this.config.checkAnyLevel) {
32295
- this.checked = status;
32296
- return;
32297
- }
32298
- this.broadcast("check", status);
32299
- this.setCheckState(status);
32300
- this.emit("check");
32309
+ if (this.config.checkAnyLevel) {
32310
+ this.checked = status;
32311
+ return;
32301
32312
  }
32313
+ this.broadcast("check", status);
32314
+ this.setCheckState(status);
32315
+ this.emit("check");
32302
32316
  }
32303
32317
  calculateNodesPath() {
32304
32318
  const nodes = [this];
@@ -32331,14 +32345,14 @@ class Store {
32331
32345
  }
32332
32346
  clearChecked() {
32333
32347
  this.getFlattedNodes().forEach((node) => {
32334
- node.checked = false;
32348
+ node.setNodeCheck(false);
32335
32349
  node.isIndeterminate = false;
32336
32350
  });
32337
32351
  }
32338
32352
  removeTag(tag2) {
32339
32353
  this.getFlattedNodes().find((node) => {
32340
32354
  if (arrayEqual(tag2, node.path)) {
32341
- node.checked = false;
32355
+ node.setNodeCheck(false);
32342
32356
  return true;
32343
32357
  }
32344
32358
  return false;
@@ -32349,17 +32363,20 @@ class Store {
32349
32363
  }
32350
32364
  setNodesCheck(nodes) {
32351
32365
  this.getFlattedNodes().forEach((node) => {
32352
- node.checked = false;
32366
+ node.setNodeCheck(false);
32353
32367
  const checkedNode = nodes.find((nodeValue) => arrayEqual(node.path, nodeValue));
32354
32368
  if (checkedNode) {
32355
32369
  const currentNode = this.getNodeByValue(checkedNode);
32356
- currentNode.checked = true;
32370
+ currentNode.setNodeCheck(true);
32357
32371
  }
32358
32372
  });
32359
32373
  }
32360
32374
  getCheckedNodes() {
32361
32375
  return this.getFlattedNodes().filter((node) => node.checked);
32362
32376
  }
32377
+ getCheckedLeafNodes() {
32378
+ return this.getFlattedNodes().filter((node) => node.isLeaf && node.checked);
32379
+ }
32363
32380
  getNodeByValue(value) {
32364
32381
  var _a;
32365
32382
  const nodes = this.getFlattedNodes().filter((node) => arrayEqual(node.path, value));
@@ -32462,22 +32479,18 @@ var Component$8 = defineComponent({
32462
32479
  var _a;
32463
32480
  if (multiple) {
32464
32481
  store.value.setNodesCheck(val);
32465
- selectedTags.value = store.value.getCheckedNodes().map((node) => ({
32466
- text: getShowText(node),
32467
- key: node.id
32482
+ selectedTags.value = store.value.getCheckedNodes().filter((node2) => store.value.config.checkAnyLevel || node2.isLeaf).map((node2) => ({
32483
+ text: getShowText(node2),
32484
+ key: node2.id
32468
32485
  }));
32469
32486
  selectedText.value = selectedTags.value.map((item) => item.text).join(", ");
32470
32487
  return;
32471
32488
  }
32472
- !props2.checkAnyLevel && ((_a = popover2 == null ? void 0 : popover2.value) == null ? void 0 : _a.hide());
32473
- if (val.length === 0) {
32474
- selectedText.value = "";
32475
- } else {
32476
- const node = store.value.getNodeByValue(val);
32477
- if (!node)
32478
- return;
32479
- selectedText.value = getShowText(node);
32489
+ if (!props2.checkAnyLevel) {
32490
+ (_a = popover2 == null ? void 0 : popover2.value) == null ? void 0 : _a.hide();
32480
32491
  }
32492
+ const node = store.value.getNodeByValue(val);
32493
+ selectedText.value = node ? getShowText(node) : "";
32481
32494
  updateSearchKey();
32482
32495
  };
32483
32496
  const handleClear = (e) => {
@@ -40612,6 +40625,7 @@ var SearchSelectInput = defineComponent({
40612
40625
  }
40613
40626
  async function handleSelectItem(item, type) {
40614
40627
  var _a, _b, _c, _d, _e;
40628
+ console.info(item, "==========");
40615
40629
  if ((_a = item.value) == null ? void 0 : _a.id) {
40616
40630
  if (props2.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props2.validateValues) {
40617
40631
  const seleted = new SelectedItem(__spreadProps(__spreadValues({}, item), {
@@ -40654,8 +40668,12 @@ var SearchSelectInput = defineComponent({
40654
40668
  handleSelectItem(item, "condition");
40655
40669
  }
40656
40670
  function handleMenuFooterClick(item) {
40671
+ var _a;
40657
40672
  switch (item.id) {
40658
40673
  case "confirm":
40674
+ if (!((_a = usingItem.value) == null ? void 0 : _a.values.length))
40675
+ return;
40676
+ keyword.value = "";
40659
40677
  handleKeyEnter();
40660
40678
  break;
40661
40679
  case "cancel":