@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.
Files changed (27) hide show
  1. package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +6 -6
  2. package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +2 -1
  3. package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +5 -5
  4. package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +5 -4
  5. package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +8 -6
  6. package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +8 -6
  7. package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +8 -6
  8. package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +8 -6
  9. package/dist/es/utils/data-source/index.js +4 -3
  10. package/dist/tmagic-editor.umd.cjs +41 -31
  11. package/package.json +7 -7
  12. package/src/components/CodeBlockEditor.vue +76 -66
  13. package/src/components/CodeParams.vue +3 -3
  14. package/src/fields/CodeSelectCol.vue +4 -1
  15. package/src/fields/DataSourceFieldSelect/Index.vue +3 -1
  16. package/src/fields/DataSourceMethodSelect.vue +4 -1
  17. package/src/fields/EventSelect.vue +65 -58
  18. package/src/fields/StyleSetter/components/Border.vue +35 -33
  19. package/src/fields/StyleSetter/pro/Background.vue +4 -4
  20. package/src/fields/StyleSetter/pro/Border.vue +3 -3
  21. package/src/fields/StyleSetter/pro/Font.vue +3 -3
  22. package/src/fields/StyleSetter/pro/Layout.vue +2 -2
  23. package/src/fields/StyleSetter/pro/Position.vue +3 -3
  24. package/src/utils/data-source/formConfigs/base.ts +2 -2
  25. package/src/utils/data-source/index.ts +6 -6
  26. package/src/utils/props.ts +2 -2
  27. package/types/index.d.ts +20 -20
@@ -1,11 +1,11 @@
1
- import { DataSchema, DataSourceFieldType, DataSourceSchema } from '@tmagic/core';
2
- import { CascaderOption, FormConfig, FormState } from '@tmagic/form';
1
+ import type { DataSchema, DataSourceFieldType, DataSourceSchema } from '@tmagic/core';
2
+ import { type CascaderOption, defineFormItem, type FormConfig } from '@tmagic/form';
3
3
  import { dataSourceTemplateRegExp, getKeysArray, isNumber } from '@tmagic/utils';
4
4
 
5
5
  import BaseFormConfig from './formConfigs/base';
6
6
  import HttpFormConfig from './formConfigs/http';
7
7
 
8
- const dataSourceFormConfig = {
8
+ const dataSourceFormConfig = defineFormItem({
9
9
  type: 'tab',
10
10
  items: [
11
11
  {
@@ -50,7 +50,7 @@ const dataSourceFormConfig = {
50
50
  },
51
51
  {
52
52
  title: '请求参数裁剪',
53
- display: (_formState: FormState, { model }: any) => model.type === 'http',
53
+ display: (_formState, { model }) => model.type === 'http',
54
54
  items: [
55
55
  {
56
56
  name: 'beforeRequest',
@@ -62,7 +62,7 @@ const dataSourceFormConfig = {
62
62
  },
63
63
  {
64
64
  title: '响应数据裁剪',
65
- display: (_formState: FormState, { model }: any) => model.type === 'http',
65
+ display: (_formStat, { model }) => model.type === 'http',
66
66
  items: [
67
67
  {
68
68
  name: 'afterResponse',
@@ -73,7 +73,7 @@ const dataSourceFormConfig = {
73
73
  ],
74
74
  },
75
75
  ],
76
- };
76
+ });
77
77
 
78
78
  const fillConfig = (config: FormConfig): FormConfig => [...BaseFormConfig(), ...config, dataSourceFormConfig];
79
79
 
@@ -24,7 +24,7 @@ import {
24
24
  NODE_DISABLE_DATA_SOURCE_KEY,
25
25
  } from '@tmagic/core';
26
26
  import { tMagicMessage } from '@tmagic/design';
27
- import type { ChildConfig, FormConfig, TabConfig, TabPaneConfig } from '@tmagic/form';
27
+ import type { ChildConfig, DisplayCondsConfig, FormConfig, TabConfig, TabPaneConfig } from '@tmagic/form';
28
28
 
29
29
  export const arrayOptions = [
30
30
  { text: '包含', value: 'include' },
@@ -168,7 +168,7 @@ export const advancedTabConfig: TabPaneConfig = {
168
168
  ],
169
169
  };
170
170
 
171
- export const displayTabConfig: TabPaneConfig = {
171
+ export const displayTabConfig: TabPaneConfig<DisplayCondsConfig> = {
172
172
  title: '显示条件',
173
173
  display: (_state, { model }) => model.type !== 'page',
174
174
  items: [
package/types/index.d.ts CHANGED
@@ -1566,7 +1566,7 @@ declare const numberOptions: {
1566
1566
  declare const styleTabConfig: TabPaneConfig;
1567
1567
  declare const eventTabConfig: TabPaneConfig;
1568
1568
  declare const advancedTabConfig: TabPaneConfig;
1569
- declare const displayTabConfig: TabPaneConfig;
1569
+ declare const displayTabConfig: TabPaneConfig<DisplayCondsConfig>;
1570
1570
  /**
1571
1571
  * 统一为组件属性表单加上事件、高级、样式配置
1572
1572
  * @param config 组件属性配置
@@ -1938,13 +1938,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
1938
1938
  inline: boolean;
1939
1939
  labelPosition: string;
1940
1940
  config: _tmagic_form_schema0.FormConfig;
1941
+ height: string;
1941
1942
  initValues: Record<string, any>;
1942
1943
  lastValues: Record<string, any>;
1943
1944
  isCompare: boolean;
1944
1945
  keyProp: string;
1945
1946
  parentValues: Record<string, any>;
1946
1947
  stepActive: string | number;
1947
- height: string;
1948
1948
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
1949
1949
  P: {};
1950
1950
  B: {};
@@ -1991,13 +1991,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
1991
1991
  inline: boolean;
1992
1992
  labelPosition: string;
1993
1993
  config: _tmagic_form_schema0.FormConfig;
1994
+ height: string;
1994
1995
  initValues: Record<string, any>;
1995
1996
  lastValues: Record<string, any>;
1996
1997
  isCompare: boolean;
1997
1998
  keyProp: string;
1998
1999
  parentValues: Record<string, any>;
1999
2000
  stepActive: string | number;
2000
- height: string;
2001
2001
  }> | null>>;
2002
2002
  submit: (v: _tmagic_form_schema0.FormValue, eventData: ContainerChangeEventData$1) => Promise<void>;
2003
2003
  }, {}, {}, {}, _vue_runtime_core0.ComponentOptionsMixin, _vue_runtime_core0.ComponentOptionsMixin, {
@@ -2086,13 +2086,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2086
2086
  inline: boolean;
2087
2087
  labelPosition: string;
2088
2088
  config: _tmagic_form_schema0.FormConfig;
2089
+ height: string;
2089
2090
  initValues: Record<string, any>;
2090
2091
  lastValues: Record<string, any>;
2091
2092
  isCompare: boolean;
2092
2093
  keyProp: string;
2093
2094
  parentValues: Record<string, any>;
2094
2095
  stepActive: string | number;
2095
- height: string;
2096
2096
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
2097
2097
  P: {};
2098
2098
  B: {};
@@ -2139,13 +2139,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2139
2139
  inline: boolean;
2140
2140
  labelPosition: string;
2141
2141
  config: _tmagic_form_schema0.FormConfig;
2142
+ height: string;
2142
2143
  initValues: Record<string, any>;
2143
2144
  lastValues: Record<string, any>;
2144
2145
  isCompare: boolean;
2145
2146
  keyProp: string;
2146
2147
  parentValues: Record<string, any>;
2147
2148
  stepActive: string | number;
2148
- height: string;
2149
2149
  }> | null>>;
2150
2150
  submit: (v: _tmagic_form_schema0.FormValue, eventData: ContainerChangeEventData$1) => Promise<void>;
2151
2151
  }> & {} & _vue_runtime_core0.ComponentCustomProperties & {} & {
@@ -2249,13 +2249,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2249
2249
  inline: boolean;
2250
2250
  labelPosition: string;
2251
2251
  config: _tmagic_form_schema0.FormConfig;
2252
+ height: string;
2252
2253
  initValues: Record<string, any>;
2253
2254
  lastValues: Record<string, any>;
2254
2255
  isCompare: boolean;
2255
2256
  keyProp: string;
2256
2257
  parentValues: Record<string, any>;
2257
2258
  stepActive: string | number;
2258
- height: string;
2259
2259
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
2260
2260
  P: {};
2261
2261
  B: {};
@@ -2302,13 +2302,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2302
2302
  inline: boolean;
2303
2303
  labelPosition: string;
2304
2304
  config: _tmagic_form_schema0.FormConfig;
2305
+ height: string;
2305
2306
  initValues: Record<string, any>;
2306
2307
  lastValues: Record<string, any>;
2307
2308
  isCompare: boolean;
2308
2309
  keyProp: string;
2309
2310
  parentValues: Record<string, any>;
2310
2311
  stepActive: string | number;
2311
- height: string;
2312
2312
  }> | null>>;
2313
2313
  submit: (v: _tmagic_form_schema0.FormValue, eventData: ContainerChangeEventData$1) => Promise<void>;
2314
2314
  }, {}, {}, {}, _vue_runtime_core0.ComponentOptionsMixin, _vue_runtime_core0.ComponentOptionsMixin, {
@@ -2397,13 +2397,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2397
2397
  inline: boolean;
2398
2398
  labelPosition: string;
2399
2399
  config: _tmagic_form_schema0.FormConfig;
2400
+ height: string;
2400
2401
  initValues: Record<string, any>;
2401
2402
  lastValues: Record<string, any>;
2402
2403
  isCompare: boolean;
2403
2404
  keyProp: string;
2404
2405
  parentValues: Record<string, any>;
2405
2406
  stepActive: string | number;
2406
- height: string;
2407
2407
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
2408
2408
  P: {};
2409
2409
  B: {};
@@ -2450,13 +2450,13 @@ declare const __VLS_base$12: _vue_runtime_core0.DefineComponent<EditorProps, Ser
2450
2450
  inline: boolean;
2451
2451
  labelPosition: string;
2452
2452
  config: _tmagic_form_schema0.FormConfig;
2453
+ height: string;
2453
2454
  initValues: Record<string, any>;
2454
2455
  lastValues: Record<string, any>;
2455
2456
  isCompare: boolean;
2456
2457
  keyProp: string;
2457
2458
  parentValues: Record<string, any>;
2458
2459
  stepActive: string | number;
2459
- height: string;
2460
2460
  }> | null>>;
2461
2461
  submit: (v: _tmagic_form_schema0.FormValue, eventData: ContainerChangeEventData$1) => Promise<void>;
2462
2462
  }> & {} & _vue_runtime_core0.ComponentCustomProperties & {} & {
@@ -2539,9 +2539,9 @@ declare const __VLS_export$32: _vue_runtime_core0.DefineComponent<__VLS_Props$30
2539
2539
  onInitd?: ((...args: any[]) => any) | undefined;
2540
2540
  }>, {
2541
2541
  options: monaco_editor0.editor.IStandaloneEditorConstructionOptions;
2542
- initValues: any;
2543
2542
  language: string;
2544
2543
  parse: boolean;
2544
+ initValues: any;
2545
2545
  autoSave: boolean;
2546
2546
  disabledFullScreen: boolean;
2547
2547
  }, {}, {}, {}, string, _vue_runtime_core0.ComponentProvideOptions, false, {}, any>;
@@ -2914,13 +2914,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
2914
2914
  inline: boolean;
2915
2915
  labelPosition: string;
2916
2916
  config: _tmagic_form_schema0.FormConfig;
2917
+ height: string;
2917
2918
  initValues: Record<string, any>;
2918
2919
  lastValues: Record<string, any>;
2919
2920
  isCompare: boolean;
2920
2921
  keyProp: string;
2921
2922
  parentValues: Record<string, any>;
2922
2923
  stepActive: string | number;
2923
- height: string;
2924
2924
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
2925
2925
  P: {};
2926
2926
  B: {};
@@ -2967,13 +2967,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
2967
2967
  inline: boolean;
2968
2968
  labelPosition: string;
2969
2969
  config: _tmagic_form_schema0.FormConfig;
2970
+ height: string;
2970
2971
  initValues: Record<string, any>;
2971
2972
  lastValues: Record<string, any>;
2972
2973
  isCompare: boolean;
2973
2974
  keyProp: string;
2974
2975
  parentValues: Record<string, any>;
2975
2976
  stepActive: string | number;
2976
- height: string;
2977
2977
  }> | null>>;
2978
2978
  submit: (v: FormValue, eventData: ContainerChangeEventData) => Promise<void>;
2979
2979
  }, {}, {}, {}, _vue_runtime_core0.ComponentOptionsMixin, _vue_runtime_core0.ComponentOptionsMixin, {
@@ -3062,13 +3062,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3062
3062
  inline: boolean;
3063
3063
  labelPosition: string;
3064
3064
  config: _tmagic_form_schema0.FormConfig;
3065
+ height: string;
3065
3066
  initValues: Record<string, any>;
3066
3067
  lastValues: Record<string, any>;
3067
3068
  isCompare: boolean;
3068
3069
  keyProp: string;
3069
3070
  parentValues: Record<string, any>;
3070
3071
  stepActive: string | number;
3071
- height: string;
3072
3072
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
3073
3073
  P: {};
3074
3074
  B: {};
@@ -3115,13 +3115,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3115
3115
  inline: boolean;
3116
3116
  labelPosition: string;
3117
3117
  config: _tmagic_form_schema0.FormConfig;
3118
+ height: string;
3118
3119
  initValues: Record<string, any>;
3119
3120
  lastValues: Record<string, any>;
3120
3121
  isCompare: boolean;
3121
3122
  keyProp: string;
3122
3123
  parentValues: Record<string, any>;
3123
3124
  stepActive: string | number;
3124
- height: string;
3125
3125
  }> | null>>;
3126
3126
  submit: (v: FormValue, eventData: ContainerChangeEventData) => Promise<void>;
3127
3127
  }> & {} & _vue_runtime_core0.ComponentCustomProperties & {} & {
@@ -3224,13 +3224,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3224
3224
  inline: boolean;
3225
3225
  labelPosition: string;
3226
3226
  config: _tmagic_form_schema0.FormConfig;
3227
+ height: string;
3227
3228
  initValues: Record<string, any>;
3228
3229
  lastValues: Record<string, any>;
3229
3230
  isCompare: boolean;
3230
3231
  keyProp: string;
3231
3232
  parentValues: Record<string, any>;
3232
3233
  stepActive: string | number;
3233
- height: string;
3234
3234
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
3235
3235
  P: {};
3236
3236
  B: {};
@@ -3277,13 +3277,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3277
3277
  inline: boolean;
3278
3278
  labelPosition: string;
3279
3279
  config: _tmagic_form_schema0.FormConfig;
3280
+ height: string;
3280
3281
  initValues: Record<string, any>;
3281
3282
  lastValues: Record<string, any>;
3282
3283
  isCompare: boolean;
3283
3284
  keyProp: string;
3284
3285
  parentValues: Record<string, any>;
3285
3286
  stepActive: string | number;
3286
- height: string;
3287
3287
  }> | null>>;
3288
3288
  submit: (v: FormValue, eventData: ContainerChangeEventData) => Promise<void>;
3289
3289
  }, {}, {}, {}, _vue_runtime_core0.ComponentOptionsMixin, _vue_runtime_core0.ComponentOptionsMixin, {
@@ -3372,13 +3372,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3372
3372
  inline: boolean;
3373
3373
  labelPosition: string;
3374
3374
  config: _tmagic_form_schema0.FormConfig;
3375
+ height: string;
3375
3376
  initValues: Record<string, any>;
3376
3377
  lastValues: Record<string, any>;
3377
3378
  isCompare: boolean;
3378
3379
  keyProp: string;
3379
3380
  parentValues: Record<string, any>;
3380
3381
  stepActive: string | number;
3381
- height: string;
3382
3382
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
3383
3383
  P: {};
3384
3384
  B: {};
@@ -3425,13 +3425,13 @@ declare const __VLS_base$7: _vue_runtime_core0.DefineComponent<__VLS_Props$13, {
3425
3425
  inline: boolean;
3426
3426
  labelPosition: string;
3427
3427
  config: _tmagic_form_schema0.FormConfig;
3428
+ height: string;
3428
3429
  initValues: Record<string, any>;
3429
3430
  lastValues: Record<string, any>;
3430
3431
  isCompare: boolean;
3431
3432
  keyProp: string;
3432
3433
  parentValues: Record<string, any>;
3433
3434
  stepActive: string | number;
3434
- height: string;
3435
3435
  }> | null>>;
3436
3436
  submit: (v: FormValue, eventData: ContainerChangeEventData) => Promise<void>;
3437
3437
  }> & {} & _vue_runtime_core0.ComponentCustomProperties & {} & {
@@ -3510,13 +3510,13 @@ declare const __VLS_base$6: _vue_runtime_core0.DefineComponent<__VLS_Props$12, {
3510
3510
  inline: boolean;
3511
3511
  labelPosition: string;
3512
3512
  config: FormConfig;
3513
+ height: string;
3513
3514
  initValues: Record<string, any>;
3514
3515
  lastValues: Record<string, any>;
3515
3516
  isCompare: boolean;
3516
3517
  keyProp: string;
3517
3518
  parentValues: Record<string, any>;
3518
3519
  stepActive: string | number;
3519
- height: string;
3520
3520
  }, false, {}, {}, _vue_runtime_core0.GlobalComponents, _vue_runtime_core0.GlobalDirectives, string, {}, any, _vue_runtime_core0.ComponentProvideOptions, {
3521
3521
  P: {};
3522
3522
  B: {};
@@ -3563,13 +3563,13 @@ declare const __VLS_base$6: _vue_runtime_core0.DefineComponent<__VLS_Props$12, {
3563
3563
  inline: boolean;
3564
3564
  labelPosition: string;
3565
3565
  config: FormConfig;
3566
+ height: string;
3566
3567
  initValues: Record<string, any>;
3567
3568
  lastValues: Record<string, any>;
3568
3569
  isCompare: boolean;
3569
3570
  keyProp: string;
3570
3571
  parentValues: Record<string, any>;
3571
3572
  stepActive: string | number;
3572
- height: string;
3573
3573
  }> | null>>;
3574
3574
  submit: (v: FormValue, eventData: ContainerChangeEventData) => Promise<void>;
3575
3575
  }, {}, {}, {}, _vue_runtime_core0.ComponentOptionsMixin, _vue_runtime_core0.ComponentOptionsMixin, {