@deot/vc-components 1.0.45 → 1.0.47

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
@@ -3728,7 +3728,8 @@ const props$19 = {
3728
3728
  nullValue: {
3729
3729
  type: [Number, String, Object],
3730
3730
  default: void 0
3731
- }
3731
+ },
3732
+ label: String
3732
3733
  };
3733
3734
 
3734
3735
  const props$18 = {
@@ -11425,7 +11426,14 @@ const props$L = {
11425
11426
  styleless: {
11426
11427
  type: Boolean,
11427
11428
  default: false
11428
- }
11429
+ },
11430
+ // 给formItem统一注入
11431
+ contentStyle: [Object, String],
11432
+ contentClass: [Object, String],
11433
+ labelStyle: [Object, String],
11434
+ labelClass: [Object, String],
11435
+ errorStyle: [Object, String],
11436
+ errorClass: [Object, String]
11429
11437
  };
11430
11438
 
11431
11439
  const useForm = (expose, options = {}) => {
@@ -11585,7 +11593,9 @@ const props$K = {
11585
11593
  contentStyle: [Object, String],
11586
11594
  contentClass: [Object, String],
11587
11595
  labelStyle: [Object, String],
11588
- labelClass: [Object, String]
11596
+ labelClass: [Object, String],
11597
+ errorStyle: [Object, String],
11598
+ errorClass: [Object, String]
11589
11599
  };
11590
11600
 
11591
11601
  const filterEmpty = (val) => {
@@ -11667,6 +11677,7 @@ const useFormItem = (expose) => {
11667
11677
  width: labelPosition.value !== "top" && labelWidth && labelWidth > 0 ? `${labelWidth}px` : "auto",
11668
11678
  textAlign: labelPosition.value === "top" ? "left" : labelPosition.value
11669
11679
  },
11680
+ form.props.labelStyle,
11670
11681
  props.labelStyle
11671
11682
  ];
11672
11683
  });
@@ -11677,9 +11688,22 @@ const useFormItem = (expose) => {
11677
11688
  marginLeft: !hasLabel.value && isNest.value ? 0 : labelWidth && labelWidth > 0 ? `${labelWidth}px` : "unset",
11678
11689
  marginBottom: isNest.value && !isNestLast.value ? `20px` : 0
11679
11690
  },
11691
+ form.props.contentStyle,
11680
11692
  props.contentStyle
11681
11693
  ];
11682
11694
  });
11695
+ const errorStyle = computed(() => {
11696
+ return [form.props.errorStyle, props.errorStyle];
11697
+ });
11698
+ const labelClass = computed(() => {
11699
+ return [form.props.labelClass, props.labelClass];
11700
+ });
11701
+ const contentClass = computed(() => {
11702
+ return [form.props.contentClass, props.contentClass];
11703
+ });
11704
+ const errorClass = computed(() => {
11705
+ return [form.props.errorClass, props.errorClass];
11706
+ });
11683
11707
  const isStyleless = computed(() => {
11684
11708
  return props.styleless || form.props.styleless;
11685
11709
  });
@@ -11842,6 +11866,10 @@ const useFormItem = (expose) => {
11842
11866
  classes,
11843
11867
  labelStyle,
11844
11868
  contentStyle,
11869
+ errorStyle,
11870
+ labelClass,
11871
+ contentClass,
11872
+ errorClass,
11845
11873
  showError,
11846
11874
  labelPosition
11847
11875
  };
@@ -11864,6 +11892,10 @@ const FormItem = /* @__PURE__ */ defineComponent({
11864
11892
  classes,
11865
11893
  labelStyle,
11866
11894
  contentStyle,
11895
+ errorStyle,
11896
+ labelClass,
11897
+ contentClass,
11898
+ errorClass,
11867
11899
  showError,
11868
11900
  validateMessage
11869
11901
  } = it;
@@ -11877,27 +11909,30 @@ const FormItem = /* @__PURE__ */ defineComponent({
11877
11909
  show: showError.value,
11878
11910
  nest: isNest.value,
11879
11911
  message: validateMessage.value,
11880
- class: errorColorClass
11912
+ class: [errorColorClass, ...errorClass.value],
11913
+ style: errorStyle.value
11881
11914
  })];
11882
11915
  return createVNode("div", {
11883
11916
  "class": ['vc-form-item', classes.value]
11884
11917
  }, [(label || slots.label) && createVNode("div", {
11885
11918
  "style": labelStyle.value,
11886
- "class": ['vc-form-item__label', props.labelClass],
11919
+ "class": ['vc-form-item__label', ...labelClass.value],
11887
11920
  "for": labelFor
11888
11921
  }, [createVNode("label", null, [label || slots.label?.()])]), createVNode("div", {
11889
11922
  "class": "vc-form-item__wrapper"
11890
11923
  }, [createVNode("div", {
11891
- "class": ['vc-form-item__content', props.contentClass],
11924
+ "class": ['vc-form-item__content', ...contentClass.value],
11892
11925
  "style": contentStyle.value
11893
11926
  }, [slots.default?.(), slots.error ? slots.error({
11894
11927
  show: showError.value,
11895
11928
  nest: isNest.value,
11896
11929
  message: validateMessage.value,
11897
- class: errorColorClass
11930
+ class: [errorColorClass, ...errorClass.value],
11931
+ style: errorStyle.value
11898
11932
  }) : createVNode(TransitionFade, null, {
11899
11933
  default: () => [withDirectives(createVNode("div", {
11900
- "class": ['vc-form-item__tip', isNest.value ? 'is-nest' : '', errorColorClass]
11934
+ "class": ['vc-form-item__tip', isNest.value ? 'is-nest' : '', errorColorClass, ...errorClass.value],
11935
+ "style": [errorStyle.value]
11901
11936
  }, [validateMessage.value]), [[vShow, showError.value]])]
11902
11937
  })])])]);
11903
11938
  };
@@ -11963,6 +11998,10 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11963
11998
  classes,
11964
11999
  labelStyle,
11965
12000
  contentStyle,
12001
+ errorStyle,
12002
+ labelClass,
12003
+ contentClass,
12004
+ errorClass,
11966
12005
  isNest,
11967
12006
  showError,
11968
12007
  validateMessage
@@ -11978,7 +12017,8 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11978
12017
  show: showError.value,
11979
12018
  nest: isNest.value,
11980
12019
  message: validateMessage.value,
11981
- class: errorColorClass
12020
+ class: [errorColorClass, ...errorClass.value],
12021
+ style: errorStyle.value
11982
12022
  })];
11983
12023
  return createVNode("div", {
11984
12024
  "style": {
@@ -11990,14 +12030,15 @@ const MFormItem = /* @__PURE__ */ defineComponent({
11990
12030
  }, [(props.label || slots.label) && createVNode("label", {
11991
12031
  "for": labelFor,
11992
12032
  "style": labelStyle.value,
11993
- "class": "vcm-form-item__label"
12033
+ "class": ['vcm-form-item__label', ...labelClass.value]
11994
12034
  }, [label || slots.label?.()]), createVNode("div", {
11995
12035
  "style": contentStyle.value,
11996
- "class": "vcm-form-item__content"
12036
+ "class": ['vcm-form-item__content', ...contentClass.value]
11997
12037
  }, [slots.default?.(), showMessage && showError.value && createVNode("div", {
11998
12038
  "class": [{
11999
12039
  'is-nest': isNest.value
12000
- }, errorColorClass]
12040
+ }, errorColorClass, ...errorClass.value],
12041
+ "style": errorStyle.value
12001
12042
  }, [slots.error ? slots.error({
12002
12043
  message: validateMessage.value
12003
12044
  }) : validateMessage.value])])])]);
@@ -14268,7 +14309,7 @@ const Select = /* @__PURE__ */ defineComponent({
14268
14309
  "style": its.value.style,
14269
14310
  "animation": "y",
14270
14311
  "onMouseenter": () => isHover.value = true,
14271
- "onMuseleave": () => isHover.value = false,
14312
+ "onMouseleave": () => isHover.value = false,
14272
14313
  "onReady": () => emit('ready'),
14273
14314
  "onClose": () => emit('close'),
14274
14315
  "onVisibleChange": () => emit('visible-change', isActive.value),
@@ -14284,6 +14325,13 @@ const Select = /* @__PURE__ */ defineComponent({
14284
14325
  "readonly": true,
14285
14326
  "placeholder": its.value.attrs?.placeholder || '请选择'
14286
14327
  }, {
14328
+ prepend: () => {
14329
+ if (slots.prepend) return slots.prepend?.();
14330
+ if (!props.label) return null;
14331
+ return createVNode("span", {
14332
+ "class": "vc-select__label"
14333
+ }, [props.label]);
14334
+ },
14287
14335
  content: multiple.value && currentValue.value && currentValue.value.length > 0 ? () => {
14288
14336
  return createVNode("div", {
14289
14337
  "class": [classes.value, 'vc-select__tags']
@@ -14305,7 +14353,7 @@ const Select = /* @__PURE__ */ defineComponent({
14305
14353
  }, [createVNode(Icon, {
14306
14354
  "type": showClear.value ? 'clear' : icon.value,
14307
14355
  "class": [{
14308
- 'is-arrow': !showClear
14356
+ 'is-arrow': !showClear.value
14309
14357
  }, 'vc-select__icon'],
14310
14358
  "onClick": handleClear
14311
14359
  }, null)]);
@@ -16694,6 +16742,7 @@ const useSwitch = (expose) => {
16694
16742
  });
16695
16743
  const classes = computed(() => {
16696
16744
  return {
16745
+ "is-disabled": props.disabled,
16697
16746
  "is-loading": isLoading.value,
16698
16747
  "is-checked": checked.value
16699
16748
  };