bkui-vue 0.0.1-beta.30 → 0.0.1-beta.31

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.
@@ -80,6 +80,7 @@ var virtualRender$1 = "";
80
80
  var transfer = "";
81
81
  var pagination = "";
82
82
  var timeline = "";
83
+ var codeDiff = "";
83
84
  var resizeLayout = "";
84
85
  var tagInput = "";
85
86
  const BKLAYERD_INDEX_EFAULT_VALUE = {
@@ -8461,6 +8462,7 @@ const loadingTypes = {
8461
8462
  type: Function
8462
8463
  },
8463
8464
  loading: PropTypes.bool,
8465
+ inline: PropTypes.bool.def(true),
8464
8466
  theme: PropTypes.theme(["white", "primary", "warning", "success", "danger"]),
8465
8467
  title: PropTypes.string.def(""),
8466
8468
  size: PropTypes.commonType(Object.values(BkLoadingSize)).def(BkLoadingSize.Normal),
@@ -8479,9 +8481,9 @@ var Component$r = vue.defineComponent({
8479
8481
  "class": `oval oval-${i2}`
8480
8482
  }, null))]);
8481
8483
  const loadingWrapperCls = vue.computed(() => classes({
8484
+ "bk-loading-wrapper": props.loading,
8482
8485
  "bk-nested-loading": !!ctx.slots.default
8483
- }, "bk-loading-wrapper"));
8484
- console.log(props.theme);
8486
+ }));
8485
8487
  const containerCls = vue.computed(() => classes({
8486
8488
  [`bk-loading-size-${props.size}`]: !!props.size,
8487
8489
  [`bk-loading-${props.theme}`]: !!props.theme
@@ -8499,15 +8501,15 @@ var Component$r = vue.defineComponent({
8499
8501
  });
8500
8502
  return () => {
8501
8503
  var _a, _b;
8502
- return ctx.slots.default && !props.loading ? (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a) : vue.createVNode("div", {
8504
+ return vue.createVNode("div", {
8503
8505
  "class": loadingWrapperCls.value
8504
- }, [vue.createVNode("div", {
8506
+ }, [props.loading && vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
8505
8507
  "class": containerCls.value
8506
8508
  }, [indicator.value, hasTitle.value && vue.createVNode("div", {
8507
8509
  "class": "bk-loading-title"
8508
8510
  }, [props.title])]), ctx.slots.default && vue.createVNode("div", {
8509
8511
  "class": "bk-loading-mask"
8510
- }, [ctx.slots.default()])]);
8512
+ }, null)]), (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
8511
8513
  };
8512
8514
  }
8513
8515
  });
@@ -11711,7 +11713,7 @@ var Component$7 = vue.defineComponent({
11711
11713
  }
11712
11714
  });
11713
11715
  const BkSwitcher = withInstall(Component$7);
11714
- const EventProps$1 = {
11716
+ const EventProps = {
11715
11717
  onContentScroll: Function
11716
11718
  };
11717
11719
  const virtualRenderProps = __spreadValues({
@@ -11734,7 +11736,7 @@ const virtualRenderProps = __spreadValues({
11734
11736
  scrollPosition: PropTypes.string.def("content"),
11735
11737
  abosuteHeight: PropTypes.oneOfType([PropTypes.string.def("auto"), PropTypes.number]).def("auto"),
11736
11738
  throttleDelay: PropTypes.number.def(60)
11737
- }, EventProps$1);
11739
+ }, EventProps);
11738
11740
  function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
11739
11741
  let startIndex = 0;
11740
11742
  let height = 0;
@@ -11963,10 +11965,7 @@ var Component$6 = vue.defineComponent({
11963
11965
  });
11964
11966
  const BkVirtualRender = withInstall(Component$6);
11965
11967
  const BORDER_OPRIONS = ["none", "row", "col", "outer"];
11966
- const EventProps = {
11967
- onRowClick: Function
11968
- };
11969
- const tableProps = __spreadValues({
11968
+ const tableProps = {
11970
11969
  data: PropTypes.arrayOf(PropTypes.any).def([]),
11971
11970
  columns: PropTypes.arrayOf(PropTypes.shape({
11972
11971
  label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
@@ -11985,7 +11984,7 @@ const tableProps = __spreadValues({
11985
11984
  border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPRIONS, "border")).def(["row"]),
11986
11985
  pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
11987
11986
  remotePagination: PropTypes.bool.def(false)
11988
- }, EventProps);
11987
+ };
11989
11988
  function _isSlot(s2) {
11990
11989
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !vue.isVNode(s2);
11991
11990
  }
@@ -12366,7 +12365,7 @@ const paginationProps = {
12366
12365
  var Component$5 = vue.defineComponent({
12367
12366
  name: "Pagination",
12368
12367
  props: paginationProps,
12369
- emits: ["update:modelValue", "change", "update:limit", "limit-change"],
12368
+ emits: ["update:modelValue", "change", "update:limit", "limitChange"],
12370
12369
  setup(props, context) {
12371
12370
  const totalPageNum = vue.ref(0);
12372
12371
  const {
@@ -12401,7 +12400,7 @@ var Component$5 = vue.defineComponent({
12401
12400
  context.emit("change", smallListCurrent2);
12402
12401
  });
12403
12402
  vue.watch(localLimit, (localLimit2) => {
12404
- context.emit("limit-change", localLimit2);
12403
+ context.emit("limitChange", localLimit2);
12405
12404
  });
12406
12405
  return {
12407
12406
  totalPageNum,
@@ -12606,14 +12605,14 @@ class TableRender {
12606
12605
  Object.assign(this.props.pagination, {
12607
12606
  limit
12608
12607
  });
12609
- this.context.emit("page-limit-change", limit);
12608
+ this.context.emit("pageLimitChange", limit);
12610
12609
  }
12611
12610
  hanlePageChange(current) {
12612
12611
  Object.assign(this.props.pagination, {
12613
12612
  current,
12614
12613
  value: current
12615
12614
  });
12616
- this.context.emit("page-value-change", current);
12615
+ this.context.emit("pageValueChange", current);
12617
12616
  }
12618
12617
  setColumnActive(index, single = false) {
12619
12618
  const col = this.propActiveCols.find((item) => item.index === index);
@@ -12698,7 +12697,7 @@ class TableRender {
12698
12697
  var Component$4 = vue.defineComponent({
12699
12698
  name: "Table",
12700
12699
  props: tableProps,
12701
- emits: ["column-pick", "row-click", "page-limit-change", "page-value-change"],
12700
+ emits: ["columnPick", "rowClick", "pageLimitChange", "pageValueChange"],
12702
12701
  setup(props, ctx) {
12703
12702
  const activeCols = vue.reactive(resolveActiveColumns(props));
12704
12703
  const colgroups = vue.reactive(props.columns.map((col) => __spreadProps(__spreadValues({}, col), {
@@ -13764,15 +13763,16 @@ var TagInput = vue.defineComponent({
13764
13763
  TagInput.install = (Vue) => {
13765
13764
  Vue.component(TagInput.name, TagInput);
13766
13765
  };
13766
+ const dividerProps = {
13767
+ direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
13768
+ align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
13769
+ color: PropTypes.string.def("#dde4eb"),
13770
+ width: PropTypes.number.def(1),
13771
+ type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
13772
+ };
13767
13773
  var bkDivider = vue.defineComponent({
13768
13774
  name: "Divider",
13769
- props: {
13770
- direction: PropTypes.commonType(["horizontal", "vertical"], "direction").def("horizontal"),
13771
- align: PropTypes.commonType(["left", "center", "right"], "align").def("center"),
13772
- color: PropTypes.string.def("#dde4eb"),
13773
- width: PropTypes.number.def(1),
13774
- type: PropTypes.commonType(["dashed", "solid"], "lineType").def("dashed")
13775
- },
13775
+ props: dividerProps,
13776
13776
  render() {
13777
13777
  const styles = () => {
13778
13778
  if (this.direction === "vertical") {
@@ -13797,46 +13797,73 @@ var bkDivider = vue.defineComponent({
13797
13797
  }
13798
13798
  });
13799
13799
  const BkDivider = withInstall(bkDivider);
13800
+ const tabNavEventProps = {
13801
+ tabAdd: {
13802
+ type: Function,
13803
+ default: () => ({})
13804
+ },
13805
+ tabChange: {
13806
+ type: Function,
13807
+ default: (name) => name
13808
+ },
13809
+ tabRemove: {
13810
+ type: Function,
13811
+ default: (name) => name
13812
+ },
13813
+ tabSort: {
13814
+ type: Function,
13815
+ default: () => ({})
13816
+ },
13817
+ tabDrag: {
13818
+ type: Function,
13819
+ default: () => ({})
13820
+ }
13821
+ };
13822
+ const tabProps = {
13823
+ active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
13824
+ type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
13825
+ tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
13826
+ closable: Boolean,
13827
+ addable: Boolean,
13828
+ sortable: Boolean,
13829
+ sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
13830
+ labelHeight: PropTypes.number.def(50),
13831
+ scrollStep: PropTypes.number.def(200),
13832
+ extCls: PropTypes.string.def(""),
13833
+ validateActive: PropTypes.bool.def(true),
13834
+ showHeader: PropTypes.bool.def(true),
13835
+ changeOnHover: PropTypes.bool.def(false),
13836
+ changeOnHoverDelay: PropTypes.number.def(1e3)
13837
+ };
13838
+ const tabNavProps = __spreadValues({
13839
+ active: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
13840
+ panels: {
13841
+ type: Array,
13842
+ default: () => []
13843
+ },
13844
+ closable: Boolean,
13845
+ addable: Boolean,
13846
+ sortable: Boolean,
13847
+ sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
13848
+ labelHeight: PropTypes.number.def(50),
13849
+ scrollStep: PropTypes.number.def(200),
13850
+ validateActive: PropTypes.bool.def(true),
13851
+ changeOnHover: PropTypes.bool.def(false),
13852
+ changeOnHoverDelay: PropTypes.number.def(1e3)
13853
+ }, tabNavEventProps);
13854
+ const tabPanelProps = {
13855
+ name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
13856
+ label: PropTypes.string || PropTypes.func,
13857
+ closable: PropTypes.bool,
13858
+ visible: PropTypes.bool.def(true),
13859
+ disabled: PropTypes.bool,
13860
+ sortable: PropTypes.bool,
13861
+ renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
13862
+ panel: PropTypes.string || PropTypes.func
13863
+ };
13800
13864
  var TabNav = vue.defineComponent({
13801
13865
  name: "TabNav",
13802
- props: {
13803
- active: {
13804
- type: String || Number
13805
- },
13806
- panels: {
13807
- type: Array,
13808
- default: () => []
13809
- },
13810
- closable: PropTypes.bool.def(false),
13811
- addable: PropTypes.bool.def(false),
13812
- sortable: PropTypes.bool.def(false),
13813
- sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
13814
- labelHeight: PropTypes.number.def(50),
13815
- scrollStep: PropTypes.number.def(200),
13816
- validateActive: PropTypes.bool.def(true),
13817
- changeOnHover: PropTypes.bool.def(false),
13818
- changeOnHoverDelay: PropTypes.number.def(1e3),
13819
- tabAdd: {
13820
- type: Function,
13821
- default: () => ({})
13822
- },
13823
- tabChange: {
13824
- type: Function,
13825
- default: () => ({})
13826
- },
13827
- tabRemove: {
13828
- type: Function,
13829
- default: () => ({})
13830
- },
13831
- tabSort: {
13832
- type: Function,
13833
- default: () => ({})
13834
- },
13835
- tabDrag: {
13836
- type: Function,
13837
- default: () => ({})
13838
- }
13839
- },
13866
+ props: tabNavProps,
13840
13867
  setup(props) {
13841
13868
  const navs = vue.computed(() => {
13842
13869
  if (!Array.isArray(props.panels) || !props.panels.length) {
@@ -13907,18 +13934,15 @@ var TabNav = vue.defineComponent({
13907
13934
  distinctRoots(el1, el2) {
13908
13935
  return el1 === el2;
13909
13936
  },
13910
- swapArr(arr, a2, b2) {
13911
- const swap = arr[a2];
13912
- arr[a2] = arr[b2];
13913
- arr[b2] = swap;
13914
- },
13915
13937
  handleTabAdd(e) {
13916
13938
  this.tabAdd(e);
13917
13939
  },
13918
13940
  dragstart(index, $event) {
13919
13941
  this.dragStartIndex = index;
13920
13942
  this.draggingEle = this.guid;
13921
- $event.dataTransfer.effectAllowed = "move";
13943
+ Object.assign($event.dataTransfer, {
13944
+ effectAllowed: "move"
13945
+ });
13922
13946
  this.tabDrag(index, $event);
13923
13947
  },
13924
13948
  dragenter(index) {
@@ -13935,20 +13959,7 @@ var TabNav = vue.defineComponent({
13935
13959
  if (!this.distinctRoots(this.draggingEle, this.guid)) {
13936
13960
  return false;
13937
13961
  }
13938
- if (sortType === "insert") {
13939
- if (this.dragStartIndex < index) {
13940
- this.panels.splice(index + 1, 0, this.panels[this.dragStartIndex]);
13941
- this.panels.splice(this.dragStartIndex, 1);
13942
- } else if (this.dragStartIndex > index) {
13943
- this.panels.splice(index, 0, this.panels[this.dragStartIndex]);
13944
- this.panels.splice(this.dragStartIndex + 1, 1);
13945
- } else {
13946
- return false;
13947
- }
13948
- } else {
13949
- this.swapArr(this.panels, this.dragStartIndex, index);
13950
- }
13951
- this.tabSort(this.dragStartIndex, index);
13962
+ this.tabSort(this.dragStartIndex, index, sortType);
13952
13963
  },
13953
13964
  handleTabChange(name) {
13954
13965
  this.tabChange(name);
@@ -13989,7 +14000,7 @@ var TabNav = vue.defineComponent({
13989
14000
  }
13990
14001
  return classNames.join(" ");
13991
14002
  };
13992
- const getValue = (value, value2) => typeof value === "boolean" ? value : value2;
14003
+ const getValue = (curentValue, parentValue) => curentValue || parentValue;
13993
14004
  return vue.createVNode("div", {
13994
14005
  "key": name,
13995
14006
  "onClick": () => this.handleTabChange(name),
@@ -14021,26 +14032,29 @@ var TabNav = vue.defineComponent({
14021
14032
  });
14022
14033
  const renderSlot = () => {
14023
14034
  var _a, _b, _c, _d;
14024
- let addSlot;
14025
14035
  const list = [];
14026
14036
  if (typeof this.$slots.add === "function") {
14027
- addSlot = (_b = (_a = this.$slots).add) == null ? void 0 : _b.call(_a, vue.h);
14037
+ list.push((_b = (_a = this.$slots).add) == null ? void 0 : _b.call(_a, vue.h));
14028
14038
  } else if (addable) {
14029
- addSlot = vue.createVNode("div", {
14039
+ list.push(vue.createVNode("div", {
14030
14040
  "onClick": this.handleTabAdd
14031
14041
  }, [vue.createVNode(plus, {
14032
14042
  "width": 26,
14033
14043
  "height": 26
14034
- }, null)]);
14044
+ }, null)]));
14035
14045
  }
14036
- list.push(addSlot);
14037
14046
  if (typeof this.$slots.setting === "function") {
14038
14047
  list.push((_d = (_c = this.$slots).setting) == null ? void 0 : _d.call(_c, vue.h));
14039
14048
  }
14040
- return list.map((item, index) => vue.createVNode("div", {
14041
- "class": "bk-tab-header-item",
14042
- "key": index
14043
- }, [item]));
14049
+ if (list.length) {
14050
+ return vue.createVNode("div", {
14051
+ "class": "bk-tab-header-operation"
14052
+ }, [list.map((item, index) => vue.createVNode("div", {
14053
+ "class": "bk-tab-header-item",
14054
+ "key": index
14055
+ }, [item]))]);
14056
+ }
14057
+ return null;
14044
14058
  };
14045
14059
  return vue.createVNode("div", {
14046
14060
  "style": {
@@ -14049,9 +14063,7 @@ var TabNav = vue.defineComponent({
14049
14063
  "class": "bk-tab-header"
14050
14064
  }, [vue.createVNode("div", {
14051
14065
  "class": "bk-tab-header-nav"
14052
- }, [renderNavs()]), vue.createVNode("div", {
14053
- "class": "bk-tab-header-operation"
14054
- }, [renderSlot()])]);
14066
+ }, [renderNavs()]), renderSlot()]);
14055
14067
  }
14056
14068
  });
14057
14069
  var Tab = vue.defineComponent({
@@ -14059,28 +14071,11 @@ var Tab = vue.defineComponent({
14059
14071
  components: {
14060
14072
  TabNav
14061
14073
  },
14062
- props: {
14063
- active: {
14064
- type: String || Number
14065
- },
14066
- type: PropTypes.commonType(["card", "border-card", "unborder-card"], "type").def("border-card"),
14067
- tabPosition: PropTypes.commonType(["left", "right", "top"], "position").def("top"),
14068
- closable: PropTypes.bool.def(false),
14069
- addable: PropTypes.bool.def(false),
14070
- sortable: PropTypes.bool.def(false),
14071
- sortType: PropTypes.commonType(["replace", "insert", "top"], "sortType").def("replace"),
14072
- labelHeight: PropTypes.number.def(50),
14073
- scrollStep: PropTypes.number.def(200),
14074
- extCls: PropTypes.string.def(""),
14075
- validateActive: PropTypes.bool.def(true),
14076
- showHeader: PropTypes.bool.def(true),
14077
- changeOnHover: PropTypes.bool.def(false),
14078
- changeOnHoverDelay: PropTypes.number.def(1e3)
14079
- },
14074
+ props: tabProps,
14080
14075
  emits: [
14081
14076
  "add-panel",
14082
14077
  "tab-change",
14083
- "close-panel",
14078
+ "remove-panel",
14084
14079
  "sort-change",
14085
14080
  "on-drag-tab",
14086
14081
  "add",
@@ -14097,7 +14092,7 @@ var Tab = vue.defineComponent({
14097
14092
  const panels = vue.ref([]);
14098
14093
  const instance = vue.getCurrentInstance();
14099
14094
  if (typeof slots.panel === "function") {
14100
- panels.value = slots.default();
14095
+ panels.value = slots.panel();
14101
14096
  }
14102
14097
  if (typeof slots.default === "function") {
14103
14098
  panels.value = slots.default();
@@ -14162,11 +14157,26 @@ var Tab = vue.defineComponent({
14162
14157
  },
14163
14158
  tabRemove(index, panel) {
14164
14159
  this.$emit("remove", index, panel);
14165
- this.$emit("close-panel", index, panel);
14160
+ this.$emit("remove-panel", index, panel);
14166
14161
  },
14167
- tabSort(dragTabIndex, dropTabIndex) {
14168
- this.$emit("sort", dragTabIndex, dropTabIndex);
14169
- this.$emit("sort-change", dragTabIndex, dropTabIndex);
14162
+ tabSort(dragTabIndex, dropTabIndex, sortType) {
14163
+ if (sortType === "insert") {
14164
+ if (dragTabIndex < dropTabIndex) {
14165
+ this.panels.splice(dropTabIndex + 1, 0, this.panels[dragTabIndex]);
14166
+ this.panels.splice(dragTabIndex, 1);
14167
+ } else if (dragTabIndex > dropTabIndex) {
14168
+ this.panels.splice(dropTabIndex, 0, this.panels[dragTabIndex]);
14169
+ this.panels.splice(dragTabIndex + 1, 1);
14170
+ } else {
14171
+ return false;
14172
+ }
14173
+ } else {
14174
+ const swap = this.panels[dropTabIndex];
14175
+ this.panels[dropTabIndex] = this.panels[dragTabIndex];
14176
+ this.panels[dragTabIndex] = swap;
14177
+ }
14178
+ this.$emit("sort", dragTabIndex, dropTabIndex, sortType);
14179
+ this.$emit("sort-change", dragTabIndex, dropTabIndex, sortType);
14170
14180
  },
14171
14181
  tabDrag(dragTabIndex, dragEvent) {
14172
14182
  this.$emit("drag", dragTabIndex, dragEvent);
@@ -14234,18 +14244,7 @@ var Tab = vue.defineComponent({
14234
14244
  });
14235
14245
  var TabPanel = vue.defineComponent({
14236
14246
  name: "TabPanel",
14237
- props: {
14238
- name: {
14239
- type: String || Number
14240
- },
14241
- label: String || Function,
14242
- closable: Function || Boolean,
14243
- visible: PropTypes.bool.def(true),
14244
- disabled: PropTypes.bool.def(null) || void 0,
14245
- sortable: Function || Boolean,
14246
- renderDirective: PropTypes.commonType(["if", "show"], "render").def("show"),
14247
- panel: String || Function
14248
- },
14247
+ props: tabPanelProps,
14249
14248
  render() {
14250
14249
  const active = this.name === this.$parent.active;
14251
14250
  const getContent = () => {
@@ -14269,8 +14268,7 @@ var TabPanel = vue.defineComponent({
14269
14268
  }, [getContent()]), [[vue.vShow, active]]);
14270
14269
  }
14271
14270
  });
14272
- const BKTab = withInstall(Tab);
14273
- const BKTabPanel = withInstall(TabPanel);
14271
+ const BkTab = withInstallProps(Tab, { TabPanel });
14274
14272
  const instances = {
14275
14273
  "top-left": [],
14276
14274
  "top-right": [],
@@ -20127,8 +20125,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
20127
20125
  Tag: BkTag,
20128
20126
  TagInput,
20129
20127
  Divider: BkDivider,
20130
- Tab: BKTab,
20131
- TabPanel: BKTabPanel,
20128
+ Tab: BkTab,
20129
+ TabPanel,
20132
20130
  Message,
20133
20131
  Notify,
20134
20132
  Menu: BkMenu,
@@ -20196,8 +20194,8 @@ exports.Sideslider = BkSideslider;
20196
20194
  exports.Steps = BkSteps;
20197
20195
  exports.Swiper = BkSwiper;
20198
20196
  exports.Switcher = BkSwitcher;
20199
- exports.Tab = BKTab;
20200
- exports.TabPanel = BKTabPanel;
20197
+ exports.Tab = BkTab;
20198
+ exports.TabPanel = TabPanel;
20201
20199
  exports.Table = BkTable;
20202
20200
  exports.Tag = BkTag;
20203
20201
  exports.TagInput = TagInput;