bkui-vue 0.0.1-beta.48 → 0.0.1-beta.49

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
@@ -8536,16 +8536,17 @@ var Component$r = defineComponent({
8536
8536
  }
8537
8537
  });
8538
8538
  const BkLoading = withInstallProps(Component$r, { setDefaultIndicator, BkLoadingMode, BkLoadingSize }, true);
8539
+ const btnSizes = ["", "small", "large"];
8539
8540
  const buttonProps = {
8540
8541
  theme: PropTypes.theme().def(""),
8541
8542
  hoverTheme: PropTypes.theme(["primary", "warning", "success", "danger"]).def(""),
8542
- size: PropTypes.size(),
8543
+ size: PropTypes.size(btnSizes).def(""),
8543
8544
  title: PropTypes.string,
8544
8545
  icon: PropTypes.string,
8545
8546
  iconRight: PropTypes.string,
8546
8547
  disabled: PropTypes.bool,
8547
8548
  loading: PropTypes.bool,
8548
- laodingMode: PropTypes.commonType(Object.values(BkLoadingMode)),
8549
+ loadingMode: PropTypes.commonType(Object.values(BkLoadingMode)),
8549
8550
  outline: PropTypes.bool,
8550
8551
  text: PropTypes.bool,
8551
8552
  nativeType: {
@@ -8565,6 +8566,7 @@ var Component$q = defineComponent({
8565
8566
  const isHover = ref(false);
8566
8567
  const showSlot = (_a = slots.default) != null ? _a : false;
8567
8568
  const btnClsPrefix = "bk-button";
8569
+ const isText = computed(() => props.text && !props.hoverTheme);
8568
8570
  const btnCls = computed(() => {
8569
8571
  const hoverTheme = props.hoverTheme ? `${btnClsPrefix}-hover-${props.hoverTheme}` : "";
8570
8572
  const btnThemeCls = props.theme ? `${btnClsPrefix}-${props.theme}` : "";
@@ -8572,11 +8574,12 @@ var Component$q = defineComponent({
8572
8574
  return classes({
8573
8575
  "is-disabled": props.disabled,
8574
8576
  "is-outline": props.outline,
8575
- "is-text": props.text && !props.hoverTheme,
8576
- [`${btnClsPrefix}-${props.size}`]: props.size !== "",
8577
+ "is-text": isText.value,
8578
+ [`${btnClsPrefix}-${props.size}`]: props.size && btnSizes.includes(props.size),
8577
8579
  "no-slot": !showSlot
8578
8580
  }, `${themeCls} ${btnClsPrefix} ${hoverTheme}`);
8579
8581
  });
8582
+ console.log(btnCls.value, props);
8580
8583
  const loadingTheme = computed(() => {
8581
8584
  if (props.text || props.outline || props.hoverTheme) {
8582
8585
  if (isHover.value && !props.text)
@@ -8585,7 +8588,7 @@ var Component$q = defineComponent({
8585
8588
  }
8586
8589
  return ["", "default"].includes(props.theme) ? "" : "white";
8587
8590
  });
8588
- const loadingSize = computed(() => props.size === BkLoadingSize.Small ? BkLoadingSize.Mini : BkLoadingSize.Small);
8591
+ const loadingSize = computed(() => isText.value || props.size === BkLoadingSize.Small ? BkLoadingSize.Mini : BkLoadingSize.Small);
8589
8592
  const handleClick = () => {
8590
8593
  if (props.loading)
8591
8594
  return;
@@ -8609,13 +8612,13 @@ var Component$q = defineComponent({
8609
8612
  "onClick": handleClick,
8610
8613
  "onMouseover": handleMouseOver,
8611
8614
  "onMouseleave": handleMouseout
8612
- }), [props.loading ? createVNode(BkLoading, {
8615
+ }), [props.loading && createVNode(BkLoading, {
8613
8616
  "loading": true,
8614
8617
  "class": `${btnClsPrefix}-loading`,
8615
- "mode": props.laodingMode,
8618
+ "mode": props.loadingMode,
8616
8619
  "theme": loadingTheme.value,
8617
8620
  "size": loadingSize.value
8618
- }, null) : slots.default && createVNode("span", {
8621
+ }, null), slots.default && createVNode("span", {
8619
8622
  "class": `${btnClsPrefix}-text`
8620
8623
  }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)])]);
8621
8624
  };
@@ -8714,6 +8717,8 @@ const useCheckbox = () => {
8714
8717
  if (isGroup) {
8715
8718
  watch(() => checkboxGroup.props.modelValue, (modelValue) => {
8716
8719
  isChecked.value = modelValue.includes(props.label);
8720
+ }, {
8721
+ deep: true
8717
8722
  });
8718
8723
  } else {
8719
8724
  watch(() => props.modelValue, (modelValue) => {
@@ -20640,7 +20645,7 @@ var Dropdown = defineComponent({
20640
20645
  disabled: PropTypes.bool.def(false),
20641
20646
  extCls: PropTypes.string
20642
20647
  },
20643
- emits: ["showChange"],
20648
+ emits: ["showChange", "show", "hide"],
20644
20649
  setup(props, {
20645
20650
  emit
20646
20651
  }) {
@@ -20661,12 +20666,20 @@ var Dropdown = defineComponent({
20661
20666
  });
20662
20667
  });
20663
20668
  watch(() => props.disabled, (val) => handleUpdateDisabled(val));
20669
+ const afterShow = () => {
20670
+ emit("show");
20671
+ };
20672
+ const afterHidden = () => {
20673
+ emit("hide");
20674
+ };
20664
20675
  const registerDropdown = () => {
20665
20676
  if (props.disabled)
20666
20677
  return;
20667
20678
  popoverInstance = new BKPopover(reference2.value, refContent.value, {
20668
20679
  placement: props.placement,
20669
- trigger: props.trigger
20680
+ trigger: props.trigger,
20681
+ afterShow,
20682
+ afterHidden
20670
20683
  });
20671
20684
  props.trigger === "manual" && props.isShow && popoverInstance.show();
20672
20685
  };