@carefrees/form-utils-vue 0.0.8 → 0.0.10

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.
Files changed (44) hide show
  1. package/esm/form/form.vue2.mjs +4 -0
  2. package/esm/form/index.mjs +1 -1
  3. package/esm/formItem/form.Item.base.vue.mjs +1 -1
  4. package/esm/formItem/form.hide.item.vue.mjs +1 -1
  5. package/esm/formItem/formItem.vue.mjs +1 -1
  6. package/esm/hooks/attr/attr.FormItem.d.ts +5 -784
  7. package/esm/hooks/attr/attr.FormItem.mjs +7 -7
  8. package/esm/hooks/register/register.FormHideItem.mjs +5 -5
  9. package/esm/hooks/register/register.FormItem.d.ts +3 -782
  10. package/esm/hooks/register/register.FormItem.mjs +10 -10
  11. package/esm/hooks/register/register.FormList.d.ts +1 -781
  12. package/esm/hooks/register/register.FormList.mjs +5 -5
  13. package/esm/hooks/useAttrs.mjs +7 -9
  14. package/esm/interface/index.d.ts +2 -2
  15. package/lib/form/form.vue2.js +4 -0
  16. package/lib/form/index.js +2 -2
  17. package/lib/formItem/form.Item.base.vue.js +1 -1
  18. package/lib/formItem/form.hide.item.vue.js +1 -1
  19. package/lib/formItem/formItem.vue.js +1 -1
  20. package/lib/hooks/attr/attr.FormItem.d.ts +5 -784
  21. package/lib/hooks/attr/attr.FormItem.js +7 -7
  22. package/lib/hooks/register/register.FormHideItem.js +4 -4
  23. package/lib/hooks/register/register.FormItem.d.ts +3 -782
  24. package/lib/hooks/register/register.FormItem.js +10 -10
  25. package/lib/hooks/register/register.FormList.d.ts +1 -781
  26. package/lib/hooks/register/register.FormList.js +5 -5
  27. package/lib/hooks/useAttrs.js +6 -8
  28. package/lib/interface/index.d.ts +2 -2
  29. package/package.json +3 -3
  30. package/src/form/{index.vue → form.vue} +1 -1
  31. package/src/form/index.ts +1 -1
  32. package/src/hooks/attr/attr.FormItem.tsx +13 -9
  33. package/src/hooks/register/register.FormHideItem.ts +5 -5
  34. package/src/hooks/register/register.FormItem.ts +12 -12
  35. package/src/hooks/register/register.FormList.ts +5 -5
  36. package/src/hooks/useAttrs.ts +6 -8
  37. package/src/interface/index.ts +2 -2
  38. package/src/layout/layout.formItem.vue +1 -1
  39. package/esm/form/index.vue2.mjs +0 -4
  40. package/lib/form/index.vue2.js +0 -4
  41. /package/esm/form/{index.vue.d.ts → form.vue.d.ts} +0 -0
  42. /package/esm/form/{index.vue.mjs → form.vue.mjs} +0 -0
  43. /package/lib/form/{index.vue.d.ts → form.vue.d.ts} +0 -0
  44. /package/lib/form/{index.vue.js → form.vue.js} +0 -0
@@ -6,23 +6,23 @@ const useRegisterFormList = (options) => {
6
6
  const { ruleInstance, formItemInstance, form, newName, parentItem } = useRegisterFormItem(options);
7
7
  const formListInstance = useFormList();
8
8
  watch(
9
- [newName.value],
9
+ () => [toValue(newName)],
10
10
  () => {
11
- formListInstance.ctor(newName.value);
11
+ formListInstance.ctor(toValue(newName));
12
12
  },
13
13
  { immediate: true }
14
14
  );
15
15
  watch(
16
- [form, formItemInstance, ruleInstance.value],
16
+ () => [form, formItemInstance, toValue(ruleInstance)],
17
17
  () => {
18
18
  formListInstance.instance = form;
19
19
  formListInstance.formItemInstance = formItemInstance;
20
- formListInstance.rule = ruleInstance.value;
20
+ formListInstance.rule = toValue(ruleInstance);
21
21
  },
22
22
  { immediate: true }
23
23
  );
24
24
  watch(
25
- [options.sort, parentItem.value],
25
+ () => [options.sort, toValue(parentItem)],
26
26
  () => {
27
27
  formListInstance.sort = toValue(parentItem.value.sort);
28
28
  formListInstance.parentDataField = toValue(parentItem.value.name);
@@ -1,4 +1,4 @@
1
- import { inject, computed, toRefs, ref, provide, reactive } from "vue";
1
+ import { inject, computed, ref, provide, reactive } from "vue";
2
2
  const attrsProvideSymbol = Symbol("carefrees-attrs");
3
3
  function useAttrsProvide(options) {
4
4
  const {
@@ -28,14 +28,12 @@ function useAttrsProvide(options) {
28
28
  function useAttrsInject() {
29
29
  const attrs = inject(
30
30
  attrsProvideSymbol,
31
- computed(
32
- () => toRefs({
33
- colCount: 4,
34
- errorLayout: "left-bottom",
35
- labelMode: "top",
36
- showColon: true
37
- })
38
- )
31
+ computed(() => ({
32
+ colCount: ref(4),
33
+ errorLayout: ref("left-bottom"),
34
+ labelMode: ref("top"),
35
+ showColon: ref(true)
36
+ }))
39
37
  );
40
38
  return attrs;
41
39
  }
@@ -1,4 +1,4 @@
1
- import { ComputedRef, Ref, VNodeChild, StyleValue, UnwrapNestedRefs } from 'vue';
1
+ import { ComputedRef, Ref, Component, StyleValue, UnwrapNestedRefs } from 'vue';
2
2
  import { FormItemAttrOptions } from '../hooks/attr/attr.FormItem';
3
3
  import { LayoutFormItemProps } from './layout.formItem';
4
4
  import { FormLayoutProps } from './layout';
@@ -11,7 +11,7 @@ export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps
11
11
  /**不进行样式渲染*/
12
12
  noStyle?: boolean;
13
13
  /**输入框组件*/
14
- input?: VNodeChild;
14
+ input?: Component | string;
15
15
  }
16
16
  export interface FormProps<T = any> extends FormLayoutProps {
17
17
  form?: FormInstanceBase;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const form_vue_vue_type_script_setup_true_lang = require("./form.vue.js");
4
+ exports.default = form_vue_vue_type_script_setup_true_lang.default;
package/lib/form/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index_vue_vue_type_script_setup_true_lang = require("./index.vue.js");
3
+ const form_vue_vue_type_script_setup_true_lang = require("./form.vue.js");
4
4
  const withInstall = require("../utils/withInstall.js");
5
- const Form = withInstall.withInstall(index_vue_vue_type_script_setup_true_lang.default);
5
+ const Form = withInstall.withInstall(form_vue_vue_type_script_setup_true_lang.default);
6
6
  exports.Form = Form;
@@ -13,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
13
13
  ...__default__,
14
14
  props: {
15
15
  noStyle: { type: Boolean },
16
- input: { type: [Object, String, Number, Boolean, null, Array] },
16
+ input: {},
17
17
  dependencies: {},
18
18
  noticeOnlyRuleDataField: {},
19
19
  isNoticeParentField: { type: Boolean },
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
12
  ...__default__,
13
13
  props: {
14
14
  noStyle: { type: Boolean },
15
- input: { type: [Object, String, Number, Boolean, null, Array] },
15
+ input: {},
16
16
  dependencies: {},
17
17
  noticeOnlyRuleDataField: {},
18
18
  isNoticeParentField: { type: Boolean },
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
12
  ...__default__,
13
13
  props: {
14
14
  noStyle: { type: Boolean },
15
- input: { type: [Object, String, Number, Boolean, null, Array] },
15
+ input: {},
16
16
  dependencies: {},
17
17
  noticeOnlyRuleDataField: {},
18
18
  isNoticeParentField: { type: Boolean },