bkui-vue 0.0.1-beta.342 → 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.
Files changed (41) hide show
  1. package/dist/index.cjs.js +2 -2
  2. package/dist/index.esm.js +49 -25
  3. package/dist/index.umd.js +2 -2
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/breadcrumb/index.js +1 -1
  7. package/lib/button/index.js +1 -1
  8. package/lib/checkbox/checkbox.d.ts +4 -10
  9. package/lib/checkbox/common.d.ts +1 -0
  10. package/lib/checkbox/index.d.ts +8 -16
  11. package/lib/checkbox/index.js +1 -1
  12. package/lib/collapse/collapse-panel.d.ts +2 -2
  13. package/lib/collapse/index.d.ts +2 -2
  14. package/lib/collapse/index.js +1 -1
  15. package/lib/collapse/props.d.ts +1 -2
  16. package/lib/date-picker/date-picker.css +2 -1
  17. package/lib/date-picker/date-picker.less +2 -3
  18. package/lib/date-picker/date-picker.variable.css +2 -1
  19. package/lib/dialog/dialog.d.ts +2 -2
  20. package/lib/dialog/index.d.ts +4 -4
  21. package/lib/dialog/props.d.ts +1 -1
  22. package/lib/form/form.css +0 -1
  23. package/lib/form/form.less +0 -1
  24. package/lib/form/form.variable.css +0 -1
  25. package/lib/modal/index.d.ts +5 -5
  26. package/lib/modal/index.js +1 -1
  27. package/lib/modal/modal.d.ts +2 -2
  28. package/lib/modal/props.mixin.d.ts +1 -2
  29. package/lib/shared/index.js +1 -1
  30. package/lib/shared/vue-types.d.ts +5 -1
  31. package/lib/sideslider/index.d.ts +4 -4
  32. package/lib/sideslider/sideslider.d.ts +2 -2
  33. package/lib/tab/index.d.ts +2 -2
  34. package/lib/tab/index.js +1 -1
  35. package/lib/tab/props.d.ts +1 -2
  36. package/lib/tab/tab-panel.d.ts +2 -2
  37. package/lib/tab/tab.css +0 -1
  38. package/lib/tab/tab.less +0 -1
  39. package/lib/tab/tab.variable.css +0 -1
  40. package/lib/tag-input/tag-input.d.ts +28 -2
  41. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -9161,8 +9161,25 @@ var BreadcrumbItem = defineComponent({
9161
9161
  const classCtx = classes({
9162
9162
  "bk-breadcrumb-item": true
9163
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
+ };
9164
9181
  return () => {
9165
- var _a, _b;
9182
+ var _a;
9166
9183
  return createVNode("span", {
9167
9184
  "class": classCtx
9168
9185
  }, [createVNode("span", {
@@ -9170,12 +9187,7 @@ var BreadcrumbItem = defineComponent({
9170
9187
  "class": `bk-breadcrumb-item-inner ${props2.to ? "is-link" : ""}`,
9171
9188
  "role": "link",
9172
9189
  "onClick": handleClick
9173
- }, [(_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", {
9174
- "class": `bk-breadcrumb-separator ${parent.separatorClass}`
9175
- }, null) : createVNode("span", {
9176
- "class": "bk-breadcrumb-separator",
9177
- "role": "presentation"
9178
- }, [parent == null ? void 0 : parent.separator])]);
9190
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), renderSeparator()]);
9179
9191
  };
9180
9192
  }
9181
9193
  });
@@ -9332,10 +9344,10 @@ var Component$y = defineComponent({
9332
9344
  if (isHover.value && !props2.text)
9333
9345
  return "white";
9334
9346
  if (props2.text && props2.disabled)
9335
- return "";
9347
+ return;
9336
9348
  return props2.hoverTheme || props2.theme;
9337
9349
  }
9338
- return ["", "default"].includes(props2.theme) ? "" : "white";
9350
+ return !props2.theme ? void 0 : "white";
9339
9351
  });
9340
9352
  const loadingSize = computed(() => isText.value || props2.size === BkLoadingSize.Small ? BkLoadingSize.Mini : BkLoadingSize.Small);
9341
9353
  const handleClick = (e) => {
@@ -9793,6 +9805,7 @@ const useCheckbox = () => {
9793
9805
  } = currentInstance;
9794
9806
  const checkboxGroup = inject(checkboxGroupKey, EMPTY_OBJ);
9795
9807
  const isGroup = !isEmptyObj(checkboxGroup);
9808
+ const inputRef = ref();
9796
9809
  const isChecked = ref(props2.checked);
9797
9810
  const isDisabled = computed(() => {
9798
9811
  if (isGroup && checkboxGroup.props.disabled) {
@@ -9800,6 +9813,19 @@ const useCheckbox = () => {
9800
9813
  }
9801
9814
  return props2.disabled;
9802
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
+ };
9803
9829
  if (isGroup) {
9804
9830
  watch(() => checkboxGroup.props.modelValue, (modelValue) => {
9805
9831
  isChecked.value = modelValue.includes(props2.label);
@@ -9816,6 +9842,10 @@ const useCheckbox = () => {
9816
9842
  immediate: true
9817
9843
  });
9818
9844
  }
9845
+ watch(() => props2.checked, () => {
9846
+ isChecked.value = props2.checked;
9847
+ triggerChange();
9848
+ });
9819
9849
  const setChecked = (value = true) => {
9820
9850
  isChecked.value = value;
9821
9851
  };
@@ -9825,17 +9855,7 @@ const useCheckbox = () => {
9825
9855
  }
9826
9856
  const $targetInput = event.target;
9827
9857
  isChecked.value = $targetInput.checked;
9828
- const nextValue = isChecked.value ? props2.trueLabel : props2.falseLabel;
9829
- emit("update:modelValue", nextValue);
9830
- emit("change", nextValue);
9831
- if (isGroup) {
9832
- checkboxGroup.handleChange();
9833
- }
9834
- nextTick(() => {
9835
- if ($targetInput.checked !== isChecked.value) {
9836
- $targetInput.checked = isChecked.value;
9837
- }
9838
- });
9858
+ triggerChange();
9839
9859
  };
9840
9860
  onMounted(() => {
9841
9861
  if (isGroup) {
@@ -9848,6 +9868,7 @@ const useCheckbox = () => {
9848
9868
  }
9849
9869
  });
9850
9870
  return {
9871
+ inputRef,
9851
9872
  isChecked,
9852
9873
  isDisabled,
9853
9874
  setChecked,
@@ -9855,10 +9876,10 @@ const useCheckbox = () => {
9855
9876
  };
9856
9877
  };
9857
9878
  const checkboxProps = {
9858
- modelValue: PropTypes.oneOfType([String, Number, Boolean]).def(""),
9879
+ modelValue: PropTypes.oneOfType([String, Number, Boolean]),
9859
9880
  label: PropTypes.oneOfType([String, Number, Boolean]),
9860
9881
  trueLabel: PropTypes.oneOfType([String, Number, Boolean]).def(true),
9861
- falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(""),
9882
+ falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(false),
9862
9883
  disabled: PropTypes.bool.def(false),
9863
9884
  checked: PropTypes.bool.def(false),
9864
9885
  indeterminate: PropTypes.bool,
@@ -9875,12 +9896,14 @@ var Component$v = defineComponent({
9875
9896
  focus: handleFocus
9876
9897
  }] = useFocus$1();
9877
9898
  const {
9899
+ inputRef,
9878
9900
  isChecked,
9879
9901
  isDisabled,
9880
9902
  setChecked,
9881
9903
  handleChange
9882
9904
  } = useCheckbox();
9883
9905
  return {
9906
+ inputRef,
9884
9907
  isFocus,
9885
9908
  isChecked,
9886
9909
  isDisabled,
@@ -9912,6 +9935,7 @@ var Component$v = defineComponent({
9912
9935
  }, [createVNode("span", {
9913
9936
  "class": [resolveClassName("checkbox-input"), this.size]
9914
9937
  }, [createVNode("input", {
9938
+ "ref": "inputRef",
9915
9939
  "role": "checkbox",
9916
9940
  "type": "checkbox",
9917
9941
  "class": "bk-checkbox-original",
@@ -10007,7 +10031,7 @@ const propsCollapsePanel = __spreadValues({
10007
10031
  content: PropTypes.string,
10008
10032
  disabled: PropTypes.bool.def(false),
10009
10033
  isFormList: PropTypes.bool.def(false),
10010
- renderDirective: renderDirectiveType,
10034
+ renderDirective: renderDirectiveType(),
10011
10035
  modelValue: PropTypes.bool.def(false)
10012
10036
  }, CollapsePanelEventProps);
10013
10037
  const trimArr$1 = function(s2) {
@@ -10305,7 +10329,7 @@ const propsMixin$1 = {
10305
10329
  direction: PropTypes.string,
10306
10330
  title: PropTypes.string.def(""),
10307
10331
  animateType: PropTypes.string.def("slide"),
10308
- renderDirective: renderDirectiveType,
10332
+ renderDirective: renderDirectiveType(),
10309
10333
  beforeClose: PropTypes.custom(() => true),
10310
10334
  dialogType: dialogTypeUnion(),
10311
10335
  multiInstance: PropTypes.bool.def(true),
@@ -20461,7 +20485,7 @@ const tabPanelProps = {
20461
20485
  visible: PropTypes.bool.def(true),
20462
20486
  disabled: PropTypes.bool,
20463
20487
  sortable: PropTypes.bool,
20464
- renderDirective: renderDirectiveType,
20488
+ renderDirective: renderDirectiveType(),
20465
20489
  panel: PropTypes.string || PropTypes.func
20466
20490
  };
20467
20491
  var TabNav = defineComponent({