@gct-paas/schema 0.1.4-dev.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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/index.esm.min.mjs +1250 -0
  4. package/dist/index.min.cjs +1 -0
  5. package/dist/index.system.min.js +1 -0
  6. package/es/constants/index.d.ts +14 -0
  7. package/es/constants/index.mjs +370 -0
  8. package/es/index.d.ts +8 -0
  9. package/es/index.mjs +20 -0
  10. package/es/interface/common/data-linkage-config.d.ts +17 -0
  11. package/es/interface/designer.d.ts +99 -0
  12. package/es/interface/index.d.ts +6 -0
  13. package/es/interface/modal/i-modal-body.d.ts +15 -0
  14. package/es/interface/modal/i-modal-bottom-button.d.ts +15 -0
  15. package/es/interface/modal/i-modal-footer.d.ts +15 -0
  16. package/es/interface/modal/i-modal-props.d.ts +26 -0
  17. package/es/interface/modal/i-modal.d.ts +52 -0
  18. package/es/interface/modal/index.d.ts +17 -0
  19. package/es/interface/schema/index.d.ts +2 -0
  20. package/es/interface/schema/widget-props/i-button-props.d.ts +170 -0
  21. package/es/interface/schema/widget-props/i-display-props.d.ts +48 -0
  22. package/es/interface/schema/widget-props/i-form-container-props.d.ts +77 -0
  23. package/es/interface/schema/widget-props/i-form-input-props.d.ts +409 -0
  24. package/es/interface/schema/widget-props/i-layout-props.d.ts +77 -0
  25. package/es/interface/schema/widget-props/i-search-widget-props.d.ts +126 -0
  26. package/es/interface/schema/widget-props/i-table-column-props.d.ts +54 -0
  27. package/es/interface/schema/widget-props/i-table-props.d.ts +384 -0
  28. package/es/interface/schema/widget-props/index.d.ts +8 -0
  29. package/es/interface/schema/widget-types.d.ts +370 -0
  30. package/es/interface/widget/i-common.d.ts +42 -0
  31. package/es/interface/widget/i-editors.d.ts +240 -0
  32. package/es/interface/widget/i-events.d.ts +55 -0
  33. package/es/interface/widget/i-hooks-and-misc.d.ts +59 -0
  34. package/es/interface/widget/i-props.d.ts +177 -0
  35. package/es/interface/widget/i-schemas.d.ts +135 -0
  36. package/es/interface/widget/i-styles.d.ts +114 -0
  37. package/es/interface/widget/index.d.ts +53 -0
  38. package/es/interface/widget-info/i-designer-item-hooks.d.ts +21 -0
  39. package/es/interface/widget-info/i-designer-schema-exports.d.ts +13 -0
  40. package/es/interface/widget-info/i-widget-info-item.d.ts +78 -0
  41. package/es/interface/widget-info/i-widget-info.d.ts +19 -0
  42. package/es/interface/widget-info/index.d.ts +4 -0
  43. package/es/schema/common-config/base-button-config.d.ts +3 -0
  44. package/es/schema/common-config/base-button-config.mjs +84 -0
  45. package/es/schema/common-config/button-editor-config.d.ts +4 -0
  46. package/es/schema/common-config/button-editor-config.mjs +206 -0
  47. package/es/schema/common-config/button-props-func.d.ts +5 -0
  48. package/es/schema/common-config/button-props-func.mjs +11 -0
  49. package/es/schema/common-config/common-field-editor-config.d.ts +10 -0
  50. package/es/schema/common-config/common-field-editor-config.mjs +61 -0
  51. package/es/schema/common-config/common-style.d.ts +3 -0
  52. package/es/schema/common-config/common-style.mjs +85 -0
  53. package/es/schema/common-config/display-editor-config.d.ts +3 -0
  54. package/es/schema/common-config/display-editor-config.mjs +89 -0
  55. package/es/schema/common-config/permission-editor-config.d.ts +2 -0
  56. package/es/schema/common-config/permission-editor-config.mjs +23 -0
  57. package/es/schema/index.d.ts +9 -0
  58. package/es/schema/modal/modal-body.d.ts +2 -0
  59. package/es/schema/modal/modal-body.mjs +9 -0
  60. package/es/schema/modal/modal-footer.d.ts +2 -0
  61. package/es/schema/modal/modal-footer.mjs +9 -0
  62. package/es/schema/modal/modal.d.ts +8 -0
  63. package/es/schema/modal/modal.mjs +182 -0
  64. package/es/types/index.d.ts +1 -0
  65. package/es/utils/index.d.ts +3 -0
  66. package/es/utils/schema/index.d.ts +45 -0
  67. package/es/utils/schema/index.mjs +49 -0
  68. package/es/utils/schema-style/index.d.ts +108 -0
  69. package/es/utils/schema-style/index.mjs +155 -0
  70. package/es/utils/widget-info/widget-info.d.ts +104 -0
  71. package/es/utils/widget-info/widget-info.mjs +76 -0
  72. package/package.json +63 -0
@@ -0,0 +1,182 @@
1
+ import { BuiltinType, Platform, PropGroup, StyleGroup, buildShortUUID } from '@gct-paas/core';
2
+ import { widget as widget$1 } from './modal-body.mjs';
3
+ import { widget as widget$2 } from './modal-footer.mjs';
4
+
5
+ const widget = {
6
+ id: "",
7
+ /**默认是WEB 添加的时候会根据当前环境改变 */
8
+ platform: Platform.WEB,
9
+ /**系统用的name */
10
+ name: "sys.pageDesigner.modal",
11
+ alias: "",
12
+ /**用户新建编辑的name */
13
+ modalName: "",
14
+ type: BuiltinType.MODAL,
15
+ js: "",
16
+ css: "",
17
+ children: [widget$1, widget$2],
18
+ props: {
19
+ modalTitle: "弹窗",
20
+ unitType: "px",
21
+ modalWidth: 800,
22
+ isSubTableModal: false,
23
+ bindSubTableId: "",
24
+ createModalTitle: "新建弹窗",
25
+ editModalTitle: "编辑弹窗",
26
+ hasFooter: true,
27
+ openMode: "modal",
28
+ /**just mobile */
29
+ mUnitType: "%",
30
+ mModalWidth: 80
31
+ },
32
+ style: {
33
+ paddingAll: "16",
34
+ paddingTop: "16",
35
+ paddingRight: "16",
36
+ paddingBottom: "16",
37
+ paddingLeft: "16"
38
+ },
39
+ events: {},
40
+ i18n: {},
41
+ runJs: "",
42
+ los: {},
43
+ icon: "icon-motaikuang1",
44
+ isField: false
45
+ };
46
+ const propEditorList = [
47
+ {
48
+ component: "text-editor",
49
+ name: "modalTitle",
50
+ label: "sys.pageDesigner.modalTitleName",
51
+ group: PropGroup.BASIC,
52
+ _config: {
53
+ showCount: true,
54
+ maxlength: 32
55
+ },
56
+ hidden: (widget2) => {
57
+ return widget2.props.isSubTableModal;
58
+ }
59
+ },
60
+ {
61
+ component: "input-unit-editor",
62
+ name: { unitType: "unitType", modalWidth: "modalWidth" },
63
+ label: "sys.pageDesigner.modalWidthProp",
64
+ group: PropGroup.MODAL,
65
+ hidden: (widget2) => {
66
+ return widget2.platform === Platform.MOBILE;
67
+ }
68
+ },
69
+ {
70
+ component: "input-unit-editor",
71
+ name: { unitType: "mUnitType", modalWidth: "mModalWidth" },
72
+ label: "sys.pageDesigner.modalHeightProp",
73
+ group: PropGroup.MODAL,
74
+ hidden: (widget2) => {
75
+ return widget2.platform !== Platform.MOBILE;
76
+ },
77
+ _config: {
78
+ filterUnitType: "px"
79
+ }
80
+ },
81
+ {
82
+ component: "text-editor",
83
+ name: "createModalTitle",
84
+ label: "sys.pageDesigner.createModalTitle",
85
+ group: PropGroup.MODALTITLECONFIG,
86
+ _config: {
87
+ i18n: true
88
+ },
89
+ hidden: (widget2) => {
90
+ return !widget2.props.isSubTableModal;
91
+ }
92
+ },
93
+ {
94
+ component: "text-editor",
95
+ name: "editModalTitle",
96
+ label: "sys.pageDesigner.editModalTitle",
97
+ group: PropGroup.MODALTITLECONFIG,
98
+ _config: {
99
+ i18n: true
100
+ },
101
+ hidden: (widget2) => {
102
+ return !widget2.props.isSubTableModal;
103
+ }
104
+ },
105
+ {
106
+ component: "select-editor",
107
+ name: "openMode",
108
+ label: "sys.appDesigner.openMode",
109
+ group: PropGroup.MODAL,
110
+ hidden: (widget2) => {
111
+ return widget2.platform !== Platform.WEB;
112
+ },
113
+ _config: {
114
+ options: () => {
115
+ return [
116
+ {
117
+ label: "打开弹窗页面",
118
+ value: "modal"
119
+ },
120
+ {
121
+ label: "右侧划入页面",
122
+ value: "drawer"
123
+ }
124
+ ];
125
+ }
126
+ },
127
+ changeCallback: (widget2, value) => {
128
+ if (value === "drawer") {
129
+ widget2.props.unitType = "%";
130
+ widget2.props.modalWidth = 80;
131
+ } else {
132
+ widget2.props.unitType = "px";
133
+ widget2.props.modalWidth = 800;
134
+ }
135
+ }
136
+ },
137
+ {
138
+ component: "switch-editor",
139
+ name: "hasFooter",
140
+ label: "sys.pageDesigner.operateButton",
141
+ group: PropGroup.BUTTON,
142
+ hidden: (widget2) => {
143
+ return widget2.props.isSubTableModal;
144
+ }
145
+ }
146
+ ];
147
+ const styleEditorList = [
148
+ {
149
+ component: "color-editor",
150
+ name: "backgroundColor",
151
+ label: "sys.pageDesigner.backgroundColor",
152
+ group: StyleGroup.BACKGROUND
153
+ },
154
+ {
155
+ component: "margin-editor",
156
+ group: StyleGroup.MARGIN,
157
+ _config: {
158
+ hiddenMarginOrPadding: "margin"
159
+ }
160
+ }
161
+ ];
162
+ const eventList = [
163
+ {
164
+ name: "onMounted",
165
+ title: "sys.pageDesigner.onMounted",
166
+ params: []
167
+ }
168
+ ];
169
+ const runCallback = () => {
170
+ };
171
+ const beforeCreate = (widget2) => {
172
+ widget2.children[0].id = buildShortUUID(widget2.children[0].type);
173
+ widget2.children[1].id = buildShortUUID(widget2.children[1].type);
174
+ };
175
+ const designerConfig = {
176
+ basicProps: {
177
+ key_label: "弹窗",
178
+ alias_hidden: true
179
+ }
180
+ };
181
+
182
+ export { beforeCreate, designerConfig, eventList, propEditorList, runCallback, styleEditorList, widget };
@@ -0,0 +1 @@
1
+ import '@gct-paas/core/types';
@@ -0,0 +1,3 @@
1
+ export * from './schema';
2
+ export * from './schema-style';
3
+ export * from './widget-info/widget-info';
@@ -0,0 +1,45 @@
1
+ import { LowCodeWidget } from '../../interface';
2
+ /**
3
+ * 获取组件所属位置
4
+ *
5
+ * @export
6
+ * @param {LowCodeWidget.BasicSchema} widget
7
+ * @param {string} fieldType
8
+ * @param {string} componentType
9
+ * @return {*}
10
+ */
11
+ export declare function getCompPos(widget: LowCodeWidget.BasicSchema, fieldType: string, componentType: string): boolean;
12
+ /**
13
+ * 是否是表单字段类型
14
+ *
15
+ * @export
16
+ * @param {LowCodeWidget.BasicSchema} widget
17
+ * @return {boolean}
18
+ */
19
+ export declare function isFormFieldType(widget: LowCodeWidget.BasicSchema): boolean;
20
+ /**
21
+ * 初始化国际化处理
22
+ *
23
+ * @export
24
+ * @param {LowCodeWidget.BasicSchema['props']} props
25
+ */
26
+ export declare function transformI18n(props: LowCodeWidget.BasicSchema['props']): void;
27
+ /**
28
+ * 克隆组件schema
29
+ *
30
+ * @export
31
+ * @param {LowCodeWidget.BasicSchema} widgetSchema
32
+ * @return {*} {LowCodeWidget.BasicSchema}
33
+ */
34
+ export declare function cloneWidget(widgetSchema: LowCodeWidget.BasicSchema): LowCodeWidget.BasicSchema;
35
+ /**
36
+ * 递归获取所有非字段组件
37
+ *
38
+ * @param {LowCodeWidget.BasicSchema} item
39
+ * @param {string[]} [types=[]]
40
+ * @returns {*} {string[]}
41
+ */
42
+ export declare function deepFindNotField(item: IObject[]): {
43
+ [x: string]: any;
44
+ [x: symbol]: any;
45
+ }[];
@@ -0,0 +1,49 @@
1
+ import { buildShortUUID, t, MaterialEnum } from '@gct-paas/core';
2
+ import { cloneDeep, has } from 'lodash-es';
3
+ import { getWidgetInfo } from '../widget-info/widget-info.mjs';
4
+
5
+ function getCompPos(widget, fieldType, componentType) {
6
+ return widget.type === componentType && has(widget, "preLocation") && new RegExp(`^${fieldType}_`).test(widget.preLocation);
7
+ }
8
+ function isFormFieldType(widget) {
9
+ return [
10
+ MaterialEnum.MaterialFormField,
11
+ MaterialEnum.MaterialSubTableModalField,
12
+ MaterialEnum.DescriptionsFormField
13
+ ].includes(widget.materialType);
14
+ }
15
+ function transformI18n(props) {
16
+ const reg = /^\$\{(\S+)\}$/;
17
+ for (const key in props) {
18
+ const value = props[key];
19
+ if (reg.test(value)) {
20
+ props[key] = t(value.match(reg)?.[1]);
21
+ }
22
+ }
23
+ }
24
+ function cloneWidget(widgetSchema) {
25
+ const instance = cloneDeep(widgetSchema);
26
+ instance.id = buildShortUUID(instance.type);
27
+ instance.alias = t(instance.name);
28
+ if (instance.formItem) {
29
+ instance.props.label = t(instance.name);
30
+ }
31
+ const widgetInfo = getWidgetInfo(instance.platform);
32
+ if (widgetInfo) {
33
+ widgetInfo.beforeCreate?.[instance.type]?.(instance);
34
+ }
35
+ transformI18n(instance.props);
36
+ return instance;
37
+ }
38
+ function deepFindNotField(item) {
39
+ return item.map((node) => ({ ...node })).filter((node) => {
40
+ if (node.props?.model) {
41
+ return predicate(node);
42
+ }
43
+ node.children = node.children && deepFindNotField(node.children);
44
+ return predicate(node);
45
+ });
46
+ }
47
+ const predicate = (node) => !node.formItem;
48
+
49
+ export { cloneWidget, deepFindNotField, getCompPos, isFormFieldType, transformI18n };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * 样式计算工具类
3
+ * 提供样式单位转换、属性映射、样式属性处理等公共方法
4
+ */
5
+ /**
6
+ * 将像素值转换为对应单位
7
+ * 在移动环境下转换为 vw,其他环境保持 px
8
+ *
9
+ * @param pxValue - 像素值
10
+ * @returns 转换后的单位值字符串
11
+ */
12
+ export declare function pxToVw(pxValue: number): string;
13
+ /**
14
+ * 添加 px 单位到样式值
15
+ *
16
+ * @param value - 样式值
17
+ * @returns 带 px 单位和 !important 的样式字符串
18
+ */
19
+ export declare function addPxUnit(value?: string): string;
20
+ /**
21
+ * 添加 !important 标志到样式值(不添加单位)
22
+ *
23
+ * @param value - 样式值
24
+ * @returns 带 !important 的样式字符串
25
+ */
26
+ export declare function addImportant(value?: string): string;
27
+ /**
28
+ * 格式化边框样式对象
29
+ *
30
+ * @param border - 边框配置对象,包含 borderWidth、borderStyle、borderColor
31
+ * @returns 格式化后的边框样式字符串
32
+ */
33
+ export declare function formatBorder(border?: IObject): string;
34
+ /**
35
+ * 字体样式处理配置
36
+ */
37
+ interface IFontConfig {
38
+ fontAttrs: string[];
39
+ mapAttrs: Record<string, {
40
+ attr: string;
41
+ callback?: (value: any) => any;
42
+ }>;
43
+ }
44
+ /**
45
+ * 从字体配置对象中提取并转换字体样式
46
+ *
47
+ * @param font - 字体配置对象
48
+ * @param config - 字体样式处理配置(可选,使用默认配置)
49
+ * @returns 转换后的样式对象
50
+ */
51
+ export declare function extractFontStyle(font: IObject, config?: IFontConfig): IObject;
52
+ /**
53
+ * 将样式属性对象转换为 CSS 样式字符串格式
54
+ *
55
+ * @param styleProps - 样式属性对象
56
+ * @returns 转换后的样式对象(含单位和 !important)
57
+ */
58
+ export declare function propsToStyle(styleProps?: IObject): IObject;
59
+ /**
60
+ * 将单个样式属性值转换为带单位的 CSS 字符串
61
+ *
62
+ * @param prop - 属性名
63
+ * @param value - 属性值
64
+ * @returns 转换后的样式值字符串
65
+ */
66
+ export declare function makeStyleProp(prop: string, value: string): string;
67
+ /**
68
+ * 对齐方式到 Flex 对齐值的映射
69
+ */
70
+ export declare const ALIGN_TO_FLEX_MAP: Record<string, string>;
71
+ /**
72
+ * 将对齐属性值转换为 Flex 对齐值
73
+ *
74
+ * @param align - 对齐方式(left、center、right、justify)
75
+ * @returns 对应的 Flex 对齐值
76
+ */
77
+ export declare function transAlign2flex(align: string): string;
78
+ /**
79
+ * 生成位置和尺寸样式对象
80
+ *
81
+ * @param style - 样式配置对象
82
+ * @returns 位置和尺寸样式对象
83
+ */
84
+ export declare function generatePositionStyles(style: IObject): IObject;
85
+ /**
86
+ * 生成背景和间距样式对象
87
+ *
88
+ * @param style - 样式配置对象
89
+ * @returns 背景和间距样式对象
90
+ */
91
+ export declare function generateSpacingStyles(style: IObject): IObject;
92
+ /**
93
+ * 生成边框样式对象
94
+ *
95
+ * @param style - 样式配置对象
96
+ * @returns 边框样式对象
97
+ */
98
+ export declare function generateBorderStyles(style: IObject): IObject;
99
+ /**
100
+ * 生成完整的包装样式对象
101
+ * 合并位置、间距、边框等所有样式
102
+ *
103
+ * @param style - 样式配置对象
104
+ * @param ignoringStyle - 需要忽略的样式属性数组
105
+ * @returns 合并后的完整样式对象
106
+ */
107
+ export declare function generateWrapperStyle(style: IObject, ignoringStyle?: string[]): IObject;
108
+ export {};
@@ -0,0 +1,155 @@
1
+ import { isEmpty, pick, isNil } from 'lodash-es';
2
+
3
+ function pxToVw(pxValue) {
4
+ return pxValue + "px";
5
+ }
6
+ function addPxUnit(value) {
7
+ return isEmpty(value) ? "" : `${value}px !important`;
8
+ }
9
+ function addImportant(value) {
10
+ return isEmpty(value) ? "" : `${value} !important`;
11
+ }
12
+ function formatBorder(border) {
13
+ if (!border || isEmpty(border.borderWidth)) return "";
14
+ return `${border.borderWidth}px ${border.borderStyle || "solid"} ${border.borderColor || "transparent"} !important`;
15
+ }
16
+ const DEFAULT_FONT_CONFIG = {
17
+ fontAttrs: [
18
+ "fontWeight",
19
+ "fontSize",
20
+ "color",
21
+ "textDecorationLine",
22
+ "textAlign"
23
+ ],
24
+ mapAttrs: {
25
+ bold: {
26
+ attr: "fontWeight",
27
+ callback: (value) => {
28
+ return value ? 700 : 400;
29
+ }
30
+ },
31
+ italic: {
32
+ attr: "fontStyle",
33
+ callback: (value) => {
34
+ return value ? "italic" : "normal";
35
+ }
36
+ },
37
+ textDecoration: {
38
+ attr: "textDecorationLine"
39
+ },
40
+ fontSize: {
41
+ attr: "fontSize",
42
+ callback: (value) => {
43
+ return value ? pxToVw(value) : "";
44
+ }
45
+ },
46
+ align: {
47
+ attr: "textAlign"
48
+ }
49
+ }
50
+ };
51
+ function extractFontStyle(font, config = DEFAULT_FONT_CONFIG) {
52
+ if (!font) return {};
53
+ const result = {};
54
+ Object.assign(result, pick(font, config.fontAttrs));
55
+ if (typeof config.mapAttrs === "object") {
56
+ Object.keys(config.mapAttrs).forEach((k) => {
57
+ const { attr, callback } = config.mapAttrs[k];
58
+ result[attr] = typeof callback === "function" ? callback(font[k]) : font[k];
59
+ });
60
+ }
61
+ return result;
62
+ }
63
+ function propsToStyle(styleProps = {}) {
64
+ const wStyle = {};
65
+ for (const prop in styleProps) {
66
+ wStyle[prop] = makeStyleProp(prop, styleProps[prop]);
67
+ }
68
+ return wStyle;
69
+ }
70
+ const NOT_NEED_PX_STYLE = [
71
+ "opacity",
72
+ "zIndex",
73
+ "fontWeight",
74
+ "lineHeight",
75
+ "letterSpacing",
76
+ "wordSpacing",
77
+ "textAlign",
78
+ "textDecoration",
79
+ "textTransform",
80
+ "fontStyle",
81
+ "textDecorationLine"
82
+ ];
83
+ function makeStyleProp(prop, value) {
84
+ if (isNil(value) || isEmpty(value)) {
85
+ return "";
86
+ }
87
+ if (NOT_NEED_PX_STYLE.includes(prop)) {
88
+ return value + " !important";
89
+ }
90
+ return value + "px !important";
91
+ }
92
+ const ALIGN_TO_FLEX_MAP = {
93
+ left: "flex-start",
94
+ center: "center",
95
+ right: "flex-end",
96
+ justify: "space-between"
97
+ };
98
+ function transAlign2flex(align) {
99
+ return ALIGN_TO_FLEX_MAP[align] || align;
100
+ }
101
+ function generatePositionStyles(style) {
102
+ return {
103
+ position: addImportant(style.position),
104
+ top: addPxUnit(style.top),
105
+ left: addPxUnit(style.left),
106
+ right: addPxUnit(style.right),
107
+ bottom: addPxUnit(style.bottom),
108
+ width: addPxUnit(style.width),
109
+ height: addPxUnit(style.height)
110
+ };
111
+ }
112
+ function generateSpacingStyles(style) {
113
+ return {
114
+ backgroundColor: addImportant(style.backgroundColor),
115
+ marginTop: addPxUnit(style.marginTop),
116
+ marginRight: addPxUnit(style.marginRight),
117
+ marginBottom: addPxUnit(style.marginBottom),
118
+ marginLeft: addPxUnit(style.marginLeft),
119
+ paddingTop: addPxUnit(style.paddingTop),
120
+ paddingRight: addPxUnit(style.paddingRight),
121
+ paddingBottom: addPxUnit(style.paddingBottom),
122
+ paddingLeft: addPxUnit(style.paddingLeft)
123
+ };
124
+ }
125
+ function generateBorderStyles(style) {
126
+ return {
127
+ borderLeft: formatBorder(style.borderLeft),
128
+ borderRight: formatBorder(style.borderRight),
129
+ borderBottom: formatBorder(style.borderBottom),
130
+ borderTop: formatBorder(style.borderTop),
131
+ borderTopRightRadius: addPxUnit(style.borderTopRightRadius),
132
+ borderTopLeftRadius: addPxUnit(style.borderTopLeftRadius),
133
+ borderBottomRightRadius: addPxUnit(style.borderBottomRightRadius),
134
+ borderBottomLeftRadius: addPxUnit(style.borderBottomLeftRadius)
135
+ };
136
+ }
137
+ function generateWrapperStyle(style, ignoringStyle = []) {
138
+ const styleData = {
139
+ ...generatePositionStyles(style),
140
+ ...generateSpacingStyles(style),
141
+ ...generateBorderStyles(style)
142
+ };
143
+ ignoringStyle.forEach((key) => {
144
+ delete styleData[key];
145
+ });
146
+ Object.keys(styleData).forEach((key) => {
147
+ const val = styleData[key];
148
+ if (isNil(val) || isEmpty(val)) {
149
+ delete styleData[key];
150
+ }
151
+ });
152
+ return styleData;
153
+ }
154
+
155
+ export { ALIGN_TO_FLEX_MAP, addImportant, addPxUnit, extractFontStyle, formatBorder, generateBorderStyles, generatePositionStyles, generateSpacingStyles, generateWrapperStyle, makeStyleProp, propsToStyle, pxToVw, transAlign2flex };
@@ -0,0 +1,104 @@
1
+ import { ExportWidgetBeforeCreate, ExportWidgetBlackList, ExportWidgetCallback, ExportWidgetDesignerConfig, ExportWidgetEvents, ExportWidgetHooks, ExportWidgetPropEditors, ExportWidgetSchema, ExportWidgetStyleEditors, ExportWidgetWhiteList, IWidgetInfo, IWidgetInfoItem } from '../../interface';
2
+ import { Platform } from '@gct-paas/core';
3
+ /**
4
+ * 设计界面所有组件配置信息
5
+ *
6
+ * @export
7
+ * @class WidgetInfo
8
+ * @implements {IWidgetInfo}
9
+ */
10
+ declare class WidgetInfo implements IWidgetInfo {
11
+ events: ExportWidgetEvents;
12
+ propEditors: ExportWidgetPropEditors;
13
+ schema: ExportWidgetSchema;
14
+ callback: ExportWidgetCallback;
15
+ beforeCreate: ExportWidgetBeforeCreate;
16
+ styleEditors: ExportWidgetStyleEditors;
17
+ designerConfig: ExportWidgetDesignerConfig;
18
+ hooks: ExportWidgetHooks;
19
+ whiteList: ExportWidgetWhiteList;
20
+ blackList: ExportWidgetBlackList;
21
+ }
22
+ /**
23
+ * 网页端组件配置信息
24
+ */
25
+ export declare const webWidgetInfo: WidgetInfo;
26
+ /**
27
+ * 移动端组件配置信息
28
+ */
29
+ export declare const mobileWidgetInfo: WidgetInfo;
30
+ /**
31
+ * 平板端组件配置信息
32
+ */
33
+ export declare const padWidgetInfo: WidgetInfo;
34
+ /**
35
+ * 获取指定平台的组件配置信息
36
+ *
37
+ * @export
38
+ * @param {Platform} [platform] 平台类型
39
+ * @return {*} {IWidgetInfo} 组件配置信息
40
+ */
41
+ export declare function getWidgetInfo(platform?: Platform): IWidgetInfo;
42
+ /**
43
+ * 注册单一组件信息
44
+ *
45
+ * @export
46
+ * @param {IWidgetInfo} widgetInfo
47
+ * @param {string} type
48
+ * @param {IObject} module
49
+ */
50
+ export declare function registerWidgetItem(widgetInfo: IWidgetInfo, type: string, module: IObject): void;
51
+ /**
52
+ * 注册网页端单一组件信息
53
+ *
54
+ * @export
55
+ * @param {IObject} module
56
+ * @param {string} type
57
+ */
58
+ export declare function registerWebWidgetItem(module: IObject, type: string): void;
59
+ /**
60
+ * 注册移动端单一组件信息
61
+ *
62
+ * @export
63
+ * @param {IObject} module
64
+ * @param {string} type
65
+ */
66
+ export declare function registerMobileWidgetItem(module: IObject, type: string): void;
67
+ /**
68
+ * 注册平板端单一组件信息
69
+ *
70
+ * @export
71
+ * @param {IObject} module
72
+ * @param {string} type
73
+ */
74
+ export declare function registerPadWidgetItem(module: IObject, type: string): void;
75
+ /**
76
+ * 注册单一组件信息(插件方式)
77
+ *
78
+ * @export
79
+ * @param {IWidgetInfo} widgetInfo
80
+ * @param {IWidgetInfoItem} designer
81
+ */
82
+ export declare function registerPluginWidgetItem(widgetInfo: IWidgetInfo, designer: IWidgetInfoItem): void;
83
+ /**
84
+ * 注册网页端插件组件配置
85
+ *
86
+ * @export
87
+ * @param {IWidgetInfoItem} designer
88
+ */
89
+ export declare function registerWebPluginWidgetItem(designer: IWidgetInfoItem): void;
90
+ /**
91
+ * 注册移动端插件组件配置
92
+ *
93
+ * @export
94
+ * @param {IWidgetInfoItem} designer
95
+ */
96
+ export declare function registerMobilePluginWidgetItem(designer: IWidgetInfoItem): void;
97
+ /**
98
+ * 注册平板端插件组件配置
99
+ *
100
+ * @export
101
+ * @param {IWidgetInfoItem} designer
102
+ */
103
+ export declare function registerPadPluginWidgetItem(designer: IWidgetInfoItem): void;
104
+ export {};