MCPcopy
hub / github.com/alibaba/lowcode-engine / BaseRenderer

Class BaseRenderer

packages/renderer-core/src/renderer/base.tsx:121–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119 let scopeIdx = 0;
120
121 return class BaseRenderer extends Component<IBaseRendererProps, Record<string, any>> {
122 [key: string]: any;
123
124 static displayName = 'BaseRenderer';
125
126 static defaultProps = {
127 __schema: {},
128 };
129
130 static contextType = AppContext;
131
132 i18n: any;
133 getLocale: any;
134 setLocale: any;
135 dataSourceMap: Record<string, any> = {};
136
137 __namespace = 'base';
138 __compScopes: Record<string, any> = {};
139 __instanceMap: Record<string, any> = {};
140 __dataHelper: any;
141
142 /**
143 * keep track of customMethods added to this context
144 *
145 * @type {any}
146 */
147 __customMethodsList: any[] = [];
148 __parseExpression: any;
149 __ref: any;
150
151 /**
152 * reference of style element contains schema.css
153 *
154 * @type {any}
155 */
156 __styleElement: any;
157
158 constructor(props: IBaseRendererProps, context: IBaseRendererContext) {
159 super(props, context);
160 this.context = context;
161 this.__parseExpression = (str: string, self: any) => {
162 return parseExpression({ str, self, thisRequired: props?.thisRequiredInJSE, logScope: props.componentName });
163 };
164 this.__beforeInit(props);
165 this.__init(props);
166 this.__afterInit(props);
167 this.__debug(`constructor - ${props?.__schema?.fileName}`);
168 }
169
170 // eslint-disable-next-line @typescript-eslint/no-unused-vars
171 __beforeInit(_props: IBaseRendererProps) { }
172
173 __init(props: IBaseRendererProps) {
174 this.__compScopes = {};
175 this.__instanceMap = {};
176 this.__bindCustomMethods(props);
177 this.__initI18nAPIs();
178 }

Callers

nothing calls this directly

Calls 15

forceUpdateMethod · 0.95
$Method · 0.95
forEachFunction · 0.90
parseDataFunction · 0.90
getI18nFunction · 0.90
getValueFunction · 0.90
parseI18nFunction · 0.90
isJSSlotFunction · 0.90
isSchemaFunction · 0.90
isFileSchemaFunction · 0.90
transformArrayToMapFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…