@tmagic/editor 1.7.8-beta.2 → 1.7.8-beta.4
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.
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/utils/data-source/index.js +4 -3
- package/dist/tmagic-editor.umd.cjs +41 -31
- package/package.json +7 -7
- package/src/components/CodeBlockEditor.vue +76 -66
- package/src/components/CodeParams.vue +3 -3
- package/src/fields/CodeSelectCol.vue +4 -1
- package/src/fields/DataSourceFieldSelect/Index.vue +3 -1
- package/src/fields/DataSourceMethodSelect.vue +4 -1
- package/src/fields/EventSelect.vue +65 -58
- package/src/fields/StyleSetter/components/Border.vue +35 -33
- package/src/fields/StyleSetter/pro/Background.vue +4 -4
- package/src/fields/StyleSetter/pro/Border.vue +3 -3
- package/src/fields/StyleSetter/pro/Font.vue +3 -3
- package/src/fields/StyleSetter/pro/Layout.vue +2 -2
- package/src/fields/StyleSetter/pro/Position.vue +3 -3
- package/src/utils/data-source/formConfigs/base.ts +2 -2
- package/src/utils/data-source/index.ts +6 -6
- package/src/utils/props.ts +2 -2
- package/types/index.d.ts +20 -20
|
@@ -63,7 +63,14 @@ import { computed, inject, nextTick, Ref, ref, useTemplateRef, watch } from 'vue
|
|
|
63
63
|
|
|
64
64
|
import type { CodeBlockContent } from '@tmagic/core';
|
|
65
65
|
import { TMagicButton, TMagicDialog, tMagicMessage, tMagicMessageBox, TMagicTag } from '@tmagic/design';
|
|
66
|
-
import {
|
|
66
|
+
import {
|
|
67
|
+
type ContainerChangeEventData,
|
|
68
|
+
defineFormConfig,
|
|
69
|
+
defineFormItem,
|
|
70
|
+
type FormConfig,
|
|
71
|
+
MFormBox,
|
|
72
|
+
type TableColumnConfig,
|
|
73
|
+
} from '@tmagic/form';
|
|
67
74
|
|
|
68
75
|
import FloatingBox from '@editor/components/FloatingBox.vue';
|
|
69
76
|
import { useEditorContentHeight } from '@editor/hooks/use-editor-content-height';
|
|
@@ -112,7 +119,7 @@ const diffChange = () => {
|
|
|
112
119
|
difVisible.value = false;
|
|
113
120
|
};
|
|
114
121
|
|
|
115
|
-
const defaultParamColConfig = {
|
|
122
|
+
const defaultParamColConfig = defineFormItem<TableColumnConfig>({
|
|
116
123
|
type: 'row',
|
|
117
124
|
label: '参数类型',
|
|
118
125
|
items: [
|
|
@@ -140,76 +147,79 @@ const defaultParamColConfig = {
|
|
|
140
147
|
],
|
|
141
148
|
},
|
|
142
149
|
],
|
|
143
|
-
};
|
|
150
|
+
});
|
|
144
151
|
|
|
145
|
-
const functionConfig = computed
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
name: 'name',
|
|
149
|
-
rules: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
text: '描述',
|
|
153
|
-
name: 'desc',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
text: '执行时机',
|
|
157
|
-
name: 'timing',
|
|
158
|
-
type: 'select',
|
|
159
|
-
options: () => {
|
|
160
|
-
const options = [
|
|
161
|
-
{ text: '初始化前', value: 'beforeInit' },
|
|
162
|
-
{ text: '初始化后', value: 'afterInit' },
|
|
163
|
-
];
|
|
164
|
-
if (props.dataSourceType !== 'base') {
|
|
165
|
-
options.push({ text: '请求前', value: 'beforeRequest' });
|
|
166
|
-
options.push({ text: '请求后', value: 'afterRequest' });
|
|
167
|
-
}
|
|
168
|
-
return options;
|
|
169
|
-
},
|
|
170
|
-
display: () => props.isDataSource,
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
type: 'table',
|
|
174
|
-
border: true,
|
|
175
|
-
text: '参数',
|
|
176
|
-
enableFullscreen: false,
|
|
177
|
-
enableToggleMode: false,
|
|
178
|
-
name: 'params',
|
|
179
|
-
dropSort: false,
|
|
180
|
-
items: [
|
|
152
|
+
const functionConfig = computed(
|
|
153
|
+
() =>
|
|
154
|
+
defineFormConfig([
|
|
181
155
|
{
|
|
182
|
-
|
|
183
|
-
label: '参数名',
|
|
156
|
+
text: '名称',
|
|
184
157
|
name: 'name',
|
|
158
|
+
rules: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
185
159
|
},
|
|
186
160
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
name: 'extra',
|
|
161
|
+
text: '描述',
|
|
162
|
+
name: 'desc',
|
|
190
163
|
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
164
|
+
{
|
|
165
|
+
text: '执行时机',
|
|
166
|
+
name: 'timing',
|
|
167
|
+
type: 'select',
|
|
168
|
+
options: () => {
|
|
169
|
+
const options = [
|
|
170
|
+
{ text: '初始化前', value: 'beforeInit' },
|
|
171
|
+
{ text: '初始化后', value: 'afterInit' },
|
|
172
|
+
];
|
|
173
|
+
if (props.dataSourceType !== 'base') {
|
|
174
|
+
options.push({ text: '请求前', value: 'beforeRequest' });
|
|
175
|
+
options.push({ text: '请求后', value: 'afterRequest' });
|
|
176
|
+
}
|
|
177
|
+
return options;
|
|
178
|
+
},
|
|
179
|
+
display: () => props.isDataSource,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
type: 'table',
|
|
183
|
+
border: true,
|
|
184
|
+
text: '参数',
|
|
185
|
+
enableFullscreen: false,
|
|
186
|
+
enableToggleMode: false,
|
|
187
|
+
name: 'params',
|
|
188
|
+
dropSort: false,
|
|
189
|
+
items: [
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
label: '参数名',
|
|
193
|
+
name: 'name',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'text',
|
|
197
|
+
label: '描述',
|
|
198
|
+
name: 'extra',
|
|
199
|
+
},
|
|
200
|
+
codeBlockService.getParamsColConfig() || defaultParamColConfig,
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'content',
|
|
205
|
+
type: 'vs-code',
|
|
206
|
+
options: inject('codeOptions', {}),
|
|
207
|
+
autosize: { minRows: 10, maxRows: 30 },
|
|
208
|
+
onChange: (_formState, code: string) => {
|
|
209
|
+
try {
|
|
210
|
+
// 检测js代码是否存在语法错误
|
|
211
|
+
getEditorConfig('parseDSL')(code);
|
|
212
|
+
|
|
213
|
+
return code;
|
|
214
|
+
} catch (error: any) {
|
|
215
|
+
tMagicMessage.error(error.message);
|
|
216
|
+
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
]) as FormConfig,
|
|
222
|
+
);
|
|
213
223
|
|
|
214
224
|
const parseContent = (content: any) => {
|
|
215
225
|
if (typeof content === 'string') {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<script lang="ts" setup>
|
|
14
14
|
import { computed, useTemplateRef } from 'vue';
|
|
15
15
|
|
|
16
|
-
import { type ContainerChangeEventData, type
|
|
16
|
+
import { type ContainerChangeEventData, type FormItemConfig, type FormValue, MForm } from '@tmagic/form';
|
|
17
17
|
|
|
18
18
|
import type { CodeParamStatement } from '@editor/type';
|
|
19
19
|
import { error } from '@editor/utils';
|
|
@@ -34,7 +34,7 @@ const emit = defineEmits(['change']);
|
|
|
34
34
|
|
|
35
35
|
const formRef = useTemplateRef<InstanceType<typeof MForm>>('form');
|
|
36
36
|
|
|
37
|
-
const getFormConfig = (items:
|
|
37
|
+
const getFormConfig = (items: FormItemConfig[] = []) => [
|
|
38
38
|
{
|
|
39
39
|
type: 'fieldset',
|
|
40
40
|
items,
|
|
@@ -51,7 +51,7 @@ const codeParamsConfig = computed(() =>
|
|
|
51
51
|
name,
|
|
52
52
|
text,
|
|
53
53
|
extra,
|
|
54
|
-
fieldConfig: config,
|
|
54
|
+
fieldConfig: config as FormItemConfig,
|
|
55
55
|
})),
|
|
56
56
|
),
|
|
57
57
|
);
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
createValues,
|
|
51
51
|
type FieldProps,
|
|
52
52
|
filterFunction,
|
|
53
|
+
type FormItemConfig,
|
|
53
54
|
type FormState,
|
|
54
55
|
MSelect,
|
|
55
56
|
type SelectConfig,
|
|
@@ -141,7 +142,9 @@ const onCodeIdChangeHandler = (value: any) => {
|
|
|
141
142
|
|
|
142
143
|
changeRecords.push({
|
|
143
144
|
propPath: props.prop.replace(`${props.name}`, 'params'),
|
|
144
|
-
value: paramsConfig.value.length
|
|
145
|
+
value: paramsConfig.value.length
|
|
146
|
+
? createValues(mForm, paramsConfig.value as unknown as FormItemConfig[], {}, props.model.params)
|
|
147
|
+
: {},
|
|
145
148
|
});
|
|
146
149
|
|
|
147
150
|
emit('change', value, {
|
|
@@ -98,7 +98,9 @@ const dataSources = computed(() => dataSourceService.get('dataSources') || []);
|
|
|
98
98
|
const disabledDataSource = computed(() => propsService.getDisabledDataSource());
|
|
99
99
|
|
|
100
100
|
const type = computed((): string => {
|
|
101
|
-
|
|
101
|
+
if (!props.config.fieldConfig) return '';
|
|
102
|
+
|
|
103
|
+
let type = 'type' in props.config.fieldConfig ? props.config.fieldConfig.type : '';
|
|
102
104
|
if (typeof type === 'function') {
|
|
103
105
|
type = type(mForm, {
|
|
104
106
|
model: props.model,
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
type DataSourceMethodSelectConfig,
|
|
49
49
|
type FieldProps,
|
|
50
50
|
filterFunction,
|
|
51
|
+
type FormItemConfig,
|
|
51
52
|
type FormState,
|
|
52
53
|
MCascader,
|
|
53
54
|
} from '@tmagic/form';
|
|
@@ -142,7 +143,9 @@ const onChangeHandler = (value: any) => {
|
|
|
142
143
|
|
|
143
144
|
changeRecords.push({
|
|
144
145
|
propPath: props.prop.replace(`${props.name}`, 'params'),
|
|
145
|
-
value: paramsConfig.value.length
|
|
146
|
+
value: paramsConfig.value.length
|
|
147
|
+
? createValues(mForm, paramsConfig.value as unknown as FormItemConfig[], {}, props.model.params)
|
|
148
|
+
: {},
|
|
146
149
|
});
|
|
147
150
|
|
|
148
151
|
emit('change', value, {
|
|
@@ -62,14 +62,15 @@ import type {
|
|
|
62
62
|
CodeSelectColConfig,
|
|
63
63
|
ContainerChangeEventData,
|
|
64
64
|
DataSourceMethodSelectConfig,
|
|
65
|
+
DynamicTypeConfig,
|
|
65
66
|
EventSelectConfig,
|
|
66
67
|
FieldProps,
|
|
67
68
|
FormState,
|
|
68
|
-
OnChangeHandlerData,
|
|
69
69
|
PanelConfig,
|
|
70
70
|
TableConfig,
|
|
71
|
+
UISelectConfig,
|
|
71
72
|
} from '@tmagic/form';
|
|
72
|
-
import { MContainer as MFormContainer, MPanel, MTable } from '@tmagic/form';
|
|
73
|
+
import { defineFormItem, MContainer as MFormContainer, MPanel, MTable } from '@tmagic/form';
|
|
73
74
|
import { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, traverseNode } from '@tmagic/utils';
|
|
74
75
|
|
|
75
76
|
import { useServices } from '@editor/hooks/use-services';
|
|
@@ -212,12 +213,12 @@ const actionTypeConfig = computed(() => {
|
|
|
212
213
|
|
|
213
214
|
// 联动组件配置
|
|
214
215
|
const targetCompConfig = computed(() => {
|
|
215
|
-
const defaultTargetCompConfig = {
|
|
216
|
+
const defaultTargetCompConfig: UISelectConfig = {
|
|
216
217
|
name: 'to',
|
|
217
218
|
text: '联动组件',
|
|
218
219
|
type: 'ui-select',
|
|
219
|
-
display: (
|
|
220
|
-
onChange: (
|
|
220
|
+
display: (_mForm, { model }) => model.actionType === ActionType.COMP,
|
|
221
|
+
onChange: (_MForm, _v, { setModel }) => {
|
|
221
222
|
setModel('method', '');
|
|
222
223
|
},
|
|
223
224
|
};
|
|
@@ -226,7 +227,7 @@ const targetCompConfig = computed(() => {
|
|
|
226
227
|
|
|
227
228
|
// 联动组件动作配置
|
|
228
229
|
const compActionConfig = computed(() => {
|
|
229
|
-
const defaultCompActionConfig = {
|
|
230
|
+
const defaultCompActionConfig: DynamicTypeConfig = {
|
|
230
231
|
name: 'method',
|
|
231
232
|
text: '动作',
|
|
232
233
|
type: (mForm: FormState | undefined, { model }: any) => {
|
|
@@ -304,62 +305,68 @@ const dataSourceActionConfig = computed(() => {
|
|
|
304
305
|
});
|
|
305
306
|
|
|
306
307
|
// 兼容旧的数据格式
|
|
307
|
-
const tableConfig = computed
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
308
|
+
const tableConfig = computed(
|
|
309
|
+
() =>
|
|
310
|
+
defineFormItem({
|
|
311
|
+
type: 'table',
|
|
312
|
+
name: 'events',
|
|
313
|
+
items: [
|
|
314
|
+
{
|
|
315
|
+
name: 'name',
|
|
316
|
+
label: '事件名',
|
|
317
|
+
type: eventNameConfig.value.type,
|
|
318
|
+
options: (mForm: FormState, { formValue }: any) =>
|
|
319
|
+
eventsService.getEvent(formValue.type).map((option: any) => ({
|
|
320
|
+
text: option.label,
|
|
321
|
+
value: option.value,
|
|
322
|
+
})),
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: 'to',
|
|
326
|
+
label: '联动组件',
|
|
327
|
+
type: 'ui-select',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: 'method',
|
|
331
|
+
label: '动作',
|
|
332
|
+
type: compActionConfig.value.type,
|
|
333
|
+
options: (mForm: FormState, { model }: any) => {
|
|
334
|
+
const node = editorService.getNodeById(model.to);
|
|
335
|
+
if (!node?.type) return [];
|
|
336
|
+
|
|
337
|
+
return eventsService.getMethod(node.type, model.to).map((option: any) => ({
|
|
338
|
+
text: option.label,
|
|
339
|
+
value: option.value,
|
|
340
|
+
}));
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
}) as TableConfig,
|
|
345
|
+
);
|
|
342
346
|
|
|
343
347
|
// 组件动作组表单配置
|
|
344
|
-
const actionsConfig = computed
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
type: 'group-list',
|
|
349
|
-
name: 'actions',
|
|
350
|
-
expandAll: true,
|
|
351
|
-
enableToggleMode: false,
|
|
352
|
-
titlePrefix: '动作',
|
|
348
|
+
const actionsConfig = computed(
|
|
349
|
+
() =>
|
|
350
|
+
defineFormItem({
|
|
351
|
+
type: 'panel',
|
|
353
352
|
items: [
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
353
|
+
{
|
|
354
|
+
type: 'group-list',
|
|
355
|
+
name: 'actions',
|
|
356
|
+
expandAll: true,
|
|
357
|
+
enableToggleMode: false,
|
|
358
|
+
titlePrefix: '动作',
|
|
359
|
+
items: [
|
|
360
|
+
actionTypeConfig.value,
|
|
361
|
+
targetCompConfig.value,
|
|
362
|
+
compActionConfig.value,
|
|
363
|
+
codeActionConfig.value,
|
|
364
|
+
dataSourceActionConfig.value,
|
|
365
|
+
],
|
|
366
|
+
},
|
|
359
367
|
],
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
}));
|
|
368
|
+
}) as PanelConfig,
|
|
369
|
+
);
|
|
363
370
|
|
|
364
371
|
// 是否为旧的数据格式
|
|
365
372
|
const isOldVersion = computed(() => {
|
|
@@ -39,46 +39,48 @@
|
|
|
39
39
|
import { computed, ref } from 'vue';
|
|
40
40
|
|
|
41
41
|
import type { ContainerChangeEventData, FormValue } from '@tmagic/form';
|
|
42
|
-
import { MContainer } from '@tmagic/form';
|
|
42
|
+
import { defineFormItem, type MContainer } from '@tmagic/form';
|
|
43
43
|
import type { StyleSchema } from '@tmagic/schema';
|
|
44
44
|
|
|
45
45
|
const direction = ref('');
|
|
46
46
|
|
|
47
|
-
const config = computed(() =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
const config = computed(() =>
|
|
48
|
+
defineFormItem({
|
|
49
|
+
items: [
|
|
50
|
+
{
|
|
51
|
+
name: `border${direction.value}Width`,
|
|
52
|
+
text: '边框宽度',
|
|
53
|
+
labelWidth: '68px',
|
|
54
|
+
type: 'data-source-field-select',
|
|
55
|
+
fieldConfig: {
|
|
56
|
+
type: 'text',
|
|
57
|
+
},
|
|
56
58
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
{
|
|
60
|
+
name: `border${direction.value}Color`,
|
|
61
|
+
text: '边框颜色',
|
|
62
|
+
labelWidth: '68px',
|
|
63
|
+
type: 'data-source-field-select',
|
|
64
|
+
fieldConfig: {
|
|
65
|
+
type: 'colorPicker',
|
|
66
|
+
},
|
|
65
67
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
68
|
+
{
|
|
69
|
+
name: `border${direction.value}Style`,
|
|
70
|
+
text: '边框样式',
|
|
71
|
+
labelWidth: '68px',
|
|
72
|
+
type: 'data-source-field-select',
|
|
73
|
+
fieldConfig: {
|
|
74
|
+
type: 'select',
|
|
75
|
+
options: ['solid', 'dashed', 'dotted'].map((item) => ({
|
|
76
|
+
value: item,
|
|
77
|
+
text: item,
|
|
78
|
+
})),
|
|
79
|
+
},
|
|
78
80
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
],
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
82
84
|
|
|
83
85
|
const selectDirection = (d?: string) => (direction.value = d || '');
|
|
84
86
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
6
|
import { markRaw } from 'vue';
|
|
7
7
|
|
|
8
|
-
import { ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
8
|
+
import { type ContainerChangeEventData, defineFormItem, type MContainer } from '@tmagic/form';
|
|
9
9
|
import type { StyleSchema } from '@tmagic/schema';
|
|
10
10
|
|
|
11
11
|
import BackgroundPosition from '../components/BackgroundPosition.vue';
|
|
@@ -21,7 +21,7 @@ const emit = defineEmits<{
|
|
|
21
21
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
22
22
|
}>();
|
|
23
23
|
|
|
24
|
-
const config = {
|
|
24
|
+
const config = defineFormItem({
|
|
25
25
|
items: [
|
|
26
26
|
{
|
|
27
27
|
name: 'backgroundColor',
|
|
@@ -39,7 +39,7 @@ const config = {
|
|
|
39
39
|
type: 'data-source-field-select',
|
|
40
40
|
fieldConfig: {
|
|
41
41
|
type: 'img-upload',
|
|
42
|
-
},
|
|
42
|
+
} as any,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
name: 'backgroundSize',
|
|
@@ -74,7 +74,7 @@ const config = {
|
|
|
74
74
|
labelWidth: '68px',
|
|
75
75
|
},
|
|
76
76
|
],
|
|
77
|
-
};
|
|
77
|
+
});
|
|
78
78
|
|
|
79
79
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
80
80
|
emit('change', value, eventData);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
6
|
<script lang="ts" setup>
|
|
7
|
-
import { type ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
7
|
+
import { type ContainerChangeEventData, defineFormItem, type MContainer } from '@tmagic/form';
|
|
8
8
|
import type { StyleSchema } from '@tmagic/schema';
|
|
9
9
|
|
|
10
10
|
import Border from '../components/Border.vue';
|
|
@@ -19,7 +19,7 @@ const emit = defineEmits<{
|
|
|
19
19
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
20
20
|
}>();
|
|
21
21
|
|
|
22
|
-
const config = {
|
|
22
|
+
const config = defineFormItem({
|
|
23
23
|
items: [
|
|
24
24
|
{
|
|
25
25
|
labelWidth: '68px',
|
|
@@ -31,7 +31,7 @@ const config = {
|
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
|
-
};
|
|
34
|
+
});
|
|
35
35
|
|
|
36
36
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
37
37
|
emit('change', value, eventData);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
6
|
import { markRaw } from 'vue';
|
|
7
7
|
|
|
8
|
-
import { ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
8
|
+
import { type ContainerChangeEventData, defineFormItem, type MContainer } from '@tmagic/form';
|
|
9
9
|
import type { StyleSchema } from '@tmagic/schema';
|
|
10
10
|
|
|
11
11
|
import { AlignCenter, AlignLeft, AlignRight } from '../icons/text-align';
|
|
@@ -20,7 +20,7 @@ const emit = defineEmits<{
|
|
|
20
20
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
21
21
|
}>();
|
|
22
22
|
|
|
23
|
-
const config = {
|
|
23
|
+
const config = defineFormItem({
|
|
24
24
|
items: [
|
|
25
25
|
{
|
|
26
26
|
type: 'row',
|
|
@@ -86,7 +86,7 @@ const config = {
|
|
|
86
86
|
],
|
|
87
87
|
},
|
|
88
88
|
],
|
|
89
|
-
};
|
|
89
|
+
});
|
|
90
90
|
|
|
91
91
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
92
92
|
emit('change', value, eventData);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<script lang="ts" setup>
|
|
13
13
|
import { markRaw } from 'vue';
|
|
14
14
|
|
|
15
|
-
import type { ContainerChangeEventData } from '@tmagic/form';
|
|
15
|
+
import type { ChildConfig, ContainerChangeEventData } from '@tmagic/form';
|
|
16
16
|
import { defineFormItem, MContainer } from '@tmagic/form';
|
|
17
17
|
import type { StyleSchema } from '@tmagic/schema';
|
|
18
18
|
|
|
@@ -180,7 +180,7 @@ const config = defineFormItem({
|
|
|
180
180
|
],
|
|
181
181
|
},
|
|
182
182
|
],
|
|
183
|
-
});
|
|
183
|
+
}) as ChildConfig;
|
|
184
184
|
|
|
185
185
|
const change = (value: string | StyleSchema, eventData: ContainerChangeEventData) => {
|
|
186
186
|
emit('change', value, eventData);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts" setup>
|
|
6
|
-
import { ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
6
|
+
import { type ContainerChangeEventData, defineFormItem, type MContainer } from '@tmagic/form';
|
|
7
7
|
import type { StyleSchema } from '@tmagic/schema';
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
@@ -24,7 +24,7 @@ const positionText: Record<string, string> = {
|
|
|
24
24
|
sticky: '粘性定位',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const config = {
|
|
27
|
+
const config = defineFormItem({
|
|
28
28
|
items: [
|
|
29
29
|
{
|
|
30
30
|
name: 'position',
|
|
@@ -95,7 +95,7 @@ const config = {
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
],
|
|
98
|
-
};
|
|
98
|
+
});
|
|
99
99
|
|
|
100
100
|
const change = (value: string | StyleSchema, eventData: ContainerChangeEventData) => {
|
|
101
101
|
emit('change', value, eventData);
|