@tmagic/editor 1.7.11 → 1.7.13-beta.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 (37) hide show
  1. package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +6 -2
  2. package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -1
  3. package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +6 -3
  4. package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +12 -7
  5. package/dist/es/index.js +2 -2
  6. package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +1 -1
  7. package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +4 -2
  8. package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +4 -1
  9. package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +87 -12
  10. package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +5 -2
  11. package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +3 -2
  12. package/dist/es/services/editor.js +7 -5
  13. package/dist/es/services/props.js +2 -2
  14. package/dist/es/style.css +20 -0
  15. package/dist/es/utils/data-source/index.js +2 -3
  16. package/dist/es/utils/tree.js +3 -1
  17. package/dist/style.css +20 -0
  18. package/dist/tmagic-editor.umd.cjs +138 -37
  19. package/package.json +7 -7
  20. package/src/Editor.vue +2 -0
  21. package/src/components/ScrollViewer.vue +4 -1
  22. package/src/components/Tree.vue +4 -1
  23. package/src/components/TreeNode.vue +8 -8
  24. package/src/editorProps.ts +3 -0
  25. package/src/layouts/props-panel/PropsPanel.vue +1 -1
  26. package/src/layouts/sidebar/Sidebar.vue +4 -0
  27. package/src/layouts/sidebar/layer/LayerPanel.vue +11 -1
  28. package/src/layouts/workspace/Breadcrumb.vue +87 -6
  29. package/src/layouts/workspace/Workspace.vue +3 -1
  30. package/src/layouts/workspace/viewer/Stage.vue +7 -1
  31. package/src/services/editor.ts +11 -6
  32. package/src/services/props.ts +2 -2
  33. package/src/theme/breadcrumb.scss +24 -0
  34. package/src/type.ts +14 -1
  35. package/src/utils/data-source/index.ts +8 -4
  36. package/src/utils/tree.ts +5 -1
  37. package/types/index.d.ts +30 -7
@@ -1,17 +1,22 @@
1
1
  <template>
2
- <div v-if="nodes.length === 1" class="m-editor-breadcrumb">
3
- <template v-for="(item, index) in path" :key="item.id">
4
- <TMagicButton link :disabled="item.id === node?.id" @click="select(item)">{{ item.name }}</TMagicButton
5
- ><span v-if="index < path.length - 1">/</span>
2
+ <div v-if="nodes.length === 1" ref="containerRef" class="m-editor-breadcrumb">
3
+ <template v-for="(item, index) in displayPath" :key="item.isEllipsis ? `ellipsis-${index}` : item.id">
4
+ <span v-if="item.isEllipsis" class="m-editor-breadcrumb-ellipsis">...</span>
5
+ <TMagicTooltip v-else :content="item.name" placement="top" :show-after="500">
6
+ <TMagicButton class="m-editor-breadcrumb-item" link :disabled="item.id === node?.id" @click="select(item)">{{
7
+ item.name
8
+ }}</TMagicButton>
9
+ </TMagicTooltip>
10
+ <span v-if="index < displayPath.length - 1" class="m-editor-breadcrumb-separator">/</span>
6
11
  </template>
7
12
  </div>
8
13
  </template>
9
14
 
10
15
  <script setup lang="ts">
11
- import { computed } from 'vue';
16
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
12
17
 
13
18
  import type { MNode } from '@tmagic/core';
14
- import { TMagicButton } from '@tmagic/design';
19
+ import { TMagicButton, TMagicTooltip } from '@tmagic/design';
15
20
  import { getNodePath } from '@tmagic/utils';
16
21
 
17
22
  import { useServices } from '@editor/hooks/use-services';
@@ -20,6 +25,8 @@ defineOptions({
20
25
  name: 'MEditorBreadcrumb',
21
26
  });
22
27
 
28
+ type DisplayItem = (MNode & { isEllipsis?: false }) | { isEllipsis: true; id: string; name: string };
29
+
23
30
  const { editorService } = useServices();
24
31
 
25
32
  const node = computed(() => editorService.get('node'));
@@ -27,6 +34,80 @@ const nodes = computed(() => editorService.get('nodes'));
27
34
  const root = computed(() => editorService.get('root'));
28
35
  const path = computed(() => getNodePath(node.value?.id || '', root.value?.items || []));
29
36
 
37
+ const containerRef = ref<HTMLElement | null>(null);
38
+ // 当面包屑宽度超过父元素宽度的阈值时折叠
39
+ const COLLAPSE_RATIO = 0.8;
40
+ const collapsed = ref(false);
41
+
42
+ const displayPath = computed<DisplayItem[]>(() => {
43
+ const list = path.value;
44
+ // 折叠后视觉元素数(first + ... + last2 = 4 个),所以只有路径 > 3 时折叠才能减少占位
45
+ if (!collapsed.value || list.length <= 3) {
46
+ return list as DisplayItem[];
47
+ }
48
+ return [
49
+ list[0],
50
+ { isEllipsis: true, id: '__ellipsis__', name: '...' },
51
+ list[list.length - 2],
52
+ list[list.length - 1],
53
+ ] as DisplayItem[];
54
+ });
55
+
56
+ const measureOverflow = async () => {
57
+ // 先恢复完整渲染再测量,避免折叠后误判
58
+ if (collapsed.value) {
59
+ collapsed.value = false;
60
+ await nextTick();
61
+ }
62
+ const el = containerRef.value;
63
+ const parent = el?.parentElement;
64
+ if (!el || !parent) return;
65
+ // scrollWidth 取内容自然宽度(不受自身 max-width 影响),与父容器宽度做比例判断
66
+ const contentWidth = el.scrollWidth;
67
+ const parentWidth = parent.clientWidth;
68
+ if (parentWidth <= 0) return;
69
+ collapsed.value = contentWidth > parentWidth * COLLAPSE_RATIO;
70
+ };
71
+
72
+ let resizeObserver: ResizeObserver | null = null;
73
+
74
+ const observe = () => {
75
+ resizeObserver?.disconnect();
76
+ const el = containerRef.value;
77
+ if (!el || typeof ResizeObserver === 'undefined') return;
78
+ resizeObserver = new ResizeObserver(() => {
79
+ measureOverflow();
80
+ });
81
+ resizeObserver.observe(el);
82
+ if (el.parentElement) {
83
+ resizeObserver.observe(el.parentElement);
84
+ }
85
+ };
86
+
87
+ onMounted(() => {
88
+ observe();
89
+ measureOverflow();
90
+ });
91
+
92
+ onBeforeUnmount(() => {
93
+ resizeObserver?.disconnect();
94
+ resizeObserver = null;
95
+ });
96
+
97
+ watch(
98
+ () => nodes.value.length,
99
+ async () => {
100
+ await nextTick();
101
+ observe();
102
+ measureOverflow();
103
+ },
104
+ );
105
+
106
+ watch(path, async () => {
107
+ await nextTick();
108
+ measureOverflow();
109
+ });
110
+
30
111
  const select = async (node: MNode) => {
31
112
  await editorService.select(node);
32
113
  editorService.get('stage')?.select(node.id);
@@ -9,7 +9,9 @@
9
9
  :disabled-stage-overlay="disabledStageOverlay"
10
10
  :stage-content-menu="stageContentMenu"
11
11
  :custom-content-menu="customContentMenu"
12
- ></MagicStage>
12
+ >
13
+ <template #stage-top><slot name="stage-top"></slot></template>
14
+ </MagicStage>
13
15
  </slot>
14
16
 
15
17
  <slot name="workspace-content"></slot>
@@ -27,6 +27,10 @@
27
27
 
28
28
  <NodeListMenu></NodeListMenu>
29
29
 
30
+ <template #before>
31
+ <slot name="stage-top"></slot>
32
+ </template>
33
+
30
34
  <template #content>
31
35
  <StageOverlay v-if="!disabledStageOverlay"></StageOverlay>
32
36
 
@@ -52,7 +56,7 @@ import { calcValueByFontsize, getIdFromEl } from '@tmagic/utils';
52
56
  import ScrollViewer from '@editor/components/ScrollViewer.vue';
53
57
  import { useServices } from '@editor/hooks';
54
58
  import { useStage } from '@editor/hooks/use-stage';
55
- import type { CustomContentMenuFunction, MenuButton, MenuComponent, StageOptions } from '@editor/type';
59
+ import type { CustomContentMenuFunction, MenuButton, MenuComponent, StageOptions, StageSlots } from '@editor/type';
56
60
  import { DragType, Layout } from '@editor/type';
57
61
  import { getEditorConfig } from '@editor/utils/config';
58
62
  import { KeyBindingContainerKey } from '@editor/utils/keybinding-config';
@@ -65,6 +69,8 @@ defineOptions({
65
69
  name: 'MEditorStage',
66
70
  });
67
71
 
72
+ defineSlots<StageSlots>();
73
+
68
74
  const props = withDefaults(
69
75
  defineProps<{
70
76
  stageOptions: StageOptions;
@@ -509,7 +509,10 @@ class Editor extends BaseService {
509
509
 
510
510
  public async doUpdate(
511
511
  config: MNode,
512
- { changeRecords = [] }: { changeRecords?: ChangeRecord[] } = {},
512
+ {
513
+ changeRecords = [],
514
+ selectedAfterUpdate = true,
515
+ }: { changeRecords?: ChangeRecord[]; selectedAfterUpdate?: boolean } = {},
513
516
  ): Promise<{ newNode: MNode; oldNode: MNode; changeRecords?: ChangeRecord[] }> {
514
517
  const root = this.get('root');
515
518
  if (!root) throw new Error('root为空');
@@ -554,10 +557,12 @@ class Editor extends BaseService {
554
557
  parentNodeItems[index] = newConfig;
555
558
 
556
559
  // 将update后的配置更新到nodes中
557
- const nodes = this.get('nodes');
558
- const targetIndex = nodes.findIndex((nodeItem: MNode) => `${nodeItem.id}` === `${newConfig.id}`);
559
- nodes.splice(targetIndex, 1, newConfig);
560
- this.set('nodes', [...nodes]);
560
+ if (selectedAfterUpdate) {
561
+ const nodes = this.get('nodes');
562
+ const targetIndex = nodes.findIndex((nodeItem: MNode) => `${nodeItem.id}` === `${newConfig.id}`);
563
+ nodes.splice(targetIndex, 1, newConfig);
564
+ this.set('nodes', [...nodes]);
565
+ }
561
566
 
562
567
  if (isPage(newConfig) || isPageFragment(newConfig)) {
563
568
  this.set('page', newConfig as MPage | MPageFragment);
@@ -580,7 +585,7 @@ class Editor extends BaseService {
580
585
  */
581
586
  public async update(
582
587
  config: MNode | MNode[],
583
- data: { changeRecords?: ChangeRecord[] } = {},
588
+ data: { changeRecords?: ChangeRecord[]; selectedAfterUpdate?: boolean } = {},
584
589
  ): Promise<MNode | MNode[]> {
585
590
  this.captureSelectionBeforeOp();
586
591
 
@@ -117,9 +117,9 @@ class Props extends BaseService {
117
117
  * @param type 组件类型
118
118
  * @returns 组件属性表单配置
119
119
  */
120
- public async getPropsConfig(type: string): Promise<FormConfig> {
120
+ public async getPropsConfig(type: string, data?: { node?: MNode | null }): Promise<FormConfig> {
121
121
  if (type === 'area') {
122
- return await this.getPropsConfig('button');
122
+ return await this.getPropsConfig('button', data);
123
123
  }
124
124
 
125
125
  return cloneDeep(this.state.propsConfigMap[toLine(type)] || (await this.fillConfig([])));
@@ -3,4 +3,28 @@
3
3
  left: 5px;
4
4
  top: 5px;
5
5
  z-index: 10;
6
+ display: flex;
7
+ align-items: center;
8
+ white-space: nowrap;
9
+
10
+ .m-editor-breadcrumb-item {
11
+ max-width: 100px;
12
+ min-width: 0;
13
+ overflow: hidden;
14
+
15
+ // Element Plus button 内部文本节点
16
+ > span {
17
+ display: block;
18
+ max-width: 100%;
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ white-space: nowrap;
22
+ }
23
+ }
24
+
25
+ .m-editor-breadcrumb-separator,
26
+ .m-editor-breadcrumb-ellipsis {
27
+ margin: 0 4px;
28
+ flex-shrink: 0;
29
+ }
6
30
  }
package/src/type.ts CHANGED
@@ -73,7 +73,17 @@ export interface FrameworkSlots {
73
73
  'page-list-popover'(props: { list: (MPage | MPageFragment)[] }): any;
74
74
  }
75
75
 
76
- export interface WorkspaceSlots {
76
+ export interface ScrollViewerSlots {
77
+ before(props: {}): any;
78
+ content(props: {}): any;
79
+ default(props: {}): any;
80
+ }
81
+
82
+ export interface StageSlots extends ScrollViewerSlots {
83
+ 'stage-top'(props: {}): any;
84
+ }
85
+
86
+ export interface WorkspaceSlots extends StageSlots {
77
87
  stage(props: {}): any;
78
88
  'workspace-content'(props: {}): any;
79
89
  }
@@ -669,6 +679,9 @@ export interface TreeNodeData {
669
679
  [key: string]: any;
670
680
  }
671
681
 
682
+ /** 判断组件树节点是否可展开(即是否要展示为拥有子节点的形态)的函数 */
683
+ export type IsExpandableFunction = (_data: TreeNodeData, _nodeStatusMap: Map<Id, LayerNodeStatus>) => boolean;
684
+
672
685
  export type AsyncBeforeHook<Value extends Array<string>, C extends Record<Value[number], (...args: any) => any>> = {
673
686
  [K in Value[number]]?: (...args: Parameters<C[K]>) => Promise<Parameters<C[K]>> | Parameters<C[K]>;
674
687
  };
@@ -1,11 +1,11 @@
1
1
  import type { DataSchema, DataSourceFieldType, DataSourceSchema } from '@tmagic/core';
2
- import { type CascaderOption, defineFormItem, type FormConfig } from '@tmagic/form';
2
+ import { type CascaderOption, type FormConfig, type TabConfig } 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 = defineFormItem({
8
+ const dataSourceFormConfig: TabConfig = {
9
9
  type: 'tab',
10
10
  items: [
11
11
  {
@@ -73,9 +73,13 @@ const dataSourceFormConfig = defineFormItem({
73
73
  ],
74
74
  },
75
75
  ],
76
- });
76
+ };
77
77
 
78
- const fillConfig = (config: FormConfig): FormConfig => [...BaseFormConfig(), ...config, dataSourceFormConfig];
78
+ const fillConfig = <T = never>(config: FormConfig<T>): FormConfig<T> => [
79
+ ...BaseFormConfig(),
80
+ ...config,
81
+ dataSourceFormConfig,
82
+ ];
79
83
 
80
84
  export const getFormConfig = (type: string, configs: Record<string, FormConfig>): FormConfig => {
81
85
  switch (type) {
package/src/utils/tree.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Id } from '@tmagic/core';
2
2
  import { getKeys } from '@tmagic/utils';
3
3
 
4
- import type { LayerNodeStatus } from '@editor/type';
4
+ import type { IsExpandableFunction, LayerNodeStatus } from '@editor/type';
5
5
 
6
6
  export const updateStatus = (nodeStatusMap: Map<Id, LayerNodeStatus>, id: Id, status: Partial<LayerNodeStatus>) => {
7
7
  const nodeStatus = nodeStatusMap.get(id);
@@ -13,3 +13,7 @@ export const updateStatus = (nodeStatusMap: Map<Id, LayerNodeStatus>, id: Id, st
13
13
  }
14
14
  });
15
15
  };
16
+
17
+ /** 默认的组件树节点是否可展开的判断函数:当节点的子项中至少存在一个可见节点时认为可展开 */
18
+ export const defaultIsExpandable: IsExpandableFunction = (data, nodeStatusMap) =>
19
+ Array.isArray(data.items) && data.items.some((item) => nodeStatusMap.get(item.id)?.visible);
package/types/index.d.ts CHANGED
@@ -422,9 +422,11 @@ declare class Editor extends export_default {
422
422
  */
423
423
  remove(nodeOrNodeList: MNode | MNode[]): Promise<void>;
424
424
  doUpdate(config: MNode, {
425
- changeRecords
425
+ changeRecords,
426
+ selectedAfterUpdate
426
427
  }?: {
427
428
  changeRecords?: ChangeRecord[];
429
+ selectedAfterUpdate?: boolean;
428
430
  }): Promise<{
429
431
  newNode: MNode;
430
432
  oldNode: MNode;
@@ -438,6 +440,7 @@ declare class Editor extends export_default {
438
440
  */
439
441
  update(config: MNode | MNode[], data?: {
440
442
  changeRecords?: ChangeRecord[];
443
+ selectedAfterUpdate?: boolean;
441
444
  }): Promise<MNode | MNode[]>;
442
445
  /**
443
446
  * 将id为id1的组件移动到id为id2的组件位置上,例如:[1,2,3,4] -> sort(1,3) -> [2,1,3,4]
@@ -637,7 +640,9 @@ declare class Props extends export_default {
637
640
  * @param type 组件类型
638
641
  * @returns 组件属性表单配置
639
642
  */
640
- getPropsConfig(type: string): Promise<FormConfig>;
643
+ getPropsConfig(type: string, data?: {
644
+ node?: MNode | null;
645
+ }): Promise<FormConfig>;
641
646
  setPropsValues(values: Record<string, Partial<MNode> | PropsFormValueFunction>): void;
642
647
  /**
643
648
  * 为指点类型组件设置组件初始值
@@ -851,7 +856,15 @@ interface FrameworkSlots {
851
856
  list: (MPage | MPageFragment)[];
852
857
  }): any;
853
858
  }
854
- interface WorkspaceSlots {
859
+ interface ScrollViewerSlots {
860
+ before(props: {}): any;
861
+ content(props: {}): any;
862
+ default(props: {}): any;
863
+ }
864
+ interface StageSlots extends ScrollViewerSlots {
865
+ 'stage-top'(props: {}): any;
866
+ }
867
+ interface WorkspaceSlots extends StageSlots {
855
868
  stage(props: {}): any;
856
869
  'workspace-content'(props: {}): any;
857
870
  }
@@ -1385,6 +1398,8 @@ interface TreeNodeData {
1385
1398
  items?: TreeNodeData[];
1386
1399
  [key: string]: any;
1387
1400
  }
1401
+ /** 判断组件树节点是否可展开(即是否要展示为拥有子节点的形态)的函数 */
1402
+ type IsExpandableFunction = (_data: TreeNodeData, _nodeStatusMap: Map<Id, LayerNodeStatus>) => boolean;
1388
1403
  type AsyncBeforeHook<Value extends Array<string>, C extends Record<Value[number], (...args: any) => any>> = { [K in Value[number]]?: (...args: Parameters<C[K]>) => Promise<Parameters<C[K]>> | Parameters<C[K]> };
1389
1404
  type AsyncAfterHook<Value extends Array<string>, C extends Record<Value[number], (...args: any) => any>> = { [K in Value[number]]?: (result: Awaited<ReturnType<C[K]>>, ...args: Parameters<C[K]>) => ReturnType<C[K]> | Awaited<ReturnType<C[K]>> };
1390
1405
  type SyncBeforeHook<Value extends Array<string>, C extends Record<Value[number], (...args: any) => any>> = { [K in Value[number]]?: (...args: Parameters<C[K]>) => Parameters<C[K]> };
@@ -1857,6 +1872,8 @@ declare class ScrollViewer extends EventEmitter$1 {
1857
1872
  //#endregion
1858
1873
  //#region temp/packages/editor/src/utils/tree.d.ts
1859
1874
  declare const updateStatus: (nodeStatusMap: Map<Id, LayerNodeStatus>, id: Id, status: Partial<LayerNodeStatus>) => void;
1875
+ /** 默认的组件树节点是否可展开的判断函数:当节点的子项中至少存在一个可见节点时认为可展开 */
1876
+ declare const defaultIsExpandable: IsExpandableFunction;
1860
1877
  //#endregion
1861
1878
  //#region temp/packages/editor/src/utils/const.d.ts
1862
1879
  /** 当uiService.get('uiSelectMode')为true,点击组件(包括任何形式,组件树/画布)时触发的事件名 */
@@ -1960,6 +1977,8 @@ interface EditorProps {
1960
1977
  isContainer?: (el: HTMLElement) => boolean | Promise<boolean>;
1961
1978
  /** 用于自定义组件树与画布的右键菜单 */
1962
1979
  customContentMenu?: CustomContentMenuFunction;
1980
+ /** 用于自定义判断组件树节点是否可展开(即是否要展示为拥有子节点的形态) */
1981
+ layerNodeIsExpandable?: IsExpandableFunction;
1963
1982
  /** 画布双击前的钩子函数,返回 false 则阻止默认的双击行为 */
1964
1983
  beforeDblclick?: (event: MouseEvent) => Promise<boolean | void> | boolean | void;
1965
1984
  extendFormState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
@@ -2686,7 +2705,8 @@ type __VLS_Props$29 = {
2686
2705
  layerContentMenu: (MenuButton | MenuComponent)[];
2687
2706
  indent?: number;
2688
2707
  nextLevelIndentIncrement?: number;
2689
- customContentMenu: CustomContentMenuFunction;
2708
+ customContentMenu: CustomContentMenuFunction; /** 自定义判断组件树节点是否可展开(即是否要展示为拥有子节点的形态)的函数 */
2709
+ isExpandable?: IsExpandableFunction;
2690
2710
  };
2691
2711
  declare const __VLS_base$10: _$_vue_runtime_core0.DefineComponent<__VLS_Props$29, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {}, string, _$_vue_runtime_core0.PublicProps, Readonly<__VLS_Props$29> & Readonly<{}>, {}, {}, {}, {}, string, _$_vue_runtime_core0.ComponentProvideOptions, false, {}, any>;
2692
2712
  declare const __VLS_export$30: __VLS_WithSlots$10<typeof __VLS_base$10, __VLS_Slots$10>;
@@ -3939,7 +3959,8 @@ type __VLS_Props$5 = {
3939
3959
  nodeStatusMap: Map<Id, LayerNodeStatus>;
3940
3960
  indent?: number;
3941
3961
  nextLevelIndentIncrement?: number;
3942
- emptyText?: string;
3962
+ emptyText?: string; /** 自定义判断节点是否可展开(即是否要展示为拥有子节点的形态)的函数 */
3963
+ isExpandable?: IsExpandableFunction;
3943
3964
  };
3944
3965
  declare const __VLS_base$1: _$_vue_runtime_core0.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {
3945
3966
  "node-dragstart": (event: DragEvent, data: TreeNodeData) => any;
@@ -3987,7 +4008,8 @@ type __VLS_Props$4 = {
3987
4008
  parentsId?: Id[];
3988
4009
  nodeStatusMap: Map<Id, LayerNodeStatus>;
3989
4010
  indent?: number;
3990
- nextLevelIndentIncrement?: number;
4011
+ nextLevelIndentIncrement?: number; /** 自定义判断节点是否可展开(即是否要展示为拥有子节点的形态)的函数 */
4012
+ isExpandable?: IsExpandableFunction;
3991
4013
  };
3992
4014
  declare const __VLS_base: _$_vue_runtime_core0.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {
3993
4015
  "node-dragstart": (event: DragEvent, data: TreeNodeData) => any;
@@ -4007,6 +4029,7 @@ declare const __VLS_base: _$_vue_runtime_core0.DefineComponent<__VLS_Props$4, {}
4007
4029
  indent: number;
4008
4030
  parentsId: Id[];
4009
4031
  nextLevelIndentIncrement: number;
4032
+ isExpandable: IsExpandableFunction;
4010
4033
  }, {}, {}, {}, string, _$_vue_runtime_core0.ComponentProvideOptions, false, {}, any>;
4011
4034
  declare const __VLS_export$4: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4012
4035
  declare const _default$33: typeof __VLS_export$4;
@@ -4061,4 +4084,4 @@ declare const _default$36: {
4061
4084
  install: (app: App, opt?: Partial<EditorInstallOptions | DesignPluginOptions | FormInstallOptions>) => void;
4062
4085
  };
4063
4086
  //#endregion
4064
- export { AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, ComponentGroup, ComponentGroupState, ComponentItem, _default$5 as ComponentListPanel, ComponentListPanelSlots, _default$6 as CondOpSelect, _default$7 as ContentMenu, CustomContentMenuFunction, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$8 as DataSourceAddButton, _default$9 as DataSourceConfigPanel, _default$10 as DataSourceFieldSelect, _default$11 as DataSourceFields, _default$12 as DataSourceInput, DataSourceListSlots, _default$13 as DataSourceMethodSelect, _default$14 as DataSourceMethods, _default$15 as DataSourceMocks, _default$16 as DataSourceSelect, DatasourceTypeOption, DepTargetType, _default$17 as DisplayConds, DragClassification, DragType, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EventBus, EventBusEvent, _default$18 as EventSelect, Fixed2Other, _default$19 as FloatingBox, FrameworkSlots, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryOpType, HistoryState, _default$20 as Icon, IdleTask, IdleTaskEvents, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$21 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$22 as LayerPanel, LayerPanelSlots, Layout, _default$23 as LayoutContainer, _default$23 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$24 as PageFragmentSelect, PartSortableOptions, PastePosition, PropsFormConfigFunction, _default$25 as PropsFormPanel, PropsFormValueFunction, _default$26 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$27 as Resizer, ScrollViewer, ScrollViewerEvent, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StageCore, StageOptions, StageOverlayState, StageRect, StepValue, StoreState, StoreStateKey, _default$28 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$29 as TMagicCodeEditor, _default$30 as TMagicEditor, _default$31 as ToolButton, _default$32 as Tree, _default$33 as TreeNode, TreeNodeData, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$34 as codeBlockService, collectRelatedNodes, _default$35 as dataSourceService, debug, _default$36 as default, _default$37 as depService, designPlugin, displayTabConfig, editorNodeMergeCustomizer, _default$38 as editorService, eqOptions, error, eventTabConfig, _default$39 as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, _default$40 as historyService, info, isIncludeDataSource, _default$41 as loadMonaco, log, moveItemsInContainer, numberOptions, _default$42 as propsService, resolveSelectedNode, serializeConfig, setChildrenLayout, setEditorConfig, setLayout, _default$43 as stageOverlayService, _default$44 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$45 as uiService, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };
4087
+ export { AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, ComponentGroup, ComponentGroupState, ComponentItem, _default$5 as ComponentListPanel, ComponentListPanelSlots, _default$6 as CondOpSelect, _default$7 as ContentMenu, CustomContentMenuFunction, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$8 as DataSourceAddButton, _default$9 as DataSourceConfigPanel, _default$10 as DataSourceFieldSelect, _default$11 as DataSourceFields, _default$12 as DataSourceInput, DataSourceListSlots, _default$13 as DataSourceMethodSelect, _default$14 as DataSourceMethods, _default$15 as DataSourceMocks, _default$16 as DataSourceSelect, DatasourceTypeOption, DepTargetType, _default$17 as DisplayConds, DragClassification, DragType, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EventBus, EventBusEvent, _default$18 as EventSelect, Fixed2Other, _default$19 as FloatingBox, FrameworkSlots, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryOpType, HistoryState, _default$20 as Icon, IdleTask, IdleTaskEvents, IsExpandableFunction, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$21 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$22 as LayerPanel, LayerPanelSlots, Layout, _default$23 as LayoutContainer, _default$23 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$24 as PageFragmentSelect, PartSortableOptions, PastePosition, PropsFormConfigFunction, _default$25 as PropsFormPanel, PropsFormValueFunction, _default$26 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$27 as Resizer, ScrollViewer, ScrollViewerEvent, ScrollViewerSlots, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StageCore, StageOptions, StageOverlayState, StageRect, StageSlots, StepValue, StoreState, StoreStateKey, _default$28 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$29 as TMagicCodeEditor, _default$30 as TMagicEditor, _default$31 as ToolButton, _default$32 as Tree, _default$33 as TreeNode, TreeNodeData, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$34 as codeBlockService, collectRelatedNodes, _default$35 as dataSourceService, debug, _default$36 as default, defaultIsExpandable, _default$37 as depService, designPlugin, displayTabConfig, editorNodeMergeCustomizer, _default$38 as editorService, eqOptions, error, eventTabConfig, _default$39 as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getDefaultConfig, getDisplayField, getEditorConfig, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, _default$40 as historyService, info, isIncludeDataSource, _default$41 as loadMonaco, log, moveItemsInContainer, numberOptions, _default$42 as propsService, resolveSelectedNode, serializeConfig, setChildrenLayout, setEditorConfig, setLayout, _default$43 as stageOverlayService, _default$44 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$45 as uiService, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };