bkui-vue 0.0.1-beta.139 → 0.0.1-beta.141

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 (83) hide show
  1. package/dist/index.cjs.js +29 -29
  2. package/dist/index.esm.js +58 -42
  3. package/dist/index.umd.js +26 -26
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/affix.variable.css +11 -0
  7. package/lib/alert/alert.variable.css +11 -0
  8. package/lib/backtop/backtop.variable.css +11 -0
  9. package/lib/badge/badge.variable.css +11 -0
  10. package/lib/breadcrumb/breadcrumb.variable.css +11 -0
  11. package/lib/button/button.less +7 -7
  12. package/lib/button/button.variable.css +11 -0
  13. package/lib/card/card.variable.css +11 -0
  14. package/lib/cascader/cascader-panel.d.ts +1 -0
  15. package/lib/cascader/cascader.css +8 -1
  16. package/lib/cascader/cascader.d.ts +12 -2
  17. package/lib/cascader/cascader.less +9 -1
  18. package/lib/cascader/cascader.variable.css +19 -1
  19. package/lib/cascader/index.d.ts +40 -6
  20. package/lib/cascader/index.js +1 -1
  21. package/lib/cascader/interface.d.ts +4 -1
  22. package/lib/cascader/node.d.ts +2 -1
  23. package/lib/cascader/store.d.ts +3 -0
  24. package/lib/checkbox/checkbox.variable.css +11 -0
  25. package/lib/code-diff/code-diff.variable.css +11 -0
  26. package/lib/collapse/collapse.variable.css +11 -0
  27. package/lib/container/container.variable.css +11 -0
  28. package/lib/date-picker/date-picker.variable.css +11 -0
  29. package/lib/divider/divider.variable.css +11 -0
  30. package/lib/dropdown/dropdown.variable.css +11 -0
  31. package/lib/exception/exception.variable.css +11 -0
  32. package/lib/fixed-navbar/fixed-navbar.variable.css +11 -0
  33. package/lib/form/form.variable.css +11 -0
  34. package/lib/input/input.variable.css +11 -0
  35. package/lib/link/link.variable.css +11 -0
  36. package/lib/loading/loading.variable.css +11 -0
  37. package/lib/menu/menu.variable.css +11 -0
  38. package/lib/menu/submenu.variable.css +11 -0
  39. package/lib/message/index.js +1 -1
  40. package/lib/message/message.css +8 -1
  41. package/lib/message/message.less +9 -1
  42. package/lib/message/message.variable.css +19 -1
  43. package/lib/message/messageConstructor.d.ts +2 -2
  44. package/lib/navigation/navigation.variable.css +11 -0
  45. package/lib/notify/index.js +1 -1
  46. package/lib/notify/notify.css +7 -3
  47. package/lib/notify/notify.less +8 -3
  48. package/lib/notify/notify.variable.css +18 -3
  49. package/lib/notify/notifyConstructor.d.ts +2 -2
  50. package/lib/pagination/pagination.variable.css +11 -0
  51. package/lib/popover/popover.variable.css +11 -0
  52. package/lib/popover2/popover2.variable.css +11 -0
  53. package/lib/process/process.variable.css +11 -0
  54. package/lib/progress/progress.variable.css +11 -0
  55. package/lib/radio/radio.css +56 -50
  56. package/lib/radio/radio.less +181 -171
  57. package/lib/radio/radio.variable.css +70 -53
  58. package/lib/resize-layout/resize-layout.variable.css +11 -0
  59. package/lib/select/select.variable.css +11 -0
  60. package/lib/sideslider/index.d.ts +43 -35
  61. package/lib/sideslider/index.js +1 -1
  62. package/lib/sideslider/sideslider.css +6 -7
  63. package/lib/sideslider/sideslider.d.ts +21 -17
  64. package/lib/sideslider/sideslider.less +6 -7
  65. package/lib/sideslider/sideslider.variable.css +17 -7
  66. package/lib/slider/slider.variable.css +11 -0
  67. package/lib/steps/steps.variable.css +11 -0
  68. package/lib/styles/mixins/scroll.variable.css +11 -0
  69. package/lib/styles/themes/themes.less +13 -0
  70. package/lib/switcher/switcher.variable.css +11 -0
  71. package/lib/tab/tab.variable.css +11 -0
  72. package/lib/table/plugins/head-filter.variable.css +11 -0
  73. package/lib/table/plugins/head-sort.variable.css +11 -0
  74. package/lib/table/plugins/settings.variable.css +11 -0
  75. package/lib/table/table.variable.css +11 -0
  76. package/lib/tag/tag.variable.css +11 -0
  77. package/lib/tag-input/tag-input.variable.css +11 -0
  78. package/lib/timeline/timeline.variable.css +11 -0
  79. package/lib/transfer/transfer.variable.css +11 -0
  80. package/lib/tree/tree.variable.css +11 -0
  81. package/lib/upload/upload.variable.css +11 -0
  82. package/lib/virtual-render/virtual-render.variable.css +11 -0
  83. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -7960,14 +7960,6 @@ function debounce(delay = 300, fn2, immediate = false) {
7960
7960
  };
7961
7961
  return debounced;
7962
7962
  }
7963
- function filterProperty(data2, filter) {
7964
- return JSON.parse(JSON.stringify(data2, (key2, value) => {
7965
- if (filter.includes(key2)) {
7966
- return void 0;
7967
- }
7968
- return value;
7969
- }));
7970
- }
7971
7963
  function arrayEqual(arr1 = [], arr2 = []) {
7972
7964
  if (arr1.length !== arr2.length) {
7973
7965
  return false;
@@ -14666,14 +14658,6 @@ var Component$h = defineComponent({
14666
14658
  BkButton
14667
14659
  },
14668
14660
  props: __spreadProps(__spreadValues({}, sliderPops), {
14669
- title: {
14670
- type: String,
14671
- default: ""
14672
- },
14673
- extCls: {
14674
- type: String,
14675
- default: ""
14676
- },
14677
14661
  direction: {
14678
14662
  type: String,
14679
14663
  default: "right",
@@ -14742,10 +14726,10 @@ var Component$h = defineComponent({
14742
14726
  }
14743
14727
  };
14744
14728
  const className = `bk-sideslider-wrapper ${props.scrollable ? "scroll-able" : ""} ${props.extCls}`;
14745
- const maxHeight = slots.footer ? "calc(100vh - 114px)" : "calc(100vh - 60px)";
14729
+ const maxHeight = slots.footer ? "calc(100vh - 106px)" : "calc(100vh - 52px)";
14746
14730
  return createVNode(BkModal, mergeProps(props, {
14747
14731
  "maxHeight": maxHeight,
14748
- "extCls": className,
14732
+ "class": className,
14749
14733
  "style": `${props.direction}: 0;`,
14750
14734
  "onHidden": handleHidden,
14751
14735
  "onShown": handleShown,
@@ -19077,7 +19061,7 @@ const Message$1 = (constructor, options) => {
19077
19061
  });
19078
19062
  const container2 = document.createElement("div");
19079
19063
  const vm = createVNode(constructor, opts);
19080
- vm.props.onDestory = (id2) => {
19064
+ vm.props.onDestroy = (id2) => {
19081
19065
  close(id2, position, spacing, userOnClose);
19082
19066
  render$1(null, container2);
19083
19067
  };
@@ -19124,7 +19108,7 @@ const messageProps = {
19124
19108
  var MessageConstructor = defineComponent({
19125
19109
  name: "Message",
19126
19110
  props: messageProps,
19127
- emits: ["destory"],
19111
+ emits: ["destroy"],
19128
19112
  setup(props, {
19129
19113
  emit
19130
19114
  }) {
@@ -19157,7 +19141,7 @@ var MessageConstructor = defineComponent({
19157
19141
  });
19158
19142
  watch(visible, () => {
19159
19143
  if (!visible.value) {
19160
- emit("destory", props.id);
19144
+ emit("destroy", props.id);
19161
19145
  }
19162
19146
  });
19163
19147
  return {
@@ -19188,7 +19172,7 @@ var MessageConstructor = defineComponent({
19188
19172
  }, [createVNode("div", {
19189
19173
  "class": "bk-message-icon"
19190
19174
  }, [renderIcon()]), this.message]), this.dismissable && createVNode(error, {
19191
- "class": "bk-message-icon bk-message-close",
19175
+ "class": "bk-message-close",
19192
19176
  "onClick": this.close
19193
19177
  }, null)]), [[vShow, this.visible]])]
19194
19178
  });
@@ -19214,7 +19198,7 @@ const notifyProps = {
19214
19198
  var NotifyConstructor = defineComponent({
19215
19199
  name: "Notify",
19216
19200
  props: notifyProps,
19217
- emits: ["destory"],
19201
+ emits: ["destroy"],
19218
19202
  setup(props, {
19219
19203
  emit
19220
19204
  }) {
@@ -19246,7 +19230,7 @@ var NotifyConstructor = defineComponent({
19246
19230
  });
19247
19231
  watch(visible, () => {
19248
19232
  if (!visible.value) {
19249
- emit("destory", props.id);
19233
+ emit("destroy", props.id);
19250
19234
  }
19251
19235
  });
19252
19236
  return {
@@ -19276,7 +19260,7 @@ var NotifyConstructor = defineComponent({
19276
19260
  "class": "bk-notify-content"
19277
19261
  }, [createVNode("div", {
19278
19262
  "class": "bk-notify-icon"
19279
- }, [renderIcon()]), this.title ? createVNode("h3", {
19263
+ }, [renderIcon()]), this.title ? createVNode("div", {
19280
19264
  "class": "bk-notify-content-header"
19281
19265
  }, [this.title]) : "", createVNode("div", {
19282
19266
  "class": "bk-notify-content-text"
@@ -25917,6 +25901,18 @@ var CascaderPanel = defineComponent({
25917
25901
  if ((_a = node.children) == null ? void 0 : _a.length) {
25918
25902
  menus.list.push(node.children);
25919
25903
  activePath.value.push(node);
25904
+ return;
25905
+ }
25906
+ if (store.config.isRemote && !node.isLeaf) {
25907
+ node.loading = true;
25908
+ const updateNodes = (nodeData) => {
25909
+ store.appendNodes(nodeData, node || null);
25910
+ menus.list.push(node.children);
25911
+ activePath.value.push(node);
25912
+ node.loading = false;
25913
+ };
25914
+ store.config.remoteMethod(node, updateNodes);
25915
+ console.log("remote fuck here");
25920
25916
  }
25921
25917
  };
25922
25918
  const nodeEvent = (node) => {
@@ -25956,6 +25952,11 @@ var CascaderPanel = defineComponent({
25956
25952
  node.setNodeCheck(value);
25957
25953
  nodeCheckHandler(node);
25958
25954
  };
25955
+ const iconRender = (node) => node.loading ? createVNode(spinner, {
25956
+ "class": "icon-spinner"
25957
+ }, null) : createVNode(angleRight, {
25958
+ "class": "icon-angle-right"
25959
+ }, null);
25959
25960
  return {
25960
25961
  menus,
25961
25962
  activePath,
@@ -25965,7 +25966,8 @@ var CascaderPanel = defineComponent({
25965
25966
  isCheckedNode,
25966
25967
  checkValue,
25967
25968
  nodeClear,
25968
- checkNode
25969
+ checkNode,
25970
+ iconRender
25969
25971
  };
25970
25972
  },
25971
25973
  render() {
@@ -25987,10 +25989,8 @@ var CascaderPanel = defineComponent({
25987
25989
  "onUpdate:modelValue": ($event) => node.checked = $event,
25988
25990
  "onChange": (val) => this.checkNode(node, val)
25989
25991
  }, null), createVNode("span", {
25990
- "class": "content"
25991
- }, [node.name]), !node.isLeaf ? createVNode(angleRight, {
25992
- "class": "icon-angle-right"
25993
- }, null) : ""]))]))]);
25992
+ "class": "bk-cascader-node-name"
25993
+ }, [node.name]), !node.isLeaf ? this.iconRender(node) : ""]))]))]);
25994
25994
  }
25995
25995
  });
25996
25996
  class Node$1 {
@@ -25998,25 +25998,30 @@ class Node$1 {
25998
25998
  this.data = node;
25999
25999
  this.config = config;
26000
26000
  this.parent = parent || null;
26001
+ this.leaf = node.leaf;
26001
26002
  this.level = !this.parent ? 1 : this.parent.level + 1;
26002
26003
  this.initState();
26003
26004
  }
26004
26005
  initState() {
26005
- var _a;
26006
26006
  const { idKey, nameKey, childrenKey } = this.config;
26007
26007
  this.id = this.data[idKey];
26008
26008
  this.name = this.data[nameKey];
26009
26009
  this.loading = false;
26010
+ this.loaded = false;
26010
26011
  this.checked = false;
26011
26012
  const childrenData = this.data[childrenKey];
26012
26013
  this.children = (childrenData || []).map((child) => new Node$1(child, this.config, this));
26013
- this.hasChildren = ((_a = this.children) == null ? void 0 : _a.length) !== 0;
26014
26014
  this.pathNodes = this.calculateNodesPath();
26015
26015
  this.path = this.pathNodes.map((node) => node.id);
26016
26016
  this.pathNames = this.pathNodes.map((node) => node.name);
26017
26017
  }
26018
26018
  get isLeaf() {
26019
- return !this.hasChildren;
26019
+ var _a;
26020
+ if (this.config.isRemote) {
26021
+ const isLeaf = this.leaf || (this.loaded ? !this.children.length : false);
26022
+ return isLeaf;
26023
+ }
26024
+ return !(Array.isArray(this.children) && ((_a = this.children) == null ? void 0 : _a.length) !== 0);
26020
26025
  }
26021
26026
  get isDisabled() {
26022
26027
  return this.data.disabled;
@@ -26047,8 +26052,8 @@ class Store {
26047
26052
  constructor(props) {
26048
26053
  const { list } = props;
26049
26054
  this.data = list;
26050
- this.config = filterProperty(props, ["list"]);
26051
26055
  this.nodes = this.data.map((node) => new Node$1(node, this.config));
26056
+ this.config = props;
26052
26057
  }
26053
26058
  getNodes() {
26054
26059
  return this.nodes;
@@ -26064,6 +26069,14 @@ class Store {
26064
26069
  const nodes = this.getFlattedNodes().filter((node) => arrayEqual(node.path, value));
26065
26070
  return (_a = nodes[0]) != null ? _a : null;
26066
26071
  }
26072
+ appendNode(nodeData, parentNode) {
26073
+ const node = new Node$1(nodeData, this.config, parentNode);
26074
+ const children = parentNode ? parentNode.children : this.nodes;
26075
+ children.push(node);
26076
+ }
26077
+ appendNodes(nodeDataList, parentNode) {
26078
+ nodeDataList.forEach((node) => this.appendNode(node, parentNode));
26079
+ }
26067
26080
  }
26068
26081
  var Component$5 = defineComponent({
26069
26082
  name: "Cascader",
@@ -26094,7 +26107,7 @@ var Component$5 = defineComponent({
26094
26107
  limitOneLine: PropTypes.bool.def(false),
26095
26108
  extCls: PropTypes.string.def("")
26096
26109
  },
26097
- emits: ["update:modelValue"],
26110
+ emits: ["update:modelValue", "change", "clear", "toggle"],
26098
26111
  setup(props, {
26099
26112
  emit
26100
26113
  }) {
@@ -26112,20 +26125,21 @@ var Component$5 = defineComponent({
26112
26125
  const selectedText = ref("");
26113
26126
  const selectedTags = ref([]);
26114
26127
  const updateValue = (val) => {
26115
- emit("update:modelValue", val);
26116
26128
  if (multiple) {
26117
- selectedTags.value = store.getCheckedNodes().map((node2) => ({
26118
- text: node2.pathNames.join(separator2),
26119
- key: node2.id
26129
+ selectedTags.value = store.getCheckedNodes().map((node) => ({
26130
+ text: node.pathNames.join(separator2),
26131
+ key: node.id
26120
26132
  }));
26121
26133
  return;
26122
26134
  }
26123
26135
  if (val.length === 0) {
26124
26136
  selectedText.value = "";
26125
- return;
26137
+ } else {
26138
+ const node = store.getNodeByValue(val);
26139
+ selectedText.value = node.pathNames.join(separator2);
26126
26140
  }
26127
- const node = store.getNodeByValue(val);
26128
- selectedText.value = node.pathNames.join(separator2);
26141
+ emit("update:modelValue", val);
26142
+ emit("change", val);
26129
26143
  };
26130
26144
  const hidePopover = () => {
26131
26145
  panelShow.value = false;
@@ -26133,10 +26147,12 @@ var Component$5 = defineComponent({
26133
26147
  const handleClear = (e) => {
26134
26148
  e.stopPropagation();
26135
26149
  updateValue([]);
26150
+ emit("clear", JSON.parse(JSON.stringify(props.modelValue)));
26136
26151
  };
26137
26152
  const inputClickHandler = (e) => {
26138
26153
  e.stopPropagation();
26139
26154
  panelShow.value = !panelShow.value;
26155
+ emit("toggle", panelShow.value);
26140
26156
  };
26141
26157
  const removeTag = (value, index, e) => {
26142
26158
  e.stopPropagation();