jky-component-lib 0.0.37 → 0.0.45

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 (46) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +10 -0
  2. package/dist/es/components.d.ts +1 -0
  3. package/dist/es/components.js +4 -1
  4. package/dist/es/form/Form.vue.d.ts +237 -0
  5. package/dist/es/form/Form.vue.js +178 -0
  6. package/dist/es/form/Form.vue3.js +5 -0
  7. package/dist/es/form/FormItem.vue.d.ts +6 -0
  8. package/dist/es/form/FormItem.vue.js +243 -0
  9. package/dist/es/form/FormItem.vue3.js +5 -0
  10. package/dist/es/form/index.d.ts +4 -0
  11. package/dist/es/form/index.js +8 -0
  12. package/dist/es/form/style.css +14 -0
  13. package/dist/es/index.js +2 -0
  14. package/dist/es/menu/Aside.vue.d.ts +17 -0
  15. package/dist/es/menu/Aside.vue.js +26 -0
  16. package/dist/es/menu/Menu.vue.d.ts +6 -17
  17. package/dist/es/menu/Menu.vue.js +25 -7
  18. package/dist/es/package.json.js +1 -1
  19. package/dist/es/page-header/PageHeader.vue.js +1 -1
  20. package/dist/es/page-header/PopoverMenu.vue.d.ts +4 -3
  21. package/dist/es/page-header/PopoverMenu.vue.js +4 -4
  22. package/dist/es/style.css +165 -0
  23. package/dist/lib/_virtual/_plugin-vue_export-helper.js +10 -0
  24. package/dist/lib/components.d.ts +1 -0
  25. package/dist/lib/components.js +12 -9
  26. package/dist/lib/form/Form.vue.d.ts +237 -0
  27. package/dist/lib/form/Form.vue.js +178 -0
  28. package/dist/lib/form/Form.vue3.js +5 -0
  29. package/dist/lib/form/FormItem.vue.d.ts +6 -0
  30. package/dist/lib/form/FormItem.vue.js +243 -0
  31. package/dist/lib/form/FormItem.vue3.js +5 -0
  32. package/dist/lib/form/index.d.ts +4 -0
  33. package/dist/lib/form/index.js +8 -0
  34. package/dist/lib/form/style.css +14 -0
  35. package/dist/lib/index.js +8 -6
  36. package/dist/lib/menu/Aside.vue.d.ts +17 -0
  37. package/dist/lib/menu/Aside.vue.js +26 -0
  38. package/dist/lib/menu/Menu.vue.d.ts +6 -17
  39. package/dist/lib/menu/Menu.vue.js +24 -6
  40. package/dist/lib/package.json.js +1 -1
  41. package/dist/lib/page-header/PageHeader.vue.js +1 -1
  42. package/dist/lib/page-header/PopoverMenu.vue.d.ts +4 -3
  43. package/dist/lib/page-header/PopoverMenu.vue.js +4 -4
  44. package/dist/lib/style.css +165 -0
  45. package/dist/umd/index.js +637 -29
  46. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ const _export_sfc = (sfc, props) => {
2
+ const target = sfc.__vccOpts || sfc;
3
+ for (const [key, val] of props) {
4
+ target[key] = val;
5
+ }
6
+ return target;
7
+ };
8
+ export {
9
+ _export_sfc as default
10
+ };
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from 'vue';
2
2
  export * from './button';
3
3
  export * from './button-nav';
4
+ export * from './form';
4
5
  export * from './menu';
5
6
  export * from './page-header';
6
7
  export * from './say-hello';
@@ -1,5 +1,6 @@
1
1
  import { JkyButton } from "./button/index.js";
2
2
  import { JkyButtonNav } from "./button-nav/index.js";
3
+ import { JkyForm } from "./form/index.js";
3
4
  import { JkyMenu } from "./menu/index.js";
4
5
  import { JkyPageHeader } from "./page-header/index.js";
5
6
  import { JkySayHello } from "./say-hello/index.js";
@@ -8,11 +9,13 @@ const components = [
8
9
  JkyButton,
9
10
  JkyButtonNav,
10
11
  JkyPageHeader,
11
- JkyMenu
12
+ JkyMenu,
13
+ JkyForm
12
14
  ];
13
15
  export {
14
16
  JkyButton,
15
17
  JkyButtonNav,
18
+ JkyForm,
16
19
  JkyMenu,
17
20
  JkyPageHeader,
18
21
  JkySayHello,
@@ -0,0 +1,237 @@
1
+ import { FormProps } from './types';
2
+ type __VLS_Props = FormProps;
3
+ declare function validate(callback?: (isValid: boolean, invalidFields?: any) => void): Promise<boolean>;
4
+ declare function resetFields(): void;
5
+ declare function clearValidate(props?: any): void;
6
+ declare function getFormInstance(): ({
7
+ $: import('vue').ComponentInternalInstance;
8
+ $data: {};
9
+ $props: {
10
+ readonly model?: Record<string, any> | undefined;
11
+ readonly rules?: import('element-plus').FormRules | undefined;
12
+ readonly labelPosition?: "left" | "right" | "top" | undefined;
13
+ readonly requireAsteriskPosition?: "left" | "right" | undefined;
14
+ readonly labelWidth?: string | number | undefined;
15
+ readonly labelSuffix?: string | undefined;
16
+ readonly inline?: boolean | undefined;
17
+ readonly inlineMessage?: boolean | undefined;
18
+ readonly statusIcon?: boolean | undefined;
19
+ readonly showMessage?: boolean | undefined;
20
+ readonly validateOnRuleChange?: boolean | undefined;
21
+ readonly hideRequiredAsterisk?: boolean | undefined;
22
+ readonly scrollToError?: boolean | undefined;
23
+ readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
24
+ readonly size?: import('element-plus').ComponentSize | undefined;
25
+ readonly disabled?: boolean | undefined;
26
+ readonly onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
27
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
28
+ $attrs: import('vue').Attrs;
29
+ $refs: {
30
+ [x: string]: unknown;
31
+ };
32
+ $slots: Readonly<{
33
+ [name: string]: globalThis.Slot | undefined;
34
+ }>;
35
+ $root: ComponentPublicInstance | null;
36
+ $parent: ComponentPublicInstance | null;
37
+ $host: Element | null;
38
+ $emit: (event: "validate", prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
39
+ $el: any;
40
+ $options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').FormProps> & Readonly<{
41
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
42
+ }>, {
43
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
44
+ validateField: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
45
+ resetFields: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
46
+ clearValidate: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
47
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
48
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
49
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
50
+ setInitialValues: (initModel: Record<string, any>) => void;
51
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
52
+ validate: (prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
53
+ }, string, {
54
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
55
+ labelWidth: string | number;
56
+ labelPosition: "left" | "right" | "top";
57
+ requireAsteriskPosition: "left" | "right";
58
+ labelSuffix: string;
59
+ showMessage: boolean;
60
+ validateOnRuleChange: boolean;
61
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
62
+ beforeCreate?: (() => void) | (() => void)[];
63
+ created?: (() => void) | (() => void)[];
64
+ beforeMount?: (() => void) | (() => void)[];
65
+ mounted?: (() => void) | (() => void)[];
66
+ beforeUpdate?: (() => void) | (() => void)[];
67
+ updated?: (() => void) | (() => void)[];
68
+ activated?: (() => void) | (() => void)[];
69
+ deactivated?: (() => void) | (() => void)[];
70
+ beforeDestroy?: (() => void) | (() => void)[];
71
+ beforeUnmount?: (() => void) | (() => void)[];
72
+ destroyed?: (() => void) | (() => void)[];
73
+ unmounted?: (() => void) | (() => void)[];
74
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
75
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
76
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
77
+ };
78
+ $forceUpdate: () => void;
79
+ $nextTick: typeof import('vue').nextTick;
80
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
81
+ } & Readonly<{
82
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
83
+ labelWidth: string | number;
84
+ labelPosition: "left" | "right" | "top";
85
+ requireAsteriskPosition: "left" | "right";
86
+ labelSuffix: string;
87
+ showMessage: boolean;
88
+ validateOnRuleChange: boolean;
89
+ }> & Omit<Readonly<import('element-plus').FormProps> & Readonly<{
90
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
91
+ }>, "labelWidth" | "labelPosition" | "showMessage" | "validate" | "clearValidate" | "requireAsteriskPosition" | "labelSuffix" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validateField" | "resetFields" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & import('vue').ShallowUnwrapRef<{
92
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
93
+ validateField: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
94
+ resetFields: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
95
+ clearValidate: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
96
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
97
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
98
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
99
+ setInitialValues: (initModel: Record<string, any>) => void;
100
+ }> & {} & import('vue').ComponentCustomProperties & {} & {
101
+ $slots: {
102
+ default?: (props: {}) => any;
103
+ };
104
+ }) | undefined;
105
+ type __VLS_PublicProps = {
106
+ modelValue: Record<string, any>;
107
+ } & __VLS_Props;
108
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
109
+ validate: typeof validate;
110
+ resetFields: typeof resetFields;
111
+ clearValidate: typeof clearValidate;
112
+ getFormInstance: typeof getFormInstance;
113
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
114
+ change: (value: Record<string, any>) => any;
115
+ "update:modelValue": (value: Record<string, any>) => any;
116
+ validate: (result: {
117
+ valid: boolean;
118
+ fields?: any;
119
+ }) => any;
120
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
121
+ onChange?: ((value: Record<string, any>) => any) | undefined;
122
+ "onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
123
+ onValidate?: ((result: {
124
+ valid: boolean;
125
+ fields?: any;
126
+ }) => any) | undefined;
127
+ }>, {
128
+ size: import('element-plus').ComponentSize;
129
+ labelWidth: string | number;
130
+ labelPosition: "left" | "right" | "top";
131
+ showTitle: boolean;
132
+ gutter: number;
133
+ defaultSpan: number;
134
+ responsive: boolean;
135
+ watchDeep: boolean;
136
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
137
+ formRef: ({
138
+ $: import('vue').ComponentInternalInstance;
139
+ $data: {};
140
+ $props: {
141
+ readonly model?: Record<string, any> | undefined;
142
+ readonly rules?: import('element-plus').FormRules | undefined;
143
+ readonly labelPosition?: "left" | "right" | "top" | undefined;
144
+ readonly requireAsteriskPosition?: "left" | "right" | undefined;
145
+ readonly labelWidth?: string | number | undefined;
146
+ readonly labelSuffix?: string | undefined;
147
+ readonly inline?: boolean | undefined;
148
+ readonly inlineMessage?: boolean | undefined;
149
+ readonly statusIcon?: boolean | undefined;
150
+ readonly showMessage?: boolean | undefined;
151
+ readonly validateOnRuleChange?: boolean | undefined;
152
+ readonly hideRequiredAsterisk?: boolean | undefined;
153
+ readonly scrollToError?: boolean | undefined;
154
+ readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
155
+ readonly size?: import('element-plus').ComponentSize | undefined;
156
+ readonly disabled?: boolean | undefined;
157
+ readonly onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
158
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
159
+ $attrs: import('vue').Attrs;
160
+ $refs: {
161
+ [x: string]: unknown;
162
+ };
163
+ $slots: Readonly<{
164
+ [name: string]: globalThis.Slot | undefined;
165
+ }>;
166
+ $root: ComponentPublicInstance | null;
167
+ $parent: ComponentPublicInstance | null;
168
+ $host: Element | null;
169
+ $emit: (event: "validate", prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
170
+ $el: any;
171
+ $options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').FormProps> & Readonly<{
172
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
173
+ }>, {
174
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
175
+ validateField: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
176
+ resetFields: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
177
+ clearValidate: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
178
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
179
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
180
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
181
+ setInitialValues: (initModel: Record<string, any>) => void;
182
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
183
+ validate: (prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
184
+ }, string, {
185
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
186
+ labelWidth: string | number;
187
+ labelPosition: "left" | "right" | "top";
188
+ requireAsteriskPosition: "left" | "right";
189
+ labelSuffix: string;
190
+ showMessage: boolean;
191
+ validateOnRuleChange: boolean;
192
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
193
+ beforeCreate?: (() => void) | (() => void)[];
194
+ created?: (() => void) | (() => void)[];
195
+ beforeMount?: (() => void) | (() => void)[];
196
+ mounted?: (() => void) | (() => void)[];
197
+ beforeUpdate?: (() => void) | (() => void)[];
198
+ updated?: (() => void) | (() => void)[];
199
+ activated?: (() => void) | (() => void)[];
200
+ deactivated?: (() => void) | (() => void)[];
201
+ beforeDestroy?: (() => void) | (() => void)[];
202
+ beforeUnmount?: (() => void) | (() => void)[];
203
+ destroyed?: (() => void) | (() => void)[];
204
+ unmounted?: (() => void) | (() => void)[];
205
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
206
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
207
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
208
+ };
209
+ $forceUpdate: () => void;
210
+ $nextTick: typeof import('vue').nextTick;
211
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
212
+ } & Readonly<{
213
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
214
+ labelWidth: string | number;
215
+ labelPosition: "left" | "right" | "top";
216
+ requireAsteriskPosition: "left" | "right";
217
+ labelSuffix: string;
218
+ showMessage: boolean;
219
+ validateOnRuleChange: boolean;
220
+ }> & Omit<Readonly<import('element-plus').FormProps> & Readonly<{
221
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
222
+ }>, "labelWidth" | "labelPosition" | "showMessage" | "validate" | "clearValidate" | "requireAsteriskPosition" | "labelSuffix" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validateField" | "resetFields" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & import('vue').ShallowUnwrapRef<{
223
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
224
+ validateField: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
225
+ resetFields: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
226
+ clearValidate: (props?: import('element-plus/es/utils').Arrayable<import('element-plus').FormItemProp>) => void;
227
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
228
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
229
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
230
+ setInitialValues: (initModel: Record<string, any>) => void;
231
+ }> & {} & import('vue').ComponentCustomProperties & {} & {
232
+ $slots: {
233
+ default?: (props: {}) => any;
234
+ };
235
+ }) | null;
236
+ }, HTMLDivElement>;
237
+ export default _default;
@@ -0,0 +1,178 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __async = (__this, __arguments, generator) => {
21
+ return new Promise((resolve, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e) {
26
+ reject(e);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
40
+ import { defineComponent, useModel, ref, computed, watch, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, unref, mergeProps, withCtx, createElementVNode, normalizeStyle, Fragment, renderList, createBlock, mergeModels } from "vue";
41
+ import { ElForm } from "element-plus";
42
+ import _sfc_main$1 from "./FormItem.vue.js";
43
+ /* empty css */
44
+ const _hoisted_1 = {
45
+ key: 0,
46
+ class: "jky-form__title mb-4 text-xl font-semibold"
47
+ };
48
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
49
+ name: "JkyForm"
50
+ }), {
51
+ __name: "Form",
52
+ props: /* @__PURE__ */ mergeModels({
53
+ modelValue: {},
54
+ items: {},
55
+ showTitle: { type: Boolean, default: false },
56
+ title: {},
57
+ gutter: { default: 0 },
58
+ defaultSpan: { default: 24 },
59
+ responsive: { type: Boolean, default: true },
60
+ className: {},
61
+ readonly: { type: Boolean },
62
+ disabled: { type: Boolean },
63
+ watchDeep: { type: Boolean, default: true },
64
+ onValidate: {},
65
+ model: {},
66
+ rules: {},
67
+ labelPosition: { default: "right" },
68
+ requireAsteriskPosition: {},
69
+ labelWidth: { default: "100" },
70
+ labelSuffix: {},
71
+ inline: { type: Boolean },
72
+ inlineMessage: { type: Boolean },
73
+ statusIcon: { type: Boolean },
74
+ showMessage: { type: Boolean },
75
+ validateOnRuleChange: { type: Boolean },
76
+ hideRequiredAsterisk: { type: Boolean },
77
+ scrollToError: { type: Boolean },
78
+ scrollIntoViewOptions: { type: Boolean },
79
+ size: { default: "default" }
80
+ }, {
81
+ "modelValue": { required: true, default: () => ({}) },
82
+ "modelModifiers": {}
83
+ }),
84
+ emits: /* @__PURE__ */ mergeModels(["change", "validate"], ["update:modelValue"]),
85
+ setup(__props, { expose: __expose, emit: __emit }) {
86
+ const props = __props;
87
+ const emit = __emit;
88
+ const modelValue = useModel(__props, "modelValue");
89
+ const formRef = ref();
90
+ const formClass = computed(() => {
91
+ return [
92
+ "jky-form",
93
+ props.className
94
+ ].filter(Boolean).join(" ");
95
+ });
96
+ watch(
97
+ () => props.modelValue,
98
+ (newVal, oldVal) => {
99
+ if (newVal !== oldVal) {
100
+ emit("change", __spreadValues({}, newVal));
101
+ }
102
+ },
103
+ { deep: props.watchDeep }
104
+ );
105
+ function validate(callback) {
106
+ return __async(this, null, function* () {
107
+ var _a;
108
+ try {
109
+ yield (_a = formRef.value) == null ? void 0 : _a.validate();
110
+ emit("validate", { valid: true });
111
+ callback == null ? void 0 : callback(true, void 0);
112
+ return true;
113
+ } catch (error) {
114
+ emit("validate", { valid: false, fields: error.fields });
115
+ callback == null ? void 0 : callback(false, error.fields);
116
+ return false;
117
+ }
118
+ });
119
+ }
120
+ function resetFields() {
121
+ var _a;
122
+ (_a = formRef.value) == null ? void 0 : _a.resetFields();
123
+ }
124
+ function clearValidate(props2) {
125
+ var _a;
126
+ (_a = formRef.value) == null ? void 0 : _a.clearValidate(props2);
127
+ }
128
+ function getFormInstance() {
129
+ return formRef.value;
130
+ }
131
+ __expose({
132
+ validate,
133
+ resetFields,
134
+ clearValidate,
135
+ getFormInstance
136
+ });
137
+ return (_ctx, _cache) => {
138
+ return openBlock(), createElementBlock("div", {
139
+ class: normalizeClass(formClass.value)
140
+ }, [
141
+ __props.showTitle && __props.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
142
+ createVNode(unref(ElForm), mergeProps({
143
+ ref_key: "formRef",
144
+ ref: formRef,
145
+ model: modelValue.value,
146
+ "label-width": __props.labelWidth,
147
+ "label-position": __props.labelPosition,
148
+ size: __props.size
149
+ }, _ctx.$attrs), {
150
+ default: withCtx(() => [
151
+ createElementVNode("div", {
152
+ class: "grid",
153
+ style: normalizeStyle({
154
+ gridTemplateColumns: "repeat(12, minmax(0, 1fr))",
155
+ gap: `${__props.gutter}px`
156
+ })
157
+ }, [
158
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
159
+ return openBlock(), createBlock(_sfc_main$1, {
160
+ key: item.field,
161
+ field: item.field,
162
+ config: item,
163
+ model: modelValue.value,
164
+ readonly: __props.readonly,
165
+ disabled: __props.disabled
166
+ }, null, 8, ["field", "config", "model", "readonly", "disabled"]);
167
+ }), 128))
168
+ ], 4)
169
+ ]),
170
+ _: 1
171
+ }, 16, ["model", "label-width", "label-position", "size"])
172
+ ], 2);
173
+ };
174
+ }
175
+ }));
176
+ export {
177
+ _sfc_main as default
178
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./Form.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,6 @@
1
+ import { FormItemProps } from './types';
2
+ declare const _default: import('vue').DefineComponent<FormItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
3
+ disabled: boolean;
4
+ readonly: boolean;
5
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ export default _default;