@sitecore-jss/sitecore-jss-angular 21.5.0 → 21.6.0-beta.1

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 (66) hide show
  1. package/LICENSE.txt +202 -202
  2. package/README.md +7 -7
  3. package/angular.json +48 -48
  4. package/dist/README.md +7 -7
  5. package/dist/components/data-resolver-factory.d.ts +13 -13
  6. package/dist/components/date.directive.d.ts +20 -20
  7. package/dist/components/editframe.component.d.ts +22 -22
  8. package/dist/components/file.directive.d.ts +17 -17
  9. package/dist/components/generic-link.directive.d.ts +20 -20
  10. package/dist/components/guard-resolver-factory.d.ts +11 -11
  11. package/dist/components/hidden-rendering.component.d.ts +7 -7
  12. package/dist/components/image.directive.d.ts +35 -35
  13. package/dist/components/link.directive.d.ts +26 -26
  14. package/dist/components/missing-component.component.d.ts +7 -7
  15. package/dist/components/placeholder-loading.directive.d.ts +8 -8
  16. package/dist/components/placeholder.component.d.ts +59 -59
  17. package/dist/components/placeholder.token.d.ts +64 -64
  18. package/dist/components/raw.component.d.ts +12 -12
  19. package/dist/components/render-component.component.d.ts +33 -33
  20. package/dist/components/render-each.directive.d.ts +8 -8
  21. package/dist/components/render-empty.directive.d.ts +8 -8
  22. package/dist/components/rendering-field.d.ts +41 -41
  23. package/dist/components/rendering.d.ts +5 -5
  24. package/dist/components/rich-text.directive.d.ts +18 -18
  25. package/dist/components/router-link.directive.d.ts +19 -19
  26. package/dist/components/text.directive.d.ts +16 -16
  27. package/dist/esm2020/components/data-resolver-factory.mjs +58 -58
  28. package/dist/esm2020/components/date.directive.mjs +59 -59
  29. package/dist/esm2020/components/editframe.component.mjs +65 -65
  30. package/dist/esm2020/components/file.directive.mjs +44 -44
  31. package/dist/esm2020/components/generic-link.directive.mjs +64 -64
  32. package/dist/esm2020/components/guard-resolver-factory.mjs +85 -85
  33. package/dist/esm2020/components/hidden-rendering.component.mjs +20 -20
  34. package/dist/esm2020/components/image.directive.mjs +137 -137
  35. package/dist/esm2020/components/link.directive.mjs +117 -117
  36. package/dist/esm2020/components/missing-component.component.mjs +15 -15
  37. package/dist/esm2020/components/placeholder-loading.directive.mjs +15 -15
  38. package/dist/esm2020/components/placeholder.component.mjs +250 -250
  39. package/dist/esm2020/components/placeholder.token.mjs +23 -23
  40. package/dist/esm2020/components/raw.component.mjs +35 -35
  41. package/dist/esm2020/components/render-component.component.mjs +90 -90
  42. package/dist/esm2020/components/render-each.directive.mjs +15 -15
  43. package/dist/esm2020/components/render-empty.directive.mjs +15 -15
  44. package/dist/esm2020/components/rendering-field.mjs +1 -1
  45. package/dist/esm2020/components/rendering.mjs +7 -7
  46. package/dist/esm2020/components/rich-text.directive.mjs +62 -62
  47. package/dist/esm2020/components/router-link.directive.mjs +47 -47
  48. package/dist/esm2020/components/text.directive.mjs +57 -57
  49. package/dist/esm2020/jss-component-factory.service.mjs +82 -82
  50. package/dist/esm2020/lib.module.mjs +161 -161
  51. package/dist/esm2020/public_api.mjs +24 -24
  52. package/dist/esm2020/sitecore-jss-sitecore-jss-angular.mjs +4 -4
  53. package/dist/esm2020/utils.mjs +16 -16
  54. package/dist/fesm2015/sitecore-jss-sitecore-jss-angular.mjs +1406 -1406
  55. package/dist/fesm2020/sitecore-jss-sitecore-jss-angular.mjs +1413 -1413
  56. package/dist/index.d.ts +5 -5
  57. package/dist/jss-component-factory.service.d.ts +25 -25
  58. package/dist/lib.module.d.ts +46 -46
  59. package/dist/package.json +2 -2
  60. package/dist/public_api.d.ts +25 -25
  61. package/dist/utils.d.ts +7 -7
  62. package/ng-package.json +13 -13
  63. package/package.json +3 -3
  64. package/tsconfig.json +9 -9
  65. package/tsconfig.spec.json +16 -16
  66. package/typings/README.md +2 -2
@@ -16,1038 +16,1038 @@ export { GraphQLLayoutService, RestLayoutService, getChildPlaceholder, getFieldV
16
16
  export { constants, enableDebug } from '@sitecore-jss/sitecore-jss';
17
17
  export { trackingApi } from '@sitecore-jss/sitecore-jss/tracking';
18
18
 
19
- /**
20
- * File fields cannot be managed via the EE. We never output "editable."
21
- */
22
- class FileDirective {
23
- constructor(viewContainer, templateRef) {
24
- this.viewContainer = viewContainer;
25
- this.templateRef = templateRef;
26
- }
27
- ngOnChanges(changes) {
28
- if (changes.field) {
29
- if (!this.viewRef) {
30
- this.viewContainer.clear();
31
- this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
32
- }
33
- this.updateView();
34
- }
35
- }
36
- updateView() {
37
- const field = this.field;
38
- if (!field || (!field.value && !field.src)) {
39
- return;
40
- }
41
- const file = field.src ? field : field.value;
42
- this.viewRef.rootNodes.forEach((node) => {
43
- if (!file)
44
- return;
45
- node.href = file.src;
46
- if (node.innerHTML === '') {
47
- node.innerHTML = file.title || file.displayName;
48
- }
49
- });
50
- }
51
- }
52
- FileDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
53
- FileDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: FileDirective, selector: "[scFile]", inputs: { field: ["scFile", "field"] }, usesOnChanges: true, ngImport: i0 });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileDirective, decorators: [{
55
- type: Directive,
56
- args: [{ selector: '[scFile]' }]
57
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { field: [{
58
- type: Input,
59
- args: ['scFile']
19
+ /**
20
+ * File fields cannot be managed via the EE. We never output "editable."
21
+ */
22
+ class FileDirective {
23
+ constructor(viewContainer, templateRef) {
24
+ this.viewContainer = viewContainer;
25
+ this.templateRef = templateRef;
26
+ }
27
+ ngOnChanges(changes) {
28
+ if (changes.field) {
29
+ if (!this.viewRef) {
30
+ this.viewContainer.clear();
31
+ this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
32
+ }
33
+ this.updateView();
34
+ }
35
+ }
36
+ updateView() {
37
+ const field = this.field;
38
+ if (!field || (!field.value && !field.src)) {
39
+ return;
40
+ }
41
+ const file = field.src ? field : field.value;
42
+ this.viewRef.rootNodes.forEach((node) => {
43
+ if (!file)
44
+ return;
45
+ node.href = file.src;
46
+ if (node.innerHTML === '') {
47
+ node.innerHTML = file.title || file.displayName;
48
+ }
49
+ });
50
+ }
51
+ }
52
+ FileDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
53
+ FileDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: FileDirective, selector: "[scFile]", inputs: { field: ["scFile", "field"] }, usesOnChanges: true, ngImport: i0 });
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileDirective, decorators: [{
55
+ type: Directive,
56
+ args: [{ selector: '[scFile]' }]
57
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { field: [{
58
+ type: Input,
59
+ args: ['scFile']
60
60
  }] } });
61
61
 
62
- class ImageDirective {
63
- constructor(viewContainer, templateRef, renderer, elementRef) {
64
- this.viewContainer = viewContainer;
65
- this.templateRef = templateRef;
66
- this.renderer = renderer;
67
- this.elementRef = elementRef;
68
- this.editable = true;
69
- this.urlParams = {};
70
- this.attrs = {};
71
- this.inlineRef = null;
72
- }
73
- ngOnChanges(changes) {
74
- if (changes.field || changes.editable || changes.urlParams || changes.attrs) {
75
- this.viewContainer.clear();
76
- if (this.inlineRef) {
77
- this.inlineRef.remove();
78
- this.inlineRef = null;
79
- }
80
- this.updateView();
81
- }
82
- }
83
- updateView() {
84
- const overrideAttrs = Object.assign(Object.assign({}, this.getElementAttrs()), this.attrs);
85
- const media = this.field;
86
- if (!media || (!media.editable && !media.value && !media.src)) {
87
- return;
88
- }
89
- let attrs = {};
90
- // we likely have an experience editor value, should be a string
91
- if (this.editable && media.editable) {
92
- const foundImg = mediaApi.findEditorImageTag(media.editable);
93
- if (!foundImg) {
94
- return this.renderInlineWrapper(media.editable);
95
- }
96
- attrs = this.getImageAttrs(foundImg.attrs, overrideAttrs, this.urlParams);
97
- if (!attrs) {
98
- return this.renderInlineWrapper(media.editable);
99
- }
100
- const tempImg = this.renderer.createElement('img');
101
- Object.entries(attrs).forEach(([key, attrValue]) => tempImg.setAttribute(key, attrValue));
102
- const editableMarkup = media.editable.replace(foundImg.imgTag, tempImg.outerHTML);
103
- return this.renderInlineWrapper(editableMarkup);
104
- }
105
- // some wise-guy/gal is passing in a 'raw' image object value
106
- const img = media.src ? media : media.value;
107
- if (!img) {
108
- return null;
109
- }
110
- attrs = this.getImageAttrs(img, overrideAttrs, this.urlParams);
111
- if (attrs) {
112
- this.renderTemplate(attrs);
113
- }
114
- }
115
- getImageAttrs(fieldAttrs, parsedAttrs, imageParams) {
116
- const combinedAttrs = Object.assign(Object.assign({}, fieldAttrs), parsedAttrs);
117
- // eslint-disable-next-line prefer-const
118
- let { src, srcSet } = combinedAttrs, otherAttrs = __rest(combinedAttrs, ["src", "srcSet"]);
119
- if (!src) {
120
- return null;
121
- }
122
- const newAttrs = Object.assign({}, otherAttrs);
123
- // update image URL for jss handler and image rendering params
124
- src = mediaApi.updateImageUrl(src, imageParams, this.mediaUrlPrefix);
125
- if (srcSet) {
126
- // replace with HTML-formatted srcset, including updated image URLs
127
- newAttrs.srcSet = mediaApi.getSrcSet(src, srcSet, imageParams, this.mediaUrlPrefix);
128
- }
129
- else {
130
- newAttrs.src = src;
131
- }
132
- return newAttrs;
133
- }
134
- renderTemplate(imageProps) {
135
- const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
136
- viewRef.rootNodes.forEach((node) => {
137
- Object.entries(imageProps).forEach(([key, imgPropVal]) => this.renderer.setAttribute(node, key, imgPropVal));
138
- });
139
- }
140
- getElementAttrs() {
141
- const view = this.templateRef.createEmbeddedView(null);
142
- const element = view.rootNodes[0];
143
- if (!element) {
144
- view.destroy();
145
- return {};
146
- }
147
- const attrs = {};
148
- for (let i = 0; i < element.attributes.length; i++) {
149
- const attr = element.attributes.item(i);
150
- if (attr) {
151
- attrs[attr.name] = attr.value;
152
- }
153
- }
154
- view.destroy();
155
- return attrs;
156
- }
157
- renderInlineWrapper(editable) {
158
- const span = this.renderer.createElement('span');
159
- span.className = 'sc-image-wrapper';
160
- span.innerHTML = editable;
161
- const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
162
- this.renderer.insertBefore(parentNode, span, this.elementRef.nativeElement);
163
- parentNode.removeChild(this.elementRef.nativeElement);
164
- this.inlineRef = span;
165
- }
166
- }
167
- ImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ImageDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
168
- ImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: ImageDirective, selector: "[scImage]", inputs: { field: ["scImage", "field"], editable: ["scImageEditable", "editable"], mediaUrlPrefix: ["scImageMediaUrlPrefix", "mediaUrlPrefix"], urlParams: ["scImageUrlParams", "urlParams"], attrs: ["scImageAttrs", "attrs"] }, usesOnChanges: true, ngImport: i0 });
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ImageDirective, decorators: [{
170
- type: Directive,
171
- args: [{ selector: '[scImage]' }]
172
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { field: [{
173
- type: Input,
174
- args: ['scImage']
175
- }], editable: [{
176
- type: Input,
177
- args: ['scImageEditable']
178
- }], mediaUrlPrefix: [{
179
- type: Input,
180
- args: ['scImageMediaUrlPrefix']
181
- }], urlParams: [{
182
- type: Input,
183
- args: ['scImageUrlParams']
184
- }], attrs: [{
185
- type: Input,
186
- args: ['scImageAttrs']
62
+ class ImageDirective {
63
+ constructor(viewContainer, templateRef, renderer, elementRef) {
64
+ this.viewContainer = viewContainer;
65
+ this.templateRef = templateRef;
66
+ this.renderer = renderer;
67
+ this.elementRef = elementRef;
68
+ this.editable = true;
69
+ this.urlParams = {};
70
+ this.attrs = {};
71
+ this.inlineRef = null;
72
+ }
73
+ ngOnChanges(changes) {
74
+ if (changes.field || changes.editable || changes.urlParams || changes.attrs) {
75
+ this.viewContainer.clear();
76
+ if (this.inlineRef) {
77
+ this.inlineRef.remove();
78
+ this.inlineRef = null;
79
+ }
80
+ this.updateView();
81
+ }
82
+ }
83
+ updateView() {
84
+ const overrideAttrs = Object.assign(Object.assign({}, this.getElementAttrs()), this.attrs);
85
+ const media = this.field;
86
+ if (!media || (!media.editable && !media.value && !media.src)) {
87
+ return;
88
+ }
89
+ let attrs = {};
90
+ // we likely have an experience editor value, should be a string
91
+ if (this.editable && media.editable) {
92
+ const foundImg = mediaApi.findEditorImageTag(media.editable);
93
+ if (!foundImg) {
94
+ return this.renderInlineWrapper(media.editable);
95
+ }
96
+ attrs = this.getImageAttrs(foundImg.attrs, overrideAttrs, this.urlParams);
97
+ if (!attrs) {
98
+ return this.renderInlineWrapper(media.editable);
99
+ }
100
+ const tempImg = this.renderer.createElement('img');
101
+ Object.entries(attrs).forEach(([key, attrValue]) => tempImg.setAttribute(key, attrValue));
102
+ const editableMarkup = media.editable.replace(foundImg.imgTag, tempImg.outerHTML);
103
+ return this.renderInlineWrapper(editableMarkup);
104
+ }
105
+ // some wise-guy/gal is passing in a 'raw' image object value
106
+ const img = media.src ? media : media.value;
107
+ if (!img) {
108
+ return null;
109
+ }
110
+ attrs = this.getImageAttrs(img, overrideAttrs, this.urlParams);
111
+ if (attrs) {
112
+ this.renderTemplate(attrs);
113
+ }
114
+ }
115
+ getImageAttrs(fieldAttrs, parsedAttrs, imageParams) {
116
+ const combinedAttrs = Object.assign(Object.assign({}, fieldAttrs), parsedAttrs);
117
+ // eslint-disable-next-line prefer-const
118
+ let { src, srcSet } = combinedAttrs, otherAttrs = __rest(combinedAttrs, ["src", "srcSet"]);
119
+ if (!src) {
120
+ return null;
121
+ }
122
+ const newAttrs = Object.assign({}, otherAttrs);
123
+ // update image URL for jss handler and image rendering params
124
+ src = mediaApi.updateImageUrl(src, imageParams, this.mediaUrlPrefix);
125
+ if (srcSet) {
126
+ // replace with HTML-formatted srcset, including updated image URLs
127
+ newAttrs.srcSet = mediaApi.getSrcSet(src, srcSet, imageParams, this.mediaUrlPrefix);
128
+ }
129
+ else {
130
+ newAttrs.src = src;
131
+ }
132
+ return newAttrs;
133
+ }
134
+ renderTemplate(imageProps) {
135
+ const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
136
+ viewRef.rootNodes.forEach((node) => {
137
+ Object.entries(imageProps).forEach(([key, imgPropVal]) => this.renderer.setAttribute(node, key, imgPropVal));
138
+ });
139
+ }
140
+ getElementAttrs() {
141
+ const view = this.templateRef.createEmbeddedView(null);
142
+ const element = view.rootNodes[0];
143
+ if (!element) {
144
+ view.destroy();
145
+ return {};
146
+ }
147
+ const attrs = {};
148
+ for (let i = 0; i < element.attributes.length; i++) {
149
+ const attr = element.attributes.item(i);
150
+ if (attr) {
151
+ attrs[attr.name] = attr.value;
152
+ }
153
+ }
154
+ view.destroy();
155
+ return attrs;
156
+ }
157
+ renderInlineWrapper(editable) {
158
+ const span = this.renderer.createElement('span');
159
+ span.className = 'sc-image-wrapper';
160
+ span.innerHTML = editable;
161
+ const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
162
+ this.renderer.insertBefore(parentNode, span, this.elementRef.nativeElement);
163
+ parentNode.removeChild(this.elementRef.nativeElement);
164
+ this.inlineRef = span;
165
+ }
166
+ }
167
+ ImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ImageDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
168
+ ImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: ImageDirective, selector: "[scImage]", inputs: { field: ["scImage", "field"], editable: ["scImageEditable", "editable"], mediaUrlPrefix: ["scImageMediaUrlPrefix", "mediaUrlPrefix"], urlParams: ["scImageUrlParams", "urlParams"], attrs: ["scImageAttrs", "attrs"] }, usesOnChanges: true, ngImport: i0 });
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ImageDirective, decorators: [{
170
+ type: Directive,
171
+ args: [{ selector: '[scImage]' }]
172
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { field: [{
173
+ type: Input,
174
+ args: ['scImage']
175
+ }], editable: [{
176
+ type: Input,
177
+ args: ['scImageEditable']
178
+ }], mediaUrlPrefix: [{
179
+ type: Input,
180
+ args: ['scImageMediaUrlPrefix']
181
+ }], urlParams: [{
182
+ type: Input,
183
+ args: ['scImageUrlParams']
184
+ }], attrs: [{
185
+ type: Input,
186
+ args: ['scImageAttrs']
187
187
  }] } });
188
188
 
189
- class LinkDirective {
190
- constructor(viewContainer, templateRef, renderer, elementRef) {
191
- this.viewContainer = viewContainer;
192
- this.templateRef = templateRef;
193
- this.renderer = renderer;
194
- this.elementRef = elementRef;
195
- this.editable = true;
196
- this.attrs = {};
197
- this.inlineRef = null;
198
- }
199
- ngOnChanges(changes) {
200
- if (changes.field || changes.editable || changes.attrs) {
201
- this.viewContainer.clear();
202
- if (this.inlineRef) {
203
- this.inlineRef.remove();
204
- this.inlineRef = null;
205
- }
206
- this.updateView();
207
- }
208
- }
209
- renderTemplate(props, linkText) {
210
- const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
211
- viewRef.rootNodes.forEach((node) => {
212
- Object.entries(props).forEach(([key, propValue]) => {
213
- this.updateAttribute(node, key, propValue);
214
- });
215
- if (node.childNodes && node.childNodes.length === 0 && linkText) {
216
- node.textContent = linkText;
217
- }
218
- });
219
- }
220
- updateAttribute(node, key, propValue) {
221
- if (typeof propValue !== 'string' || !propValue || propValue === '') {
222
- return;
223
- }
224
- if (key === 'href') {
225
- const isInvalidLink = !propValue || /^https?:\/\/$/.test(propValue);
226
- if (isInvalidLink) {
227
- if (!node.href) {
228
- return;
229
- }
230
- propValue = node.href;
231
- }
232
- this.renderer.setAttribute(node, key, propValue);
233
- }
234
- else if (key === 'class' && node.className !== '') {
235
- this.renderer.setAttribute(node, key, `${node.className} ${propValue}`);
236
- }
237
- else {
238
- this.renderer.setAttribute(node, key, propValue);
239
- }
240
- }
241
- updateView() {
242
- var _a, _b;
243
- const field = this.field;
244
- if (this.editable && field && field.editableFirstPart && field.editableLastPart) {
245
- this.renderInlineWrapper(field.editableFirstPart, field.editableLastPart);
246
- }
247
- else if (field && (field.href || field.value)) {
248
- const props = field.href ? field : field.value;
249
- const linkText = field.text || ((_a = field.value) === null || _a === void 0 ? void 0 : _a.text) || field.href || ((_b = field.value) === null || _b === void 0 ? void 0 : _b.href);
250
- const anchor = (props === null || props === void 0 ? void 0 : props.anchor) ? `#${props.anchor}` : '';
251
- const href = `${props === null || props === void 0 ? void 0 : props.href}${anchor}`;
252
- const mergedAttrs = Object.assign(Object.assign(Object.assign({}, props), this.attrs), { href });
253
- delete mergedAttrs.anchor;
254
- this.renderTemplate(mergedAttrs, linkText);
255
- }
256
- }
257
- renderInlineWrapper(editableFirstPart, editableLastPart) {
258
- const span = this.renderer.createElement('span');
259
- span.className = 'sc-link-wrapper';
260
- span.innerHTML = editableFirstPart + editableLastPart;
261
- // assign attributes from template to inline wrapper
262
- const attrs = Object.assign(Object.assign({}, this.getElementAttrs()), this.attrs);
263
- Object.entries(attrs).forEach(([key, attrValue]) => this.updateAttribute(span, key, attrValue));
264
- this.viewContainer.createEmbeddedView(this.templateRef);
265
- const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
266
- this.renderer.insertBefore(parentNode, span, this.elementRef.nativeElement);
267
- this.inlineRef = span;
268
- }
269
- getElementAttrs() {
270
- const view = this.templateRef.createEmbeddedView(null);
271
- const element = view.rootNodes[0];
272
- if (!element) {
273
- view.destroy();
274
- return {};
275
- }
276
- const attrs = {};
277
- for (let i = 0; i < element.attributes.length; i++) {
278
- const attr = element.attributes.item(i);
279
- if (attr) {
280
- attrs[attr.name] = attr.value;
281
- }
282
- }
283
- view.destroy();
284
- return attrs;
285
- }
286
- }
287
- LinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
288
- LinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: LinkDirective, selector: "[scLink]", inputs: { editable: ["scLinkEditable", "editable"], attrs: ["scLinkAttrs", "attrs"], field: ["scLink", "field"] }, usesOnChanges: true, ngImport: i0 });
289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LinkDirective, decorators: [{
290
- type: Directive,
291
- args: [{ selector: '[scLink]' }]
292
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { editable: [{
293
- type: Input,
294
- args: ['scLinkEditable']
295
- }], attrs: [{
296
- type: Input,
297
- args: ['scLinkAttrs']
298
- }], field: [{
299
- type: Input,
300
- args: ['scLink']
189
+ class LinkDirective {
190
+ constructor(viewContainer, templateRef, renderer, elementRef) {
191
+ this.viewContainer = viewContainer;
192
+ this.templateRef = templateRef;
193
+ this.renderer = renderer;
194
+ this.elementRef = elementRef;
195
+ this.editable = true;
196
+ this.attrs = {};
197
+ this.inlineRef = null;
198
+ }
199
+ ngOnChanges(changes) {
200
+ if (changes.field || changes.editable || changes.attrs) {
201
+ this.viewContainer.clear();
202
+ if (this.inlineRef) {
203
+ this.inlineRef.remove();
204
+ this.inlineRef = null;
205
+ }
206
+ this.updateView();
207
+ }
208
+ }
209
+ renderTemplate(props, linkText) {
210
+ const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
211
+ viewRef.rootNodes.forEach((node) => {
212
+ Object.entries(props).forEach(([key, propValue]) => {
213
+ this.updateAttribute(node, key, propValue);
214
+ });
215
+ if (node.childNodes && node.childNodes.length === 0 && linkText) {
216
+ node.textContent = linkText;
217
+ }
218
+ });
219
+ }
220
+ updateAttribute(node, key, propValue) {
221
+ if (typeof propValue !== 'string' || !propValue || propValue === '') {
222
+ return;
223
+ }
224
+ if (key === 'href') {
225
+ const isInvalidLink = !propValue || /^https?:\/\/$/.test(propValue);
226
+ if (isInvalidLink) {
227
+ if (!node.href) {
228
+ return;
229
+ }
230
+ propValue = node.href;
231
+ }
232
+ this.renderer.setAttribute(node, key, propValue);
233
+ }
234
+ else if (key === 'class' && node.className !== '') {
235
+ this.renderer.setAttribute(node, key, `${node.className} ${propValue}`);
236
+ }
237
+ else {
238
+ this.renderer.setAttribute(node, key, propValue);
239
+ }
240
+ }
241
+ updateView() {
242
+ var _a, _b;
243
+ const field = this.field;
244
+ if (this.editable && field && field.editableFirstPart && field.editableLastPart) {
245
+ this.renderInlineWrapper(field.editableFirstPart, field.editableLastPart);
246
+ }
247
+ else if (field && (field.href || field.value)) {
248
+ const props = field.href ? field : field.value;
249
+ const linkText = field.text || ((_a = field.value) === null || _a === void 0 ? void 0 : _a.text) || field.href || ((_b = field.value) === null || _b === void 0 ? void 0 : _b.href);
250
+ const anchor = (props === null || props === void 0 ? void 0 : props.anchor) ? `#${props.anchor}` : '';
251
+ const href = `${props === null || props === void 0 ? void 0 : props.href}${anchor}`;
252
+ const mergedAttrs = Object.assign(Object.assign(Object.assign({}, props), this.attrs), { href });
253
+ delete mergedAttrs.anchor;
254
+ this.renderTemplate(mergedAttrs, linkText);
255
+ }
256
+ }
257
+ renderInlineWrapper(editableFirstPart, editableLastPart) {
258
+ const span = this.renderer.createElement('span');
259
+ span.className = 'sc-link-wrapper';
260
+ span.innerHTML = editableFirstPart + editableLastPart;
261
+ // assign attributes from template to inline wrapper
262
+ const attrs = Object.assign(Object.assign({}, this.getElementAttrs()), this.attrs);
263
+ Object.entries(attrs).forEach(([key, attrValue]) => this.updateAttribute(span, key, attrValue));
264
+ this.viewContainer.createEmbeddedView(this.templateRef);
265
+ const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
266
+ this.renderer.insertBefore(parentNode, span, this.elementRef.nativeElement);
267
+ this.inlineRef = span;
268
+ }
269
+ getElementAttrs() {
270
+ const view = this.templateRef.createEmbeddedView(null);
271
+ const element = view.rootNodes[0];
272
+ if (!element) {
273
+ view.destroy();
274
+ return {};
275
+ }
276
+ const attrs = {};
277
+ for (let i = 0; i < element.attributes.length; i++) {
278
+ const attr = element.attributes.item(i);
279
+ if (attr) {
280
+ attrs[attr.name] = attr.value;
281
+ }
282
+ }
283
+ view.destroy();
284
+ return attrs;
285
+ }
286
+ }
287
+ LinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
288
+ LinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: LinkDirective, selector: "[scLink]", inputs: { editable: ["scLinkEditable", "editable"], attrs: ["scLinkAttrs", "attrs"], field: ["scLink", "field"] }, usesOnChanges: true, ngImport: i0 });
289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LinkDirective, decorators: [{
290
+ type: Directive,
291
+ args: [{ selector: '[scLink]' }]
292
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { editable: [{
293
+ type: Input,
294
+ args: ['scLinkEditable']
295
+ }], attrs: [{
296
+ type: Input,
297
+ args: ['scLinkAttrs']
298
+ }], field: [{
299
+ type: Input,
300
+ args: ['scLink']
301
301
  }] } });
302
302
 
303
- class RouterLinkDirective extends LinkDirective {
304
- constructor(viewContainer, templateRef, renderer, elementRef, router) {
305
- super(viewContainer, templateRef, renderer, elementRef);
306
- this.router = router;
307
- this.editable = true;
308
- this.attrs = {};
309
- }
310
- renderTemplate(props, linkText) {
311
- const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
312
- viewRef.rootNodes.forEach((node) => {
313
- Object.entries(props).forEach(([key, propValue]) => {
314
- this.updateAttribute(node, key, propValue);
315
- if (key === 'href') {
316
- this.renderer.listen(node, 'click', (event) => {
317
- this.router.navigateByUrl(propValue);
318
- // shouldn't prevent default if the link includes a fragment
319
- if (!propValue.includes('#')) {
320
- event.preventDefault();
321
- }
322
- });
323
- }
324
- });
325
- if (node.childNodes && node.childNodes.length === 0 && linkText) {
326
- node.textContent = linkText;
327
- }
328
- });
329
- }
330
- }
331
- RouterLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterLinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
332
- RouterLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RouterLinkDirective, selector: "[scRouterLink]", inputs: { editable: ["scRouterLinkEditable", "editable"], attrs: ["scRouterLinkAttrs", "attrs"], field: ["scRouterLink", "field"] }, usesInheritance: true, ngImport: i0 });
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterLinkDirective, decorators: [{
334
- type: Directive,
335
- args: [{ selector: '[scRouterLink]' }]
336
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.Router }]; }, propDecorators: { editable: [{
337
- type: Input,
338
- args: ['scRouterLinkEditable']
339
- }], attrs: [{
340
- type: Input,
341
- args: ['scRouterLinkAttrs']
342
- }], field: [{
343
- type: Input,
344
- args: ['scRouterLink']
303
+ class RouterLinkDirective extends LinkDirective {
304
+ constructor(viewContainer, templateRef, renderer, elementRef, router) {
305
+ super(viewContainer, templateRef, renderer, elementRef);
306
+ this.router = router;
307
+ this.editable = true;
308
+ this.attrs = {};
309
+ }
310
+ renderTemplate(props, linkText) {
311
+ const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
312
+ viewRef.rootNodes.forEach((node) => {
313
+ Object.entries(props).forEach(([key, propValue]) => {
314
+ this.updateAttribute(node, key, propValue);
315
+ if (key === 'href') {
316
+ this.renderer.listen(node, 'click', (event) => {
317
+ this.router.navigateByUrl(propValue);
318
+ // shouldn't prevent default if the link includes a fragment
319
+ if (!propValue.includes('#')) {
320
+ event.preventDefault();
321
+ }
322
+ });
323
+ }
324
+ });
325
+ if (node.childNodes && node.childNodes.length === 0 && linkText) {
326
+ node.textContent = linkText;
327
+ }
328
+ });
329
+ }
330
+ }
331
+ RouterLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterLinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
332
+ RouterLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RouterLinkDirective, selector: "[scRouterLink]", inputs: { editable: ["scRouterLinkEditable", "editable"], attrs: ["scRouterLinkAttrs", "attrs"], field: ["scRouterLink", "field"] }, usesInheritance: true, ngImport: i0 });
333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RouterLinkDirective, decorators: [{
334
+ type: Directive,
335
+ args: [{ selector: '[scRouterLink]' }]
336
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.Router }]; }, propDecorators: { editable: [{
337
+ type: Input,
338
+ args: ['scRouterLinkEditable']
339
+ }], attrs: [{
340
+ type: Input,
341
+ args: ['scRouterLinkAttrs']
342
+ }], field: [{
343
+ type: Input,
344
+ args: ['scRouterLink']
345
345
  }] } });
346
346
 
347
- class GenericLinkDirective extends LinkDirective {
348
- constructor(viewContainer, templateRef, renderer, elementRef, router) {
349
- super(viewContainer, templateRef, renderer, elementRef);
350
- this.router = router;
351
- this.editable = true;
352
- this.attrs = {};
353
- }
354
- renderTemplate(props, linkText) {
355
- const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
356
- viewRef.rootNodes.forEach((node) => {
357
- Object.entries(props).forEach(([key, propValue]) => {
358
- if (key === 'href' && !isAbsoluteUrl(propValue)) {
359
- const fragments = propValue.split('#');
360
- const url = fragments[0];
361
- const anchor = fragments[1];
362
- const urlTree = this.router.createUrlTree([url], Object.assign({ fragment: anchor }, this.extras));
363
- this.updateAttribute(node, key, this.router.serializeUrl(urlTree));
364
- this.renderer.listen(node, 'click', (event) => {
365
- this.router.navigate([url], Object.assign({ fragment: anchor }, this.extras));
366
- // shouldn't prevent default if the link includes a fragment
367
- if (!anchor) {
368
- event.preventDefault();
369
- }
370
- });
371
- }
372
- else {
373
- this.updateAttribute(node, key, propValue);
374
- }
375
- });
376
- if (node.childNodes && node.childNodes.length === 0 && linkText) {
377
- node.textContent = linkText;
378
- }
379
- });
380
- }
381
- }
382
- GenericLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GenericLinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
383
- GenericLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: GenericLinkDirective, selector: "[scGenericLink]", inputs: { editable: ["scGenericLinkEditable", "editable"], attrs: ["scGenericLinkAttrs", "attrs"], field: ["scGenericLink", "field"], extras: ["scGenericLinkExtras", "extras"] }, usesInheritance: true, ngImport: i0 });
384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GenericLinkDirective, decorators: [{
385
- type: Directive,
386
- args: [{ selector: '[scGenericLink]' }]
387
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.Router }]; }, propDecorators: { editable: [{
388
- type: Input,
389
- args: ['scGenericLinkEditable']
390
- }], attrs: [{
391
- type: Input,
392
- args: ['scGenericLinkAttrs']
393
- }], field: [{
394
- type: Input,
395
- args: ['scGenericLink']
396
- }], extras: [{
397
- type: Input,
398
- args: ['scGenericLinkExtras']
347
+ class GenericLinkDirective extends LinkDirective {
348
+ constructor(viewContainer, templateRef, renderer, elementRef, router) {
349
+ super(viewContainer, templateRef, renderer, elementRef);
350
+ this.router = router;
351
+ this.editable = true;
352
+ this.attrs = {};
353
+ }
354
+ renderTemplate(props, linkText) {
355
+ const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
356
+ viewRef.rootNodes.forEach((node) => {
357
+ Object.entries(props).forEach(([key, propValue]) => {
358
+ if (key === 'href' && !isAbsoluteUrl(propValue)) {
359
+ const fragments = propValue.split('#');
360
+ const url = fragments[0];
361
+ const anchor = fragments[1];
362
+ const urlTree = this.router.createUrlTree([url], Object.assign({ fragment: anchor }, this.extras));
363
+ this.updateAttribute(node, key, this.router.serializeUrl(urlTree));
364
+ this.renderer.listen(node, 'click', (event) => {
365
+ this.router.navigate([url], Object.assign({ fragment: anchor }, this.extras));
366
+ // shouldn't prevent default if the link includes a fragment
367
+ if (!anchor) {
368
+ event.preventDefault();
369
+ }
370
+ });
371
+ }
372
+ else {
373
+ this.updateAttribute(node, key, propValue);
374
+ }
375
+ });
376
+ if (node.childNodes && node.childNodes.length === 0 && linkText) {
377
+ node.textContent = linkText;
378
+ }
379
+ });
380
+ }
381
+ }
382
+ GenericLinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GenericLinkDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
383
+ GenericLinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: GenericLinkDirective, selector: "[scGenericLink]", inputs: { editable: ["scGenericLinkEditable", "editable"], attrs: ["scGenericLinkAttrs", "attrs"], field: ["scGenericLink", "field"], extras: ["scGenericLinkExtras", "extras"] }, usesInheritance: true, ngImport: i0 });
384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GenericLinkDirective, decorators: [{
385
+ type: Directive,
386
+ args: [{ selector: '[scGenericLink]' }]
387
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.Router }]; }, propDecorators: { editable: [{
388
+ type: Input,
389
+ args: ['scGenericLinkEditable']
390
+ }], attrs: [{
391
+ type: Input,
392
+ args: ['scGenericLinkAttrs']
393
+ }], field: [{
394
+ type: Input,
395
+ args: ['scGenericLink']
396
+ }], extras: [{
397
+ type: Input,
398
+ args: ['scGenericLinkExtras']
399
399
  }] } });
400
400
 
401
- class HiddenRenderingComponent {
402
- get style() {
403
- return 'background-image: linear-gradient(45deg, #ffffff 25%, #dcdcdc 25%, #dcdcdc 50%, #ffffff 50%, #ffffff 75%, #dcdcdc 75%, #dcdcdc 100%); background-size: 3px 3px; display: block; height: 100px;';
404
- }
405
- }
406
- HiddenRenderingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HiddenRenderingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
407
- HiddenRenderingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HiddenRenderingComponent, selector: "sc-hidden-rendering", host: { properties: { "style": "this.style" } }, ngImport: i0, template: '', isInline: true });
408
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HiddenRenderingComponent, decorators: [{
409
- type: Component,
410
- args: [{
411
- selector: 'sc-hidden-rendering',
412
- template: '',
413
- }]
414
- }], propDecorators: { style: [{
415
- type: HostBinding,
416
- args: ['style']
417
- }] } });
401
+ class HiddenRenderingComponent {
402
+ get style() {
403
+ return 'background-image: linear-gradient(45deg, #ffffff 25%, #dcdcdc 25%, #dcdcdc 50%, #ffffff 50%, #ffffff 75%, #dcdcdc 75%, #dcdcdc 100%); background-size: 3px 3px; display: block; height: 100px;';
404
+ }
405
+ }
406
+ HiddenRenderingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HiddenRenderingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
407
+ HiddenRenderingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HiddenRenderingComponent, selector: "sc-hidden-rendering", host: { properties: { "style": "this.style" } }, ngImport: i0, template: '', isInline: true });
408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HiddenRenderingComponent, decorators: [{
409
+ type: Component,
410
+ args: [{
411
+ selector: 'sc-hidden-rendering',
412
+ template: '',
413
+ }]
414
+ }], propDecorators: { style: [{
415
+ type: HostBinding,
416
+ args: ['style']
417
+ }] } });
418
418
  const HIDDEN_RENDERING_NAME = 'Hidden Rendering';
419
419
 
420
- class PlaceholderLoadingDirective {
421
- constructor(templateRef) {
422
- this.templateRef = templateRef;
423
- }
424
- }
425
- PlaceholderLoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderLoadingDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
426
- PlaceholderLoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: PlaceholderLoadingDirective, selector: "[scPlaceholderLoading]", ngImport: i0 });
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderLoadingDirective, decorators: [{
428
- type: Directive,
429
- args: [{
430
- selector: '[scPlaceholderLoading]',
431
- }]
420
+ class PlaceholderLoadingDirective {
421
+ constructor(templateRef) {
422
+ this.templateRef = templateRef;
423
+ }
424
+ }
425
+ PlaceholderLoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderLoadingDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
426
+ PlaceholderLoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: PlaceholderLoadingDirective, selector: "[scPlaceholderLoading]", ngImport: i0 });
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderLoadingDirective, decorators: [{
428
+ type: Directive,
429
+ args: [{
430
+ selector: '[scPlaceholderLoading]',
431
+ }]
432
432
  }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
433
433
 
434
- /** Registers a statically loaded component */
435
- class ComponentNameAndType {
436
- }
437
- /**
438
- * @param {unknown} object
439
- */
440
- function instanceOfComponentNameAndType(object) {
441
- return typeof object === 'object' && object !== null && 'type' in object;
442
- }
443
- /**
444
- * @param {unknown} object
445
- */
446
- function instanceOfComponentNameAndModule(object) {
447
- return typeof object === 'object' && object !== null && 'module' in object;
448
- }
449
- const PLACEHOLDER_COMPONENTS = new InjectionToken('Sc.placeholder.components');
450
- const PLACEHOLDER_LAZY_COMPONENTS = new InjectionToken('Sc.placeholder.lazyComponents');
451
- const PLACEHOLDER_MISSING_COMPONENT_COMPONENT = new InjectionToken('Sc.placeholder.missingComponentComponent');
452
- const PLACEHOLDER_HIDDEN_RENDERING_COMPONENT = new InjectionToken('Sc.placeholder.hiddenRenderingComponent');
453
- const DYNAMIC_COMPONENT = new InjectionToken('Sc.placeholder.dynamicComponent');
454
- const GUARD_RESOLVER = new InjectionToken('Sc.placeholder.guardResolver');
434
+ /** Registers a statically loaded component */
435
+ class ComponentNameAndType {
436
+ }
437
+ /**
438
+ * @param {unknown} object
439
+ */
440
+ function instanceOfComponentNameAndType(object) {
441
+ return typeof object === 'object' && object !== null && 'type' in object;
442
+ }
443
+ /**
444
+ * @param {unknown} object
445
+ */
446
+ function instanceOfComponentNameAndModule(object) {
447
+ return typeof object === 'object' && object !== null && 'module' in object;
448
+ }
449
+ const PLACEHOLDER_COMPONENTS = new InjectionToken('Sc.placeholder.components');
450
+ const PLACEHOLDER_LAZY_COMPONENTS = new InjectionToken('Sc.placeholder.lazyComponents');
451
+ const PLACEHOLDER_MISSING_COMPONENT_COMPONENT = new InjectionToken('Sc.placeholder.missingComponentComponent');
452
+ const PLACEHOLDER_HIDDEN_RENDERING_COMPONENT = new InjectionToken('Sc.placeholder.hiddenRenderingComponent');
453
+ const DYNAMIC_COMPONENT = new InjectionToken('Sc.placeholder.dynamicComponent');
454
+ const GUARD_RESOLVER = new InjectionToken('Sc.placeholder.guardResolver');
455
455
  const DATA_RESOLVER = new InjectionToken('Sc.placeholder.dataResolver');
456
456
 
457
- class RenderEachDirective {
458
- constructor(templateRef) {
459
- this.templateRef = templateRef;
460
- }
461
- }
462
- RenderEachDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEachDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
463
- RenderEachDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RenderEachDirective, selector: "[renderEach]", ngImport: i0 });
464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEachDirective, decorators: [{
465
- type: Directive,
466
- args: [{
467
- selector: '[renderEach]',
468
- }]
457
+ class RenderEachDirective {
458
+ constructor(templateRef) {
459
+ this.templateRef = templateRef;
460
+ }
461
+ }
462
+ RenderEachDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEachDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
463
+ RenderEachDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RenderEachDirective, selector: "[renderEach]", ngImport: i0 });
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEachDirective, decorators: [{
465
+ type: Directive,
466
+ args: [{
467
+ selector: '[renderEach]',
468
+ }]
469
469
  }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
470
470
 
471
- class RenderEmptyDirective {
472
- constructor(templateRef) {
473
- this.templateRef = templateRef;
474
- }
475
- }
476
- RenderEmptyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEmptyDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
477
- RenderEmptyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RenderEmptyDirective, selector: "[renderEmpty]", ngImport: i0 });
478
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEmptyDirective, decorators: [{
479
- type: Directive,
480
- args: [{
481
- selector: '[renderEmpty]',
482
- }]
471
+ class RenderEmptyDirective {
472
+ constructor(templateRef) {
473
+ this.templateRef = templateRef;
474
+ }
475
+ }
476
+ RenderEmptyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEmptyDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
477
+ RenderEmptyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RenderEmptyDirective, selector: "[renderEmpty]", ngImport: i0 });
478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderEmptyDirective, decorators: [{
479
+ type: Directive,
480
+ args: [{
481
+ selector: '[renderEmpty]',
482
+ }]
483
483
  }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
484
484
 
485
- /**
486
- * @param {HtmlElementRendering | ComponentRendering} rendering
487
- */
488
- function isRawRendering(rendering) {
489
- return (!rendering.componentName &&
490
- rendering.name !== undefined);
485
+ /**
486
+ * @param {HtmlElementRendering | ComponentRendering} rendering
487
+ */
488
+ function isRawRendering(rendering) {
489
+ return (!rendering.componentName &&
490
+ rendering.name !== undefined);
491
491
  }
492
492
 
493
- class RawComponent {
494
- constructor(renderer, elementRef) {
495
- this.renderer = renderer;
496
- this.elementRef = elementRef;
497
- }
498
- ngOnInit() {
499
- const el = this.renderer.createElement(this.rendering.name);
500
- const contents = this.renderer.createText(this.rendering.contents || '');
501
- const attributes = this.rendering.attributes;
502
- for (const attr in attributes) {
503
- // eslint-disable-next-line no-prototype-builtins
504
- if (attributes.hasOwnProperty(attr)) {
505
- const value = attributes[attr];
506
- this.renderer.setAttribute(el, attr, value || '');
507
- }
508
- }
509
- this.renderer.appendChild(el, contents);
510
- const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
511
- this.renderer.insertBefore(parentNode, el, this.elementRef.nativeElement);
512
- parentNode.removeChild(this.elementRef.nativeElement);
513
- }
514
- }
515
- RawComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RawComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
516
- RawComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RawComponent, selector: "sc-raw", inputs: { rendering: "rendering" }, ngImport: i0, template: '', isInline: true });
517
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RawComponent, decorators: [{
518
- type: Component,
519
- args: [{
520
- selector: 'sc-raw',
521
- template: '',
522
- }]
523
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { rendering: [{
524
- type: Input
493
+ class RawComponent {
494
+ constructor(renderer, elementRef) {
495
+ this.renderer = renderer;
496
+ this.elementRef = elementRef;
497
+ }
498
+ ngOnInit() {
499
+ const el = this.renderer.createElement(this.rendering.name);
500
+ const contents = this.renderer.createText(this.rendering.contents || '');
501
+ const attributes = this.rendering.attributes;
502
+ for (const attr in attributes) {
503
+ // eslint-disable-next-line no-prototype-builtins
504
+ if (attributes.hasOwnProperty(attr)) {
505
+ const value = attributes[attr];
506
+ this.renderer.setAttribute(el, attr, value || '');
507
+ }
508
+ }
509
+ this.renderer.appendChild(el, contents);
510
+ const parentNode = this.renderer.parentNode(this.elementRef.nativeElement);
511
+ this.renderer.insertBefore(parentNode, el, this.elementRef.nativeElement);
512
+ parentNode.removeChild(this.elementRef.nativeElement);
513
+ }
514
+ }
515
+ RawComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RawComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
516
+ RawComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RawComponent, selector: "sc-raw", inputs: { rendering: "rendering" }, ngImport: i0, template: '', isInline: true });
517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RawComponent, decorators: [{
518
+ type: Component,
519
+ args: [{
520
+ selector: 'sc-raw',
521
+ template: '',
522
+ }]
523
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { rendering: [{
524
+ type: Input
525
525
  }] } });
526
526
 
527
- class JssComponentFactoryService {
528
- constructor(injector, components, lazyComponents) {
529
- this.injector = injector;
530
- this.components = components;
531
- this.lazyComponents = lazyComponents;
532
- this.componentMap = new Map();
533
- this.lazyComponentMap = new Map();
534
- this.components.forEach((c) => this.componentMap.set(c.name, c));
535
- if (this.lazyComponents) {
536
- this.lazyComponents.forEach((c) => this.lazyComponentMap.set(c.path, c));
537
- }
538
- }
539
- getComponent(component) {
540
- const loadedComponent = this.componentMap.get(component.componentName);
541
- if (loadedComponent) {
542
- return Promise.resolve({
543
- componentDefinition: component,
544
- componentImplementation: loadedComponent.type,
545
- canActivate: loadedComponent.canActivate,
546
- resolve: loadedComponent.resolve,
547
- });
548
- }
549
- const lazyComponent = this.lazyComponentMap.get(component.componentName);
550
- if (lazyComponent) {
551
- return lazyComponent.loadChildren().then((lazyChild) => {
552
- let componentType = null;
553
- const moduleRef = createNgModule(lazyChild, this.injector);
554
- const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT);
555
- if (!dynamicComponentType) {
556
- throw new Error(`JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?`);
557
- }
558
- if (component.componentName in dynamicComponentType) {
559
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
560
- componentType = dynamicComponentType[component.componentName];
561
- }
562
- else {
563
- if (typeof dynamicComponentType === 'function') {
564
- componentType = dynamicComponentType;
565
- }
566
- else {
567
- throw new Error(`JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?`);
568
- }
569
- }
570
- return {
571
- componentDefinition: component,
572
- componentImplementation: componentType,
573
- canActivate: lazyComponent.canActivate,
574
- resolve: lazyComponent.resolve,
575
- };
576
- });
577
- }
578
- return Promise.resolve({
579
- componentDefinition: component,
580
- });
581
- }
582
- getComponents(components) {
583
- // acquire all components and keep them in order while handling their potential async-ness
584
- return Promise.all(components.map((component) => isRawRendering(component) ? this.getRawComponent(component) : this.getComponent(component)));
585
- }
586
- getRawComponent(component) {
587
- return Promise.resolve({
588
- componentImplementation: RawComponent,
589
- componentDefinition: component,
590
- });
591
- }
592
- }
593
- JssComponentFactoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService, deps: [{ token: i0.Injector }, { token: PLACEHOLDER_COMPONENTS }, { token: PLACEHOLDER_LAZY_COMPONENTS }], target: i0.ɵɵFactoryTarget.Injectable });
594
- JssComponentFactoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService });
595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService, decorators: [{
596
- type: Injectable
597
- }], ctorParameters: function () {
598
- return [{ type: i0.Injector }, { type: undefined, decorators: [{
599
- type: Inject,
600
- args: [PLACEHOLDER_COMPONENTS]
601
- }] }, { type: undefined, decorators: [{
602
- type: Inject,
603
- args: [PLACEHOLDER_LAZY_COMPONENTS]
604
- }] }];
527
+ class JssComponentFactoryService {
528
+ constructor(injector, components, lazyComponents) {
529
+ this.injector = injector;
530
+ this.components = components;
531
+ this.lazyComponents = lazyComponents;
532
+ this.componentMap = new Map();
533
+ this.lazyComponentMap = new Map();
534
+ this.components.forEach((c) => this.componentMap.set(c.name, c));
535
+ if (this.lazyComponents) {
536
+ this.lazyComponents.forEach((c) => this.lazyComponentMap.set(c.path, c));
537
+ }
538
+ }
539
+ getComponent(component) {
540
+ const loadedComponent = this.componentMap.get(component.componentName);
541
+ if (loadedComponent) {
542
+ return Promise.resolve({
543
+ componentDefinition: component,
544
+ componentImplementation: loadedComponent.type,
545
+ canActivate: loadedComponent.canActivate,
546
+ resolve: loadedComponent.resolve,
547
+ });
548
+ }
549
+ const lazyComponent = this.lazyComponentMap.get(component.componentName);
550
+ if (lazyComponent) {
551
+ return lazyComponent.loadChildren().then((lazyChild) => {
552
+ let componentType = null;
553
+ const moduleRef = createNgModule(lazyChild, this.injector);
554
+ const dynamicComponentType = moduleRef.injector.get(DYNAMIC_COMPONENT);
555
+ if (!dynamicComponentType) {
556
+ throw new Error(`JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?`);
557
+ }
558
+ if (component.componentName in dynamicComponentType) {
559
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
560
+ componentType = dynamicComponentType[component.componentName];
561
+ }
562
+ else {
563
+ if (typeof dynamicComponentType === 'function') {
564
+ componentType = dynamicComponentType;
565
+ }
566
+ else {
567
+ throw new Error(`JssComponentFactoryService: Lazy load module for component "${lazyComponent.path}" missing DYNAMIC_COMPONENT provider. Missing JssModule.forChild()?`);
568
+ }
569
+ }
570
+ return {
571
+ componentDefinition: component,
572
+ componentImplementation: componentType,
573
+ canActivate: lazyComponent.canActivate,
574
+ resolve: lazyComponent.resolve,
575
+ };
576
+ });
577
+ }
578
+ return Promise.resolve({
579
+ componentDefinition: component,
580
+ });
581
+ }
582
+ getComponents(components) {
583
+ // acquire all components and keep them in order while handling their potential async-ness
584
+ return Promise.all(components.map((component) => isRawRendering(component) ? this.getRawComponent(component) : this.getComponent(component)));
585
+ }
586
+ getRawComponent(component) {
587
+ return Promise.resolve({
588
+ componentImplementation: RawComponent,
589
+ componentDefinition: component,
590
+ });
591
+ }
592
+ }
593
+ JssComponentFactoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService, deps: [{ token: i0.Injector }, { token: PLACEHOLDER_COMPONENTS }, { token: PLACEHOLDER_LAZY_COMPONENTS }], target: i0.ɵɵFactoryTarget.Injectable });
594
+ JssComponentFactoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService });
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssComponentFactoryService, decorators: [{
596
+ type: Injectable
597
+ }], ctorParameters: function () {
598
+ return [{ type: i0.Injector }, { type: undefined, decorators: [{
599
+ type: Inject,
600
+ args: [PLACEHOLDER_COMPONENTS]
601
+ }] }, { type: undefined, decorators: [{
602
+ type: Inject,
603
+ args: [PLACEHOLDER_LAZY_COMPONENTS]
604
+ }] }];
605
605
  } });
606
606
 
607
- /**
608
- * @param {ComponentRendering} rendering
609
- * @param {string} name
610
- */
611
- function getPlaceholder(rendering, name) {
612
- if (rendering && rendering.placeholders && Object.keys(rendering.placeholders).length > 0) {
613
- return rendering.placeholders[name];
614
- }
615
- return null;
616
- }
617
- class PlaceholderComponent {
618
- constructor(differs, componentFactory, changeDetectorRef, elementRef, renderer, router, missingComponentComponent, hiddenRenderingComponent, guardResolver, dataResolver,
619
- // eslint-disable-next-line @typescript-eslint/ban-types
620
- platformId) {
621
- this.differs = differs;
622
- this.componentFactory = componentFactory;
623
- this.changeDetectorRef = changeDetectorRef;
624
- this.elementRef = elementRef;
625
- this.renderer = renderer;
626
- this.router = router;
627
- this.missingComponentComponent = missingComponentComponent;
628
- this.hiddenRenderingComponent = hiddenRenderingComponent;
629
- this.guardResolver = guardResolver;
630
- this.dataResolver = dataResolver;
631
- this.platformId = platformId;
632
- this.clientOnly = false;
633
- this.loaded = new EventEmitter();
634
- this.isLoading = true;
635
- this._componentInstances = [];
636
- this.destroyed = false;
637
- this.parentStyleAttribute = '';
638
- }
639
- set inputs(value) {
640
- this._inputs = value;
641
- if (!this._differ && value) {
642
- this._differ = this.differs.find(value).create();
643
- }
644
- }
645
- ngOnInit() {
646
- // just to ensure the element exists
647
- const elem = this.elementRef.nativeElement;
648
- if (elem) {
649
- const attributes = elem.attributes;
650
- for (let i = 0; i < attributes.length; i++) {
651
- const attr = attributes.item(i);
652
- if (attr && attr.name.indexOf('_ngcontent') !== -1) {
653
- this.parentStyleAttribute = attr.name;
654
- }
655
- }
656
- }
657
- }
658
- ngOnDestroy() {
659
- this.destroyed = true;
660
- this._componentInstances = [];
661
- }
662
- ngOnChanges(changes) {
663
- if (changes.rendering || changes.renderings) {
664
- this._render();
665
- }
666
- }
667
- ngDoCheck() {
668
- if (!this._differ || !this._inputs || this._componentInstances.length === 0) {
669
- return;
670
- }
671
- const changes = this._differ.diff(this._inputs);
672
- if (!changes) {
673
- return;
674
- }
675
- const updates = {};
676
- changes.forEachRemovedItem((change) => (updates[change.key] = null));
677
- changes.forEachAddedItem((change) => (updates[change.key] = change.currentValue));
678
- changes.forEachChangedItem((change) => (updates[change.key] = change.currentValue));
679
- this._componentInstances.forEach((componentInstance) => this._setComponentInputs(componentInstance, updates));
680
- }
681
- _setComponentInputs(componentInstance, inputs) {
682
- Object.entries(inputs).forEach(([input, inputValue]) => (componentInstance[input] = inputValue));
683
- }
684
- _subscribeComponentOutputs(componentInstance, outputs) {
685
- Object.keys(outputs)
686
- .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable)
687
- .forEach((output) => componentInstance[output]
688
- .pipe(takeWhile(() => !this.destroyed))
689
- .subscribe(outputs[output]));
690
- }
691
- _render() {
692
- return __awaiter(this, void 0, void 0, function* () {
693
- if (this.clientOnly && isPlatformServer(this.platformId)) {
694
- return;
695
- }
696
- this._componentInstances = [];
697
- this.view.clear();
698
- if (!this.rendering && !this.renderings) {
699
- return;
700
- }
701
- if (!this.name && !this.renderings) {
702
- console.warn('Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.');
703
- this.isLoading = false;
704
- return;
705
- }
706
- const placeholder = this.renderings || getPlaceholder(this.rendering, this.name || '');
707
- if (!placeholder) {
708
- console.warn(`Placeholder '${this.name}' was not found in the current rendering data`, JSON.stringify(this.rendering, null, 2));
709
- this.isLoading = false;
710
- return;
711
- }
712
- // if the placeholder is empty (contains only raw renderings), then we may need to use the empty template if it's defined
713
- const placeholderIsEmpty = placeholder.every((rendering) => isRawRendering(rendering));
714
- if (this.renderEmptyTemplate && placeholderIsEmpty) {
715
- this.view.createEmbeddedView(this.renderEmptyTemplate.templateRef, {
716
- renderings: placeholder,
717
- });
718
- this.isLoading = false;
719
- }
720
- else {
721
- const factories = yield this.componentFactory.getComponents(placeholder);
722
- try {
723
- const nonGuarded = yield this.guardResolver(factories);
724
- const withData = yield this.dataResolver(nonGuarded);
725
- withData.forEach((rendering, index) => {
726
- if (this.renderEachTemplate && !isRawRendering(rendering.factory.componentDefinition)) {
727
- this._renderTemplatedComponent(rendering.factory.componentDefinition, index);
728
- }
729
- else {
730
- this._renderEmbeddedComponent(rendering.factory, rendering.data, index);
731
- }
732
- });
733
- this.isLoading = false;
734
- this.changeDetectorRef.markForCheck();
735
- this.loaded.emit(this.name);
736
- }
737
- catch (e) {
738
- this.isLoading = false;
739
- if (e instanceof UrlTree) {
740
- this.router.navigateByUrl(e);
741
- }
742
- else if (typeof e === 'string') {
743
- this.router.navigate([e]);
744
- }
745
- else if (Array.isArray(e)) {
746
- this.router.navigate(e);
747
- }
748
- else {
749
- throw e;
750
- }
751
- }
752
- }
753
- });
754
- }
755
- _renderTemplatedComponent(rendering, index) {
756
- // the render-each template takes care of all component mapping etc
757
- // generally using <sc-render-component> which is about like _renderEmbeddedComponent()
758
- // as a separate component
759
- this.view.createEmbeddedView(this.renderEachTemplate.templateRef, {
760
- rendering,
761
- index,
762
- });
763
- }
764
- _renderEmbeddedComponent(rendering, data, index) {
765
- if (rendering.componentDefinition.componentName === HIDDEN_RENDERING_NAME) {
766
- rendering.componentImplementation = this.hiddenRenderingComponent;
767
- }
768
- if (!rendering.componentImplementation) {
769
- const componentName = rendering.componentDefinition.componentName;
607
+ /**
608
+ * @param {ComponentRendering} rendering
609
+ * @param {string} name
610
+ */
611
+ function getPlaceholder(rendering, name) {
612
+ if (rendering && rendering.placeholders && Object.keys(rendering.placeholders).length > 0) {
613
+ return rendering.placeholders[name];
614
+ }
615
+ return null;
616
+ }
617
+ class PlaceholderComponent {
618
+ constructor(differs, componentFactory, changeDetectorRef, elementRef, renderer, router, missingComponentComponent, hiddenRenderingComponent, guardResolver, dataResolver,
619
+ // eslint-disable-next-line @typescript-eslint/ban-types
620
+ platformId) {
621
+ this.differs = differs;
622
+ this.componentFactory = componentFactory;
623
+ this.changeDetectorRef = changeDetectorRef;
624
+ this.elementRef = elementRef;
625
+ this.renderer = renderer;
626
+ this.router = router;
627
+ this.missingComponentComponent = missingComponentComponent;
628
+ this.hiddenRenderingComponent = hiddenRenderingComponent;
629
+ this.guardResolver = guardResolver;
630
+ this.dataResolver = dataResolver;
631
+ this.platformId = platformId;
632
+ this.clientOnly = false;
633
+ this.loaded = new EventEmitter();
634
+ this.isLoading = true;
635
+ this._componentInstances = [];
636
+ this.destroyed = false;
637
+ this.parentStyleAttribute = '';
638
+ }
639
+ set inputs(value) {
640
+ this._inputs = value;
641
+ if (!this._differ && value) {
642
+ this._differ = this.differs.find(value).create();
643
+ }
644
+ }
645
+ ngOnInit() {
646
+ // just to ensure the element exists
647
+ const elem = this.elementRef.nativeElement;
648
+ if (elem) {
649
+ const attributes = elem.attributes;
650
+ for (let i = 0; i < attributes.length; i++) {
651
+ const attr = attributes.item(i);
652
+ if (attr && attr.name.indexOf('_ngcontent') !== -1) {
653
+ this.parentStyleAttribute = attr.name;
654
+ }
655
+ }
656
+ }
657
+ }
658
+ ngOnDestroy() {
659
+ this.destroyed = true;
660
+ this._componentInstances = [];
661
+ }
662
+ ngOnChanges(changes) {
663
+ if (changes.rendering || changes.renderings) {
664
+ this._render();
665
+ }
666
+ }
667
+ ngDoCheck() {
668
+ if (!this._differ || !this._inputs || this._componentInstances.length === 0) {
669
+ return;
670
+ }
671
+ const changes = this._differ.diff(this._inputs);
672
+ if (!changes) {
673
+ return;
674
+ }
675
+ const updates = {};
676
+ changes.forEachRemovedItem((change) => (updates[change.key] = null));
677
+ changes.forEachAddedItem((change) => (updates[change.key] = change.currentValue));
678
+ changes.forEachChangedItem((change) => (updates[change.key] = change.currentValue));
679
+ this._componentInstances.forEach((componentInstance) => this._setComponentInputs(componentInstance, updates));
680
+ }
681
+ _setComponentInputs(componentInstance, inputs) {
682
+ Object.entries(inputs).forEach(([input, inputValue]) => (componentInstance[input] = inputValue));
683
+ }
684
+ _subscribeComponentOutputs(componentInstance, outputs) {
685
+ Object.keys(outputs)
686
+ .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable)
687
+ .forEach((output) => componentInstance[output]
688
+ .pipe(takeWhile(() => !this.destroyed))
689
+ .subscribe(outputs[output]));
690
+ }
691
+ _render() {
692
+ return __awaiter(this, void 0, void 0, function* () {
693
+ if (this.clientOnly && isPlatformServer(this.platformId)) {
694
+ return;
695
+ }
696
+ this._componentInstances = [];
697
+ this.view.clear();
698
+ if (!this.rendering && !this.renderings) {
699
+ return;
700
+ }
701
+ if (!this.name && !this.renderings) {
702
+ console.warn('Placeholder name was not specified, and explicit renderings array was not passed. Placeholder requires either name and rendering, or renderings.');
703
+ this.isLoading = false;
704
+ return;
705
+ }
706
+ const placeholder = this.renderings || getPlaceholder(this.rendering, this.name || '');
707
+ if (!placeholder) {
708
+ console.warn(`Placeholder '${this.name}' was not found in the current rendering data`, JSON.stringify(this.rendering, null, 2));
709
+ this.isLoading = false;
710
+ return;
711
+ }
712
+ // if the placeholder is empty (contains only raw renderings), then we may need to use the empty template if it's defined
713
+ const placeholderIsEmpty = placeholder.every((rendering) => isRawRendering(rendering));
714
+ if (this.renderEmptyTemplate && placeholderIsEmpty) {
715
+ this.view.createEmbeddedView(this.renderEmptyTemplate.templateRef, {
716
+ renderings: placeholder,
717
+ });
718
+ this.isLoading = false;
719
+ }
720
+ else {
721
+ const factories = yield this.componentFactory.getComponents(placeholder);
722
+ try {
723
+ const nonGuarded = yield this.guardResolver(factories);
724
+ const withData = yield this.dataResolver(nonGuarded);
725
+ withData.forEach((rendering, index) => {
726
+ if (this.renderEachTemplate && !isRawRendering(rendering.factory.componentDefinition)) {
727
+ this._renderTemplatedComponent(rendering.factory.componentDefinition, index);
728
+ }
729
+ else {
730
+ this._renderEmbeddedComponent(rendering.factory, rendering.data, index);
731
+ }
732
+ });
733
+ this.isLoading = false;
734
+ this.changeDetectorRef.markForCheck();
735
+ this.loaded.emit(this.name);
736
+ }
737
+ catch (e) {
738
+ this.isLoading = false;
739
+ if (e instanceof UrlTree) {
740
+ this.router.navigateByUrl(e);
741
+ }
742
+ else if (typeof e === 'string') {
743
+ this.router.navigate([e]);
744
+ }
745
+ else if (Array.isArray(e)) {
746
+ this.router.navigate(e);
747
+ }
748
+ else {
749
+ throw e;
750
+ }
751
+ }
752
+ }
753
+ });
754
+ }
755
+ _renderTemplatedComponent(rendering, index) {
756
+ // the render-each template takes care of all component mapping etc
757
+ // generally using <sc-render-component> which is about like _renderEmbeddedComponent()
758
+ // as a separate component
759
+ this.view.createEmbeddedView(this.renderEachTemplate.templateRef, {
760
+ rendering,
761
+ index,
762
+ });
763
+ }
764
+ _renderEmbeddedComponent(rendering, data, index) {
765
+ if (rendering.componentDefinition.componentName === HIDDEN_RENDERING_NAME) {
766
+ rendering.componentImplementation = this.hiddenRenderingComponent;
767
+ }
768
+ if (!rendering.componentImplementation) {
769
+ const componentName = rendering.componentDefinition.componentName;
770
770
  console.error(`Placeholder ${this.name} contains unknown component ${componentName}.`, `Ensure component is mapped, like:
771
771
  JssModule.withComponents([
772
772
  { name: '${componentName}', type: ${componentName}Component }
773
- ])`);
774
- rendering.componentImplementation = this.missingComponentComponent;
775
- }
776
- // apply the parent style attribute _ngcontent
777
- // work-around for https://github.com/angular/angular/issues/12215
778
- const createdComponentRef = this.view.createComponent(rendering.componentImplementation, {
779
- index: index,
780
- });
781
- if (this.parentStyleAttribute) {
782
- this.renderer.setAttribute(createdComponentRef.location.nativeElement, this.parentStyleAttribute, '');
783
- }
784
- const componentInstance = createdComponentRef.instance;
785
- componentInstance.rendering = rendering.componentDefinition;
786
- componentInstance.data = data;
787
- if (this._inputs) {
788
- this._setComponentInputs(componentInstance, this._inputs);
789
- }
790
- if (this.outputs) {
791
- this._subscribeComponentOutputs(componentInstance, this.outputs);
792
- }
793
- this._componentInstances.push(componentInstance);
794
- }
795
- }
796
- PlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderComponent, deps: [{ token: i0.KeyValueDiffers }, { token: JssComponentFactoryService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.Router }, { token: PLACEHOLDER_MISSING_COMPONENT_COMPONENT }, { token: PLACEHOLDER_HIDDEN_RENDERING_COMPONENT }, { token: GUARD_RESOLVER }, { token: DATA_RESOLVER }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
773
+ ])`);
774
+ rendering.componentImplementation = this.missingComponentComponent;
775
+ }
776
+ // apply the parent style attribute _ngcontent
777
+ // work-around for https://github.com/angular/angular/issues/12215
778
+ const createdComponentRef = this.view.createComponent(rendering.componentImplementation, {
779
+ index: index,
780
+ });
781
+ if (this.parentStyleAttribute) {
782
+ this.renderer.setAttribute(createdComponentRef.location.nativeElement, this.parentStyleAttribute, '');
783
+ }
784
+ const componentInstance = createdComponentRef.instance;
785
+ componentInstance.rendering = rendering.componentDefinition;
786
+ componentInstance.data = data;
787
+ if (this._inputs) {
788
+ this._setComponentInputs(componentInstance, this._inputs);
789
+ }
790
+ if (this.outputs) {
791
+ this._subscribeComponentOutputs(componentInstance, this.outputs);
792
+ }
793
+ this._componentInstances.push(componentInstance);
794
+ }
795
+ }
796
+ PlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderComponent, deps: [{ token: i0.KeyValueDiffers }, { token: JssComponentFactoryService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.Router }, { token: PLACEHOLDER_MISSING_COMPONENT_COMPONENT }, { token: PLACEHOLDER_HIDDEN_RENDERING_COMPONENT }, { token: GUARD_RESOLVER }, { token: DATA_RESOLVER }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
797
797
  PlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PlaceholderComponent, selector: "sc-placeholder,[sc-placeholder]", inputs: { name: "name", rendering: "rendering", renderings: "renderings", outputs: "outputs", clientOnly: "clientOnly", inputs: "inputs" }, outputs: { loaded: "loaded" }, queries: [{ propertyName: "renderEachTemplate", first: true, predicate: RenderEachDirective, descendants: true, static: true }, { propertyName: "renderEmptyTemplate", first: true, predicate: RenderEmptyDirective, descendants: true, static: true }, { propertyName: "placeholderLoading", first: true, predicate: PlaceholderLoadingDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "view", first: true, predicate: ["view"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
798
798
  <ng-template
799
799
  *ngIf="isLoading"
800
800
  [ngTemplateOutlet]="placeholderLoading?.templateRef"
801
801
  ></ng-template>
802
802
  <ng-template #view></ng-template>
803
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
804
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderComponent, decorators: [{
805
- type: Component,
806
- args: [{
807
- selector: 'sc-placeholder,[sc-placeholder]',
803
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PlaceholderComponent, decorators: [{
805
+ type: Component,
806
+ args: [{
807
+ selector: 'sc-placeholder,[sc-placeholder]',
808
808
  template: `
809
809
  <ng-template
810
810
  *ngIf="isLoading"
811
811
  [ngTemplateOutlet]="placeholderLoading?.templateRef"
812
812
  ></ng-template>
813
813
  <ng-template #view></ng-template>
814
- `,
815
- }]
816
- }], ctorParameters: function () {
817
- return [{ type: i0.KeyValueDiffers }, { type: JssComponentFactoryService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.Router }, { type: i0.Type, decorators: [{
818
- type: Inject,
819
- args: [PLACEHOLDER_MISSING_COMPONENT_COMPONENT]
820
- }] }, { type: i0.Type, decorators: [{
821
- type: Inject,
822
- args: [PLACEHOLDER_HIDDEN_RENDERING_COMPONENT]
823
- }] }, { type: undefined, decorators: [{
824
- type: Inject,
825
- args: [GUARD_RESOLVER]
826
- }] }, { type: undefined, decorators: [{
827
- type: Inject,
828
- args: [DATA_RESOLVER]
829
- }] }, { type: Object, decorators: [{
830
- type: Inject,
831
- args: [PLATFORM_ID]
832
- }] }];
833
- }, propDecorators: { name: [{
834
- type: Input
835
- }], rendering: [{
836
- type: Input
837
- }], renderings: [{
838
- type: Input
839
- }], outputs: [{
840
- type: Input
841
- }], clientOnly: [{
842
- type: Input
843
- }], loaded: [{
844
- type: Output
845
- }], renderEachTemplate: [{
846
- type: ContentChild,
847
- args: [RenderEachDirective, { static: true }]
848
- }], renderEmptyTemplate: [{
849
- type: ContentChild,
850
- args: [RenderEmptyDirective, { static: true }]
851
- }], placeholderLoading: [{
852
- type: ContentChild,
853
- args: [PlaceholderLoadingDirective, { static: true }]
854
- }], view: [{
855
- type: ViewChild,
856
- args: ['view', { read: ViewContainerRef, static: true }]
857
- }], inputs: [{
858
- type: Input
814
+ `,
815
+ }]
816
+ }], ctorParameters: function () {
817
+ return [{ type: i0.KeyValueDiffers }, { type: JssComponentFactoryService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.Router }, { type: i0.Type, decorators: [{
818
+ type: Inject,
819
+ args: [PLACEHOLDER_MISSING_COMPONENT_COMPONENT]
820
+ }] }, { type: i0.Type, decorators: [{
821
+ type: Inject,
822
+ args: [PLACEHOLDER_HIDDEN_RENDERING_COMPONENT]
823
+ }] }, { type: undefined, decorators: [{
824
+ type: Inject,
825
+ args: [GUARD_RESOLVER]
826
+ }] }, { type: undefined, decorators: [{
827
+ type: Inject,
828
+ args: [DATA_RESOLVER]
829
+ }] }, { type: Object, decorators: [{
830
+ type: Inject,
831
+ args: [PLATFORM_ID]
832
+ }] }];
833
+ }, propDecorators: { name: [{
834
+ type: Input
835
+ }], rendering: [{
836
+ type: Input
837
+ }], renderings: [{
838
+ type: Input
839
+ }], outputs: [{
840
+ type: Input
841
+ }], clientOnly: [{
842
+ type: Input
843
+ }], loaded: [{
844
+ type: Output
845
+ }], renderEachTemplate: [{
846
+ type: ContentChild,
847
+ args: [RenderEachDirective, { static: true }]
848
+ }], renderEmptyTemplate: [{
849
+ type: ContentChild,
850
+ args: [RenderEmptyDirective, { static: true }]
851
+ }], placeholderLoading: [{
852
+ type: ContentChild,
853
+ args: [PlaceholderLoadingDirective, { static: true }]
854
+ }], view: [{
855
+ type: ViewChild,
856
+ args: ['view', { read: ViewContainerRef, static: true }]
857
+ }], inputs: [{
858
+ type: Input
859
859
  }] } });
860
860
 
861
- /**
862
- * Renders a single JSS component given a rendering definition.
863
- * Useful inside templated placeholders.
864
- */
865
- class RenderComponentComponent {
866
- constructor(differs, componentFactory, missingComponentComponent) {
867
- this.differs = differs;
868
- this.componentFactory = componentFactory;
869
- this.missingComponentComponent = missingComponentComponent;
870
- this.destroyed = false;
871
- }
872
- set inputs(value) {
873
- this._inputs = value;
874
- if (!this._differ && value) {
875
- this._differ = this.differs.find(value).create();
876
- }
877
- }
878
- ngOnChanges(changes) {
879
- if (changes.rendering) {
880
- this._render();
881
- }
882
- }
883
- _setComponentInputs(componentInstance, inputs) {
884
- Object.entries(inputs).forEach(([input, inputValue]) => (componentInstance[input] = inputValue));
885
- }
886
- _subscribeComponentOutputs(componentInstance, outputs) {
887
- Object.keys(outputs)
888
- .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable)
889
- .forEach((output) => componentInstance[output]
890
- .pipe(takeWhile(() => !this.destroyed))
891
- .subscribe(outputs[output]));
892
- }
893
- _render() {
894
- this.view.clear();
895
- if (!this.rendering) {
896
- return;
897
- }
898
- const resolveComponent = isRawRendering(this.rendering)
899
- ? Promise.resolve({
900
- componentImplementation: RawComponent,
901
- componentDefinition: this.rendering,
902
- })
903
- : this.componentFactory.getComponent(this.rendering);
904
- resolveComponent.then((rendering) => {
905
- if (!rendering.componentImplementation) {
906
- const componentName = rendering.componentDefinition.componentName;
861
+ /**
862
+ * Renders a single JSS component given a rendering definition.
863
+ * Useful inside templated placeholders.
864
+ */
865
+ class RenderComponentComponent {
866
+ constructor(differs, componentFactory, missingComponentComponent) {
867
+ this.differs = differs;
868
+ this.componentFactory = componentFactory;
869
+ this.missingComponentComponent = missingComponentComponent;
870
+ this.destroyed = false;
871
+ }
872
+ set inputs(value) {
873
+ this._inputs = value;
874
+ if (!this._differ && value) {
875
+ this._differ = this.differs.find(value).create();
876
+ }
877
+ }
878
+ ngOnChanges(changes) {
879
+ if (changes.rendering) {
880
+ this._render();
881
+ }
882
+ }
883
+ _setComponentInputs(componentInstance, inputs) {
884
+ Object.entries(inputs).forEach(([input, inputValue]) => (componentInstance[input] = inputValue));
885
+ }
886
+ _subscribeComponentOutputs(componentInstance, outputs) {
887
+ Object.keys(outputs)
888
+ .filter((output) => componentInstance[output] && componentInstance[output] instanceof Observable)
889
+ .forEach((output) => componentInstance[output]
890
+ .pipe(takeWhile(() => !this.destroyed))
891
+ .subscribe(outputs[output]));
892
+ }
893
+ _render() {
894
+ this.view.clear();
895
+ if (!this.rendering) {
896
+ return;
897
+ }
898
+ const resolveComponent = isRawRendering(this.rendering)
899
+ ? Promise.resolve({
900
+ componentImplementation: RawComponent,
901
+ componentDefinition: this.rendering,
902
+ })
903
+ : this.componentFactory.getComponent(this.rendering);
904
+ resolveComponent.then((rendering) => {
905
+ if (!rendering.componentImplementation) {
906
+ const componentName = rendering.componentDefinition.componentName;
907
907
  console.error(`Attempted to render unknown component ${componentName}.`, `Ensure component is mapped, like:
908
908
  JssModule.withComponents([
909
909
  { name: '${componentName}', type: ${componentName}Component }
910
- ])`);
911
- rendering.componentImplementation = this.missingComponentComponent;
912
- }
913
- const componentInstance = this.view.createComponent(rendering.componentImplementation)
914
- .instance;
915
- componentInstance.rendering = rendering.componentDefinition;
916
- if (this._inputs) {
917
- this._setComponentInputs(componentInstance, this._inputs);
918
- }
919
- if (this.outputs) {
920
- this._subscribeComponentOutputs(componentInstance, this.outputs);
921
- }
922
- });
923
- }
924
- }
925
- RenderComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderComponentComponent, deps: [{ token: i0.KeyValueDiffers }, { token: JssComponentFactoryService }, { token: PLACEHOLDER_MISSING_COMPONENT_COMPONENT }], target: i0.ɵɵFactoryTarget.Component });
910
+ ])`);
911
+ rendering.componentImplementation = this.missingComponentComponent;
912
+ }
913
+ const componentInstance = this.view.createComponent(rendering.componentImplementation)
914
+ .instance;
915
+ componentInstance.rendering = rendering.componentDefinition;
916
+ if (this._inputs) {
917
+ this._setComponentInputs(componentInstance, this._inputs);
918
+ }
919
+ if (this.outputs) {
920
+ this._subscribeComponentOutputs(componentInstance, this.outputs);
921
+ }
922
+ });
923
+ }
924
+ }
925
+ RenderComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderComponentComponent, deps: [{ token: i0.KeyValueDiffers }, { token: JssComponentFactoryService }, { token: PLACEHOLDER_MISSING_COMPONENT_COMPONENT }], target: i0.ɵɵFactoryTarget.Component });
926
926
  RenderComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RenderComponentComponent, selector: "sc-render-component", inputs: { rendering: "rendering", outputs: "outputs", inputs: "inputs" }, viewQueries: [{ propertyName: "view", first: true, predicate: ["view"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
927
927
  <ng-template #view></ng-template>
928
- `, isInline: true });
929
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderComponentComponent, decorators: [{
930
- type: Component,
931
- args: [{
932
- selector: 'sc-render-component',
928
+ `, isInline: true });
929
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RenderComponentComponent, decorators: [{
930
+ type: Component,
931
+ args: [{
932
+ selector: 'sc-render-component',
933
933
  template: `
934
934
  <ng-template #view></ng-template>
935
- `,
936
- }]
937
- }], ctorParameters: function () {
938
- return [{ type: i0.KeyValueDiffers }, { type: JssComponentFactoryService }, { type: i0.Type, decorators: [{
939
- type: Inject,
940
- args: [PLACEHOLDER_MISSING_COMPONENT_COMPONENT]
941
- }] }];
942
- }, propDecorators: { rendering: [{
943
- type: Input
944
- }], outputs: [{
945
- type: Input
946
- }], view: [{
947
- type: ViewChild,
948
- args: ['view', { read: ViewContainerRef, static: true }]
949
- }], inputs: [{
950
- type: Input
935
+ `,
936
+ }]
937
+ }], ctorParameters: function () {
938
+ return [{ type: i0.KeyValueDiffers }, { type: JssComponentFactoryService }, { type: i0.Type, decorators: [{
939
+ type: Inject,
940
+ args: [PLACEHOLDER_MISSING_COMPONENT_COMPONENT]
941
+ }] }];
942
+ }, propDecorators: { rendering: [{
943
+ type: Input
944
+ }], outputs: [{
945
+ type: Input
946
+ }], view: [{
947
+ type: ViewChild,
948
+ args: ['view', { read: ViewContainerRef, static: true }]
949
+ }], inputs: [{
950
+ type: Input
951
951
  }] } });
952
952
 
953
- class DateDirective {
954
- constructor(viewContainer, templateRef, datePipe) {
955
- this.viewContainer = viewContainer;
956
- this.templateRef = templateRef;
957
- this.datePipe = datePipe;
958
- this.editable = true;
959
- }
960
- ngOnChanges(changes) {
961
- if (changes.field || changes.format) {
962
- if (!this.viewRef) {
963
- this.viewContainer.clear();
964
- this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
965
- }
966
- this.updateView();
967
- }
968
- }
969
- updateView() {
970
- const field = this.field;
971
- if (!field || (!field.editable && !field.value)) {
972
- return;
973
- }
974
- const html = field.editable && this.editable ? field.editable : field.value;
975
- const setDangerously = field.editable && this.editable;
976
- this.viewRef.rootNodes.forEach((node) => {
977
- if (setDangerously) {
978
- node.innerHTML = html;
979
- }
980
- else {
981
- node.textContent = this.datePipe.transform(html, this.format, this.timezone, this.locale);
982
- }
983
- });
984
- }
985
- }
986
- DateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DateDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Directive });
987
- DateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: DateDirective, selector: "[scDate]", inputs: { format: ["scDateFormat", "format"], timezone: ["scDateTimezone", "timezone"], locale: ["scDateLocale", "locale"], editable: ["scDateEditable", "editable"], field: ["scDate", "field"] }, usesOnChanges: true, ngImport: i0 });
988
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DateDirective, decorators: [{
989
- type: Directive,
990
- args: [{
991
- selector: '[scDate]',
992
- }]
993
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i1$1.DatePipe }]; }, propDecorators: { format: [{
994
- type: Input,
995
- args: ['scDateFormat']
996
- }], timezone: [{
997
- type: Input,
998
- args: ['scDateTimezone']
999
- }], locale: [{
1000
- type: Input,
1001
- args: ['scDateLocale']
1002
- }], editable: [{
1003
- type: Input,
1004
- args: ['scDateEditable']
1005
- }], field: [{
1006
- type: Input,
1007
- args: ['scDate']
953
+ class DateDirective {
954
+ constructor(viewContainer, templateRef, datePipe) {
955
+ this.viewContainer = viewContainer;
956
+ this.templateRef = templateRef;
957
+ this.datePipe = datePipe;
958
+ this.editable = true;
959
+ }
960
+ ngOnChanges(changes) {
961
+ if (changes.field || changes.format) {
962
+ if (!this.viewRef) {
963
+ this.viewContainer.clear();
964
+ this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
965
+ }
966
+ this.updateView();
967
+ }
968
+ }
969
+ updateView() {
970
+ const field = this.field;
971
+ if (!field || (!field.editable && !field.value)) {
972
+ return;
973
+ }
974
+ const html = field.editable && this.editable ? field.editable : field.value;
975
+ const setDangerously = field.editable && this.editable;
976
+ this.viewRef.rootNodes.forEach((node) => {
977
+ if (setDangerously) {
978
+ node.innerHTML = html;
979
+ }
980
+ else {
981
+ node.textContent = this.datePipe.transform(html, this.format, this.timezone, this.locale);
982
+ }
983
+ });
984
+ }
985
+ }
986
+ DateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DateDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Directive });
987
+ DateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: DateDirective, selector: "[scDate]", inputs: { format: ["scDateFormat", "format"], timezone: ["scDateTimezone", "timezone"], locale: ["scDateLocale", "locale"], editable: ["scDateEditable", "editable"], field: ["scDate", "field"] }, usesOnChanges: true, ngImport: i0 });
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DateDirective, decorators: [{
989
+ type: Directive,
990
+ args: [{
991
+ selector: '[scDate]',
992
+ }]
993
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i1$1.DatePipe }]; }, propDecorators: { format: [{
994
+ type: Input,
995
+ args: ['scDateFormat']
996
+ }], timezone: [{
997
+ type: Input,
998
+ args: ['scDateTimezone']
999
+ }], locale: [{
1000
+ type: Input,
1001
+ args: ['scDateLocale']
1002
+ }], editable: [{
1003
+ type: Input,
1004
+ args: ['scDateEditable']
1005
+ }], field: [{
1006
+ type: Input,
1007
+ args: ['scDate']
1008
1008
  }] } });
1009
1009
 
1010
- class EditFrameComponent {
1011
- constructor() {
1012
- this.isEditing = false;
1013
- this.frameProps = {};
1014
- this.chromeData = '';
1015
- }
1016
- ngOnChanges() {
1017
- this.isEditing = this.sitecore.context.pageEditing || false;
1018
- if (!this.isEditing) {
1019
- return;
1020
- }
1021
- this.frameProps.class = 'scLooseFrameZone';
1022
- if (this.cssClass) {
1023
- this.frameProps.class = `${this.frameProps.class} ${this.cssClass}`;
1024
- }
1025
- // item uri for edit frame target
1026
- if (this.dataSource) {
1027
- const route = this.sitecore.route;
1028
- const databaseName = this.dataSource.databaseName || (route === null || route === void 0 ? void 0 : route.databaseName);
1029
- const language = this.dataSource.language || this.sitecore.context.language;
1030
- this.frameProps.sc_item = `sitecore://${databaseName}/${this.dataSource.itemId}?lang=${language}`;
1031
- }
1032
- this.chromeData = this.buildChromeData();
1033
- }
1034
- buildChromeData() {
1035
- var _a;
1036
- const chromeData = {
1037
- displayName: this.title,
1038
- expandedDisplayName: this.tooltip,
1039
- };
1040
- if (this.dataSource) {
1041
- chromeData.contextItemUri = this.frameProps.sc_item;
1042
- }
1043
- chromeData.commands = (_a = this.buttons) === null || _a === void 0 ? void 0 : _a.map((value) => {
1044
- var _a;
1045
- return mapButtonToCommand(value, (_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.itemId, this.parameters);
1046
- });
1047
- return JSON.stringify(chromeData);
1048
- }
1049
- }
1050
- EditFrameComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditFrameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1010
+ class EditFrameComponent {
1011
+ constructor() {
1012
+ this.isEditing = false;
1013
+ this.frameProps = {};
1014
+ this.chromeData = '';
1015
+ }
1016
+ ngOnChanges() {
1017
+ this.isEditing = this.sitecore.context.pageEditing || false;
1018
+ if (!this.isEditing) {
1019
+ return;
1020
+ }
1021
+ this.frameProps.class = 'scLooseFrameZone';
1022
+ if (this.cssClass) {
1023
+ this.frameProps.class = `${this.frameProps.class} ${this.cssClass}`;
1024
+ }
1025
+ // item uri for edit frame target
1026
+ if (this.dataSource) {
1027
+ const route = this.sitecore.route;
1028
+ const databaseName = this.dataSource.databaseName || (route === null || route === void 0 ? void 0 : route.databaseName);
1029
+ const language = this.dataSource.language || this.sitecore.context.language;
1030
+ this.frameProps.sc_item = `sitecore://${databaseName}/${this.dataSource.itemId}?lang=${language}`;
1031
+ }
1032
+ this.chromeData = this.buildChromeData();
1033
+ }
1034
+ buildChromeData() {
1035
+ var _a;
1036
+ const chromeData = {
1037
+ displayName: this.title,
1038
+ expandedDisplayName: this.tooltip,
1039
+ };
1040
+ if (this.dataSource) {
1041
+ chromeData.contextItemUri = this.frameProps.sc_item;
1042
+ }
1043
+ chromeData.commands = (_a = this.buttons) === null || _a === void 0 ? void 0 : _a.map((value) => {
1044
+ var _a;
1045
+ return mapButtonToCommand(value, (_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.itemId, this.parameters);
1046
+ });
1047
+ return JSON.stringify(chromeData);
1048
+ }
1049
+ }
1050
+ EditFrameComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditFrameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1051
1051
  EditFrameComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: EditFrameComponent, selector: "sc-edit-frame,[sc-edit-frame]", inputs: { dataSource: "dataSource", buttons: "buttons", title: "title", tooltip: "tooltip", cssClass: "cssClass", parameters: "parameters", sitecore: "sitecore" }, usesOnChanges: true, ngImport: i0, template: `
1052
1052
  <ng-template #childContent>
1053
1053
  <ng-content></ng-content>
@@ -1063,11 +1063,11 @@ EditFrameComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
1063
1063
  <ng-template #elseBlock>
1064
1064
  <ng-container *ngTemplateOutlet="childContent"></ng-container>
1065
1065
  </ng-template>
1066
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
1067
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditFrameComponent, decorators: [{
1068
- type: Component,
1069
- args: [{
1070
- selector: 'sc-edit-frame,[sc-edit-frame]',
1066
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
1067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditFrameComponent, decorators: [{
1068
+ type: Component,
1069
+ args: [{
1070
+ selector: 'sc-edit-frame,[sc-edit-frame]',
1071
1071
  template: `
1072
1072
  <ng-template #childContent>
1073
1073
  <ng-content></ng-content>
@@ -1083,295 +1083,295 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1083
1083
  <ng-template #elseBlock>
1084
1084
  <ng-container *ngTemplateOutlet="childContent"></ng-container>
1085
1085
  </ng-template>
1086
- `,
1087
- }]
1088
- }], propDecorators: { dataSource: [{
1089
- type: Input
1090
- }], buttons: [{
1091
- type: Input
1092
- }], title: [{
1093
- type: Input
1094
- }], tooltip: [{
1095
- type: Input
1096
- }], cssClass: [{
1097
- type: Input
1098
- }], parameters: [{
1099
- type: Input
1100
- }], sitecore: [{
1101
- type: Input
1086
+ `,
1087
+ }]
1088
+ }], propDecorators: { dataSource: [{
1089
+ type: Input
1090
+ }], buttons: [{
1091
+ type: Input
1092
+ }], title: [{
1093
+ type: Input
1094
+ }], tooltip: [{
1095
+ type: Input
1096
+ }], cssClass: [{
1097
+ type: Input
1098
+ }], parameters: [{
1099
+ type: Input
1100
+ }], sitecore: [{
1101
+ type: Input
1102
1102
  }] } });
1103
1103
 
1104
- class RichTextDirective {
1105
- constructor(viewContainer, templateRef, renderer, router) {
1106
- this.viewContainer = viewContainer;
1107
- this.templateRef = templateRef;
1108
- this.renderer = renderer;
1109
- this.router = router;
1110
- this.editable = true;
1111
- }
1112
- ngOnChanges(changes) {
1113
- if (changes.field || changes.editable) {
1114
- if (!this.viewRef) {
1115
- this.viewContainer.clear();
1116
- this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
1117
- }
1118
- this.updateView();
1119
- }
1120
- }
1121
- updateView() {
1122
- const field = this.field;
1123
- if (!field || (!field.editable && !field.value)) {
1124
- return;
1125
- }
1126
- const html = field.editable && this.editable ? field.editable : field.value;
1127
- this.viewRef.rootNodes.forEach((node) => {
1128
- node.innerHTML = html;
1129
- if (!node.querySelectorAll) {
1130
- return;
1131
- }
1132
- const links = node.querySelectorAll('a[href]');
1133
- const linksArray = [].slice.call(links);
1134
- linksArray.forEach((link) => {
1135
- const href = link.getAttribute('href');
1136
- const target = link.getAttribute('target');
1137
- if (!href || isAbsoluteUrl(href) || target === '_blank' || target === '_top') {
1138
- return;
1139
- }
1140
- this.renderer.listen(link, 'click', (event) => {
1141
- this.router.navigateByUrl(href);
1142
- event.preventDefault();
1143
- });
1144
- });
1145
- });
1146
- }
1147
- }
1148
- RichTextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RichTextDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
1149
- RichTextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RichTextDirective, selector: "[scRichText]", inputs: { editable: ["scRichTextEditable", "editable"], field: ["scRichText", "field"] }, usesOnChanges: true, ngImport: i0 });
1150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RichTextDirective, decorators: [{
1151
- type: Directive,
1152
- args: [{
1153
- selector: '[scRichText]',
1154
- }]
1155
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i1.Router }]; }, propDecorators: { editable: [{
1156
- type: Input,
1157
- args: ['scRichTextEditable']
1158
- }], field: [{
1159
- type: Input,
1160
- args: ['scRichText']
1104
+ class RichTextDirective {
1105
+ constructor(viewContainer, templateRef, renderer, router) {
1106
+ this.viewContainer = viewContainer;
1107
+ this.templateRef = templateRef;
1108
+ this.renderer = renderer;
1109
+ this.router = router;
1110
+ this.editable = true;
1111
+ }
1112
+ ngOnChanges(changes) {
1113
+ if (changes.field || changes.editable) {
1114
+ if (!this.viewRef) {
1115
+ this.viewContainer.clear();
1116
+ this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
1117
+ }
1118
+ this.updateView();
1119
+ }
1120
+ }
1121
+ updateView() {
1122
+ const field = this.field;
1123
+ if (!field || (!field.editable && !field.value)) {
1124
+ return;
1125
+ }
1126
+ const html = field.editable && this.editable ? field.editable : field.value;
1127
+ this.viewRef.rootNodes.forEach((node) => {
1128
+ node.innerHTML = html;
1129
+ if (!node.querySelectorAll) {
1130
+ return;
1131
+ }
1132
+ const links = node.querySelectorAll('a[href]');
1133
+ const linksArray = [].slice.call(links);
1134
+ linksArray.forEach((link) => {
1135
+ const href = link.getAttribute('href');
1136
+ const target = link.getAttribute('target');
1137
+ if (!href || isAbsoluteUrl(href) || target === '_blank' || target === '_top') {
1138
+ return;
1139
+ }
1140
+ this.renderer.listen(link, 'click', (event) => {
1141
+ this.router.navigateByUrl(href);
1142
+ event.preventDefault();
1143
+ });
1144
+ });
1145
+ });
1146
+ }
1147
+ }
1148
+ RichTextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RichTextDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.Renderer2 }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Directive });
1149
+ RichTextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: RichTextDirective, selector: "[scRichText]", inputs: { editable: ["scRichTextEditable", "editable"], field: ["scRichText", "field"] }, usesOnChanges: true, ngImport: i0 });
1150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RichTextDirective, decorators: [{
1151
+ type: Directive,
1152
+ args: [{
1153
+ selector: '[scRichText]',
1154
+ }]
1155
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.Renderer2 }, { type: i1.Router }]; }, propDecorators: { editable: [{
1156
+ type: Input,
1157
+ args: ['scRichTextEditable']
1158
+ }], field: [{
1159
+ type: Input,
1160
+ args: ['scRichText']
1161
1161
  }] } });
1162
1162
 
1163
- class TextDirective {
1164
- constructor(viewContainer, templateRef) {
1165
- this.viewContainer = viewContainer;
1166
- this.templateRef = templateRef;
1167
- this.editable = true;
1168
- this.encode = true;
1169
- }
1170
- ngOnChanges(changes) {
1171
- if (changes.field || changes.editable || changes.encode) {
1172
- if (!this.viewRef) {
1173
- this.viewContainer.clear();
1174
- this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
1175
- }
1176
- this.updateView();
1177
- }
1178
- }
1179
- updateView() {
1180
- const field = this.field;
1181
- let editable = this.editable;
1182
- if (!field || (!field.editable && (field.value === undefined || field.value === ''))) {
1183
- return;
1184
- }
1185
- // can't use editable value if we want to output unencoded
1186
- if (!this.encode) {
1187
- editable = false;
1188
- }
1189
- const html = field.editable && editable ? field.editable : field.value;
1190
- const setDangerously = (field.editable && editable) || !this.encode;
1191
- this.viewRef.rootNodes.forEach((node) => {
1192
- if (setDangerously) {
1193
- node.innerHTML = html;
1194
- }
1195
- else {
1196
- node.textContent = html;
1197
- }
1198
- });
1199
- }
1200
- }
1201
- TextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1202
- TextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: TextDirective, selector: "[scText]", inputs: { editable: ["scTextEditable", "editable"], encode: ["scTextEncode", "encode"], field: ["scText", "field"] }, usesOnChanges: true, ngImport: i0 });
1203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextDirective, decorators: [{
1204
- type: Directive,
1205
- args: [{
1206
- selector: '[scText]',
1207
- }]
1208
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { editable: [{
1209
- type: Input,
1210
- args: ['scTextEditable']
1211
- }], encode: [{
1212
- type: Input,
1213
- args: ['scTextEncode']
1214
- }], field: [{
1215
- type: Input,
1216
- args: ['scText']
1163
+ class TextDirective {
1164
+ constructor(viewContainer, templateRef) {
1165
+ this.viewContainer = viewContainer;
1166
+ this.templateRef = templateRef;
1167
+ this.editable = true;
1168
+ this.encode = true;
1169
+ }
1170
+ ngOnChanges(changes) {
1171
+ if (changes.field || changes.editable || changes.encode) {
1172
+ if (!this.viewRef) {
1173
+ this.viewContainer.clear();
1174
+ this.viewRef = this.viewContainer.createEmbeddedView(this.templateRef);
1175
+ }
1176
+ this.updateView();
1177
+ }
1178
+ }
1179
+ updateView() {
1180
+ const field = this.field;
1181
+ let editable = this.editable;
1182
+ if (!field || (!field.editable && (field.value === undefined || field.value === ''))) {
1183
+ return;
1184
+ }
1185
+ // can't use editable value if we want to output unencoded
1186
+ if (!this.encode) {
1187
+ editable = false;
1188
+ }
1189
+ const html = field.editable && editable ? field.editable : field.value;
1190
+ const setDangerously = (field.editable && editable) || !this.encode;
1191
+ this.viewRef.rootNodes.forEach((node) => {
1192
+ if (setDangerously) {
1193
+ node.innerHTML = html;
1194
+ }
1195
+ else {
1196
+ node.textContent = html;
1197
+ }
1198
+ });
1199
+ }
1200
+ }
1201
+ TextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1202
+ TextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: TextDirective, selector: "[scText]", inputs: { editable: ["scTextEditable", "editable"], encode: ["scTextEncode", "encode"], field: ["scText", "field"] }, usesOnChanges: true, ngImport: i0 });
1203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextDirective, decorators: [{
1204
+ type: Directive,
1205
+ args: [{
1206
+ selector: '[scText]',
1207
+ }]
1208
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { editable: [{
1209
+ type: Input,
1210
+ args: ['scTextEditable']
1211
+ }], encode: [{
1212
+ type: Input,
1213
+ args: ['scTextEncode']
1214
+ }], field: [{
1215
+ type: Input,
1216
+ args: ['scText']
1217
1217
  }] } });
1218
1218
 
1219
- /**
1220
- * @param {T} value
1221
- * @returns {Promise | Observable | any} resolved value
1222
- */
1223
- function wrapIntoObservable(value) {
1224
- if (ɵisObservable(value)) {
1225
- return value;
1226
- }
1227
- if (ɵisPromise(value)) {
1228
- return from(Promise.resolve(value));
1229
- }
1230
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1231
- return of(value);
1219
+ /**
1220
+ * @param {T} value
1221
+ * @returns {Promise | Observable | any} resolved value
1222
+ */
1223
+ function wrapIntoObservable(value) {
1224
+ if (ɵisObservable(value)) {
1225
+ return value;
1226
+ }
1227
+ if (ɵisPromise(value)) {
1228
+ return from(Promise.resolve(value));
1229
+ }
1230
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1231
+ return of(value);
1232
1232
  }
1233
1233
 
1234
- /**
1235
- * @param {Injector} injector
1236
- * @param {ActivatedRoute} activatedRoute
1237
- * @param {Router} router
1238
- * @returns resolved data
1239
- */
1240
- function dataResolverFactory(injector, activatedRoute, router) {
1241
- /**
1242
- * @param {JssResolve<unknown> | Type<JssResolve<unknown>>} resolver
1243
- * @returns resolver instance
1244
- */
1245
- function getResolverInstance(resolver) {
1246
- return 'resolve' in resolver ? resolver : injector.get(resolver);
1247
- }
1248
- /**
1249
- * @param {ComponentFactoryResult} factory
1250
- * @returns {Array<[string, JssResolve<unknown>]>} resolver instances
1251
- */
1252
- function collectResolverInstances(factory) {
1253
- if (factory.resolve) {
1254
- const resolve = factory.resolve;
1255
- return Object.keys(factory.resolve).map((key) => [
1256
- key,
1257
- getResolverInstance(resolve[key]),
1258
- ]);
1259
- }
1260
- return [];
1261
- }
1262
- /**
1263
- * @param {JssResolve<unknown>} resolver
1264
- * @param {ComponentFactoryResult} factory
1265
- * @returns data
1266
- */
1267
- function _resolveData(resolver, factory) {
1268
- const data = resolver.resolve({
1269
- activatedRoute: activatedRoute.snapshot,
1270
- routerState: router.routerState.snapshot,
1271
- rendering: factory.componentDefinition,
1272
- });
1273
- const data$ = wrapIntoObservable(data);
1274
- return lastValueFrom(data$.pipe(take(1)));
1275
- }
1276
- return function resolveData(factories) {
1277
- return Promise.all(factories.map((factory) => {
1278
- const resolvers = collectResolverInstances(factory);
1279
- const pendingData = resolvers.map(([key, resolver]) => _resolveData(resolver, factory).then((data) => [key, data]));
1280
- return Promise.all(pendingData)
1281
- .then((allData) => allData.reduce((acc, [key, data]) => {
1282
- acc[key] = data;
1283
- return acc;
1284
- }, {}))
1285
- .then((data) => ({ factory, data }));
1286
- }));
1287
- };
1234
+ /**
1235
+ * @param {Injector} injector
1236
+ * @param {ActivatedRoute} activatedRoute
1237
+ * @param {Router} router
1238
+ * @returns resolved data
1239
+ */
1240
+ function dataResolverFactory(injector, activatedRoute, router) {
1241
+ /**
1242
+ * @param {JssResolve<unknown> | Type<JssResolve<unknown>>} resolver
1243
+ * @returns resolver instance
1244
+ */
1245
+ function getResolverInstance(resolver) {
1246
+ return 'resolve' in resolver ? resolver : injector.get(resolver);
1247
+ }
1248
+ /**
1249
+ * @param {ComponentFactoryResult} factory
1250
+ * @returns {Array<[string, JssResolve<unknown>]>} resolver instances
1251
+ */
1252
+ function collectResolverInstances(factory) {
1253
+ if (factory.resolve) {
1254
+ const resolve = factory.resolve;
1255
+ return Object.keys(factory.resolve).map((key) => [
1256
+ key,
1257
+ getResolverInstance(resolve[key]),
1258
+ ]);
1259
+ }
1260
+ return [];
1261
+ }
1262
+ /**
1263
+ * @param {JssResolve<unknown>} resolver
1264
+ * @param {ComponentFactoryResult} factory
1265
+ * @returns data
1266
+ */
1267
+ function _resolveData(resolver, factory) {
1268
+ const data = resolver.resolve({
1269
+ activatedRoute: activatedRoute.snapshot,
1270
+ routerState: router.routerState.snapshot,
1271
+ rendering: factory.componentDefinition,
1272
+ });
1273
+ const data$ = wrapIntoObservable(data);
1274
+ return lastValueFrom(data$.pipe(take(1)));
1275
+ }
1276
+ return function resolveData(factories) {
1277
+ return Promise.all(factories.map((factory) => {
1278
+ const resolvers = collectResolverInstances(factory);
1279
+ const pendingData = resolvers.map(([key, resolver]) => _resolveData(resolver, factory).then((data) => [key, data]));
1280
+ return Promise.all(pendingData)
1281
+ .then((allData) => allData.reduce((acc, [key, data]) => {
1282
+ acc[key] = data;
1283
+ return acc;
1284
+ }, {}))
1285
+ .then((data) => ({ factory, data }));
1286
+ }));
1287
+ };
1288
1288
  }
1289
1289
 
1290
- /**
1291
- * @param {boolean | string | string[] | UrlTree} value
1292
- * @returns instance of value
1293
- */
1294
- function isRedirectValue(value) {
1295
- return value instanceof UrlTree || typeof value === 'string' || Array.isArray(value);
1296
- }
1297
- /**
1298
- * Resolves components based on provided guards
1299
- * @param {Injector} injector
1300
- * @param {ActivatedRoute} activatedRoute
1301
- * @param {Router} router
1302
- * @returns {(factories: ComponentFactoryResult[]) => Promise<ComponentFactoryResult[]>} factory
1303
- */
1304
- function guardResolverFactory(injector, activatedRoute, router) {
1305
- /**
1306
- * @param {JssCanActivate | Type<JssCanActivate> | JssCanActivateFn} guard
1307
- * @returns resolved guard
1308
- */
1309
- function getGuardInstance(guard) {
1310
- if ('canActivate' in guard) {
1311
- return guard;
1312
- }
1313
- try {
1314
- // Class is provided
1315
- return injector.get(guard);
1316
- }
1317
- catch (_a) {
1318
- // Function is provided
1319
- return guard;
1320
- }
1321
- }
1322
- /**
1323
- * @param {ComponentFactoryResult} factory
1324
- * @returns {(JssCanActivate | JssCanActivateFn)[]} guard instances
1325
- */
1326
- function collectGuardInstances(factory) {
1327
- if (factory.canActivate) {
1328
- return Array.isArray(factory.canActivate)
1329
- ? factory.canActivate.map(getGuardInstance)
1330
- : [getGuardInstance(factory.canActivate)];
1331
- }
1332
- return [];
1333
- }
1334
- /**
1335
- *
1336
- * @param {JssCanActivate | JssCanActivateFn} guard
1337
- * @param {ComponentFactoryResult} factory
1338
- * @returns canActivate
1339
- */
1340
- function resolveGuard(guard, factory) {
1341
- const canActivate = 'canActivate' in guard ? guard.canActivate : guard;
1342
- const guardValue = canActivate({
1343
- activatedRoute: activatedRoute.snapshot,
1344
- routerState: router.routerState.snapshot,
1345
- rendering: factory.componentDefinition,
1346
- });
1347
- const canActivate$ = wrapIntoObservable(guardValue);
1348
- return lastValueFrom(canActivate$.pipe(take(1), mergeMap((value) => {
1349
- if (isRedirectValue(value)) {
1350
- return throwError(() => new Error(value.toString()));
1351
- }
1352
- else {
1353
- return of(value);
1354
- }
1355
- })));
1356
- }
1357
- return function resolveGuards(factories) {
1358
- const resolved = factories.map((factory) => {
1359
- const guards = collectGuardInstances(factory);
1360
- const pending = guards.map((guard) => resolveGuard(guard, factory));
1361
- return Promise.all(pending)
1362
- .then((canActive) => canActive.every((v) => v))
1363
- .then((canActivate) => ({
1364
- factory,
1365
- canActivate,
1366
- }));
1367
- });
1368
- return Promise.all(resolved).then((mapped) => mapped.filter((m) => m.canActivate).map((m) => m.factory));
1369
- };
1290
+ /**
1291
+ * @param {boolean | string | string[] | UrlTree} value
1292
+ * @returns instance of value
1293
+ */
1294
+ function isRedirectValue(value) {
1295
+ return value instanceof UrlTree || typeof value === 'string' || Array.isArray(value);
1296
+ }
1297
+ /**
1298
+ * Resolves components based on provided guards
1299
+ * @param {Injector} injector
1300
+ * @param {ActivatedRoute} activatedRoute
1301
+ * @param {Router} router
1302
+ * @returns {(factories: ComponentFactoryResult[]) => Promise<ComponentFactoryResult[]>} factory
1303
+ */
1304
+ function guardResolverFactory(injector, activatedRoute, router) {
1305
+ /**
1306
+ * @param {JssCanActivate | Type<JssCanActivate> | JssCanActivateFn} guard
1307
+ * @returns resolved guard
1308
+ */
1309
+ function getGuardInstance(guard) {
1310
+ if ('canActivate' in guard) {
1311
+ return guard;
1312
+ }
1313
+ try {
1314
+ // Class is provided
1315
+ return injector.get(guard);
1316
+ }
1317
+ catch (_a) {
1318
+ // Function is provided
1319
+ return guard;
1320
+ }
1321
+ }
1322
+ /**
1323
+ * @param {ComponentFactoryResult} factory
1324
+ * @returns {(JssCanActivate | JssCanActivateFn)[]} guard instances
1325
+ */
1326
+ function collectGuardInstances(factory) {
1327
+ if (factory.canActivate) {
1328
+ return Array.isArray(factory.canActivate)
1329
+ ? factory.canActivate.map(getGuardInstance)
1330
+ : [getGuardInstance(factory.canActivate)];
1331
+ }
1332
+ return [];
1333
+ }
1334
+ /**
1335
+ *
1336
+ * @param {JssCanActivate | JssCanActivateFn} guard
1337
+ * @param {ComponentFactoryResult} factory
1338
+ * @returns canActivate
1339
+ */
1340
+ function resolveGuard(guard, factory) {
1341
+ const canActivate = 'canActivate' in guard ? guard.canActivate : guard;
1342
+ const guardValue = canActivate({
1343
+ activatedRoute: activatedRoute.snapshot,
1344
+ routerState: router.routerState.snapshot,
1345
+ rendering: factory.componentDefinition,
1346
+ });
1347
+ const canActivate$ = wrapIntoObservable(guardValue);
1348
+ return lastValueFrom(canActivate$.pipe(take(1), mergeMap((value) => {
1349
+ if (isRedirectValue(value)) {
1350
+ return throwError(() => new Error(value.toString()));
1351
+ }
1352
+ else {
1353
+ return of(value);
1354
+ }
1355
+ })));
1356
+ }
1357
+ return function resolveGuards(factories) {
1358
+ const resolved = factories.map((factory) => {
1359
+ const guards = collectGuardInstances(factory);
1360
+ const pending = guards.map((guard) => resolveGuard(guard, factory));
1361
+ return Promise.all(pending)
1362
+ .then((canActive) => canActive.every((v) => v))
1363
+ .then((canActivate) => ({
1364
+ factory,
1365
+ canActivate,
1366
+ }));
1367
+ });
1368
+ return Promise.all(resolved).then((mapped) => mapped.filter((m) => m.canActivate).map((m) => m.factory));
1369
+ };
1370
1370
  }
1371
1371
 
1372
- class MissingComponentComponent {
1373
- }
1374
- MissingComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MissingComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1372
+ class MissingComponentComponent {
1373
+ }
1374
+ MissingComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MissingComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1375
1375
  MissingComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MissingComponentComponent, selector: "sc-missing-component", inputs: { rendering: "rendering" }, ngImport: i0, template: `
1376
1376
  <div
1377
1377
  style="background: darkorange; outline: 5px solid orange; padding: 10px; color: white; max-width: 500px;"
@@ -1379,11 +1379,11 @@ MissingComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
1379
1379
  <h2>{{ rendering.componentName }}</h2>
1380
1380
  <p>JSS component is missing Angular component implementation.</p>
1381
1381
  </div>
1382
- `, isInline: true });
1383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MissingComponentComponent, decorators: [{
1384
- type: Component,
1385
- args: [{
1386
- selector: 'sc-missing-component',
1382
+ `, isInline: true });
1383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MissingComponentComponent, decorators: [{
1384
+ type: Component,
1385
+ args: [{
1386
+ selector: 'sc-missing-component',
1387
1387
  template: `
1388
1388
  <div
1389
1389
  style="background: darkorange; outline: 5px solid orange; padding: 10px; color: white; max-width: 500px;"
@@ -1391,151 +1391,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1391
1391
  <h2>{{ rendering.componentName }}</h2>
1392
1392
  <p>JSS component is missing Angular component implementation.</p>
1393
1393
  </div>
1394
- `,
1395
- }]
1396
- }], propDecorators: { rendering: [{
1397
- type: Input
1394
+ `,
1395
+ }]
1396
+ }], propDecorators: { rendering: [{
1397
+ type: Input
1398
1398
  }] } });
1399
1399
 
1400
- class JssModule {
1401
- /**
1402
- * Instantiates the JSS module with no component factory.
1403
- * Useful for using it from libraries. Most of the time you'd want withComponents()
1404
- * @returns {ModuleWithProviders<JssModule>} module
1405
- */
1406
- static forRoot() {
1407
- return {
1408
- ngModule: JssModule,
1409
- providers: [
1410
- DatePipe,
1411
- JssComponentFactoryService,
1412
- {
1413
- provide: GUARD_RESOLVER,
1414
- useFactory: guardResolverFactory,
1415
- deps: [Injector, ActivatedRoute, Router],
1416
- },
1417
- {
1418
- provide: DATA_RESOLVER,
1419
- useFactory: dataResolverFactory,
1420
- deps: [Injector, ActivatedRoute, Router],
1421
- },
1422
- ],
1423
- };
1424
- }
1425
- /**
1426
- * Instantiates a module for a lazy-loaded JSS component
1427
- * @param {Type<unknown>} component
1428
- * @returns {ModuleWithProviders<JssModule>} module
1429
- */
1430
- static forChild(component) {
1431
- return {
1432
- ngModule: JssModule,
1433
- providers: [
1434
- { provide: ROUTES, useValue: [], multi: true },
1435
- { provide: DYNAMIC_COMPONENT, useValue: component },
1436
- ],
1437
- };
1438
- }
1439
- /**
1440
- * Instantiates the JSS module and specifies the mapping from component name to component implementation.
1441
- * Appropriate when defining the set of JSS components that your app is aware of.
1442
- * @param {ComponentNameAndType[]} components
1443
- * @param {ComponentNameAndModule[]} [lazyComponents]
1444
- * @returns {ModuleWithProviders<JssModule>} module
1445
- */
1446
- static withComponents(components, lazyComponents) {
1447
- return {
1448
- ngModule: JssModule,
1449
- providers: [
1450
- { provide: PLACEHOLDER_COMPONENTS, useValue: components },
1451
- { provide: PLACEHOLDER_LAZY_COMPONENTS, useValue: lazyComponents || [] },
1452
- { provide: ROUTES, useValue: lazyComponents || [], multi: true },
1453
- { provide: PLACEHOLDER_MISSING_COMPONENT_COMPONENT, useValue: MissingComponentComponent },
1454
- { provide: PLACEHOLDER_HIDDEN_RENDERING_COMPONENT, useValue: HiddenRenderingComponent },
1455
- ...JssModule.forRoot().providers,
1456
- ],
1457
- };
1458
- }
1459
- }
1460
- JssModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1461
- JssModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: JssModule, declarations: [FileDirective,
1462
- ImageDirective,
1463
- LinkDirective,
1464
- RouterLinkDirective,
1465
- GenericLinkDirective,
1466
- DateDirective,
1467
- RenderEachDirective,
1468
- RenderEmptyDirective,
1469
- PlaceholderLoadingDirective,
1470
- RenderComponentComponent,
1471
- PlaceholderComponent,
1472
- RawComponent,
1473
- RichTextDirective,
1474
- TextDirective,
1475
- MissingComponentComponent,
1476
- HiddenRenderingComponent,
1477
- EditFrameComponent], imports: [CommonModule], exports: [FileDirective,
1478
- ImageDirective,
1479
- DateDirective,
1480
- LinkDirective,
1481
- RouterLinkDirective,
1482
- GenericLinkDirective,
1483
- RenderEachDirective,
1484
- RenderEmptyDirective,
1485
- RenderComponentComponent,
1486
- PlaceholderComponent,
1487
- HiddenRenderingComponent,
1488
- PlaceholderLoadingDirective,
1489
- RichTextDirective,
1490
- TextDirective,
1491
- EditFrameComponent] });
1492
- JssModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, imports: [CommonModule] });
1493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, decorators: [{
1494
- type: NgModule,
1495
- args: [{
1496
- imports: [CommonModule],
1497
- declarations: [
1498
- FileDirective,
1499
- ImageDirective,
1500
- LinkDirective,
1501
- RouterLinkDirective,
1502
- GenericLinkDirective,
1503
- DateDirective,
1504
- RenderEachDirective,
1505
- RenderEmptyDirective,
1506
- PlaceholderLoadingDirective,
1507
- RenderComponentComponent,
1508
- PlaceholderComponent,
1509
- RawComponent,
1510
- RichTextDirective,
1511
- TextDirective,
1512
- MissingComponentComponent,
1513
- HiddenRenderingComponent,
1514
- EditFrameComponent,
1515
- ],
1516
- exports: [
1517
- FileDirective,
1518
- ImageDirective,
1519
- DateDirective,
1520
- LinkDirective,
1521
- RouterLinkDirective,
1522
- GenericLinkDirective,
1523
- RenderEachDirective,
1524
- RenderEmptyDirective,
1525
- RenderComponentComponent,
1526
- PlaceholderComponent,
1527
- HiddenRenderingComponent,
1528
- PlaceholderLoadingDirective,
1529
- RichTextDirective,
1530
- TextDirective,
1531
- EditFrameComponent,
1532
- ],
1533
- entryComponents: [RawComponent, MissingComponentComponent],
1534
- }]
1400
+ class JssModule {
1401
+ /**
1402
+ * Instantiates the JSS module with no component factory.
1403
+ * Useful for using it from libraries. Most of the time you'd want withComponents()
1404
+ * @returns {ModuleWithProviders<JssModule>} module
1405
+ */
1406
+ static forRoot() {
1407
+ return {
1408
+ ngModule: JssModule,
1409
+ providers: [
1410
+ DatePipe,
1411
+ JssComponentFactoryService,
1412
+ {
1413
+ provide: GUARD_RESOLVER,
1414
+ useFactory: guardResolverFactory,
1415
+ deps: [Injector, ActivatedRoute, Router],
1416
+ },
1417
+ {
1418
+ provide: DATA_RESOLVER,
1419
+ useFactory: dataResolverFactory,
1420
+ deps: [Injector, ActivatedRoute, Router],
1421
+ },
1422
+ ],
1423
+ };
1424
+ }
1425
+ /**
1426
+ * Instantiates a module for a lazy-loaded JSS component
1427
+ * @param {Type<unknown>} component
1428
+ * @returns {ModuleWithProviders<JssModule>} module
1429
+ */
1430
+ static forChild(component) {
1431
+ return {
1432
+ ngModule: JssModule,
1433
+ providers: [
1434
+ { provide: ROUTES, useValue: [], multi: true },
1435
+ { provide: DYNAMIC_COMPONENT, useValue: component },
1436
+ ],
1437
+ };
1438
+ }
1439
+ /**
1440
+ * Instantiates the JSS module and specifies the mapping from component name to component implementation.
1441
+ * Appropriate when defining the set of JSS components that your app is aware of.
1442
+ * @param {ComponentNameAndType[]} components
1443
+ * @param {ComponentNameAndModule[]} [lazyComponents]
1444
+ * @returns {ModuleWithProviders<JssModule>} module
1445
+ */
1446
+ static withComponents(components, lazyComponents) {
1447
+ return {
1448
+ ngModule: JssModule,
1449
+ providers: [
1450
+ { provide: PLACEHOLDER_COMPONENTS, useValue: components },
1451
+ { provide: PLACEHOLDER_LAZY_COMPONENTS, useValue: lazyComponents || [] },
1452
+ { provide: ROUTES, useValue: lazyComponents || [], multi: true },
1453
+ { provide: PLACEHOLDER_MISSING_COMPONENT_COMPONENT, useValue: MissingComponentComponent },
1454
+ { provide: PLACEHOLDER_HIDDEN_RENDERING_COMPONENT, useValue: HiddenRenderingComponent },
1455
+ ...JssModule.forRoot().providers,
1456
+ ],
1457
+ };
1458
+ }
1459
+ }
1460
+ JssModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1461
+ JssModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: JssModule, declarations: [FileDirective,
1462
+ ImageDirective,
1463
+ LinkDirective,
1464
+ RouterLinkDirective,
1465
+ GenericLinkDirective,
1466
+ DateDirective,
1467
+ RenderEachDirective,
1468
+ RenderEmptyDirective,
1469
+ PlaceholderLoadingDirective,
1470
+ RenderComponentComponent,
1471
+ PlaceholderComponent,
1472
+ RawComponent,
1473
+ RichTextDirective,
1474
+ TextDirective,
1475
+ MissingComponentComponent,
1476
+ HiddenRenderingComponent,
1477
+ EditFrameComponent], imports: [CommonModule], exports: [FileDirective,
1478
+ ImageDirective,
1479
+ DateDirective,
1480
+ LinkDirective,
1481
+ RouterLinkDirective,
1482
+ GenericLinkDirective,
1483
+ RenderEachDirective,
1484
+ RenderEmptyDirective,
1485
+ RenderComponentComponent,
1486
+ PlaceholderComponent,
1487
+ HiddenRenderingComponent,
1488
+ PlaceholderLoadingDirective,
1489
+ RichTextDirective,
1490
+ TextDirective,
1491
+ EditFrameComponent] });
1492
+ JssModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, imports: [CommonModule] });
1493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: JssModule, decorators: [{
1494
+ type: NgModule,
1495
+ args: [{
1496
+ imports: [CommonModule],
1497
+ declarations: [
1498
+ FileDirective,
1499
+ ImageDirective,
1500
+ LinkDirective,
1501
+ RouterLinkDirective,
1502
+ GenericLinkDirective,
1503
+ DateDirective,
1504
+ RenderEachDirective,
1505
+ RenderEmptyDirective,
1506
+ PlaceholderLoadingDirective,
1507
+ RenderComponentComponent,
1508
+ PlaceholderComponent,
1509
+ RawComponent,
1510
+ RichTextDirective,
1511
+ TextDirective,
1512
+ MissingComponentComponent,
1513
+ HiddenRenderingComponent,
1514
+ EditFrameComponent,
1515
+ ],
1516
+ exports: [
1517
+ FileDirective,
1518
+ ImageDirective,
1519
+ DateDirective,
1520
+ LinkDirective,
1521
+ RouterLinkDirective,
1522
+ GenericLinkDirective,
1523
+ RenderEachDirective,
1524
+ RenderEmptyDirective,
1525
+ RenderComponentComponent,
1526
+ PlaceholderComponent,
1527
+ HiddenRenderingComponent,
1528
+ PlaceholderLoadingDirective,
1529
+ RichTextDirective,
1530
+ TextDirective,
1531
+ EditFrameComponent,
1532
+ ],
1533
+ entryComponents: [RawComponent, MissingComponentComponent],
1534
+ }]
1535
1535
  }] });
1536
1536
 
1537
- /**
1538
- * Generated bundle index. Do not edit.
1537
+ /**
1538
+ * Generated bundle index. Do not edit.
1539
1539
  */
1540
1540
 
1541
1541
  export { ComponentNameAndType, DYNAMIC_COMPONENT, DateDirective, EditFrameComponent, FileDirective, GenericLinkDirective, HiddenRenderingComponent, ImageDirective, JssModule, LinkDirective, PlaceholderComponent, PlaceholderLoadingDirective, RenderComponentComponent, RenderEachDirective, RenderEmptyDirective, RichTextDirective, RouterLinkDirective, TextDirective, isRawRendering };