bkui-vue 0.0.1-beta.227 → 0.0.1-beta.229

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
@@ -10294,7 +10294,7 @@ var Component$v = defineComponent({
10294
10294
  } : {};
10295
10295
  const bodyClass = `bk-modal-body ${this.animateType === "slide" ? this.direction : ""}`;
10296
10296
  return createVNode("div", {
10297
- "class": ["bk-modal-wrapper", this.extCls, this.size],
10297
+ "class": ["bk-modal-wrapper", this.extCls, this.size, this.fullscreen ? "fullscreen" : ""],
10298
10298
  "style": [this.compStyle, this.fullscreen ? this.fullscreenStyle : ""]
10299
10299
  }, [createVNode(Transition, {
10300
10300
  "name": this.animateType
@@ -10387,6 +10387,7 @@ var Dialog = defineComponent({
10387
10387
  emit("update:isShow", false);
10388
10388
  emit("confirm");
10389
10389
  };
10390
+ const hasFooter = computed(() => ["process", "operation", "confirm"].includes(props2.dialogType));
10390
10391
  const escCloseHandler = (e) => {
10391
10392
  if (props2.isShow && props2.closeIcon) {
10392
10393
  if (e.keyCode === 27) {
@@ -10451,7 +10452,8 @@ var Dialog = defineComponent({
10451
10452
  escCloseHandler,
10452
10453
  moveHandler,
10453
10454
  handlePrevStep,
10454
- handleNextStep
10455
+ handleNextStep,
10456
+ hasFooter
10455
10457
  };
10456
10458
  },
10457
10459
  render() {
@@ -10545,7 +10547,7 @@ var Dialog = defineComponent({
10545
10547
  "onClick": this.handleClose
10546
10548
  }, [createTextVNode("+")])
10547
10549
  };
10548
- const className = `bk-dialog-wrapper ${this.scrollable ? "scroll-able" : ""} ${this.multiInstance ? "multi-instance" : ""}`;
10550
+ const className = `bk-dialog-wrapper ${this.scrollable ? "scroll-able" : ""} ${this.multiInstance ? "multi-instance" : ""} ${this.hasFooter ? "has-footer" : "no-footer"}`;
10549
10551
  return createVNode(BkModal, mergeProps(this.$props, {
10550
10552
  "class": className,
10551
10553
  "onClose": this.handleClose,
@@ -19543,7 +19545,7 @@ var Component$d = defineComponent({
19543
19545
  bkTooltips: tooltips
19544
19546
  },
19545
19547
  props: tagProps(),
19546
- emits: ["update:modelValue", "change", "select", "blur", "remove", "removeAll"],
19548
+ emits: ["update:modelValue", "change", "select", "focus", "blur", "remove", "removeAll"],
19547
19549
  setup(props2, {
19548
19550
  emit
19549
19551
  }) {
@@ -19854,6 +19856,7 @@ var Component$d = defineComponent({
19854
19856
  const handleFocus = () => {
19855
19857
  var _a;
19856
19858
  popoverProps.width = isSingleSelect.value ? (_a = bkTagSelectorRef.value) == null ? void 0 : _a.clientWidth : props2.contentWidth;
19859
+ emit("focus");
19857
19860
  };
19858
19861
  const handleBlur = () => {
19859
19862
  timer.value = setTimeout(() => {
@@ -21076,6 +21079,7 @@ const InfoBox = (config) => {
21076
21079
  };
21077
21080
  return instance;
21078
21081
  };
21082
+ const BkInfoBox = withInstall(InfoBox);
21079
21083
  const notifyProps = {
21080
21084
  id: PropTypes.string.def(""),
21081
21085
  title: PropTypes.string.def(""),
@@ -27056,7 +27060,11 @@ const transferProps = {
27056
27060
  function useTransferData(sourceData, targetList, settingCode) {
27057
27061
  const selectList = ref([]);
27058
27062
  const selectedList = ref([]);
27059
- const transformData = () => {
27063
+ const transformData = (isChange = false) => {
27064
+ if (isChange) {
27065
+ selectList.value = [];
27066
+ selectedList.value = [];
27067
+ }
27060
27068
  sourceData.value.forEach((s2) => {
27061
27069
  const keyId = s2[settingCode.value];
27062
27070
  if (targetList.value.includes(keyId)) {
@@ -27067,7 +27075,11 @@ function useTransferData(sourceData, targetList, settingCode) {
27067
27075
  });
27068
27076
  };
27069
27077
  transformData();
27070
- watch(() => [sourceData, targetList, settingCode], transformData);
27078
+ watch(() => [sourceData, targetList, settingCode], () => {
27079
+ transformData(true);
27080
+ }, {
27081
+ deep: true
27082
+ });
27071
27083
  return {
27072
27084
  selectList,
27073
27085
  selectedList
@@ -27142,20 +27154,40 @@ var Component$9 = defineComponent({
27142
27154
  return va > vb ? 1 : -1;
27143
27155
  });
27144
27156
  });
27157
+ watch(() => [selectList, selectedList], () => {
27158
+ handleEmitUpdateTargetList();
27159
+ }, {
27160
+ deep: true
27161
+ });
27162
+ const handleCheckAllItemSelect = (list, source) => {
27163
+ const itemKey = settingCode.value;
27164
+ return list.some((val) => val[itemKey] === source[itemKey]) && source.disabled;
27165
+ };
27145
27166
  const allToRight = () => {
27146
- selectList.value = [];
27147
- selectedList.value = [...sourceData.value];
27167
+ selectList.value = [...sourceData.value.filter((source) => {
27168
+ return handleCheckAllItemSelect(selectList.value, source);
27169
+ })];
27170
+ selectedList.value = [...sourceData.value.filter((source) => {
27171
+ return !handleCheckAllItemSelect(selectList.value, source);
27172
+ })];
27148
27173
  handleEmitUpdateTargetList();
27149
27174
  };
27150
27175
  const allToLeft = () => {
27151
- selectList.value = [...sourceData.value];
27152
- selectedList.value = [];
27176
+ selectList.value = [...sourceData.value.filter((source) => {
27177
+ return !handleCheckAllItemSelect(selectedList.value, source);
27178
+ })];
27179
+ selectedList.value = [...sourceData.value.filter((source) => {
27180
+ return handleCheckAllItemSelect(selectedList.value, source);
27181
+ })];
27153
27182
  handleEmitUpdateTargetList();
27154
27183
  };
27155
- const handleItemClick = (itemKey, isLeft) => {
27184
+ const handleItemClick = (item, isLeft) => {
27185
+ if (item.disabled)
27186
+ return;
27187
+ const itemKey = item[settingCode.value];
27156
27188
  const from = isLeft ? selectList : selectedList;
27157
27189
  const to = isLeft ? selectedList : selectList;
27158
- const index = from.value.findIndex((item) => item[settingCode.value] === itemKey);
27190
+ const index = from.value.findIndex((item2) => item2[settingCode.value] === itemKey);
27159
27191
  to.value.push(...from.value.splice(index, 1));
27160
27192
  handleEmitUpdateTargetList();
27161
27193
  };
@@ -27212,7 +27244,9 @@ var Component$9 = defineComponent({
27212
27244
  };
27213
27245
  const getDefaultListHtml = (item, isLeft = true) => {
27214
27246
  return createVNode("div", {
27215
- "class": "item-content"
27247
+ "class": ["item-content", {
27248
+ "is-disabled": item.disabled
27249
+ }]
27216
27250
  }, [createVNode("span", {
27217
27251
  "class": "content-text",
27218
27252
  "title": item[this.displayCode]
@@ -27236,7 +27270,7 @@ var Component$9 = defineComponent({
27236
27270
  return createVNode("li", {
27237
27271
  "key": item[this.settingCode],
27238
27272
  "class": [this.$slots[slotName] ? "custom-item" : ""],
27239
- "onClick": () => this.handleItemClick(item[this.settingCode], isLeft)
27273
+ "onClick": () => this.handleItemClick(item, isLeft)
27240
27274
  }, [(_c = (_b = (_a = this.$slots)[slotName]) == null ? void 0 : _b.call(_a, item)) != null ? _c : getDefaultListHtml(item, isLeft)]);
27241
27275
  })]) : getEmptyHtml(emptySlotName);
27242
27276
  };
@@ -27315,6 +27349,12 @@ const NODE_SOURCE_ATTRS = {
27315
27349
  ["__is_loading"]: "loading",
27316
27350
  ["__is_root"]: "isRoot"
27317
27351
  };
27352
+ const NODE_CONTENT_ACTIONS = [
27353
+ "click",
27354
+ "selected",
27355
+ "expand",
27356
+ "collapse"
27357
+ ];
27318
27358
  const treeProps = {
27319
27359
  data: PropTypes.arrayOf(PropTypes.any).def([]),
27320
27360
  label: PropTypes.oneOfType([PropTypes.func.def(void 0), PropTypes.string.def("label")]),
@@ -27368,7 +27408,12 @@ const treeProps = {
27368
27408
  showNodeTypeIcon: PropTypes.bool.def(true),
27369
27409
  selected: PropTypes.oneOfType([PropTypes.string, null, PropTypes.number, PropTypes.object]).def(null),
27370
27410
  autoCheckChildren: PropTypes.bool.def(true),
27371
- autoOpenParentNode: PropTypes.bool.def(true)
27411
+ autoOpenParentNode: PropTypes.bool.def(true),
27412
+ expandAll: PropTypes.bool.def(false),
27413
+ nodeContentAction: PropTypes.oneOfType([
27414
+ PropTypes.arrayOf(PropTypes.commonType(NODE_CONTENT_ACTIONS)),
27415
+ PropTypes.func.def(() => ["selected"])
27416
+ ]).def(["selected", "expand", "click"])
27372
27417
  };
27373
27418
  var useEmpty = (props2, {
27374
27419
  slots
@@ -27830,7 +27875,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27830
27875
  setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, isOpen);
27831
27876
  }
27832
27877
  };
27833
- const hanldeTreeNodeClick = (item, e) => {
27878
+ const handleTreeNodeClick = (item, e) => {
27834
27879
  const isOpen = isNodeOpened(item);
27835
27880
  if (isOpen) {
27836
27881
  setNodeOpened(item, false, e);
@@ -27851,7 +27896,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27851
27896
  e.stopImmediatePropagation();
27852
27897
  e.stopPropagation();
27853
27898
  e.preventDefault();
27854
- hanldeTreeNodeClick(node, e);
27899
+ handleTreeNodeClick(node, e);
27855
27900
  };
27856
27901
  const setSelect = (uuid2, selected = true, autoOpen = true) => {
27857
27902
  const nodeList2 = Array.isArray(uuid2) ? uuid2 : [uuid2];
@@ -27890,13 +27935,39 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27890
27935
  });
27891
27936
  }
27892
27937
  };
27938
+ const resolveNodeAction = (node) => {
27939
+ if (typeof props2.nodeContentAction === "function") {
27940
+ return Reflect.apply(props2.nodeContentAction, globalThis, [{
27941
+ node
27942
+ }]);
27943
+ }
27944
+ if (typeof props2.nodeContentAction === "string") {
27945
+ return [props2.nodeContentAction];
27946
+ }
27947
+ if (Array.isArray(props2.nodeContentAction)) {
27948
+ return props2.nodeContentAction;
27949
+ }
27950
+ return ["selected", "expand", "click"];
27951
+ };
27893
27952
  const handleNodeContentClick = (item, e) => {
27894
- setSelect(item, true, false);
27895
- if (!isNodeOpened(item)) {
27896
- hanldeTreeNodeClick(item, e);
27953
+ const nodeActions = resolveNodeAction(item);
27954
+ if (nodeActions.includes("selected")) {
27955
+ setSelect(item, true, false);
27956
+ }
27957
+ if (nodeActions.includes("expand")) {
27958
+ if (!isNodeOpened(item)) {
27959
+ handleTreeNodeClick(item, e);
27960
+ }
27961
+ }
27962
+ if (nodeActions.includes("collapse")) {
27963
+ if (isNodeOpened(item)) {
27964
+ handleTreeNodeClick(item, e);
27965
+ }
27966
+ }
27967
+ if (nodeActions.includes("click")) {
27968
+ const eventName = EVENTS.NODE_CLICK;
27969
+ ctx.emit(eventName, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
27897
27970
  }
27898
- const eventName = EVENTS.NODE_CLICK;
27899
- ctx.emit(eventName, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
27900
27971
  };
27901
27972
  const filterNextNode = (depth, node) => {
27902
27973
  if (isRootNode(node)) {
@@ -27948,7 +28019,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27948
28019
  };
27949
28020
  return {
27950
28021
  renderTreeNode,
27951
- hanldeTreeNodeClick,
28022
+ handleTreeNodeClick,
27952
28023
  deepAutoOpen,
27953
28024
  asyncNodeClick,
27954
28025
  setNodeAction,
@@ -28189,7 +28260,7 @@ var useTreeInit = (props2) => {
28189
28260
  return uid || item[NODE_ATTRIBUTES.UUID] || uuid_1.v4();
28190
28261
  }
28191
28262
  const cachedDefaultVal = {
28192
- [NODE_ATTRIBUTES.IS_OPEN]: () => false,
28263
+ [NODE_ATTRIBUTES.IS_OPEN]: () => !!props3.expandAll,
28193
28264
  [NODE_ATTRIBUTES.IS_CHECKED]: () => false,
28194
28265
  [NODE_ATTRIBUTES.IS_MATCH]: () => true,
28195
28266
  [NODE_ATTRIBUTES.IS_SELECTED]: (uuid2) => props3.selected === uuid2,
@@ -28464,7 +28535,7 @@ var Component$8 = defineComponent({
28464
28535
  const renderData = computed(() => flatData.data.filter((item) => checkNodeIsOpen(item) && filterFn(item)));
28465
28536
  const {
28466
28537
  renderTreeNode,
28467
- hanldeTreeNodeClick,
28538
+ handleTreeNodeClick,
28468
28539
  setNodeOpened,
28469
28540
  setOpen,
28470
28541
  setNodeAction,
@@ -28481,7 +28552,7 @@ var Component$8 = defineComponent({
28481
28552
  });
28482
28553
  const getData = () => flatData;
28483
28554
  ctx.expose({
28484
- hanldeTreeNodeClick,
28555
+ handleTreeNodeClick,
28485
28556
  isNodeChecked,
28486
28557
  isRootNode,
28487
28558
  isNodeOpened,
@@ -38257,7 +38328,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
38257
38328
  Divider: BkDivider,
38258
38329
  Tab: BkTab,
38259
38330
  Message,
38260
- InfoBox,
38331
+ InfoBox: BkInfoBox,
38261
38332
  Notify,
38262
38333
  Menu: BkMenu,
38263
38334
  Navigation,
@@ -38298,4 +38369,4 @@ var preset = {
38298
38369
  install: createInstall(),
38299
38370
  version: "0.0.1"
38300
38371
  };
38301
- 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, BkSearchSelect as SearchSelect, 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 };
38372
+ 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, BkInfoBox as 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, BkSearchSelect as SearchSelect, 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 };