@byteluck-fe/model-driven-core 7.0.0-1-beta9 → 7.0.0-beta.10

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.
@@ -47,12 +47,15 @@ declare class Control {
47
47
  toSchema(): BaseControlSchema<ControlsKeys, Property>;
48
48
  updateSetting: typeof updateSetting;
49
49
  removeSetting: typeof removeSetting;
50
+ removeSettingByKeyAndName: typeof removeSettingByKeyAndName;
50
51
  static updateBasicControl(key: 'setting', setting: {
51
52
  add?: SettingOption[];
52
53
  remove?: string[];
53
54
  update?: string[];
54
55
  }): void;
55
56
  static removeSettingItem: typeof removeSetting;
57
+ static removeSettingByKeyAndName: typeof removeSettingByKeyAndName;
58
+ static removeSettingItemByKeyAndName: typeof removeSettingByKeyAndName;
56
59
  static updateSettingItem: typeof updateSetting;
57
60
  }
58
61
  export default Control;
@@ -63,6 +66,17 @@ export { Control as DesignerControl };
63
66
  * @param keys 需要删除的key或key组成的数组
64
67
  * */
65
68
  declare function removeSetting(keys: Array<string | HideOptions> | string | HideOptions): void;
69
+ /**
70
+ * @function 根据key和name删除控件或者实例上的setting
71
+ * @description 用于删除使用公共key但通过name区分的setting项
72
+ * @param options 需要删除的setting key和name
73
+ * */
74
+ interface RemoveSettingByKeyAndNameOption {
75
+ key: string;
76
+ name: string;
77
+ }
78
+ declare function removeSettingByKeyAndName(options: RemoveSettingByKeyAndNameOption[]): void;
79
+ declare function removeSettingByKeyAndName(key: string, name: string): void;
66
80
  interface UpdateSettingOption {
67
81
  showItems: COMMON_SETTING_TYPE[];
68
82
  type?: 'push' | 'replace';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * name: base_property
3
+ * description: 基础属性定义。提供控件通用的隐藏状态、类名、样式、标题和默认状态配置,是表单、布局、列表等属性模型的公共基类。
4
+ */
1
5
  import { RuleItem } from '../Validator';
2
6
  import { BaseStyle } from '../../framework';
3
7
  import { MODE } from 'type';
@@ -11,10 +15,44 @@ declare class PropertyRuntimeRules extends Array<RuleItem> {
11
15
  constructor(props: Property);
12
16
  }
13
17
  /**
14
- * 全局属性
18
+ * 属性定义
19
+ */
20
+ interface PropertyInterface {
21
+ /**
22
+ * 是否隐藏
23
+ * @public
24
+ * @defaultValue false
25
+ */
26
+ isHide: boolean;
27
+ /**
28
+ * 类名
29
+ * @public
30
+ * @noSchema
31
+ */
32
+ className?: string[];
33
+ /**
34
+ * 样式
35
+ * @public
36
+ * @noSchema
37
+ */
38
+ style: BaseStyle;
39
+ /**
40
+ * 标题
41
+ * @public
42
+ * @defaultValue ''
43
+ */
44
+ caption: string;
45
+ /**
46
+ * 默认状态
47
+ * @public
48
+ */
49
+ defaultState: 'readonly' | 'default';
50
+ }
51
+ /**
52
+ * 属性实现
15
53
  * @public
16
54
  */
17
- declare class Property {
55
+ declare class Property implements PropertyInterface {
18
56
  static mode: MODE;
19
57
  static readonly Rules: typeof PropertyRules;
20
58
  static readonly RuntimeRules: typeof PropertyRuntimeRules;
@@ -24,7 +62,17 @@ declare class Property {
24
62
  * @defaultValue false
25
63
  */
26
64
  isHide: boolean;
65
+ /**
66
+ * 类名
67
+ * @public
68
+ * @noSchema
69
+ */
27
70
  className?: string[];
71
+ /**
72
+ * 样式
73
+ * @public
74
+ * @noSchema
75
+ */
28
76
  style: BaseStyle;
29
77
  /**
30
78
  * 标题
@@ -33,12 +81,11 @@ declare class Property {
33
81
  */
34
82
  caption: string;
35
83
  /**
36
- * 标题
84
+ * 默认状态
37
85
  * @public
38
- * @defaultValue ''
39
86
  */
40
87
  defaultState: 'readonly' | 'default';
41
88
  constructor(props?: Partial<Property>, caption?: string);
42
89
  }
43
90
  export default Property;
44
- export { Property, PropertyRules, PropertyRuntimeRules };
91
+ export { Property, PropertyInterface, PropertyRules, PropertyRuntimeRules };
@@ -12,6 +12,10 @@ export declare interface SettingOption {
12
12
  label?: string;
13
13
  name?: string;
14
14
  tip?: string;
15
+ children?: SettingOption[];
16
+ layout?: 'horizontal' | 'vertical';
17
+ min?: number;
18
+ max?: number;
15
19
  }
16
20
  export declare interface HideOptions {
17
21
  key: string;
@@ -7,13 +7,13 @@ declare class ColumnControl extends DesignerControl {
7
7
  children: DesignerControl[];
8
8
  constructor(props?: Partial<ColumnControlSchema<ColumnControlsKeys>>);
9
9
  toSchema(): {
10
- children: import("../../type").BaseControlSchema<never, import("../BaseControl").Property>[];
10
+ children: import("../../type").BaseControlSchema<never, import("../BaseControl/property").default>[];
11
11
  id: string;
12
12
  type: never;
13
- props: import("../BaseControl").Property;
13
+ props: import("../BaseControl/property").default;
14
14
  controlType: import("../../type").BaseControlTypes;
15
- fieldType?: import("@byteluck-fe/model-driven-shared").FieldTypes;
16
- pageStatus?: import("../..").PAGE_STATUS;
15
+ fieldType?: import("@byteluck-fe/model-driven-shared/dist/types").FieldTypes | undefined;
16
+ pageStatus?: import("../..").PAGE_STATUS | undefined;
17
17
  };
18
18
  }
19
19
  export default ColumnControl;
@@ -1,4 +1,8 @@
1
- import { Property, PropertyRules, RuntimeControl } from '../BaseControl';
1
+ /**
2
+ * name: base_column_control_property
3
+ * description: 列控件基础属性定义。提供列宽、标题、数据绑定、自适应宽度、冻结、排序、对齐、跨列、自动高度和子控件配置。
4
+ */
5
+ import { Property, PropertyInterface, PropertyRules, RuntimeControl } from '../BaseControl';
2
6
  import { RuleItem } from 'async-validator';
3
7
  import { DataBind, DataSourceBind, OptionSetting, AutoWidth } from '../../framework';
4
8
  declare class ColumnControlPropertyRules extends PropertyRules {
@@ -6,11 +10,62 @@ declare class ColumnControlPropertyRules extends PropertyRules {
6
10
  width: RuleItem;
7
11
  constructor(props: ColumnControlProperty);
8
12
  }
13
+ interface ColumnControlPropertyInterface extends PropertyInterface {
14
+ /**
15
+ * 宽度类型
16
+ * @defaultValue 'auto'
17
+ */
18
+ widthType: 'px' | 'auto' | 'percent';
19
+ /**
20
+ * 宽度
21
+ * @defaultValue 150
22
+ */
23
+ width: number;
24
+ /**
25
+ * 标题
26
+ */
27
+ caption: string;
28
+ /**
29
+ * 绑定数据项
30
+ */
31
+ dataBind: DataBind;
32
+ /**
33
+ * 自适应页面宽度
34
+ */
35
+ autoWidth: AutoWidth;
36
+ /**
37
+ * 冻结
38
+ * @defaultValue 'none'
39
+ */
40
+ fixed: 'left' | 'right' | 'none';
41
+ /**
42
+ * 表头排序
43
+ * @defaultValue true
44
+ */
45
+ sort: boolean;
46
+ /**
47
+ * 对齐
48
+ */
49
+ align?: 'left' | 'right' | 'center';
50
+ /**
51
+ * @internal
52
+ */
53
+ colSpan?: string;
54
+ /**
55
+ * 自动高度
56
+ * @defaultValue false
57
+ */
58
+ autoHeight: boolean;
59
+ /**
60
+ * 子控件
61
+ */
62
+ children: RuntimeControl[];
63
+ }
9
64
  /**
10
65
  * 列基本属性
11
66
  * @public
12
67
  */
13
- declare class ColumnControlProperty extends Property {
68
+ declare class ColumnControlProperty extends Property implements ColumnControlPropertyInterface {
14
69
  static readonly Rules: typeof ColumnControlPropertyRules;
15
70
  /**
16
71
  * 宽度类型
@@ -57,6 +112,9 @@ declare class ColumnControlProperty extends Property {
57
112
  * @defaultValue false
58
113
  */
59
114
  autoHeight: boolean;
115
+ /**
116
+ * 子控件
117
+ */
60
118
  children: RuntimeControl[];
61
119
  constructor(props?: Partial<ColumnControlProperty>);
62
120
  }
@@ -71,4 +129,4 @@ declare class ColumnOptionAndDataSourcePropertyRules extends ColumnControlProper
71
129
  });
72
130
  }
73
131
  export default ColumnControlProperty;
74
- export { ColumnControlProperty, ColumnControlPropertyRules, ColumnOptionAndDataSourcePropertyRules, };
132
+ export { ColumnControlProperty, ColumnControlPropertyInterface, ColumnControlPropertyRules, ColumnOptionAndDataSourcePropertyRules, };
@@ -1,4 +1,4 @@
1
- import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
1
+ import { Property, PropertyInterface, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
2
2
  import { RuleItem } from '../Validator';
3
3
  import { DataBind, DataSourceBind, ObjectDataBind, OptionSetting } from '../../framework';
4
4
  declare class BaseControlPropertyRules extends PropertyRules {
@@ -14,13 +14,7 @@ declare class BaseControlPropertyRules extends PropertyRules {
14
14
  declare class BaseControlPropertyRuntimeRules extends PropertyRuntimeRules {
15
15
  constructor(props: BaseControlProperty);
16
16
  }
17
- /**
18
- * 表单控件公共属性
19
- * @public
20
- */
21
- declare class BaseControlProperty extends Property {
22
- static readonly Rules: typeof BaseControlPropertyRules;
23
- static readonly RuntimeRules: typeof BaseControlPropertyRuntimeRules;
17
+ interface BaseControlPropertyInterface extends PropertyInterface {
24
18
  /**
25
19
  * 标题
26
20
  * @defaultValue ''
@@ -45,6 +39,18 @@ declare class BaseControlProperty extends Property {
45
39
  * @public
46
40
  */
47
41
  isCaptionItalic: boolean;
42
+ /**
43
+ * 标题字重;取值:normal:常规;bold:粗体;lighter:更细;
44
+ * @defaultValue 'normal'
45
+ * @public
46
+ */
47
+ captionFontWeight: 'normal' | 'bold' | 'lighter';
48
+ /**
49
+ * 样式类
50
+ * @defaultValue []
51
+ * @public
52
+ */
53
+ className: string[];
48
54
  /**
49
55
  * 隐藏标题
50
56
  * @defaultValue false
@@ -102,6 +108,30 @@ declare class BaseControlProperty extends Property {
102
108
  * @defaultValue ''
103
109
  */
104
110
  requiredMessage: string;
111
+ }
112
+ /**
113
+ * 表单控件公共属性
114
+ * @public
115
+ */
116
+ declare class BaseControlProperty extends Property implements BaseControlPropertyInterface {
117
+ static readonly Rules: typeof BaseControlPropertyRules;
118
+ static readonly RuntimeRules: typeof BaseControlPropertyRuntimeRules;
119
+ caption: string;
120
+ captionSize: string;
121
+ captionColor: string;
122
+ isCaptionItalic: boolean;
123
+ captionFontWeight: 'normal' | 'bold' | 'lighter';
124
+ className: string[];
125
+ isHideCaption: boolean;
126
+ isShowCaptionTip: boolean;
127
+ captionTip: string;
128
+ labelPosition: 'top' | 'left';
129
+ dataBind: DataBind | ObjectDataBind;
130
+ defaultValue: string | number | string[] | number[] | unknown;
131
+ placeholder: string;
132
+ defaultState: 'default' | 'readonly';
133
+ required: boolean;
134
+ requiredMessage: string;
105
135
  constructor(props?: Partial<BaseControlProperty>);
106
136
  }
107
137
  declare class OptionAndDataSourcePropertyRules extends BaseControlPropertyRules {
@@ -115,4 +145,4 @@ declare class OptionAndDataSourcePropertyRules extends BaseControlPropertyRules
115
145
  });
116
146
  }
117
147
  export default BaseControlProperty;
118
- export { BaseControlProperty, BaseControlPropertyRules, BaseControlPropertyRuntimeRules, OptionAndDataSourcePropertyRules, };
148
+ export { BaseControlProperty, BaseControlPropertyInterface, BaseControlPropertyRules, BaseControlPropertyRuntimeRules, OptionAndDataSourcePropertyRules, };
@@ -1,6 +1,12 @@
1
- import { Property } from '../BaseControl';
2
- declare class LayoutControlProperty extends Property {
1
+ /**
2
+ * name: base_layout_control_property
3
+ * description: 布局控件基础属性定义。继承通用属性能力,为行、列、容器、页签等布局类控件提供统一的属性模型。
4
+ */
5
+ import { Property, PropertyInterface } from '../BaseControl';
6
+ interface LayoutControlPropertyInterface extends PropertyInterface {
7
+ }
8
+ declare class LayoutControlProperty extends Property implements LayoutControlPropertyInterface {
3
9
  constructor(props?: Partial<LayoutControlProperty>);
4
10
  }
5
11
  export default LayoutControlProperty;
6
- export { LayoutControlProperty };
12
+ export { LayoutControlProperty, LayoutControlPropertyInterface };
@@ -1,13 +1,62 @@
1
- import { DesignerControl, Property, RuntimeControl } from '../BaseControl';
1
+ /**
2
+ * name: base_list_control_property
3
+ * description: 列表控件基础属性定义。提供表头、表尾、分页页码、每页条数、分页选项和总条数等列表通用配置。
4
+ */
5
+ import { DesignerControl, Property, PropertyInterface, RuntimeControl } from '../BaseControl';
2
6
  import { ControlsKeys, BaseControlSchema, MODE } from '../../type';
3
7
  import { DesignerListControl } from './designer';
4
8
  import { RuntimeListControl } from './runtime';
5
- declare class ListControlProperty<Mode extends MODE | 'Schema', Control extends object = Mode extends 'Runtime' ? RuntimeControl : Mode extends 'Designer' ? DesignerControl : BaseControlSchema<ControlsKeys, any>> extends Property {
9
+ type ControlType<Mode extends MODE | 'Schema'> = Mode extends 'Runtime' ? RuntimeControl : Mode extends 'Designer' ? DesignerControl : BaseControlSchema<ControlsKeys, any>;
10
+ interface ListControlPropertyInterface<Mode extends MODE | 'Schema', Control extends object = ControlType<Mode>> extends PropertyInterface {
11
+ /**
12
+ * 表头控件
13
+ */
6
14
  headers: Control[];
15
+ /**
16
+ * 表尾控件
17
+ */
7
18
  footers?: Control[];
19
+ /**
20
+ * 当前页码
21
+ */
8
22
  pageIndex: number;
23
+ /**
24
+ * 每页条数
25
+ */
9
26
  pageSize: number;
27
+ /**
28
+ * 每页条数选项
29
+ */
10
30
  pageSizeOptions: number[];
31
+ /**
32
+ * 总条数
33
+ */
34
+ totalCount: number;
35
+ }
36
+ declare class ListControlProperty<Mode extends MODE | 'Schema', Control extends object = ControlType<Mode>> extends Property implements ListControlPropertyInterface<Mode, Control> {
37
+ /**
38
+ * 表头控件
39
+ */
40
+ headers: Control[];
41
+ /**
42
+ * 表尾控件
43
+ */
44
+ footers?: Control[];
45
+ /**
46
+ * 当前页码
47
+ */
48
+ pageIndex: number;
49
+ /**
50
+ * 每页条数
51
+ */
52
+ pageSize: number;
53
+ /**
54
+ * 每页条数选项
55
+ */
56
+ pageSizeOptions: number[];
57
+ /**
58
+ * 总条数
59
+ */
11
60
  totalCount: number;
12
61
  constructor(parent: DesignerListControl | RuntimeListControl, props?: Partial<ListControlProperty<Mode> & {
13
62
  headers: Control[];
@@ -15,4 +64,4 @@ declare class ListControlProperty<Mode extends MODE | 'Schema', Control extends
15
64
  }>, mode?: MODE);
16
65
  }
17
66
  export default ListControlProperty;
18
- export { ListControlProperty };
67
+ export { ListControlProperty, ListControlPropertyInterface };
@@ -1,8 +1,21 @@
1
- import { LayoutControlProperty } from '../LayoutControl';
1
+ /**
2
+ * name: base_search_control_property
3
+ * description: 查询控件基础属性定义。提供查询视图的数据项绑定配置,用于搜索区域控件与数据字段建立关联。
4
+ */
5
+ import { LayoutControlProperty, LayoutControlPropertyInterface } from '../LayoutControl';
2
6
  import { DataBind } from '../../framework';
3
- declare class SearchControlProperty extends LayoutControlProperty {
7
+ interface SearchControlPropertyInterface extends LayoutControlPropertyInterface {
8
+ /**
9
+ * 绑定数据项
10
+ */
11
+ dataBind: DataBind;
12
+ }
13
+ declare class SearchControlProperty extends LayoutControlProperty implements SearchControlPropertyInterface {
14
+ /**
15
+ * 绑定数据项
16
+ */
4
17
  dataBind: DataBind;
5
18
  constructor(props?: Partial<SearchControlProperty>);
6
19
  }
7
20
  export default SearchControlProperty;
8
- export { SearchControlProperty };
21
+ export { SearchControlProperty, SearchControlPropertyInterface };
@@ -1,6 +1,12 @@
1
- import { LayoutControlProperty } from '../LayoutControl';
2
- declare class WrapControlProperty extends LayoutControlProperty {
1
+ /**
2
+ * name: base_wrap_control_property
3
+ * description: 包裹控件基础属性定义。继承布局属性能力,为外层包裹类控件提供统一的属性模型。
4
+ */
5
+ import { LayoutControlProperty, LayoutControlPropertyInterface } from '../LayoutControl';
6
+ interface WrapControlPropertyInterface extends LayoutControlPropertyInterface {
7
+ }
8
+ declare class WrapControlProperty extends LayoutControlProperty implements WrapControlPropertyInterface {
3
9
  constructor(props?: Partial<WrapControlProperty>);
4
10
  }
5
11
  export default WrapControlProperty;
6
- export { WrapControlProperty };
12
+ export { WrapControlProperty, WrapControlPropertyInterface };