icarys-fc-vant 1.0.15 → 1.0.17

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 (112) hide show
  1. package/README.md +40 -205
  2. package/dist/index.js +7590 -0
  3. package/dist/index.min.js +3 -7407
  4. package/dist/index.min.js.map +1 -0
  5. package/package.json +6 -19
  6. package/src/components/common/subform/LICENSE +21 -0
  7. package/src/components/common/subform/README.md +6 -0
  8. package/src/components/common/subform/package.json +48 -0
  9. package/src/components/common/subform/src/component.jsx +75 -0
  10. package/src/components/common/subform/src/index.js +3 -0
  11. package/src/components/common/wangeditor/LICENSE +21 -0
  12. package/src/components/common/wangeditor/README.md +14 -0
  13. package/src/components/common/wangeditor/package-lock.json +114 -0
  14. package/src/components/common/wangeditor/package.json +52 -0
  15. package/src/components/common/wangeditor/src/component.jsx +74 -0
  16. package/src/components/common/wangeditor/src/index.js +3 -0
  17. package/src/core/LICENSE +21 -0
  18. package/src/core/README.md +120 -0
  19. package/src/core/babel.config.js +13 -0
  20. package/src/core/bili.config.js +34 -0
  21. package/src/core/package-lock.json +13 -0
  22. package/src/core/package.json +61 -0
  23. package/src/core/src/components/formCreate.js +287 -0
  24. package/src/core/src/components/fragment.js +12 -0
  25. package/src/core/src/factory/context.js +264 -0
  26. package/src/core/src/factory/creator.js +63 -0
  27. package/src/core/src/factory/maker.js +17 -0
  28. package/src/core/src/factory/manager.js +87 -0
  29. package/src/core/src/factory/node.js +89 -0
  30. package/src/core/src/factory/parser.js +28 -0
  31. package/src/core/src/frame/api.js +691 -0
  32. package/src/core/src/frame/attrs.js +12 -0
  33. package/src/core/src/frame/dataDriver.js +76 -0
  34. package/src/core/src/frame/fetch.js +128 -0
  35. package/src/core/src/frame/index.js +792 -0
  36. package/src/core/src/frame/language.js +50 -0
  37. package/src/core/src/frame/provider.js +297 -0
  38. package/src/core/src/frame/util.js +311 -0
  39. package/src/core/src/handler/context.js +573 -0
  40. package/src/core/src/handler/effect.js +122 -0
  41. package/src/core/src/handler/index.js +143 -0
  42. package/src/core/src/handler/inject.js +199 -0
  43. package/src/core/src/handler/input.js +199 -0
  44. package/src/core/src/handler/lifecycle.js +55 -0
  45. package/src/core/src/handler/loader.js +375 -0
  46. package/src/core/src/handler/page.js +46 -0
  47. package/src/core/src/handler/render.js +29 -0
  48. package/src/core/src/index.js +12 -0
  49. package/src/core/src/parser/html.js +17 -0
  50. package/src/core/src/render/cache.js +47 -0
  51. package/src/core/src/render/index.js +33 -0
  52. package/src/core/src/render/render.js +418 -0
  53. package/src/core/types/index.d.ts +842 -0
  54. package/src/index.js +5 -0
  55. package/src/utils/LICENSE +21 -0
  56. package/src/utils/README.md +24 -0
  57. package/src/utils/lib/console.js +16 -0
  58. package/src/utils/lib/debounce.js +9 -0
  59. package/src/utils/lib/deepextend.js +51 -0
  60. package/src/utils/lib/deepset.js +14 -0
  61. package/src/utils/lib/extend.js +20 -0
  62. package/src/utils/lib/index.js +14 -0
  63. package/src/utils/lib/json.js +90 -0
  64. package/src/utils/lib/mergeprops.js +62 -0
  65. package/src/utils/lib/mitt.js +43 -0
  66. package/src/utils/lib/modify.js +8 -0
  67. package/src/utils/lib/slot.js +8 -0
  68. package/src/utils/lib/toarray.js +5 -0
  69. package/src/utils/lib/tocase.js +11 -0
  70. package/src/utils/lib/todate.js +10 -0
  71. package/src/utils/lib/toline.js +10 -0
  72. package/src/utils/lib/topromise.js +10 -0
  73. package/src/utils/lib/tostring.js +7 -0
  74. package/src/utils/lib/type.js +45 -0
  75. package/src/utils/lib/unique.js +6 -0
  76. package/src/utils/package.json +32 -0
  77. package/src/vant/LICENSE +21 -0
  78. package/src/vant/auto-import.d.ts +5 -0
  79. package/src/vant/auto-import.js +50 -0
  80. package/src/vant/babel.config.js +10 -0
  81. package/src/vant/bili.config.js +40 -0
  82. package/src/vant/examples/App.vue +96 -0
  83. package/src/vant/examples/main.js +13 -0
  84. package/src/vant/examples/rule.js +366 -0
  85. package/src/vant/package.json +83 -0
  86. package/src/vant/public/index.html +14 -0
  87. package/src/vant/src/components/calendar.jsx +128 -0
  88. package/src/vant/src/components/cascader.jsx +120 -0
  89. package/src/vant/src/components/checkbox.jsx +38 -0
  90. package/src/vant/src/components/datePicker.jsx +87 -0
  91. package/src/vant/src/components/group.jsx +384 -0
  92. package/src/vant/src/components/icon/IconWarning.vue +12 -0
  93. package/src/vant/src/components/index.js +26 -0
  94. package/src/vant/src/components/radio.jsx +38 -0
  95. package/src/vant/src/components/select.jsx +81 -0
  96. package/src/vant/src/components/timePicker.jsx +76 -0
  97. package/src/vant/src/components/uploader.jsx +99 -0
  98. package/src/vant/src/core/alias.js +31 -0
  99. package/src/vant/src/core/api.js +135 -0
  100. package/src/vant/src/core/config.js +35 -0
  101. package/src/vant/src/core/index.js +45 -0
  102. package/src/vant/src/core/manager.js +282 -0
  103. package/src/vant/src/core/provider.js +63 -0
  104. package/src/vant/src/core/utils.js +15 -0
  105. package/src/vant/src/index.js +13 -0
  106. package/src/vant/src/parsers/hidden.js +12 -0
  107. package/src/vant/src/parsers/index.js +59 -0
  108. package/src/vant/src/parsers/row.js +10 -0
  109. package/src/vant/src/style/index.css +495 -0
  110. package/src/vant/types/config.d.ts +99 -0
  111. package/src/vant/types/index.d.ts +27 -0
  112. package/src/vant/vue.config.js +21 -0
@@ -0,0 +1,842 @@
1
+ import {App, Component, VNodeChild} from "vue";
2
+
3
+ export type Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
4
+ BaseOptions<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
5
+ & OptionAttrs;
6
+
7
+ export type Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
8
+ BaseRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
9
+ & RuleAttrs;
10
+
11
+ export type FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
12
+ Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
13
+ | Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
14
+
15
+ export declare type Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
16
+ BaseCreator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
17
+ & CreatorAttrs;
18
+
19
+ export declare type Maker<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
20
+ BaseMaker<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
21
+ & MakerAttrs;
22
+
23
+ export declare type Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
24
+ BaseApi<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
25
+ & ApiAttrs;
26
+
27
+ declare type FormCreateFactory<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
28
+ (config: FormCreateFactoryConfig<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => FormCreate<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
29
+
30
+ export default FormCreateFactory;
31
+
32
+ export interface Install<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
33
+ (formCreate: FormCreate<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, opt: any): void;
34
+ }
35
+
36
+ export interface FormCreateProps<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
37
+ rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
38
+ option?: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
39
+ extendOption?: Boolean;
40
+ disabled?: Boolean;
41
+ preview?: Boolean;
42
+ modelValue?: Object;
43
+ api?: Object;
44
+ }
45
+
46
+ //静态数据
47
+ export interface StaticDataItem {
48
+ //数据名称
49
+ label: string;
50
+ //数据类型
51
+ type: 'static';
52
+ //数据
53
+ result: any;
54
+ }
55
+
56
+ //远程数据
57
+ export interface FetchDataItem {
58
+ //数据名称
59
+ label: string;
60
+ //数据类型
61
+ type: 'fetch';
62
+ //请求链接
63
+ action: string;
64
+ //请求方式
65
+ method: 'GET' | 'POST';
66
+ //请求头部
67
+ headers?: Object;
68
+ //附带数据
69
+ data?: Object;
70
+ //远程数据解析
71
+ parse?: string | ((res: any) => any);
72
+ //远程异常处理
73
+ onError?: string | ((e) => void);
74
+ }
75
+
76
+ //全局数据源
77
+ export interface GlobalData {
78
+ [id: string]: StaticDataItem | FetchDataItem;
79
+ }
80
+
81
+ //全局事件
82
+ export interface GlobalEvent {
83
+ [id: string]: {
84
+ //数据名称
85
+ label: string;
86
+ //回调事件
87
+ handle: string | (($inject: Object) => void);
88
+ }
89
+ }
90
+
91
+ //全局样式
92
+ export interface GlobalClass {
93
+ [className: string]: {
94
+ //数据名称
95
+ label: string;
96
+ //样式内容
97
+ content?: string;
98
+ //回调事件
99
+ style: {
100
+ [name: string]: string;
101
+ };
102
+ }
103
+ }
104
+
105
+ export interface Driver {
106
+ parsers: {
107
+ [id: string]: Parser;
108
+ };
109
+ initOptions: (options: Object) => void;
110
+ updateOptions: (options: Object) => void;
111
+ updateWrap: (ctx: Object) => void;
112
+ defaultRender: (children: Slots, ctx: Object) => VNodeChild | VNodeChild[];
113
+ defaultPreview: (children: Slots, ctx: Object) => VNodeChild | VNodeChild[];
114
+ }
115
+
116
+ export interface FormCreateFactoryConfig<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
117
+ manager: {
118
+ [key: string]: Object | Function;
119
+ },
120
+ attrs?: {
121
+ key?: string[],
122
+ array?: string[],
123
+ normal?: string[],
124
+ },
125
+ extendApi?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, h: Object) => Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
126
+ version?: string;
127
+ isMobile?: Boolean;
128
+ ui?: string;
129
+ install?: Install<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
130
+ }
131
+
132
+ export interface util<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
133
+ readonly version: string;
134
+ readonly ui: string;
135
+ readonly data: Object;
136
+ readonly maker: Maker<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
137
+
138
+ (rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[], option?: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
139
+
140
+ fetch(option: FetchOption, effectArgs: Object): void,
141
+
142
+ component(name: string, component: any): void;
143
+
144
+ component(component: string | any): any;
145
+
146
+ directive(name: string, directive: any): void;
147
+
148
+ directive(directive: any): void;
149
+
150
+ register(name: string, effect: Effect<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | ((fc: Object) => void)): void;
151
+
152
+ register(effect: Effect<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
153
+
154
+ parser(name: string, parser: Parser): void;
155
+
156
+ parser(parser: Parser): void;
157
+
158
+ parseFn(val: any): any;
159
+
160
+ use(install: Install<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | {
161
+ install: Install<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
162
+ [key: string]: any
163
+ }, Opt?: any): void;
164
+
165
+ useApp(formCreate: FormCreate<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, app: App): void;
166
+
167
+ componentAlias(alias: { [alias: string]: string }): void;
168
+
169
+ copyRule(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
170
+
171
+ copyRules(rules: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[]): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
172
+
173
+ $form(): Component;
174
+
175
+ parseJson(json: string): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
176
+
177
+ toJson(rules: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[], space?: string | number): string;
178
+
179
+ install: (app: App, ...options: any[]) => any;
180
+
181
+ create: util<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
182
+
183
+ factory(inherit?: Boolean): util<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
184
+
185
+ getApi(name: string): Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | undefined;
186
+
187
+ setData(id: string, data: any): void;
188
+
189
+ setDataDriver(id: string, callback: (key: string) => any): void;
190
+
191
+ getData(id: string, defaultValue?: any): any;
192
+
193
+ refreshData(id: string): void;
194
+
195
+ extendApi(fn: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => Object | void): void;
196
+
197
+ setModelField(type: string, field: string): void;
198
+
199
+ setFormula(name: string, fn: Function): void;
200
+
201
+ setDriver(name: string, driver: Driver): void;
202
+
203
+ removeData(attr: string): void;
204
+
205
+ isMobile?: Boolean;
206
+ }
207
+
208
+ export type FormCreate<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
209
+ Component
210
+ & util<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
211
+ & {
212
+ util: util<MakerAttrs, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
213
+ };
214
+
215
+ export interface FormData {
216
+ [field: string]: any
217
+ }
218
+
219
+ export interface BindFormData extends FormData {
220
+
221
+ }
222
+
223
+ interface Directive {
224
+ value?: any;
225
+ arg?: string;
226
+ modifiers?: Object;
227
+ }
228
+
229
+ export interface VNodeData {
230
+ type?: string;
231
+ slot?: string;
232
+ class?: any;
233
+ style?: string | object[] | object;
234
+ props?: { [key: string]: any };
235
+ on?: { [key: string]: Function | Function[] };
236
+ directives?: {
237
+ [name: string]: Directive
238
+ };
239
+ }
240
+
241
+ export interface Control<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
242
+ value?: any;
243
+ handle?: (val: any, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => boolean;
244
+ method?: 'display' | 'disabled' | 'hidden' | 'required';
245
+ condition?: '==' | '!=' | '<>' | '>' | '>=' | '<' | '<=' | 'in' | 'notIn' | 'on' | 'notOn' | 'between' | 'notBetween' | 'empty' | 'notEmpty' | 'pattern';
246
+ rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[] | string[];
247
+ }
248
+
249
+ interface loadParams<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
250
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
251
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
252
+ update: (options: []) => void;
253
+ reload: () => void;
254
+ }
255
+
256
+ type RuleOptionsFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> = (data: loadParams<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => ([] | Promise<[]>)
257
+
258
+ type RuleOptions<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
259
+ Array<any> | RuleOptionsFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
260
+
261
+ type RuleChildrenFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> = (data: loadParams<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => (FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[] | Promise<FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[]>)
262
+
263
+ type RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> =
264
+ string | FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
265
+ | RuleChildrenFn<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
266
+
267
+ interface PropArg<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
268
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
269
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
270
+ prop: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
271
+ preview: Boolean;
272
+ slotValue: any[];
273
+ model: {
274
+ callback: (value: any) => void;
275
+ value: any
276
+ },
277
+ children?: Object
278
+ }
279
+
280
+ export interface InjectArg<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
281
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
282
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
283
+ self: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
284
+ option: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
285
+ inject: any
286
+ }
287
+
288
+ export interface VNodeRule extends VNodeData {
289
+ children?: Array<VNodeRule | string>;
290
+ }
291
+
292
+ export interface BaseRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> extends VNodeData {
293
+ field?: string;
294
+ key?: string;
295
+ name?: string;
296
+ modelField?: string;
297
+ modelEmit?: string;
298
+ emitPrefix?: string;
299
+ value?: any;
300
+ ignore?: Boolean | 'hidden';
301
+ computed?: string | ((formData: FormData, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => any);
302
+ emit?: Array<string | { name: string; inject: any }>;
303
+ link?: string[];
304
+ sync?: string[];
305
+ prefix?: string | VNodeRule;
306
+ suffix?: string | VNodeRule;
307
+ update?: (value: any, $rule: this, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, arg: {
308
+ origin: 'change' | 'init' | 'link';
309
+ linkField?: string;
310
+ }) => Boolean | void;
311
+ options?: RuleOptions<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
312
+ optionsTo?: string;
313
+ deep?: Object;
314
+ native?: Boolean;
315
+ hidden?: Boolean;
316
+ display?: Boolean;
317
+ preview?: Boolean;
318
+ cache?: Boolean;
319
+ component?: Component;
320
+ inject?: any;
321
+ slotUpdate?: (arg: PropArg<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
322
+
323
+ validate?: Object[];
324
+ children?: Array<RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>>;
325
+ control?: Control<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
326
+ effect?: {
327
+ fetch?: String | FetchEffectOption | ((rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => FetchEffectOption),
328
+ componentValidate?: string | boolean | {
329
+ method: string;
330
+ trigger?: string;
331
+ message?: string;
332
+ [key: string]: any;
333
+ };
334
+ required?: boolean | string | object;
335
+ t?: {
336
+ [key: string]: string | {
337
+ attr: string;
338
+ params?: Object;
339
+ modify?: boolean;
340
+ };
341
+ };
342
+ loadData?: LoadDataEffectOption | Array<LoadDataEffectOption>;
343
+ [key: string]: any;
344
+ };
345
+ hook?: {
346
+ load?: (evt: {
347
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
348
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
349
+ }) => void;
350
+ mounted?: (evt: {
351
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
352
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
353
+ }) => void;
354
+ deleted?: (evt: {
355
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
356
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
357
+ }) => void;
358
+ value?: (evt: {
359
+ value: any,
360
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
361
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
362
+ }) => void;
363
+ hidden?: (evt: {
364
+ value: boolean,
365
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
366
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
367
+ }) => void;
368
+ watch?: (evt: {
369
+ key: string,
370
+ oldValue: any,
371
+ newValue: any,
372
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
373
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
374
+ }) => void;
375
+ deepLoad?: (evt: {
376
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
377
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
378
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
379
+ }) => void;
380
+ deepMounted?: (evt: {
381
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
382
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
383
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
384
+ }) => void;
385
+ deepDeleted?: (evt: {
386
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
387
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
388
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
389
+ }) => void;
390
+ deepValue?: (evt: {
391
+ value: any,
392
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
393
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
394
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
395
+ }) => void;
396
+ deepHidden?: (evt: {
397
+ value: boolean,
398
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
399
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
400
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
401
+ }) => void;
402
+ deepWatch?: (evt: {
403
+ key: string,
404
+ oldValue: any,
405
+ newValue: any,
406
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
407
+ parent: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
408
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
409
+ }) => void;
410
+ }
411
+
412
+ [key: string]: any;
413
+ }
414
+
415
+ export interface CreatorHelper<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
416
+ (title?: string | Object, field?: string, value?: any, props?: Object): Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
417
+ }
418
+
419
+ export declare interface CreatorFactory<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
420
+ (name: string, init: Object | ((m: Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>))
421
+ : CreatorHelper<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
422
+ }
423
+
424
+ export class BaseCreator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
425
+
426
+ private _data: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
427
+
428
+ constructor(type: string, title?: string | Object, field?: string, value?: any, props?: Object) ;
429
+
430
+ setProp(key: String, prop: any): this;
431
+
432
+ getRule(): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
433
+
434
+ _clone(): Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
435
+
436
+ slot(prop: string): this;
437
+
438
+ class(prop: any): this;
439
+
440
+ style(prop: string | object[] | object): this;
441
+
442
+ props(prop: { [key: string]: any }): this;
443
+ props(prop: string, val: any): this;
444
+
445
+ key(key: string): this;
446
+
447
+ on(prop: { [key: string]: Function | Function[] }): this;
448
+ on(prop: string, val: Function | Function[]): this;
449
+
450
+
451
+ directives(prop: { [key: string]: Directive }): this;
452
+ directives(prop: string, val: Directive): this;
453
+
454
+ type(prop: string): this;
455
+
456
+ preview(prop: Boolean): this;
457
+
458
+ cache(prop: Boolean): this;
459
+
460
+ component(prop: Component): this;
461
+
462
+ field(prop: string): this;
463
+
464
+ name(prop: string): this;
465
+
466
+ modelField(prop: string): this;
467
+
468
+ modelEmit(prop: string): this;
469
+
470
+ emitPrefix(prop: string): this;
471
+
472
+ value(prop: any): this;
473
+
474
+ computed(prop: string | ((formData: FormData, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => any)): this;
475
+
476
+ emit(prop: Array<string | { name: string; inject: any }>): this;
477
+
478
+ link(prop: string[]): this;
479
+
480
+ sync(prop: string[]): this;
481
+
482
+ prefix(prop: string | VNodeRule): this;
483
+
484
+ suffix(prop: string | VNodeRule): this;
485
+
486
+ update(prop: (value: any, $rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => Boolean | void): this;
487
+
488
+ native(prop: Boolean): this;
489
+
490
+ hidden(prop: Boolean): this;
491
+
492
+ display(prop: Boolean): this;
493
+
494
+ inject(prop: any): this;
495
+
496
+ slotUpdate(arg: PropArg<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): this;
497
+
498
+ deep(deep: Object): this;
499
+
500
+ validate(prop: Object[]): this;
501
+
502
+ children(prop: Array<RuleChildren<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>>): this;
503
+
504
+ control(prop: Control<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[]): this;
505
+
506
+ effect(prop: Object): this;
507
+
508
+ options(options: RuleOptions<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): this;
509
+
510
+ optionsTo(to: string): this;
511
+ }
512
+
513
+ export interface BaseMaker<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
514
+ create(type: string, field?: string, title?: string): Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
515
+
516
+ factory: CreatorFactory<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
517
+
518
+ html: CreatorFactory<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
519
+ }
520
+
521
+ export interface BaseOptions<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
522
+ global?: {
523
+ [key: string]: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
524
+ };
525
+ injectEvent?: boolean;
526
+ preview?: boolean;
527
+ appendValue?: boolean;
528
+ ignoreHiddenFields?: boolean;
529
+ validateOnSubmit?: boolean;
530
+ forceCoverValue?: boolean;
531
+ formData?: FormData;
532
+ el?: Element | string;
533
+ onValidateFail?: (e: Object, form: {api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>}) => void;
534
+ onSubmit?: (formData: FormData, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
535
+ onReset?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
536
+ beforeFetch?: (config: FetchEffectOption, form: {
537
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
538
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
539
+ }) => void | Promise<any>;
540
+ beforeSubmit?: (formData: Object, form: {
541
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>,
542
+ }) => void | boolean | Promise<any>;
543
+ mounted?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
544
+ reload?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
545
+ onMounted?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
546
+ onReload?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
547
+ onChange?: (field: string, value: any, opt: {
548
+ rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
549
+ api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
550
+ setFlag: boolean;
551
+ }) => void;
552
+ globalClass?: GlobalClass;
553
+ globalEvent?: GlobalEvent;
554
+ globalData?: GlobalData;
555
+ style?: string;
556
+ }
557
+
558
+
559
+ export interface BaseApi<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
560
+ readonly config: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
561
+ readonly options: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
562
+ readonly form: BindFormData;
563
+ readonly rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
564
+ readonly parent: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | undefined;
565
+ readonly top: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
566
+ readonly children: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
567
+ readonly formulas: {
568
+ [key: string]: Function;
569
+ };
570
+
571
+ formData(): FormData;
572
+
573
+ formData(field: string | Array<string>): FormData;
574
+
575
+ getValue(field: string): any;
576
+
577
+ coverValue(formData: FormData): void;
578
+
579
+ setValue(formData: FormData): void;
580
+
581
+ setValue(field: string, value: any): void;
582
+
583
+ changeValue(formData: FormData): void;
584
+
585
+ changeValue(field: string, value: any): void;
586
+
587
+ changeField(formData: FormData): void;
588
+
589
+ changeField(field: string, value: any): void;
590
+
591
+ removeField(field: string): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
592
+
593
+ removeRule(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
594
+
595
+ fields(): string[];
596
+
597
+ append(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
598
+
599
+ append(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, field: string): void;
600
+
601
+ append(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, field: string, child: boolean): void;
602
+
603
+ prepend(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
604
+
605
+ prepend(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, field: string): void;
606
+
607
+ prepend(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, field: string, child: boolean): void;
608
+
609
+ hidden(hidden: Boolean): void;
610
+
611
+ hidden(hidden: Boolean, field: string | Array<string>): void;
612
+
613
+ hiddenStatus(field: String): Boolean;
614
+
615
+ display(hidden: Boolean): void;
616
+
617
+ display(hidden: Boolean, field: string | Array<string>): void;
618
+
619
+ displayStatus(field: String): Boolean;
620
+
621
+ disabled(disabled: Boolean): void;
622
+
623
+ disabled(disabled: Boolean, field: string | Array<string>): void;
624
+
625
+ model(): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
626
+
627
+ model(origin: true): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
628
+
629
+ component(): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
630
+
631
+ component(origin: true): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
632
+
633
+ bind(): BindFormData;
634
+
635
+ reload(rules: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[]): void;
636
+
637
+ updateOptions(options: Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
638
+
639
+ onSubmit(fn: (formData: FormData, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void): void;
640
+
641
+ submit(success?: (formData: FormData, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void, fail?: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void): Promise<any>;
642
+
643
+ sync(field: string | string[]): void;
644
+
645
+ sync(rule: FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[]): void;
646
+
647
+ refresh(): void;
648
+
649
+ refreshOptions(): void;
650
+
651
+ hideForm(hide?: Boolean): void;
652
+
653
+ changeStatus(): Boolean;
654
+
655
+ clearChangeStatus(): void;
656
+
657
+ setEffect(id: string, attr: string, value: any): void;
658
+
659
+ clearEffectData(id: string, attr?: string): void;
660
+
661
+ updateRule(field: string, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
662
+
663
+ updateRule(rules: { [field: string]: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> }): void;
664
+
665
+ mergeRule(field: string, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): void;
666
+
667
+ mergeRules(rules: { [field: string]: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> }): void;
668
+
669
+ getRule(id: string): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
670
+
671
+ getRule(id: string, origin: true): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
672
+
673
+ getRule(id: string, origin: false): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
674
+
675
+ getCurrentFormRule(): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
676
+
677
+ findType(type: string, origin: true): FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
678
+
679
+ findType(type: string, origin: false): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
680
+
681
+ findTypes(type: string, origin: true): Array<FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>>;
682
+
683
+ findTypes(type: string, origin: false): Array<Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>>;
684
+
685
+ getParentRule(id: string | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): undefined | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
686
+
687
+ getRefRule(name: string): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
688
+
689
+ getRenderRule(id: string): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
690
+
691
+ updateValidate(id: string, validate: Object[], merge?: Boolean): Promise<any>;
692
+
693
+ updateValidates(validates: { [id: string]: Object[] }, merge?: Boolean): Promise<any>;
694
+
695
+ refreshValidate(): void;
696
+
697
+ method(id: string, name: string): (...args: any[]) => any;
698
+
699
+ exec(id: string, name: string, ...args: any[]): any;
700
+
701
+ toJson(space?: string | number): string;
702
+
703
+ trigger(id: string, event: string, ...args: any[]): void;
704
+
705
+ el(id: string): any;
706
+
707
+ closeModal(id: string): void;
708
+
709
+ resetFields(): void;
710
+
711
+ resetFields(field: string | string[]): void;
712
+
713
+ getParentSubRule(field: string | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | undefined;
714
+
715
+ getChildrenRuleList(field: string | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>): Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
716
+
717
+ getChildrenFormData(field: string | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, flag?: boolean): FormData;
718
+
719
+ setChildrenFormData(field: string | Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, formData: FormData, cover: boolean): void;
720
+
721
+ getSubForm(field: string): Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> | Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>[];
722
+
723
+ nextTick(fn: (api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void): void;
724
+
725
+ nextRefresh(fn: Function): void;
726
+
727
+ deferSyncValue(fn: Function, autoSync?: boolean): void;
728
+
729
+ set<T>(object: object, key: string | number, value: T): T;
730
+
731
+ emit(event: string, ...args: any[]): void;
732
+
733
+ fetch(opt: FetchOption): Promise<any>;
734
+
735
+ watchFetch(opt: FetchOption, success: ((res: any, change: boolean) => void), error: Function): Function;
736
+
737
+ getData(id: string, defaultValue?: any): any;
738
+
739
+ watchData(fn: (get: (id: string, defaultValue?: any) => any, change: boolean) => void): () => Function;
740
+
741
+ setData(id: string, value?: any, isGlobal?: boolean): void;
742
+
743
+ refreshData(id: string): void;
744
+
745
+ t(id: string, params?: Object): string | undefined;
746
+
747
+ getLocale(): string;
748
+
749
+ bus: {
750
+ $emit(event: string, ...args: any[]): void;
751
+ $on(event: string | string[], callback: Function): void;
752
+ $once(event: string | string[], callback: Function): void;
753
+ $off(event?: string | string[], callback?: Function): void;
754
+ }
755
+
756
+ on(event: string | string[], callback: Function): this;
757
+
758
+ once(event: string | string[], callback: Function): this;
759
+
760
+ off(event?: string | string[], callback?: Function): this;
761
+
762
+ [key: string]: any;
763
+ }
764
+
765
+ export interface EffectValue {
766
+ value: any;
767
+ getProp: () => Object;
768
+ clearProp: () => void;
769
+ getValue: () => any;
770
+ mergeProp: (prop: Object) => Object;
771
+ }
772
+
773
+ export interface Effect<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs> {
774
+ name?: string;
775
+ components?: string | string[];
776
+ init?: (data: {
777
+ value: any,
778
+ getValue: () => any;
779
+ repeat: Boolean;
780
+ }, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
781
+ load?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
782
+ loaded?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
783
+ watch?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
784
+ value?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
785
+ control?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
786
+ deleted?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
787
+ mounted?: (data: EffectValue, rule: Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>, api: Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>) => void;
788
+ }
789
+
790
+ export interface Slots {
791
+ [slot: string]: () => any;
792
+ }
793
+
794
+ export interface Parser {
795
+ name?: string;
796
+ merge?: Boolean;
797
+ init?: (ctx: Object) => void;
798
+ toFormValue?: (value: any, ctx: Object) => void;
799
+ toValue?: (value: any, ctx: Object) => void;
800
+ mounted?: (ctx: Object) => void;
801
+ render?: (children: Slots, ctx: Object) => VNodeChild | VNodeChild[];
802
+ preview?: (children: Slots, ctx: Object) => VNodeChild | VNodeChild[];
803
+ mergeProp?: (ctx: Object) => void;
804
+ }
805
+
806
+ export interface FetchOption {
807
+ action: String;
808
+ method?: String;
809
+ data?: Object;
810
+ dataType?: 'json';
811
+ headers?: Object;
812
+ withCredentials?: Boolean;
813
+ onSuccess: (body: any) => void
814
+ onError?: (e: Error | ProgressEvent) => void;
815
+ }
816
+
817
+ export interface FetchEffectOption {
818
+ action: String | ((rule: object, api: object) => Promise<any>);
819
+ to?: String;
820
+ parse?: String | ((body: any, rule: Object, api: Object) => any);
821
+ method?: String;
822
+ data?: Object;
823
+ query?: Object;
824
+ dataType?: 'json';
825
+ headers?: Object;
826
+ withCredentials?: Boolean;
827
+ onError?: (e: Error | ProgressEvent, rule: Object, api: Object) => void;
828
+ watch?: Boolean;
829
+ wait?: Number;
830
+ }
831
+
832
+
833
+ export interface LoadDataEffectOption {
834
+ attr?: String;
835
+ template?: String;
836
+ handler?: (get: (id: string, defaultValue?: any) => any, rule: Object, api: Object) => any;
837
+ to?: String;
838
+ copy?: boolean;
839
+ watch?: boolean;
840
+ modify?: boolean;
841
+ wait?: number;
842
+ }