@carefrees/form-utils-vue 0.0.11 → 0.0.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.
Files changed (176) hide show
  1. package/README.md +104 -2
  2. package/assets/index.css +23 -12
  3. package/esm/component.js +3 -0
  4. package/esm/form/form.js +161 -0
  5. package/esm/form/form.vue.d.ts +10 -7
  6. package/esm/form/index.d.ts +12 -12
  7. package/esm/form/index.js +4 -0
  8. package/esm/formItem/form.Item.base.js +157 -0
  9. package/esm/formItem/form.Item.base.vue.d.ts +7 -8
  10. package/esm/formItem/form.hide.item.js +122 -0
  11. package/esm/formItem/form.hide.item.vue.d.ts +7 -8
  12. package/esm/formItem/formItem.js +151 -0
  13. package/esm/formItem/formItem.vue.d.ts +6 -9
  14. package/esm/formItem/index.d.ts +26 -37
  15. package/esm/formItem/index.js +8 -0
  16. package/esm/index.d.ts +2 -2
  17. package/esm/index.js +13 -0
  18. package/esm/interface/index.d.ts +6 -11
  19. package/esm/interface/index.js +0 -0
  20. package/esm/interface/layout.d.ts +1 -1
  21. package/esm/interface/layout.formItem.d.ts +1 -1
  22. package/esm/interface/layout.formItem.js +0 -0
  23. package/esm/interface/layout.js +0 -0
  24. package/esm/layout/index.d.ts +24 -33
  25. package/esm/layout/index.js +8 -0
  26. package/esm/layout/layout.form.rows.js +21 -0
  27. package/esm/layout/layout.form.rows.vue.d.ts +8 -5
  28. package/esm/layout/layout.formItem.js +195 -0
  29. package/esm/layout/layout.formItem.vue.d.ts +6 -9
  30. package/esm/layout/layout.js +160 -0
  31. package/esm/layout/layout.vue.d.ts +6 -8
  32. package/esm/utils/index.js +1 -0
  33. package/esm/utils/withInstall.d.ts +2 -2
  34. package/esm/utils/withInstall.js +15 -0
  35. package/package.json +7 -8
  36. package/src/form/form.vue +21 -7
  37. package/src/formItem/form.Item.base.vue +5 -5
  38. package/src/formItem/form.hide.item.vue +3 -1
  39. package/src/formItem/formItem.vue +2 -1
  40. package/src/index.ts +1 -1
  41. package/src/interface/index.ts +6 -13
  42. package/src/interface/layout.formItem.ts +1 -2
  43. package/src/interface/layout.ts +2 -1
  44. package/src/layout/layout.formItem.vue +2 -1
  45. package/src/layout/layout.vue +2 -1
  46. package/esm/component.mjs +0 -12
  47. package/esm/form/form.vue.mjs +0 -110
  48. package/esm/form/form.vue2.mjs +0 -4
  49. package/esm/form/index.mjs +0 -6
  50. package/esm/formItem/form.Item.base.vue.mjs +0 -114
  51. package/esm/formItem/form.Item.base.vue2.mjs +0 -4
  52. package/esm/formItem/form.hide.item.vue.mjs +0 -78
  53. package/esm/formItem/form.hide.item.vue2.mjs +0 -4
  54. package/esm/formItem/formItem.vue.mjs +0 -102
  55. package/esm/formItem/formItem.vue2.mjs +0 -4
  56. package/esm/formItem/index.mjs +0 -12
  57. package/esm/hooks/attr/attr.FormItem.d.ts +0 -97
  58. package/esm/hooks/attr/attr.FormItem.mjs +0 -120
  59. package/esm/hooks/index.d.ts +0 -13
  60. package/esm/hooks/register/register.FormHideItem.d.ts +0 -9
  61. package/esm/hooks/register/register.FormHideItem.mjs +0 -38
  62. package/esm/hooks/register/register.FormItem.d.ts +0 -23
  63. package/esm/hooks/register/register.FormItem.mjs +0 -55
  64. package/esm/hooks/register/register.FormList.d.ts +0 -9
  65. package/esm/hooks/register/register.FormList.mjs +0 -43
  66. package/esm/hooks/register/register.form.d.ts +0 -3
  67. package/esm/hooks/register/register.form.mjs +0 -12
  68. package/esm/hooks/useAttrs.d.ts +0 -24
  69. package/esm/hooks/useAttrs.mjs +0 -43
  70. package/esm/hooks/useEffect.d.ts +0 -2
  71. package/esm/hooks/useEffect.mjs +0 -14
  72. package/esm/hooks/useForm.d.ts +0 -8
  73. package/esm/hooks/useForm.mjs +0 -26
  74. package/esm/hooks/useFormItem.d.ts +0 -7
  75. package/esm/hooks/useFormItem.mjs +0 -26
  76. package/esm/hooks/useFormItemParentName.d.ts +0 -18
  77. package/esm/hooks/useFormItemParentName.mjs +0 -37
  78. package/esm/hooks/useFormList.d.ts +0 -7
  79. package/esm/hooks/useFormList.mjs +0 -26
  80. package/esm/hooks/useHtmlFor.d.ts +0 -2
  81. package/esm/hooks/useHtmlFor.mjs +0 -11
  82. package/esm/hooks/useMultipleForm.d.ts +0 -7
  83. package/esm/hooks/useMultipleForm.mjs +0 -27
  84. package/esm/index.mjs +0 -59
  85. package/esm/instance/ruleIntsnace.d.ts +0 -49
  86. package/esm/instance/ruleIntsnace.mjs +0 -73
  87. package/esm/layout/index.mjs +0 -12
  88. package/esm/layout/layout.form.rows.vue.mjs +0 -31
  89. package/esm/layout/layout.form.rows.vue2.mjs +0 -4
  90. package/esm/layout/layout.formItem.vue.mjs +0 -216
  91. package/esm/layout/layout.formItem.vue2.mjs +0 -4
  92. package/esm/layout/layout.vue.mjs +0 -166
  93. package/esm/layout/layout.vue2.mjs +0 -4
  94. package/esm/utils/withInstall.mjs +0 -22
  95. package/lib/component.d.ts +0 -3
  96. package/lib/component.js +0 -12
  97. package/lib/form/form.vue.d.ts +0 -19
  98. package/lib/form/form.vue.js +0 -110
  99. package/lib/form/form.vue2.js +0 -4
  100. package/lib/form/index.d.ts +0 -37
  101. package/lib/form/index.js +0 -6
  102. package/lib/formItem/form.Item.base.vue.d.ts +0 -16
  103. package/lib/formItem/form.Item.base.vue.js +0 -114
  104. package/lib/formItem/form.Item.base.vue2.js +0 -4
  105. package/lib/formItem/form.hide.item.vue.d.ts +0 -16
  106. package/lib/formItem/form.hide.item.vue.js +0 -78
  107. package/lib/formItem/form.hide.item.vue2.js +0 -4
  108. package/lib/formItem/formItem.vue.d.ts +0 -18
  109. package/lib/formItem/formItem.vue.js +0 -102
  110. package/lib/formItem/formItem.vue2.js +0 -4
  111. package/lib/formItem/index.d.ts +0 -71
  112. package/lib/formItem/index.js +0 -12
  113. package/lib/hooks/attr/attr.FormItem.d.ts +0 -97
  114. package/lib/hooks/attr/attr.FormItem.js +0 -120
  115. package/lib/hooks/index.d.ts +0 -13
  116. package/lib/hooks/register/register.FormHideItem.d.ts +0 -9
  117. package/lib/hooks/register/register.FormHideItem.js +0 -38
  118. package/lib/hooks/register/register.FormItem.d.ts +0 -23
  119. package/lib/hooks/register/register.FormItem.js +0 -55
  120. package/lib/hooks/register/register.FormList.d.ts +0 -9
  121. package/lib/hooks/register/register.FormList.js +0 -43
  122. package/lib/hooks/register/register.form.d.ts +0 -3
  123. package/lib/hooks/register/register.form.js +0 -12
  124. package/lib/hooks/useAttrs.d.ts +0 -24
  125. package/lib/hooks/useAttrs.js +0 -43
  126. package/lib/hooks/useEffect.d.ts +0 -2
  127. package/lib/hooks/useEffect.js +0 -14
  128. package/lib/hooks/useForm.d.ts +0 -8
  129. package/lib/hooks/useForm.js +0 -26
  130. package/lib/hooks/useFormItem.d.ts +0 -7
  131. package/lib/hooks/useFormItem.js +0 -26
  132. package/lib/hooks/useFormItemParentName.d.ts +0 -18
  133. package/lib/hooks/useFormItemParentName.js +0 -37
  134. package/lib/hooks/useFormList.d.ts +0 -7
  135. package/lib/hooks/useFormList.js +0 -26
  136. package/lib/hooks/useHtmlFor.d.ts +0 -2
  137. package/lib/hooks/useHtmlFor.js +0 -11
  138. package/lib/hooks/useMultipleForm.d.ts +0 -7
  139. package/lib/hooks/useMultipleForm.js +0 -27
  140. package/lib/index.d.ts +0 -11
  141. package/lib/index.js +0 -59
  142. package/lib/instance/ruleIntsnace.d.ts +0 -49
  143. package/lib/instance/ruleIntsnace.js +0 -73
  144. package/lib/interface/index.d.ts +0 -36
  145. package/lib/interface/layout.d.ts +0 -28
  146. package/lib/interface/layout.formItem.d.ts +0 -39
  147. package/lib/layout/index.d.ts +0 -65
  148. package/lib/layout/index.js +0 -12
  149. package/lib/layout/layout.form.rows.vue.d.ts +0 -10
  150. package/lib/layout/layout.form.rows.vue.js +0 -31
  151. package/lib/layout/layout.form.rows.vue2.js +0 -4
  152. package/lib/layout/layout.formItem.vue.d.ts +0 -18
  153. package/lib/layout/layout.formItem.vue.js +0 -216
  154. package/lib/layout/layout.formItem.vue2.js +0 -4
  155. package/lib/layout/layout.vue.d.ts +0 -16
  156. package/lib/layout/layout.vue.js +0 -166
  157. package/lib/layout/layout.vue2.js +0 -4
  158. package/lib/utils/index.d.ts +0 -1
  159. package/lib/utils/withInstall.d.ts +0 -3
  160. package/lib/utils/withInstall.js +0 -22
  161. package/src/hooks/attr/attr.FormItem.tsx +0 -174
  162. package/src/hooks/index.ts +0 -13
  163. package/src/hooks/register/register.FormHideItem.ts +0 -45
  164. package/src/hooks/register/register.FormItem.ts +0 -80
  165. package/src/hooks/register/register.FormList.ts +0 -49
  166. package/src/hooks/register/register.form.ts +0 -12
  167. package/src/hooks/useAttrs.ts +0 -64
  168. package/src/hooks/useEffect.ts +0 -13
  169. package/src/hooks/useForm.ts +0 -28
  170. package/src/hooks/useFormItem.ts +0 -28
  171. package/src/hooks/useFormItemParentName.ts +0 -49
  172. package/src/hooks/useFormList.ts +0 -28
  173. package/src/hooks/useHtmlFor.ts +0 -9
  174. package/src/hooks/useMultipleForm.ts +0 -29
  175. package/src/instance/ruleIntsnace.ts +0 -105
  176. package/src/vite-env.d.ts +0 -1
@@ -0,0 +1,122 @@
1
+ import { createBlock, createCommentVNode, createSlots, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, unref, useSlots, withCtx } from "vue";
2
+ import form_Item_base from "./form.Item.base.js";
3
+ import { useRegisterFormHideItem } from "@carefrees/form-utils-vue-hooks";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ name: "FormHideItem",
6
+ inheritAttrs: false,
7
+ __name: "form.hide.item",
8
+ props: {
9
+ noStyle: {
10
+ type: Boolean
11
+ },
12
+ input: {},
13
+ dependencies: {},
14
+ noticeOnlyRuleDataField: {},
15
+ preserve: {
16
+ type: Boolean
17
+ },
18
+ useRules: {},
19
+ useAttrs: {},
20
+ inputAttrs: {},
21
+ valuePropName: {},
22
+ getValuePath: {},
23
+ getValueFromEvent: {},
24
+ formatValue: {},
25
+ onAfterUpdate: {},
26
+ trigger: {},
27
+ name: {},
28
+ rules: {},
29
+ sort: {},
30
+ isJoinParentField: {
31
+ type: Boolean
32
+ },
33
+ errorLayout: {},
34
+ required: {
35
+ type: Boolean
36
+ },
37
+ labelMode: {},
38
+ onlyRuleStyle: {
39
+ type: Boolean
40
+ },
41
+ label: {
42
+ type: [
43
+ Object,
44
+ String,
45
+ Number,
46
+ Boolean,
47
+ null,
48
+ Array
49
+ ]
50
+ },
51
+ helpText: {
52
+ type: [
53
+ Object,
54
+ String,
55
+ Number,
56
+ Boolean,
57
+ null,
58
+ Array
59
+ ]
60
+ },
61
+ extra: {
62
+ type: [
63
+ Object,
64
+ String,
65
+ Number,
66
+ Boolean,
67
+ null,
68
+ Array
69
+ ]
70
+ },
71
+ showColon: {
72
+ type: Boolean
73
+ },
74
+ colSpan: {},
75
+ rowSpan: {},
76
+ htmlFor: {},
77
+ validateResult: {},
78
+ style: {
79
+ type: [
80
+ Boolean,
81
+ null,
82
+ String,
83
+ Object,
84
+ Array
85
+ ]
86
+ },
87
+ class: {},
88
+ labelStyle: {
89
+ type: [
90
+ Boolean,
91
+ null,
92
+ String,
93
+ Object,
94
+ Array
95
+ ]
96
+ },
97
+ labelClass: {}
98
+ },
99
+ setup (__props) {
100
+ const props = __props;
101
+ const slots = useSlots();
102
+ const { isHide } = useRegisterFormHideItem({
103
+ name: props.name,
104
+ sort: props.sort,
105
+ isJoinParentField: props.isJoinParentField
106
+ });
107
+ return (_ctx, _cache)=>unref(isHide) ? createCommentVNode("", true) : (openBlock(), createBlock(form_Item_base, normalizeProps(mergeProps({
108
+ key: 0
109
+ }, props)), createSlots({
110
+ _: 2
111
+ }, [
112
+ renderList(slots, (item, name)=>({
113
+ name,
114
+ fn: withCtx((slotProps)=>[
115
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
116
+ ])
117
+ }))
118
+ ]), 1040));
119
+ }
120
+ });
121
+ const form_hide_item = _sfc_main;
122
+ export { form_hide_item as default };
@@ -1,15 +1,14 @@
1
- import { FormItemProps } from '../interface/index';
2
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<FormItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<{
1
+ import type { FormItemProps } from "../interface/index";
2
+ type __VLS_Slots = {
3
3
  label: (params: any) => any;
4
+ default: (params: any) => any;
4
5
  helpText: (params: any) => any;
5
6
  extra: (params: any) => any;
6
- }> & {
7
- label: (params: any) => any;
8
- helpText: (params: any) => any;
9
- extra: (params: any) => any;
10
- }>;
7
+ };
8
+ declare const __VLS_component: import("vue").DefineComponent<FormItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
10
  export default _default;
12
- type __VLS_WithTemplateSlots<T, S> = T & {
11
+ type __VLS_WithSlots<T, S> = T & {
13
12
  new (): {
14
13
  $slots: S;
15
14
  };
@@ -0,0 +1,151 @@
1
+ import { createBlock, createSlots, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, renderList, renderSlot, useSlots, withCtx } from "vue";
2
+ import layout_formItem from "../layout/layout.formItem.js";
3
+ import form_Item_base from "./form.Item.base.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ name: "FormItem",
6
+ inheritAttrs: false,
7
+ __name: "formItem",
8
+ props: {
9
+ noStyle: {
10
+ type: Boolean
11
+ },
12
+ input: {},
13
+ dependencies: {},
14
+ noticeOnlyRuleDataField: {},
15
+ preserve: {
16
+ type: Boolean
17
+ },
18
+ useRules: {},
19
+ useAttrs: {},
20
+ inputAttrs: {},
21
+ valuePropName: {},
22
+ getValuePath: {},
23
+ getValueFromEvent: {},
24
+ formatValue: {},
25
+ onAfterUpdate: {},
26
+ trigger: {},
27
+ name: {},
28
+ rules: {},
29
+ sort: {},
30
+ isJoinParentField: {
31
+ type: Boolean
32
+ },
33
+ errorLayout: {},
34
+ required: {
35
+ type: Boolean
36
+ },
37
+ labelMode: {},
38
+ onlyRuleStyle: {
39
+ type: Boolean
40
+ },
41
+ label: {
42
+ type: [
43
+ Object,
44
+ String,
45
+ Number,
46
+ Boolean,
47
+ null,
48
+ Array
49
+ ]
50
+ },
51
+ helpText: {
52
+ type: [
53
+ Object,
54
+ String,
55
+ Number,
56
+ Boolean,
57
+ null,
58
+ Array
59
+ ]
60
+ },
61
+ extra: {
62
+ type: [
63
+ Object,
64
+ String,
65
+ Number,
66
+ Boolean,
67
+ null,
68
+ Array
69
+ ]
70
+ },
71
+ showColon: {
72
+ type: Boolean
73
+ },
74
+ colSpan: {},
75
+ rowSpan: {},
76
+ htmlFor: {},
77
+ validateResult: {},
78
+ style: {
79
+ type: [
80
+ Boolean,
81
+ null,
82
+ String,
83
+ Object,
84
+ Array
85
+ ]
86
+ },
87
+ class: {},
88
+ labelStyle: {
89
+ type: [
90
+ Boolean,
91
+ null,
92
+ String,
93
+ Object,
94
+ Array
95
+ ]
96
+ },
97
+ labelClass: {}
98
+ },
99
+ setup (__props) {
100
+ const props = __props;
101
+ const slots = useSlots();
102
+ return (_ctx, _cache)=>props.name ? (openBlock(), createBlock(form_Item_base, normalizeProps(mergeProps({
103
+ key: 0
104
+ }, props)), createSlots({
105
+ _: 2
106
+ }, [
107
+ renderList(slots, (_, name)=>({
108
+ name,
109
+ fn: withCtx((slotProps)=>[
110
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
111
+ ])
112
+ }))
113
+ ]), 1040)) : (openBlock(), createBlock(layout_formItem, {
114
+ key: 1,
115
+ label: props.label,
116
+ errorLayout: props.errorLayout,
117
+ labelMode: props.labelMode,
118
+ onlyRuleStyle: props.onlyRuleStyle,
119
+ showColon: props.showColon,
120
+ colSpan: props.colSpan,
121
+ rowSpan: props.rowSpan,
122
+ style: normalizeStyle(props.style),
123
+ class: normalizeClass(props.class),
124
+ labelStyle: props.labelStyle,
125
+ labelClass: props.labelClass
126
+ }, createSlots({
127
+ _: 2
128
+ }, [
129
+ renderList(slots, (_, name)=>({
130
+ name,
131
+ fn: withCtx((slotProps)=>[
132
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
133
+ ])
134
+ }))
135
+ ]), 1032, [
136
+ "label",
137
+ "errorLayout",
138
+ "labelMode",
139
+ "onlyRuleStyle",
140
+ "showColon",
141
+ "colSpan",
142
+ "rowSpan",
143
+ "style",
144
+ "class",
145
+ "labelStyle",
146
+ "labelClass"
147
+ ]));
148
+ }
149
+ });
150
+ const formItem = _sfc_main;
151
+ export { formItem as default };
@@ -1,17 +1,14 @@
1
- import { FormItemProps } from '../interface/index';
2
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Partial<FormItemProps>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Partial<FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<{
1
+ import type { FormItemProps } from "../interface/index";
2
+ type __VLS_Slots = {
3
3
  default: (params: any) => any;
4
4
  label: (params: any) => any;
5
5
  helpText: (params: any) => any;
6
6
  extra: (params: any) => any;
7
- }> & {
8
- default: (params: any) => any;
9
- label: (params: any) => any;
10
- helpText: (params: any) => any;
11
- extra: (params: any) => any;
12
- }>;
7
+ };
8
+ declare const __VLS_component: import("vue").DefineComponent<Partial<FormItemProps>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Partial<FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
13
10
  export default _default;
14
- type __VLS_WithTemplateSlots<T, S> = T & {
11
+ type __VLS_WithSlots<T, S> = T & {
15
12
  new (): {
16
13
  $slots: S;
17
14
  };
@@ -1,70 +1,59 @@
1
- export declare const FormItemBase: import('../utils').SFCWithInstall<{
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
1
+ export declare const FormItemBase: import("../utils").SFCWithInstall<{
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
3
  P: {};
4
4
  B: {};
5
5
  D: {};
6
6
  C: {};
7
7
  M: {};
8
8
  Defaults: {};
9
- }, Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
10
- __isFragment?: undefined;
11
- __isTeleport?: undefined;
12
- __isSuspense?: undefined;
13
- } & import('vue').ComponentOptionsBase<Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
14
- $slots: Readonly<{
15
- label: (params: any) => any;
16
- helpText: (params: any) => any;
17
- extra: (params: any) => any;
18
- }> & {
9
+ }, Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
10
+ __isFragment?: never;
11
+ __isTeleport?: never;
12
+ __isSuspense?: never;
13
+ } & import("vue").ComponentOptionsBase<Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
14
+ $slots: {
19
15
  label: (params: any) => any;
16
+ default: (params: any) => any;
20
17
  helpText: (params: any) => any;
21
18
  extra: (params: any) => any;
22
19
  };
23
20
  })> & Record<string, any>;
24
- export declare const FormItem: import('../utils').SFCWithInstall<{
25
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<Partial<import('..').FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
21
+ export declare const FormItem: import("../utils").SFCWithInstall<{
22
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<Partial<import("../index.js").FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
26
23
  P: {};
27
24
  B: {};
28
25
  D: {};
29
26
  C: {};
30
27
  M: {};
31
28
  Defaults: {};
32
- }, Readonly<Partial<import('..').FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, {}>;
33
- __isFragment?: undefined;
34
- __isTeleport?: undefined;
35
- __isSuspense?: undefined;
36
- } & import('vue').ComponentOptionsBase<Readonly<Partial<import('..').FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
37
- $slots: Readonly<{
38
- default: (params: any) => any;
39
- label: (params: any) => any;
40
- helpText: (params: any) => any;
41
- extra: (params: any) => any;
42
- }> & {
29
+ }, Readonly<Partial<import("../index.js").FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, {}>;
30
+ __isFragment?: never;
31
+ __isTeleport?: never;
32
+ __isSuspense?: never;
33
+ } & import("vue").ComponentOptionsBase<Readonly<Partial<import("../index.js").FormItemProps>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
34
+ $slots: {
43
35
  default: (params: any) => any;
44
36
  label: (params: any) => any;
45
37
  helpText: (params: any) => any;
46
38
  extra: (params: any) => any;
47
39
  };
48
40
  })> & Record<string, any>;
49
- export declare const FormHideItem: import('../utils').SFCWithInstall<{
50
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
41
+ export declare const FormHideItem: import("../utils").SFCWithInstall<{
42
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
51
43
  P: {};
52
44
  B: {};
53
45
  D: {};
54
46
  C: {};
55
47
  M: {};
56
48
  Defaults: {};
57
- }, Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
58
- __isFragment?: undefined;
59
- __isTeleport?: undefined;
60
- __isSuspense?: undefined;
61
- } & import('vue').ComponentOptionsBase<Readonly<import('..').FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
62
- $slots: Readonly<{
63
- label: (params: any) => any;
64
- helpText: (params: any) => any;
65
- extra: (params: any) => any;
66
- }> & {
49
+ }, Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
50
+ __isFragment?: never;
51
+ __isTeleport?: never;
52
+ __isSuspense?: never;
53
+ } & import("vue").ComponentOptionsBase<Readonly<import("../index.js").FormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
54
+ $slots: {
67
55
  label: (params: any) => any;
56
+ default: (params: any) => any;
68
57
  helpText: (params: any) => any;
69
58
  extra: (params: any) => any;
70
59
  };
@@ -0,0 +1,8 @@
1
+ import form_Item_base from "./form.Item.base.js";
2
+ import formItem from "./formItem.js";
3
+ import form_hide_item from "./form.hide.item.js";
4
+ import { withInstall } from "../utils/index.js";
5
+ const FormItemBase = withInstall(form_Item_base);
6
+ const FormItem = withInstall(formItem);
7
+ const FormHideItem = withInstall(form_hide_item);
8
+ export { FormHideItem, FormItem, FormItemBase };
package/esm/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { App } from 'vue';
2
- export * from './hooks';
1
+ export * from '@carefrees/form-utils-vue-hooks';
3
2
  export * from './component';
4
3
  export * from './utils';
5
4
  export * from './interface';
6
5
  export * from './interface/layout';
7
6
  export * from './interface/layout.formItem';
7
+ import { App } from 'vue';
8
8
  declare const _default: {
9
9
  install: (app: App) => void;
10
10
  };
package/esm/index.js ADDED
@@ -0,0 +1,13 @@
1
+ export * from "@carefrees/form-utils-vue-hooks";
2
+ export * from "./component.js";
3
+ export * from "./utils/index.js";
4
+ export * from "./interface/index.js";
5
+ export * from "./interface/layout.js";
6
+ export * from "./interface/layout.formItem.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__component_js_7f599402__ from "./component.js";
8
+ const src = {
9
+ install: (app)=>{
10
+ for(const c in __WEBPACK_EXTERNAL_MODULE__component_js_7f599402__)app.use(__WEBPACK_EXTERNAL_MODULE__component_js_7f599402__[c]);
11
+ }
12
+ };
13
+ export { src as default };
@@ -1,12 +1,7 @@
1
- import { ComputedRef, Ref, Component, StyleValue, UnwrapNestedRefs } from 'vue';
2
- import { FormItemAttrOptions } from '../hooks/attr/attr.FormItem';
1
+ import { Component, StyleValue, UnwrapNestedRefs } from 'vue';
3
2
  import { LayoutFormItemProps } from './layout.formItem';
4
3
  import { FormLayoutProps } from './layout';
5
- import { FormInstanceBase, ValidateErrorEntity } from '@carefrees/form-utils';
6
- export type ComputedRefBase<T> = ComputedRef<T> | Ref<T>;
7
- export type PartialComputedRefs<T> = {
8
- [K in keyof T]: ComputedRefBase<T[K]>;
9
- };
4
+ import type { FormInstanceBase, ValidateErrorEntity, FormItemAttrOptions } from '@carefrees/form-utils-vue-hooks';
10
5
  export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps {
11
6
  /**不进行样式渲染*/
12
7
  noStyle?: boolean;
@@ -14,13 +9,13 @@ export interface FormItemProps extends FormItemAttrOptions, LayoutFormItemProps
14
9
  input?: Component | string;
15
10
  }
16
11
  export interface FormProps<T = any> extends FormLayoutProps {
17
- form?: FormInstanceBase;
12
+ form?: FormInstanceBase<T>;
18
13
  style?: StyleValue;
19
14
  class?: string;
20
15
  layoutClass?: string;
21
16
  layoutStyle?: StyleValue;
22
17
  /**表单数据*/
23
- formData?: any;
18
+ formData?: Object;
24
19
  /**值更新触发*/
25
20
  onValuesChange?: (changedValues: Partial<T>, values: UnwrapNestedRefs<T>) => void;
26
21
  /**提交保存 验证成功*/
@@ -31,6 +26,6 @@ export interface FormProps<T = any> extends FormLayoutProps {
31
26
  hideData?: Record<string, boolean>;
32
27
  /**表单名称*/
33
28
  name?: string;
34
- /**隐藏规则校验*/
35
- hideRuleData?: Record<string, boolean>;
29
+ /**背景颜色*/
30
+ bgcolor?: string;
36
31
  }
File without changes
@@ -1,4 +1,4 @@
1
- import { AttrsOptions } from '../hooks/useAttrs';
1
+ import type { AttrsOptions } from '@carefrees/form-utils-vue-hooks';
2
2
  import { VNodeChild, StyleValue } from 'vue';
3
3
  export interface FormLayoutProps extends Omit<AttrsOptions, 'colCount'> {
4
4
  /**标题*/
@@ -1,5 +1,5 @@
1
1
  import { VNodeChild, StyleValue } from 'vue';
2
- import { ComputedRefBase } from '.';
2
+ import type { ComputedRefBase } from '@carefrees/form-utils-vue-hooks';
3
3
  export interface LayoutFormItemProps {
4
4
  /**规则校验失败错误提示位置*/
5
5
  errorLayout?: 'left-bottom' | 'right-bottom' | 'top-right' | 'top-left';
File without changes
File without changes
@@ -1,65 +1,56 @@
1
- export declare const Layout: import('../utils').SFCWithInstall<{
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
1
+ export declare const Layout: import("../utils").SFCWithInstall<{
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("../index.js").FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
3
  P: {};
4
4
  B: {};
5
5
  D: {};
6
6
  C: {};
7
7
  M: {};
8
8
  Defaults: {};
9
- }, Readonly<import('..').FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
10
- __isFragment?: undefined;
11
- __isTeleport?: undefined;
12
- __isSuspense?: undefined;
13
- } & import('vue').ComponentOptionsBase<Readonly<import('..').FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
14
- $slots: Readonly<{
15
- default: any;
16
- title: any;
17
- extra: any;
18
- }> & {
9
+ }, Readonly<import("../index.js").FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
10
+ __isFragment?: never;
11
+ __isTeleport?: never;
12
+ __isSuspense?: never;
13
+ } & import("vue").ComponentOptionsBase<Readonly<import("../index.js").FormLayoutProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
14
+ $slots: {
19
15
  default: any;
20
16
  title: any;
21
17
  extra: any;
22
18
  };
23
19
  })> & Record<string, any>;
24
- export declare const LayoutFormItem: import('../utils').SFCWithInstall<{
25
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
20
+ export declare const LayoutFormItem: import("../utils").SFCWithInstall<{
21
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("../index.js").LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
26
22
  P: {};
27
23
  B: {};
28
24
  D: {};
29
25
  C: {};
30
26
  M: {};
31
27
  Defaults: {};
32
- }, Readonly<import('..').LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
33
- __isFragment?: undefined;
34
- __isTeleport?: undefined;
35
- __isSuspense?: undefined;
36
- } & import('vue').ComponentOptionsBase<Readonly<import('..').LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
37
- $slots: Readonly<{
38
- default: any;
39
- label: any;
40
- helpText: any;
41
- extra: any;
42
- }> & {
28
+ }, Readonly<import("../index.js").LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
29
+ __isFragment?: never;
30
+ __isTeleport?: never;
31
+ __isSuspense?: never;
32
+ } & import("vue").ComponentOptionsBase<Readonly<import("../index.js").LayoutFormItemProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
33
+ $slots: {
43
34
  default: any;
44
35
  label: any;
45
36
  helpText: any;
46
37
  extra: any;
47
38
  };
48
39
  })> & Record<string, any>;
49
- export declare const FormLayoutRows: import('../utils').SFCWithInstall<{
50
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
40
+ export declare const FormLayoutRows: import("../utils").SFCWithInstall<{
41
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
51
42
  P: {};
52
43
  B: {};
53
44
  D: {};
54
45
  C: {};
55
46
  M: {};
56
47
  Defaults: {};
57
- }, Readonly<import('vue').HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, {}>;
58
- __isFragment?: undefined;
59
- __isTeleport?: undefined;
60
- __isSuspense?: undefined;
61
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
48
+ }, Readonly<import("vue").HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, {}>;
49
+ __isFragment?: never;
50
+ __isTeleport?: never;
51
+ __isSuspense?: never;
52
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").HTMLAttributes> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
62
53
  $slots: {
63
- default?(_: {}): any;
54
+ default?: (props: {}) => any;
64
55
  };
65
56
  })> & Record<string, any>;
@@ -0,0 +1,8 @@
1
+ import layout from "./layout.js";
2
+ import layout_formItem from "./layout.formItem.js";
3
+ import layout_form_rows from "./layout.form.rows.js";
4
+ import { withInstall } from "../utils/index.js";
5
+ const Layout = withInstall(layout);
6
+ const LayoutFormItem = withInstall(layout_formItem);
7
+ const FormLayoutRows = withInstall(layout_form_rows);
8
+ export { FormLayoutRows, Layout, LayoutFormItem };