GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lowcode-engine/packages/shell/src/component-meta.ts at main · WonRay/lowcode-engine

Expand file tree

/

component-meta.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
132 lines (114 loc) · 2.86 KB
/

component-meta.ts

Copy path

File metadata and controls

132 lines (114 loc) · 2.86 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import {
ComponentMeta as InnerComponentMeta,
ParentalNode,
} from '@alilc/lowcode-designer';
import Node from './node';
import { NodeData, NodeSchema } from '@alilc/lowcode-types';
import { componentMetaSymbol, nodeSymbol } from './symbols';
export default class ComponentMeta {
private readonly [componentMetaSymbol]: InnerComponentMeta;
constructor(componentMeta: InnerComponentMeta) {
this[componentMetaSymbol] = componentMeta;
}
static create(componentMeta: InnerComponentMeta | null) {
if (!componentMeta) return null;
return new ComponentMeta(componentMeta);
}
/**
* 组件名
*/
get componentName(): string {
return this[componentMetaSymbol].componentName;
}
/**
* 是否是「容器型」组件
*/
get isContainer(): boolean {
return this[componentMetaSymbol].isContainer;
}
/**
* 是否是最小渲染单元。
* 当组件需要重新渲染时:
* 若为最小渲染单元,则只渲染当前组件,
* 若不为最小渲染单元,则寻找到上层最近的最小渲染单元进行重新渲染,直至根节点。
*/
get isMinimalRenderUnit(): boolean {
return this[componentMetaSymbol].isMinimalRenderUnit;
}
/**
* 是否为「模态框」组件
*/
get isModal(): boolean {
return this[componentMetaSymbol].isModal;
}
/**
* 元数据配置
*/
get configure() {
return this[componentMetaSymbol].configure;
}
/**
* 标题
*/
get title() {
return this[componentMetaSymbol].title;
}
/**
* 图标
*/
get icon() {
return this[componentMetaSymbol].icon;
}
/**
* 组件 npm 信息
*/
get npm() {
return this[componentMetaSymbol].npm;
}
/**
* @deprecated
*/
get prototype() {
return this[componentMetaSymbol].prototype;
}
get availableActions() {
return this[componentMetaSymbol].availableActions;
}
/**
* 设置 npm 信息
* @param npm
*/
setNpm(npm: any) {
this[componentMetaSymbol].setNpm(npm);
}
/**
* 获取元数据
* @returns
*/
getMetadata() {
return this[componentMetaSymbol].getMetadata();
}
/**
* check if the current node could be placed in parent node
* @param my
* @param parent
* @returns
*/
checkNestingUp(my: Node | NodeData, parent: ParentalNode<NodeSchema>) {
const curNode = my.isNode ? my[nodeSymbol] : my;
return this[componentMetaSymbol].checkNestingUp(curNode as any, parent);
}
/**
* check if the target node(s) could be placed in current node
* @param my
* @param parent
* @returns
*/
checkNestingDown(my: Node | NodeData, target: NodeSchema | Node | NodeSchema[]) {
const curNode = my.isNode ? my[nodeSymbol] : my;
return this[componentMetaSymbol].checkNestingDown(curNode as any, target[nodeSymbol] || target);
}
refreshMetadata() {
this[componentMetaSymbol].refreshMetadata();
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.