bkui-vue 0.0.1-beta.147 → 0.0.1-beta.148

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
@@ -11228,7 +11228,7 @@ const PopoverProps = __spreadValues({
11228
11228
  arrow: PropTypes.bool.def(true),
11229
11229
  padding: PropTypes.number.def(5),
11230
11230
  offset: PropTypes.number.def(6),
11231
- boundary: PropTypes.string.def(void 0),
11231
+ boundary: PropTypes.oneOfType([PropTypes.string.def("parent"), PropTypes.instanceOf(HTMLElement)]),
11232
11232
  zIndex: PropTypes.number.def(void 0),
11233
11233
  disableTeleport: PropTypes.bool.def(false),
11234
11234
  autoPlacement: PropTypes.bool.def(false),
@@ -12700,7 +12700,7 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
12700
12700
  });
12701
12701
  };
12702
12702
  const showPopover = () => {
12703
- localIsShow.value = true;
12703
+ !props2.disabled && (localIsShow.value = true);
12704
12704
  };
12705
12705
  let popShowTimerId = void 0;
12706
12706
  let isMouseenter = false;
@@ -15182,7 +15182,7 @@ var useTagRender = (props2, ctx) => {
15182
15182
  };
15183
15183
  return {
15184
15184
  rendAsTag: () => {
15185
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
15185
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
15186
15186
  return h$1(renderAs, {
15187
15187
  class: props2.className
15188
15188
  }, [(_c = (_b = (_a = ctx.slots).beforeContent) == null ? void 0 : _b.call(_a)) != null ? _c : "", withDirectives(h$1(contentAs, {
@@ -15190,7 +15190,7 @@ var useTagRender = (props2, ctx) => {
15190
15190
  style: props2.contentStyle
15191
15191
  }, [(_f = (_e = (_d = ctx.slots).default) == null ? void 0 : _e.call(_d, {
15192
15192
  data: props2.list
15193
- })) != null ? _f : ""]), [[vVirtualRender, dirModifier]]), (_i = (_h = (_g = ctx.slots).afterContent) == null ? void 0 : _h.call(_g)) != null ? _i : ""]);
15193
+ })) != null ? _f : ""]), [[vVirtualRender, dirModifier]]), (_i = (_h = (_g = ctx.slots).afterContent) == null ? void 0 : _h.call(_g)) != null ? _i : "", (_l = (_k = (_j = ctx.slots).afterSection) == null ? void 0 : _k.call(_j)) != null ? _l : ""]);
15194
15194
  }
15195
15195
  };
15196
15196
  };
@@ -15408,7 +15408,7 @@ var Component$e = defineComponent({
15408
15408
  reset: reset2
15409
15409
  });
15410
15410
  return () => {
15411
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
15411
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
15412
15412
  return h$1(renderAs || "div", {
15413
15413
  ref: refRoot,
15414
15414
  class: wrapperClass.value,
@@ -15421,7 +15421,7 @@ var Component$e = defineComponent({
15421
15421
  })) != null ? _f : ""]), [[vVirtualRender, dirModifier]]), (_i = (_h = (_g = ctx.slots).afterContent) == null ? void 0 : _h.call(_g)) != null ? _i : "", h$1("div", {
15422
15422
  class: [resolveClassName("virtual-section")],
15423
15423
  style: innerStyle.value
15424
- })]);
15424
+ }), (_l = (_k = (_j = ctx.slots).afterSection) == null ? void 0 : _k.call(_j)) != null ? _l : ""]);
15425
15425
  };
15426
15426
  }
15427
15427
  });
@@ -17353,7 +17353,7 @@ const useClass = (props2, root, reactiveProp, pageData) => {
17353
17353
  if (/^\d+\.?\d*px$/ig.test(strHeight)) {
17354
17354
  return Number(strHeight.replace("px", ""));
17355
17355
  }
17356
- if (/^\d+\.?\d*%$/ig.test(strHeight)) {
17356
+ if (/^\d+\.?\d*%$/ig.test(strHeight) && typeof defaultValue === "number") {
17357
17357
  const percent = Number(strHeight.replace("%", ""));
17358
17358
  return defaultValue * percent / 100;
17359
17359
  }
@@ -17369,10 +17369,13 @@ const useClass = (props2, root, reactiveProp, pageData) => {
17369
17369
  const contentHeight = resolveHeight - resolveHeadHeight - resolveFooterHeight;
17370
17370
  const height = props2.height !== "auto" ? `${contentHeight}px` : false;
17371
17371
  const minHeight = resolveMinHeight - resolveHeadHeight - resolveFooterHeight;
17372
+ const resolveMaxHeight = resolvePropHeight(props2.maxHeight, void 0);
17373
+ const maxHeight = typeof resolveMaxHeight === "number" ? `${resolveMaxHeight - resolveHeadHeight - resolveFooterHeight}px` : false;
17372
17374
  Object.assign(contentStyle, {
17373
17375
  display: (pageData == null ? void 0 : pageData.length) ? "block" : false,
17374
17376
  "min-height": `${minHeight}px`,
17375
- height
17377
+ height,
17378
+ maxHeight
17376
17379
  });
17377
17380
  };
17378
17381
  onMounted(() => {
@@ -17684,6 +17687,10 @@ var Component$c = defineComponent({
17684
17687
  "scroll-loading": true,
17685
17688
  _bottom: true
17686
17689
  };
17690
+ const fixedBottomBorder = {
17691
+ [resolveClassName("fixed-bottom-border")]: true,
17692
+ "_is-empty": !props2.data.length
17693
+ };
17687
17694
  const {
17688
17695
  renderScrollLoading
17689
17696
  } = useScrollLoading(props2, ctx);
@@ -17713,7 +17720,10 @@ var Component$c = defineComponent({
17713
17720
  "scrollEvent": true,
17714
17721
  "enabled": props2.virtualEnabled
17715
17722
  }), {
17716
- default: (scope) => tableRender.renderTableBodySchema(scope.data || props2.data)
17723
+ default: (scope) => tableRender.renderTableBodySchema(scope.data || props2.data),
17724
+ afterSection: () => createVNode("div", {
17725
+ "class": fixedBottomBorder
17726
+ }, null)
17717
17727
  }),
17718
17728
  createVNode("div", {
17719
17729
  "class": fixedWrapperClass
@@ -25941,86 +25951,70 @@ var Row = defineComponent({
25941
25951
  }
25942
25952
  });
25943
25953
  const BkContainer = withInstallProps(Container, { Row, Col });
25954
+ const PLACEMENT_OPTIONS = ["auto", "auto-start", "auto-end", "top", "right", "bottom", "left", "top-start", "top-end", "bottom-start", "bottom-end", "right-start", "right-end", "left-start", "left-end"];
25955
+ const TRIGGER_OPTIONS = ["hover", "click", "manual"];
25944
25956
  var Dropdown = defineComponent({
25945
25957
  name: "Dropdown",
25946
25958
  props: {
25947
25959
  isShow: PropTypes.bool.def(false),
25948
- placement: PropTypes.commonType(["auto", "auto-start", "auto-end", "top", "right", "bottom", "left", "top-start", "top-end", "bottom-start", "bottom-end", "right-start", "right-end", "left-start", "left-end"], "placement").def("bottom"),
25949
- trigger: PropTypes.commonType(["hover", "click", "manual"], "trigger").def("hover"),
25960
+ placement: PropTypes.commonType(PLACEMENT_OPTIONS, "placement").def("bottom"),
25961
+ trigger: PropTypes.commonType(TRIGGER_OPTIONS, "trigger").def("hover"),
25950
25962
  disabled: PropTypes.bool.def(false),
25963
+ popoverOptions: PropTypes.object.def({}),
25951
25964
  extCls: PropTypes.string
25952
25965
  },
25953
25966
  emits: ["showChange", "show", "hide"],
25954
- setup(props2, {
25967
+ setup(_props, {
25955
25968
  emit
25956
25969
  }) {
25957
- let popoverInstance = /* @__PURE__ */ Object.create(null);
25958
- const reference2 = ref(null);
25959
- const refContent = ref(null);
25960
- onMounted(() => {
25961
- registerDropdown();
25962
- });
25963
- onBeforeUnmount(() => {
25964
- destoryDropdown();
25965
- });
25966
- watch(() => props2.isShow, (val) => {
25967
- nextTick(() => {
25968
- if (props2.trigger === "manual" && popoverInstance && !props2.disabled) {
25969
- val ? popoverInstance.show() : popoverInstance.hide();
25970
- }
25971
- });
25972
- });
25973
- watch(() => props2.disabled, (val) => handleUpdateDisabled(val));
25970
+ const handleShowChagne = (val) => {
25971
+ emit("showChange", val);
25972
+ };
25974
25973
  const afterShow = () => {
25975
25974
  emit("show");
25975
+ handleShowChagne(true);
25976
25976
  };
25977
25977
  const afterHidden = () => {
25978
25978
  emit("hide");
25979
- };
25980
- const registerDropdown = () => {
25981
- if (props2.disabled)
25982
- return;
25983
- popoverInstance = new BKPopover(reference2.value, refContent.value, {
25984
- placement: props2.placement,
25985
- trigger: props2.trigger,
25986
- afterShow,
25987
- afterHidden
25988
- });
25989
- props2.trigger === "manual" && props2.isShow && popoverInstance.show();
25990
- };
25991
- const destoryDropdown = () => {
25992
- if (popoverInstance) {
25993
- const instance = popoverInstance;
25994
- instance.isShow && instance.hide();
25995
- instance.destroy();
25996
- popoverInstance = null;
25997
- props2.trigger === "manual" && emit("showChange", false);
25998
- }
25999
- };
26000
- const handleUpdateDisabled = (val) => {
26001
- const instance = popoverInstance;
26002
- props2.trigger === "manual" && !val && emit("showChange", false);
26003
- instance.updateDisabled(val);
25979
+ handleShowChagne(false);
26004
25980
  };
26005
25981
  return {
26006
- reference: reference2,
26007
- refContent
25982
+ afterShow,
25983
+ afterHidden
26008
25984
  };
26009
25985
  },
26010
25986
  render() {
26011
- var _a, _b, _c, _d;
26012
25987
  const wrapperClasses = classes({
26013
25988
  "bk-dropdown": true
26014
25989
  }, this.$props.extCls);
25990
+ const basePopoverOptions = {
25991
+ theme: "light bk-dropdown-popover",
25992
+ trigger: this.trigger,
25993
+ arrow: false,
25994
+ placement: this.placement,
25995
+ isShow: this.isShow,
25996
+ disabled: this.disabled
25997
+ };
25998
+ const popoverOptions = lodash.exports.merge(basePopoverOptions, this.popoverOptions);
26015
25999
  return createVNode("div", {
26016
26000
  "class": wrapperClasses
26017
- }, [createVNode("div", {
26018
- "ref": "reference",
26019
- "class": "bk-dropdown-reference"
26020
- }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
26021
- "ref": "refContent",
26022
- "class": "bk-dropdown-content"
26023
- }, [(_d = (_c = this.$slots).content) == null ? void 0 : _d.call(_c)])]);
26001
+ }, [createVNode(BkPopover2, mergeProps(popoverOptions, {
26002
+ "onAfterShow": this.afterShow,
26003
+ "onAfterHidden": this.afterHidden
26004
+ }), {
26005
+ default: () => {
26006
+ var _a, _b;
26007
+ return createVNode("div", {
26008
+ "class": "bk-dropdown-reference"
26009
+ }, [createTextVNode(" "), (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a), createTextVNode(" ")]);
26010
+ },
26011
+ content: () => {
26012
+ var _a, _b;
26013
+ return createVNode("div", {
26014
+ "class": "bk-dropdown-content"
26015
+ }, [createTextVNode(" "), (_b = (_a = this.$slots).content) == null ? void 0 : _b.call(_a), createTextVNode(" ")]);
26016
+ }
26017
+ })]);
26024
26018
  }
26025
26019
  });
26026
26020
  var DropdownItem = defineComponent({