bkui-vue 0.0.1-beta.228 → 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(""),
@@ -27345,6 +27349,12 @@ const NODE_SOURCE_ATTRS = {
27345
27349
  ["__is_loading"]: "loading",
27346
27350
  ["__is_root"]: "isRoot"
27347
27351
  };
27352
+ const NODE_CONTENT_ACTIONS = [
27353
+ "click",
27354
+ "selected",
27355
+ "expand",
27356
+ "collapse"
27357
+ ];
27348
27358
  const treeProps = {
27349
27359
  data: PropTypes.arrayOf(PropTypes.any).def([]),
27350
27360
  label: PropTypes.oneOfType([PropTypes.func.def(void 0), PropTypes.string.def("label")]),
@@ -27398,7 +27408,12 @@ const treeProps = {
27398
27408
  showNodeTypeIcon: PropTypes.bool.def(true),
27399
27409
  selected: PropTypes.oneOfType([PropTypes.string, null, PropTypes.number, PropTypes.object]).def(null),
27400
27410
  autoCheckChildren: PropTypes.bool.def(true),
27401
- 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"])
27402
27417
  };
27403
27418
  var useEmpty = (props2, {
27404
27419
  slots
@@ -27860,7 +27875,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27860
27875
  setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, isOpen);
27861
27876
  }
27862
27877
  };
27863
- const hanldeTreeNodeClick = (item, e) => {
27878
+ const handleTreeNodeClick = (item, e) => {
27864
27879
  const isOpen = isNodeOpened(item);
27865
27880
  if (isOpen) {
27866
27881
  setNodeOpened(item, false, e);
@@ -27881,7 +27896,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27881
27896
  e.stopImmediatePropagation();
27882
27897
  e.stopPropagation();
27883
27898
  e.preventDefault();
27884
- hanldeTreeNodeClick(node, e);
27899
+ handleTreeNodeClick(node, e);
27885
27900
  };
27886
27901
  const setSelect = (uuid2, selected = true, autoOpen = true) => {
27887
27902
  const nodeList2 = Array.isArray(uuid2) ? uuid2 : [uuid2];
@@ -27920,13 +27935,39 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27920
27935
  });
27921
27936
  }
27922
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
+ };
27923
27952
  const handleNodeContentClick = (item, e) => {
27924
- setSelect(item, true, false);
27925
- if (!isNodeOpened(item)) {
27926
- 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);
27927
27970
  }
27928
- const eventName = EVENTS.NODE_CLICK;
27929
- ctx.emit(eventName, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
27930
27971
  };
27931
27972
  const filterNextNode = (depth, node) => {
27932
27973
  if (isRootNode(node)) {
@@ -27978,7 +28019,7 @@ var useNodeAction = (props2, ctx, flatData, _renderData, schemaValues, initOptio
27978
28019
  };
27979
28020
  return {
27980
28021
  renderTreeNode,
27981
- hanldeTreeNodeClick,
28022
+ handleTreeNodeClick,
27982
28023
  deepAutoOpen,
27983
28024
  asyncNodeClick,
27984
28025
  setNodeAction,
@@ -28219,7 +28260,7 @@ var useTreeInit = (props2) => {
28219
28260
  return uid || item[NODE_ATTRIBUTES.UUID] || uuid_1.v4();
28220
28261
  }
28221
28262
  const cachedDefaultVal = {
28222
- [NODE_ATTRIBUTES.IS_OPEN]: () => false,
28263
+ [NODE_ATTRIBUTES.IS_OPEN]: () => !!props3.expandAll,
28223
28264
  [NODE_ATTRIBUTES.IS_CHECKED]: () => false,
28224
28265
  [NODE_ATTRIBUTES.IS_MATCH]: () => true,
28225
28266
  [NODE_ATTRIBUTES.IS_SELECTED]: (uuid2) => props3.selected === uuid2,
@@ -28494,7 +28535,7 @@ var Component$8 = defineComponent({
28494
28535
  const renderData = computed(() => flatData.data.filter((item) => checkNodeIsOpen(item) && filterFn(item)));
28495
28536
  const {
28496
28537
  renderTreeNode,
28497
- hanldeTreeNodeClick,
28538
+ handleTreeNodeClick,
28498
28539
  setNodeOpened,
28499
28540
  setOpen,
28500
28541
  setNodeAction,
@@ -28511,7 +28552,7 @@ var Component$8 = defineComponent({
28511
28552
  });
28512
28553
  const getData = () => flatData;
28513
28554
  ctx.expose({
28514
- hanldeTreeNodeClick,
28555
+ handleTreeNodeClick,
28515
28556
  isNodeChecked,
28516
28557
  isRootNode,
28517
28558
  isNodeOpened,
@@ -38287,7 +38328,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
38287
38328
  Divider: BkDivider,
38288
38329
  Tab: BkTab,
38289
38330
  Message,
38290
- InfoBox,
38331
+ InfoBox: BkInfoBox,
38291
38332
  Notify,
38292
38333
  Menu: BkMenu,
38293
38334
  Navigation,
@@ -38328,4 +38369,4 @@ var preset = {
38328
38369
  install: createInstall(),
38329
38370
  version: "0.0.1"
38330
38371
  };
38331
- 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 };