@byteluck-fe/model-driven-driven 6.2.0-1-beta.23 → 6.2.0-1-beta.24

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.
@@ -1,9 +1,9 @@
1
- import { ControlDesignerInstance } from '@byteluck-fe/model-driven-core';
2
- import { CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
3
- export declare class Builder {
4
- private designer;
5
- ListPageBuilder(): ControlDesignerInstance<'list-view'>;
6
- ProListPageBuilder(): ControlDesignerInstance<'list-view'>;
7
- FormPageBuilder(): ControlDesignerInstance<'data-view'>;
8
- VuePageBuilder(): ControlDesignerInstance<CONTROL_TYPE.VUE_PAGE>;
9
- }
1
+ import { ControlDesignerInstance } from '@byteluck-fe/model-driven-core';
2
+ import { CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
3
+ export declare class Builder {
4
+ private designer;
5
+ ListPageBuilder(): ControlDesignerInstance<'list-view'>;
6
+ ProListPageBuilder(): ControlDesignerInstance<'list-view'>;
7
+ FormPageBuilder(): ControlDesignerInstance<'data-view'>;
8
+ VuePageBuilder(): ControlDesignerInstance<CONTROL_TYPE.VUE_PAGE>;
9
+ }
@@ -1,36 +1,36 @@
1
- import { ControlDesigner, ControlDesignerInstance, ControlsKeys, RegisterControls, controlHooksEmitter, ControlExport } from '@byteluck-fe/model-driven-core';
2
- import EventLogic from './EventLogic';
3
- import { FieldTypes } from '@byteluck-fe/model-driven-shared';
4
- import { toSchema, getModelBindInfoList, checkSchema } from './utils';
5
- interface ToolboxType {
6
- key: string;
7
- title: string;
8
- children: ControlDesigner<ControlsKeys>[];
9
- }
10
- interface DesignerServices {
11
- getUsersByIds?: (userIds: string[]) => Promise<any>;
12
- remoteUserByName?: (username: string) => Promise<any>;
13
- getDeptByIds?: (deptIds: string[]) => Promise<any>;
14
- remoteDeptByName?: (deptName: string) => Promise<any>;
15
- getAddress?: (params: any, addressType: string[]) => Promise<any>;
16
- uploadFile?: (params: any) => Promise<any>;
17
- }
18
- export default class Designer<EventKeys extends string = string> extends RegisterControls<'Designer'> {
19
- static EventLogic: typeof EventLogic;
20
- toolbox: ToolboxType[];
21
- readonly services: DesignerServices;
22
- readonly eventLogic: EventLogic;
23
- readonly fieldTypes: typeof FieldTypes;
24
- controlSettingMap: Map<string, ControlExport['Setting']>;
25
- constructor();
26
- registerControl(control: ControlExport): void;
27
- getControlSetting(type: string): any[] | null;
28
- setInstance(instance: ControlDesignerInstance<ControlsKeys>, props: string, value: unknown): void;
29
- eachControls(callback: (value: ControlDesigner<ControlsKeys>, index: number, array: ControlDesigner<ControlsKeys>[]) => void): void;
30
- getInitControl(): ControlDesignerInstance<ControlsKeys>[];
31
- checkSchema(...args: Parameters<typeof checkSchema>): Promise<ReturnType<typeof checkSchema>>;
32
- getModelBindInfoList(...args: Parameters<typeof getModelBindInfoList>): ReturnType<typeof getModelBindInfoList>;
33
- getSchema(...args: Parameters<typeof toSchema>): ReturnType<typeof toSchema>;
34
- listenControlHook(...args: Parameters<(typeof controlHooksEmitter)['on']>): ReturnType<(typeof controlHooksEmitter)['on']>;
35
- }
36
- export { ToolboxType, DesignerServices, Designer };
1
+ import { ControlDesigner, ControlDesignerInstance, ControlsKeys, RegisterControls, controlHooksEmitter, ControlExport } from '@byteluck-fe/model-driven-core';
2
+ import EventLogic from './EventLogic';
3
+ import { FieldTypes } from '@byteluck-fe/model-driven-shared';
4
+ import { toSchema, getModelBindInfoList, checkSchema } from './utils';
5
+ interface ToolboxType {
6
+ key: string;
7
+ title: string;
8
+ children: ControlDesigner<ControlsKeys>[];
9
+ }
10
+ interface DesignerServices {
11
+ getUsersByIds?: (userIds: string[]) => Promise<any>;
12
+ remoteUserByName?: (username: string) => Promise<any>;
13
+ getDeptByIds?: (deptIds: string[]) => Promise<any>;
14
+ remoteDeptByName?: (deptName: string) => Promise<any>;
15
+ getAddress?: (params: any, addressType: string[]) => Promise<any>;
16
+ uploadFile?: (params: any) => Promise<any>;
17
+ }
18
+ export default class Designer<EventKeys extends string = string> extends RegisterControls<'Designer'> {
19
+ static EventLogic: typeof EventLogic;
20
+ toolbox: ToolboxType[];
21
+ readonly services: DesignerServices;
22
+ readonly eventLogic: EventLogic;
23
+ readonly fieldTypes: typeof FieldTypes;
24
+ controlSettingMap: Map<string, ControlExport['Setting']>;
25
+ constructor();
26
+ registerControl(control: ControlExport): void;
27
+ getControlSetting(type: string): any[] | null;
28
+ setInstance(instance: ControlDesignerInstance<ControlsKeys>, props: string, value: unknown): void;
29
+ eachControls(callback: (value: ControlDesigner<ControlsKeys>, index: number, array: ControlDesigner<ControlsKeys>[]) => void): void;
30
+ getInitControl(): ControlDesignerInstance<ControlsKeys>[];
31
+ checkSchema(...args: Parameters<typeof checkSchema>): Promise<ReturnType<typeof checkSchema>>;
32
+ getModelBindInfoList(...args: Parameters<typeof getModelBindInfoList>): ReturnType<typeof getModelBindInfoList>;
33
+ getSchema(...args: Parameters<typeof toSchema>): ReturnType<typeof toSchema>;
34
+ listenControlHook(...args: Parameters<(typeof controlHooksEmitter)['on']>): ReturnType<(typeof controlHooksEmitter)['on']>;
35
+ }
36
+ export { ToolboxType, DesignerServices, Designer };
@@ -1,114 +1,114 @@
1
- import { Callback, Watcher } from '@byteluck-fe/model-driven-shared';
2
- import { Store, StoreOptions } from './Store';
3
- import { Designer } from './Designer';
4
- import EventLogic from './EventLogic';
5
- import { Plugin } from './Plugin';
6
- import { DesignerControl, ControlDesignerInstance, ControlsKeys, Schema, DeepPartial, Messages, BeforeCreateInstance } from '@byteluck-fe/model-driven-core';
7
- import { generatePermissions, getModelBindInfoList, toSchema } from './utils';
8
- import { Settings } from '@byteluck-fe/model-driven-settings';
9
- type EventKeys = 'before-validate' | 'validated' | 'updated' | 'joined' | 'moved' | 'removed' | 'select' | 'field-changed';
10
- type SchemaBaseType = Schema<ControlsKeys>;
11
- interface DrivenOptions {
12
- autoMount?: boolean;
13
- plugins?: Plugin[];
14
- Designer?: typeof Designer;
15
- mode?: string;
16
- schema: SchemaBaseType | SchemaBaseType[];
17
- store?: Omit<StoreOptions, 'instance'>;
18
- messagesI18n?: Object;
19
- language?: string;
20
- }
21
- /**
22
- * 设计器驱动
23
- * */
24
- declare class Driven extends Watcher<EventKeys> {
25
- /**
26
- * 控件事件定义
27
- * */
28
- static EventLogic: typeof EventLogic;
29
- readonly mode: string;
30
- isMounted: boolean;
31
- id: string;
32
- /**
33
- * 控件可选的事件
34
- * */
35
- readonly eventLogic: EventLogic;
36
- /**
37
- * 处理数据存储,存放模型等
38
- * */
39
- store: Store;
40
- /**
41
- * 额外参数存储
42
- */
43
- externalParams?: Record<string, any>;
44
- /**
45
- * 处理instance,和schema存储
46
- * */
47
- private designer;
48
- /**
49
- * 插件数组
50
- * */
51
- private __plugins;
52
- private __pluginsApplied;
53
- private readonly $options;
54
- constructor(options: DrivenOptions);
55
- mount(): void;
56
- use(plugin: Plugin): this;
57
- private applyPlugins;
58
- emit(key: EventKeys, ...payload: any[]): Promise<unknown[]>;
59
- on(key: EventKeys, callback: Callback): void;
60
- setInstances(schema: DrivenOptions['schema'], beforeCreateInstance?: BeforeCreateInstance): void;
61
- private beforeSelectInstance;
62
- private afterSelectInstance;
63
- private setSelectedInstanceSetting;
64
- private concatSetting;
65
- private formatGroupSetting;
66
- setControlConfig(...args: Parameters<Designer['registerControlConfig']>): Designer<string>;
67
- getControlConfig(control: ControlsKeys): Readonly<Record<string, unknown>> | undefined;
68
- getControlSetting(type: ControlsKeys): Settings;
69
- selectInstance(instance: DesignerControl | null): void;
70
- setSelectedFieldItem(fieldItem: Parameters<Store['setSelectedFieldItem']>[0]): void;
71
- moveStart(instance: DesignerControl | string): void;
72
- moveEnd(instance?: DesignerControl | string | null): void;
73
- createInstance<T extends ControlsKeys>(type: T, initSchema?: DeepPartial<Schema<T>>): ControlDesignerInstance<T> | undefined;
74
- getInstance(instanceId: DesignerControl | string): DesignerControl | undefined;
75
- getInstances(): DesignerControl[];
76
- getInstancesFromType<T extends ControlsKeys>(type: T): ControlDesignerInstance<T>[];
77
- getDataScopeInstances(): DesignerControl[];
78
- getDataScopeInstancesFromType<T extends ControlsKeys>(type: T): ControlDesignerInstance<T>[];
79
- private updateInstancePropValue;
80
- private updateInstanceProps;
81
- setInstance<T extends DesignerControl>(instance: T, props: DeepPartial<T['props']>, payload?: any): void;
82
- setInstance<T extends DesignerControl>(instance: T, propName: string, value: unknown, payload?: any): void;
83
- /**
84
- * 删除控件
85
- * */
86
- removeInstance(instance: DesignerControl): void;
87
- replaceInstance(oldInstance: DesignerControl, newInstance: DesignerControl): void;
88
- /**
89
- * 修改控件类型
90
- * */
91
- updateInstanceType<T extends ControlsKeys>(instance: DesignerControl, type: T): ControlDesignerInstance<T> | undefined;
92
- validate(messages?: Messages, ignore?: string[]): Promise<boolean>;
93
- getSchema: typeof toSchema;
94
- getModelBindInfoList: typeof getModelBindInfoList;
95
- generatePermissions: typeof generatePermissions;
96
- getCustomControlsInUse(): string[];
97
- assertInstanceIsCustomControl(instance: DesignerControl | string): boolean;
98
- static register(...arg: Parameters<(typeof Designer)['register']>): typeof Driven;
99
- static judgeControlIsRegistered(control: Parameters<(typeof Designer)['register']>[0]): boolean;
100
- judgeControlIsRegistered(control: Parameters<(typeof Designer)['register']>[0]): boolean;
101
- register(...arg: Parameters<(typeof Designer)['register']>): this;
102
- /**
103
- * 判断控件的类型,返回当前控件的正确类型
104
- * */
105
- assertInstance<T extends ControlsKeys>(instance: DesignerControl, types: T | T[]): instance is ControlDesignerInstance<T>;
106
- /**
107
- * 控件在列表控件内,如明细子表或列表控件
108
- * */
109
- getInstanceInListControl(instance: DesignerControl): boolean;
110
- getInstanceParentControl<T extends ControlsKeys>(instance: DesignerControl, controlType: T): ControlDesignerInstance<T> | undefined;
111
- private callSelectedEffect;
112
- private callSelectedScopeEffect;
113
- }
114
- export { Driven };
1
+ import { Callback, Watcher } from '@byteluck-fe/model-driven-shared';
2
+ import { Store, StoreOptions } from './Store';
3
+ import { Designer } from './Designer';
4
+ import EventLogic from './EventLogic';
5
+ import { Plugin } from './Plugin';
6
+ import { DesignerControl, ControlDesignerInstance, ControlsKeys, Schema, DeepPartial, Messages, BeforeCreateInstance } from '@byteluck-fe/model-driven-core';
7
+ import { generatePermissions, getModelBindInfoList, toSchema } from './utils';
8
+ import { Settings } from '@byteluck-fe/model-driven-settings';
9
+ type EventKeys = 'before-validate' | 'validated' | 'updated' | 'joined' | 'moved' | 'removed' | 'select' | 'field-changed';
10
+ type SchemaBaseType = Schema<ControlsKeys>;
11
+ interface DrivenOptions {
12
+ autoMount?: boolean;
13
+ plugins?: Plugin[];
14
+ Designer?: typeof Designer;
15
+ mode?: string;
16
+ schema: SchemaBaseType | SchemaBaseType[];
17
+ store?: Omit<StoreOptions, 'instance'>;
18
+ messagesI18n?: Object;
19
+ language?: string;
20
+ }
21
+ /**
22
+ * 设计器驱动
23
+ * */
24
+ declare class Driven extends Watcher<EventKeys> {
25
+ /**
26
+ * 控件事件定义
27
+ * */
28
+ static EventLogic: typeof EventLogic;
29
+ readonly mode: string;
30
+ isMounted: boolean;
31
+ id: string;
32
+ /**
33
+ * 控件可选的事件
34
+ * */
35
+ readonly eventLogic: EventLogic;
36
+ /**
37
+ * 处理数据存储,存放模型等
38
+ * */
39
+ store: Store;
40
+ /**
41
+ * 额外参数存储
42
+ */
43
+ externalParams?: Record<string, any>;
44
+ /**
45
+ * 处理instance,和schema存储
46
+ * */
47
+ private designer;
48
+ /**
49
+ * 插件数组
50
+ * */
51
+ private __plugins;
52
+ private __pluginsApplied;
53
+ private readonly $options;
54
+ constructor(options: DrivenOptions);
55
+ mount(): void;
56
+ use(plugin: Plugin): this;
57
+ private applyPlugins;
58
+ emit(key: EventKeys, ...payload: any[]): Promise<unknown[]>;
59
+ on(key: EventKeys, callback: Callback): void;
60
+ setInstances(schema: DrivenOptions['schema'], beforeCreateInstance?: BeforeCreateInstance): void;
61
+ private beforeSelectInstance;
62
+ private afterSelectInstance;
63
+ private setSelectedInstanceSetting;
64
+ private concatSetting;
65
+ private formatGroupSetting;
66
+ setControlConfig(...args: Parameters<Designer['registerControlConfig']>): Designer<string>;
67
+ getControlConfig(control: ControlsKeys): Readonly<Record<string, unknown>> | undefined;
68
+ getControlSetting(type: ControlsKeys): Settings;
69
+ selectInstance(instance: DesignerControl | null): void;
70
+ setSelectedFieldItem(fieldItem: Parameters<Store['setSelectedFieldItem']>[0]): void;
71
+ moveStart(instance: DesignerControl | string): void;
72
+ moveEnd(instance?: DesignerControl | string | null): void;
73
+ createInstance<T extends ControlsKeys>(type: T, initSchema?: DeepPartial<Schema<T>>): ControlDesignerInstance<T> | undefined;
74
+ getInstance(instanceId: DesignerControl | string): DesignerControl | undefined;
75
+ getInstances(): DesignerControl[];
76
+ getInstancesFromType<T extends ControlsKeys>(type: T): InstanceType<import("@byteluck-fe/model-driven-core").ControlDesigner<T>>[];
77
+ getDataScopeInstances(): DesignerControl[];
78
+ getDataScopeInstancesFromType<T extends ControlsKeys>(type: T): InstanceType<import("@byteluck-fe/model-driven-core").ControlDesigner<T>>[];
79
+ private updateInstancePropValue;
80
+ private updateInstanceProps;
81
+ setInstance<T extends DesignerControl>(instance: T, props: DeepPartial<T['props']>, payload?: any): void;
82
+ setInstance<T extends DesignerControl>(instance: T, propName: string, value: unknown, payload?: any): void;
83
+ /**
84
+ * 删除控件
85
+ * */
86
+ removeInstance(instance: DesignerControl): void;
87
+ replaceInstance(oldInstance: DesignerControl, newInstance: DesignerControl): void;
88
+ /**
89
+ * 修改控件类型
90
+ * */
91
+ updateInstanceType<T extends ControlsKeys>(instance: DesignerControl, type: T): ControlDesignerInstance<T> | undefined;
92
+ validate(messages?: Messages, ignore?: string[]): Promise<boolean>;
93
+ getSchema: typeof toSchema;
94
+ getModelBindInfoList: typeof getModelBindInfoList;
95
+ generatePermissions: typeof generatePermissions;
96
+ getCustomControlsInUse(): string[];
97
+ assertInstanceIsCustomControl(instance: DesignerControl | string): boolean;
98
+ static register(...arg: Parameters<(typeof Designer)['register']>): typeof Driven;
99
+ static judgeControlIsRegistered(control: Parameters<(typeof Designer)['register']>[0]): boolean;
100
+ judgeControlIsRegistered(control: Parameters<(typeof Designer)['register']>[0]): boolean;
101
+ register(...arg: Parameters<(typeof Designer)['register']>): this;
102
+ /**
103
+ * 判断控件的类型,返回当前控件的正确类型
104
+ * */
105
+ assertInstance<T extends ControlsKeys>(instance: DesignerControl, types: T | T[]): instance is ControlDesignerInstance<T>;
106
+ /**
107
+ * 控件在列表控件内,如明细子表或列表控件
108
+ * */
109
+ getInstanceInListControl(instance: DesignerControl): boolean;
110
+ getInstanceParentControl<T extends ControlsKeys>(instance: DesignerControl, controlType: T): ControlDesignerInstance<T> | undefined;
111
+ private callSelectedEffect;
112
+ private callSelectedScopeEffect;
113
+ }
114
+ export { Driven };
@@ -1,2 +1,2 @@
1
- import { EventLogic } from '@byteluck-fe/model-driven-shared';
2
- export default EventLogic;
1
+ import { EventLogic } from '@byteluck-fe/model-driven-shared';
2
+ export default EventLogic;
@@ -1,6 +1,6 @@
1
- import { Driven } from './Driven';
2
- declare abstract class Plugin {
3
- abstract pluginName?: string;
4
- abstract apply(driven: Driven): void;
5
- }
6
- export { Plugin };
1
+ import { Driven } from './Driven';
2
+ declare abstract class Plugin {
3
+ abstract pluginName?: string;
4
+ abstract apply(driven: Driven): void;
5
+ }
6
+ export { Plugin };
@@ -1,82 +1,82 @@
1
- import { DesignerControl, ControlDesignerInstance, DesignerLayoutControl, DesignerListControl } from '@byteluck-fe/model-driven-core';
2
- import { Rules } from 'async-validator';
3
- import { Settings, Setting } from '@byteluck-fe/model-driven-settings';
4
- export interface StoreOptions {
5
- instance: DesignerControl[];
6
- getParentBeforeInstanceMove?: (instance: DesignerControl) => DesignerControl | null;
7
- }
8
- type DataScopeControl = ControlDesignerInstance<'data-view' | 'subtable' | 'list-view'> | null;
9
- export declare class Store {
10
- /**
11
- * 页面控件实例树
12
- * */
13
- instance: DesignerControl[];
14
- /**
15
- * 拍平的控件数组
16
- * */
17
- flatInstances: DesignerControl[];
18
- /**
19
- * 控件id组成的map
20
- * */
21
- instanceIdMap: Map<string, DesignerControl>;
22
- /**
23
- * dataCode和fieldCode组成的map
24
- * {
25
- * [主表dataCode]: {
26
- * [fieldCode]: 控件
27
- * },
28
- * [子表dataCode]: {
29
- * [fieldCode]: 控件
30
- * }
31
- * }
32
- * */
33
- dataFieldCodeMap: Map<string, Map<string, DesignerControl>>;
34
- /**
35
- * 当前选中的控件
36
- * */
37
- selected: DesignerControl | null;
38
- /**
39
- * 当前选中的数据作用域控件
40
- * */
41
- selectedInstanceDataScopeParent: DataScopeControl;
42
- selectedDataScopeFlatInstances: DesignerControl[];
43
- /**
44
- * 当前选中控件的setting
45
- * */
46
- selectedInstanceSetting: Settings;
47
- selectedInstanceSettingItems: Setting[];
48
- /**
49
- * 当前选中控件的数据模型
50
- * */
51
- selectedFieldItem: any;
52
- /**
53
- * 扩展字段,比如appId,dataCode等
54
- * */
55
- external: Record<string, any>;
56
- movingInstance: DesignerControl | null;
57
- movingInstanceOldParent: DesignerControl | null;
58
- movingInstanceOldDataScopeParent: DataScopeControl;
59
- private readonly getParentBeforeInstanceMove;
60
- constructor(options: StoreOptions);
61
- /**
62
- * 当前选中控件的rules
63
- * */
64
- get selectedRules(): Rules | null;
65
- /**
66
- * 当前选中控件的antd rules
67
- * */
68
- get selectedAntdRules(): Rules | null;
69
- setInstances(instances: DesignerControl[]): void;
70
- setSelectInstance(instance: DesignerControl | null): void;
71
- setSelectInstanceSettings(settings: Settings): void;
72
- private getSettingItems;
73
- setSelectedFieldItem(fieldItem: Record<string, any> | null): void;
74
- setMovingInstance(instance: DesignerControl | null): void;
75
- updateDataFieldCodeMap(instance: DesignerControl): void;
76
- getFlatInstances(): void;
77
- }
78
- export declare function loop(instances: DesignerControl[] | DesignerControl, callback: (instance: DesignerControl) => void): void;
79
- export declare function isDataScopeInstance(instance: DesignerControl): instance is Exclude<DataScopeControl, null>;
80
- export declare function findInstanceDataScopeParent(instance: DesignerControl | null): any;
81
- export declare function getDataScopeFlatInstances(dataScopeInstance: DesignerLayoutControl | DesignerListControl): DesignerControl[];
82
- export {};
1
+ import { DesignerControl, ControlDesignerInstance, DesignerLayoutControl, DesignerListControl } from '@byteluck-fe/model-driven-core';
2
+ import { Rules } from 'async-validator';
3
+ import { Settings, Setting } from '@byteluck-fe/model-driven-settings';
4
+ export interface StoreOptions {
5
+ instance: DesignerControl[];
6
+ getParentBeforeInstanceMove?: (instance: DesignerControl) => DesignerControl | null;
7
+ }
8
+ type DataScopeControl = ControlDesignerInstance<'data-view' | 'subtable' | 'list-view'> | null;
9
+ export declare class Store {
10
+ /**
11
+ * 页面控件实例树
12
+ * */
13
+ instance: DesignerControl[];
14
+ /**
15
+ * 拍平的控件数组
16
+ * */
17
+ flatInstances: DesignerControl[];
18
+ /**
19
+ * 控件id组成的map
20
+ * */
21
+ instanceIdMap: Map<string, DesignerControl>;
22
+ /**
23
+ * dataCode和fieldCode组成的map
24
+ * {
25
+ * [主表dataCode]: {
26
+ * [fieldCode]: 控件
27
+ * },
28
+ * [子表dataCode]: {
29
+ * [fieldCode]: 控件
30
+ * }
31
+ * }
32
+ * */
33
+ dataFieldCodeMap: Map<string, Map<string, DesignerControl>>;
34
+ /**
35
+ * 当前选中的控件
36
+ * */
37
+ selected: DesignerControl | null;
38
+ /**
39
+ * 当前选中的数据作用域控件
40
+ * */
41
+ selectedInstanceDataScopeParent: DataScopeControl;
42
+ selectedDataScopeFlatInstances: DesignerControl[];
43
+ /**
44
+ * 当前选中控件的setting
45
+ * */
46
+ selectedInstanceSetting: Settings;
47
+ selectedInstanceSettingItems: Setting[];
48
+ /**
49
+ * 当前选中控件的数据模型
50
+ * */
51
+ selectedFieldItem: any;
52
+ /**
53
+ * 扩展字段,比如appId,dataCode等
54
+ * */
55
+ external: Record<string, any>;
56
+ movingInstance: DesignerControl | null;
57
+ movingInstanceOldParent: DesignerControl | null;
58
+ movingInstanceOldDataScopeParent: DataScopeControl;
59
+ private readonly getParentBeforeInstanceMove;
60
+ constructor(options: StoreOptions);
61
+ /**
62
+ * 当前选中控件的rules
63
+ * */
64
+ get selectedRules(): Rules | null;
65
+ /**
66
+ * 当前选中控件的antd rules
67
+ * */
68
+ get selectedAntdRules(): Rules | null;
69
+ setInstances(instances: DesignerControl[]): void;
70
+ setSelectInstance(instance: DesignerControl | null): void;
71
+ setSelectInstanceSettings(settings: Settings): void;
72
+ private getSettingItems;
73
+ setSelectedFieldItem(fieldItem: Record<string, any> | null): void;
74
+ setMovingInstance(instance: DesignerControl | null): void;
75
+ updateDataFieldCodeMap(instance: DesignerControl): void;
76
+ getFlatInstances(): void;
77
+ }
78
+ export declare function loop(instances: DesignerControl[] | DesignerControl, callback: (instance: DesignerControl) => void): void;
79
+ export declare function isDataScopeInstance(instance: DesignerControl): instance is Exclude<DataScopeControl, null>;
80
+ export declare function findInstanceDataScopeParent(instance: DesignerControl | null): any;
81
+ export declare function getDataScopeFlatInstances(dataScopeInstance: DesignerLayoutControl | DesignerListControl): DesignerControl[];
82
+ export {};
@@ -1,6 +1,6 @@
1
- import { CONTROL_TYPE, FieldTypes } from '@byteluck-fe/model-driven-shared';
2
- export declare const objectDataBindControlTypes: CONTROL_TYPE[];
3
- export declare const objectDataBindKeyToFieldType: Record<string, {
4
- caption: string;
5
- fieldType: FieldTypes;
6
- }>;
1
+ import { CONTROL_TYPE, FieldTypes } from '@byteluck-fe/model-driven-shared';
2
+ export declare const objectDataBindControlTypes: CONTROL_TYPE[];
3
+ export declare const objectDataBindKeyToFieldType: Record<string, {
4
+ caption: string;
5
+ fieldType: FieldTypes;
6
+ }>;
@@ -1,4 +1,4 @@
1
- import { ControlsKeys, ControlDesignerInstance, DesignerFormControl, DesignerLayoutControl, DesignerControl, DesignerListControl, DesignerSearchControl, DesignerWrapControl } from '@byteluck-fe/model-driven-core';
2
- export declare function hasChildrenControl(instance: DesignerControl): instance is DesignerLayoutControl | DesignerSearchControl | DesignerWrapControl;
3
- export declare function hasHeaderControl(instance: DesignerControl): instance is DesignerListControl;
4
- export declare function loopFormControl(control: ControlDesignerInstance<ControlsKeys>[], callback: (item: DesignerFormControl | ControlDesignerInstance<'subtable'>, children?: DesignerFormControl[]) => any): void;
1
+ import { ControlsKeys, ControlDesignerInstance, DesignerFormControl, DesignerLayoutControl, DesignerControl, DesignerListControl, DesignerSearchControl, DesignerWrapControl } from '@byteluck-fe/model-driven-core';
2
+ export declare function hasChildrenControl(instance: DesignerControl): instance is DesignerLayoutControl | DesignerSearchControl | DesignerWrapControl;
3
+ export declare function hasHeaderControl(instance: DesignerControl): instance is DesignerListControl;
4
+ export declare function loopFormControl(control: ControlDesignerInstance<ControlsKeys>[], callback: (item: DesignerFormControl | ControlDesignerInstance<'subtable'>, children?: DesignerFormControl[]) => any): void;
@@ -1,8 +1,8 @@
1
- import Designer, { ToolboxType, DesignerServices } from './Designer';
2
- export type { ToolboxType, DesignerServices };
3
- export { Designer };
4
- export * from './utils';
5
- export * from './Builder';
6
- export * from './designerUtils';
7
- export * from './Driven';
8
- export * from './Store';
1
+ import Designer, { ToolboxType, DesignerServices } from './Designer';
2
+ export type { ToolboxType, DesignerServices };
3
+ export { Designer };
4
+ export * from './utils';
5
+ export * from './Builder';
6
+ export * from './designerUtils';
7
+ export * from './Driven';
8
+ export * from './Store';
@@ -1,41 +1,41 @@
1
- import { Schema, ControlsKeys, DataBindModelType, DesignerControl, DesignerFormControl, Messages } from '@byteluck-fe/model-driven-core';
2
- export declare function getMasterFormControls(controls: DesignerControl[]): DesignerFormControl[];
3
- /**
4
- * @description 给modelBindInfoList中填充fieldCode和dataCode
5
- * @description 我们生成fieldCode的规则是:DataBind的控件,取`field_${id}`,ObjectDataBind的控件,取`field_${id}_${key}`, key指的是ObjectDataBind.keys()
6
- * */
7
- export declare function fillModelBindInfoListFieldCode(modelBindInfoList: DataBindModelType[], dataCode?: string): DataBindModelType[];
8
- /**
9
- * @description 将控件实例转换为schema
10
- * */
11
- declare function toSchema<T extends ControlsKeys>(instance: DesignerControl): Schema<T>;
12
- declare function toSchema<T extends ControlsKeys>(instances: DesignerControl[]): Schema<T>[];
13
- declare function getModelBindInfoList(controls: DesignerControl[] | DesignerControl): DataBindModelType | DataBindModelType[] | undefined;
14
- declare function checkSchema(controls: DesignerControl[] | DesignerControl, messages?: Messages, ignore?: string[]): Promise<boolean>;
15
- interface PermissionItem {
16
- controlId: string;
17
- caption: string;
18
- type: string;
19
- controlType: string;
20
- /**
21
- * 是否可编辑
22
- * */
23
- canEdit: boolean;
24
- /**
25
- * 是否可查看
26
- * */
27
- canRead: boolean;
28
- /**
29
- * 是否可隐藏
30
- * */
31
- canHide: boolean;
32
- parentId: string | null;
33
- /**
34
- * 在表单、列表授权时将权限分组显示
35
- * element = 元素分组权限 = 除了绑定字段的控件都是这种类型
36
- * field = 字段分组权限 = 绑了字段的控件类型
37
- */
38
- group: 'element' | 'field';
39
- }
40
- declare function generatePermissions(controls: DesignerControl[] | DesignerControl, parent?: PermissionItem): PermissionItem[];
41
- export { toSchema, getModelBindInfoList, checkSchema, generatePermissions };
1
+ import { Schema, ControlsKeys, DataBindModelType, DesignerControl, DesignerFormControl, Messages } from '@byteluck-fe/model-driven-core';
2
+ export declare function getMasterFormControls(controls: DesignerControl[]): DesignerFormControl[];
3
+ /**
4
+ * @description 给modelBindInfoList中填充fieldCode和dataCode
5
+ * @description 我们生成fieldCode的规则是:DataBind的控件,取`field_${id}`,ObjectDataBind的控件,取`field_${id}_${key}`, key指的是ObjectDataBind.keys()
6
+ * */
7
+ export declare function fillModelBindInfoListFieldCode(modelBindInfoList: DataBindModelType[], dataCode?: string): DataBindModelType[];
8
+ /**
9
+ * @description 将控件实例转换为schema
10
+ * */
11
+ declare function toSchema<T extends ControlsKeys>(instance: DesignerControl): Schema<T>;
12
+ declare function toSchema<T extends ControlsKeys>(instances: DesignerControl[]): Schema<T>[];
13
+ declare function getModelBindInfoList(controls: DesignerControl[] | DesignerControl): DataBindModelType | DataBindModelType[] | undefined;
14
+ declare function checkSchema(controls: DesignerControl[] | DesignerControl, messages?: Messages, ignore?: string[]): Promise<boolean>;
15
+ interface PermissionItem {
16
+ controlId: string;
17
+ caption: string;
18
+ type: string;
19
+ controlType: string;
20
+ /**
21
+ * 是否可编辑
22
+ * */
23
+ canEdit: boolean;
24
+ /**
25
+ * 是否可查看
26
+ * */
27
+ canRead: boolean;
28
+ /**
29
+ * 是否可隐藏
30
+ * */
31
+ canHide: boolean;
32
+ parentId: string | null;
33
+ /**
34
+ * 在表单、列表授权时将权限分组显示
35
+ * element = 元素分组权限 = 除了绑定字段的控件都是这种类型
36
+ * field = 字段分组权限 = 绑了字段的控件类型
37
+ */
38
+ group: 'element' | 'field';
39
+ }
40
+ declare function generatePermissions(controls: DesignerControl[] | DesignerControl, parent?: PermissionItem): PermissionItem[];
41
+ export { toSchema, getModelBindInfoList, checkSchema, generatePermissions };