cosey 0.5.15 → 0.5.16

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.
@@ -1,8 +1,8 @@
1
1
  import { ElInputNumber } from 'element-plus';
2
2
  import { defineComponent, computed, h, mergeProps } from 'vue';
3
- import { isNullish } from '../../../../utils/is.js';
4
3
  import { useLocale } from '../../../../hooks/useLocale.js';
5
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
+ import { isString } from '../../../../utils/is.js';
6
6
 
7
7
  var stdin_default = defineComponent((props, {
8
8
  slots
@@ -10,7 +10,20 @@ var stdin_default = defineComponent((props, {
10
10
  const {
11
11
  t
12
12
  } = useLocale();
13
- const value = computed(() => props.componentProps?.modelValue);
13
+ const value = computed(() => {
14
+ let value2 = props.componentProps?.modelValue;
15
+ if (isString(value2)) {
16
+ if (value2 === "") {
17
+ value2 = null;
18
+ } else {
19
+ value2 = +value2;
20
+ if (isNaN(value2)) {
21
+ value2 = null;
22
+ }
23
+ }
24
+ }
25
+ return value2;
26
+ });
14
27
  return () => {
15
28
  if (props.readonly) {
16
29
  return addNullablePlaceholder(value.value);
@@ -23,7 +36,7 @@ var stdin_default = defineComponent((props, {
23
36
  }
24
37
  }, {
25
38
  ...props.componentProps,
26
- modelValue: isNullish(value.value) ? value.value : isNaN(+value.value) ? null : +value.value
39
+ modelValue: value.value
27
40
  }), slots);
28
41
  };
29
42
  }, {
@@ -3,8 +3,8 @@ import { defaultInputNumberRangeProps } from './input-number-range.js';
3
3
  import stdin_default$1 from './style/index.js';
4
4
  import { useFormItem, CHANGE_EVENT, ElInputNumber } from 'element-plus';
5
5
  import { debugWarn } from 'element-plus/es/utils/error.mjs';
6
- import { useComponentConfig } from '../config-provider/config-provider.api.js';
7
6
  import { isNullish } from '../../utils/is.js';
7
+ import { useComponentConfig } from '../config-provider/config-provider.api.js';
8
8
 
9
9
  var stdin_default = /* @__PURE__ */defineComponent({
10
10
  ...{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.5.15",
3
+ "version": "0.5.16",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",