cosey 0.5.11 → 0.5.13

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,7 +1,8 @@
1
1
  import { type InputNumberInstance, type InputNumberProps } from 'element-plus';
2
2
  import { type FieldComponentCommonProps } from '../common';
3
3
  export interface FieldNumberProps extends FieldComponentCommonProps {
4
- componentProps?: Partial<InputNumberProps> & {
4
+ componentProps?: Partial<Omit<InputNumberProps, 'modelValue'>> & {
5
+ modelValue?: number | null | string;
5
6
  'onUpdate:modelValue'?: (value: number | undefined) => void;
6
7
  onChange?: (currentValue: number | undefined, oldValue: number | undefined) => void;
7
8
  onBlur?: (event: FocusEvent) => void;
@@ -1,5 +1,6 @@
1
1
  import { ElInputNumber } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
+ import { isNullish } from '../../../../utils/is.js';
3
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
4
5
 
5
6
  var stdin_default = defineComponent((props, {
@@ -11,9 +12,13 @@ var stdin_default = defineComponent((props, {
11
12
  }
12
13
  return h(ElInputNumber, mergeProps({
13
14
  style: {
14
- verticalAlign: "top"
15
+ verticalAlign: "top",
16
+ width: "100%"
15
17
  }
16
- }, props.componentProps ?? {}), slots);
18
+ }, {
19
+ ...props.componentProps,
20
+ modelValue: isNullish(props.componentProps?.modelValue) ? null : Number(props.componentProps?.modelValue) || null
21
+ }), slots);
17
22
  };
18
23
  }, {
19
24
  name: "CoFieldNumber",
@@ -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 { isNullish } from '../../utils/is.js';
7
6
  import { useComponentConfig } from '../config-provider/config-provider.api.js';
7
+ import { isNullish } from '../../utils/is.js';
8
8
 
9
9
  var stdin_default = /* @__PURE__ */defineComponent({
10
10
  ...{
package/config/http.d.ts CHANGED
@@ -62,6 +62,10 @@ export declare const defaultHttpConfig: {
62
62
  * 是否直接返回 AxiosResponse 对象
63
63
  */
64
64
  originalResponse: boolean;
65
+ /**
66
+ * 是否直接返回 AxiosResponse.data 属性值
67
+ */
68
+ originalData: boolean;
65
69
  };
66
70
  export type HttpConfig = DeepPartial<typeof defaultHttpConfig>;
67
71
  export type RequiredHttpConfig = typeof defaultHttpConfig;
package/config/http.js CHANGED
@@ -57,7 +57,11 @@ const defaultHttpConfig = {
57
57
  /**
58
58
  * 是否直接返回 AxiosResponse 对象
59
59
  */
60
- originalResponse: false
60
+ originalResponse: false,
61
+ /**
62
+ * 是否直接返回 AxiosResponse.data 属性值
63
+ */
64
+ originalData: false
61
65
  };
62
66
 
63
67
  export { defaultHttpConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -34,6 +34,9 @@ function useRequest(config = {}, useHttpConfig) {
34
34
  }
35
35
  return Promise.reject(new Error(message));
36
36
  }
37
+ if (mergedHttpConfig.originalData) {
38
+ return resData;
39
+ }
37
40
  return data;
38
41
  };
39
42
  const createAxios = (createHttpConfig) => {