@chase-shao/vue-component-lib 1.0.0 → 1.0.1

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 该函数用于创建一个异步的延迟操作,使程序暂停执行指定的毫秒数。
3
+ * @param tick - 延迟的毫秒数。
4
+ * @returns 一个 Promise,在指定的毫秒数后解析。
5
+ */
6
+ export declare const sleep: (tick: number) => Promise<unknown>;
7
+ /**
8
+ * async get data from store, if store ie empty load from remote.
9
+ * @param store Target Pinia store
10
+ * @param key Data key
11
+ * @param remoteFunction Remote load function
12
+ * @param defaultValue data default value
13
+ * @returns {Promise<*>}
14
+ */
15
+ export declare const getStoreData: (store: Record<string, any>, key: string, remoteFunction: Function, defaultValue?: undefined) => Promise<any>;
16
+ /**
17
+ * Pat a 0 to left if input string length is 1
18
+ * @param str
19
+ * @returns {string}
20
+ */
21
+ export declare const patLeft0: (str: any) => string;
22
+ /**
23
+ * Format date as input format.
24
+ * @param date input date
25
+ * @param format date format, default as 'yyyy-MM-dd hh:mm:ss'
26
+ * @returns {string|*}
27
+ */
28
+ export declare const dateFormatter: (date: Date | string, format?: string) => string;
@@ -0,0 +1,22 @@
1
+ import { ActionProps, ActionTypeEnum } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<ActionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
+ click: (type: ActionTypeEnum, url: string, redirectType: import('../../../types').RedirectType) => any;
13
+ }, string, import('vue').PublicProps, Readonly<ActionProps> & Readonly<{
14
+ onClick?: ((type: ActionTypeEnum, url: string, redirectType: import('../../../types').RedirectType) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
+ export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { ActionProps, ActionTypeEnum } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<ActionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
+ click: (type: ActionTypeEnum, url: string, redirectType: import('../../../types').RedirectType) => any;
13
+ }, string, import('vue').PublicProps, Readonly<ActionProps> & Readonly<{
14
+ onClick?: ((type: ActionTypeEnum, url: string, redirectType: import('../../../types').RedirectType) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
+ export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,13 @@
1
+ import { ActionConfig } from '../../../services/dataGen';
2
+ import { ActionTypeEnum } from './types';
3
+ import { RedirectType } from '../../../types';
4
+ type __VLS_Props = {
5
+ config: ActionConfig;
6
+ };
7
+ declare const RedirectType: import('vue').ComputedRef<RedirectType>;
8
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
9
+ click: (type: ActionTypeEnum, url: string, redirectType: RedirectType) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onClick?: ((type: ActionTypeEnum, url: string, redirectType: RedirectType) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { RedirectType } from '../../../types';
2
+ type ActionProps = {
3
+ url: string;
4
+ redirectType: RedirectType;
5
+ };
6
+ declare enum ActionTypeEnum {
7
+ Submit = 0,
8
+ Link = 1
9
+ }
10
+ type ActionEmits = {
11
+ (e: 'click', type: ActionTypeEnum, url: string, redirectType: RedirectType): void;
12
+ };
13
+ export type { ActionProps, ActionEmits };
14
+ export { ActionTypeEnum };
@@ -0,0 +1,220 @@
1
+ type __VLS_Props = {
2
+ className: string;
3
+ };
4
+ declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
6
+ slots: {
7
+ title?(_: {}): any;
8
+ content?(_: {}): any;
9
+ action?(_: {}): any;
10
+ };
11
+ refs: {
12
+ dataWidgetsRef: (import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
13
+ onChange?: ((value: any) => any) | undefined;
14
+ onError?: ((value: string) => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
16
+ }>, {
17
+ isFileUpload(): boolean;
18
+ submit(workflowId: number): void;
19
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ change: (value: any) => any;
21
+ error: (value: string) => any;
22
+ "update:modelValue": (value: any) => any;
23
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
24
+ widgetRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
25
+ onChange?: ((value: any) => any) | undefined;
26
+ onError?: ((value: string) => any) | undefined;
27
+ onInput?: ((value: any) => any) | undefined;
28
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
29
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ change: (value: any) => any;
31
+ error: (value: string) => any;
32
+ input: (value: any) => any;
33
+ "update:modelValue": (value: any) => any;
34
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
35
+ P: {};
36
+ B: {};
37
+ D: {};
38
+ C: {};
39
+ M: {};
40
+ Defaults: {};
41
+ }, Readonly<{}> & Readonly<{
42
+ onChange?: ((value: any) => any) | undefined;
43
+ onError?: ((value: string) => any) | undefined;
44
+ onInput?: ((value: any) => any) | undefined;
45
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
46
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
47
+ modelValue: string;
48
+ config: import('../../../services/dataGen').WidgetConfig;
49
+ }> & Readonly<{
50
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
51
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
52
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
53
+ change: (value?: string | number | null | undefined) => any;
54
+ "update:modelValue": (value?: string | number | null | undefined) => any;
55
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
56
+ P: {};
57
+ B: {};
58
+ D: {};
59
+ C: {};
60
+ M: {};
61
+ Defaults: {};
62
+ }, Readonly<{
63
+ modelValue: string;
64
+ config: import('../../../services/dataGen').WidgetConfig;
65
+ }> & Readonly<{
66
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
67
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
68
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
69
+ config: import('../../../services/dataGen').WidgetConfig;
70
+ }> & Readonly<{
71
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
72
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
73
+ }>, {
74
+ submit(workflowId: number): void;
75
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
76
+ change: (value?: string | number | null | undefined) => any;
77
+ "update:modelValue": (value?: string | number | null | undefined) => any;
78
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
79
+ uploadRef: any;
80
+ }, any, import('vue').ComponentProvideOptions, {
81
+ P: {};
82
+ B: {};
83
+ D: {};
84
+ C: {};
85
+ M: {};
86
+ Defaults: {};
87
+ }, Readonly<{
88
+ config: import('../../../services/dataGen').WidgetConfig;
89
+ }> & Readonly<{
90
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
91
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
92
+ }>, {
93
+ submit(workflowId: number): void;
94
+ }, {}, {}, {}, {}> | null;
95
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
96
+ P: {};
97
+ B: {};
98
+ D: {};
99
+ C: {};
100
+ M: {};
101
+ Defaults: {};
102
+ }, Readonly<{}> & Readonly<{
103
+ onChange?: ((value: any) => any) | undefined;
104
+ onError?: ((value: string) => any) | undefined;
105
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
106
+ }>, {
107
+ isFileUpload(): boolean;
108
+ submit(workflowId: number): void;
109
+ }, {}, {}, {}, {}> | null)[];
110
+ };
111
+ rootEl: HTMLDivElement;
112
+ };
113
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
114
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
115
+ dataWidgetsRef: (import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
116
+ onChange?: ((value: any) => any) | undefined;
117
+ onError?: ((value: string) => any) | undefined;
118
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
119
+ }>, {
120
+ isFileUpload(): boolean;
121
+ submit(workflowId: number): void;
122
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
123
+ change: (value: any) => any;
124
+ error: (value: string) => any;
125
+ "update:modelValue": (value: any) => any;
126
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
127
+ widgetRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
128
+ onChange?: ((value: any) => any) | undefined;
129
+ onError?: ((value: string) => any) | undefined;
130
+ onInput?: ((value: any) => any) | undefined;
131
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
132
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
133
+ change: (value: any) => any;
134
+ error: (value: string) => any;
135
+ input: (value: any) => any;
136
+ "update:modelValue": (value: any) => any;
137
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
138
+ P: {};
139
+ B: {};
140
+ D: {};
141
+ C: {};
142
+ M: {};
143
+ Defaults: {};
144
+ }, Readonly<{}> & Readonly<{
145
+ onChange?: ((value: any) => any) | undefined;
146
+ onError?: ((value: string) => any) | undefined;
147
+ onInput?: ((value: any) => any) | undefined;
148
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
149
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
150
+ modelValue: string;
151
+ config: import('../../../services/dataGen').WidgetConfig;
152
+ }> & Readonly<{
153
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
154
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
155
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
156
+ change: (value?: string | number | null | undefined) => any;
157
+ "update:modelValue": (value?: string | number | null | undefined) => any;
158
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
159
+ P: {};
160
+ B: {};
161
+ D: {};
162
+ C: {};
163
+ M: {};
164
+ Defaults: {};
165
+ }, Readonly<{
166
+ modelValue: string;
167
+ config: import('../../../services/dataGen').WidgetConfig;
168
+ }> & Readonly<{
169
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
170
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
171
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
172
+ config: import('../../../services/dataGen').WidgetConfig;
173
+ }> & Readonly<{
174
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
175
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
176
+ }>, {
177
+ submit(workflowId: number): void;
178
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
179
+ change: (value?: string | number | null | undefined) => any;
180
+ "update:modelValue": (value?: string | number | null | undefined) => any;
181
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
182
+ uploadRef: any;
183
+ }, any, import('vue').ComponentProvideOptions, {
184
+ P: {};
185
+ B: {};
186
+ D: {};
187
+ C: {};
188
+ M: {};
189
+ Defaults: {};
190
+ }, Readonly<{
191
+ config: import('../../../services/dataGen').WidgetConfig;
192
+ }> & Readonly<{
193
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
194
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
195
+ }>, {
196
+ submit(workflowId: number): void;
197
+ }, {}, {}, {}, {}> | null;
198
+ }, HTMLDivElement, import('vue').ComponentProvideOptions, {
199
+ P: {};
200
+ B: {};
201
+ D: {};
202
+ C: {};
203
+ M: {};
204
+ Defaults: {};
205
+ }, Readonly<{}> & Readonly<{
206
+ onChange?: ((value: any) => any) | undefined;
207
+ onError?: ((value: string) => any) | undefined;
208
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
209
+ }>, {
210
+ isFileUpload(): boolean;
211
+ submit(workflowId: number): void;
212
+ }, {}, {}, {}, {}> | null)[];
213
+ }, HTMLDivElement>;
214
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
215
+ export default _default;
216
+ type __VLS_WithTemplateSlots<T, S> = T & {
217
+ new (): {
218
+ $slots: S;
219
+ };
220
+ };
@@ -0,0 +1,23 @@
1
+ type __VLS_Props = {
2
+ className: string;
3
+ workflowId: string;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ title?(_: {}): any;
9
+ content?(_: {}): any;
10
+ action?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ className: string;
3
+ };
4
+ declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
6
+ slots: {
7
+ title?(_: {}): any;
8
+ content?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: HTMLDivElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,23 @@
1
+ type __VLS_Props = {
2
+ className: string;
3
+ workflowId: string;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ title?(_: {}): any;
9
+ content?(_: {}): any;
10
+ action?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,13 @@
1
+ import { WidgetConfig } from '../../../services/dataGen';
2
+ type __VLS_Props = {
3
+ modelValue: string;
4
+ config: WidgetConfig;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
+ change: (value?: string | number | null | undefined) => any;
8
+ "update:modelValue": (value?: string | number | null | undefined) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { WidgetConfig } from '../../../services/dataGen';
2
+ type __VLS_Props = {
3
+ config: WidgetConfig;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
6
+ submit(workflowId: number): void;
7
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
+ change: (value?: string | number | null | undefined) => any;
9
+ "update:modelValue": (value?: string | number | null | undefined) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
12
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
14
+ uploadRef: any;
15
+ }, any>;
16
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
2
+ change: (value: any) => any;
3
+ error: (value: string) => any;
4
+ input: (value: any) => any;
5
+ "update:modelValue": (value: any) => any;
6
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
7
+ onChange?: ((value: any) => any) | undefined;
8
+ onError?: ((value: string) => any) | undefined;
9
+ onInput?: ((value: any) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
2
+ change: (value: any) => any;
3
+ error: (value: string) => any;
4
+ input: (value: any) => any;
5
+ "update:modelValue": (value: any) => any;
6
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
7
+ onChange?: ((value: any) => any) | undefined;
8
+ onError?: ((value: string) => any) | undefined;
9
+ onInput?: ((value: any) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { WidgetConfig } from '../../../services/dataGen';
2
+ type __VLS_Props = {
3
+ modelValue: string;
4
+ config: WidgetConfig;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
+ change: (value?: string | number | null | undefined) => any;
8
+ "update:modelValue": (value?: string | number | null | undefined) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
2
+ change: (value: any) => any;
3
+ error: (value: string) => any;
4
+ input: (value: any) => any;
5
+ "update:modelValue": (value: any) => any;
6
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
7
+ onChange?: ((value: any) => any) | undefined;
8
+ onError?: ((value: string) => any) | undefined;
9
+ onInput?: ((value: any) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { WidgetConfig, ValidationConfig } from '../../../services/dataGen';
2
+ export type FormCompProps = {
3
+ modelValue: any;
4
+ config: WidgetConfig;
5
+ readonly?: boolean;
6
+ validations?: ValidationConfig[];
7
+ [key: string]: any;
8
+ };
9
+ export type FormCompEmits = {
10
+ (e: 'update:modelValue', value: any): void;
11
+ (e: 'change', value: any): void;
12
+ (e: 'error', value: string): void;
13
+ };
@@ -0,0 +1,85 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ isFileUpload(): boolean;
3
+ submit(workflowId: number): void;
4
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
+ change: (value: any) => any;
6
+ error: (value: string) => any;
7
+ "update:modelValue": (value: any) => any;
8
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
9
+ onChange?: ((value: any) => any) | undefined;
10
+ onError?: ((value: string) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
13
+ widgetRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
14
+ onChange?: ((value: any) => any) | undefined;
15
+ onError?: ((value: string) => any) | undefined;
16
+ onInput?: ((value: any) => any) | undefined;
17
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
18
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
19
+ change: (value: any) => any;
20
+ error: (value: string) => any;
21
+ input: (value: any) => any;
22
+ "update:modelValue": (value: any) => any;
23
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
24
+ P: {};
25
+ B: {};
26
+ D: {};
27
+ C: {};
28
+ M: {};
29
+ Defaults: {};
30
+ }, Readonly<{}> & Readonly<{
31
+ onChange?: ((value: any) => any) | undefined;
32
+ onError?: ((value: string) => any) | undefined;
33
+ onInput?: ((value: any) => any) | undefined;
34
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
35
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
36
+ modelValue: string;
37
+ config: import('../../../services/dataGen').WidgetConfig;
38
+ }> & Readonly<{
39
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
40
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
41
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
42
+ change: (value?: string | number | null | undefined) => any;
43
+ "update:modelValue": (value?: string | number | null | undefined) => any;
44
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
45
+ P: {};
46
+ B: {};
47
+ D: {};
48
+ C: {};
49
+ M: {};
50
+ Defaults: {};
51
+ }, Readonly<{
52
+ modelValue: string;
53
+ config: import('../../../services/dataGen').WidgetConfig;
54
+ }> & Readonly<{
55
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
56
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
57
+ }>, {}, {}, {}, {}, {}> | import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
58
+ config: import('../../../services/dataGen').WidgetConfig;
59
+ }> & Readonly<{
60
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
61
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
62
+ }>, {
63
+ submit(workflowId: number): void;
64
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
65
+ change: (value?: string | number | null | undefined) => any;
66
+ "update:modelValue": (value?: string | number | null | undefined) => any;
67
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
68
+ uploadRef: any;
69
+ }, any, import('vue').ComponentProvideOptions, {
70
+ P: {};
71
+ B: {};
72
+ D: {};
73
+ C: {};
74
+ M: {};
75
+ Defaults: {};
76
+ }, Readonly<{
77
+ config: import('../../../services/dataGen').WidgetConfig;
78
+ }> & Readonly<{
79
+ onChange?: ((value?: string | number | null | undefined) => any) | undefined;
80
+ "onUpdate:modelValue"?: ((value?: string | number | null | undefined) => any) | undefined;
81
+ }>, {
82
+ submit(workflowId: number): void;
83
+ }, {}, {}, {}, {}> | null;
84
+ }, HTMLDivElement>;
85
+ export default _default;
package/dist/main.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as CreateView } from './components/data-gen/views/CreateView.vue';
3
+ import { default as UpdateView } from './components/data-gen/views/UpdateView.vue';
4
+ import { default as DetailView } from './components/data-gen/views/DetailView.vue';
5
+ import { default as ListView } from './components/data-gen/views/ListView.vue';
6
+ declare const MyPlugin: {
7
+ install(app: App): void;
8
+ };
9
+ export default MyPlugin;
10
+ export { CreateView, UpdateView, DetailView, ListView };
@@ -0,0 +1,2 @@
1
+ export declare const getToken: () => Promise<any>;
2
+ export declare const getAxios: () => Promise<import('axios').AxiosInstance>;
@@ -0,0 +1,108 @@
1
+ import { RedirectType } from '../types';
2
+ export type SelectOption = {
3
+ value: string | number;
4
+ label: string;
5
+ [key: string]: unknown;
6
+ };
7
+ export type WidgetConfig = {
8
+ Widget: string;
9
+ Readonly: boolean;
10
+ Title: string;
11
+ DataSourceProvider: string;
12
+ options?: SelectOption[];
13
+ multiple?: boolean;
14
+ remote?: string;
15
+ UploadURL?: string;
16
+ [key: string]: unknown;
17
+ };
18
+ export type ValidationConfig = {
19
+ RuleName: string;
20
+ RuleParameter: any;
21
+ };
22
+ export type FieldConfig = {
23
+ widget?: WidgetConfig;
24
+ order?: number;
25
+ validations: ValidationConfig[];
26
+ value?: any;
27
+ column?: boolean;
28
+ };
29
+ export type ActionConfig = {
30
+ isSubmit?: boolean;
31
+ requestUrl?: string;
32
+ redirectUrl?: string;
33
+ title: string;
34
+ widget: string;
35
+ redirectType?: RedirectType;
36
+ };
37
+ export type PageConfig = {
38
+ pageType: string;
39
+ fields: Record<string, FieldConfig>;
40
+ actions?: ActionConfig[];
41
+ globalValidations: Array<{
42
+ rule: string;
43
+ param?: any;
44
+ appliesTo: string[];
45
+ }>;
46
+ };
47
+ export declare enum PageActionType {
48
+ Create = 0,
49
+ Update = 1,
50
+ Details = 2,
51
+ list = 3
52
+ }
53
+ export declare const getPageData: (type: PageActionType, opt: {
54
+ className: string;
55
+ workflowId?: string;
56
+ }) => Promise<PageConfig>;
57
+ export type Action = {
58
+ redirectUrl: string;
59
+ location: 'InTable' | 'InOperation';
60
+ attributeType: 'UIControl';
61
+ readonly: boolean;
62
+ widget: 'Link';
63
+ title: 'Approve' | 'Create' | 'Update';
64
+ isSubmit: boolean;
65
+ };
66
+ export type ListDataRes = {
67
+ __ClassAttributes: {
68
+ RedirectUrl: string;
69
+ Location: 'InTable' | 'InOperation';
70
+ AttributeType: 'UIControl';
71
+ Readonly: boolean;
72
+ Widget: 'Link';
73
+ Title: 'Approve' | 'Create' | 'Update';
74
+ IsSubmit: boolean;
75
+ RedirectType: RedirectType;
76
+ }[];
77
+ Data: {
78
+ propertyValue: ListData;
79
+ };
80
+ };
81
+ type ListData = {
82
+ data: object[];
83
+ totalCount: number;
84
+ };
85
+ export declare function getListData(className: string, opt: {
86
+ Filters: object[];
87
+ Sorts: object[];
88
+ PageNumber: number;
89
+ PageSize: number;
90
+ }): Promise<{
91
+ data: object[];
92
+ totalCount: number;
93
+ actions: {
94
+ redirectUrl: string;
95
+ location: "InTable" | "InOperation";
96
+ attributeType: "UIControl";
97
+ redirectType: RedirectType;
98
+ readonly: boolean;
99
+ widget: "Link";
100
+ title: "Create" | "Update" | "Approve";
101
+ isSubmit: boolean;
102
+ }[];
103
+ }>;
104
+ export declare function createData(className: string, data: object, url: string): Promise<number>;
105
+ export declare function updateData(className: string, id: string, data: object, url: string): Promise<any>;
106
+ export declare function approveData(className: string, id: string, email: string, reason: string, data: object, url: string): Promise<any>;
107
+ export declare function getOptions(url: string, value?: string): Promise<SelectOption[]>;
108
+ export {};
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ [key: string]: Function;
3
+ };
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { ValidationConfig } from './dataGen';
2
+ export declare const validateRules: (configs: ValidationConfig[], value: any) => boolean;
3
+ export declare const vallidateRule: (config: ValidationConfig, value: any) => boolean;
@@ -0,0 +1,3 @@
1
+ export declare const useMainStore: import('pinia').StoreDefinition<"main", {
2
+ token: undefined;
3
+ }, {}, {}>;
@@ -0,0 +1 @@
1
+ export type RedirectType = 'Create' | 'Update' | 'Details' | 'List';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chase-shao/vue-component-lib",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -14,15 +14,18 @@
14
14
  },
15
15
  "./dist/style.css": "./dist/index.css"
16
16
  },
17
- "dependencies": {},
18
17
  "devDependencies": {
18
+ "@arco-design/web-vue": "^2.57.0",
19
19
  "@vitejs/plugin-vue": "^6.0.1",
20
20
  "@vue/compiler-sfc": "^3.5.18",
21
+ "axios": "^1.11.0",
22
+ "pinia": "^3.0.3",
21
23
  "tslib": "^2.8.1",
22
24
  "typescript": "^5.9.2",
23
25
  "vite": "^7.0.6",
24
26
  "vite-plugin-dts": "^4.5.4",
25
- "vue": "^3.5.18"
27
+ "vue": "^3.5.18",
28
+ "vue-router": "^4.5.1"
26
29
  },
27
30
  "scripts": {
28
31
  "build": "vite build",
@@ -56,6 +59,9 @@
56
59
  },
57
60
  "homepage": "https://github.com/your-username/vue-component-lib#readme",
58
61
  "peerDependencies": {
59
- "vue": "^3.5.18"
62
+ "axios": "^1.11.0",
63
+ "pinia": "^3.0.3",
64
+ "vue": "^3.5.18",
65
+ "vue-router": "^4.5.1"
60
66
  }
61
67
  }