@oiij/naive-ui 0.0.47 → 0.0.50

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.
@@ -38,7 +38,7 @@ function useNaiveForm(value, options) {
38
38
  const formRef = (0, vue.ref)();
39
39
  const formProps = {
40
40
  ref: formRef,
41
- model: formValue,
41
+ model: (0, vue.reactive)(formValue.value),
42
42
  rules: formRules
43
43
  };
44
44
  const onValidatedEvent = (0, __vueuse_core.createEventHook)();
@@ -68,7 +68,7 @@ function useNaiveForm(value, options) {
68
68
  }
69
69
  return {
70
70
  formRef,
71
- formValue: (0, vue.toRef)(formValue),
71
+ formValue,
72
72
  formRules,
73
73
  formProps,
74
74
  validate,
@@ -1,7 +1,8 @@
1
+ import * as vue0 from "vue";
2
+ import { Ref } from "vue";
1
3
  import * as _vueuse_core0 from "@vueuse/core";
2
4
  import { ValidateError } from "async-validator";
3
5
  import { FormInst, FormItemRule, FormRules } from "naive-ui";
4
- import { Ref } from "vue";
5
6
 
6
7
  //#region src/composables/useNaiveForm.d.ts
7
8
  type NaiveFormClearRules = {
@@ -16,11 +17,11 @@ type NaiveFormOptions<T extends Record<string, any>> = {
16
17
  };
17
18
  declare function useNaiveForm<T extends Record<string, any> = Record<string, any>>(value?: T | Ref<T>, options?: NaiveFormOptions<T>): {
18
19
  formRef: Ref<FormInst | undefined, FormInst | undefined>;
19
- formValue: Ref<T>;
20
+ formValue: Ref<T, T>;
20
21
  formRules: Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
21
22
  formProps: {
22
23
  ref: Ref<FormInst | undefined, FormInst | undefined>;
23
- model: Ref<T, T>;
24
+ model: vue0.Reactive<T>;
24
25
  rules: Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
25
26
  };
26
27
  validate: () => Promise<{
@@ -1,4 +1,5 @@
1
1
  import * as _vueuse_core0 from "@vueuse/core";
2
+ import * as vue0 from "vue";
2
3
  import { Ref } from "vue";
3
4
  import { FormInst, FormItemRule, FormRules } from "naive-ui";
4
5
  import { ValidateError } from "async-validator";
@@ -16,11 +17,11 @@ type NaiveFormOptions<T extends Record<string, any>> = {
16
17
  };
17
18
  declare function useNaiveForm<T extends Record<string, any> = Record<string, any>>(value?: T | Ref<T>, options?: NaiveFormOptions<T>): {
18
19
  formRef: Ref<FormInst | undefined, FormInst | undefined>;
19
- formValue: Ref<T>;
20
+ formValue: Ref<T, T>;
20
21
  formRules: Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
21
22
  formProps: {
22
23
  ref: Ref<FormInst | undefined, FormInst | undefined>;
23
- model: Ref<T, T>;
24
+ model: vue0.Reactive<T>;
24
25
  rules: Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
25
26
  };
26
27
  validate: () => Promise<{
@@ -1,5 +1,5 @@
1
1
  import { createEventHook } from "@vueuse/core";
2
- import { ref, toRaw, toRef, toValue } from "vue";
2
+ import { reactive, ref, toRaw, toValue } from "vue";
3
3
 
4
4
  //#region src/composables/useNaiveForm.ts
5
5
  function isObject(value) {
@@ -37,7 +37,7 @@ function useNaiveForm(value, options) {
37
37
  const formRef = ref();
38
38
  const formProps = {
39
39
  ref: formRef,
40
- model: formValue,
40
+ model: reactive(formValue.value),
41
41
  rules: formRules
42
42
  };
43
43
  const onValidatedEvent = createEventHook();
@@ -67,7 +67,7 @@ function useNaiveForm(value, options) {
67
67
  }
68
68
  return {
69
69
  formRef,
70
- formValue: toRef(formValue),
70
+ formValue,
71
71
  formRules,
72
72
  formProps,
73
73
  validate,
@@ -1,5 +1,5 @@
1
- import { GlobalThemeOverrides, NDateLocale } from "naive-ui";
2
1
  import { ComputedRef, Ref } from "vue";
2
+ import { GlobalThemeOverrides, NDateLocale } from "naive-ui";
3
3
  import * as naive_ui_es_themes_interface0 from "naive-ui/es/themes/interface";
4
4
 
5
5
  //#region src/composables/useNaiveTheme.d.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oiij/naive-ui",
3
3
  "type": "module",
4
- "version": "0.0.47",
4
+ "version": "0.0.50",
5
5
  "description": "Som Composable Functions And Components for Vue 3",
6
6
  "author": "oiij",
7
7
  "license": "MIT",
@@ -38,20 +38,20 @@
38
38
  "package.json"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@vueuse/core": "^13.6.0",
41
+ "@vueuse/core": "^13.7.0",
42
42
  "async-validator": "^4.2.5",
43
43
  "colord": "^2.9.3",
44
44
  "naive-ui": "^2.42.0",
45
45
  "prismjs": "^1.30.0",
46
46
  "vue": "^3.5.18",
47
47
  "vue-hooks-plus": "^2.4.0",
48
- "@oiij/markdown-it": "0.0.4",
48
+ "@oiij/markdown-it": "0.0.5",
49
49
  "@oiij/css-render": "0.0.3",
50
- "@oiij/use": "0.0.21"
50
+ "@oiij/use": "0.0.22"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/prismjs": "^1.26.5",
54
- "@vueuse/core": "^13.6.0",
54
+ "@vueuse/core": "^13.7.0",
55
55
  "async-validator": "^4.2.5",
56
56
  "colord": "^2.9.3",
57
57
  "naive-ui": "^2.42.0",
@@ -60,8 +60,8 @@
60
60
  "vue-component-type-helpers": "^3.0.5",
61
61
  "vue-hooks-plus": "^2.4.0",
62
62
  "@oiij/css-render": "0.0.3",
63
- "@oiij/markdown-it": "0.0.4",
64
- "@oiij/use": "0.0.21"
63
+ "@oiij/use": "0.0.22",
64
+ "@oiij/markdown-it": "0.0.5"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"