@oinone/kunlun-vue-widget 6.2.0

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 (63) hide show
  1. package/dist/oinone-kunlun-vue-widget.esm.js +16 -0
  2. package/dist/types/index.d.ts +1 -0
  3. package/dist/types/src/basic/AsyncVueWidget.d.ts +7 -0
  4. package/dist/types/src/basic/VueFragment.vue.d.ts +2 -0
  5. package/dist/types/src/basic/VueWidget.d.ts +331 -0
  6. package/dist/types/src/basic/Widget.d.ts +234 -0
  7. package/dist/types/src/basic/index.d.ts +3 -0
  8. package/dist/types/src/data/ActiveRecordsWidget.d.ts +246 -0
  9. package/dist/types/src/data/PathWidget.d.ts +34 -0
  10. package/dist/types/src/data/index.d.ts +2 -0
  11. package/dist/types/src/dsl/DslDefinitionWidget.d.ts +61 -0
  12. package/dist/types/src/dsl/DslNodeWidget.d.ts +42 -0
  13. package/dist/types/src/dsl/DslRenderWidget.d.ts +44 -0
  14. package/dist/types/src/dsl/index.d.ts +3 -0
  15. package/dist/types/src/feature/index.d.ts +1 -0
  16. package/dist/types/src/feature/invisible-supported.d.ts +11 -0
  17. package/dist/types/src/hooks/all-mounted.d.ts +20 -0
  18. package/dist/types/src/hooks/index.d.ts +1 -0
  19. package/dist/types/src/index.d.ts +9 -0
  20. package/dist/types/src/token/index.d.ts +2 -0
  21. package/dist/types/src/typing/WidgetTagContext.d.ts +39 -0
  22. package/dist/types/src/typing/WidgetTagProps.d.ts +23 -0
  23. package/dist/types/src/typing/index.d.ts +3 -0
  24. package/dist/types/src/typing/typing.d.ts +7 -0
  25. package/dist/types/src/util/dsl-render.d.ts +106 -0
  26. package/dist/types/src/util/index.d.ts +4 -0
  27. package/dist/types/src/util/install.d.ts +4 -0
  28. package/dist/types/src/util/render.d.ts +7 -0
  29. package/dist/types/src/util/widget-manager.d.ts +4 -0
  30. package/dist/types/src/view/index.d.ts +161 -0
  31. package/index.ts +1 -0
  32. package/package.json +34 -0
  33. package/rollup.config.js +21 -0
  34. package/src/basic/AsyncVueWidget.ts +31 -0
  35. package/src/basic/VueFragment.vue +11 -0
  36. package/src/basic/VueWidget.ts +997 -0
  37. package/src/basic/Widget.ts +675 -0
  38. package/src/basic/index.ts +3 -0
  39. package/src/data/ActiveRecordsWidget.ts +572 -0
  40. package/src/data/PathWidget.ts +82 -0
  41. package/src/data/index.ts +2 -0
  42. package/src/dsl/DslDefinitionWidget.ts +235 -0
  43. package/src/dsl/DslNodeWidget.ts +130 -0
  44. package/src/dsl/DslRenderWidget.ts +106 -0
  45. package/src/dsl/index.ts +3 -0
  46. package/src/feature/index.ts +1 -0
  47. package/src/feature/invisible-supported.ts +29 -0
  48. package/src/hooks/all-mounted.ts +179 -0
  49. package/src/hooks/index.ts +1 -0
  50. package/src/index.ts +9 -0
  51. package/src/shim-translate.d.ts +7 -0
  52. package/src/shim-vue.d.ts +6 -0
  53. package/src/token/index.ts +8 -0
  54. package/src/typing/WidgetTagContext.ts +53 -0
  55. package/src/typing/WidgetTagProps.ts +24 -0
  56. package/src/typing/index.ts +3 -0
  57. package/src/typing/typing.ts +7 -0
  58. package/src/util/dsl-render.ts +464 -0
  59. package/src/util/index.ts +4 -0
  60. package/src/util/install.ts +29 -0
  61. package/src/util/render.ts +21 -0
  62. package/src/util/widget-manager.ts +14 -0
  63. package/src/view/index.ts +416 -0
@@ -0,0 +1,234 @@
1
+ import { IWidget, WidgetConstructor, WidgetProps } from '@oinone/kunlun-engine';
2
+ import { BehaviorSubject, Subject, Subscription } from '@oinone/kunlun-state';
3
+ import { InnerWidgetType } from '../typing/typing';
4
+ interface BaseWidgetSubjection<T> {
5
+ subscribe: (func: (data: T) => void) => Subscription;
6
+ subject: BehaviorSubject<T> | Subject<T>;
7
+ }
8
+ export interface WidgetSubjection<T> extends BaseWidgetSubjection<T> {
9
+ subject: Subject<T>;
10
+ }
11
+ export interface WidgetBehaviorSubjection<T> extends BaseWidgetSubjection<T> {
12
+ subject: BehaviorSubject<T>;
13
+ }
14
+ export declare type watcher<T> = {
15
+ path: string;
16
+ handler: (newVal: T, oldVal: T) => void;
17
+ options?: {
18
+ deep?: boolean;
19
+ };
20
+ };
21
+ export declare type HANDLE = string;
22
+ export declare abstract class Widget<Props extends WidgetProps = WidgetProps, R = unknown> implements IWidget<Props> {
23
+ private static widgetCount;
24
+ private static createHandle;
25
+ private static widgetMap;
26
+ private static attributeMap;
27
+ private static protoChainsCache;
28
+ private static watchMap;
29
+ private static nameContextMap;
30
+ private subscriptionMap;
31
+ private $$props?;
32
+ private static Attribute;
33
+ /**
34
+ * 添加事件监听
35
+ *
36
+ * @param {string} path 监听的路径
37
+ * @param {deep?:boolean;immediate?:boolean} options?
38
+ *
39
+ * @example
40
+ *
41
+ * @Widget.Watch('formData.name', {deep: true, immediate: true})
42
+ * private watchName(name: string) {
43
+ * ... todo
44
+ * }
45
+ *
46
+ */
47
+ protected static Watch(path: string, options?: {
48
+ deep?: boolean;
49
+ immediate?: boolean;
50
+ }): <T extends Widget<WidgetProps, unknown>, K>(target: T, nativeName: string, descriptor: TypedPropertyDescriptor<(newValue: K, oldValue?: K | undefined) => void> | TypedPropertyDescriptor<(newValue: K, oldValue?: K | undefined) => Promise<void>> | TypedPropertyDescriptor<(newValue?: K | undefined, oldValue?: K | undefined) => void> | TypedPropertyDescriptor<(newValue?: K | undefined, oldValue?: K | undefined) => Promise<void>>) => void;
51
+ private static Sub;
52
+ /**
53
+ * 可以用来处理不同widget之间的通讯,当被订阅的时候,会将默认值发送出去
54
+ *
55
+ * @param {Symbol} name 唯一标示
56
+ * @param {unknown} value? 默认值
57
+ *
58
+ * @example
59
+ *
60
+ * const identifier = Symbol('example-sub')
61
+ *
62
+ * * field.ts * // 文件
63
+ *
64
+ * @Widget.BehaviorSubContext(identifier, {value: '这是默认值'})
65
+ * private exampleSub!:WidgetBehaviorSubjection<{value: string}>
66
+ *
67
+ * onValueChange() {
68
+ * this.exampleSub.subject.next({value: '这是新的值'})
69
+ * }
70
+ *
71
+ * * other-field.ts * // 文件
72
+ * @Widget.BehaviorSubContext(identifier, {value: '这是默认值'})
73
+ * private exampleSub!:WidgetBehaviorSubjection<{value: string}>
74
+ *
75
+ * mounted() {
76
+ * this.exampleSub.subscribe((value) => {
77
+ * ...todo
78
+ * })
79
+ * }
80
+ *
81
+ */
82
+ protected static BehaviorSubContext(name: Symbol, value?: unknown): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
83
+ /**
84
+ * 与 `BehaviorSubContext` 一样,区别在于第一次不会发射默认值
85
+ *
86
+ * @param {Symbol} name 唯一标示
87
+ * @param {unknown} value? 默认值
88
+ */
89
+ protected static SubContext(name: Symbol, value?: unknown): <K extends Widget<WidgetProps, unknown>>(target: K, paramName: string) => void;
90
+ /**
91
+ * 将数据绑定为响应式,并且组件中可以获取该值
92
+ */
93
+ protected static Reactive(params?: {
94
+ displayName?: string;
95
+ render?: boolean;
96
+ }): <T extends Widget<WidgetProps, unknown>, K>(target: T, nativeName: string, description?: TypedPropertyDescriptor<K> | undefined) => void;
97
+ /**
98
+ * 将方法绑定为能够被组件获取的方法
99
+ */
100
+ protected static Method(displayName?: string): <T extends Widget<WidgetProps, unknown>, K>(target: T, nativeName: string, description?: TypedPropertyDescriptor<K> | undefined) => void;
101
+ static select<T extends Widget = Widget>(handle: string): T | undefined;
102
+ /**
103
+ * 获取上级注入的依赖,与 Provide 一起使用
104
+ *
105
+ * @param {string|Symbol} injectName? 被注入的name,如果不传递,那么取target中的name
106
+ *
107
+ * @example
108
+ *
109
+ * * children.ts * // 文件
110
+ *
111
+ * @Widget.Inject('InjectName')
112
+ * private rootData!:
113
+ *
114
+ * 如果要将该值变为响应式,如果加上Reactive
115
+ *
116
+ * @Widget.Reactive()
117
+ * @Widget.Inject('InjectName')
118
+ * private rootData!:;
119
+ */
120
+ protected static Inject(injectName?: string | Symbol): <T extends Widget<WidgetProps, unknown>>(target: T, name: string) => void;
121
+ /**
122
+ * 获取下级注入的依赖,与 Inject 一起使用
123
+ *
124
+ * @param {string|Symbol} provideName? 被注入的name,如果不传递,那么取target中的name
125
+ *
126
+ * @example
127
+ *
128
+ * * parent.ts * // 文件
129
+ *
130
+ * @Widget.Provide('ProvideName')
131
+ * private rootData!:
132
+ *
133
+ * 如果要将该值变为响应式,如果加上Reactive
134
+ *
135
+ * @Widget.Reactive()
136
+ * @Widget.Provide('ProvideName')
137
+ * private rootData!:;
138
+ */
139
+ protected static Provide(provideName?: string | Symbol): <T extends Widget<WidgetProps, unknown>>(target: T, name: string) => void;
140
+ private parent;
141
+ protected $$innerWidgetType: InnerWidgetType | null | undefined;
142
+ protected childrenInstance: Widget[];
143
+ protected children: Widget[];
144
+ protected childrenWidget: Widget[];
145
+ private readonly handle;
146
+ config: Props;
147
+ private name;
148
+ private initialized;
149
+ private self;
150
+ constructor(handle?: string);
151
+ protected getSelf(): Widget<WidgetProps, unknown> | null;
152
+ getOperator(): this;
153
+ initialize(config?: Props): Widget;
154
+ /**
155
+ * 销毁widget
156
+ *
157
+ * 内部会根据handle匹配到对应的widget,然后进行销毁,如果children中出现了相同的handle,那么会销毁第一个
158
+ */
159
+ dispose(force?: boolean): void;
160
+ /**
161
+ * 创建一个widget
162
+ *
163
+ * @param {Widget} constructor 对应的widget
164
+ * @param {string} name? 插槽
165
+ * @param {IViewProps} config? widget中initialize方法接收的参数
166
+ *
167
+ */
168
+ createWidget<T extends Widget>(constructor: WidgetConstructor<T['config'], T>, name?: string, config?: T['config'], specifiedIndex?: number): T;
169
+ getHandle(): HANDLE;
170
+ /**
171
+ * 删除指定的widget
172
+ */
173
+ deleteWidget(name: string): boolean;
174
+ moveChildWidget(endIndex: number, startIndex: number): void;
175
+ insertWidget(widget: Widget, index: number): void;
176
+ deleteWidgetByIndex(index: number, handle?: string): boolean;
177
+ getConfig(key: string): unknown;
178
+ getAllConfig(): Props;
179
+ getSibling(): Widget<WidgetProps, unknown>[] | null;
180
+ /**
181
+ * 返回当前元素在其父元素的子元素节点中的前一个元素节点,如果该元素已经是第一个元素节点,则返回 null
182
+ */
183
+ previousWidgetSibling(): Widget<WidgetProps, unknown> | null;
184
+ /**
185
+ * 返回当前元素在其父元素的子元素节点中的后一个元素节点,如果该元素已经是最后一个元素节点,则返回 null
186
+ */
187
+ nextWidgetSibling(): Widget<WidgetProps, unknown> | null;
188
+ /**
189
+ * 获取父元素
190
+ */
191
+ getParentWidget(): Widget | null;
192
+ /**
193
+ * 获取子元素
194
+ */
195
+ getChildrenWidget(): Widget<WidgetProps, unknown>[];
196
+ /**
197
+ * @inner
198
+ *
199
+ */
200
+ getParent(): Widget | null;
201
+ getName(): string;
202
+ getWidgetType(): string;
203
+ static getProtoChains<T extends Function>(obj: T): Function[];
204
+ private currentAttributeMapCache;
205
+ /**
206
+ * 获取所有的属性
207
+ */
208
+ getAttributes(): Map<string, string>;
209
+ /**
210
+ * 获取所有的监听事件
211
+ */
212
+ getWatchers(): watcher<unknown>[];
213
+ /**
214
+ * @deprecated 使用 getChildrenWidget()
215
+ *
216
+ * 获取所有的children
217
+ */
218
+ getChildren(): Widget[];
219
+ /**
220
+ * @inner
221
+ *
222
+ */
223
+ getChildrenInstance(): Widget[];
224
+ protected addChildrenInstance(widget: Widget): void;
225
+ protected getShared(injectName: string | Symbol): {
226
+ host?: Widget;
227
+ value?: unknown;
228
+ };
229
+ private releaseInjection;
230
+ getComputeHandler(name: string): any;
231
+ protected getProps(): string[];
232
+ abstract render(...args: any[]): R;
233
+ }
234
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './Widget';
2
+ export * from './VueWidget';
3
+ export * from './AsyncVueWidget';
@@ -0,0 +1,246 @@
1
+ import { ActiveRecord, ActiveRecords, DeleteActiveRecordsByEntityFunction, DeleteActiveRecordsByEntityPredict, DeleteActiveRecordsFunction, FlushActiveRecordsFunction, PushActiveRecordsFunction, PushActiveRecordsPredict, ReloadActiveRecordsFunction, SubmitCacheManager, UpdateActiveRecordsByEntityFunction, UpdateActiveRecordsByEntityPredict, UpdateActiveRecordsFunction, UpdateEntity } from '@oinone/kunlun-engine';
2
+ import { PathWidget, PathWidgetProps } from './PathWidget';
3
+ export interface ActiveRecordsWidgetProps extends PathWidgetProps {
4
+ dataSource?: ActiveRecords | null;
5
+ activeRecords?: ActiveRecords;
6
+ }
7
+ /**
8
+ * 数据记录组件
9
+ */
10
+ export declare class ActiveRecordsWidget<Props extends ActiveRecordsWidgetProps = ActiveRecordsWidgetProps> extends PathWidget<Props> {
11
+ initialize(props: Props): this;
12
+ /**
13
+ * 提交缓存管理器
14
+ * @protected
15
+ */
16
+ protected get submitCache(): SubmitCacheManager | undefined;
17
+ /**
18
+ * 上级根数据
19
+ * @protected
20
+ */
21
+ protected parentRootData: ActiveRecord[] | undefined;
22
+ /**
23
+ * 当前根数据
24
+ * @protected
25
+ */
26
+ private currentRootData;
27
+ /**
28
+ * 提供给下级的根数据
29
+ * @protected
30
+ */
31
+ get rootData(): ActiveRecord[] | undefined;
32
+ set rootData(rootData: ActiveRecord[] | undefined);
33
+ getCurrentRootData(): ActiveRecord[] | undefined;
34
+ setCurrentRootData(rootData: ActiveRecords | undefined): void;
35
+ protected parentReloadRootData: ReloadActiveRecordsFunction | undefined;
36
+ reloadRootData(records: ActiveRecords | undefined): void;
37
+ /**
38
+ * 上级数据源
39
+ * @protected
40
+ */
41
+ protected parentDataSource: ActiveRecord[] | undefined;
42
+ /**
43
+ * 当前数据源
44
+ * @protected
45
+ */
46
+ private currentDataSource;
47
+ /**
48
+ * 提供给下级的数据源
49
+ * @protected
50
+ */
51
+ get dataSource(): ActiveRecord[] | undefined;
52
+ set dataSource(dataSource: ActiveRecord[] | undefined);
53
+ getCurrentDataSource(): ActiveRecord[] | null | undefined;
54
+ setCurrentDataSource(dataSource: ActiveRecords | null | undefined): void;
55
+ protected parentReloadDataSource: ReloadActiveRecordsFunction | undefined;
56
+ /**
57
+ * 重新加载数据源到当前数据源中
58
+ * <pre>
59
+ * @Widget.Method()
60
+ * @Widget.Inject()
61
+ * private reloadDataSource: ReloadActiveRecordsFunction | undefined;
62
+ * </pre>
63
+ *
64
+ * @param records 数据
65
+ */
66
+ reloadDataSource(records: ActiveRecords | undefined): void;
67
+ protected parentPushDataSource: PushActiveRecordsFunction | undefined;
68
+ /**
69
+ * 添加数据源到当前数据源中
70
+ * <pre>
71
+ * @Widget.Method()
72
+ * @Widget.Inject()
73
+ * private pushDataSource: PushActiveRecordsFunction | undefined;
74
+ * </pre>
75
+ *
76
+ * @param records 数据
77
+ * @param predict 推送判定
78
+ */
79
+ pushDataSource(records: ActiveRecords, predict?: PushActiveRecordsPredict): void;
80
+ protected parentUpdateDataSource: UpdateActiveRecordsFunction | undefined;
81
+ /**
82
+ * 根据索引更新数据源
83
+ * <pre>
84
+ * @Widget.Method()
85
+ * @Widget.Inject()
86
+ * private updateDataSource: UpdateActiveRecordsFunction | undefined;
87
+ * </pre>
88
+ *
89
+ * @param records 数据
90
+ */
91
+ updateDataSource(records: UpdateEntity[]): void;
92
+ protected parentUpdateDataSourceByEntity: UpdateActiveRecordsByEntityFunction | undefined;
93
+ /**
94
+ * 根据数据更新数据源
95
+ * <pre>
96
+ * @Widget.Method()
97
+ * @Widget.Inject()
98
+ * private updateDataSourceByEntity: UpdateDataSourceByEntityFunction | undefined;
99
+ * </pre>
100
+ *
101
+ * @param records 数据
102
+ * @param predict 更新判定
103
+ */
104
+ updateDataSourceByEntity(records: ActiveRecords, predict?: UpdateActiveRecordsByEntityPredict): void;
105
+ protected parentDeleteDataSource: DeleteActiveRecordsFunction | undefined;
106
+ /**
107
+ * 根据索引删除数据源
108
+ * <pre>
109
+ * @Widget.Method()
110
+ * @Widget.Inject()
111
+ * private deleteDataSource: DeleteActiveRecordsFunction | undefined;
112
+ * </pre>
113
+ *
114
+ * @param recordIndexes 数据
115
+ */
116
+ deleteDataSource(recordIndexes: number[]): void;
117
+ protected parentDeleteDataSourceByEntity: DeleteActiveRecordsByEntityFunction | undefined;
118
+ /**
119
+ * 根据数据删除数据源
120
+ * <pre>
121
+ * @Widget.Method()
122
+ * @Widget.Inject()
123
+ * private deleteDataSourceByEntity: DeleteDataSourceByEntityFunction | undefined;
124
+ * </pre>
125
+ *
126
+ * @param records 数据
127
+ * @param predict 删除判定
128
+ */
129
+ deleteDataSourceByEntity(records: ActiveRecords, predict?: DeleteActiveRecordsByEntityPredict): void;
130
+ protected parentCreateDataSourceByEntity: PushActiveRecordsFunction | undefined;
131
+ createDataSourceByEntity(records: ActiveRecords, predict?: PushActiveRecordsPredict): void;
132
+ protected parentFlushDataSource: FlushActiveRecordsFunction | undefined;
133
+ /**
134
+ * 刷新数据源(数据向上提交)
135
+ * <pre>
136
+ * @Widget.Method()
137
+ * @Widget.Inject()
138
+ * private flushActiveRecords: FlushActiveRecordsFunction | undefined;
139
+ * </pre>
140
+ */
141
+ flushDataSource(): void;
142
+ /**
143
+ * 上级数据记录,不可直接修改,仅在挂载时加载到当前数据记录
144
+ */
145
+ protected parentActiveRecords: ActiveRecord[] | undefined;
146
+ /**
147
+ * 上级视图数据
148
+ */
149
+ protected parentViewActiveRecords: ActiveRecord[] | undefined;
150
+ /**
151
+ * 当前数据记录,不存在时将进行数据透传
152
+ */
153
+ private currentActiveRecords;
154
+ /**
155
+ * 提供给下级的数据记录
156
+ */
157
+ get activeRecords(): ActiveRecord[] | undefined;
158
+ set activeRecords(activeRecords: ActiveRecord[] | undefined);
159
+ getCurrentActiveRecords(): ActiveRecord[] | undefined;
160
+ setCurrentActiveRecords(activeRecords: ActiveRecords | undefined): void;
161
+ protected parentReloadActiveRecords: ReloadActiveRecordsFunction | undefined;
162
+ /**
163
+ * 重新加载数据记录到当前数据记录中
164
+ * <pre>
165
+ * @Widget.Method()
166
+ * @Widget.Inject()
167
+ * private reloadActiveRecords: ReloadActiveRecordsFunction | undefined;
168
+ * </pre>
169
+ *
170
+ * @param records 数据
171
+ */
172
+ reloadActiveRecords(records: ActiveRecords | undefined): void;
173
+ protected parentPushActiveRecords: PushActiveRecordsFunction | undefined;
174
+ /**
175
+ * 添加数据记录到当前数据记录中
176
+ * <pre>
177
+ * @Widget.Method()
178
+ * @Widget.Inject()
179
+ * private pushActiveRecords: PushActiveRecordsFunction | undefined;
180
+ * </pre>
181
+ *
182
+ * @param records 数据
183
+ * @param predict 推送判定
184
+ */
185
+ pushActiveRecords(records: ActiveRecords, predict?: PushActiveRecordsPredict): void;
186
+ protected parentUpdateActiveRecords: UpdateActiveRecordsFunction | undefined;
187
+ /**
188
+ * 根据索引更新数据记录
189
+ * <pre>
190
+ * @Widget.Method()
191
+ * @Widget.Inject()
192
+ * private updateActiveRecords: UpdateActiveRecordsFunction | undefined;
193
+ * </pre>
194
+ *
195
+ * @param records 数据
196
+ */
197
+ updateActiveRecords(records: UpdateEntity[]): void;
198
+ protected parentUpdateActiveRecordsByEntity: UpdateActiveRecordsByEntityFunction | undefined;
199
+ /**
200
+ * 根据数据更新数据记录
201
+ * <pre>
202
+ * @Widget.Method()
203
+ * @Widget.Inject()
204
+ * private updateActiveRecordsByEntity: UpdateActiveRecordsByEntityFunction | undefined;
205
+ * </pre>
206
+ *
207
+ * @param records 数据
208
+ * @param updatePredict 更新判定
209
+ */
210
+ updateActiveRecordsByEntity(records: ActiveRecords, updatePredict?: UpdateActiveRecordsByEntityPredict): void;
211
+ protected parentDeleteActiveRecords: DeleteActiveRecordsFunction | undefined;
212
+ /**
213
+ * 根据索引删除数据记录
214
+ * <pre>
215
+ * @Widget.Method()
216
+ * @Widget.Inject()
217
+ * private deleteActiveRecords: DeleteActiveRecordsFunction | undefined;
218
+ * </pre>
219
+ *
220
+ * @param recordIndexes 数据
221
+ */
222
+ deleteActiveRecords(recordIndexes: number[]): void;
223
+ protected parentDeleteActiveRecordsByEntity: DeleteActiveRecordsByEntityFunction | undefined;
224
+ /**
225
+ * 根据数据删除数据记录
226
+ * <pre>
227
+ * @Widget.Method()
228
+ * @Widget.Inject()
229
+ * private deleteActiveRecordsByEntity: DeleteActiveRecordsByEntityFunction | undefined;
230
+ * </pre>
231
+ *
232
+ * @param records 数据
233
+ * @param predict 删除判定
234
+ */
235
+ deleteActiveRecordsByEntity(records: ActiveRecords, predict?: DeleteActiveRecordsByEntityPredict): void;
236
+ protected parentFlushActiveRecords: FlushActiveRecordsFunction | undefined;
237
+ /**
238
+ * 刷新数据记录(数据向上提交)
239
+ * <pre>
240
+ * @Widget.Method()
241
+ * @Widget.Inject()
242
+ * private flushActiveRecords: FlushActiveRecordsFunction | undefined;
243
+ * </pre>
244
+ */
245
+ flushActiveRecords(): void;
246
+ }
@@ -0,0 +1,34 @@
1
+ import { DslDefinitionWidgetProps, DslDefinitionWidget } from '../dsl';
2
+ export interface PathWidgetProps extends DslDefinitionWidgetProps {
3
+ path?: string;
4
+ subPath?: string;
5
+ subIndex?: string | number;
6
+ __index?: number;
7
+ }
8
+ /**
9
+ * 路径组件
10
+ */
11
+ export declare class PathWidget<Props extends PathWidgetProps = PathWidgetProps> extends DslDefinitionWidget<Props> {
12
+ /**
13
+ * 上级路径
14
+ */
15
+ protected parentPath: string | undefined;
16
+ /**
17
+ * 当前子路径
18
+ */
19
+ protected subPath: string | undefined;
20
+ /**
21
+ * 当前子路径索引
22
+ */
23
+ protected subIndex: string | number | undefined;
24
+ /**
25
+ * 当前指定路径
26
+ * @protected
27
+ */
28
+ protected currentPath: string | undefined;
29
+ /**
30
+ * 完整路径
31
+ */
32
+ get path(): string;
33
+ initialize(props: Props): this;
34
+ }
@@ -0,0 +1,2 @@
1
+ export * from './PathWidget';
2
+ export * from './ActiveRecordsWidget';
@@ -0,0 +1,61 @@
1
+ import { ComputeContext, RuntimeContext, RuntimeModelField } from '@oinone/kunlun-engine';
2
+ import { InvisibleSupported } from '../feature';
3
+ import { DslRenderWidget, DslRenderWidgetProps } from './DslRenderWidget';
4
+ /**
5
+ * dsl组件属性
6
+ */
7
+ export interface DslDefinitionWidgetProps extends DslRenderWidgetProps {
8
+ /**
9
+ * 元数据视图handle
10
+ */
11
+ metadataHandle?: string;
12
+ /**
13
+ * 根组件handle(一般为视图组件)
14
+ */
15
+ rootHandle?: string;
16
+ /**
17
+ * 是否内联组件
18
+ */
19
+ inline?: boolean;
20
+ /**
21
+ * 自动组件
22
+ */
23
+ automatic?: boolean;
24
+ }
25
+ /**
26
+ * dsl定义组件
27
+ */
28
+ export declare class DslDefinitionWidget<Props extends DslDefinitionWidgetProps = DslDefinitionWidgetProps> extends DslRenderWidget<Props> implements InvisibleSupported {
29
+ protected automatic: boolean;
30
+ protected metadataHandle: string | undefined;
31
+ getMetadataHandle(): string | undefined;
32
+ protected rootHandle: string | undefined;
33
+ getRootHandle(): string | undefined;
34
+ protected readonly currentHandle: string;
35
+ getCurrentHandle(): string;
36
+ protected inline: boolean | undefined;
37
+ protected defaultAllInvisible: boolean;
38
+ get allInvisible(): boolean | undefined;
39
+ private invisibleState;
40
+ private lastedInvisibleState;
41
+ parentInvisible: boolean | undefined;
42
+ get invisible(): boolean;
43
+ get parentInvisibleProvider(): boolean;
44
+ constructor(handle?: string);
45
+ initialize(props: Props): this;
46
+ get metadataRuntimeContext(): RuntimeContext;
47
+ get rootRuntimeContext(): RuntimeContext;
48
+ get rootComputeContext(): ComputeContext | undefined;
49
+ get rootViewRuntimeContext(): {
50
+ runtimeContext: RuntimeContext;
51
+ fields: RuntimeModelField[];
52
+ };
53
+ protected invisibleProcess(invisible: boolean | string): boolean | undefined;
54
+ protected childrenInvisibleProcess(): boolean;
55
+ protected resetInvisible(): void;
56
+ protected resetParentInvisible(): void;
57
+ protected $$mounted(): void;
58
+ protected $$updated(): void;
59
+ protected $$unmountedAfterProperties(): void;
60
+ protected allMounted(): void;
61
+ }
@@ -0,0 +1,42 @@
1
+ import { DslDefinition } from '@oinone/kunlun-dsl';
2
+ import { DslProps, RuntimeContext } from '@oinone/kunlun-engine';
3
+ import { IDslNode } from '@oinone/kunlun-meta';
4
+ import { VueWidget } from '../basic';
5
+ /**
6
+ * @deprecated 请使用PathWidget或ActiveRecordsWidget
7
+ */
8
+ export declare class DslNodeWidget<IViewProps extends DslProps = DslProps> extends VueWidget<IViewProps> {
9
+ protected metadataHandle: string | undefined;
10
+ protected rootHandle: string | undefined;
11
+ protected currentHandle: string;
12
+ protected dslNode?: IDslNode;
13
+ protected template: DslDefinition | undefined;
14
+ protected slotName: string | undefined;
15
+ /**
16
+ * 上级路径
17
+ */
18
+ protected parentPath: string | undefined;
19
+ /**
20
+ * 当前子路径
21
+ */
22
+ protected subPath: string | undefined;
23
+ /**
24
+ * 当前子路径
25
+ */
26
+ protected subIndex: string | number | undefined;
27
+ /**
28
+ * 完整路径
29
+ */
30
+ protected get widgetPath(): string;
31
+ protected widgetInline: boolean | undefined;
32
+ protected get variables(): Record<string, unknown>;
33
+ initialize(config: IViewProps): this;
34
+ getDsl(): IDslNode;
35
+ getSlotName(): string | undefined;
36
+ /**
37
+ * 根据标签名获取dsl
38
+ */
39
+ getDslChildrenByLabel(labelName: string): IDslNode | null | undefined;
40
+ get metadataRuntimeContext(): RuntimeContext | undefined;
41
+ get rootRuntimeContext(): RuntimeContext | undefined;
42
+ }
@@ -0,0 +1,44 @@
1
+ import { DslDefinition, DslSlots } from '@oinone/kunlun-dsl';
2
+ import { WidgetProps } from '@oinone/kunlun-engine';
3
+ import { Slots, VNode } from 'vue';
4
+ import { VueWidget } from '../basic';
5
+ /**
6
+ * dsl渲染组件属性
7
+ */
8
+ export interface DslRenderWidgetProps extends WidgetProps {
9
+ /**
10
+ * 内部组件
11
+ */
12
+ internal?: boolean;
13
+ /**
14
+ * 模板dsl定义
15
+ */
16
+ template?: DslDefinition;
17
+ /**
18
+ * 在父组件中的插槽名
19
+ */
20
+ slotName?: string;
21
+ /**
22
+ * 支持的插槽名称
23
+ */
24
+ slotNames?: string[];
25
+ /**
26
+ * 插槽上下文
27
+ */
28
+ slotContext?: Record<string, unknown>;
29
+ }
30
+ export declare class DslRenderWidget<Props extends DslRenderWidgetProps = DslRenderWidgetProps> extends VueWidget {
31
+ protected internal: boolean;
32
+ protected template: DslDefinition | undefined;
33
+ protected slotName: string | undefined;
34
+ protected supportedSlotNames: string[];
35
+ protected dslSlots: DslSlots | undefined;
36
+ protected slots: Slots | null | undefined;
37
+ initialize(props: Props): this;
38
+ getDsl(): DslDefinition;
39
+ getSlotName(): string | undefined;
40
+ render(ctx?: Record<string, unknown>, slots?: Slots): VNode | VNode[];
41
+ protected rawRender(ctx?: Record<string, unknown>, slots?: Slots): VNode | VNode[];
42
+ protected internalRender(slots?: Slots): Slots | undefined;
43
+ protected commonRender(slots?: Slots): Slots | undefined;
44
+ }
@@ -0,0 +1,3 @@
1
+ export * from './DslNodeWidget';
2
+ export * from './DslDefinitionWidget';
3
+ export * from './DslRenderWidget';
@@ -0,0 +1 @@
1
+ export * from './invisible-supported';
@@ -0,0 +1,11 @@
1
+ import { Widget } from '../basic';
2
+ declare type InvisibleGetter = () => boolean;
3
+ /**
4
+ * 标记可隐藏功能支持
5
+ */
6
+ export interface InvisibleSupported {
7
+ invisible: boolean | InvisibleGetter | undefined;
8
+ }
9
+ export declare function executeInvisible(invisibleSupported: InvisibleSupported | undefined): boolean;
10
+ export declare function isAllInvisible(widgets: (Widget | InvisibleSupported)[] | undefined): boolean;
11
+ export {};