twcpt 0.0.2 → 0.0.4

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 (75) hide show
  1. package/README.md +33 -4
  2. package/dist/charts.cjs.js +1 -1
  3. package/dist/charts.d.ts +0 -7
  4. package/dist/charts.es.js +1 -9
  5. package/dist/components/j-tw-btn/index.d.ts +51 -14
  6. package/dist/components/j-tw-btn/types.d.ts +19 -4
  7. package/dist/components/j-tw-checkbox/index.d.ts +230 -0
  8. package/dist/components/j-tw-checkbox/types.d.ts +35 -0
  9. package/dist/components/j-tw-checkbox-group/index.d.ts +309 -0
  10. package/dist/components/j-tw-checkbox-group/types.d.ts +38 -0
  11. package/dist/components/j-tw-confirm-dialog/index.d.ts +704 -0
  12. package/dist/components/j-tw-confirm-dialog/jwConfirmDialog.d.ts +2 -0
  13. package/dist/components/j-tw-confirm-dialog/types.d.ts +79 -0
  14. package/dist/components/j-tw-date-picker/index.d.ts +1645 -0
  15. package/dist/components/j-tw-date-picker/types.d.ts +162 -0
  16. package/dist/components/j-tw-dialog/index.d.ts +793 -0
  17. package/dist/components/j-tw-dialog/jwDialog.d.ts +38 -0
  18. package/dist/components/j-tw-dialog/types.d.ts +122 -0
  19. package/dist/components/j-tw-dropdown-btn/index.d.ts +3 -0
  20. package/dist/components/j-tw-dropdown-btn/types.d.ts +69 -0
  21. package/dist/components/j-tw-form/index.d.ts +368 -0
  22. package/dist/components/j-tw-form/types.d.ts +18 -0
  23. package/dist/components/j-tw-form-item/index.d.ts +248 -0
  24. package/dist/components/j-tw-form-item/types.d.ts +21 -0
  25. package/dist/components/j-tw-form-label/index.d.ts +66 -0
  26. package/dist/components/j-tw-input/index.d.ts +537 -0
  27. package/dist/components/j-tw-input/types.d.ts +76 -0
  28. package/dist/components/j-tw-messages/MessageItem.d.ts +84 -0
  29. package/dist/components/j-tw-messages/index.d.ts +110 -0
  30. package/dist/components/j-tw-messages/jwMessages.d.ts +2 -0
  31. package/dist/components/j-tw-messages/state.d.ts +23 -0
  32. package/dist/components/j-tw-messages/types.d.ts +31 -0
  33. package/dist/components/j-tw-radio/index.d.ts +168 -0
  34. package/dist/components/j-tw-radio/types.d.ts +29 -0
  35. package/dist/components/j-tw-radio-group/index.d.ts +244 -0
  36. package/dist/components/j-tw-radio-group/types.d.ts +37 -0
  37. package/dist/components/j-tw-status-img/index.d.ts +36 -0
  38. package/dist/components/j-tw-status-img/types.d.ts +3 -0
  39. package/dist/components/j-tw-table/index.d.ts +480 -0
  40. package/dist/components/j-tw-table/types.d.ts +157 -0
  41. package/dist/components/j-tw-tree-select/TreeNode.d.ts +124 -0
  42. package/dist/components/j-tw-tree-select/index.d.ts +292 -0
  43. package/dist/components/j-tw-tree-select/types.d.ts +110 -0
  44. package/dist/components/j-tw-tree-select-btn/TreeNode.d.ts +107 -0
  45. package/dist/components/j-tw-tree-select-btn/index.d.ts +1505 -0
  46. package/dist/components/j-tw-tree-select-btn/types.d.ts +104 -0
  47. package/dist/global.d.ts +128 -38
  48. package/dist/index.css +1 -1
  49. package/dist/index.d.ts +44 -8
  50. package/dist/shims-svg.d.ts +4 -0
  51. package/dist/twcpt-styles.css +1 -1
  52. package/dist/twcpt.cjs.js +12 -1
  53. package/dist/twcpt.es.js +4521 -1488
  54. package/dist/types.d.ts +1 -1
  55. package/dist/utils/init.d.ts +19 -0
  56. package/dist/utils/tool.d.ts +1 -1
  57. package/dist/utils/useBizRequest.d.ts +12 -0
  58. package/package.json +4 -4
  59. package/dist/charts-CKv8I1ye.js +0 -879
  60. package/dist/charts-DIdINgA4.cjs +0 -1
  61. package/dist/charts.css +0 -1
  62. package/dist/components/j-ch-bar/index.d.ts +0 -50
  63. package/dist/components/j-ch-bar/types.d.ts +0 -42
  64. package/dist/components/j-ch-bar-line/index.d.ts +0 -49
  65. package/dist/components/j-ch-bar-line/types.d.ts +0 -42
  66. package/dist/components/j-ch-bubble/index.d.ts +0 -54
  67. package/dist/components/j-ch-bubble/types.d.ts +0 -51
  68. package/dist/components/j-ch-line/index.d.ts +0 -57
  69. package/dist/components/j-ch-line/types.d.ts +0 -42
  70. package/dist/components/j-ch-pie-doughnut/index.d.ts +0 -60
  71. package/dist/components/j-ch-pie-doughnut/types.d.ts +0 -55
  72. package/dist/components/j-ch-radar/index.d.ts +0 -49
  73. package/dist/components/j-ch-radar/types.d.ts +0 -42
  74. package/dist/utils/chart.d.ts +0 -28
  75. package/dist/utils/website-config.d.ts +0 -15
@@ -0,0 +1,38 @@
1
+ import { JTWDialogRegisterProps, JTWDialogExpose } from './types';
2
+ interface DialogProviderOptions {
3
+ router?: any;
4
+ store?: any;
5
+ i18n?: any;
6
+ plugins?: any[];
7
+ locale?: any;
8
+ }
9
+ export interface DialogProviderType {
10
+ configure(options: DialogProviderOptions): void;
11
+ register(props: JTWDialogRegisterProps): Promise<JTWDialogExpose>;
12
+ destroy(dialogId: string): void;
13
+ destroyAll(): void;
14
+ }
15
+ export declare const DialogProvider: DialogProviderType;
16
+ /**
17
+ * 打开一个 dialog(center)或 drawer(right)
18
+ *
19
+ * @example
20
+ * // center dialog with async component
21
+ * const instance = await jwDialog({
22
+ * title: '生成报告',
23
+ * position: 'center',
24
+ * size: 'md',
25
+ * component: () => import('./MyForm.vue'),
26
+ * componentBind: { someData: 123 },
27
+ * });
28
+ *
29
+ * @example
30
+ * // right drawer
31
+ * const instance = await jwDialog({
32
+ * title: '详情',
33
+ * position: 'right',
34
+ * component: () => import('./DetailPanel.vue'),
35
+ * });
36
+ */
37
+ export declare function jwDialog(options: JTWDialogRegisterProps): Promise<JTWDialogExpose>;
38
+ export {};
@@ -0,0 +1,122 @@
1
+ import { DefineComponent } from 'vue';
2
+ /** Dialog 位置类型常量 */
3
+ export declare const JTWDialogPosition: {
4
+ readonly CENTER: "center";
5
+ readonly RIGHT: "right";
6
+ };
7
+ /** Dialog 宽度尺寸常量 */
8
+ export declare const JTWDialogSize: {
9
+ readonly SM: "sm";
10
+ readonly MD: "md";
11
+ readonly LG: "lg";
12
+ };
13
+ /** Footer 显示模式常量 */
14
+ export declare const JTWDialogFooterMode: {
15
+ readonly BOTH: "both";
16
+ readonly CANCEL_ONLY: "cancel-only";
17
+ readonly CONFIRM_ONLY: "confirm-only";
18
+ };
19
+ export type JTWDialogPositionType = (typeof JTWDialogPosition)[keyof typeof JTWDialogPosition];
20
+ export type JTWDialogSizeType = (typeof JTWDialogSize)[keyof typeof JTWDialogSize];
21
+ export type JTWDialogFooterModeType = (typeof JTWDialogFooterMode)[keyof typeof JTWDialogFooterMode];
22
+ /**
23
+ * @description jwDialog 调用选项
24
+ */
25
+ export interface JTWDialogOptions {
26
+ /**
27
+ * 弹窗标题
28
+ */
29
+ title?: string;
30
+ /**
31
+ * 位置:center = 居中对话框,right = 右侧抽屉
32
+ * @default 'center'
33
+ */
34
+ position?: JTWDialogPositionType;
35
+ /**
36
+ * 宽度尺寸(仅 center 模式有效):sm=480px, md=768px, lg=1280px
37
+ * @default 'md'
38
+ */
39
+ size?: JTWDialogSizeType;
40
+ /**
41
+ * 是否显示 Header
42
+ * @default true
43
+ */
44
+ showHeader?: boolean;
45
+ /**
46
+ * 是否显示 Footer
47
+ * @default true
48
+ */
49
+ showFooter?: boolean;
50
+ /**
51
+ * Footer 显示模式:both=都显示, cancel-only=只显示取消, confirm-only=只显示确认
52
+ * @default 'both'
53
+ */
54
+ footerMode?: JTWDialogFooterModeType;
55
+ /**
56
+ * 确认按钮文字
57
+ * @default '确定'
58
+ */
59
+ confirmText?: string;
60
+ /**
61
+ * 取消按钮文字
62
+ * @default '取消'
63
+ */
64
+ cancelText?: string;
65
+ /**
66
+ * 动态组件(async import)
67
+ */
68
+ component?: any;
69
+ /**
70
+ * 组件 Props
71
+ */
72
+ componentBind?: Record<string, any>;
73
+ /**
74
+ * 组件事件
75
+ */
76
+ componentOn?: Record<string, any>;
77
+ /**
78
+ * 点击遮罩是否关闭
79
+ * @default true
80
+ */
81
+ closeOnMask?: boolean;
82
+ /**
83
+ * 按 Esc 是否关闭
84
+ * @default true
85
+ */
86
+ closeOnEsc?: boolean;
87
+ }
88
+ /**
89
+ * @description JTWDialog 组件 Props
90
+ */
91
+ export interface JTWDialogProps {
92
+ dialogId?: string;
93
+ title?: string;
94
+ position?: JTWDialogPositionType;
95
+ size?: JTWDialogSizeType;
96
+ showHeader?: boolean;
97
+ showFooter?: boolean;
98
+ footerMode?: JTWDialogFooterModeType;
99
+ confirmText?: string;
100
+ cancelText?: string;
101
+ component?: any;
102
+ componentBind?: Record<string, any>;
103
+ componentOn?: Record<string, any>;
104
+ closeOnMask?: boolean;
105
+ closeOnEsc?: boolean;
106
+ }
107
+ /** JTWDialog Expose 接口 */
108
+ export interface JTWDialogExpose {
109
+ open: () => void;
110
+ close: () => void;
111
+ setLoading: (loading: boolean) => void;
112
+ changeCancelText: (text: string) => void;
113
+ changeConfirmText: (text: string) => void;
114
+ }
115
+ /** JTWDialog 组件类型定义 */
116
+ export type JTWDialogComponent = DefineComponent<JTWDialogProps>;
117
+ /** JTWDialog 实例类型 */
118
+ export type JTWDialogInstance = InstanceType<JTWDialogComponent>;
119
+ /** DialogProvider 注册选项(与 JTWDialogOptions 保持一致,内部多一个 dialogId) */
120
+ export interface JTWDialogRegisterProps extends JTWDialogOptions {
121
+ dialogId?: string;
122
+ }
@@ -0,0 +1,3 @@
1
+ import { default as JTWDropdownBtn } from './index';
2
+ export default JTWDropdownBtn;
3
+ export * from './types';
@@ -0,0 +1,69 @@
1
+ import { DefineComponent } from 'vue';
2
+ import { JTWBtnProps } from '../j-tw-btn/types';
3
+ /** 下拉选项 */
4
+ export interface JTWDropdownOption {
5
+ /** 选项唯一标识 */
6
+ value: string | number;
7
+ /** 选项显示文本 */
8
+ label: string;
9
+ /** 是否禁用 */
10
+ disabled?: boolean;
11
+ }
12
+ /**
13
+ * @description JTWDropdownBtn 下拉按钮组件
14
+ * 只支持 primary 颜色,不支持 color 属性
15
+ */
16
+ export interface JTWDropdownBtnProps extends Omit<JTWBtnProps, 'color'> {
17
+ /**
18
+ * 下拉选项列表
19
+ */
20
+ options?: JTWDropdownOption[];
21
+ /**
22
+ * 当前选中的值
23
+ */
24
+ modelValue?: string | number;
25
+ }
26
+ /** JTWDropdownBtn Emits 接口 */
27
+ export interface JTWDropdownBtnEmits {
28
+ (e: 'click', event: MouseEvent): void;
29
+ (e: 'update:modelValue', value: string | number): void;
30
+ (e: 'select', option: JTWDropdownOption): void;
31
+ }
32
+ /** JTWDropdownBtn Slots 接口 */
33
+ export interface JTWDropdownBtnSlots {
34
+ /** 默认插槽,按钮文本内容 */
35
+ default?: () => any;
36
+ /** 图标插槽 */
37
+ icon?: () => any;
38
+ /** 自定义加载图标插槽 */
39
+ loading?: () => any;
40
+ }
41
+ /** JTWDropdownBtn 暴露的方法 */
42
+ export interface JTWDropdownBtnExpose {
43
+ /** 按钮根元素 */
44
+ $el: HTMLElement | undefined;
45
+ /** 触发点击 */
46
+ click: () => void;
47
+ /** 打开下拉菜单 */
48
+ openDropdown: () => void;
49
+ /** 关闭下拉菜单 */
50
+ closeDropdown: () => void;
51
+ }
52
+ /** Emits 配置对象格式 */
53
+ export type JTWDropdownBtnEmitsOptions = {
54
+ click: (e: MouseEvent) => true;
55
+ 'update:modelValue': (value: string | number) => true;
56
+ select: (option: JTWDropdownOption) => true;
57
+ };
58
+ /** JTWDropdownBtn 组件类型定义 */
59
+ export type JTWDropdownBtnComponent = DefineComponent<JTWDropdownBtnProps, JTWDropdownBtnExpose, {}, {}, {}, {}, {}, JTWDropdownBtnEmitsOptions>;
60
+ /** JTWDropdownBtn 实例类型 */
61
+ export type JTWDropdownBtnInstance = InstanceType<JTWDropdownBtnComponent> & JTWDropdownBtnExpose;
62
+ /** JTWDropdownBtn 模板 Props(用于全局类型声明) */
63
+ export interface JTWDropdownBtnTemplateProps extends JTWDropdownBtnProps {
64
+ onClick?: (event: MouseEvent) => void;
65
+ 'onUpdate:modelValue'?: (value: string | number) => void;
66
+ onSelect?: (option: JTWDropdownOption) => void;
67
+ class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
68
+ style?: string | Record<string, string>;
69
+ }
@@ -0,0 +1,368 @@
1
+ import { DefineComponent, Ref, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Attrs, Slot, ComponentPublicInstance, ComponentOptionsBase, Reactive, ComponentOptionsMixin, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, PublicProps, CreateComponentPublicInstanceWithMixins, ObjectPlugin, ComputedRef } from 'vue';
2
+ import { FormRules, ComponentSize, FormItemProp, FormProps, FormValidateCallback, FormValidationResult, FormItemContext, FormItemProps } from 'element-plus';
3
+ import { Arrayable } from 'element-plus/es/utils/typescript.mjs';
4
+ import { OnCleanup } from '@vue/reactivity';
5
+ declare const _default: DefineComponent<{}, {
6
+ elFormRef: Ref<({
7
+ $: ComponentInternalInstance;
8
+ $data: {};
9
+ $props: {
10
+ readonly model?: Record<string, any> | undefined;
11
+ readonly rules?: 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?: ComponentSize | undefined;
25
+ readonly disabled?: boolean | undefined;
26
+ readonly onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
27
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
28
+ $attrs: Attrs;
29
+ $refs: {
30
+ [x: string]: unknown;
31
+ };
32
+ $slots: Readonly<{
33
+ [name: string]: Slot<any> | undefined;
34
+ }>;
35
+ $root: ComponentPublicInstance | null;
36
+ $parent: ComponentPublicInstance | null;
37
+ $host: Element | null;
38
+ $emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
39
+ $el: any;
40
+ $options: ComponentOptionsBase<Readonly< FormProps> & Readonly<{
41
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
42
+ }>, {
43
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
44
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
45
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
46
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
47
+ scrollToField: (prop: FormItemProp) => void;
48
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
49
+ fields: Reactive< FormItemContext[]>;
50
+ setInitialValues: (initModel: Record<string, any>) => void;
51
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
52
+ validate: (prop: 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, {}, GlobalComponents, GlobalDirectives, string, 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: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
75
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: 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: nextTick;
80
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): 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< FormProps> & Readonly<{
90
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
91
+ }>, "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "showMessage" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & ShallowUnwrapRef<{
92
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
93
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
94
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
95
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
96
+ scrollToField: (prop: FormItemProp) => void;
97
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
98
+ fields: Reactive< FormItemContext[]>;
99
+ setInitialValues: (initModel: Record<string, any>) => void;
100
+ }> & {} & ComponentCustomProperties & {} & {
101
+ $slots: {
102
+ default?: (props: {}) => any;
103
+ };
104
+ }) | null, ({
105
+ $: ComponentInternalInstance;
106
+ $data: {};
107
+ $props: {
108
+ readonly model?: Record<string, any> | undefined;
109
+ readonly rules?: FormRules | undefined;
110
+ readonly labelPosition?: "left" | "right" | "top" | undefined;
111
+ readonly requireAsteriskPosition?: "left" | "right" | undefined;
112
+ readonly labelWidth?: string | number | undefined;
113
+ readonly labelSuffix?: string | undefined;
114
+ readonly inline?: boolean | undefined;
115
+ readonly inlineMessage?: boolean | undefined;
116
+ readonly statusIcon?: boolean | undefined;
117
+ readonly showMessage?: boolean | undefined;
118
+ readonly validateOnRuleChange?: boolean | undefined;
119
+ readonly hideRequiredAsterisk?: boolean | undefined;
120
+ readonly scrollToError?: boolean | undefined;
121
+ readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
122
+ readonly size?: ComponentSize | undefined;
123
+ readonly disabled?: boolean | undefined;
124
+ readonly onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
125
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
126
+ $attrs: Attrs;
127
+ $refs: {
128
+ [x: string]: unknown;
129
+ };
130
+ $slots: Readonly<{
131
+ [name: string]: Slot<any> | undefined;
132
+ }>;
133
+ $root: ComponentPublicInstance | null;
134
+ $parent: ComponentPublicInstance | null;
135
+ $host: Element | null;
136
+ $emit: (event: "validate", prop: FormItemProp, isValid: boolean, message: string) => void;
137
+ $el: any;
138
+ $options: ComponentOptionsBase<Readonly< FormProps> & Readonly<{
139
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
140
+ }>, {
141
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
142
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
143
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
144
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
145
+ scrollToField: (prop: FormItemProp) => void;
146
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
147
+ fields: Reactive< FormItemContext[]>;
148
+ setInitialValues: (initModel: Record<string, any>) => void;
149
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
150
+ validate: (prop: FormItemProp, isValid: boolean, message: string) => void;
151
+ }, string, {
152
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
153
+ labelWidth: string | number;
154
+ labelPosition: "left" | "right" | "top";
155
+ requireAsteriskPosition: "left" | "right";
156
+ labelSuffix: string;
157
+ showMessage: boolean;
158
+ validateOnRuleChange: boolean;
159
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
160
+ beforeCreate?: (() => void) | (() => void)[];
161
+ created?: (() => void) | (() => void)[];
162
+ beforeMount?: (() => void) | (() => void)[];
163
+ mounted?: (() => void) | (() => void)[];
164
+ beforeUpdate?: (() => void) | (() => void)[];
165
+ updated?: (() => void) | (() => void)[];
166
+ activated?: (() => void) | (() => void)[];
167
+ deactivated?: (() => void) | (() => void)[];
168
+ beforeDestroy?: (() => void) | (() => void)[];
169
+ beforeUnmount?: (() => void) | (() => void)[];
170
+ destroyed?: (() => void) | (() => void)[];
171
+ unmounted?: (() => void) | (() => void)[];
172
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
173
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
174
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
175
+ };
176
+ $forceUpdate: () => void;
177
+ $nextTick: nextTick;
178
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
179
+ } & Readonly<{
180
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
181
+ labelWidth: string | number;
182
+ labelPosition: "left" | "right" | "top";
183
+ requireAsteriskPosition: "left" | "right";
184
+ labelSuffix: string;
185
+ showMessage: boolean;
186
+ validateOnRuleChange: boolean;
187
+ }> & Omit<Readonly< FormProps> & Readonly<{
188
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
189
+ }>, "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "showMessage" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & ShallowUnwrapRef<{
190
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
191
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
192
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
193
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
194
+ scrollToField: (prop: FormItemProp) => void;
195
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
196
+ fields: Reactive< FormItemContext[]>;
197
+ setInitialValues: (initModel: Record<string, any>) => void;
198
+ }> & {} & ComponentCustomProperties & {} & {
199
+ $slots: {
200
+ default?: (props: {}) => any;
201
+ };
202
+ }) | null>;
203
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {
204
+ ElForm: {
205
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< FormProps> & Readonly<{
206
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
207
+ }>, {
208
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
209
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
210
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
211
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
212
+ scrollToField: (prop: FormItemProp) => void;
213
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
214
+ fields: Reactive< FormItemContext[]>;
215
+ setInitialValues: (initModel: Record<string, any>) => void;
216
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
217
+ validate: (prop: FormItemProp, isValid: boolean, message: string) => void;
218
+ }, PublicProps, {
219
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
220
+ labelWidth: string | number;
221
+ labelPosition: "left" | "right" | "top";
222
+ requireAsteriskPosition: "left" | "right";
223
+ labelSuffix: string;
224
+ showMessage: boolean;
225
+ validateOnRuleChange: boolean;
226
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
227
+ P: {};
228
+ B: {};
229
+ D: {};
230
+ C: {};
231
+ M: {};
232
+ Defaults: {};
233
+ }, Readonly< FormProps> & Readonly<{
234
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
235
+ }>, {
236
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
237
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
238
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
239
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
240
+ scrollToField: (prop: FormItemProp) => void;
241
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
242
+ fields: Reactive< FormItemContext[]>;
243
+ setInitialValues: (initModel: Record<string, any>) => void;
244
+ }, {}, {}, {}, {
245
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
246
+ labelWidth: string | number;
247
+ labelPosition: "left" | "right" | "top";
248
+ requireAsteriskPosition: "left" | "right";
249
+ labelSuffix: string;
250
+ showMessage: boolean;
251
+ validateOnRuleChange: boolean;
252
+ }>;
253
+ __isFragment?: never;
254
+ __isTeleport?: never;
255
+ __isSuspense?: never;
256
+ } & ComponentOptionsBase<Readonly< FormProps> & Readonly<{
257
+ onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
258
+ }>, {
259
+ validate: (callback?: FormValidateCallback) => FormValidationResult;
260
+ validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
261
+ resetFields: (props?: Arrayable<FormItemProp>) => void;
262
+ clearValidate: (props?: Arrayable<FormItemProp>) => void;
263
+ scrollToField: (prop: FormItemProp) => void;
264
+ getField: (prop: FormItemProp) => FormItemContext | undefined;
265
+ fields: Reactive< FormItemContext[]>;
266
+ setInitialValues: (initModel: Record<string, any>) => void;
267
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
268
+ validate: (prop: FormItemProp, isValid: boolean, message: string) => void;
269
+ }, string, {
270
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
271
+ labelWidth: string | number;
272
+ labelPosition: "left" | "right" | "top";
273
+ requireAsteriskPosition: "left" | "right";
274
+ labelSuffix: string;
275
+ showMessage: boolean;
276
+ validateOnRuleChange: boolean;
277
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
278
+ $slots: {
279
+ default?: (props: {}) => any;
280
+ };
281
+ }) & ObjectPlugin & {
282
+ setPropsDefaults: (defaults: Partial<{
283
+ readonly model?: Record<string, any> | undefined;
284
+ readonly rules?: FormRules | undefined;
285
+ readonly labelPosition?: "left" | "right" | "top" | undefined;
286
+ readonly requireAsteriskPosition?: "left" | "right" | undefined;
287
+ readonly labelWidth?: string | number | undefined;
288
+ readonly labelSuffix?: string | undefined;
289
+ readonly inline?: boolean | undefined;
290
+ readonly inlineMessage?: boolean | undefined;
291
+ readonly statusIcon?: boolean | undefined;
292
+ readonly showMessage?: boolean | undefined;
293
+ readonly validateOnRuleChange?: boolean | undefined;
294
+ readonly hideRequiredAsterisk?: boolean | undefined;
295
+ readonly scrollToError?: boolean | undefined;
296
+ readonly scrollIntoViewOptions?: (ScrollIntoViewOptions | boolean) | undefined;
297
+ readonly size?: ComponentSize | undefined;
298
+ readonly disabled?: boolean | undefined;
299
+ readonly onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
300
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps>) => void;
301
+ } & {
302
+ FormItem: {
303
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< FormItemProps> & Readonly<{}>, {
304
+ size: ComputedRef<"" | "default" | "large" | "small">;
305
+ validateMessage: Ref<string, string>;
306
+ validateState: Ref<"" | "error" | "success" | "validating", "" | "error" | "success" | "validating">;
307
+ validate: (trigger: string, callback?: FormValidateCallback) => FormValidationResult;
308
+ clearValidate: () => void;
309
+ resetField: () => void;
310
+ setInitialValue: (value: any) => void;
311
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
312
+ required: boolean;
313
+ labelPosition: "left" | "right" | "top" | "";
314
+ inlineMessage: boolean;
315
+ showMessage: boolean;
316
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
317
+ P: {};
318
+ B: {};
319
+ D: {};
320
+ C: {};
321
+ M: {};
322
+ Defaults: {};
323
+ }, Readonly< FormItemProps> & Readonly<{}>, {
324
+ size: ComputedRef<"" | "default" | "large" | "small">;
325
+ validateMessage: Ref<string, string>;
326
+ validateState: Ref<"" | "error" | "success" | "validating", "" | "error" | "success" | "validating">;
327
+ validate: (trigger: string, callback?: FormValidateCallback) => FormValidationResult;
328
+ clearValidate: () => void;
329
+ resetField: () => void;
330
+ setInitialValue: (value: any) => void;
331
+ }, {}, {}, {}, {
332
+ required: boolean;
333
+ labelPosition: "left" | "right" | "top" | "";
334
+ inlineMessage: boolean;
335
+ showMessage: boolean;
336
+ }>;
337
+ __isFragment?: never;
338
+ __isTeleport?: never;
339
+ __isSuspense?: never;
340
+ } & ComponentOptionsBase<Readonly< FormItemProps> & Readonly<{}>, {
341
+ size: ComputedRef<"" | "default" | "large" | "small">;
342
+ validateMessage: Ref<string, string>;
343
+ validateState: Ref<"" | "error" | "success" | "validating", "" | "error" | "success" | "validating">;
344
+ validate: (trigger: string, callback?: FormValidateCallback) => FormValidationResult;
345
+ clearValidate: () => void;
346
+ resetField: () => void;
347
+ setInitialValue: (value: any) => void;
348
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
349
+ required: boolean;
350
+ labelPosition: "left" | "right" | "top" | "";
351
+ inlineMessage: boolean;
352
+ showMessage: boolean;
353
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
354
+ $slots: {
355
+ label?: (props: {
356
+ label: string;
357
+ }) => any;
358
+ } & {
359
+ default?: (props: {}) => any;
360
+ } & {
361
+ error?: (props: {
362
+ error: string;
363
+ }) => any;
364
+ };
365
+ });
366
+ };
367
+ }, {}, string, ComponentProvideOptions, true, {}, any>;
368
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { DefineComponent } from 'vue';
2
+ import { FormProps, FormEmits, FormInstance } from 'element-plus';
3
+ export interface JTWFormProps extends FormProps {
4
+ }
5
+ export interface JTWFormEmits extends FormEmits {
6
+ }
7
+ export interface JTWFormSlots {
8
+ default?: () => any;
9
+ }
10
+ export interface JTWFormExpose {
11
+ validate: FormInstance['validate'];
12
+ validateField: FormInstance['validateField'];
13
+ resetFields: FormInstance['resetFields'];
14
+ scrollToField: FormInstance['scrollToField'];
15
+ clearValidate: FormInstance['clearValidate'];
16
+ }
17
+ export type JTWFormComponent = DefineComponent<JTWFormProps, JTWFormExpose, {}, {}, {}, {}, {}, JTWFormEmits>;
18
+ export type JTWFormInstance = InstanceType<JTWFormComponent> & JTWFormExpose;