1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Injector } from '../di/injector';
|
---|
9 | import { InjectFlags } from '../di/interface/injector';
|
---|
10 | import { ComponentFactory, ComponentRef } from '../linker/component_factory';
|
---|
11 | import { ComponentFactoryBoundToModule, ComponentFactoryResolver } from '../linker/component_factory_resolver';
|
---|
12 | import { ElementRef } from '../linker/element_ref';
|
---|
13 | import { NgModuleRef } from '../linker/ng_module_factory';
|
---|
14 | import { TemplateRef } from '../linker/template_ref';
|
---|
15 | import { stringify } from '../util/stringify';
|
---|
16 | import { VERSION } from '../version';
|
---|
17 | import { callNgModuleLifecycle, initNgModule, resolveNgModuleDep } from './ng_module';
|
---|
18 | import { asElementData, asProviderData, asTextData, Services } from './types';
|
---|
19 | import { markParentViewsForCheck, resolveDefinition, rootRenderNodes, tokenKey, viewParentEl } from './util';
|
---|
20 | import { attachEmbeddedView, detachEmbeddedView, moveEmbeddedView, renderDetachView } from './view_attach';
|
---|
21 | const EMPTY_CONTEXT = {};
|
---|
22 | // Attention: this function is called as top level function.
|
---|
23 | // Putting any logic in here will destroy closure tree shaking!
|
---|
24 | export function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {
|
---|
25 | return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);
|
---|
26 | }
|
---|
27 | export function getComponentViewDefinitionFactory(componentFactory) {
|
---|
28 | return componentFactory.viewDefFactory;
|
---|
29 | }
|
---|
30 | class ComponentFactory_ extends ComponentFactory {
|
---|
31 | constructor(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {
|
---|
32 | // Attention: this ctor is called as top level function.
|
---|
33 | // Putting any logic in here will destroy closure tree shaking!
|
---|
34 | super();
|
---|
35 | this.selector = selector;
|
---|
36 | this.componentType = componentType;
|
---|
37 | this._inputs = _inputs;
|
---|
38 | this._outputs = _outputs;
|
---|
39 | this.ngContentSelectors = ngContentSelectors;
|
---|
40 | this.viewDefFactory = viewDefFactory;
|
---|
41 | }
|
---|
42 | get inputs() {
|
---|
43 | const inputsArr = [];
|
---|
44 | const inputs = this._inputs;
|
---|
45 | for (let propName in inputs) {
|
---|
46 | const templateName = inputs[propName];
|
---|
47 | inputsArr.push({ propName, templateName });
|
---|
48 | }
|
---|
49 | return inputsArr;
|
---|
50 | }
|
---|
51 | get outputs() {
|
---|
52 | const outputsArr = [];
|
---|
53 | for (let propName in this._outputs) {
|
---|
54 | const templateName = this._outputs[propName];
|
---|
55 | outputsArr.push({ propName, templateName });
|
---|
56 | }
|
---|
57 | return outputsArr;
|
---|
58 | }
|
---|
59 | /**
|
---|
60 | * Creates a new component.
|
---|
61 | */
|
---|
62 | create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
|
---|
63 | if (!ngModule) {
|
---|
64 | throw new Error('ngModule should be provided');
|
---|
65 | }
|
---|
66 | const viewDef = resolveDefinition(this.viewDefFactory);
|
---|
67 | const componentNodeIndex = viewDef.nodes[0].element.componentProvider.nodeIndex;
|
---|
68 | const view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);
|
---|
69 | const component = asProviderData(view, componentNodeIndex).instance;
|
---|
70 | if (rootSelectorOrNode) {
|
---|
71 | view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);
|
---|
72 | }
|
---|
73 | return new ComponentRef_(view, new ViewRef_(view), component);
|
---|
74 | }
|
---|
75 | }
|
---|
76 | class ComponentRef_ extends ComponentRef {
|
---|
77 | constructor(_view, _viewRef, _component) {
|
---|
78 | super();
|
---|
79 | this._view = _view;
|
---|
80 | this._viewRef = _viewRef;
|
---|
81 | this._component = _component;
|
---|
82 | this._elDef = this._view.def.nodes[0];
|
---|
83 | this.hostView = _viewRef;
|
---|
84 | this.changeDetectorRef = _viewRef;
|
---|
85 | this.instance = _component;
|
---|
86 | }
|
---|
87 | get location() {
|
---|
88 | return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);
|
---|
89 | }
|
---|
90 | get injector() {
|
---|
91 | return new Injector_(this._view, this._elDef);
|
---|
92 | }
|
---|
93 | get componentType() {
|
---|
94 | return this._component.constructor;
|
---|
95 | }
|
---|
96 | destroy() {
|
---|
97 | this._viewRef.destroy();
|
---|
98 | }
|
---|
99 | onDestroy(callback) {
|
---|
100 | this._viewRef.onDestroy(callback);
|
---|
101 | }
|
---|
102 | }
|
---|
103 | export function createViewContainerData(view, elDef, elData) {
|
---|
104 | return new ViewContainerRef_(view, elDef, elData);
|
---|
105 | }
|
---|
106 | class ViewContainerRef_ {
|
---|
107 | constructor(_view, _elDef, _data) {
|
---|
108 | this._view = _view;
|
---|
109 | this._elDef = _elDef;
|
---|
110 | this._data = _data;
|
---|
111 | /**
|
---|
112 | * @internal
|
---|
113 | */
|
---|
114 | this._embeddedViews = [];
|
---|
115 | }
|
---|
116 | get element() {
|
---|
117 | return new ElementRef(this._data.renderElement);
|
---|
118 | }
|
---|
119 | get injector() {
|
---|
120 | return new Injector_(this._view, this._elDef);
|
---|
121 | }
|
---|
122 | /** @deprecated No replacement */
|
---|
123 | get parentInjector() {
|
---|
124 | let view = this._view;
|
---|
125 | let elDef = this._elDef.parent;
|
---|
126 | while (!elDef && view) {
|
---|
127 | elDef = viewParentEl(view);
|
---|
128 | view = view.parent;
|
---|
129 | }
|
---|
130 | return view ? new Injector_(view, elDef) : new Injector_(this._view, null);
|
---|
131 | }
|
---|
132 | clear() {
|
---|
133 | const len = this._embeddedViews.length;
|
---|
134 | for (let i = len - 1; i >= 0; i--) {
|
---|
135 | const view = detachEmbeddedView(this._data, i);
|
---|
136 | Services.destroyView(view);
|
---|
137 | }
|
---|
138 | }
|
---|
139 | get(index) {
|
---|
140 | const view = this._embeddedViews[index];
|
---|
141 | if (view) {
|
---|
142 | const ref = new ViewRef_(view);
|
---|
143 | ref.attachToViewContainerRef(this);
|
---|
144 | return ref;
|
---|
145 | }
|
---|
146 | return null;
|
---|
147 | }
|
---|
148 | get length() {
|
---|
149 | return this._embeddedViews.length;
|
---|
150 | }
|
---|
151 | createEmbeddedView(templateRef, context, index) {
|
---|
152 | const viewRef = templateRef.createEmbeddedView(context || {});
|
---|
153 | this.insert(viewRef, index);
|
---|
154 | return viewRef;
|
---|
155 | }
|
---|
156 | createComponent(componentFactory, index, injector, projectableNodes, ngModuleRef) {
|
---|
157 | const contextInjector = injector || this.parentInjector;
|
---|
158 | if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {
|
---|
159 | ngModuleRef = contextInjector.get(NgModuleRef);
|
---|
160 | }
|
---|
161 | const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
|
---|
162 | this.insert(componentRef.hostView, index);
|
---|
163 | return componentRef;
|
---|
164 | }
|
---|
165 | insert(viewRef, index) {
|
---|
166 | if (viewRef.destroyed) {
|
---|
167 | throw new Error('Cannot insert a destroyed View in a ViewContainer!');
|
---|
168 | }
|
---|
169 | const viewRef_ = viewRef;
|
---|
170 | const viewData = viewRef_._view;
|
---|
171 | attachEmbeddedView(this._view, this._data, index, viewData);
|
---|
172 | viewRef_.attachToViewContainerRef(this);
|
---|
173 | return viewRef;
|
---|
174 | }
|
---|
175 | move(viewRef, currentIndex) {
|
---|
176 | if (viewRef.destroyed) {
|
---|
177 | throw new Error('Cannot move a destroyed View in a ViewContainer!');
|
---|
178 | }
|
---|
179 | const previousIndex = this._embeddedViews.indexOf(viewRef._view);
|
---|
180 | moveEmbeddedView(this._data, previousIndex, currentIndex);
|
---|
181 | return viewRef;
|
---|
182 | }
|
---|
183 | indexOf(viewRef) {
|
---|
184 | return this._embeddedViews.indexOf(viewRef._view);
|
---|
185 | }
|
---|
186 | remove(index) {
|
---|
187 | const viewData = detachEmbeddedView(this._data, index);
|
---|
188 | if (viewData) {
|
---|
189 | Services.destroyView(viewData);
|
---|
190 | }
|
---|
191 | }
|
---|
192 | detach(index) {
|
---|
193 | const view = detachEmbeddedView(this._data, index);
|
---|
194 | return view ? new ViewRef_(view) : null;
|
---|
195 | }
|
---|
196 | }
|
---|
197 | export function createChangeDetectorRef(view) {
|
---|
198 | return new ViewRef_(view);
|
---|
199 | }
|
---|
200 | export class ViewRef_ {
|
---|
201 | constructor(_view) {
|
---|
202 | this._view = _view;
|
---|
203 | this._viewContainerRef = null;
|
---|
204 | this._appRef = null;
|
---|
205 | }
|
---|
206 | get rootNodes() {
|
---|
207 | return rootRenderNodes(this._view);
|
---|
208 | }
|
---|
209 | get context() {
|
---|
210 | return this._view.context;
|
---|
211 | }
|
---|
212 | set context(value) {
|
---|
213 | this._view.context = value;
|
---|
214 | }
|
---|
215 | get destroyed() {
|
---|
216 | return (this._view.state & 128 /* Destroyed */) !== 0;
|
---|
217 | }
|
---|
218 | markForCheck() {
|
---|
219 | markParentViewsForCheck(this._view);
|
---|
220 | }
|
---|
221 | detach() {
|
---|
222 | this._view.state &= ~4 /* Attached */;
|
---|
223 | }
|
---|
224 | detectChanges() {
|
---|
225 | const fs = this._view.root.rendererFactory;
|
---|
226 | if (fs.begin) {
|
---|
227 | fs.begin();
|
---|
228 | }
|
---|
229 | try {
|
---|
230 | Services.checkAndUpdateView(this._view);
|
---|
231 | }
|
---|
232 | finally {
|
---|
233 | if (fs.end) {
|
---|
234 | fs.end();
|
---|
235 | }
|
---|
236 | }
|
---|
237 | }
|
---|
238 | checkNoChanges() {
|
---|
239 | Services.checkNoChangesView(this._view);
|
---|
240 | }
|
---|
241 | reattach() {
|
---|
242 | this._view.state |= 4 /* Attached */;
|
---|
243 | }
|
---|
244 | onDestroy(callback) {
|
---|
245 | if (!this._view.disposables) {
|
---|
246 | this._view.disposables = [];
|
---|
247 | }
|
---|
248 | this._view.disposables.push(callback);
|
---|
249 | }
|
---|
250 | destroy() {
|
---|
251 | if (this._appRef) {
|
---|
252 | this._appRef.detachView(this);
|
---|
253 | }
|
---|
254 | else if (this._viewContainerRef) {
|
---|
255 | this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));
|
---|
256 | }
|
---|
257 | Services.destroyView(this._view);
|
---|
258 | }
|
---|
259 | detachFromAppRef() {
|
---|
260 | this._appRef = null;
|
---|
261 | renderDetachView(this._view);
|
---|
262 | Services.dirtyParentQueries(this._view);
|
---|
263 | }
|
---|
264 | attachToAppRef(appRef) {
|
---|
265 | if (this._viewContainerRef) {
|
---|
266 | throw new Error('This view is already attached to a ViewContainer!');
|
---|
267 | }
|
---|
268 | this._appRef = appRef;
|
---|
269 | }
|
---|
270 | attachToViewContainerRef(vcRef) {
|
---|
271 | if (this._appRef) {
|
---|
272 | throw new Error('This view is already attached directly to the ApplicationRef!');
|
---|
273 | }
|
---|
274 | this._viewContainerRef = vcRef;
|
---|
275 | }
|
---|
276 | }
|
---|
277 | export function createTemplateData(view, def) {
|
---|
278 | return new TemplateRef_(view, def);
|
---|
279 | }
|
---|
280 | class TemplateRef_ extends TemplateRef {
|
---|
281 | constructor(_parentView, _def) {
|
---|
282 | super();
|
---|
283 | this._parentView = _parentView;
|
---|
284 | this._def = _def;
|
---|
285 | }
|
---|
286 | createEmbeddedView(context) {
|
---|
287 | return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context));
|
---|
288 | }
|
---|
289 | get elementRef() {
|
---|
290 | return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);
|
---|
291 | }
|
---|
292 | }
|
---|
293 | export function createInjector(view, elDef) {
|
---|
294 | return new Injector_(view, elDef);
|
---|
295 | }
|
---|
296 | class Injector_ {
|
---|
297 | constructor(view, elDef) {
|
---|
298 | this.view = view;
|
---|
299 | this.elDef = elDef;
|
---|
300 | }
|
---|
301 | get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
|
---|
302 | const allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;
|
---|
303 | return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token, tokenKey: tokenKey(token) }, notFoundValue);
|
---|
304 | }
|
---|
305 | }
|
---|
306 | export function nodeValue(view, index) {
|
---|
307 | const def = view.def.nodes[index];
|
---|
308 | if (def.flags & 1 /* TypeElement */) {
|
---|
309 | const elData = asElementData(view, def.nodeIndex);
|
---|
310 | return def.element.template ? elData.template : elData.renderElement;
|
---|
311 | }
|
---|
312 | else if (def.flags & 2 /* TypeText */) {
|
---|
313 | return asTextData(view, def.nodeIndex).renderText;
|
---|
314 | }
|
---|
315 | else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {
|
---|
316 | return asProviderData(view, def.nodeIndex).instance;
|
---|
317 | }
|
---|
318 | throw new Error(`Illegal state: read nodeValue for node index ${index}`);
|
---|
319 | }
|
---|
320 | export function createNgModuleRef(moduleType, parent, bootstrapComponents, def) {
|
---|
321 | return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);
|
---|
322 | }
|
---|
323 | class NgModuleRef_ {
|
---|
324 | constructor(_moduleType, _parent, _bootstrapComponents, _def) {
|
---|
325 | this._moduleType = _moduleType;
|
---|
326 | this._parent = _parent;
|
---|
327 | this._bootstrapComponents = _bootstrapComponents;
|
---|
328 | this._def = _def;
|
---|
329 | this._destroyListeners = [];
|
---|
330 | this._destroyed = false;
|
---|
331 | this.injector = this;
|
---|
332 | initNgModule(this);
|
---|
333 | }
|
---|
334 | get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
---|
335 | let flags = 0 /* None */;
|
---|
336 | if (injectFlags & InjectFlags.SkipSelf) {
|
---|
337 | flags |= 1 /* SkipSelf */;
|
---|
338 | }
|
---|
339 | else if (injectFlags & InjectFlags.Self) {
|
---|
340 | flags |= 4 /* Self */;
|
---|
341 | }
|
---|
342 | return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: flags }, notFoundValue);
|
---|
343 | }
|
---|
344 | get instance() {
|
---|
345 | return this.get(this._moduleType);
|
---|
346 | }
|
---|
347 | get componentFactoryResolver() {
|
---|
348 | return this.get(ComponentFactoryResolver);
|
---|
349 | }
|
---|
350 | destroy() {
|
---|
351 | if (this._destroyed) {
|
---|
352 | throw new Error(`The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);
|
---|
353 | }
|
---|
354 | this._destroyed = true;
|
---|
355 | callNgModuleLifecycle(this, 131072 /* OnDestroy */);
|
---|
356 | this._destroyListeners.forEach((listener) => listener());
|
---|
357 | }
|
---|
358 | onDestroy(callback) {
|
---|
359 | this._destroyListeners.push(callback);
|
---|
360 | }
|
---|
361 | }
|
---|
362 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVmcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL3ZpZXcvcmVmcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFHSCxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFDeEMsT0FBTyxFQUFDLFdBQVcsRUFBQyxNQUFNLDBCQUEwQixDQUFDO0FBRXJELE9BQU8sRUFBQyxnQkFBZ0IsRUFBRSxZQUFZLEVBQUMsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRSxPQUFPLEVBQUMsNkJBQTZCLEVBQUUsd0JBQXdCLEVBQUMsTUFBTSxzQ0FBc0MsQ0FBQztBQUM3RyxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDakQsT0FBTyxFQUFzQixXQUFXLEVBQUMsTUFBTSw2QkFBNkIsQ0FBQztBQUM3RSxPQUFPLEVBQUMsV0FBVyxFQUFDLE1BQU0sd0JBQXdCLENBQUM7QUFHbkQsT0FBTyxFQUFDLFN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