@o3r/components 11.6.0-prerelease.2 → 11.6.0-prerelease.21
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.
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts +3 -9
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.js +34 -37
- package/builders/component-extractor/helpers/component/component-config.extractor.d.ts +2 -15
- package/builders/component-extractor/helpers/component/component-config.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component-config.extractor.js +41 -48
- package/builders/component-extractor/helpers/component/component.extractor.d.ts +2 -10
- package/builders/component-extractor/helpers/component/component.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component.extractor.js +20 -25
- package/builders/component-extractor/helpers/component/component.parser.d.ts +2 -3
- package/builders/component-extractor/helpers/component/component.parser.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component.parser.js +11 -14
- package/builders/component-extractor/index.d.ts.map +1 -1
- package/builders/component-extractor/index.js +25 -27
- package/builders/component-extractor/schema.d.ts.map +1 -1
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts +2 -2
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts.map +1 -1
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.js +1 -1
- package/builders/metadata-check/index.d.ts.map +1 -1
- package/builders/metadata-check/schema.d.ts.map +1 -1
- package/core/component.output.d.ts.map +1 -1
- package/core/rendering/helpers.d.ts +0 -1
- package/core/rendering/helpers.d.ts.map +1 -1
- package/devkit/components-devkit.interface.d.ts.map +1 -1
- package/devkit/components-devtools.message.service.d.ts +2 -3
- package/devkit/components-devtools.message.service.d.ts.map +1 -1
- package/devkit/components-devtools.module.d.ts.map +1 -1
- package/devkit/components-devtools.token.d.ts +1 -1
- package/devkit/components-devtools.token.d.ts.map +1 -1
- package/devkit/inspector/ng/ng.d.ts +3 -1
- package/devkit/inspector/ng/ng.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.helpers.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.service.d.ts.map +1 -1
- package/esm2022/core/component.output.mjs +1 -1
- package/esm2022/core/rendering/helpers.mjs +3 -4
- package/esm2022/devkit/components-devkit.interface.mjs +7 -7
- package/esm2022/devkit/components-devtools.message.service.mjs +15 -16
- package/esm2022/devkit/components-devtools.module.mjs +10 -10
- package/esm2022/devkit/components-devtools.token.mjs +2 -2
- package/esm2022/devkit/index.mjs +1 -1
- package/esm2022/devkit/inspector/index.mjs +1 -1
- package/esm2022/devkit/inspector/ng/ng.mjs +1 -1
- package/esm2022/devkit/inspector/otter-inspector.helpers.mjs +8 -8
- package/esm2022/devkit/inspector/otter-inspector.service.mjs +8 -8
- package/esm2022/rules-engine/placeholder.action-handler.mjs +23 -21
- package/esm2022/rules-engine/placeholder.interfaces.mjs +1 -1
- package/esm2022/rules-engine/placeholder.rules-engine.effect.mjs +28 -25
- package/esm2022/rules-engine/placeholder.rules-engine.module.mjs +10 -10
- package/esm2022/rules-engine/public_api.mjs +2 -2
- package/esm2022/stores/index.mjs +2 -2
- package/esm2022/stores/placeholder-request/index.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.actions.mjs +3 -3
- package/esm2022/stores/placeholder-request/placeholder-request.module.mjs +9 -9
- package/esm2022/stores/placeholder-request/placeholder-request.reducer.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.selectors.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.state.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.sync.mjs +3 -3
- package/esm2022/stores/placeholder-template/index.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.actions.mjs +2 -2
- package/esm2022/stores/placeholder-template/placeholder-template.module.mjs +9 -9
- package/esm2022/stores/placeholder-template/placeholder-template.reducer.mjs +3 -3
- package/esm2022/stores/placeholder-template/placeholder-template.selectors.mjs +8 -8
- package/esm2022/stores/placeholder-template/placeholder-template.state.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.sync.mjs +2 -2
- package/esm2022/tools/component-replacement/c11n.directive.mjs +9 -8
- package/esm2022/tools/component-replacement/c11n.helpers.mjs +1 -1
- package/esm2022/tools/component-replacement/c11n.mock.module.mjs +15 -15
- package/esm2022/tools/component-replacement/c11n.module.mjs +10 -9
- package/esm2022/tools/component-replacement/c11n.service.mjs +7 -7
- package/esm2022/tools/component-replacement/c11n.token.mjs +2 -2
- package/esm2022/tools/component-replacement/index.mjs +3 -3
- package/esm2022/tools/pipes/capitalize/capitalize.module.mjs +7 -7
- package/esm2022/tools/pipes/capitalize/capitalize.pipe.mjs +8 -8
- package/esm2022/tools/pipes/duration/duration.module.mjs +7 -7
- package/esm2022/tools/pipes/duration/duration.pipe.mjs +10 -9
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.module.mjs +7 -7
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.pipe.mjs +8 -8
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.module.mjs +7 -7
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.pipe.mjs +9 -9
- package/esm2022/tools/placeholder/placeholder.component.mjs +18 -22
- package/esm2022/tools/placeholder/placeholder.interface.mjs +1 -1
- package/esm2022/tools/placeholder/placeholder.module.mjs +11 -11
- package/fesm2022/o3r-components-rules-engine.mjs +41 -36
- package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-components.mjs +241 -244
- package/fesm2022/o3r-components.mjs.map +1 -1
- package/package.json +11 -11
- package/rules-engine/placeholder.action-handler.d.ts +1 -1
- package/rules-engine/placeholder.action-handler.d.ts.map +1 -1
- package/rules-engine/placeholder.interfaces.d.ts.map +1 -1
- package/rules-engine/placeholder.rules-engine.effect.d.ts +2 -2
- package/rules-engine/placeholder.rules-engine.effect.d.ts.map +1 -1
- package/rules-engine/placeholder.rules-engine.module.d.ts.map +1 -1
- package/rules-engine/public_api.d.ts +1 -1
- package/rules-engine/public_api.d.ts.map +1 -1
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +1 -1
- package/schematics/ng-add/helpers/devtools-registration.d.ts +0 -2
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -1
- package/schematics/ng-add/helpers/devtools-registration.js +1 -3
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +3 -4
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-update/v10-0/index.d.ts.map +1 -1
- package/schematics/ng-update/v10-0/index.js +2 -1
- package/stores/index.d.ts +1 -1
- package/stores/index.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.actions.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.module.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.reducer.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.selectors.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.state.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.sync.d.ts +1 -1
- package/stores/placeholder-request/placeholder-request.sync.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.actions.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.module.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.reducer.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.selectors.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.state.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.sync.d.ts +2 -2
- package/stores/placeholder-template/placeholder-template.sync.d.ts.map +1 -1
- package/tools/component-replacement/c11n.directive.d.ts.map +1 -1
- package/tools/component-replacement/c11n.helpers.d.ts.map +1 -1
- package/tools/component-replacement/c11n.mock.module.d.ts.map +1 -1
- package/tools/component-replacement/c11n.module.d.ts +1 -0
- package/tools/component-replacement/c11n.module.d.ts.map +1 -1
- package/tools/component-replacement/c11n.service.d.ts.map +1 -1
- package/tools/component-replacement/c11n.token.d.ts.map +1 -1
- package/tools/component-replacement/index.d.ts +2 -2
- package/tools/component-replacement/index.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.module.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.pipe.d.ts.map +1 -1
- package/tools/pipes/duration/duration.module.d.ts.map +1 -1
- package/tools/pipes/duration/duration.pipe.d.ts +1 -0
- package/tools/pipes/duration/duration.pipe.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.module.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.pipe.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.module.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.pipe.d.ts.map +1 -1
- package/tools/placeholder/placeholder.component.d.ts.map +1 -1
- package/tools/placeholder/placeholder.interface.d.ts.map +1 -1
- package/tools/placeholder/placeholder.module.d.ts.map +1 -1
|
@@ -2,10 +2,10 @@ import { of, from, observeOn, animationFrameScheduler, BehaviorSubject, Subscrip
|
|
|
2
2
|
import { mergeMap, bufferCount, concatMap, delay, scan, tap, filter, distinctUntilChanged, map, mapTo, switchMap } from 'rxjs/operators';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, NgModule, Injectable, Optional, Inject, SimpleChange, forwardRef, Directive, Input, Pipe, Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
|
5
|
-
import { asyncProps, createEntityAsyncRequestAdapter, asyncStoreItemAdapter, asyncEntitySerializer, otterComponentInfoPropertyName, sendOtterMessage, filterMessageContent } from '@o3r/core';
|
|
6
|
-
import * as i1$1 from '@o3r/logger';
|
|
7
5
|
import * as i1 from '@ngrx/store';
|
|
8
6
|
import { createAction, props, on, createReducer, StoreModule, createFeatureSelector, createSelector } from '@ngrx/store';
|
|
7
|
+
import { asyncProps, createEntityAsyncRequestAdapter, asyncStoreItemAdapter, asyncEntitySerializer, otterComponentInfoPropertyName, sendOtterMessage, filterMessageContent } from '@o3r/core';
|
|
8
|
+
import * as i1$1 from '@o3r/logger';
|
|
9
9
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
10
10
|
import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
11
11
|
import * as i2 from '@angular/common';
|
|
@@ -17,7 +17,6 @@ import { CommonModule } from '@angular/common';
|
|
|
17
17
|
* of similar components.
|
|
18
18
|
* @param delayMs Delay between data emits
|
|
19
19
|
* @param concurrency Amount of elements that should be emitted at once
|
|
20
|
-
* @returns
|
|
21
20
|
*/
|
|
22
21
|
function lazyArray(delayMs = 0, concurrency = 2) {
|
|
23
22
|
let isFirstEmission = true;
|
|
@@ -46,97 +45,14 @@ function lazyArray(delayMs = 0, concurrency = 2) {
|
|
|
46
45
|
* @param message message to check
|
|
47
46
|
*/
|
|
48
47
|
const isComponentsMessage = (message) => {
|
|
49
|
-
return message && (message.dataType === 'requestMessages'
|
|
50
|
-
message.dataType === 'connect'
|
|
51
|
-
message.dataType === 'selectedComponentInfo'
|
|
52
|
-
message.dataType === 'isComponentSelectionAvailable'
|
|
53
|
-
message.dataType === 'placeholderMode'
|
|
54
|
-
message.dataType === 'toggleInspector');
|
|
48
|
+
return message && (message.dataType === 'requestMessages'
|
|
49
|
+
|| message.dataType === 'connect'
|
|
50
|
+
|| message.dataType === 'selectedComponentInfo'
|
|
51
|
+
|| message.dataType === 'isComponentSelectionAvailable'
|
|
52
|
+
|| message.dataType === 'placeholderMode'
|
|
53
|
+
|| message.dataType === 'toggleInspector');
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
const ACTION_DELETE_ENTITY = '[PlaceholderTemplate] delete entity';
|
|
58
|
-
const ACTION_SET_ENTITY = '[PlaceholderTemplate] set entity';
|
|
59
|
-
const ACTION_TOGGLE_MODE = '[PlaceholderTemplate] toggle mode';
|
|
60
|
-
/** Action to delete a specific entity */
|
|
61
|
-
const deletePlaceholderTemplateEntity = createAction(ACTION_DELETE_ENTITY, props());
|
|
62
|
-
/** Action to clear all placeholderTemplate and fill the store with the payload */
|
|
63
|
-
const setPlaceholderTemplateEntity = createAction(ACTION_SET_ENTITY, props());
|
|
64
|
-
const togglePlaceholderModeTemplate = createAction(ACTION_TOGGLE_MODE, props());
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* PlaceholderTemplate Store adapter
|
|
68
|
-
*/
|
|
69
|
-
const placeholderTemplateAdapter = createEntityAdapter({
|
|
70
|
-
selectId: (model) => model.id
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* PlaceholderTemplate Store initial value
|
|
74
|
-
*/
|
|
75
|
-
const placeholderTemplateInitialState = placeholderTemplateAdapter.getInitialState({
|
|
76
|
-
mode: 'normal'
|
|
77
|
-
});
|
|
78
|
-
/**
|
|
79
|
-
* List of basic actions for PlaceholderTemplate Store
|
|
80
|
-
*/
|
|
81
|
-
const placeholderTemplateReducerFeatures = [
|
|
82
|
-
on(setPlaceholderTemplateEntity, (state, payload) => placeholderTemplateAdapter.addOne(payload.entity, placeholderTemplateAdapter.removeOne(payload.entity.id, state))),
|
|
83
|
-
on(deletePlaceholderTemplateEntity, (state, payload) => {
|
|
84
|
-
const id = payload.id;
|
|
85
|
-
if (!id || !state.entities[id]) {
|
|
86
|
-
return state;
|
|
87
|
-
}
|
|
88
|
-
return placeholderTemplateAdapter.removeOne(id, state);
|
|
89
|
-
}),
|
|
90
|
-
on(togglePlaceholderModeTemplate, (state, payload) => {
|
|
91
|
-
return {
|
|
92
|
-
...state,
|
|
93
|
-
mode: payload.mode
|
|
94
|
-
};
|
|
95
|
-
})
|
|
96
|
-
];
|
|
97
|
-
/**
|
|
98
|
-
* PlaceholderTemplate Store reducer
|
|
99
|
-
*/
|
|
100
|
-
const placeholderTemplateReducer = createReducer(placeholderTemplateInitialState, ...placeholderTemplateReducerFeatures);
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Name of the PlaceholderTemplate Store
|
|
104
|
-
*/
|
|
105
|
-
const PLACEHOLDER_TEMPLATE_STORE_NAME = 'placeholderTemplate';
|
|
106
|
-
|
|
107
|
-
/** Token of the PlaceholderTemplate reducer */
|
|
108
|
-
const PLACEHOLDER_TEMPLATE_REDUCER_TOKEN = new InjectionToken('Feature PlaceholderTemplate Reducer');
|
|
109
|
-
/** Provide default reducer for PlaceholderTemplate store */
|
|
110
|
-
function getDefaultPlaceholderTemplateReducer() {
|
|
111
|
-
return placeholderTemplateReducer;
|
|
112
|
-
}
|
|
113
|
-
class PlaceholderTemplateStoreModule {
|
|
114
|
-
static forRoot(reducerFactory) {
|
|
115
|
-
return {
|
|
116
|
-
ngModule: PlaceholderTemplateStoreModule,
|
|
117
|
-
providers: [
|
|
118
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: reducerFactory }
|
|
119
|
-
]
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
123
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
124
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateStoreModule, providers: [
|
|
125
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
126
|
-
], imports: [StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)] }); }
|
|
127
|
-
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: PlaceholderTemplateStoreModule, decorators: [{
|
|
129
|
-
type: NgModule,
|
|
130
|
-
args: [{
|
|
131
|
-
imports: [
|
|
132
|
-
StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)
|
|
133
|
-
],
|
|
134
|
-
providers: [
|
|
135
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
136
|
-
]
|
|
137
|
-
}]
|
|
138
|
-
}] });
|
|
139
|
-
|
|
140
56
|
const ACTION_FAIL_ENTITIES = '[PlaceholderRequest] fail entities';
|
|
141
57
|
const ACTION_SET_ENTITY_FROM_URL = '[PlaceholderRequest] set entity from url';
|
|
142
58
|
const ACTION_CANCEL_REQUEST = '[PlaceholderRequest] cancel request';
|
|
@@ -240,13 +156,13 @@ class PlaceholderRequestStoreModule {
|
|
|
240
156
|
]
|
|
241
157
|
};
|
|
242
158
|
}
|
|
243
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
244
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
245
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
159
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRequestStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
160
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRequestStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
161
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRequestStoreModule, providers: [
|
|
246
162
|
{ provide: PLACEHOLDER_REQUEST_REDUCER_TOKEN, useFactory: getDefaultplaceholderRequestReducer }
|
|
247
163
|
], imports: [StoreModule.forFeature(PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_REQUEST_REDUCER_TOKEN)] }); }
|
|
248
164
|
}
|
|
249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderRequestStoreModule, decorators: [{
|
|
250
166
|
type: NgModule,
|
|
251
167
|
args: [{
|
|
252
168
|
imports: [
|
|
@@ -286,6 +202,89 @@ const placeholderRequestStorageSync = {
|
|
|
286
202
|
deserialize: placeholderRequestStorageDeserializer
|
|
287
203
|
};
|
|
288
204
|
|
|
205
|
+
const ACTION_DELETE_ENTITY = '[PlaceholderTemplate] delete entity';
|
|
206
|
+
const ACTION_SET_ENTITY = '[PlaceholderTemplate] set entity';
|
|
207
|
+
const ACTION_TOGGLE_MODE = '[PlaceholderTemplate] toggle mode';
|
|
208
|
+
/** Action to delete a specific entity */
|
|
209
|
+
const deletePlaceholderTemplateEntity = createAction(ACTION_DELETE_ENTITY, props());
|
|
210
|
+
/** Action to clear all placeholderTemplate and fill the store with the payload */
|
|
211
|
+
const setPlaceholderTemplateEntity = createAction(ACTION_SET_ENTITY, props());
|
|
212
|
+
const togglePlaceholderModeTemplate = createAction(ACTION_TOGGLE_MODE, props());
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* PlaceholderTemplate Store adapter
|
|
216
|
+
*/
|
|
217
|
+
const placeholderTemplateAdapter = createEntityAdapter({
|
|
218
|
+
selectId: (model) => model.id
|
|
219
|
+
});
|
|
220
|
+
/**
|
|
221
|
+
* PlaceholderTemplate Store initial value
|
|
222
|
+
*/
|
|
223
|
+
const placeholderTemplateInitialState = placeholderTemplateAdapter.getInitialState({
|
|
224
|
+
mode: 'normal'
|
|
225
|
+
});
|
|
226
|
+
/**
|
|
227
|
+
* List of basic actions for PlaceholderTemplate Store
|
|
228
|
+
*/
|
|
229
|
+
const placeholderTemplateReducerFeatures = [
|
|
230
|
+
on(setPlaceholderTemplateEntity, (state, payload) => placeholderTemplateAdapter.addOne(payload.entity, placeholderTemplateAdapter.removeOne(payload.entity.id, state))),
|
|
231
|
+
on(deletePlaceholderTemplateEntity, (state, payload) => {
|
|
232
|
+
const id = payload.id;
|
|
233
|
+
if (!id || !state.entities[id]) {
|
|
234
|
+
return state;
|
|
235
|
+
}
|
|
236
|
+
return placeholderTemplateAdapter.removeOne(id, state);
|
|
237
|
+
}),
|
|
238
|
+
on(togglePlaceholderModeTemplate, (state, payload) => {
|
|
239
|
+
return {
|
|
240
|
+
...state,
|
|
241
|
+
mode: payload.mode
|
|
242
|
+
};
|
|
243
|
+
})
|
|
244
|
+
];
|
|
245
|
+
/**
|
|
246
|
+
* PlaceholderTemplate Store reducer
|
|
247
|
+
*/
|
|
248
|
+
const placeholderTemplateReducer = createReducer(placeholderTemplateInitialState, ...placeholderTemplateReducerFeatures);
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Name of the PlaceholderTemplate Store
|
|
252
|
+
*/
|
|
253
|
+
const PLACEHOLDER_TEMPLATE_STORE_NAME = 'placeholderTemplate';
|
|
254
|
+
|
|
255
|
+
/** Token of the PlaceholderTemplate reducer */
|
|
256
|
+
const PLACEHOLDER_TEMPLATE_REDUCER_TOKEN = new InjectionToken('Feature PlaceholderTemplate Reducer');
|
|
257
|
+
/** Provide default reducer for PlaceholderTemplate store */
|
|
258
|
+
function getDefaultPlaceholderTemplateReducer() {
|
|
259
|
+
return placeholderTemplateReducer;
|
|
260
|
+
}
|
|
261
|
+
class PlaceholderTemplateStoreModule {
|
|
262
|
+
static forRoot(reducerFactory) {
|
|
263
|
+
return {
|
|
264
|
+
ngModule: PlaceholderTemplateStoreModule,
|
|
265
|
+
providers: [
|
|
266
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: reducerFactory }
|
|
267
|
+
]
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
271
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
272
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateStoreModule, providers: [
|
|
273
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
274
|
+
], imports: [StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)] }); }
|
|
275
|
+
}
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderTemplateStoreModule, decorators: [{
|
|
277
|
+
type: NgModule,
|
|
278
|
+
args: [{
|
|
279
|
+
imports: [
|
|
280
|
+
StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)
|
|
281
|
+
],
|
|
282
|
+
providers: [
|
|
283
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
284
|
+
]
|
|
285
|
+
}]
|
|
286
|
+
}] });
|
|
287
|
+
|
|
289
288
|
const { selectEntities } = placeholderTemplateAdapter.getSelectors();
|
|
290
289
|
const selectPlaceholderTemplateState = createFeatureSelector(PLACEHOLDER_TEMPLATE_STORE_NAME);
|
|
291
290
|
/** Select the dictionary of PlaceholderTemplate entities */
|
|
@@ -308,7 +307,7 @@ const selectSortedTemplates = (placeholderId) => createSelector(selectPlaceholde
|
|
|
308
307
|
// The isPending will be considered true if any of the Url is still pending
|
|
309
308
|
let isPending = false;
|
|
310
309
|
const templates = [];
|
|
311
|
-
placeholderTemplate.urlsWithPriority.forEach(urlWithPriority => {
|
|
310
|
+
placeholderTemplate.urlsWithPriority.forEach((urlWithPriority) => {
|
|
312
311
|
const placeholderRequest = placeholderRequestState.entities[urlWithPriority.rawUrl];
|
|
313
312
|
if (placeholderRequest) {
|
|
314
313
|
// If one of the items is pending, we will wait to display all contents at the same time
|
|
@@ -331,7 +330,7 @@ const selectSortedTemplates = (placeholderId) => createSelector(selectPlaceholde
|
|
|
331
330
|
// Sort templates by priority
|
|
332
331
|
const orderedTemplates = templates.sort((template1, template2) => {
|
|
333
332
|
return (template2.priority - template1.priority) || 1;
|
|
334
|
-
}).filter(templateData => !!templateData.renderedTemplate);
|
|
333
|
+
}).filter((templateData) => !!templateData.renderedTemplate);
|
|
335
334
|
return { orderedTemplates, isPending };
|
|
336
335
|
});
|
|
337
336
|
/**
|
|
@@ -346,7 +345,7 @@ const selectPlaceholderRenderedTemplates = (placeholderId) => createSelector(sel
|
|
|
346
345
|
return;
|
|
347
346
|
}
|
|
348
347
|
return {
|
|
349
|
-
orderedRenderedTemplates: placeholderData.orderedTemplates?.map(placeholder => placeholder.renderedTemplate),
|
|
348
|
+
orderedRenderedTemplates: placeholderData.orderedTemplates?.map((placeholder) => placeholder.renderedTemplate),
|
|
350
349
|
isPending: placeholderData.isPending
|
|
351
350
|
};
|
|
352
351
|
});
|
|
@@ -408,7 +407,7 @@ function getTranslationsRec(node, rec) {
|
|
|
408
407
|
const translations = {};
|
|
409
408
|
subTranslations.forEach((s) => {
|
|
410
409
|
Object.entries(s || {}).forEach(([k, v]) => {
|
|
411
|
-
if (v.length) {
|
|
410
|
+
if (v.length > 0) {
|
|
412
411
|
translations[k] = v;
|
|
413
412
|
}
|
|
414
413
|
});
|
|
@@ -416,11 +415,11 @@ function getTranslationsRec(node, rec) {
|
|
|
416
415
|
if (component) {
|
|
417
416
|
const componentName = component.constructor.name;
|
|
418
417
|
const componentTranslations = Object.values(component[o3rInfoProperty]?.translations || {}).filter((t) => typeof t === 'string');
|
|
419
|
-
if (componentTranslations.length) {
|
|
418
|
+
if (componentTranslations.length > 0) {
|
|
420
419
|
translations[componentName] = componentTranslations;
|
|
421
420
|
}
|
|
422
421
|
}
|
|
423
|
-
return Object.keys(translations).length ? translations : undefined;
|
|
422
|
+
return Object.keys(translations).length > 0 ? translations : undefined;
|
|
424
423
|
}
|
|
425
424
|
/**
|
|
426
425
|
* Determine the translations of a node
|
|
@@ -445,7 +444,7 @@ function getAnalyticEventsRec(node, rec) {
|
|
|
445
444
|
const events = {};
|
|
446
445
|
subEvents.forEach((s) => {
|
|
447
446
|
Object.entries(s || {}).forEach(([k, v]) => {
|
|
448
|
-
if (v.length) {
|
|
447
|
+
if (v.length > 0) {
|
|
449
448
|
events[k] = v;
|
|
450
449
|
}
|
|
451
450
|
});
|
|
@@ -453,11 +452,11 @@ function getAnalyticEventsRec(node, rec) {
|
|
|
453
452
|
if (component && component[o3rInfoProperty]) {
|
|
454
453
|
const componentName = component.constructor.name;
|
|
455
454
|
const componentEvents = Object.values(component.analyticsEvents || {}).map((eventConstructor) => eventConstructor.name);
|
|
456
|
-
if (componentEvents.length) {
|
|
455
|
+
if (componentEvents.length > 0) {
|
|
457
456
|
events[componentName] = componentEvents;
|
|
458
457
|
}
|
|
459
458
|
}
|
|
460
|
-
return Object.keys(events).length ? events : undefined;
|
|
459
|
+
return Object.keys(events).length > 0 ? events : undefined;
|
|
461
460
|
}
|
|
462
461
|
/**
|
|
463
462
|
* Determine the analytics of a node
|
|
@@ -518,7 +517,6 @@ class OtterInspectorService {
|
|
|
518
517
|
const container = isContainer(parentHost)
|
|
519
518
|
? getOtterLikeComponentInfo(parent, parentHost)
|
|
520
519
|
: undefined;
|
|
521
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
522
520
|
const { component, host, ...infoToBeSent } = this.selectedComponent;
|
|
523
521
|
this.otterLikeComponentInfoToBeSent.next({
|
|
524
522
|
...infoToBeSent,
|
|
@@ -528,7 +526,7 @@ class OtterInspectorService {
|
|
|
528
526
|
isOtterLikeComponent(info) {
|
|
529
527
|
const hasConfigId = !!info.configId;
|
|
530
528
|
const hasTranslations = !!info.translations?.length;
|
|
531
|
-
const hasAnalytics =
|
|
529
|
+
const hasAnalytics = Object.keys(info.analytics || {}).length > 0;
|
|
532
530
|
return hasConfigId || hasTranslations || hasAnalytics;
|
|
533
531
|
}
|
|
534
532
|
findComponentInfo(node) {
|
|
@@ -623,10 +621,11 @@ class OtterInspectorService {
|
|
|
623
621
|
}`;
|
|
624
622
|
const inspectorDiv = document.createElement('div');
|
|
625
623
|
const inspectorSpan = document.createElement('span');
|
|
626
|
-
inspectorDiv.
|
|
624
|
+
inspectorDiv.append(inspectorSpan);
|
|
627
625
|
inspectorDiv.classList.add(INSPECTOR_CLASS);
|
|
628
|
-
document.head.
|
|
629
|
-
|
|
626
|
+
document.head.append(inspectorCss);
|
|
627
|
+
document.body.append(inspectorDiv);
|
|
628
|
+
this.inspectorDiv = inspectorDiv;
|
|
630
629
|
}
|
|
631
630
|
/**
|
|
632
631
|
* Toggle the inspector.
|
|
@@ -701,8 +700,7 @@ class ComponentsDevtoolsMessageService {
|
|
|
701
700
|
}
|
|
702
701
|
/**
|
|
703
702
|
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
704
|
-
* @param
|
|
705
|
-
* @param message
|
|
703
|
+
* @param message message coming from the Otter Chrome DevTools extension
|
|
706
704
|
*/
|
|
707
705
|
async handleEvents(message) {
|
|
708
706
|
this.logger.debug('Message handling by the components service', message);
|
|
@@ -739,10 +737,10 @@ class ComponentsDevtoolsMessageService {
|
|
|
739
737
|
ngOnDestroy() {
|
|
740
738
|
this.subscriptions.unsubscribe();
|
|
741
739
|
}
|
|
742
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
743
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
740
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsMessageService, deps: [{ token: i1$1.LoggerService }, { token: i1.Store }, { token: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
741
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsMessageService, providedIn: 'root' }); }
|
|
744
742
|
}
|
|
745
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsMessageService, decorators: [{
|
|
746
744
|
type: Injectable,
|
|
747
745
|
args: [{
|
|
748
746
|
providedIn: 'root'
|
|
@@ -768,16 +766,16 @@ class ComponentsDevtoolsModule {
|
|
|
768
766
|
]
|
|
769
767
|
};
|
|
770
768
|
}
|
|
771
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
772
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
769
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
770
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsModule, imports: [StoreModule,
|
|
773
771
|
PlaceholderTemplateStoreModule] }); }
|
|
774
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
772
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsModule, providers: [
|
|
775
773
|
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS },
|
|
776
774
|
ComponentsDevtoolsMessageService
|
|
777
775
|
], imports: [StoreModule,
|
|
778
776
|
PlaceholderTemplateStoreModule] }); }
|
|
779
777
|
}
|
|
780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
778
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ComponentsDevtoolsModule, decorators: [{
|
|
781
779
|
type: NgModule,
|
|
782
780
|
args: [{
|
|
783
781
|
imports: [
|
|
@@ -796,6 +794,7 @@ class C11nDirective {
|
|
|
796
794
|
set inputs(value) {
|
|
797
795
|
this._inputs = value;
|
|
798
796
|
if (!this.differInputs && value) {
|
|
797
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference -- KeyValueDiffers.find is not an array function
|
|
799
798
|
this.differInputs = this.differsService.find(value).create();
|
|
800
799
|
}
|
|
801
800
|
}
|
|
@@ -840,7 +839,7 @@ class C11nDirective {
|
|
|
840
839
|
this.viewContainerRef.clear();
|
|
841
840
|
this.componentRef = this.viewContainerRef.createComponent(changes.component.currentValue);
|
|
842
841
|
Object.keys(this.componentRef.instance)
|
|
843
|
-
.filter(prop => !(this.outputs && Object.keys(this.outputs).
|
|
842
|
+
.filter((prop) => !(this.outputs && Object.keys(this.outputs).includes(prop)))
|
|
844
843
|
.forEach((prop) => {
|
|
845
844
|
this.uninitializedInputs.add(prop);
|
|
846
845
|
});
|
|
@@ -878,7 +877,7 @@ class C11nDirective {
|
|
|
878
877
|
inputChanges.config = new SimpleChange(this.componentRef.instance.config, changes.config.currentValue, this.uninitializedInputs.has('config'));
|
|
879
878
|
this.uninitializedInputs.delete('config');
|
|
880
879
|
}
|
|
881
|
-
if (this.componentRef && Object.keys(inputChanges).length) {
|
|
880
|
+
if (this.componentRef && Object.keys(inputChanges).length > 0) {
|
|
882
881
|
Object.entries(inputChanges).forEach(([inputName, value]) => {
|
|
883
882
|
this.componentRef.setInput(inputName, value.currentValue);
|
|
884
883
|
});
|
|
@@ -903,8 +902,8 @@ class C11nDirective {
|
|
|
903
902
|
this.componentRef.destroy();
|
|
904
903
|
}
|
|
905
904
|
}
|
|
906
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
907
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
905
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.KeyValueDiffers }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
906
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: C11nDirective, selector: "[c11n]", inputs: { component: "component", config: "config", formControl: "formControl", inputs: "inputs", outputs: "outputs" }, providers: [
|
|
908
907
|
{
|
|
909
908
|
provide: NG_VALUE_ACCESSOR,
|
|
910
909
|
useExisting: forwardRef((() => C11nDirective)),
|
|
@@ -917,7 +916,7 @@ class C11nDirective {
|
|
|
917
916
|
}
|
|
918
917
|
], usesOnChanges: true, ngImport: i0 }); }
|
|
919
918
|
}
|
|
920
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nDirective, decorators: [{
|
|
921
920
|
type: Directive,
|
|
922
921
|
args: [{
|
|
923
922
|
selector: '[c11n]',
|
|
@@ -946,6 +945,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
946
945
|
type: Input
|
|
947
946
|
}] } });
|
|
948
947
|
|
|
948
|
+
/**
|
|
949
|
+
* Register a custom component
|
|
950
|
+
* @param customComponentsMap an object containing the already registered custom component
|
|
951
|
+
* @param customComponentKey
|
|
952
|
+
* @param customComponent
|
|
953
|
+
*/
|
|
954
|
+
function registerCustomComponent(customComponentsMap, customComponentKey, customComponent) {
|
|
955
|
+
customComponentsMap.set(customComponentKey, customComponent);
|
|
956
|
+
return customComponentsMap;
|
|
957
|
+
}
|
|
958
|
+
|
|
949
959
|
/** The C11n injection token */
|
|
950
960
|
const C11N_PRESENTERS_MAP_TOKEN = new InjectionToken('C11n injection token');
|
|
951
961
|
/** Function used to register custom components */
|
|
@@ -974,16 +984,58 @@ class C11nService {
|
|
|
974
984
|
return typeof presenterConfig === 'string' && presenterConfig !== '' ? (this.presentersMap.get(presenterConfig) || defaultPres) : defaultPres;
|
|
975
985
|
}));
|
|
976
986
|
}
|
|
977
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
978
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.
|
|
987
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nService, deps: [{ token: C11N_PRESENTERS_MAP_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
988
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nService }); }
|
|
979
989
|
}
|
|
980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nService, decorators: [{
|
|
981
991
|
type: Injectable
|
|
982
992
|
}], ctorParameters: () => [{ type: Map, decorators: [{
|
|
983
993
|
type: Inject,
|
|
984
994
|
args: [C11N_PRESENTERS_MAP_TOKEN]
|
|
985
995
|
}] }] });
|
|
986
996
|
|
|
997
|
+
/** C11n directive mock */
|
|
998
|
+
class MockC11nDirective {
|
|
999
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MockC11nDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1000
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MockC11nDirective, selector: "[c11n]", inputs: { config: "config", component: "component", inputs: "inputs", outputs: "outputs" }, ngImport: i0 }); }
|
|
1001
|
+
}
|
|
1002
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MockC11nDirective, decorators: [{
|
|
1003
|
+
type: Directive,
|
|
1004
|
+
args: [{
|
|
1005
|
+
selector: '[c11n]',
|
|
1006
|
+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property -- mocked directive
|
|
1007
|
+
inputs: ['config', 'component', 'inputs', 'outputs']
|
|
1008
|
+
}]
|
|
1009
|
+
}] });
|
|
1010
|
+
/** C11n service mock */
|
|
1011
|
+
class C11nMockService {
|
|
1012
|
+
addPresenter(_presKey, _presType) { }
|
|
1013
|
+
getPresenter(_defaultPres, _presKey) {
|
|
1014
|
+
return (source) => source.pipe(mapTo(null));
|
|
1015
|
+
}
|
|
1016
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1017
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockService }); }
|
|
1018
|
+
}
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockService, decorators: [{
|
|
1020
|
+
type: Injectable
|
|
1021
|
+
}] });
|
|
1022
|
+
/**
|
|
1023
|
+
* The purpose of this module is to be imported in the unit tests of the components which are using c11n directive
|
|
1024
|
+
*/
|
|
1025
|
+
class C11nMockModule {
|
|
1026
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1027
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: C11nMockModule, declarations: [MockC11nDirective], exports: [MockC11nDirective] }); }
|
|
1028
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockModule, providers: [{ provide: C11nService, useClass: C11nMockService }] }); }
|
|
1029
|
+
}
|
|
1030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nMockModule, decorators: [{
|
|
1031
|
+
type: NgModule,
|
|
1032
|
+
args: [{
|
|
1033
|
+
declarations: [MockC11nDirective],
|
|
1034
|
+
exports: [MockC11nDirective],
|
|
1035
|
+
providers: [{ provide: C11nService, useClass: C11nMockService }]
|
|
1036
|
+
}]
|
|
1037
|
+
}] });
|
|
1038
|
+
|
|
987
1039
|
/**
|
|
988
1040
|
* Customization service factory
|
|
989
1041
|
* @param config -> registerCompFunc - a function which returns the map of custom components which will be injected in c11n service
|
|
@@ -998,6 +1050,7 @@ function createC11nService(config) {
|
|
|
998
1050
|
}
|
|
999
1051
|
class C11nModule {
|
|
1000
1052
|
/**
|
|
1053
|
+
* Get the module with providers for the root component
|
|
1001
1054
|
* @param config -> registerCompFunc - a function which returns the map of custom components which will be injected in c11n service
|
|
1002
1055
|
* @param config.registerCompFunc
|
|
1003
1056
|
*/
|
|
@@ -1013,11 +1066,11 @@ class C11nModule {
|
|
|
1013
1066
|
}]
|
|
1014
1067
|
};
|
|
1015
1068
|
}
|
|
1016
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1017
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1018
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1069
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1070
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: C11nModule, declarations: [C11nDirective], exports: [C11nDirective] }); }
|
|
1071
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nModule }); }
|
|
1019
1072
|
}
|
|
1020
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: C11nModule, decorators: [{
|
|
1021
1074
|
type: NgModule,
|
|
1022
1075
|
args: [{
|
|
1023
1076
|
declarations: [C11nDirective],
|
|
@@ -1025,69 +1078,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1025
1078
|
}]
|
|
1026
1079
|
}] });
|
|
1027
1080
|
|
|
1028
|
-
/**
|
|
1029
|
-
* Register a custom component
|
|
1030
|
-
* @param customComponentsMap an object containing the already registered custom component
|
|
1031
|
-
* @param customComponentKey
|
|
1032
|
-
* @param customComponent
|
|
1033
|
-
*/
|
|
1034
|
-
function registerCustomComponent(customComponentsMap, customComponentKey, customComponent) {
|
|
1035
|
-
customComponentsMap.set(customComponentKey, customComponent);
|
|
1036
|
-
return customComponentsMap;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
/** C11n directive mock */
|
|
1040
|
-
class MockC11nDirective {
|
|
1041
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: MockC11nDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1042
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.12", type: MockC11nDirective, selector: "[c11n]", inputs: { config: "config", component: "component", inputs: "inputs", outputs: "outputs" }, ngImport: i0 }); }
|
|
1043
|
-
}
|
|
1044
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: MockC11nDirective, decorators: [{
|
|
1045
|
-
type: Directive,
|
|
1046
|
-
args: [{
|
|
1047
|
-
selector: '[c11n]',
|
|
1048
|
-
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
1049
|
-
inputs: ['config', 'component', 'inputs', 'outputs']
|
|
1050
|
-
}]
|
|
1051
|
-
}] });
|
|
1052
|
-
/** C11n service mock */
|
|
1053
|
-
class C11nMockService {
|
|
1054
|
-
addPresenter(_presKey, _presType) { }
|
|
1055
|
-
getPresenter(_defaultPres, _presKey) {
|
|
1056
|
-
return (source) => source.pipe(mapTo(null));
|
|
1057
|
-
}
|
|
1058
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1059
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockService }); }
|
|
1060
|
-
}
|
|
1061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockService, decorators: [{
|
|
1062
|
-
type: Injectable
|
|
1063
|
-
}] });
|
|
1064
|
-
/**
|
|
1065
|
-
* The purpose of this module is to be imported in the unit tests of the components which are using c11n directive
|
|
1066
|
-
*/
|
|
1067
|
-
class C11nMockModule {
|
|
1068
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1069
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.12", ngImport: i0, type: C11nMockModule, declarations: [MockC11nDirective], exports: [MockC11nDirective] }); }
|
|
1070
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockModule, providers: [{ provide: C11nService, useClass: C11nMockService }] }); }
|
|
1071
|
-
}
|
|
1072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: C11nMockModule, decorators: [{
|
|
1073
|
-
type: NgModule,
|
|
1074
|
-
args: [{
|
|
1075
|
-
declarations: [MockC11nDirective],
|
|
1076
|
-
exports: [MockC11nDirective],
|
|
1077
|
-
providers: [{ provide: C11nService, useClass: C11nMockService }]
|
|
1078
|
-
}]
|
|
1079
|
-
}] });
|
|
1080
|
-
|
|
1081
1081
|
class O3rCapitalizePipe {
|
|
1082
1082
|
transform(value) {
|
|
1083
1083
|
const val = value && value.toString && value.toString();
|
|
1084
1084
|
const firstLetter = val && val.charAt(0);
|
|
1085
1085
|
return firstLetter ? firstLetter.toUpperCase() + val.slice(1) : value;
|
|
1086
1086
|
}
|
|
1087
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1088
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1087
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rCapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1088
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rCapitalizePipe, isStandalone: true, name: "o3rCapitalize" }); }
|
|
1089
1089
|
}
|
|
1090
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1090
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rCapitalizePipe, decorators: [{
|
|
1091
1091
|
type: Pipe,
|
|
1092
1092
|
args: [{ name: 'o3rCapitalize', standalone: true }]
|
|
1093
1093
|
}] });
|
|
@@ -1095,10 +1095,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1095
1095
|
* @deprecated please use O3rCapitalizePipe, will be removed in v12.
|
|
1096
1096
|
*/
|
|
1097
1097
|
class CapitalizePipe extends O3rCapitalizePipe {
|
|
1098
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1099
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1098
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1099
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipe, name: "capitalize" }); }
|
|
1100
1100
|
}
|
|
1101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipe, decorators: [{
|
|
1102
1102
|
type: Pipe,
|
|
1103
1103
|
args: [{ name: 'capitalize' }]
|
|
1104
1104
|
}] });
|
|
@@ -1107,11 +1107,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1107
1107
|
* @deprecated please use O3rCapitalizePipe, will be removed in v12.
|
|
1108
1108
|
*/
|
|
1109
1109
|
class CapitalizePipeModule {
|
|
1110
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1111
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1112
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1110
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1111
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipeModule, declarations: [CapitalizePipe], exports: [CapitalizePipe] }); }
|
|
1112
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipeModule }); }
|
|
1113
1113
|
}
|
|
1114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CapitalizePipeModule, decorators: [{
|
|
1115
1115
|
type: NgModule,
|
|
1116
1116
|
args: [{
|
|
1117
1117
|
declarations: [CapitalizePipe],
|
|
@@ -1156,6 +1156,7 @@ function padNum(num, digits) {
|
|
|
1156
1156
|
*/
|
|
1157
1157
|
class O3rDurationPipe {
|
|
1158
1158
|
/**
|
|
1159
|
+
* Converts a duration in seconds into the HH:mm format
|
|
1159
1160
|
* @param value the value in seconds
|
|
1160
1161
|
* @param pattern the desired output format.
|
|
1161
1162
|
* The pattern takes into account static format characters surrounded by braces
|
|
@@ -1193,10 +1194,10 @@ class O3rDurationPipe {
|
|
|
1193
1194
|
return result.replace(matchedPatternToReplace, padded);
|
|
1194
1195
|
}, pattern);
|
|
1195
1196
|
}
|
|
1196
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1197
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1197
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1198
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rDurationPipe, isStandalone: true, name: "o3rDuration" }); }
|
|
1198
1199
|
}
|
|
1199
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rDurationPipe, decorators: [{
|
|
1200
1201
|
type: Pipe,
|
|
1201
1202
|
args: [{ name: 'o3rDuration', standalone: true }]
|
|
1202
1203
|
}] });
|
|
@@ -1205,10 +1206,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1205
1206
|
* @deprecated please use O3rDurationPipe, will be removed in v12.
|
|
1206
1207
|
*/
|
|
1207
1208
|
class DurationPipe extends O3rDurationPipe {
|
|
1208
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1209
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1209
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DurationPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1210
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: DurationPipe, name: "duration" }); }
|
|
1210
1211
|
}
|
|
1211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DurationPipe, decorators: [{
|
|
1212
1213
|
type: Pipe,
|
|
1213
1214
|
args: [{ name: 'duration' }]
|
|
1214
1215
|
}] });
|
|
@@ -1217,11 +1218,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1217
1218
|
* @deprecated please use O3rDurationPipe, will be removed in v12.
|
|
1218
1219
|
*/
|
|
1219
1220
|
class DurationPipeModule {
|
|
1220
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1221
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1222
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1221
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DurationPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1222
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: DurationPipeModule, declarations: [DurationPipe], exports: [DurationPipe] }); }
|
|
1223
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DurationPipeModule }); }
|
|
1223
1224
|
}
|
|
1224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DurationPipeModule, decorators: [{
|
|
1225
1226
|
type: NgModule,
|
|
1226
1227
|
args: [{
|
|
1227
1228
|
declarations: [DurationPipe],
|
|
@@ -1233,10 +1234,10 @@ class O3rKeepWhiteSpacePipe {
|
|
|
1233
1234
|
transform(value) {
|
|
1234
1235
|
return value.replace(/\s/g, ' ');
|
|
1235
1236
|
}
|
|
1236
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1237
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1237
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rKeepWhiteSpacePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1238
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rKeepWhiteSpacePipe, name: "o3rKeepWhiteSpace" }); }
|
|
1238
1239
|
}
|
|
1239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rKeepWhiteSpacePipe, decorators: [{
|
|
1240
1241
|
type: Pipe,
|
|
1241
1242
|
args: [{
|
|
1242
1243
|
name: 'o3rKeepWhiteSpace'
|
|
@@ -1246,10 +1247,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1246
1247
|
* @deprecated please use O3rKeepWhiteSpacePipe, will be removed in v12.
|
|
1247
1248
|
*/
|
|
1248
1249
|
class KeepWhiteSpacePipe extends O3rKeepWhiteSpacePipe {
|
|
1249
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1250
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1250
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1251
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipe, name: "keepWhiteSpace" }); }
|
|
1251
1252
|
}
|
|
1252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipe, decorators: [{
|
|
1253
1254
|
type: Pipe,
|
|
1254
1255
|
args: [{
|
|
1255
1256
|
name: 'keepWhiteSpace'
|
|
@@ -1260,11 +1261,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1260
1261
|
* @deprecated please use O3rKeepWhiteSpacePipe, will be removed in v12.
|
|
1261
1262
|
*/
|
|
1262
1263
|
class KeepWhiteSpacePipeModule {
|
|
1263
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1264
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1265
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1264
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1265
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipeModule, declarations: [KeepWhiteSpacePipe], exports: [KeepWhiteSpacePipe] }); }
|
|
1266
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipeModule }); }
|
|
1266
1267
|
}
|
|
1267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeepWhiteSpacePipeModule, decorators: [{
|
|
1268
1269
|
type: NgModule,
|
|
1269
1270
|
args: [{
|
|
1270
1271
|
declarations: [KeepWhiteSpacePipe],
|
|
@@ -1272,7 +1273,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1272
1273
|
}]
|
|
1273
1274
|
}] });
|
|
1274
1275
|
|
|
1275
|
-
const escapeRegExp = (str) => str.replace(/[
|
|
1276
|
+
const escapeRegExp = (str) => str.replace(/[$()*+./?[\\\]^{|}-]/g, '\\$&');
|
|
1276
1277
|
class O3rReplaceWithBoldPipe {
|
|
1277
1278
|
transform(value, inputText) {
|
|
1278
1279
|
if (inputText) {
|
|
@@ -1283,10 +1284,10 @@ class O3rReplaceWithBoldPipe {
|
|
|
1283
1284
|
return value;
|
|
1284
1285
|
}
|
|
1285
1286
|
}
|
|
1286
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1287
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1287
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rReplaceWithBoldPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1288
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: O3rReplaceWithBoldPipe, isStandalone: true, name: "o3rReplaceWithBold" }); }
|
|
1288
1289
|
}
|
|
1289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: O3rReplaceWithBoldPipe, decorators: [{
|
|
1290
1291
|
type: Pipe,
|
|
1291
1292
|
args: [{
|
|
1292
1293
|
name: 'o3rReplaceWithBold',
|
|
@@ -1300,10 +1301,10 @@ class ReplaceWithBoldPipe extends O3rReplaceWithBoldPipe {
|
|
|
1300
1301
|
escapeRegExp(str) {
|
|
1301
1302
|
return escapeRegExp(str);
|
|
1302
1303
|
}
|
|
1303
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1304
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.
|
|
1304
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1305
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipe, name: "replaceWithBold" }); }
|
|
1305
1306
|
}
|
|
1306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipe, decorators: [{
|
|
1307
1308
|
type: Pipe,
|
|
1308
1309
|
args: [{
|
|
1309
1310
|
name: 'replaceWithBold'
|
|
@@ -1314,11 +1315,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1314
1315
|
* @deprecated please use O3rReplaceWithBoldPipe, will be removed in v12.
|
|
1315
1316
|
*/
|
|
1316
1317
|
class ReplaceWithBoldPipeModule {
|
|
1317
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1318
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1319
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1318
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1319
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipeModule, declarations: [ReplaceWithBoldPipe], exports: [ReplaceWithBoldPipe] }); }
|
|
1320
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipeModule }); }
|
|
1320
1321
|
}
|
|
1321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReplaceWithBoldPipeModule, decorators: [{
|
|
1322
1323
|
type: NgModule,
|
|
1323
1324
|
args: [{
|
|
1324
1325
|
declarations: [ReplaceWithBoldPipe],
|
|
@@ -1352,21 +1353,18 @@ class PlaceholderComponent {
|
|
|
1352
1353
|
id,
|
|
1353
1354
|
orderedTemplates: placeholders?.orderedTemplates,
|
|
1354
1355
|
isPending: placeholders?.isPending
|
|
1355
|
-
})), distinctUntilChanged((previous, current) => previous.id === current.id
|
|
1356
|
-
previous.isPending === current.isPending
|
|
1357
|
-
previous.orderedTemplates?.map(placeholder => placeholder.renderedTemplate).join('')
|
|
1358
|
-
current.orderedTemplates?.map(placeholder => placeholder.renderedTemplate).join(''))))).subscribe(({ id, orderedTemplates, isPending }) => {
|
|
1356
|
+
})), distinctUntilChanged((previous, current) => previous.id === current.id
|
|
1357
|
+
&& previous.isPending === current.isPending
|
|
1358
|
+
&& previous.orderedTemplates?.map((placeholder) => placeholder.renderedTemplate).join('')
|
|
1359
|
+
=== current.orderedTemplates?.map((placeholder) => placeholder.renderedTemplate).join(''))))).subscribe(({ id, orderedTemplates, isPending }) => {
|
|
1359
1360
|
this.isPending = isPending;
|
|
1360
|
-
|
|
1361
|
-
this.template = undefined;
|
|
1362
|
-
}
|
|
1363
|
-
else {
|
|
1361
|
+
this.template = orderedTemplates?.length
|
|
1364
1362
|
// Concatenates the list of templates
|
|
1365
|
-
|
|
1366
|
-
|
|
1363
|
+
? orderedTemplates.map((placeholder) => placeholder.renderedTemplate).join('')
|
|
1364
|
+
: undefined;
|
|
1367
1365
|
if (this.isPending === false) {
|
|
1368
1366
|
this.messages$.next({
|
|
1369
|
-
templateIds:
|
|
1367
|
+
templateIds: this.isPending ? [] : (orderedTemplates || []).map((placeholder) => placeholder.resolvedUrl),
|
|
1370
1368
|
placeholderId: id
|
|
1371
1369
|
});
|
|
1372
1370
|
}
|
|
@@ -1390,13 +1388,12 @@ class PlaceholderComponent {
|
|
|
1390
1388
|
this.afterViewInit$.complete();
|
|
1391
1389
|
this.subscription.unsubscribe();
|
|
1392
1390
|
}
|
|
1393
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1394
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.
|
|
1391
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderComponent, deps: [{ token: i1.Store }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1392
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: PlaceholderComponent, selector: "o3r-placeholder", inputs: { id: "id" }, host: { properties: { "class.debug": "mode() === 'debug'" } }, ngImport: i0, template: "<ng-template #projection>\n <ng-content></ng-content>\n</ng-template>\n@switch (mode()) {\n @case ('debug') {\n <span class=\"placehoder-id\">{{ id$ | async }}</span>\n }\n @case ('pending') {\n <ng-container *ngTemplateOutlet=\"projection\" />\n }\n @case ('normal') {\n @if (isPending) {\n <ng-container *ngTemplateOutlet=\"projection\" />\n } @else {\n <div [innerHTML]=\"template\"></div>\n }\n }\n}\n", styles: [".debug{padding:15px;text-align:center;border:2px dashed var(--o3r-placeholder-debug-color, #a65c27);border-radius:10px;width:100%;background:var(--o3r-placeholder-background, #fff2ea);border-style:dashed;color:var(--o3r-placeholder-debug-color, #a65c27);font-size:larger}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1395
1393
|
}
|
|
1396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderComponent, decorators: [{
|
|
1397
1395
|
type: Component,
|
|
1398
1396
|
args: [{ selector: 'o3r-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1399
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1400
1397
|
'[class.debug]': `mode() === 'debug'`
|
|
1401
1398
|
}, template: "<ng-template #projection>\n <ng-content></ng-content>\n</ng-template>\n@switch (mode()) {\n @case ('debug') {\n <span class=\"placehoder-id\">{{ id$ | async }}</span>\n }\n @case ('pending') {\n <ng-container *ngTemplateOutlet=\"projection\" />\n }\n @case ('normal') {\n @if (isPending) {\n <ng-container *ngTemplateOutlet=\"projection\" />\n } @else {\n <div [innerHTML]=\"template\"></div>\n }\n }\n}\n", styles: [".debug{padding:15px;text-align:center;border:2px dashed var(--o3r-placeholder-debug-color, #a65c27);border-radius:10px;width:100%;background:var(--o3r-placeholder-background, #fff2ea);border-style:dashed;color:var(--o3r-placeholder-debug-color, #a65c27);font-size:larger}\n"] }]
|
|
1402
1399
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
|
@@ -1404,17 +1401,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
1404
1401
|
}] } });
|
|
1405
1402
|
|
|
1406
1403
|
class PlaceholderModule {
|
|
1407
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1408
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1404
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1405
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, declarations: [PlaceholderComponent], imports: [CommonModule,
|
|
1409
1406
|
StoreModule,
|
|
1410
1407
|
PlaceholderTemplateStoreModule,
|
|
1411
1408
|
PlaceholderRequestStoreModule], exports: [PlaceholderComponent] }); }
|
|
1412
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1409
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, imports: [CommonModule,
|
|
1413
1410
|
StoreModule,
|
|
1414
1411
|
PlaceholderTemplateStoreModule,
|
|
1415
1412
|
PlaceholderRequestStoreModule] }); }
|
|
1416
1413
|
}
|
|
1417
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PlaceholderModule, decorators: [{
|
|
1418
1415
|
type: NgModule,
|
|
1419
1416
|
args: [{
|
|
1420
1417
|
imports: [
|