bkui-vue 0.0.1-beta.156 → 0.0.1-beta.157

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 (81) hide show
  1. package/dist/index.cjs.js +28 -28
  2. package/dist/index.esm.js +123 -71
  3. package/dist/index.umd.js +30 -30
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/affix.variable.css +2 -2
  7. package/lib/alert/alert.variable.css +2 -2
  8. package/lib/backtop/backtop.variable.css +2 -2
  9. package/lib/badge/badge.variable.css +2 -2
  10. package/lib/breadcrumb/breadcrumb.variable.css +2 -2
  11. package/lib/button/button.variable.css +2 -2
  12. package/lib/card/card.variable.css +2 -2
  13. package/lib/cascader/cascader-panel.d.ts +4 -4
  14. package/lib/cascader/cascader.css +13 -3
  15. package/lib/cascader/cascader.d.ts +2 -2
  16. package/lib/cascader/cascader.less +14 -1
  17. package/lib/cascader/cascader.variable.css +13 -3
  18. package/lib/cascader/index.d.ts +10 -10
  19. package/lib/cascader/index.js +1 -1
  20. package/lib/checkbox/checkbox.variable.css +2 -2
  21. package/lib/code-diff/code-diff.variable.css +2 -2
  22. package/lib/collapse/collapse.variable.css +2 -2
  23. package/lib/color-picker/color-picker.variable.css +2 -2
  24. package/lib/container/container.variable.css +2 -2
  25. package/lib/date-picker/date-picker.variable.css +2 -2
  26. package/lib/divider/divider.variable.css +2 -2
  27. package/lib/dropdown/dropdown.variable.css +2 -2
  28. package/lib/exception/exception.css +40 -14
  29. package/lib/exception/exception.d.ts +10 -3
  30. package/lib/exception/exception.less +59 -22
  31. package/lib/exception/exception.variable.css +42 -16
  32. package/lib/exception/index.d.ts +23 -8
  33. package/lib/exception/index.js +1 -1
  34. package/lib/fixed-navbar/fixed-navbar.variable.css +2 -2
  35. package/lib/form/form.variable.css +2 -2
  36. package/lib/input/input.variable.css +2 -2
  37. package/lib/link/link.variable.css +2 -2
  38. package/lib/loading/loading.variable.css +2 -2
  39. package/lib/menu/menu.variable.css +2 -2
  40. package/lib/menu/submenu.variable.css +2 -2
  41. package/lib/message/message.variable.css +2 -2
  42. package/lib/navigation/navigation.variable.css +2 -2
  43. package/lib/notify/notify.variable.css +2 -2
  44. package/lib/pagination/pagination.variable.css +2 -2
  45. package/lib/popover/popover.variable.css +2 -2
  46. package/lib/popover2/popover2.variable.css +2 -2
  47. package/lib/process/process.variable.css +2 -2
  48. package/lib/progress/progress.variable.css +2 -2
  49. package/lib/radio/radio.variable.css +2 -2
  50. package/lib/resize-layout/resize-layout.variable.css +2 -2
  51. package/lib/select/select.variable.css +2 -2
  52. package/lib/sideslider/sideslider.variable.css +2 -2
  53. package/lib/slider/slider.variable.css +2 -2
  54. package/lib/steps/steps.variable.css +2 -2
  55. package/lib/styles/mixins/scroll.variable.css +2 -2
  56. package/lib/styles/themes/themes.less +2 -2
  57. package/lib/switcher/switcher.variable.css +2 -2
  58. package/lib/tab/tab.variable.css +2 -2
  59. package/lib/table/const.d.ts +2 -2
  60. package/lib/table/index.d.ts +6 -6
  61. package/lib/table/index.js +1 -1
  62. package/lib/table/plugins/head-filter.variable.css +2 -2
  63. package/lib/table/plugins/head-sort.variable.css +2 -2
  64. package/lib/table/plugins/settings.variable.css +2 -2
  65. package/lib/table/table.css +41 -14
  66. package/lib/table/table.d.ts +2 -2
  67. package/lib/table/table.less +1 -1
  68. package/lib/table/table.variable.css +43 -16
  69. package/lib/tag/tag.css +23 -8
  70. package/lib/tag/tag.less +25 -8
  71. package/lib/tag/tag.variable.css +25 -10
  72. package/lib/tag-input/index.js +1 -1
  73. package/lib/tag-input/tag-input.variable.css +2 -2
  74. package/lib/timeline/timeline.variable.css +2 -2
  75. package/lib/transfer/transfer.variable.css +2 -2
  76. package/lib/tree/tree.css +3 -0
  77. package/lib/tree/tree.less +6 -0
  78. package/lib/tree/tree.variable.css +5 -2
  79. package/lib/upload/upload.variable.css +2 -2
  80. package/lib/virtual-render/virtual-render.variable.css +2 -2
  81. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -7320,6 +7320,7 @@ var lodash = { exports: {} };
7320
7320
  }
7321
7321
  }).call(commonjsGlobal);
7322
7322
  })(lodash, lodash.exports);
7323
+ var _$1 = lodash.exports;
7323
7324
  const lowerStr = "abcdefghijklmnopqrstuvwxyz0123456789";
7324
7325
  const random = (n2, str = lowerStr) => {
7325
7326
  let result = "";
@@ -10438,20 +10439,12 @@ var Component$t = defineComponent({
10438
10439
  props: {
10439
10440
  type: PropTypes.commonType(["404", "403", "500", "building", "empty", "search-empty", "login"], "type").def("404"),
10440
10441
  scene: PropTypes.commonType(["page", "part"], "scene").def("page"),
10441
- extCls: PropTypes.string
10442
+ title: PropTypes.string,
10443
+ description: PropTypes.string
10442
10444
  },
10443
10445
  setup(props2, {
10444
10446
  slots
10445
10447
  }) {
10446
- const tipText = {
10447
- 403: "\u65E0\u4E1A\u52A1\u6743\u9650",
10448
- 404: "\u9875\u9762\u4E0D\u5B58\u5728",
10449
- 500: "\u670D\u52A1\u7EF4\u62A4\u4E2D",
10450
- building: "\u529F\u80FD\u5EFA\u8BBE\u4E2D",
10451
- empty: "\u6CA1\u6709\u6570\u636E",
10452
- "search-empty": "\u641C\u7D22\u4E3A\u7A7A",
10453
- login: "\u8BF7\u767B\u5165\u84DD\u9CB8"
10454
- };
10455
10448
  const images = {
10456
10449
  403: permissions,
10457
10450
  404: notFound,
@@ -10461,19 +10454,58 @@ var Component$t = defineComponent({
10461
10454
  "search-empty": searchEmpty,
10462
10455
  login
10463
10456
  };
10464
- return () => {
10465
- var _a, _b;
10457
+ const renderImg = () => {
10458
+ const imgSrc = images[props2.type] ? images[props2.type] : empty;
10466
10459
  return createVNode("div", {
10467
- "class": ["bk-exception-wrapper", props2.extCls]
10468
- }, [createVNode("div", {
10469
- "class": ["bk-exception-img", `${props2.scene}-img`]
10460
+ "class": "bk-exception-img"
10470
10461
  }, [createVNode("img", {
10471
10462
  "class": "exception-image",
10472
- "src": images[props2.type],
10463
+ "src": imgSrc,
10473
10464
  "alt": "type"
10474
- }, null)]), createVNode("div", {
10475
- "class": ["bk-exception-text", `${props2.scene}-text`]
10476
- }, [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : tipText[props2.type]])]);
10465
+ }, null)]);
10466
+ };
10467
+ const renderTitle = () => {
10468
+ if (_$1.isFunction(slots.title)) {
10469
+ return createVNode("div", {
10470
+ "class": "bk-exception-title"
10471
+ }, [slots.title()]);
10472
+ }
10473
+ if (props2.title) {
10474
+ return createVNode("div", {
10475
+ "class": "bk-exception-title"
10476
+ }, [props2.title]);
10477
+ }
10478
+ return null;
10479
+ };
10480
+ const renderDescription = () => {
10481
+ if (_$1.isFunction(slots.description)) {
10482
+ return createVNode("div", {
10483
+ "class": "bk-exception-description"
10484
+ }, [slots.description()]);
10485
+ }
10486
+ if (props2.description) {
10487
+ return createVNode("div", {
10488
+ "class": "bk-exception-description"
10489
+ }, [props2.description]);
10490
+ }
10491
+ return null;
10492
+ };
10493
+ const renderFooter = () => {
10494
+ if (_$1.isFunction(slots.default)) {
10495
+ return createVNode("div", {
10496
+ "class": "bk-exception-footer"
10497
+ }, [slots.default()]);
10498
+ }
10499
+ return null;
10500
+ };
10501
+ return () => {
10502
+ const rootClass = classes({
10503
+ "bk-exception": true,
10504
+ [`bk-exception-${props2.scene}`]: true
10505
+ });
10506
+ return createVNode("div", {
10507
+ "class": rootClass
10508
+ }, [renderImg(), renderTitle(), renderDescription(), renderFooter()]);
10477
10509
  };
10478
10510
  }
10479
10511
  });
@@ -15494,7 +15526,7 @@ var EMITEVENTS = /* @__PURE__ */ ((EMITEVENTS2) => {
15494
15526
  EMITEVENTS2["COLUMN_SORT"] = "columnSort";
15495
15527
  EMITEVENTS2["COLUMN_FILTER"] = "columnFilter";
15496
15528
  EMITEVENTS2["ROW_CLICK"] = "rowClick";
15497
- EMITEVENTS2["ROW_DBL_CLICK"] = "rowDblClick";
15529
+ EMITEVENTS2["ROW_DBL_CLICK"] = "rowDblclick";
15498
15530
  EMITEVENTS2["ROW_EXPAND_CLICK"] = "rowExpand";
15499
15531
  EMITEVENTS2["PAGE_LIMIT_CHANGE"] = "pageLimitChange";
15500
15532
  EMITEVENTS2["PAGE_VALUE_CHANGE"] = "pageValueChange";
@@ -15508,7 +15540,7 @@ const EMIT_EVENT_TYPES = {
15508
15540
  ["columnFilter"]: EMPTY$1,
15509
15541
  ["columnSort"]: EMPTY$1,
15510
15542
  ["rowClick"]: EMPTY$1,
15511
- ["rowDblClick"]: EMPTY$1,
15543
+ ["rowDblclick"]: EMPTY$1,
15512
15544
  ["rowExpand"]: EMPTY$1,
15513
15545
  ["pageLimitChange"]: EMPTY$1,
15514
15546
  ["pageValueChange"]: EMPTY$1,
@@ -16177,19 +16209,13 @@ var BodyEmpty = defineComponent({
16177
16209
  emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E")
16178
16210
  },
16179
16211
  emits: ["change"],
16180
- setup(props2, {
16181
- slots
16182
- }) {
16212
+ setup(props2) {
16183
16213
  const type = computed(() => props2.list.length === 0 ? "empty" : "search-empty");
16184
16214
  return () => createVNode(BkException, {
16185
16215
  "scene": "part",
16186
- "type": type.value
16187
- }, {
16188
- default: () => {
16189
- var _a, _b;
16190
- return [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : props2.emptyText];
16191
- }
16192
- });
16216
+ "type": type.value,
16217
+ "description": props2.emptyText
16218
+ }, null);
16193
16219
  }
16194
16220
  });
16195
16221
  const resolvePropVal = (prop, key2, args) => {
@@ -16940,14 +16966,14 @@ class TableRender {
16940
16966
  Object.assign(this.props.pagination, {
16941
16967
  limit
16942
16968
  });
16943
- this.context.emit("pageLimitChange", limit);
16969
+ this.context.emit(EMITEVENTS.PAGE_LIMIT_CHANGE, limit);
16944
16970
  }
16945
16971
  hanlePageChange(current) {
16946
16972
  Object.assign(this.props.pagination, {
16947
16973
  current,
16948
16974
  value: current
16949
16975
  });
16950
- this.context.emit("pageValueChange", current);
16976
+ this.context.emit(EMITEVENTS.PAGE_VALUE_CHANGE, current);
16951
16977
  }
16952
16978
  setColumnActive(index, single = false) {
16953
16979
  const col = this.propActiveCols.find((item) => item.index === index);
@@ -16965,7 +16991,7 @@ class TableRender {
16965
16991
  handleColumnHeadClick(index) {
16966
16992
  if (this.props.columnPick !== "disabled") {
16967
16993
  this.setColumnActive(index, this.props.columnPick === "single");
16968
- this.context.emit("column-pick", this.propActiveCols);
16994
+ this.context.emit(EMITEVENTS.COLUMN_PICK, this.propActiveCols);
16969
16995
  }
16970
16996
  }
16971
16997
  getSortCell(column, index) {
@@ -17120,10 +17146,10 @@ class TableRender {
17120
17146
  }
17121
17147
  }
17122
17148
  handleRowClick(e, row, index, rows) {
17123
- this.context.emit("rowClick", e, row, index, rows, this);
17149
+ this.context.emit(EMITEVENTS.ROW_CLICK, e, row, index, rows, this);
17124
17150
  }
17125
17151
  handleRowDblClick(e, row, index, rows) {
17126
- this.context.emit("rowDblClick", e, row, index, rows, this);
17152
+ this.context.emit(EMITEVENTS.ROW_DBL_CLICK, e, row, index, rows, this);
17127
17153
  }
17128
17154
  getExpandCell(row) {
17129
17155
  const isExpand = !!row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND];
@@ -17830,11 +17856,9 @@ function useFlatList(props2) {
17830
17856
  displayKey,
17831
17857
  list
17832
17858
  } = toRefs(props2);
17833
- const state = reactive({
17834
- flatList: []
17835
- });
17859
+ const flatList = reactive([]);
17836
17860
  watch([useGroup, saveKey, displayKey, list], () => {
17837
- state.flatList = [];
17861
+ flatList.splice(0, flatList.length);
17838
17862
  let formatList = list.value;
17839
17863
  if (useGroup.value) {
17840
17864
  formatList = list.value.reduce((formatList2, item) => {
@@ -17850,9 +17874,17 @@ function useFlatList(props2) {
17850
17874
  return formatList2.concat(children);
17851
17875
  }, []);
17852
17876
  }
17853
- state.flatList = [...formatList];
17877
+ appendToTargetList(formatList);
17854
17878
  }, { immediate: true, deep: true });
17855
- return state.flatList;
17879
+ function appendToTargetList(targetList) {
17880
+ const QUANTUM = 3e4;
17881
+ const len = targetList.length;
17882
+ for (let i2 = 0; i2 < len; i2 += QUANTUM) {
17883
+ const appendList = targetList.slice(i2, Math.min(i2 + QUANTUM, len));
17884
+ flatList.push(...appendList);
17885
+ }
17886
+ }
17887
+ return flatList;
17856
17888
  }
17857
17889
  const getCharLength = (str) => {
17858
17890
  const len = str.length;
@@ -18019,7 +18051,9 @@ var Component$c = defineComponent({
18019
18051
  }));
18020
18052
  watch([() => [...props2.modelValue], () => [...props2.list]], () => {
18021
18053
  var _a;
18022
- initData();
18054
+ nextTick(() => {
18055
+ initData();
18056
+ });
18023
18057
  if (props2.withValidate) {
18024
18058
  (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change");
18025
18059
  }
@@ -26108,9 +26142,10 @@ const BkDropdown = withInstallProps(Dropdown, { DropdownMenu, DropdownItem });
26108
26142
  var CascaderPanel = defineComponent({
26109
26143
  name: "CascaderPanel",
26110
26144
  props: {
26111
- store: PropTypes.object.def({})
26145
+ store: PropTypes.object.def({}),
26146
+ modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([])])
26112
26147
  },
26113
- emits: ["input"],
26148
+ emits: ["update:modelValue"],
26114
26149
  setup(props2, {
26115
26150
  emit
26116
26151
  }) {
@@ -26122,24 +26157,25 @@ var CascaderPanel = defineComponent({
26122
26157
  });
26123
26158
  const activePath = ref([]);
26124
26159
  const checkValue = ref([]);
26125
- const nodeCheckHandler = (node) => {
26126
- if (node.config.multiple) {
26127
- checkValue.value = store.getCheckedNodes().map((node2) => node2.path);
26128
- } else {
26129
- checkValue.value = node.path;
26160
+ const updateCheckValue = (value) => {
26161
+ if (value.length === 0) {
26162
+ menus.list = menus.list.slice(0, 1);
26163
+ activePath.value = [];
26130
26164
  }
26131
- emit("input", checkValue.value);
26132
- };
26133
- const nodeClear = () => {
26134
- emit("input", []);
26135
- };
26136
- const syncCheckedValue = (value) => {
26137
26165
  value.forEach((id) => {
26138
26166
  const node = store.getNodeById(id);
26139
26167
  nodeExpandHandler(node);
26140
26168
  });
26141
26169
  checkValue.value = value;
26142
26170
  };
26171
+ const nodeCheckHandler = (node) => {
26172
+ if (node.config.multiple) {
26173
+ checkValue.value = store.getCheckedNodes().map((node2) => node2.path);
26174
+ } else {
26175
+ checkValue.value = node.path;
26176
+ }
26177
+ emit("update:modelValue", checkValue.value);
26178
+ };
26143
26179
  const nodeExpandHandler = (node) => {
26144
26180
  var _a;
26145
26181
  if (node.isDisabled)
@@ -26204,6 +26240,11 @@ var CascaderPanel = defineComponent({
26204
26240
  }, null) : createVNode(angleRight, {
26205
26241
  "class": "icon-angle-right"
26206
26242
  }, null);
26243
+ watch(() => props2.modelValue, (value) => {
26244
+ updateCheckValue(value);
26245
+ }, {
26246
+ immediate: true
26247
+ });
26207
26248
  return {
26208
26249
  menus,
26209
26250
  activePath,
@@ -26212,10 +26253,8 @@ var CascaderPanel = defineComponent({
26212
26253
  nodeEvent,
26213
26254
  isCheckedNode,
26214
26255
  checkValue,
26215
- nodeClear,
26216
26256
  checkNode,
26217
- iconRender,
26218
- syncCheckedValue
26257
+ iconRender
26219
26258
  };
26220
26259
  },
26221
26260
  render() {
@@ -26375,13 +26414,18 @@ var Component$6 = defineComponent({
26375
26414
  const panelShow = ref(false);
26376
26415
  const selectedText = ref("");
26377
26416
  const selectedTags = ref([]);
26378
- const checkedValue = ref(props2.modelValue);
26417
+ const {
26418
+ modelValue
26419
+ } = toRefs(props2);
26379
26420
  const cascaderPanel = ref();
26380
- watch(() => props2.modelValue, (value) => {
26381
- updateValue(value);
26421
+ const checkedValue = computed({
26422
+ get: () => modelValue.value,
26423
+ set: (value) => {
26424
+ emit("update:modelValue", value);
26425
+ }
26382
26426
  });
26427
+ const popover3 = ref(null);
26383
26428
  const updateValue = (val) => {
26384
- cascaderPanel.value.syncCheckedValue(val);
26385
26429
  if (multiple) {
26386
26430
  selectedTags.value = store.getCheckedNodes().map((node) => ({
26387
26431
  text: node.pathNames.join(separator2),
@@ -26396,17 +26440,13 @@ var Component$6 = defineComponent({
26396
26440
  selectedText.value = node.pathNames.join(separator2);
26397
26441
  }
26398
26442
  };
26399
- const inputChangeHandler = (val) => {
26400
- updateValue(val);
26401
- emit("update:modelValue", val);
26402
- emit("change", val);
26403
- };
26404
26443
  const hidePopover = () => {
26405
26444
  panelShow.value = false;
26406
26445
  };
26407
26446
  const handleClear = (e) => {
26408
26447
  e.stopPropagation();
26409
26448
  updateValue([]);
26449
+ emit("update:modelValue", []);
26410
26450
  emit("clear", JSON.parse(JSON.stringify(props2.modelValue)));
26411
26451
  };
26412
26452
  const inputClickHandler = (e) => {
@@ -26420,6 +26460,15 @@ var Component$6 = defineComponent({
26420
26460
  current.splice(index, 1);
26421
26461
  updateValue(current);
26422
26462
  };
26463
+ watch(() => props2.modelValue, (value) => {
26464
+ var _a;
26465
+ updateValue(value);
26466
+ (_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.handlePopShow(false);
26467
+ emit("update:modelValue", value);
26468
+ emit("change", value);
26469
+ }, {
26470
+ immediate: true
26471
+ });
26423
26472
  return {
26424
26473
  store,
26425
26474
  updateValue,
@@ -26431,10 +26480,10 @@ var Component$6 = defineComponent({
26431
26480
  handleClear,
26432
26481
  isHover,
26433
26482
  setHover,
26483
+ popover: popover3,
26434
26484
  cancelHover,
26435
26485
  selectedTags,
26436
26486
  removeTag,
26437
- inputChangeHandler,
26438
26487
  cascaderPanel
26439
26488
  };
26440
26489
  },
@@ -26468,7 +26517,8 @@ var Component$6 = defineComponent({
26468
26517
  return createVNode("div", {
26469
26518
  "class": ["bk-cascader", "bk-cascader-wrapper", this.extCls, {
26470
26519
  "bk-is-show-panel": this.panelShow,
26471
- "is-unselected": this.modelValue.length === 0
26520
+ "is-unselected": this.modelValue.length === 0,
26521
+ "is-hover": this.isHover
26472
26522
  }],
26473
26523
  "tabindex": "0",
26474
26524
  "data-placeholder": this.placeholder,
@@ -26482,6 +26532,7 @@ var Component$6 = defineComponent({
26482
26532
  "class": "bk-cascader-popover-wrapper",
26483
26533
  "isShow": this.panelShow,
26484
26534
  "onUpdate:isShow": ($event) => this.panelShow = $event,
26535
+ "ref": "popover",
26485
26536
  "boundary": "body"
26486
26537
  }, {
26487
26538
  default: () => createVNode("div", {
@@ -26497,7 +26548,8 @@ var Component$6 = defineComponent({
26497
26548
  }, [createVNode(CascaderPanel, {
26498
26549
  "store": this.store,
26499
26550
  "ref": "cascaderPanel",
26500
- "onInput": (val) => this.inputChangeHandler(val)
26551
+ "modelValue": this.checkedValue,
26552
+ "onUpdate:modelValue": ($event) => this.checkedValue = $event
26501
26553
  }, null)])
26502
26554
  })]);
26503
26555
  }