@gct-paas/schema 0.1.4-dev.8 → 0.1.5-dev.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 (70) hide show
  1. package/dist/index.esm.min.js +1 -0
  2. package/es/constants/design.d.ts +26 -0
  3. package/es/constants/design.mjs +30 -0
  4. package/es/constants/index.d.ts +28 -0
  5. package/es/constants/index.mjs +411 -0
  6. package/es/index.d.ts +1 -1
  7. package/es/index.mjs +13 -10
  8. package/es/interface/common/data-linkage-config.d.ts +17 -0
  9. package/es/interface/design/i-design-container-node.d.ts +13 -0
  10. package/es/interface/design/i-design-data.d.ts +44 -0
  11. package/es/interface/design/i-design-editor-data.d.ts +20 -0
  12. package/es/interface/design/i-design-editor-node.d.ts +15 -0
  13. package/es/interface/design/i-design-node-data.d.ts +19 -0
  14. package/es/interface/design/i-design-node.d.ts +80 -0
  15. package/es/interface/design/i-design-page-node-data.d.ts +15 -0
  16. package/es/interface/design/i-design-tree-item.d.ts +26 -0
  17. package/es/interface/design/i-drag-data-item.d.ts +46 -0
  18. package/es/interface/design/index.d.ts +9 -0
  19. package/es/interface/designer.d.ts +8 -7
  20. package/es/interface/index.d.ts +7 -2
  21. package/es/interface/modal/i-modal-body.d.ts +1 -1
  22. package/es/interface/modal/i-modal.d.ts +1 -1
  23. package/es/interface/relationship-diagram-config/i-relationship-diagram-node.d.ts +82 -0
  24. package/es/interface/relationship-diagram-config/i-rule-config.d.ts +135 -0
  25. package/es/interface/relationship-diagram-config/index.d.ts +2 -0
  26. package/es/interface/schema/index.d.ts +2 -0
  27. package/es/interface/schema/widget-props/i-button-props.d.ts +170 -0
  28. package/es/interface/schema/widget-props/i-card-list-props.d.ts +79 -0
  29. package/es/interface/schema/widget-props/i-display-props.d.ts +48 -0
  30. package/es/interface/schema/widget-props/i-form-container-props.d.ts +91 -0
  31. package/es/interface/schema/widget-props/i-form-input-props.d.ts +409 -0
  32. package/es/interface/schema/widget-props/i-layout-props.d.ts +77 -0
  33. package/es/interface/schema/widget-props/i-search-widget-props.d.ts +132 -0
  34. package/es/interface/schema/widget-props/i-table-column-props.d.ts +54 -0
  35. package/es/interface/schema/widget-props/i-table-props.d.ts +384 -0
  36. package/es/interface/schema/widget-props/index.d.ts +9 -0
  37. package/es/interface/schema/widget-types.d.ts +399 -0
  38. package/es/interface/widget/i-common.d.ts +2 -1
  39. package/es/interface/widget/i-editors.d.ts +3 -2
  40. package/es/interface/widget/i-events.d.ts +2 -9
  41. package/es/interface/widget/i-hooks-and-misc.d.ts +1 -0
  42. package/es/interface/widget/i-props.d.ts +14 -32
  43. package/es/interface/widget/i-schemas.d.ts +6 -4
  44. package/es/interface/widget/i-styles.d.ts +2 -1
  45. package/es/interface/widget/index.d.ts +9 -2
  46. package/es/interface/widget-info/i-designer-item-hooks.d.ts +21 -0
  47. package/es/interface/widget-info/i-designer-schema-exports.d.ts +13 -0
  48. package/es/interface/widget-info/i-widget-info-item.d.ts +78 -0
  49. package/es/interface/widget-info/i-widget-info.d.ts +19 -0
  50. package/es/interface/widget-info/index.d.ts +4 -0
  51. package/es/utils/field-editor-override-registry/field-editor-override-registry.d.ts +36 -0
  52. package/es/utils/field-editor-override-registry/field-editor-override-registry.mjs +29 -0
  53. package/es/utils/index.d.ts +4 -2
  54. package/es/utils/index.mjs +6 -0
  55. package/es/utils/schema/index.d.ts +38 -1
  56. package/es/utils/schema/index.mjs +83 -5
  57. package/es/utils/schema/search.d.ts +9 -0
  58. package/es/utils/schema/search.mjs +146 -0
  59. package/es/utils/schema/utils.d.ts +21 -0
  60. package/es/utils/schema/utils.mjs +182 -0
  61. package/es/utils/schema-style/index.mjs +203 -127
  62. package/es/utils/widget-info/widget-info.d.ts +104 -0
  63. package/es/utils/widget-info/widget-info.mjs +151 -0
  64. package/package.json +12 -13
  65. package/dist/index.esm.min.mjs +0 -237
  66. package/dist/index.min.cjs +0 -1
  67. package/dist/index.system.min.js +0 -1
  68. package/es/schema/common-config/common-style.d.ts +0 -3
  69. package/es/schema/common-config/common-style.mjs +0 -85
  70. package/es/schema/index.d.ts +0 -1
@@ -1,155 +1,231 @@
1
- import { isEmpty, pick, isNil } from 'lodash-es';
2
-
1
+ import { isEmpty, isNil, pick } from "lodash-es";
2
+ //#region src/utils/schema-style/index.ts
3
+ /**
4
+ * 样式计算工具类
5
+ * 提供样式单位转换、属性映射、样式属性处理等公共方法
6
+ */
7
+ /**
8
+ * 将像素值转换为对应单位
9
+ * 在移动环境下转换为 vw,其他环境保持 px
10
+ *
11
+ * @param pxValue - 像素值
12
+ * @returns 转换后的单位值字符串
13
+ */
3
14
  function pxToVw(pxValue) {
4
- return pxValue + "px";
15
+ return pxValue + "px";
5
16
  }
17
+ /**
18
+ * 添加 px 单位到样式值
19
+ *
20
+ * @param value - 样式值
21
+ * @returns 带 px 单位和 !important 的样式字符串
22
+ */
6
23
  function addPxUnit(value) {
7
- return isEmpty(value) ? "" : `${value}px !important`;
24
+ return isEmpty(value) ? "" : `${value}px !important`;
8
25
  }
26
+ /**
27
+ * 添加 !important 标志到样式值(不添加单位)
28
+ *
29
+ * @param value - 样式值
30
+ * @returns 带 !important 的样式字符串
31
+ */
9
32
  function addImportant(value) {
10
- return isEmpty(value) ? "" : `${value} !important`;
33
+ return isEmpty(value) ? "" : `${value} !important`;
11
34
  }
35
+ /**
36
+ * 格式化边框样式对象
37
+ *
38
+ * @param border - 边框配置对象,包含 borderWidth、borderStyle、borderColor
39
+ * @returns 格式化后的边框样式字符串
40
+ */
12
41
  function formatBorder(border) {
13
- if (!border || isEmpty(border.borderWidth)) return "";
14
- return `${border.borderWidth}px ${border.borderStyle || "solid"} ${border.borderColor || "transparent"} !important`;
42
+ if (!border || isEmpty(border.borderWidth)) return "";
43
+ return `${border.borderWidth}px ${border.borderStyle || "solid"} ${border.borderColor || "transparent"} !important`;
15
44
  }
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
- }
45
+ /**
46
+ * 字体样式处理默认配置
47
+ */
48
+ var DEFAULT_FONT_CONFIG = {
49
+ fontAttrs: [
50
+ "fontWeight",
51
+ "fontSize",
52
+ "color",
53
+ "textDecorationLine",
54
+ "textAlign"
55
+ ],
56
+ mapAttrs: {
57
+ bold: {
58
+ attr: "fontWeight",
59
+ callback: (value) => {
60
+ return value ? 700 : 400;
61
+ }
62
+ },
63
+ italic: {
64
+ attr: "fontStyle",
65
+ callback: (value) => {
66
+ return value ? "italic" : "normal";
67
+ }
68
+ },
69
+ textDecoration: { attr: "textDecorationLine" },
70
+ fontSize: {
71
+ attr: "fontSize",
72
+ callback: (value) => {
73
+ return value ? pxToVw(value) : "";
74
+ }
75
+ },
76
+ align: { attr: "textAlign" }
77
+ }
50
78
  };
79
+ /**
80
+ * 从字体配置对象中提取并转换字体样式
81
+ *
82
+ * @param font - 字体配置对象
83
+ * @param config - 字体样式处理配置(可选,使用默认配置)
84
+ * @returns 转换后的样式对象
85
+ */
51
86
  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;
87
+ if (!font) return {};
88
+ const result = {};
89
+ Object.assign(result, pick(font, config.fontAttrs));
90
+ if (typeof config.mapAttrs === "object") Object.keys(config.mapAttrs).forEach((k) => {
91
+ const { attr, callback } = config.mapAttrs[k];
92
+ result[attr] = typeof callback === "function" ? callback(font[k]) : font[k];
93
+ });
94
+ return result;
62
95
  }
96
+ /**
97
+ * 将样式属性对象转换为 CSS 样式字符串格式
98
+ *
99
+ * @param styleProps - 样式属性对象
100
+ * @returns 转换后的样式对象(含单位和 !important)
101
+ */
63
102
  function propsToStyle(styleProps = {}) {
64
- const wStyle = {};
65
- for (const prop in styleProps) {
66
- wStyle[prop] = makeStyleProp(prop, styleProps[prop]);
67
- }
68
- return wStyle;
103
+ const wStyle = {};
104
+ for (const prop in styleProps) wStyle[prop] = makeStyleProp(prop, styleProps[prop]);
105
+ return wStyle;
69
106
  }
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"
107
+ /**
108
+ * 不需要添加 px 单位的 CSS 属性列表
109
+ */
110
+ var NOT_NEED_PX_STYLE = [
111
+ "opacity",
112
+ "zIndex",
113
+ "fontWeight",
114
+ "lineHeight",
115
+ "letterSpacing",
116
+ "wordSpacing",
117
+ "textAlign",
118
+ "textDecoration",
119
+ "textTransform",
120
+ "fontStyle",
121
+ "textDecorationLine"
82
122
  ];
123
+ /**
124
+ * 将单个样式属性值转换为带单位的 CSS 字符串
125
+ *
126
+ * @param prop - 属性名
127
+ * @param value - 属性值
128
+ * @returns 转换后的样式值字符串
129
+ */
83
130
  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";
131
+ if (isNil(value) || isEmpty(value)) return "";
132
+ if (NOT_NEED_PX_STYLE.includes(prop)) return value + " !important";
133
+ return value + "px !important";
91
134
  }
92
- const ALIGN_TO_FLEX_MAP = {
93
- left: "flex-start",
94
- center: "center",
95
- right: "flex-end",
96
- justify: "space-between"
135
+ /**
136
+ * 对齐方式到 Flex 对齐值的映射
137
+ */
138
+ var ALIGN_TO_FLEX_MAP = {
139
+ left: "flex-start",
140
+ center: "center",
141
+ right: "flex-end",
142
+ justify: "space-between"
97
143
  };
144
+ /**
145
+ * 将对齐属性值转换为 Flex 对齐值
146
+ *
147
+ * @param align - 对齐方式(left、center、right、justify)
148
+ * @returns 对应的 Flex 对齐值
149
+ */
98
150
  function transAlign2flex(align) {
99
- return ALIGN_TO_FLEX_MAP[align] || align;
151
+ return ALIGN_TO_FLEX_MAP[align] || align;
100
152
  }
153
+ /**
154
+ * 生成位置和尺寸样式对象
155
+ *
156
+ * @param style - 样式配置对象
157
+ * @returns 位置和尺寸样式对象
158
+ */
101
159
  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
- };
160
+ return {
161
+ position: addImportant(style.position),
162
+ top: addPxUnit(style.top),
163
+ left: addPxUnit(style.left),
164
+ right: addPxUnit(style.right),
165
+ bottom: addPxUnit(style.bottom),
166
+ width: addPxUnit(style.width),
167
+ height: addPxUnit(style.height)
168
+ };
111
169
  }
170
+ /**
171
+ * 生成背景和间距样式对象
172
+ *
173
+ * @param style - 样式配置对象
174
+ * @returns 背景和间距样式对象
175
+ */
112
176
  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
- };
177
+ return {
178
+ backgroundColor: addImportant(style.backgroundColor),
179
+ marginTop: addPxUnit(style.marginTop),
180
+ marginRight: addPxUnit(style.marginRight),
181
+ marginBottom: addPxUnit(style.marginBottom),
182
+ marginLeft: addPxUnit(style.marginLeft),
183
+ paddingTop: addPxUnit(style.paddingTop),
184
+ paddingRight: addPxUnit(style.paddingRight),
185
+ paddingBottom: addPxUnit(style.paddingBottom),
186
+ paddingLeft: addPxUnit(style.paddingLeft)
187
+ };
124
188
  }
189
+ /**
190
+ * 生成边框样式对象
191
+ *
192
+ * @param style - 样式配置对象
193
+ * @returns 边框样式对象
194
+ */
125
195
  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
- };
196
+ return {
197
+ borderLeft: formatBorder(style.borderLeft),
198
+ borderRight: formatBorder(style.borderRight),
199
+ borderBottom: formatBorder(style.borderBottom),
200
+ borderTop: formatBorder(style.borderTop),
201
+ borderTopRightRadius: addPxUnit(style.borderTopRightRadius),
202
+ borderTopLeftRadius: addPxUnit(style.borderTopLeftRadius),
203
+ borderBottomRightRadius: addPxUnit(style.borderBottomRightRadius),
204
+ borderBottomLeftRadius: addPxUnit(style.borderBottomLeftRadius)
205
+ };
136
206
  }
207
+ /**
208
+ * 生成完整的包装样式对象
209
+ * 合并位置、间距、边框等所有样式
210
+ *
211
+ * @param style - 样式配置对象
212
+ * @param ignoringStyle - 需要忽略的样式属性数组
213
+ * @returns 合并后的完整样式对象
214
+ */
137
215
  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;
216
+ const styleData = {
217
+ ...generatePositionStyles(style),
218
+ ...generateSpacingStyles(style),
219
+ ...generateBorderStyles(style)
220
+ };
221
+ ignoringStyle.forEach((key) => {
222
+ delete styleData[key];
223
+ });
224
+ Object.keys(styleData).forEach((key) => {
225
+ const val = styleData[key];
226
+ if (isNil(val) || isEmpty(val)) delete styleData[key];
227
+ });
228
+ return styleData;
153
229
  }
154
-
230
+ //#endregion
155
231
  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 {};
@@ -0,0 +1,151 @@
1
+ import { Platform } from "@gct-paas/core";
2
+ //#region src/utils/widget-info/widget-info.ts
3
+ /**
4
+ * 设计界面所有组件配置信息
5
+ *
6
+ * @export
7
+ * @class WidgetInfo
8
+ * @implements {IWidgetInfo}
9
+ */
10
+ var WidgetInfo = class {
11
+ events = {};
12
+ propEditors = {};
13
+ schema = {};
14
+ callback = {};
15
+ beforeCreate = {};
16
+ styleEditors = {};
17
+ designerConfig = {};
18
+ hooks = {};
19
+ whiteList = {};
20
+ blackList = {};
21
+ };
22
+ /**
23
+ * 网页端组件配置信息
24
+ */
25
+ var webWidgetInfo = new WidgetInfo();
26
+ /**
27
+ * 移动端组件配置信息
28
+ */
29
+ var mobileWidgetInfo = new WidgetInfo();
30
+ /**
31
+ * 平板端组件配置信息
32
+ */
33
+ var padWidgetInfo = new WidgetInfo();
34
+ /**
35
+ * 获取指定平台的组件配置信息
36
+ *
37
+ * @export
38
+ * @param {Platform} [platform] 平台类型
39
+ * @return {*} {IWidgetInfo} 组件配置信息
40
+ */
41
+ function getWidgetInfo(platform) {
42
+ switch (platform) {
43
+ case Platform.WEB: return webWidgetInfo;
44
+ case Platform.MOBILE: return mobileWidgetInfo;
45
+ case Platform.PAD: return padWidgetInfo;
46
+ default:
47
+ console.warn(`Unknown platform "${platform}", returning webWidgetInfo by default.`);
48
+ return webWidgetInfo;
49
+ }
50
+ }
51
+ /**
52
+ * 注册单一组件信息
53
+ *
54
+ * @export
55
+ * @param {IWidgetInfo} widgetInfo
56
+ * @param {string} type
57
+ * @param {IObject} module
58
+ */
59
+ function registerWidgetItem(widgetInfo, type, module) {
60
+ widgetInfo.events[type] = module.eventList;
61
+ widgetInfo.hooks[type] = module.hooks;
62
+ widgetInfo.whiteList[type] = module.whiteList;
63
+ widgetInfo.blackList[type] = module.blackList;
64
+ widgetInfo.propEditors[type] = module.propEditorList;
65
+ widgetInfo.schema[type] = module.widget;
66
+ widgetInfo.callback[type] = module.runCallback;
67
+ widgetInfo.beforeCreate[type] = module.beforeCreate;
68
+ widgetInfo.styleEditors[type] = module.styleEditorList;
69
+ widgetInfo.designerConfig[type] = module.designerConfig;
70
+ }
71
+ /**
72
+ * 注册网页端单一组件信息
73
+ *
74
+ * @export
75
+ * @param {IObject} module
76
+ * @param {string} type
77
+ */
78
+ function registerWebWidgetItem(module, type) {
79
+ registerWidgetItem(webWidgetInfo, type, module);
80
+ }
81
+ /**
82
+ * 注册移动端单一组件信息
83
+ *
84
+ * @export
85
+ * @param {IObject} module
86
+ * @param {string} type
87
+ */
88
+ function registerMobileWidgetItem(module, type) {
89
+ registerWidgetItem(mobileWidgetInfo, type, module);
90
+ }
91
+ /**
92
+ * 注册平板端单一组件信息
93
+ *
94
+ * @export
95
+ * @param {IObject} module
96
+ * @param {string} type
97
+ */
98
+ function registerPadWidgetItem(module, type) {
99
+ registerWidgetItem(padWidgetInfo, type, module);
100
+ }
101
+ /**
102
+ * 注册单一组件信息(插件方式)
103
+ *
104
+ * @export
105
+ * @param {IWidgetInfo} widgetInfo
106
+ * @param {IWidgetInfoItem} designer
107
+ */
108
+ function registerPluginWidgetItem(widgetInfo, designer) {
109
+ if (designer) {
110
+ const { type } = designer.schema;
111
+ widgetInfo.events[type] = designer.events;
112
+ widgetInfo.hooks[type] = designer.hooks;
113
+ widgetInfo.whiteList[type] = designer.whiteList;
114
+ widgetInfo.blackList[type] = designer.blackList;
115
+ widgetInfo.propEditors[type] = designer.propEditors;
116
+ widgetInfo.schema[type] = designer.schema;
117
+ widgetInfo.callback[type] = designer.callback;
118
+ widgetInfo.beforeCreate[type] = designer.beforeCreate;
119
+ widgetInfo.styleEditors[type] = designer.styleEditors;
120
+ widgetInfo.designerConfig[type] = designer.designerConfig;
121
+ }
122
+ }
123
+ /**
124
+ * 注册网页端插件组件配置
125
+ *
126
+ * @export
127
+ * @param {IWidgetInfoItem} designer
128
+ */
129
+ function registerWebPluginWidgetItem(designer) {
130
+ registerPluginWidgetItem(webWidgetInfo, designer);
131
+ }
132
+ /**
133
+ * 注册移动端插件组件配置
134
+ *
135
+ * @export
136
+ * @param {IWidgetInfoItem} designer
137
+ */
138
+ function registerMobilePluginWidgetItem(designer) {
139
+ registerPluginWidgetItem(mobileWidgetInfo, designer);
140
+ }
141
+ /**
142
+ * 注册平板端插件组件配置
143
+ *
144
+ * @export
145
+ * @param {IWidgetInfoItem} designer
146
+ */
147
+ function registerPadPluginWidgetItem(designer) {
148
+ registerPluginWidgetItem(padWidgetInfo, designer);
149
+ }
150
+ //#endregion
151
+ export { getWidgetInfo, mobileWidgetInfo, padWidgetInfo, registerMobilePluginWidgetItem, registerMobileWidgetItem, registerPadPluginWidgetItem, registerPadWidgetItem, registerPluginWidgetItem, registerWebPluginWidgetItem, registerWebWidgetItem, registerWidgetItem, webWidgetInfo };
package/package.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "name": "@gct-paas/schema",
3
- "version": "0.1.4-dev.8",
3
+ "version": "0.1.5-dev.0",
4
4
  "type": "module",
5
5
  "description": "paas 平台 schema 架构包",
6
- "main": "dist/index.min.cjs",
7
- "module": "es/index.mjs",
6
+ "loader": "dist/index.esm.min.js",
8
7
  "types": "es/index.d.ts",
9
- "system": "dist/index.system.min.js",
10
8
  "exports": {
11
9
  ".": {
12
10
  "types": "./es/index.d.ts",
13
- "import": "./es/index.mjs",
14
- "require": "./dist/index.min.cjs"
11
+ "import": "./es/index.mjs"
15
12
  },
16
13
  "./types": {
17
14
  "types": "./es/types/index.d.ts"
@@ -51,13 +48,15 @@
51
48
  "gen-api:platform": "gct-paas gen-api --url=http://paas.paasdev.gct-paas.com --tag=platform -t ../cli/hbs-temp -o ./src/service/gct-platform && prettier './src/service/gct-platform' --write"
52
49
  },
53
50
  "dependencies": {
54
- "@gct-paas/api": "0.1.0-dev.8",
55
- "@gct-paas/core": "0.1.4-dev.8",
56
- "vue": "^3.5.28"
51
+ "@gct-paas/api": "^0.1.2-dev.3",
52
+ "@gct-paas/core": "0.1.5-dev.0",
53
+ "lodash-es": "^4.17.23",
54
+ "vue": "^3.5.30"
57
55
  },
58
- "devDependencies": {
59
- "@gct-paas/build": "^0.1.5-dev.6",
60
- "vitest": "^4.0.18"
56
+ "peerDependencies": {
57
+ "@gct-paas/api": "*",
58
+ "@gct-paas/core": "*",
59
+ "vue": ">=3"
61
60
  },
62
- "gitHead": "bf7f4f9672c3906ec834e6d58b999ce78f7cad08"
61
+ "gitHead": "d5a1badfd34c55ceefd2cf33f2ee659454076e37"
63
62
  }