@deot/vc-components 1.0.44 → 1.0.46

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.js CHANGED
@@ -274,7 +274,9 @@ const Affix = /* @__PURE__ */ defineComponent({
274
274
  [`vc-affix__${props.fixed ? 'fixed' : 'absolute'}`]: isActive.value
275
275
  },
276
276
  "style": contentStyle.value
277
- }, [slots?.default?.()])]);
277
+ }, [slots?.default?.({
278
+ active: isActive.value
279
+ })])]);
278
280
  };
279
281
  }
280
282
  });
@@ -11423,7 +11425,14 @@ const props$L = {
11423
11425
  styleless: {
11424
11426
  type: Boolean,
11425
11427
  default: false
11426
- }
11428
+ },
11429
+ // 给formItem统一注入
11430
+ contentStyle: [Object, String],
11431
+ contentClass: [Object, String],
11432
+ labelStyle: [Object, String],
11433
+ labelClass: [Object, String],
11434
+ errorStyle: [Object, String],
11435
+ errorClass: [Object, String]
11427
11436
  };
11428
11437
 
11429
11438
  const useForm = (expose, options = {}) => {
@@ -11583,7 +11592,9 @@ const props$K = {
11583
11592
  contentStyle: [Object, String],
11584
11593
  contentClass: [Object, String],
11585
11594
  labelStyle: [Object, String],
11586
- labelClass: [Object, String]
11595
+ labelClass: [Object, String],
11596
+ errorStyle: [Object, String],
11597
+ errorClass: [Object, String]
11587
11598
  };
11588
11599
 
11589
11600
  const filterEmpty = (val) => {
@@ -11665,6 +11676,7 @@ const useFormItem = (expose) => {
11665
11676
  width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
11666
11677
  textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
11667
11678
  },
11679
+ form.props.labelStyle,
11668
11680
  props.labelStyle
11669
11681
  ];
11670
11682
  });
@@ -11675,9 +11687,22 @@ const useFormItem = (expose) => {
11675
11687
  marginLeft: !hasLabel.value && isNest.value ? 0 : labelWidth && labelWidth > 0 ? `${labelWidth}px` : "unset",
11676
11688
  marginBottom: isNest.value && !isNestLast.value ? `20px` : 0
11677
11689
  },
11690
+ form.props.contentStyle,
11678
11691
  props.contentStyle
11679
11692
  ];
11680
11693
  });
11694
+ const errorStyle = computed(() => {
11695
+ return [form.props.errorStyle, props.errorStyle];
11696
+ });
11697
+ const labelClass = computed(() => {
11698
+ return [form.props.labelClass, props.labelClass];
11699
+ });
11700
+ const contentClass = computed(() => {
11701
+ return [form.props.contentClass, props.contentClass];
11702
+ });
11703
+ const errorClass = computed(() => {
11704
+ return [form.props.errorClass, props.errorClass];
11705
+ });
11681
11706
  const isStyleless = computed(() => {
11682
11707
  return props.styleless || form.props.styleless;
11683
11708
  });
@@ -11840,6 +11865,10 @@ const useFormItem = (expose) => {
11840
11865
  classes,
11841
11866
  labelStyle,
11842
11867
  contentStyle,
11868
+ errorStyle,
11869
+ labelClass,
11870
+ contentClass,
11871
+ errorClass,
11843
11872
  showError,
11844
11873
  labelPosition
11845
11874
  };
@@ -11862,6 +11891,10 @@ const FormItem = /* @__PURE__ */ defineComponent({
11862
11891
  classes,
11863
11892
  labelStyle,
11864
11893
  contentStyle,
11894
+ errorStyle,
11895
+ labelClass,
11896
+ contentClass,
11897
+ errorClass,
11865
11898
  showError,
11866
11899
  validateMessage
11867
11900
  } = it;
@@ -11875,27 +11908,30 @@ const FormItem = /* @__PURE__ */ defineComponent({
11875
11908
  show: showError.value,
11876
11909
  nest: isNest.value,
11877
11910
  message: validateMessage.value,
11878
- class: errorColorClass
11911
+ class: [errorColorClass, ...errorClass.value],
11912
+ style: errorStyle.value
11879
11913
  })];
11880
11914
  return createVNode("div", {
11881
11915
  "class": ['vc-form-item', classes.value]
11882
11916
  }, [(label || slots.label) && createVNode("div", {
11883
11917
  "style": labelStyle.value,
11884
- "class": ['vc-form-item__label', props.labelClass],
11918
+ "class": ['vc-form-item__label', ...labelClass.value],
11885
11919
  "for": labelFor
11886
11920
  }, [createVNode("label", null, [label || slots.label?.()])]), createVNode("div", {
11887
11921
  "class": "vc-form-item__wrapper"
11888
11922
  }, [createVNode("div", {
11889
- "class": ['vc-form-item__content', props.contentClass],
11923
+ "class": ['vc-form-item__content', ...contentClass.value],
11890
11924
  "style": contentStyle.value
11891
11925
  }, [slots.default?.(), slots.error ? slots.error({
11892
11926
  show: showError.value,
11893
11927
  nest: isNest.value,
11894
11928
  message: validateMessage.value,
11895
- class: errorColorClass
11929
+ class: [errorColorClass, ...errorClass.value],
11930
+ style: errorStyle.value
11896
11931
  }) : createVNode(TransitionFade, null, {
11897
11932
  default: () => [withDirectives(createVNode("div", {
11898
- "class": ['vc-form-item__tip', isNest.value ? 'is-nest' : '', errorColorClass]
11933
+ "class": ['vc-form-item__tip', isNest.value ? 'is-nest' : '', errorColorClass, ...errorClass.value],
11934
+ "style": [errorStyle.value]
11899
11935
  }, [validateMessage.value]), [[vShow, showError.value]])]
11900
11936
  })])])]);
11901
11937
  };
@@ -11961,6 +11997,10 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11961
11997
  classes,
11962
11998
  labelStyle,
11963
11999
  contentStyle,
12000
+ errorStyle,
12001
+ labelClass,
12002
+ contentClass,
12003
+ errorClass,
11964
12004
  isNest,
11965
12005
  showError,
11966
12006
  validateMessage
@@ -11976,7 +12016,8 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11976
12016
  show: showError.value,
11977
12017
  nest: isNest.value,
11978
12018
  message: validateMessage.value,
11979
- class: errorColorClass
12019
+ class: [errorColorClass, ...errorClass.value],
12020
+ style: errorStyle.value
11980
12021
  })];
11981
12022
  return createVNode("div", {
11982
12023
  "style": {
@@ -11988,14 +12029,15 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11988
12029
  }, [(props.label || slots.label) && createVNode("label", {
11989
12030
  "for": labelFor,
11990
12031
  "style": labelStyle.value,
11991
- "class": "vcm-form-item__label"
12032
+ "class": ['vcm-form-item__label', ...labelClass.value]
11992
12033
  }, [label || slots.label?.()]), createVNode("div", {
11993
12034
  "style": contentStyle.value,
11994
- "class": "vcm-form-item__content"
12035
+ "class": ['vcm-form-item__content', ...contentClass.value]
11995
12036
  }, [slots.default?.(), showMessage && showError.value && createVNode("div", {
11996
12037
  "class": [{
11997
12038
  'is-nest': isNest.value
11998
- }, errorColorClass]
12039
+ }, errorColorClass, ...errorClass.value],
12040
+ "style": errorStyle.value
11999
12041
  }, [slots.error ? slots.error({
12000
12042
  message: validateMessage.value
12001
12043
  }) : validateMessage.value])])])]);
@@ -16692,6 +16734,7 @@ const useSwitch = (expose) => {
16692
16734
  });
16693
16735
  const classes = computed(() => {
16694
16736
  return {
16737
+ "is-disabled": props.disabled,
16695
16738
  "is-loading": isLoading.value,
16696
16739
  "is-checked": checked.value
16697
16740
  };
@@ -19979,6 +20022,7 @@ const useTabs = (options = {}) => {
19979
20022
  emit("update:modelValue", currentValue.value);
19980
20023
  emit("change", currentValue.value);
19981
20024
  emit("click", currentValue.value);
20025
+ nav.anchor && document.querySelector(nav.anchor)?.scrollIntoView?.({ behavior: "smooth" });
19982
20026
  };
19983
20027
  const handleResize = () => {
19984
20028
  if (instance.isUnmounted) return;
@@ -20238,6 +20282,9 @@ const props$b = {
20238
20282
  type: [String, Function],
20239
20283
  default: ""
20240
20284
  },
20285
+ anchor: {
20286
+ type: String
20287
+ },
20241
20288
  /**
20242
20289
  * 服务端渲染时,lazy设置为false,可以把内容渲染出来;
20243
20290
  * 不能设置为!IS_SERVER, 会影响客服端激活,不一样会存在问题
@@ -20694,6 +20741,10 @@ const props$9 = {
20694
20741
  default: (props$) => {
20695
20742
  return props$.value;
20696
20743
  }
20744
+ },
20745
+ theme: {
20746
+ type: String,
20747
+ default: "dark"
20697
20748
  }
20698
20749
  };
20699
20750
 
@@ -20746,7 +20797,7 @@ const Text = /* @__PURE__ */ defineComponent({
20746
20797
  // 确保不重复创建
20747
20798
  triggerEl: e.target,
20748
20799
  hover: true,
20749
- theme: 'dark',
20800
+ theme: props.theme,
20750
20801
  placement: props.placement,
20751
20802
  portalClass: props.portalClass,
20752
20803
  portalStyle: [props.portalStyle || `width: ${e.target.clientWidth}px`, 'word-break: break-all'],