vue-devui 1.6.36 → 1.6.37-alpha.0

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.
@@ -10575,9 +10575,11 @@ function DecIcon() {
10575
10575
  const ns = useNamespace$1("input-number");
10576
10576
  function useRender(props, ctx) {
10577
10577
  const formContext = inject(FORM_TOKEN, void 0);
10578
+ const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
10578
10579
  const { style, class: customClass, ...otherAttrs } = ctx.attrs;
10579
10580
  const customStyle = { style };
10580
10581
  const inputNumberSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "md");
10582
+ const isValidateError = computed(() => (formItemContext == null ? void 0 : formItemContext.validateState) === "error");
10581
10583
  const wrapClass = computed(() => [
10582
10584
  {
10583
10585
  [ns.b()]: true,
@@ -10588,6 +10590,7 @@ function useRender(props, ctx) {
10588
10590
  ]);
10589
10591
  const controlButtonsClass = computed(() => ({
10590
10592
  [ns.e("control-buttons")]: true,
10593
+ [ns.em("control-buttons", "error")]: isValidateError.value,
10591
10594
  disabled: props.disabled
10592
10595
  }));
10593
10596
  const inputWrapClass = computed(() => ({
@@ -10595,6 +10598,7 @@ function useRender(props, ctx) {
10595
10598
  }));
10596
10599
  const inputInnerClass = computed(() => ({
10597
10600
  [ns.e("input-box")]: true,
10601
+ [ns.em("input-box", "error")]: isValidateError.value,
10598
10602
  disabled: props.disabled
10599
10603
  }));
10600
10604
  return { wrapClass, customStyle, otherAttrs, controlButtonsClass, inputWrapClass, inputInnerClass };
@@ -10732,6 +10736,7 @@ var InputNumber = defineComponent({
10732
10736
  props: inputNumberProps,
10733
10737
  emits: ["update:modelValue", "change", "input"],
10734
10738
  setup(props, ctx) {
10739
+ const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
10735
10740
  const {
10736
10741
  disabled
10737
10742
  } = toRefs(props);
@@ -10755,6 +10760,10 @@ var InputNumber = defineComponent({
10755
10760
  onInput,
10756
10761
  onChange
10757
10762
  } = useEvent(props, ctx, inputRef);
10763
+ watch(() => props.modelValue, () => {
10764
+ formItemContext == null ? void 0 : formItemContext.validate("change").catch(() => {
10765
+ });
10766
+ });
10758
10767
  return () => createVNode("div", mergeProps({
10759
10768
  "class": wrapClass.value
10760
10769
  }, customStyle), [createVNode("div", {
@@ -10779,7 +10788,9 @@ var InputNumber = defineComponent({
10779
10788
  "class": inputInnerClass.value
10780
10789
  }, otherAttrs, {
10781
10790
  "onInput": onInput,
10782
- "onChange": onChange
10791
+ "onChange": onChange,
10792
+ "onBlur": () => formItemContext == null ? void 0 : formItemContext.validate("blur").catch(() => {
10793
+ })
10783
10794
  }), null)])]);
10784
10795
  }
10785
10796
  });