@gct-paas/design 0.1.4-dev.16 → 0.1.4-dev.17

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.
@@ -0,0 +1,221 @@
1
+ import { fixedAlignEditor } from "../common-config/column-editor-config.mjs";
2
+ import "lodash-es";
3
+ import { BindCmpStyleEnum, FIELD_TYPE, FormComponents, Platform, ProgressTypeEnum, PropGroup, StyleGroup, TagTypeEnum, TextDecoration, buildShortUUID, fixedAlignENUM, tableColumnWidthEnum, tagEnum } from "@gct-paas/core";
4
+ import "@gct-paas/schema";
5
+ fixedAlignENUM.NONE, tableColumnWidthEnum.ATUO;
6
+ function webRunPropEditor(list) {
7
+ return [
8
+ ...list,
9
+ ...fixedAlignEditor,
10
+ {
11
+ component: "radio-display-editor",
12
+ name: "displayType",
13
+ label: "sys.pageDesigner.displayStyle",
14
+ group: PropGroup.SHOW,
15
+ _config: { options: [{
16
+ icon: "paperclip",
17
+ label: "sys.pageDesigner.oneFile",
18
+ value: "concise"
19
+ }, {
20
+ icon: "fujian",
21
+ label: "sys.pageDesigner.fileName",
22
+ value: "more"
23
+ }] },
24
+ hidden(widget) {
25
+ if (widget.props.fieldType !== FIELD_TYPE.ATTACHMENT) return true;
26
+ }
27
+ },
28
+ {
29
+ component: "max-display-editor",
30
+ name: "displayMaxNum",
31
+ label: "sys.pageDesigner.displayMaxNum",
32
+ group: PropGroup.SHOW,
33
+ _config: {
34
+ min: 1,
35
+ max: 20,
36
+ precision: 0
37
+ },
38
+ hidden(widget) {
39
+ if (widget.props.fieldType !== FIELD_TYPE.IMAGE) return true;
40
+ }
41
+ }
42
+ ];
43
+ }
44
+ var styleUtils = {
45
+ columnWidthEditor: [{
46
+ component: "column-width-editor",
47
+ name: {
48
+ number: "columnwidth",
49
+ type: "columnwidthConfigure"
50
+ },
51
+ label: "",
52
+ group: StyleGroup.LAYOUT,
53
+ _config: { columnWidthEnum: [tableColumnWidthEnum.ATUO, tableColumnWidthEnum.ENUMERATION] },
54
+ hidden(widget) {
55
+ return widget.platform == Platform.MOBILE;
56
+ }
57
+ }, {
58
+ component: "column-width-editor",
59
+ name: {
60
+ percentage: "columnwidth",
61
+ type: "columnwidthConfigure"
62
+ },
63
+ label: "",
64
+ group: StyleGroup.LAYOUT,
65
+ _config: { columnWidthEnum: [tableColumnWidthEnum.ATUO, tableColumnWidthEnum.PERCENTAGE] },
66
+ hidden(widget) {
67
+ return widget.platform === Platform.WEB || widget.platform === Platform.PAD;
68
+ }
69
+ }],
70
+ labelFontEditor: [{
71
+ component: "font-editor",
72
+ name: "labelFont",
73
+ label: "sys.name",
74
+ group: StyleGroup.STYLE,
75
+ hidden(widget) {
76
+ return widget.platform === Platform.PAD;
77
+ }
78
+ }],
79
+ contentFontEditor: [{
80
+ component: "font-editor",
81
+ name: "contentFont",
82
+ label: "sys.content",
83
+ group: StyleGroup.STYLE,
84
+ hidden(widget) {
85
+ if (widget.props?.fieldType == FIELD_TYPE.DATA_TABLE_FORMULA || widget.type == FormComponents.DataTableFormula) return true;
86
+ return [
87
+ FIELD_TYPE.ATTACHMENT,
88
+ FIELD_TYPE.IMAGE,
89
+ FIELD_TYPE.SIGNATURE
90
+ ].includes(widget.props.fieldType);
91
+ },
92
+ _config: { hiddenColor: true }
93
+ }],
94
+ tagEditor: [{
95
+ component: "boolean-editor",
96
+ name: "tagStyleOpen",
97
+ label: "sys.pageDesigner.tagStyle",
98
+ group: StyleGroup.STYLE,
99
+ hidden(widget) {
100
+ if ([FIELD_TYPE.BOOLEAN, FIELD_TYPE.EXPRESSION].includes(widget.props.fieldType) && widget.props.bindCompStyleType === BindCmpStyleEnum.CMP_BOOLEAN) return true;
101
+ if (widget.props?.fieldType == FIELD_TYPE.DATA_TABLE_FORMULA || widget.type == FormComponents.DataTableFormula) return true;
102
+ return [
103
+ FIELD_TYPE.ATTACHMENT,
104
+ FIELD_TYPE.IMAGE,
105
+ FIELD_TYPE.RDO_REF,
106
+ FIELD_TYPE.SIGNATURE
107
+ ].includes(widget.props.fieldType);
108
+ },
109
+ _config: {
110
+ showType: "checkbox",
111
+ options: [{
112
+ label: "sys.pageDesigner.configureContentAsLabelStyle",
113
+ value: true
114
+ }]
115
+ },
116
+ changeCallback: (widget, value) => {
117
+ if (value && !widget.style.tagStyle) widget.style.tagStyle = {
118
+ color: "",
119
+ tagType: TagTypeEnum.RADIUS
120
+ };
121
+ }
122
+ }, {
123
+ component: "tag-editor",
124
+ name: "tagStyle",
125
+ group: StyleGroup.STYLE,
126
+ hidden: (widget) => {
127
+ if ([FIELD_TYPE.BOOLEAN, FIELD_TYPE.EXPRESSION].includes(widget.props.fieldType) && widget.props.bindCompStyleType === BindCmpStyleEnum.CMP_BOOLEAN) return true;
128
+ if ([
129
+ FIELD_TYPE.ATTACHMENT,
130
+ FIELD_TYPE.IMAGE,
131
+ FIELD_TYPE.RDO_REF
132
+ ].includes(widget.props.fieldType)) return true;
133
+ if (widget.props?.fieldType == FIELD_TYPE.DATA_TABLE_FORMULA || widget.type == FormComponents.DataTableFormula) return true;
134
+ return !widget.style.tagStyleOpen;
135
+ }
136
+ }],
137
+ columnFormulaStyleByRule: [{
138
+ component: "column-tag-editor",
139
+ name: "columnFontStyleByRule",
140
+ label: "",
141
+ group: StyleGroup.STYLE,
142
+ _config: { generator: getFontStyleRule },
143
+ hidden(widget) {
144
+ return !(widget.props?.fieldType == FIELD_TYPE.DATA_TABLE_FORMULA || widget.type == FormComponents.DataTableFormula);
145
+ }
146
+ }, {
147
+ component: "column-backgound-editor",
148
+ name: "columnBackgroundByRule",
149
+ label: "",
150
+ group: StyleGroup.BACKGROUND,
151
+ _config: { generator: getBackgroundRule },
152
+ hidden(widget) {
153
+ return !(widget.props?.fieldType == FIELD_TYPE.DATA_TABLE_FORMULA || widget.type == FormComponents.DataTableFormula);
154
+ }
155
+ }]
156
+ };
157
+ function runStyleEditor() {
158
+ return [
159
+ ...styleUtils.columnWidthEditor,
160
+ ...styleUtils.contentFontEditor,
161
+ ...styleUtils.tagEditor,
162
+ ...styleUtils.columnFormulaStyleByRule
163
+ ];
164
+ }
165
+ function mobileRunSubTableStyleEditor() {
166
+ return [
167
+ {
168
+ component: "column-width-editor",
169
+ name: {
170
+ number: "columnwidth",
171
+ type: "columnwidthConfigure"
172
+ },
173
+ label: "",
174
+ group: StyleGroup.LAYOUT,
175
+ _config: { columnWidthEnum: [tableColumnWidthEnum.ATUO, tableColumnWidthEnum.ENUMERATION] },
176
+ hidden(widget) {
177
+ return widget.platform == Platform.MOBILE;
178
+ }
179
+ },
180
+ ...styleUtils.labelFontEditor,
181
+ ...styleUtils.contentFontEditor,
182
+ ...styleUtils.tagEditor,
183
+ ...styleUtils.columnFormulaStyleByRule
184
+ ];
185
+ }
186
+ /**添加样式规则 */
187
+ function getFontStyleRule() {
188
+ return {
189
+ id: buildShortUUID("content"),
190
+ displayRule: "",
191
+ contentFont: {
192
+ fontSize: "",
193
+ bold: false,
194
+ italic: false,
195
+ textDecoration: TextDecoration.NONE,
196
+ color: "",
197
+ align: "left"
198
+ },
199
+ tagStyle: {
200
+ color: "#0DAA9C",
201
+ tagType: TagTypeEnum.RADIUS,
202
+ progressBarType: ProgressTypeEnum.CIRCLE
203
+ },
204
+ progressStyle: {
205
+ color: "#0DAA9C",
206
+ tagType: ProgressTypeEnum.CIRCLE
207
+ },
208
+ tagType: tagEnum.TAG,
209
+ tagStyleOpen: false
210
+ };
211
+ }
212
+ /**添加背景下规则 */
213
+ function getBackgroundRule() {
214
+ return {
215
+ id: buildShortUUID("background"),
216
+ displayRule: "",
217
+ backgroundColor: ""
218
+ };
219
+ }
220
+ //#endregion
221
+ export { mobileRunSubTableStyleEditor, runStyleEditor, webRunPropEditor };
@@ -0,0 +1,3 @@
1
+ export declare function runPropEditor(selectedRef: IObject, propEditorList: IObject[]): IObject[];
2
+ export declare function runStyleEditor(_selectedRef: IObject, propEditorList: IObject[]): IObject[];
3
+ export declare function runEventEditor(): never[];
@@ -0,0 +1,14 @@
1
+ import { LowCodeWidget } from '@gct-paas/schema';
2
+ export declare class FieldOverrideUtil {
3
+ static tableVTablePropEditor(selectedRef: LowCodeWidget.BasicSchema, defaultList: LowCodeWidget.PropEditor[]): LowCodeWidget.PropEditor[];
4
+ /**
5
+ * gct-paas-design src/widgets/web/other/table-select/table-select.ts 里边覆写这个方法
6
+ *
7
+ * @static
8
+ * @param {LowCodeWidget.BasicSchema} selectedRef
9
+ * @param {string} [type]
10
+ * @return {*} {LowCodeWidget.PropEditor[]}
11
+ */
12
+ static runTableSelectPropEditor(selectedRef: LowCodeWidget.BasicSchema, type?: string): LowCodeWidget.PropEditor[];
13
+ }
14
+ export declare function setupOverride(): void;
@@ -0,0 +1,66 @@
1
+ import { runPropEditor } from "./card-list-field.mjs";
2
+ import { mobileRunSubTableStyleEditor, runStyleEditor, webRunPropEditor } from "./data-table-column.mjs";
3
+ import { MaterialEnum, Platform, SUB_TABLE_EDIT_MODE } from "@gct-paas/core";
4
+ import { FieldEditorOverrideRegistry, padVTableSupportEditFieldTypes } from "@gct-paas/schema";
5
+ //#region src/schema/field/index.ts
6
+ //! 此文件不要写其他逻辑,这里是旧模式的兼容性写法
7
+ var FieldOverrideUtil = class {
8
+ static tableVTablePropEditor(selectedRef, defaultList) {
9
+ const { platform } = selectedRef;
10
+ if (platform === Platform.PAD) {
11
+ const fieldType = selectedRef.props.fieldType;
12
+ return padVTableSupportEditFieldTypes.includes(fieldType) ? webRunPropEditor(defaultList) : runPropEditor(selectedRef, defaultList, false);
13
+ }
14
+ return platform === Platform.WEB ? webRunPropEditor(defaultList) : runPropEditor(selectedRef, defaultList, false);
15
+ }
16
+ /**
17
+ * gct-paas-design src/widgets/web/other/table-select/table-select.ts 里边覆写这个方法
18
+ *
19
+ * @static
20
+ * @param {LowCodeWidget.BasicSchema} selectedRef
21
+ * @param {string} [type]
22
+ * @return {*} {LowCodeWidget.PropEditor[]}
23
+ */
24
+ static runTableSelectPropEditor(selectedRef, type) {
25
+ console.log("table-select-field", selectedRef, type);
26
+ return [];
27
+ }
28
+ };
29
+ function setupOverride() {
30
+ console.debug("正在注册字段编辑器覆写配置");
31
+ FieldEditorOverrideRegistry.register(MaterialEnum.MaterialTableField, {
32
+ propEditor: (selectedRef, defaultList) => {
33
+ return FieldOverrideUtil.tableVTablePropEditor(selectedRef, defaultList);
34
+ },
35
+ styleEditor: (_selectedRef, _defaultWidget) => runStyleEditor()
36
+ });
37
+ FieldEditorOverrideRegistry.register(MaterialEnum.MaterialEmbedTableField, {
38
+ propEditor: (selectedRef, defaultList) => {
39
+ return FieldOverrideUtil.tableVTablePropEditor(selectedRef, defaultList);
40
+ },
41
+ styleEditor: (_selectedRef, _defaultWidget) => runStyleEditor()
42
+ });
43
+ FieldEditorOverrideRegistry.register(MaterialEnum.MaterialSubTableField, {
44
+ propEditor: (selectedRef, defaultList, preCompInfo) => {
45
+ if (preCompInfo && preCompInfo.props?.editMode === SUB_TABLE_EDIT_MODE.MODAL) return FieldOverrideUtil.runTableSelectPropEditor(selectedRef, "subTable2Field");
46
+ const { platform } = selectedRef;
47
+ if (platform === Platform.PAD) {
48
+ const fieldType = selectedRef.props.fieldType;
49
+ return padVTableSupportEditFieldTypes.includes(fieldType) ? webRunPropEditor(defaultList) : runPropEditor(selectedRef, defaultList, false);
50
+ }
51
+ if (platform === Platform.WEB) return webRunPropEditor(defaultList);
52
+ },
53
+ styleEditor: (selectedRef, _defaultWidget) => {
54
+ return selectedRef.platform === Platform.WEB ? runStyleEditor() : mobileRunSubTableStyleEditor();
55
+ }
56
+ });
57
+ FieldEditorOverrideRegistry.register(MaterialEnum.MaterialTableSelectField, {
58
+ propEditor: (selectedRef, _defaultList) => {
59
+ return FieldOverrideUtil.runTableSelectPropEditor(selectedRef);
60
+ },
61
+ styleEditor: (_selectedRef, _defaultWidget) => runStyleEditor()
62
+ });
63
+ }
64
+ setupOverride();
65
+ //#endregion
66
+ export { FieldOverrideUtil, setupOverride };
@@ -13,3 +13,4 @@ export * from './common-config/autofill-editor-config';
13
13
  export * from './common-config/column-editor-config';
14
14
  export * from './search/BaseSearch';
15
15
  export * from './search/BaseDate';
16
+ export * from './field';
@@ -12,3 +12,4 @@ import "./common-config/autofill-editor-config.mjs";
12
12
  import "./common-config/column-editor-config.mjs";
13
13
  import "./search/BaseSearch.mjs";
14
14
  import "./search/BaseDate.mjs";
15
+ import "./field/index.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/design",
3
- "version": "0.1.4-dev.16",
3
+ "version": "0.1.4-dev.17",
4
4
  "type": "module",
5
5
  "description": "paas 平台设计界面底包",
6
6
  "loader": "dist/loader.esm.min.js",
@@ -45,10 +45,10 @@
45
45
  "@ant-design/icons-vue": "^7.0.1",
46
46
  "@babel/core": "^7.29.0",
47
47
  "@gct-paas/api": "^0.1.2-dev.1",
48
- "@gct-paas/core": "0.1.4-dev.16",
49
- "@gct-paas/core-web": "0.1.4-dev.16",
50
- "@gct-paas/schema": "0.1.4-dev.16",
51
- "@gct-paas/scss": "0.1.4-dev.16",
48
+ "@gct-paas/core": "0.1.4-dev.17",
49
+ "@gct-paas/core-web": "0.1.4-dev.17",
50
+ "@gct-paas/schema": "0.1.4-dev.17",
51
+ "@gct-paas/scss": "0.1.4-dev.17",
52
52
  "@jsplumb/browser-ui": "^6.2.10",
53
53
  "@vueuse/core": "^14.1.0",
54
54
  "ant-design-vue": "~3.2.20",
@@ -77,5 +77,5 @@
77
77
  "@gct-paas/scss": "*",
78
78
  "vue": ">=3"
79
79
  },
80
- "gitHead": "cee8da739039182f4df08a2c0126cdd578fbc33b"
80
+ "gitHead": "386e2564d23891fd28c72e649788697ad12b7768"
81
81
  }