bkui-vue 0.0.1-beta.194 → 0.0.1-beta.196

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
@@ -33,7 +33,7 @@ var __publicField = (obj, key2, value) => {
33
33
  __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
34
34
  return value;
35
35
  };
36
- import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, createApp, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, unref, watchEffect, onUpdated, render as render$1, onUnmounted, shallowRef, toRaw, withModifiers, TransitionGroup } from "vue";
36
+ import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, createApp, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, unref, watchEffect, markRaw, onUpdated, render as render$1, onUnmounted, shallowRef, toRaw, withModifiers, TransitionGroup } from "vue";
37
37
  var reset = "";
38
38
  var alert = "";
39
39
  var affix = "";
@@ -10680,6 +10680,7 @@ const EventProps$2 = {
10680
10680
  onAfterShow: Function
10681
10681
  };
10682
10682
  const PopoverProps$1 = __spreadValues({
10683
+ contentCls: PropTypes.string.def(""),
10683
10684
  isShow: PropTypes.bool.def(false),
10684
10685
  always: PropTypes.bool.def(false),
10685
10686
  disabled: PropTypes.bool.def(false),
@@ -10818,11 +10819,13 @@ var Component$q = defineComponent({
10818
10819
  const handleAfterLeave = () => {
10819
10820
  ctx.emit("after-leave");
10820
10821
  };
10821
- const customThemeCls = compTheme.value.customThemes.join(" ");
10822
- const customTheme = compTheme.value.customThemes.reduce((out, cur) => __spreadValues({
10822
+ const customTheme = computed(() => compTheme.value.customThemes.reduce((out, cur) => __spreadValues({
10823
10823
  [`data-${cur}-theme`]: true
10824
- }, out), {});
10825
- const contentClass = `bk-popover-content ${customThemeCls}`;
10824
+ }, out), {}));
10825
+ const contentClass = computed(() => {
10826
+ const customThemeCls = compTheme.value.customThemes.join(" ");
10827
+ return `bk-popover-content ${customThemeCls} ${props2.contentCls}`.trim();
10828
+ });
10826
10829
  const handleClickContent = (e) => {
10827
10830
  const stopBehaviorFn = (behavior) => {
10828
10831
  if (typeof e[behavior] === "function") {
@@ -10853,9 +10856,9 @@ var Component$q = defineComponent({
10853
10856
  var _a2, _b2, _c;
10854
10857
  return [createVNode("div", mergeProps({
10855
10858
  "ref": refContent,
10856
- "class": contentClass,
10859
+ "class": contentClass.value,
10857
10860
  "style": compStyle.value
10858
- }, customTheme, {
10861
+ }, customTheme.value, {
10859
10862
  "onClick": handleClickContent
10860
10863
  }), [(_c = (_b2 = (_a2 = ctx.slots).content) == null ? void 0 : _b2.call(_a2)) != null ? _c : content.value, arrow2.value && createVNode("div", {
10861
10864
  "class": "arrow",
@@ -15907,7 +15910,7 @@ var Component$g = defineComponent({
15907
15910
  })]);
15908
15911
  }
15909
15912
  });
15910
- const BkSteps$2 = withInstall(Component$g);
15913
+ const BkSteps = withInstall(Component$g);
15911
15914
  var Component$f = defineComponent({
15912
15915
  name: "Switcher",
15913
15916
  props: {
@@ -18884,12 +18887,12 @@ function useFlatList(props2) {
18884
18887
  displayKey,
18885
18888
  list
18886
18889
  } = toRefs(props2);
18887
- const flatList = reactive([]);
18890
+ const flatList = ref([]);
18888
18891
  watch([useGroup, saveKey, displayKey, list], () => {
18889
- flatList.splice(0, flatList.length);
18890
- let formatList = list.value;
18892
+ flatList.value = [];
18893
+ let formatList = markRaw(list.value);
18891
18894
  if (useGroup.value) {
18892
- formatList = list.value.reduce((formatList2, item) => {
18895
+ formatList = formatList.reduce((formatList2, item) => {
18893
18896
  let children = [];
18894
18897
  if (item.children) {
18895
18898
  children = item.children.map((child) => __spreadValues({
@@ -18902,16 +18905,8 @@ function useFlatList(props2) {
18902
18905
  return formatList2.concat(children);
18903
18906
  }, []);
18904
18907
  }
18905
- appendToTargetList(formatList);
18906
- }, { immediate: true, deep: true });
18907
- function appendToTargetList(targetList) {
18908
- const QUANTUM = 3e4;
18909
- const len = targetList.length;
18910
- for (let i2 = 0; i2 < len; i2 += QUANTUM) {
18911
- const appendList = targetList.slice(i2, Math.min(i2 + QUANTUM, len));
18912
- flatList.push(...appendList);
18913
- }
18914
- }
18908
+ flatList.value = formatList;
18909
+ }, { immediate: true });
18915
18910
  return flatList;
18916
18911
  }
18917
18912
  const getCharLength = (str) => {
@@ -19003,6 +18998,10 @@ const tagProps = () => ({
19003
18998
  withValidate: {
19004
18999
  type: Boolean,
19005
19000
  default: true
19001
+ },
19002
+ popoverProps: {
19003
+ type: Object,
19004
+ default: () => ({})
19006
19005
  }
19007
19006
  });
19008
19007
  var TagRender = defineComponent({
@@ -19042,7 +19041,7 @@ var Component$c = defineComponent({
19042
19041
  isHover: false,
19043
19042
  focusItemIndex: props2.allowCreate ? -1 : 0
19044
19043
  });
19045
- const popoverProps = reactive({
19044
+ const popoverProps = reactive(__spreadValues({
19046
19045
  isShow: false,
19047
19046
  width: 190,
19048
19047
  modifiers: [{
@@ -19051,7 +19050,7 @@ var Component$c = defineComponent({
19051
19050
  offset: [0, 4]
19052
19051
  }
19053
19052
  }]
19054
- });
19053
+ }, props2.popoverProps));
19055
19054
  const {
19056
19055
  maxResult
19057
19056
  } = toRefs(props2);
@@ -19077,7 +19076,7 @@ var Component$c = defineComponent({
19077
19076
  active: state.isEdit,
19078
19077
  disabled: props2.disabled
19079
19078
  }));
19080
- watch([() => [...props2.modelValue], () => [...props2.list]], () => {
19079
+ watch([() => props2.modelValue, () => props2.list], () => {
19081
19080
  var _a;
19082
19081
  nextTick(() => {
19083
19082
  initData();
@@ -19212,7 +19211,7 @@ var Component$c = defineComponent({
19212
19211
  trigger
19213
19212
  } = props2;
19214
19213
  listState.selectedTagList = [];
19215
- listState.localList = [...formatList];
19214
+ listState.localList = formatList.value;
19216
19215
  if (modelValue.length) {
19217
19216
  modelValue.forEach((tag2) => {
19218
19217
  const value = listState.localList.find((val) => tag2 === val[saveKey]);
@@ -19386,7 +19385,7 @@ var Component$c = defineComponent({
19386
19385
  e.stopPropagation();
19387
19386
  const removeList = listState.selectedTagList;
19388
19387
  listState.selectedTagList = [];
19389
- const existList = formatList.filter((item) => removeList.some((removeItem) => removeItem[props2.saveKey] === item[props2.saveKey]));
19388
+ const existList = formatList.value.filter((item) => removeList.some((removeItem) => removeItem[props2.saveKey] === item[props2.saveKey]));
19390
19389
  if ((props2.allowCreate && existList.length !== 0 || !props2.allowCreate) && !isSingleSelect.value) {
19391
19390
  listState.localList.push(...existList);
19392
19391
  }
@@ -19420,7 +19419,7 @@ var Component$c = defineComponent({
19420
19419
  swapElementPositions(tagInputItemRef.value, nodes[index - 1]);
19421
19420
  listState.selectedTagList.splice(index - 1, 1);
19422
19421
  focusInputTrigger();
19423
- const isExistInit = formatList.some((item) => item === target[props2.saveKey]);
19422
+ const isExistInit = formatList.value.some((item) => item === target[props2.saveKey]);
19424
19423
  if ((props2.allowCreate && isExistInit || !props2.allowCreate) && !isSingleSelect.value) {
19425
19424
  listState.localList.push(target);
19426
19425
  }
@@ -19643,7 +19642,7 @@ var Component$c = defineComponent({
19643
19642
  };
19644
19643
  const removeTag = (data2, index) => {
19645
19644
  listState.selectedTagList.splice(index, 1);
19646
- const isExistInit = formatList.some((item) => item === data2[props2.saveKey]);
19645
+ const isExistInit = formatList.value.some((item) => item === data2[props2.saveKey]);
19647
19646
  if ((props2.allowCreate && isExistInit || !props2.allowCreate) && !isSingleSelect.value) {
19648
19647
  listState.localList.push(data2);
19649
19648
  }
@@ -19678,56 +19677,20 @@ var Component$c = defineComponent({
19678
19677
  });
19679
19678
  },
19680
19679
  render() {
19681
- const renderSelectorList = () => {
19682
- if (this.useGroup) {
19683
- return this.renderList.map((group) => createVNode("li", {
19684
- "class": "bk-selector-group-item"
19685
- }, [createVNode("span", {
19686
- "class": "group-name"
19687
- }, [group.name, createTextVNode(" ("), group.children.length, createTextVNode(")")]), createVNode("ul", {
19688
- "class": "bk-selector-group-list-item"
19689
- }, [group.children.map((item, index) => createVNode("li", {
19690
- "class": ["bk-selector-list-item", {
19691
- disabled: item.disabled
19692
- }, this.activeClass(item, index)],
19693
- "onClick": this.handleTagSelected.bind(this, item, "select")
19694
- }, [createVNode(ListTagRender, {
19695
- "node": item,
19696
- "displayKey": this.displayKey,
19697
- "tpl": this.tpl,
19698
- "searchKey": this.searchKey,
19699
- "searchKeyword": this.curInputValue
19700
- }, null)]))])]));
19701
- }
19702
- return this.renderList.map((item, index) => createVNode("li", {
19703
- "class": ["bk-selector-list-item", {
19704
- disabled: item.disabled
19705
- }, this.activeClass(item, index)],
19706
- "onClick": this.handleTagSelected.bind(this, item, "select")
19707
- }, [createVNode(ListTagRender, {
19708
- "node": item,
19709
- "displayKey": this.displayKey,
19710
- "tpl": this.tpl,
19711
- "searchKey": this.searchKey,
19712
- "searchKeyword": this.curInputValue
19713
- }, null)]));
19714
- };
19715
19680
  return createVNode("div", {
19716
19681
  "class": "bk-tag-input",
19717
19682
  "ref": "bkTagSelectorRef",
19718
19683
  "onClick": this.focusInputTrigger,
19719
19684
  "onMouseenter": () => this.isHover = true,
19720
19685
  "onMouseleave": () => this.isHover = false
19721
- }, [createVNode(BkPopover, {
19686
+ }, [createVNode(BkPopover, mergeProps({
19722
19687
  "ref": "popoverRef",
19723
19688
  "theme": "light",
19724
19689
  "trigger": "manual",
19725
19690
  "placement": "bottom-start",
19726
- "arrow": false,
19727
- "width": this.popoverProps.width,
19728
- "isShow": this.popoverProps.isShow,
19729
- "modifiers": this.popoverProps.modifiers
19730
- }, {
19691
+ "content-cls": "bk-tag-input-popover-content",
19692
+ "arrow": false
19693
+ }, this.popoverProps), {
19731
19694
  default: () => {
19732
19695
  var _a, _b, _c;
19733
19696
  return createVNode("div", {
@@ -19787,7 +19750,35 @@ var Component$c = defineComponent({
19787
19750
  "max-height": `${this.contentMaxHeight}px`
19788
19751
  },
19789
19752
  "class": "outside-ul"
19790
- }, [renderSelectorList(), this.isPageLoading ? createVNode("li", {
19753
+ }, [this.renderList.map((group, index) => this.useGroup ? createVNode("li", {
19754
+ "class": "bk-selector-group-item"
19755
+ }, [createVNode("span", {
19756
+ "class": "group-name"
19757
+ }, [group.name, createTextVNode(" ("), group.children.length, createTextVNode(")")]), createVNode("ul", {
19758
+ "class": "bk-selector-group-list-item"
19759
+ }, [group.children.map((item, index2) => createVNode("li", {
19760
+ "class": ["bk-selector-list-item", {
19761
+ disabled: item.disabled
19762
+ }, this.activeClass(item, index2)],
19763
+ "onClick": this.handleTagSelected.bind(this, item, "select")
19764
+ }, [createVNode(ListTagRender, {
19765
+ "node": item,
19766
+ "displayKey": this.displayKey,
19767
+ "tpl": this.tpl,
19768
+ "searchKey": this.searchKey,
19769
+ "searchKeyword": this.curInputValue
19770
+ }, null)]))])]) : createVNode("li", {
19771
+ "class": ["bk-selector-list-item", {
19772
+ disabled: group.disabled
19773
+ }, this.activeClass(group, index)],
19774
+ "onClick": this.handleTagSelected.bind(this, group, "select")
19775
+ }, [createVNode(ListTagRender, {
19776
+ "node": group,
19777
+ "displayKey": this.displayKey,
19778
+ "tpl": this.tpl,
19779
+ "searchKey": this.searchKey,
19780
+ "searchKeyword": this.curInputValue
19781
+ }, null)])), this.isPageLoading ? createVNode("li", {
19791
19782
  "class": "bk-selector-list-item loading"
19792
19783
  }, [createVNode(BkLoading, {
19793
19784
  "theme": "primary",
@@ -29918,7 +29909,7 @@ var Component$3 = defineComponent({
29918
29909
  })]);
29919
29910
  }
29920
29911
  });
29921
- const BkSteps$1 = withInstall(Component$3);
29912
+ const BkTimeline = withInstall(Component$3);
29922
29913
  const processProps = {
29923
29914
  list: PropTypes.array.def([]),
29924
29915
  controllable: PropTypes.bool.def(false),
@@ -29928,7 +29919,7 @@ const processProps = {
29928
29919
  extCls: PropTypes.string
29929
29920
  };
29930
29921
  var Component$2 = defineComponent({
29931
- name: "BKProcess",
29922
+ name: "Process",
29932
29923
  props: processProps,
29933
29924
  emits: ["update:curProcess", "click"],
29934
29925
  setup(props2, {
@@ -29946,8 +29937,6 @@ var Component$2 = defineComponent({
29946
29937
  content: "\u6B65\u9AA43"
29947
29938
  }, {
29948
29939
  content: "\u6B65\u9AA44"
29949
- }, {
29950
- content: "\u6B65\u9AA45"
29951
29940
  }]);
29952
29941
  if ((_a = props2.list) == null ? void 0 : _a.length) {
29953
29942
  defaultProcessList.value.splice(0, defaultProcessList.value.length, ...props2.list);
@@ -29985,19 +29974,21 @@ var Component$2 = defineComponent({
29985
29974
  "class": "bk-icon bk-process-icon icon-loading"
29986
29975
  }, null);
29987
29976
  }
29988
- if (isErrorStatus(item)) {
29977
+ if (index === this.curProcess - 1 && isErrorStatus(item)) {
29989
29978
  return createVNode(error, {
29990
29979
  "class": "bk-process-icon"
29991
29980
  }, null);
29992
29981
  }
29982
+ if (index === this.curProcess - 1 && isIcon(item)) {
29983
+ return createVNode("span", {
29984
+ "class": "bk-process-icon-custom"
29985
+ }, [createVNode(item.icon, null, null)]);
29986
+ }
29993
29987
  if (isDone(index)) {
29994
29988
  return createVNode(done, {
29995
29989
  "class": "bk-process-icon-done"
29996
29990
  }, null);
29997
29991
  }
29998
- return createVNode("span", {
29999
- "class": "number"
30000
- }, [isIcon(item)]);
30001
29992
  };
30002
29993
  return createVNode("div", {
30003
29994
  "class": processCls
@@ -30014,12 +30005,13 @@ var Component$2 = defineComponent({
30014
30005
  },
30015
30006
  "class": {
30016
30007
  success: this.curProcess >= index + 1,
30017
- current: isLoadingStatus(item) && index === this.curProcess - 1
30008
+ current: isLoadingStatus(item) && index === this.curProcess - 1,
30009
+ error: isErrorStatus(item) && index === this.curProcess - 1
30018
30010
  }
30019
30011
  }, [item[this.displayKey], renderIcon(index, item)]))])]);
30020
30012
  }
30021
30013
  });
30022
- const BkSteps = withInstall(Component$2);
30014
+ const BkProcess = withInstall(Component$2);
30023
30015
  const CLASS_PREFIX = "bk-upload";
30024
30016
  var EThemes = /* @__PURE__ */ ((EThemes2) => {
30025
30017
  EThemes2["BUTTON"] = "button";
@@ -36072,7 +36064,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
36072
36064
  Swiper: BkSwiper,
36073
36065
  Select: BkSelect,
36074
36066
  Sideslider: BkSideslider,
36075
- Steps: BkSteps$2,
36067
+ Steps: BkSteps,
36076
36068
  Switcher: BkSwitcher,
36077
36069
  Table: BkTable,
36078
36070
  TableColumn: BkTableColumn,
@@ -36097,8 +36089,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
36097
36089
  Cascader: BkCascader,
36098
36090
  Slider,
36099
36091
  ResizeLayout: BkResizeLayout,
36100
- TimeLine: BkSteps$1,
36101
- Process: BkSteps,
36092
+ TimeLine: BkTimeline,
36093
+ Process: BkProcess,
36102
36094
  Upload,
36103
36095
  CodeDiff: BkCodeDiff,
36104
36096
  ColorPicker: BkColorPicker,
@@ -36121,4 +36113,4 @@ var preset = {
36121
36113
  install: createInstall(),
36122
36114
  version: "0.0.1"
36123
36115
  };
36124
- export { createPopoverComponent as $bkPopover, BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkSteps as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps$2 as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTableColumn as TableColumn, BkTag as Tag, TagInput, BkSteps$1 as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, ellipsis as bkEllipsis, createInstance as bkEllipsisInstance, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
36116
+ export { createPopoverComponent as $bkPopover, BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkProcess as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTableColumn as TableColumn, BkTag as Tag, TagInput, BkTimeline as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, ellipsis as bkEllipsis, createInstance as bkEllipsisInstance, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };