bkui-vue 0.0.1-beta.343 → 0.0.1-beta.344

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
@@ -7889,11 +7889,6 @@ var SizeEnum = /* @__PURE__ */ ((SizeEnum2) => {
7889
7889
  SizeEnum2["DEFAULT"] = "default";
7890
7890
  return SizeEnum2;
7891
7891
  })(SizeEnum || {});
7892
- var RenderDirectiveEnum = /* @__PURE__ */ ((RenderDirectiveEnum2) => {
7893
- RenderDirectiveEnum2["IF"] = "if";
7894
- RenderDirectiveEnum2["SHOW"] = "show";
7895
- return RenderDirectiveEnum2;
7896
- })(RenderDirectiveEnum || {});
7897
7892
  function renderDirectiveType() {
7898
7893
  return j("renderDirective", {
7899
7894
  default: "show"
@@ -9166,8 +9161,25 @@ var BreadcrumbItem = defineComponent({
9166
9161
  const classCtx = classes({
9167
9162
  "bk-breadcrumb-item": true
9168
9163
  }, `${props2.extCls || ""}`);
9164
+ const renderSeparator = () => {
9165
+ if (slots.separator) {
9166
+ return slots.separator();
9167
+ }
9168
+ if (parent.separatorClass) {
9169
+ return createVNode("i", {
9170
+ "class": `bk-breadcrumb-separator ${parent.separatorClass}`
9171
+ }, null);
9172
+ }
9173
+ if (parent.separator) {
9174
+ return createVNode("span", {
9175
+ "class": "bk-breadcrumb-separator",
9176
+ "role": "presentation"
9177
+ }, [parent == null ? void 0 : parent.separator]);
9178
+ }
9179
+ return null;
9180
+ };
9169
9181
  return () => {
9170
- var _a, _b;
9182
+ var _a;
9171
9183
  return createVNode("span", {
9172
9184
  "class": classCtx
9173
9185
  }, [createVNode("span", {
@@ -9175,12 +9187,7 @@ var BreadcrumbItem = defineComponent({
9175
9187
  "class": `bk-breadcrumb-item-inner ${props2.to ? "is-link" : ""}`,
9176
9188
  "role": "link",
9177
9189
  "onClick": handleClick
9178
- }, [(_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)]), (slots == null ? void 0 : slots.separator) ? (_b = slots == null ? void 0 : slots.separator) == null ? void 0 : _b.call(slots) : (parent == null ? void 0 : parent.separatorClass) ? createVNode("i", {
9179
- "class": `bk-breadcrumb-separator ${parent.separatorClass}`
9180
- }, null) : createVNode("span", {
9181
- "class": "bk-breadcrumb-separator",
9182
- "role": "presentation"
9183
- }, [parent == null ? void 0 : parent.separator])]);
9190
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderSeparator()]);
9184
9191
  };
9185
9192
  }
9186
9193
  });
@@ -9337,10 +9344,10 @@ var Component$y = defineComponent({
9337
9344
  if (isHover.value && !props2.text)
9338
9345
  return "white";
9339
9346
  if (props2.text && props2.disabled)
9340
- return "";
9347
+ return;
9341
9348
  return props2.hoverTheme || props2.theme;
9342
9349
  }
9343
- return ["", "default"].includes(props2.theme) ? "" : "white";
9350
+ return !props2.theme ? void 0 : "white";
9344
9351
  });
9345
9352
  const loadingSize = computed(() => isText.value || props2.size === BkLoadingSize.Small ? BkLoadingSize.Mini : BkLoadingSize.Small);
9346
9353
  const handleClick = (e) => {
@@ -9798,6 +9805,7 @@ const useCheckbox = () => {
9798
9805
  } = currentInstance;
9799
9806
  const checkboxGroup = inject(checkboxGroupKey, EMPTY_OBJ);
9800
9807
  const isGroup = !isEmptyObj(checkboxGroup);
9808
+ const inputRef = ref();
9801
9809
  const isChecked = ref(props2.checked);
9802
9810
  const isDisabled = computed(() => {
9803
9811
  if (isGroup && checkboxGroup.props.disabled) {
@@ -9805,6 +9813,19 @@ const useCheckbox = () => {
9805
9813
  }
9806
9814
  return props2.disabled;
9807
9815
  });
9816
+ const triggerChange = () => {
9817
+ const nextValue = isChecked.value ? props2.trueLabel : props2.falseLabel;
9818
+ emit("update:modelValue", nextValue);
9819
+ emit("change", nextValue);
9820
+ if (isGroup) {
9821
+ checkboxGroup.handleChange();
9822
+ }
9823
+ nextTick(() => {
9824
+ if (inputRef.value.checked !== isChecked.value) {
9825
+ inputRef.value.checked = isChecked.value;
9826
+ }
9827
+ });
9828
+ };
9808
9829
  if (isGroup) {
9809
9830
  watch(() => checkboxGroup.props.modelValue, (modelValue) => {
9810
9831
  isChecked.value = modelValue.includes(props2.label);
@@ -9821,6 +9842,10 @@ const useCheckbox = () => {
9821
9842
  immediate: true
9822
9843
  });
9823
9844
  }
9845
+ watch(() => props2.checked, () => {
9846
+ isChecked.value = props2.checked;
9847
+ triggerChange();
9848
+ });
9824
9849
  const setChecked = (value = true) => {
9825
9850
  isChecked.value = value;
9826
9851
  };
@@ -9830,17 +9855,7 @@ const useCheckbox = () => {
9830
9855
  }
9831
9856
  const $targetInput = event.target;
9832
9857
  isChecked.value = $targetInput.checked;
9833
- const nextValue = isChecked.value ? props2.trueLabel : props2.falseLabel;
9834
- emit("update:modelValue", nextValue);
9835
- emit("change", nextValue);
9836
- if (isGroup) {
9837
- checkboxGroup.handleChange();
9838
- }
9839
- nextTick(() => {
9840
- if ($targetInput.checked !== isChecked.value) {
9841
- $targetInput.checked = isChecked.value;
9842
- }
9843
- });
9858
+ triggerChange();
9844
9859
  };
9845
9860
  onMounted(() => {
9846
9861
  if (isGroup) {
@@ -9853,6 +9868,7 @@ const useCheckbox = () => {
9853
9868
  }
9854
9869
  });
9855
9870
  return {
9871
+ inputRef,
9856
9872
  isChecked,
9857
9873
  isDisabled,
9858
9874
  setChecked,
@@ -9860,10 +9876,10 @@ const useCheckbox = () => {
9860
9876
  };
9861
9877
  };
9862
9878
  const checkboxProps = {
9863
- modelValue: PropTypes.oneOfType([String, Number, Boolean]).def(""),
9879
+ modelValue: PropTypes.oneOfType([String, Number, Boolean]),
9864
9880
  label: PropTypes.oneOfType([String, Number, Boolean]),
9865
9881
  trueLabel: PropTypes.oneOfType([String, Number, Boolean]).def(true),
9866
- falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(""),
9882
+ falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(false),
9867
9883
  disabled: PropTypes.bool.def(false),
9868
9884
  checked: PropTypes.bool.def(false),
9869
9885
  indeterminate: PropTypes.bool,
@@ -9880,12 +9896,14 @@ var Component$v = defineComponent({
9880
9896
  focus: handleFocus
9881
9897
  }] = useFocus$1();
9882
9898
  const {
9899
+ inputRef,
9883
9900
  isChecked,
9884
9901
  isDisabled,
9885
9902
  setChecked,
9886
9903
  handleChange
9887
9904
  } = useCheckbox();
9888
9905
  return {
9906
+ inputRef,
9889
9907
  isFocus,
9890
9908
  isChecked,
9891
9909
  isDisabled,
@@ -9917,6 +9935,7 @@ var Component$v = defineComponent({
9917
9935
  }, [createVNode("span", {
9918
9936
  "class": [resolveClassName("checkbox-input"), this.size]
9919
9937
  }, [createVNode("input", {
9938
+ "ref": "inputRef",
9920
9939
  "role": "checkbox",
9921
9940
  "type": "checkbox",
9922
9941
  "class": "bk-checkbox-original",
@@ -10012,7 +10031,7 @@ const propsCollapsePanel = __spreadValues({
10012
10031
  content: PropTypes.string,
10013
10032
  disabled: PropTypes.bool.def(false),
10014
10033
  isFormList: PropTypes.bool.def(false),
10015
- renderDirective: renderDirectiveType().def(RenderDirectiveEnum.SHOW),
10034
+ renderDirective: renderDirectiveType(),
10016
10035
  modelValue: PropTypes.bool.def(false)
10017
10036
  }, CollapsePanelEventProps);
10018
10037
  const trimArr$1 = function(s2) {
@@ -10310,7 +10329,7 @@ const propsMixin$1 = {
10310
10329
  direction: PropTypes.string,
10311
10330
  title: PropTypes.string.def(""),
10312
10331
  animateType: PropTypes.string.def("slide"),
10313
- renderDirective: renderDirectiveType,
10332
+ renderDirective: renderDirectiveType(),
10314
10333
  beforeClose: PropTypes.custom(() => true),
10315
10334
  dialogType: dialogTypeUnion(),
10316
10335
  multiInstance: PropTypes.bool.def(true),
@@ -20466,7 +20485,7 @@ const tabPanelProps = {
20466
20485
  visible: PropTypes.bool.def(true),
20467
20486
  disabled: PropTypes.bool,
20468
20487
  sortable: PropTypes.bool,
20469
- renderDirective: renderDirectiveType,
20488
+ renderDirective: renderDirectiveType(),
20470
20489
  panel: PropTypes.string || PropTypes.func
20471
20490
  };
20472
20491
  var TabNav = defineComponent({