@hestia-earth/ui-components 0.0.7 → 0.0.10
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/README.md +5 -22
- package/bibliographies/bibliographies-search-confirm/bibliographies-search-confirm.component.d.ts +1 -1
- package/bundles/hestia-earth-ui-components.umd.js +2339 -806
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/blank-node-state/blank-node-state.component.d.ts +2 -2
- package/common/common.light.module.d.ts +19 -0
- package/common/common.module.d.ts +10 -19
- package/common/delta-utils.d.ts +1 -1
- package/common/index.d.ts +1 -0
- package/common/link-key-value/link-key-value.component.d.ts +1 -1
- package/common/maps-utils.d.ts +2 -2
- package/common/precision.pipe.d.ts +1 -1
- package/common/tags-input.directive.d.ts +1 -1
- package/common/utils.d.ts +7 -7
- package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +2 -2
- package/cycles/cycles-suggest-form/cycles-suggest-form.component.d.ts +1 -2
- package/cycles/cycles.model.d.ts +1 -1
- package/engine/aggregation-engine.service.d.ts +2 -2
- package/engine/engine.service.d.ts +5 -4
- package/esm2015/common/common.light.module.js +66 -0
- package/esm2015/common/common.module.js +11 -47
- package/esm2015/common/index.js +2 -1
- package/esm2015/common/tags-input.directive.js +3 -3
- package/esm2015/common/utils.js +1 -2
- package/esm2015/engine/engine.service.js +10 -6
- package/esm2015/tags-input/defaultOptions.js +26 -0
- package/esm2015/tags-input/index.js +1053 -0
- package/esm2015/tags-input/templates/dropdown-item.js +3 -0
- package/esm2015/tags-input/templates/tag.js +6 -0
- package/esm2015/tags-input/templates/wrapper.js +10 -0
- package/esm2015/tags-input/utils/component.js +80 -0
- package/esm2015/tags-input/utils/dom.js +98 -0
- package/esm2015/tags-input/utils/events.js +147 -0
- package/esm2015/tags-input/utils/type.js +41 -0
- package/esm2015/tags-input/utils/uuid.js +3 -0
- package/fesm2015/hestia-earth-ui-components.js +1977 -499
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/files/files-error.model.d.ts +5 -5
- package/files/files-form/files-form.component.d.ts +7 -7
- package/files/files-form.model.d.ts +10 -10
- package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +2 -2
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +2 -2
- package/node/node-icon/node-icon.component.d.ts +1 -1
- package/node/node-link/node-link.component.d.ts +1 -1
- package/node/node-logs-models/node-logs-models.component.d.ts +1 -1
- package/node/node.service.d.ts +2 -2
- package/package.json +1 -2
- package/schema/schema.service.d.ts +1 -1
- package/search/search.model.d.ts +18 -17
- package/search/search.service.d.ts +7 -7
- package/sites/sites-maps/sites-maps.component.d.ts +1 -1
- package/sites/sites-measurements/sites-measurements.component.d.ts +1 -1
- package/sites/sites.model.d.ts +1 -1
- package/styles.scss +1 -1
- package/tags-input/defaultOptions.d.ts +25 -0
- package/tags-input/index.d.ts +277 -0
- package/tags-input/styles.sass +154 -0
- package/tags-input/templates/dropdown-item.d.ts +2 -0
- package/tags-input/templates/tag.d.ts +2 -0
- package/tags-input/templates/wrapper.d.ts +2 -0
- package/tags-input/utils/component.d.ts +22 -0
- package/tags-input/utils/dom.d.ts +38 -0
- package/tags-input/utils/events.d.ts +72 -0
- package/tags-input/utils/type.d.ts +17 -0
- package/tags-input/utils/uuid.d.ts +2 -0
- package/terms/terms.model.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, NgModule,
|
|
2
|
+
import { Injectable, NgModule, Component as Component$1, Input, HostBinding, Directive, Pipe, InjectionToken, Inject, ViewChild, EventEmitter as EventEmitter$1, Output, HostListener } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1$4 from '@angular/forms';
|
|
@@ -8,24 +8,23 @@ import * as i4 from '@angular/router';
|
|
|
8
8
|
import { RouterModule } from '@angular/router';
|
|
9
9
|
import * as i10 from '@ng-bootstrap/ng-bootstrap';
|
|
10
10
|
import { NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
|
|
11
|
-
import * as i1$
|
|
11
|
+
import * as i1$3 from '@angular/google-maps';
|
|
12
12
|
import { GoogleMap, GoogleMapsModule } from '@angular/google-maps';
|
|
13
13
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
14
14
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
15
15
|
import { faClone, faCircle, faIdBadge } from '@fortawesome/free-regular-svg-icons';
|
|
16
16
|
import { faAngleDoubleLeft, faAngleDoubleRight, faAngleDown, faAngleLeft, faAngleRight, faBookOpen, faBuilding, faCalculator, faChartBar, faCheck, faClipboard, faClipboardList, faClone as faClone$1, faComments, faDownload, faDrawPolygon, faEdit, faExclamationTriangle, faExternalLinkAlt, faFilter, faList, faLongArrowAltDown, faLongArrowAltUp, faLongArrowAltLeft, faLongArrowAltRight, faMap, faMapMarked, faMapMarkedAlt, faPlus, faPlusCircle, faSearch, faSeedling, faSpellCheck, faSpinner, faTimes, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
17
|
+
import * as i1$1 from '@angular/platform-browser';
|
|
18
|
+
import { ReplaySubject, of, forkJoin, from, zip } from 'rxjs';
|
|
17
19
|
import { getColor } from 'random-material-color';
|
|
18
20
|
import { EmissionMethodTier, NodeType, isExpandable, TermTermType, nestedSearchableKeys, SchemaType, SCHEMA_VERSION, sortKeysByType, CycleFunctionalUnit, SiteSiteType, isTypeValid, isTypeNode, typeToSchemaType } from '@hestia-earth/schema';
|
|
19
21
|
import { fileToExt, nodeTypeToParam, DataState, SupportedExtensions } from '@hestia-earth/api';
|
|
20
22
|
import { unique, isEmpty, isUndefined, isNumber, toPrecision, isBoolean, ConvertUnits, converters, convertValue, isEqual, diffInDays } from '@hestia-earth/utils';
|
|
21
|
-
import
|
|
23
|
+
import * as pluralize from 'pluralize';
|
|
22
24
|
import { catchError, map, take, mergeMap, debounceTime, distinctUntilChanged, tap, switchMap, reduce, filter, distinct, toArray, mergeAll, groupBy } from 'rxjs/operators';
|
|
23
25
|
import { __rest, __awaiter } from 'tslib';
|
|
24
26
|
import * as csvtojson from 'csvtojson';
|
|
25
|
-
import * as i1$
|
|
26
|
-
import * as i1$3 from '@angular/platform-browser';
|
|
27
|
-
import * as pluralize from 'pluralize';
|
|
28
|
-
import BulmaTagsInput from '@hestia-earth/bulma-tagsinput';
|
|
27
|
+
import * as i1$2 from '@angular/common/http';
|
|
29
28
|
import { json2csvAsync } from 'json-2-csv';
|
|
30
29
|
import * as i6 from '@angular/cdk/drag-drop';
|
|
31
30
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
@@ -85,6 +84,148 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
85
84
|
}]
|
|
86
85
|
}], ctorParameters: function () { return [{ type: i1.FaIconLibrary }]; } });
|
|
87
86
|
|
|
87
|
+
class SocialTagsComponent {
|
|
88
|
+
constructor(meta) {
|
|
89
|
+
this.meta = meta;
|
|
90
|
+
this.config = {};
|
|
91
|
+
this.classes = 'is-hidden';
|
|
92
|
+
}
|
|
93
|
+
ngOnInit() {
|
|
94
|
+
this.meta.addTag({ charset: 'UTF-8' });
|
|
95
|
+
const config = Object.assign({ 'og:url': window.location.href.split('?')[0] }, this.config);
|
|
96
|
+
Object.keys(config).map(name => {
|
|
97
|
+
const content = config[name];
|
|
98
|
+
this.meta.updateTag({ name, content });
|
|
99
|
+
if (name === 'og:description') {
|
|
100
|
+
this.meta.updateTag({ name: 'description', content });
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
SocialTagsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SocialTagsComponent, deps: [{ token: i1$1.Meta }], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
SocialTagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SocialTagsComponent, selector: "he-social-tags", inputs: { config: "config" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: "<span></span>\n", styles: [""] });
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SocialTagsComponent, decorators: [{
|
|
108
|
+
type: Component$1,
|
|
109
|
+
args: [{
|
|
110
|
+
selector: 'he-social-tags',
|
|
111
|
+
templateUrl: './social-tags.component.html',
|
|
112
|
+
styleUrls: ['./social-tags.component.scss']
|
|
113
|
+
}]
|
|
114
|
+
}], ctorParameters: function () { return [{ type: i1$1.Meta }]; }, propDecorators: { config: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], classes: [{
|
|
117
|
+
type: HostBinding,
|
|
118
|
+
args: ['class']
|
|
119
|
+
}] } });
|
|
120
|
+
|
|
121
|
+
let toastId = 0;
|
|
122
|
+
class HeToastService {
|
|
123
|
+
constructor() {
|
|
124
|
+
this.toasts = new ReplaySubject(1);
|
|
125
|
+
}
|
|
126
|
+
success(message, duration = 3000) {
|
|
127
|
+
this.toasts.next({
|
|
128
|
+
id: ++toastId,
|
|
129
|
+
message,
|
|
130
|
+
duration,
|
|
131
|
+
color: 'success',
|
|
132
|
+
showRawMessage: true
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
error(message, showRawMessage = true, duration = 3000) {
|
|
136
|
+
this.toasts.next({
|
|
137
|
+
id: ++toastId,
|
|
138
|
+
message: (`${message}` || '').trim(),
|
|
139
|
+
duration,
|
|
140
|
+
color: 'danger',
|
|
141
|
+
showRawMessage
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
HeToastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
146
|
+
HeToastService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeToastService, providedIn: 'root' });
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeToastService, decorators: [{
|
|
148
|
+
type: Injectable,
|
|
149
|
+
args: [{
|
|
150
|
+
providedIn: 'root'
|
|
151
|
+
}]
|
|
152
|
+
}] });
|
|
153
|
+
|
|
154
|
+
class ToastComponent {
|
|
155
|
+
constructor(toastService) {
|
|
156
|
+
this.toastService = toastService;
|
|
157
|
+
this.subscriptions = [];
|
|
158
|
+
this.toasts = [];
|
|
159
|
+
}
|
|
160
|
+
ngOnInit() {
|
|
161
|
+
this.subscriptions.push(this.toastService.toasts.subscribe(toast => this.add(toast)));
|
|
162
|
+
}
|
|
163
|
+
ngOnDestroy() {
|
|
164
|
+
this.subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
165
|
+
}
|
|
166
|
+
add(toast) {
|
|
167
|
+
this.toasts.push(toast);
|
|
168
|
+
if (toast.duration) {
|
|
169
|
+
toast.timeout = setTimeout(() => this.dismiss(toast), toast.duration);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
dismiss(toast) {
|
|
173
|
+
this.toasts.splice(this.toasts.findIndex(val => val.id === toast.id), 1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
ToastComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToastComponent, deps: [{ token: HeToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
177
|
+
ToastComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToastComponent, selector: "he-toast", ngImport: i0, template: "<div class=\"mb-3 columns is-centered is-vcentered\">\n <div class=\"notification is-{{toast.color}}\" role=\"alert\" *ngFor=\"let toast of toasts\">\n <button class=\"delete\" aria-label=\"delete\" (click)=\"dismiss(toast)\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong [ngSwitch]=\"toast.color\">\n <ng-container *ngSwitchCase=\"'danger'\">\n <ng-container [ngSwitch]=\"toast.message\">\n <span *ngSwitchCase=\"'Unauthorized'\">You are not allowed to perform this action.</span>\n <span *ngSwitchCase=\"'form-invalid'\">Please fix all the errors on this page.</span>\n <span *ngSwitchCase=\"'users-email-already-taken'\">Email already taken.</span>\n <span *ngSwitchCase=\"'users-auth-already-taken'\">Account already connected.</span>\n <span *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span *ngIf=\"toast.showRawMessage\">{{toast.message}}</span>\n <span [class.is-hidden]=\"toast.showRawMessage\">An unknown error occurred. Please try again later.</span>\n </ng-container>\n </strong>\n </div>\n</div>\n", styles: [":host{bottom:0;position:fixed;width:100%}\n"], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToastComponent, decorators: [{
|
|
179
|
+
type: Component$1,
|
|
180
|
+
args: [{
|
|
181
|
+
selector: 'he-toast',
|
|
182
|
+
templateUrl: './toast.component.html',
|
|
183
|
+
styleUrls: ['./toast.component.scss']
|
|
184
|
+
}]
|
|
185
|
+
}], ctorParameters: function () { return [{ type: HeToastService }]; } });
|
|
186
|
+
|
|
187
|
+
/* eslint-disable @angular-eslint/directive-selector */
|
|
188
|
+
class BindOnceDirective {
|
|
189
|
+
constructor(templateRef, viewContainerRef) {
|
|
190
|
+
this.embeddedViewRef = viewContainerRef.createEmbeddedView(templateRef);
|
|
191
|
+
this.embeddedViewRef.detach();
|
|
192
|
+
}
|
|
193
|
+
ngOnChanges() {
|
|
194
|
+
this.embeddedViewRef.detectChanges();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
BindOnceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindOnceDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
198
|
+
BindOnceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BindOnceDirective, selector: "[bindOnce]", inputs: { bindOnce: "bindOnce" }, usesOnChanges: true, ngImport: i0 });
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindOnceDirective, decorators: [{
|
|
200
|
+
type: Directive,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: '[bindOnce]'
|
|
203
|
+
}]
|
|
204
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { bindOnce: [{
|
|
205
|
+
type: Input
|
|
206
|
+
}] } });
|
|
207
|
+
|
|
208
|
+
const shouldDefault = {
|
|
209
|
+
string: (value) => !value,
|
|
210
|
+
number: (value) => !value && value !== 0,
|
|
211
|
+
boolean: (value) => !value,
|
|
212
|
+
object: (value) => !value || !Object.keys(value).length,
|
|
213
|
+
undefined: () => true
|
|
214
|
+
};
|
|
215
|
+
class DefaultPipe {
|
|
216
|
+
transform(value, defaultValue) {
|
|
217
|
+
return shouldDefault[typeof value](value) ? defaultValue : value;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
DefaultPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
221
|
+
DefaultPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultPipe, name: "default" });
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DefaultPipe, decorators: [{
|
|
223
|
+
type: Pipe,
|
|
224
|
+
args: [{
|
|
225
|
+
name: 'default'
|
|
226
|
+
}]
|
|
227
|
+
}] });
|
|
228
|
+
|
|
88
229
|
const get$4 = require('lodash.get');
|
|
89
230
|
const gitHome = 'https://gitlab.com/hestia-earth';
|
|
90
231
|
const gitRawBaseUrl = 'https://glcdn.githack.com/hestia-earth';
|
|
@@ -96,7 +237,6 @@ const baseUrl = () => window.location.origin.includes('localhost') ?
|
|
|
96
237
|
window.location.origin :
|
|
97
238
|
'https://www.hestia.earth';
|
|
98
239
|
const isExternal = () => baseUrl() !== window.location.origin;
|
|
99
|
-
;
|
|
100
240
|
const parseErrorStatus = (error) => ((error === null || error === void 0 ? void 0 : error.statusText) || '').toLowerCase().replace(/\s/g, '-');
|
|
101
241
|
const parseErrorMessage = (error) => get$4(error, 'error.error', get$4(error, 'error.message', get$4(error, 'error', get$4(error, 'message', error))));
|
|
102
242
|
const handleAPIError = (error) => {
|
|
@@ -271,155 +411,20 @@ const filenameWithoutExt = (filename = '') => {
|
|
|
271
411
|
return file.endsWith('.') ? file.substring(0, file.length - 1) : file;
|
|
272
412
|
};
|
|
273
413
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
(function (DeltaColour) {
|
|
278
|
-
DeltaColour["Success"] = "success";
|
|
279
|
-
DeltaColour["Warning"] = "warning";
|
|
280
|
-
DeltaColour["Danger"] = "danger";
|
|
281
|
-
})(DeltaColour || (DeltaColour = {}));
|
|
282
|
-
var DeltaDisplayType;
|
|
283
|
-
(function (DeltaDisplayType) {
|
|
284
|
-
DeltaDisplayType["absolute"] = "absolute";
|
|
285
|
-
DeltaDisplayType["percent"] = "percent";
|
|
286
|
-
})(DeltaDisplayType || (DeltaDisplayType = {}));
|
|
287
|
-
const deltaPerType = {
|
|
288
|
-
[DeltaDisplayType.absolute]: (value, original) => value - original,
|
|
289
|
-
[DeltaDisplayType.percent]: (value, original) => ((value - original) / original) * 100
|
|
290
|
-
};
|
|
291
|
-
const roundValue = (value) => +`${value}`.substring(0, 10);
|
|
292
|
-
const delta = (value, originalValue, displayType = DeltaDisplayType.percent, mapping) => {
|
|
293
|
-
const vvalue = roundValue(propertyValue$1(value));
|
|
294
|
-
const voriginalValue = roundValue(propertyValue$1(originalValue));
|
|
295
|
-
const deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
|
|
296
|
-
const diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
|
|
297
|
-
return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
|
|
298
|
-
};
|
|
299
|
-
var PercentDeltaConditions;
|
|
300
|
-
(function (PercentDeltaConditions) {
|
|
301
|
-
PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
|
|
302
|
-
PercentDeltaConditions["original0"] = "original is 0";
|
|
303
|
-
})(PercentDeltaConditions || (PercentDeltaConditions = {}));
|
|
304
|
-
const calculatePercentDeltaConditions = {
|
|
305
|
-
[PercentDeltaConditions.recalculated0]: (original, recalculated) => original > 0 && recalculated === 0,
|
|
306
|
-
[PercentDeltaConditions.original0]: (original, recalculated) => original === 0 && recalculated > 0
|
|
307
|
-
};
|
|
308
|
-
const calculatePercentDeltaResult = {
|
|
309
|
-
[PercentDeltaConditions.recalculated0]: (original, recalculated) => (recalculated - original) / (original + 1),
|
|
310
|
-
// Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
311
|
-
[PercentDeltaConditions.original0]: (original, recalculated) => Math.sign(recalculated - original),
|
|
312
|
-
default: (original, recalculated) => (recalculated - original) / original
|
|
313
|
-
};
|
|
314
|
-
const calculatePercentDelta = (recalculated, original) => {
|
|
315
|
-
const matchingCondition = Object.values(PercentDeltaConditions).find((value) => calculatePercentDeltaConditions[value](original, recalculated)) || 'default';
|
|
316
|
-
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
317
|
-
};
|
|
318
|
-
const customDeltaFuncs = {
|
|
319
|
-
[DeltaDisplayType.percent]: calculatePercentDelta
|
|
320
|
-
};
|
|
321
|
-
const evaluateSuccess = (deltaValue) => Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
322
|
-
? DeltaColour.Success
|
|
323
|
-
: Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
324
|
-
? DeltaColour.Warning
|
|
325
|
-
: DeltaColour.Danger;
|
|
326
|
-
|
|
327
|
-
/* eslint-disable @angular-eslint/directive-selector */
|
|
328
|
-
class BindOnceDirective {
|
|
329
|
-
constructor(templateRef, viewContainerRef) {
|
|
330
|
-
this.embeddedViewRef = viewContainerRef.createEmbeddedView(templateRef);
|
|
331
|
-
this.embeddedViewRef.detach();
|
|
332
|
-
}
|
|
333
|
-
ngOnChanges() {
|
|
334
|
-
this.embeddedViewRef.detectChanges();
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
BindOnceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindOnceDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
338
|
-
BindOnceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BindOnceDirective, selector: "[bindOnce]", inputs: { bindOnce: "bindOnce" }, usesOnChanges: true, ngImport: i0 });
|
|
339
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindOnceDirective, decorators: [{
|
|
340
|
-
type: Directive,
|
|
341
|
-
args: [{
|
|
342
|
-
selector: '[bindOnce]'
|
|
343
|
-
}]
|
|
344
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { bindOnce: [{
|
|
345
|
-
type: Input
|
|
346
|
-
}] } });
|
|
347
|
-
|
|
348
|
-
class PrecisionPipe {
|
|
349
|
-
transform(value, precision) {
|
|
350
|
-
return isUndefined(value) ?
|
|
351
|
-
null : (isNumber(value) ?
|
|
352
|
-
`${toPrecision(parseFloat(`${value}`), parseInt(`${precision}`, 10))}`.replace(/\.00$/, '') :
|
|
353
|
-
value);
|
|
414
|
+
class EllipsisPipe {
|
|
415
|
+
transform(value, maxLength) {
|
|
416
|
+
return ellipsis(`${value}`, maxLength);
|
|
354
417
|
}
|
|
355
418
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type:
|
|
419
|
+
EllipsisPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EllipsisPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
420
|
+
EllipsisPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EllipsisPipe, name: "ellipsis" });
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EllipsisPipe, decorators: [{
|
|
359
422
|
type: Pipe,
|
|
360
423
|
args: [{
|
|
361
|
-
name: '
|
|
424
|
+
name: 'ellipsis'
|
|
362
425
|
}]
|
|
363
426
|
}] });
|
|
364
427
|
|
|
365
|
-
class BlankNodeValueDeltaComponent {
|
|
366
|
-
constructor() {
|
|
367
|
-
this.displayType = DeltaDisplayType.percent;
|
|
368
|
-
this.DeltaDisplayType = DeltaDisplayType;
|
|
369
|
-
}
|
|
370
|
-
get hide() {
|
|
371
|
-
return emptyValue(this.value) || emptyValue(this.originalValue);
|
|
372
|
-
}
|
|
373
|
-
get delta() {
|
|
374
|
-
return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
|
|
375
|
-
}
|
|
376
|
-
get color() {
|
|
377
|
-
return this.displayType === DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
BlankNodeValueDeltaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeValueDeltaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
381
|
-
BlankNodeValueDeltaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: { value: "value", originalValue: "originalValue", displayType: "displayType" }, ngImport: i0, template: "<small [class.is-hidden]=\"hide\">\n <span class=\"has-text-{{color}}\">\n <span *ngIf=\"delta > 0\">+</span>\n <ng-container [ngSwitch]=\"displayType\">\n <ng-container *ngSwitchCase=\"DeltaDisplayType.absolute\">\n <span *bindOnce=\"delta\">{{delta | precision:3}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DeltaDisplayType.percent\">\n <span *bindOnce=\"delta\">{{delta | number:'1.0-2'}}</span>\n <span>%</span>\n </ng-container>\n </ng-container>\n </span>\n</small>\n", styles: [""], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "precision": PrecisionPipe, "number": i3.DecimalPipe } });
|
|
382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeValueDeltaComponent, decorators: [{
|
|
383
|
-
type: Component,
|
|
384
|
-
args: [{
|
|
385
|
-
selector: 'he-blank-node-value-delta',
|
|
386
|
-
templateUrl: './blank-node-value-delta.component.html',
|
|
387
|
-
styleUrls: ['./blank-node-value-delta.component.scss']
|
|
388
|
-
}]
|
|
389
|
-
}], propDecorators: { value: [{
|
|
390
|
-
type: Input
|
|
391
|
-
}], originalValue: [{
|
|
392
|
-
type: Input
|
|
393
|
-
}], displayType: [{
|
|
394
|
-
type: Input
|
|
395
|
-
}] } });
|
|
396
|
-
|
|
397
|
-
class BlankNodeDiffsComponent {
|
|
398
|
-
constructor() {
|
|
399
|
-
this.originalValues = [];
|
|
400
|
-
this.recalculatedValues = [];
|
|
401
|
-
this.propertyValue = propertyValue$1;
|
|
402
|
-
this.values = [];
|
|
403
|
-
}
|
|
404
|
-
ngOnInit() {
|
|
405
|
-
this.values = formatDiffValues(this.originalValues, this.recalculatedValues);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
BlankNodeDiffsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeDiffsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
409
|
-
BlankNodeDiffsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeDiffsComponent, selector: "he-blank-node-diffs", inputs: { originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0, template: "<div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-3\" *bindOnce=\"values\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let value of values\"\n [class.has-background-light]=\"!!value.original && value.original !== value.recalculated\"\n >\n <td class=\"width-auto\" [attr.title]=\"value.term.name\">\n <ng-container *ngTemplateOutlet=\"termLink; context: {$implicit: value.term}\"></ng-container>\n </td>\n <td>\n <span>{{value.original === undefined ? '-' : value.original}}</span>\n </td>\n <td>\n <span>{{value.recalculated === undefined ? '-' : value.recalculated}}</span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta\n [value]=\"value.recalculated\"\n [originalValue]=\"value.original\"\n ></he-blank-node-value-delta>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<ng-template #termLink let-term>\n <a [routerLink]=\"['/', 'term', term['@id']]\" target=\"_blank\">\n <span class=\"is-nowrap has-text-ellipsis\">{{term.name}}</span>\n </a>\n</ng-template>\n", styles: ["table.data-table th:first-child,table.data-table td:first-child{width:auto}\n"], components: [{ type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }] });
|
|
410
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeDiffsComponent, decorators: [{
|
|
411
|
-
type: Component,
|
|
412
|
-
args: [{
|
|
413
|
-
selector: 'he-blank-node-diffs',
|
|
414
|
-
templateUrl: './blank-node-diffs.component.html',
|
|
415
|
-
styleUrls: ['./blank-node-diffs.component.scss']
|
|
416
|
-
}]
|
|
417
|
-
}], propDecorators: { originalValues: [{
|
|
418
|
-
type: Input
|
|
419
|
-
}], recalculatedValues: [{
|
|
420
|
-
type: Input
|
|
421
|
-
}] } });
|
|
422
|
-
|
|
423
428
|
const termProperties = (term) => Object.keys(term).filter(key => !isExpandable(term[key]) && ![
|
|
424
429
|
'pinned', 'expanded', 'extended', 'selected', 'loading',
|
|
425
430
|
'_score', '@type', '@id', '@context', 'createdAt',
|
|
@@ -602,6 +607,232 @@ const sortOrder = [
|
|
|
602
607
|
TermTermType.standardsLabels
|
|
603
608
|
];
|
|
604
609
|
|
|
610
|
+
class KeyToLabelPipe {
|
|
611
|
+
transform(value) {
|
|
612
|
+
// using termTypeLabel here which defaults to `keyToLabel` function
|
|
613
|
+
return termTypeLabel(value);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
KeyToLabelPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyToLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
617
|
+
KeyToLabelPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyToLabelPipe, name: "keyToLabel" });
|
|
618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeyToLabelPipe, decorators: [{
|
|
619
|
+
type: Pipe,
|
|
620
|
+
args: [{
|
|
621
|
+
name: 'keyToLabel'
|
|
622
|
+
}]
|
|
623
|
+
}] });
|
|
624
|
+
|
|
625
|
+
class KeysPipe {
|
|
626
|
+
transform(value, sort = false) {
|
|
627
|
+
const keys = Object.keys(value).map(key => ({ key, value: value[key] }));
|
|
628
|
+
if (sort) {
|
|
629
|
+
keys.sort((a, b) => a.key.localeCompare(b.key));
|
|
630
|
+
}
|
|
631
|
+
return keys;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
KeysPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
635
|
+
KeysPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, name: "keys" });
|
|
636
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, decorators: [{
|
|
637
|
+
type: Pipe,
|
|
638
|
+
args: [{
|
|
639
|
+
name: 'keys'
|
|
640
|
+
}]
|
|
641
|
+
}] });
|
|
642
|
+
|
|
643
|
+
class PluralizePipe {
|
|
644
|
+
transform(value, times = 0) {
|
|
645
|
+
return pluralize(value, times);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
PluralizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
649
|
+
PluralizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, name: "pluralize" });
|
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, decorators: [{
|
|
651
|
+
type: Pipe,
|
|
652
|
+
args: [{
|
|
653
|
+
name: 'pluralize'
|
|
654
|
+
}]
|
|
655
|
+
}] });
|
|
656
|
+
|
|
657
|
+
class PrecisionPipe {
|
|
658
|
+
transform(value, precision) {
|
|
659
|
+
return isUndefined(value) ?
|
|
660
|
+
null : (isNumber(value) ?
|
|
661
|
+
`${toPrecision(parseFloat(`${value}`), parseInt(`${precision}`, 10))}`.replace(/\.00$/, '') :
|
|
662
|
+
value);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
PrecisionPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PrecisionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
666
|
+
PrecisionPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PrecisionPipe, name: "precision" });
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PrecisionPipe, decorators: [{
|
|
668
|
+
type: Pipe,
|
|
669
|
+
args: [{
|
|
670
|
+
name: 'precision'
|
|
671
|
+
}]
|
|
672
|
+
}] });
|
|
673
|
+
|
|
674
|
+
const components$7 = [
|
|
675
|
+
SocialTagsComponent,
|
|
676
|
+
ToastComponent,
|
|
677
|
+
BindOnceDirective,
|
|
678
|
+
DefaultPipe,
|
|
679
|
+
EllipsisPipe,
|
|
680
|
+
KeysPipe,
|
|
681
|
+
PluralizePipe,
|
|
682
|
+
KeyToLabelPipe,
|
|
683
|
+
PrecisionPipe
|
|
684
|
+
];
|
|
685
|
+
class HeCommonLightModule {
|
|
686
|
+
}
|
|
687
|
+
HeCommonLightModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonLightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
688
|
+
HeCommonLightModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonLightModule, declarations: [SocialTagsComponent,
|
|
689
|
+
ToastComponent,
|
|
690
|
+
BindOnceDirective,
|
|
691
|
+
DefaultPipe,
|
|
692
|
+
EllipsisPipe,
|
|
693
|
+
KeysPipe,
|
|
694
|
+
PluralizePipe,
|
|
695
|
+
KeyToLabelPipe,
|
|
696
|
+
PrecisionPipe], imports: [CommonModule, FormsModule, RouterModule,
|
|
697
|
+
HeFontawesomeModule], exports: [HeFontawesomeModule, SocialTagsComponent,
|
|
698
|
+
ToastComponent,
|
|
699
|
+
BindOnceDirective,
|
|
700
|
+
DefaultPipe,
|
|
701
|
+
EllipsisPipe,
|
|
702
|
+
KeysPipe,
|
|
703
|
+
PluralizePipe,
|
|
704
|
+
KeyToLabelPipe,
|
|
705
|
+
PrecisionPipe] });
|
|
706
|
+
HeCommonLightModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonLightModule, imports: [[
|
|
707
|
+
CommonModule, FormsModule, RouterModule,
|
|
708
|
+
HeFontawesomeModule
|
|
709
|
+
], HeFontawesomeModule] });
|
|
710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonLightModule, decorators: [{
|
|
711
|
+
type: NgModule,
|
|
712
|
+
args: [{
|
|
713
|
+
declarations: components$7,
|
|
714
|
+
exports: [
|
|
715
|
+
HeFontawesomeModule,
|
|
716
|
+
...components$7
|
|
717
|
+
],
|
|
718
|
+
imports: [
|
|
719
|
+
CommonModule, FormsModule, RouterModule,
|
|
720
|
+
HeFontawesomeModule
|
|
721
|
+
]
|
|
722
|
+
}]
|
|
723
|
+
}] });
|
|
724
|
+
|
|
725
|
+
const SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
|
|
726
|
+
const WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
|
|
727
|
+
var DeltaColour;
|
|
728
|
+
(function (DeltaColour) {
|
|
729
|
+
DeltaColour["Success"] = "success";
|
|
730
|
+
DeltaColour["Warning"] = "warning";
|
|
731
|
+
DeltaColour["Danger"] = "danger";
|
|
732
|
+
})(DeltaColour || (DeltaColour = {}));
|
|
733
|
+
var DeltaDisplayType;
|
|
734
|
+
(function (DeltaDisplayType) {
|
|
735
|
+
DeltaDisplayType["absolute"] = "absolute";
|
|
736
|
+
DeltaDisplayType["percent"] = "percent";
|
|
737
|
+
})(DeltaDisplayType || (DeltaDisplayType = {}));
|
|
738
|
+
const deltaPerType = {
|
|
739
|
+
[DeltaDisplayType.absolute]: (value, original) => value - original,
|
|
740
|
+
[DeltaDisplayType.percent]: (value, original) => ((value - original) / original) * 100
|
|
741
|
+
};
|
|
742
|
+
const roundValue = (value) => +`${value}`.substring(0, 10);
|
|
743
|
+
const delta = (value, originalValue, displayType = DeltaDisplayType.percent, mapping) => {
|
|
744
|
+
const vvalue = roundValue(propertyValue$1(value));
|
|
745
|
+
const voriginalValue = roundValue(propertyValue$1(originalValue));
|
|
746
|
+
const deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
|
|
747
|
+
const diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
|
|
748
|
+
return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
|
|
749
|
+
};
|
|
750
|
+
var PercentDeltaConditions;
|
|
751
|
+
(function (PercentDeltaConditions) {
|
|
752
|
+
PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
|
|
753
|
+
PercentDeltaConditions["original0"] = "original is 0";
|
|
754
|
+
})(PercentDeltaConditions || (PercentDeltaConditions = {}));
|
|
755
|
+
const calculatePercentDeltaConditions = {
|
|
756
|
+
[PercentDeltaConditions.recalculated0]: (original, recalculated) => original > 0 && recalculated === 0,
|
|
757
|
+
[PercentDeltaConditions.original0]: (original, recalculated) => original === 0 && recalculated > 0
|
|
758
|
+
};
|
|
759
|
+
const calculatePercentDeltaResult = {
|
|
760
|
+
[PercentDeltaConditions.recalculated0]: (original, recalculated) => (recalculated - original) / (original + 1),
|
|
761
|
+
// Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
762
|
+
[PercentDeltaConditions.original0]: (original, recalculated) => Math.sign(recalculated - original),
|
|
763
|
+
default: (original, recalculated) => (recalculated - original) / original
|
|
764
|
+
};
|
|
765
|
+
const calculatePercentDelta = (recalculated, original) => {
|
|
766
|
+
const matchingCondition = Object.values(PercentDeltaConditions).find((value) => calculatePercentDeltaConditions[value](original, recalculated)) || 'default';
|
|
767
|
+
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
768
|
+
};
|
|
769
|
+
const customDeltaFuncs = {
|
|
770
|
+
[DeltaDisplayType.percent]: calculatePercentDelta
|
|
771
|
+
};
|
|
772
|
+
const evaluateSuccess = (deltaValue) => Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
773
|
+
? DeltaColour.Success
|
|
774
|
+
: Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
775
|
+
? DeltaColour.Warning
|
|
776
|
+
: DeltaColour.Danger;
|
|
777
|
+
|
|
778
|
+
class BlankNodeValueDeltaComponent {
|
|
779
|
+
constructor() {
|
|
780
|
+
this.displayType = DeltaDisplayType.percent;
|
|
781
|
+
this.DeltaDisplayType = DeltaDisplayType;
|
|
782
|
+
}
|
|
783
|
+
get hide() {
|
|
784
|
+
return emptyValue(this.value) || emptyValue(this.originalValue);
|
|
785
|
+
}
|
|
786
|
+
get delta() {
|
|
787
|
+
return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
|
|
788
|
+
}
|
|
789
|
+
get color() {
|
|
790
|
+
return this.displayType === DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
BlankNodeValueDeltaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeValueDeltaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
794
|
+
BlankNodeValueDeltaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: { value: "value", originalValue: "originalValue", displayType: "displayType" }, ngImport: i0, template: "<small [class.is-hidden]=\"hide\">\n <span class=\"has-text-{{color}}\">\n <span *ngIf=\"delta > 0\">+</span>\n <ng-container [ngSwitch]=\"displayType\">\n <ng-container *ngSwitchCase=\"DeltaDisplayType.absolute\">\n <span *bindOnce=\"delta\">{{delta | precision:3}}</span>\n </ng-container>\n <ng-container *ngSwitchCase=\"DeltaDisplayType.percent\">\n <span *bindOnce=\"delta\">{{delta | number:'1.0-2'}}</span>\n <span>%</span>\n </ng-container>\n </ng-container>\n </span>\n</small>\n", styles: [""], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "precision": PrecisionPipe, "number": i3.DecimalPipe } });
|
|
795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeValueDeltaComponent, decorators: [{
|
|
796
|
+
type: Component$1,
|
|
797
|
+
args: [{
|
|
798
|
+
selector: 'he-blank-node-value-delta',
|
|
799
|
+
templateUrl: './blank-node-value-delta.component.html',
|
|
800
|
+
styleUrls: ['./blank-node-value-delta.component.scss']
|
|
801
|
+
}]
|
|
802
|
+
}], propDecorators: { value: [{
|
|
803
|
+
type: Input
|
|
804
|
+
}], originalValue: [{
|
|
805
|
+
type: Input
|
|
806
|
+
}], displayType: [{
|
|
807
|
+
type: Input
|
|
808
|
+
}] } });
|
|
809
|
+
|
|
810
|
+
class BlankNodeDiffsComponent {
|
|
811
|
+
constructor() {
|
|
812
|
+
this.originalValues = [];
|
|
813
|
+
this.recalculatedValues = [];
|
|
814
|
+
this.propertyValue = propertyValue$1;
|
|
815
|
+
this.values = [];
|
|
816
|
+
}
|
|
817
|
+
ngOnInit() {
|
|
818
|
+
this.values = formatDiffValues(this.originalValues, this.recalculatedValues);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
BlankNodeDiffsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeDiffsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
822
|
+
BlankNodeDiffsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeDiffsComponent, selector: "he-blank-node-diffs", inputs: { originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0, template: "<div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-3\" *bindOnce=\"values\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th>Original</th>\n <th>Recalculated</th>\n <th>Difference</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let value of values\"\n [class.has-background-light]=\"!!value.original && value.original !== value.recalculated\"\n >\n <td class=\"width-auto\" [attr.title]=\"value.term.name\">\n <ng-container *ngTemplateOutlet=\"termLink; context: {$implicit: value.term}\"></ng-container>\n </td>\n <td>\n <span>{{value.original === undefined ? '-' : value.original}}</span>\n </td>\n <td>\n <span>{{value.recalculated === undefined ? '-' : value.recalculated}}</span>\n </td>\n <td class=\"is-nowrap\">\n <he-blank-node-value-delta\n [value]=\"value.recalculated\"\n [originalValue]=\"value.original\"\n ></he-blank-node-value-delta>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<ng-template #termLink let-term>\n <a [routerLink]=\"['/', 'term', term['@id']]\" target=\"_blank\">\n <span class=\"is-nowrap has-text-ellipsis\">{{term.name}}</span>\n </a>\n</ng-template>\n", styles: ["table.data-table th:first-child,table.data-table td:first-child{width:auto}\n"], components: [{ type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }] });
|
|
823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeDiffsComponent, decorators: [{
|
|
824
|
+
type: Component$1,
|
|
825
|
+
args: [{
|
|
826
|
+
selector: 'he-blank-node-diffs',
|
|
827
|
+
templateUrl: './blank-node-diffs.component.html',
|
|
828
|
+
styleUrls: ['./blank-node-diffs.component.scss']
|
|
829
|
+
}]
|
|
830
|
+
}], propDecorators: { originalValues: [{
|
|
831
|
+
type: Input
|
|
832
|
+
}], recalculatedValues: [{
|
|
833
|
+
type: Input
|
|
834
|
+
}] } });
|
|
835
|
+
|
|
605
836
|
const HE_API_BASE_URL = new InjectionToken('HE_API_BASE_URL');
|
|
606
837
|
class HeCommonService {
|
|
607
838
|
constructor(_apiBaseUrl) {
|
|
@@ -724,14 +955,14 @@ class HeNodeService {
|
|
|
724
955
|
});
|
|
725
956
|
}
|
|
726
957
|
}
|
|
727
|
-
HeNodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeNodeService, deps: [{ token: i1$
|
|
958
|
+
HeNodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeNodeService, deps: [{ token: i1$2.HttpClient }, { token: HeAuthService }, { token: HeCommonService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
728
959
|
HeNodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeNodeService, providedIn: 'root' });
|
|
729
960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeNodeService, decorators: [{
|
|
730
961
|
type: Injectable,
|
|
731
962
|
args: [{
|
|
732
963
|
providedIn: 'root'
|
|
733
964
|
}]
|
|
734
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
965
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: HeAuthService }, { type: HeCommonService }]; } });
|
|
735
966
|
|
|
736
967
|
const gitUrl$1 = () => `${gitHome}/hestia-aggregation-engine/-/blob/${gitBranch()}`;
|
|
737
968
|
const rawUrl$1 = () => `${gitRawBaseUrl}/hestia-aggregation-engine/-/raw/${gitBranch()}`;
|
|
@@ -804,14 +1035,14 @@ class HeAggregationEngineService {
|
|
|
804
1035
|
return this.lookups$.pipe(take(1)).toPromise();
|
|
805
1036
|
}
|
|
806
1037
|
}
|
|
807
|
-
HeAggregationEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeAggregationEngineService, deps: [{ token: i1$
|
|
1038
|
+
HeAggregationEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeAggregationEngineService, deps: [{ token: i1$2.HttpClient }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
808
1039
|
HeAggregationEngineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeAggregationEngineService, providedIn: 'root' });
|
|
809
1040
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeAggregationEngineService, decorators: [{
|
|
810
1041
|
type: Injectable,
|
|
811
1042
|
args: [{
|
|
812
1043
|
providedIn: 'root'
|
|
813
1044
|
}]
|
|
814
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
1045
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: HeNodeService }]; } });
|
|
815
1046
|
|
|
816
1047
|
const HE_ORCHESTRATOR_BASE_URL = new InjectionToken('HE_ORCHESTRATOR_BASE_URL');
|
|
817
1048
|
const gitUrl = () => `${gitHome}/hestia-engine-models/-/blob/${gitBranch()}`;
|
|
@@ -827,7 +1058,8 @@ const pathToApiDocsPath = (model, term) => [
|
|
|
827
1058
|
].filter(Boolean).join('-')
|
|
828
1059
|
].join('/');
|
|
829
1060
|
class HeEngineService {
|
|
830
|
-
constructor(http) {
|
|
1061
|
+
constructor(_orchestratorBaseUrl, http) {
|
|
1062
|
+
this._orchestratorBaseUrl = _orchestratorBaseUrl;
|
|
831
1063
|
this.http = http;
|
|
832
1064
|
this.modelsLoading = false;
|
|
833
1065
|
this.modelsLoaded = false;
|
|
@@ -864,19 +1096,22 @@ class HeEngineService {
|
|
|
864
1096
|
return this.model$(model).pipe(take(1)).toPromise();
|
|
865
1097
|
}
|
|
866
1098
|
ochestratorConfig(type) {
|
|
867
|
-
return this.http.get(`${
|
|
1099
|
+
return this.http.get(`${this._orchestratorBaseUrl}/${type}.json`, {
|
|
868
1100
|
params: { inline: false }
|
|
869
1101
|
}).toPromise();
|
|
870
1102
|
}
|
|
871
1103
|
}
|
|
872
|
-
HeEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, deps: [{ token: i1$
|
|
1104
|
+
HeEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, deps: [{ token: HE_ORCHESTRATOR_BASE_URL }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
873
1105
|
HeEngineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, providedIn: 'root' });
|
|
874
1106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeEngineService, decorators: [{
|
|
875
1107
|
type: Injectable,
|
|
876
1108
|
args: [{
|
|
877
1109
|
providedIn: 'root'
|
|
878
1110
|
}]
|
|
879
|
-
}], ctorParameters: function () { return [{ type:
|
|
1111
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1112
|
+
type: Inject,
|
|
1113
|
+
args: [HE_ORCHESTRATOR_BASE_URL]
|
|
1114
|
+
}] }, { type: i1$2.HttpClient }]; } });
|
|
880
1115
|
|
|
881
1116
|
var NodeKeyState;
|
|
882
1117
|
(function (NodeKeyState) {
|
|
@@ -940,7 +1175,7 @@ class BlankNodeStateComponent {
|
|
|
940
1175
|
BlankNodeStateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeStateComponent, deps: [{ token: HeAggregationEngineService }, { token: HeEngineService }], target: i0.ɵɵFactoryTarget.Component });
|
|
941
1176
|
BlankNodeStateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: { nodeType: "nodeType", dataKey: "dataKey", key: "key", node: "node", state: "state" }, ngImport: i0, template: "<ng-container *bindOnce=\"node\">\n <span *ngFor=\"let star of stars\">*</span>\n\n <ng-container *ngIf=\"showLink\">\n <!-- <span class=\"ml-2\" *ngIf=\"is(NodeKeyState.aggregated)\">\n <ng-container *ngIf=\"aggregatedModel$ | async as model\">\n <ng-container *ngTemplateOutlet=\"docsLink; context: {$implicit: model}\"></ng-container>\n </ng-container>\n </span> -->\n\n <span class=\"ml-2\" *ngIf=\"is(NodeKeyState.added); else showUpdated\">\n <ng-container *ngIf=\"engineModel$ | async as model\">\n <ng-container *ngTemplateOutlet=\"docsLink; context: {$implicit: model}\"></ng-container>\n </ng-container>\n </span>\n </ng-container>\n</ng-container>\n\n<ng-template #showUpdated>\n <span class=\"ml-2\" *ngIf=\"is(NodeKeyState.updated)\">\n <ng-container *ngIf=\"engineModel$ | async as model\">\n <ng-container *ngTemplateOutlet=\"docsLink; context: {$implicit: model}\"></ng-container>\n </ng-container>\n </span>\n</ng-template>\n\n<ng-template #docsLink let-model>\n <a [href]=\"model.apiDocsPath || model.docPath || model.path\" target=\"_blank\"\n (click)=\"$event.stopPropagation()\"\n >\n <span>Docs</span>\n <fa-icon class=\"ml-2\" icon=\"external-link-alt\" size=\"sm\"></fa-icon>\n </a>\n</ng-template>\n", styles: [":host{display:inline-block}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3.AsyncPipe } });
|
|
942
1177
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeStateComponent, decorators: [{
|
|
943
|
-
type: Component,
|
|
1178
|
+
type: Component$1,
|
|
944
1179
|
args: [{
|
|
945
1180
|
selector: 'he-blank-node-state',
|
|
946
1181
|
templateUrl: './blank-node-state.component.html',
|
|
@@ -969,7 +1204,7 @@ class BlankNodeStateNoticeComponent {
|
|
|
969
1204
|
BlankNodeStateNoticeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeStateNoticeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
970
1205
|
BlankNodeStateNoticeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: { dataState: "dataState", showDeleted: "showDeleted" }, ngImport: i0, template: "<p class=\"is-size-7 is-italic\" *ngIf=\"show\">\n <span>Recalculations: * Data Added ** Data Updated *** Data Aggregated</span>\n <span *ngIf=\"showDeleted\" class=\"pl-1\">**** Data Deleted</span>\n</p>\n", styles: [""], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
971
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlankNodeStateNoticeComponent, decorators: [{
|
|
972
|
-
type: Component,
|
|
1207
|
+
type: Component$1,
|
|
973
1208
|
args: [{
|
|
974
1209
|
selector: 'he-blank-node-state-notice',
|
|
975
1210
|
templateUrl: './blank-node-state-notice.component.html',
|
|
@@ -1017,7 +1252,7 @@ class ClipboardComponent {
|
|
|
1017
1252
|
ClipboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClipboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1018
1253
|
ClipboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ClipboardComponent, selector: "he-clipboard", inputs: { value: "value", disabled: "disabled", hideText: "hideText", icon: "icon", size: "size", rotate: "rotate", clipboardClass: "clipboardClass" }, viewQueries: [{ propertyName: "valueNode", first: true, predicate: ["valueNode"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["t"], descendants: true }], ngImport: i0, template: "<span #valueNode [class.is-hidden]=\"hideText\">{{value}}</span>\n\n<span [class]=\"clipboardClass\" pointer (click)=\"!disabled && onClick($event)\"\n ngbTooltip=\"Copied!\" triggers=\"manual\" placement=\"bottom\" container=\"body\" #t=\"ngbTooltip\"\n>\n <fa-icon [icon]=\"icon\" [size]=\"size\" [rotate]=\"rotate\"></fa-icon>\n</span>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }] });
|
|
1019
1254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClipboardComponent, decorators: [{
|
|
1020
|
-
type: Component,
|
|
1255
|
+
type: Component$1,
|
|
1021
1256
|
args: [{
|
|
1022
1257
|
selector: 'he-clipboard',
|
|
1023
1258
|
templateUrl: './clipboard.component.html',
|
|
@@ -1075,7 +1310,7 @@ class LinkKeyValueComponent {
|
|
|
1075
1310
|
LinkKeyValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkKeyValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1076
1311
|
LinkKeyValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LinkKeyValueComponent, selector: "he-link-key-value", inputs: { node: "node", nodeType: "nodeType", dataKey: "dataKey", key: "key" }, ngImport: i0, template: "<ng-container *ngIf=\"!isUndefined\">\n <ng-container *bindOnce=\"node\">\n <a [href]=\"baseUrl + '/schema/' + type + '#' + key\" target=\"_blank\"><b>{{key}}</b></a>\n <span class=\"pr-2\">:</span>\n <a [href]=\"valueLink\" *ngIf=\"valueLink; else showString\">{{valueString}}</a>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"node\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"\n ></he-blank-node-state>\n </ng-container>\n</ng-container>\n\n<ng-template #showString>\n {{valueString | precision:3}}\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "precision": PrecisionPipe } });
|
|
1077
1312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkKeyValueComponent, decorators: [{
|
|
1078
|
-
type: Component,
|
|
1313
|
+
type: Component$1,
|
|
1079
1314
|
args: [{
|
|
1080
1315
|
selector: 'he-link-key-value',
|
|
1081
1316
|
templateUrl: './link-key-value.component.html',
|
|
@@ -1200,7 +1435,7 @@ class MapsDrawingConfirmComponent {
|
|
|
1200
1435
|
this.modes = [google.maps.drawing.OverlayType.POLYGON];
|
|
1201
1436
|
this.center = { lat: 0, lng: 0 };
|
|
1202
1437
|
this.zoom = 3;
|
|
1203
|
-
this.closed = new EventEmitter();
|
|
1438
|
+
this.closed = new EventEmitter$1();
|
|
1204
1439
|
this.options = {
|
|
1205
1440
|
fullscreenControl: false,
|
|
1206
1441
|
mapTypeControl: true,
|
|
@@ -1251,9 +1486,9 @@ class MapsDrawingConfirmComponent {
|
|
|
1251
1486
|
}
|
|
1252
1487
|
}
|
|
1253
1488
|
MapsDrawingConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapsDrawingConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1254
|
-
MapsDrawingConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: GoogleMap, descendants: true }], ngImport: i0, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"closed.next(value)\">\n <span>Close</span>\n </button>\n <button class=\"button is-danger is-outlined\" (click)=\"clear()\">\n <fa-icon class=\"mr-2\" icon=\"times\"></fa-icon>\n <span>Clear</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: ["google-map{display:block;height:100%;max-height:calc(100vh - 146px);min-height:500px}\n"], components: [{ type: i1$
|
|
1489
|
+
MapsDrawingConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: { value: "value", modes: "modes", center: "center", zoom: "zoom" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "map", first: true, predicate: GoogleMap, descendants: true }], ngImport: i0, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Draw on Map</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(value)\"></button>\n </header>\n <section class=\"modal-card-body p-0\">\n <google-map\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n [options]=\"options\"\n ></google-map>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"closed.next(value)\">\n <span>Close</span>\n </button>\n <button class=\"button is-danger is-outlined\" (click)=\"clear()\">\n <fa-icon class=\"mr-2\" icon=\"times\"></fa-icon>\n <span>Clear</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: ["google-map{display:block;height:100%;max-height:calc(100vh - 146px);min-height:500px}\n"], components: [{ type: i1$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }] });
|
|
1255
1490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapsDrawingConfirmComponent, decorators: [{
|
|
1256
|
-
type: Component,
|
|
1491
|
+
type: Component$1,
|
|
1257
1492
|
args: [{
|
|
1258
1493
|
selector: 'he-maps-drawing-confirm',
|
|
1259
1494
|
templateUrl: './maps-drawing-confirm.component.html',
|
|
@@ -1289,7 +1524,7 @@ class PopoverComponent {
|
|
|
1289
1524
|
PopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1290
1525
|
PopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverComponent, selector: "he-popover", inputs: { message: "message", content: "content", data: "data", position: "position" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"is-inline-block popover is-popover-{{position}}\" [class.is-popover-active]=\"active\">\n <ng-content></ng-content>\n\n <div class=\"popover-content\">\n\n <ng-template\n [ngTemplateOutlet]=\"content || ct\"\n [ngTemplateOutletContext]=\"{message: message, data: data}\"\n ></ng-template>\n\n <footer>\n <ng-content select=\"[actions]\"></ng-content>\n <button class=\"button is-small\" (click)=\"$event.stopPropagation(); active = false\">\n <span>Close</span>\n </button>\n </footer>\n </div>\n</div>\n\n<ng-template #ct>\n <p class=\"mb-2 is-pre-wrap\" [innerHtml]=\"message\"></p>\n</ng-template>\n", styles: [":host{cursor:pointer;display:block}.popover{position:relative;display:inline-block}.popover .popover-content{z-index:99999;position:absolute;display:none;font-size:.75rem;padding:.4rem .8rem;color:#4a4a4a;background-color:#fff;border-radius:4px;box-shadow:0 2px 3px #0a0a0a1a,0 0 0 1px #0a0a0a1a;width:max-content;max-width:24rem}.popover .popover-content:before{position:absolute;content:\"\";border-style:solid;pointer-events:none;height:0;width:0;top:100%;left:50%;border-color:transparent;border-bottom-color:#fff;border-left-color:#fff;border-width:.4rem;margin-left:-.4rem;margin-top:-.4rem;transform-origin:center;box-shadow:-1px 1px 2px #0a0a0a33}.popover .popover-content{top:auto!important;bottom:100%!important;left:50%!important;right:auto!important;transform:translate(-50%,-.7rem)!important}.popover .popover-content:before{top:100%!important;bottom:auto!important;left:50%!important;right:auto!important;transform:rotate(-45deg)}.popover.is-popover-right .popover-content{top:auto!important;bottom:50%!important;left:100%!important;right:auto!important;transform:translate(.7rem,50%)!important}.popover.is-popover-right .popover-content:before{top:50%!important;bottom:auto!important;left:0!important;right:auto!important;transform:rotate(45deg)}.popover.is-popover-bottom .popover-content{top:100%!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translate(-50%,.7rem)!important}.popover.is-popover-bottom .popover-content:before{top:0!important;bottom:auto!important;left:50%!important;right:auto!important;transform:rotate(135deg)}.popover.is-popover-left .popover-content{top:auto!important;bottom:50%!important;left:auto!important;right:100%!important;transform:translate(-.7rem,50%)!important}.popover.is-popover-left .popover-content:before{top:50%!important;bottom:auto!important;left:100%!important;right:auto!important;transform:rotate(-135deg)}.popover.is-popover-active .popover-content,.popover.is-popover-hover:hover .popover-content,.popover .popover-trigger:focus~.popover-content{display:block}\n"], directives: [{ type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
1291
1526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopoverComponent, decorators: [{
|
|
1292
|
-
type: Component,
|
|
1527
|
+
type: Component$1,
|
|
1293
1528
|
args: [{
|
|
1294
1529
|
selector: 'he-popover',
|
|
1295
1530
|
templateUrl: './popover.component.html',
|
|
@@ -1310,7 +1545,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1310
1545
|
|
|
1311
1546
|
class PopoverConfirmComponent {
|
|
1312
1547
|
constructor() {
|
|
1313
|
-
this.confirmed = new EventEmitter();
|
|
1548
|
+
this.confirmed = new EventEmitter$1();
|
|
1314
1549
|
this.data = {};
|
|
1315
1550
|
}
|
|
1316
1551
|
confirm() {
|
|
@@ -1321,7 +1556,7 @@ class PopoverConfirmComponent {
|
|
|
1321
1556
|
PopoverConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopoverConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1322
1557
|
PopoverConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: { message: "message", content: "content", position: "position", popoverClass: "popoverClass" }, outputs: { confirmed: "confirmed" }, viewQueries: [{ propertyName: "popover", first: true, predicate: PopoverComponent, descendants: true }], ngImport: i0, template: "<he-popover [message]=\"message\" [content]=\"content\" [data]=\"data\" [position]=\"position\" [class]=\"popoverClass\">\n <ng-content></ng-content>\n\n <ng-container actions>\n <button class=\"button is-small is-primary mr-2\" (click)=\"$event.stopPropagation(); confirm()\">\n <span>Confirm</span>\n </button>\n </ng-container>\n</he-popover>\n", styles: ["he-popover{height:100%;width:100%}\n"], components: [{ type: PopoverComponent, selector: "he-popover", inputs: ["message", "content", "data", "position"] }] });
|
|
1323
1558
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopoverConfirmComponent, decorators: [{
|
|
1324
|
-
type: Component,
|
|
1559
|
+
type: Component$1,
|
|
1325
1560
|
args: [{
|
|
1326
1561
|
selector: 'he-popover-confirm',
|
|
1327
1562
|
templateUrl: './popover-confirm.component.html',
|
|
@@ -1359,7 +1594,7 @@ class SchemaVersionLinkComponent {
|
|
|
1359
1594
|
SchemaVersionLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SchemaVersionLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1360
1595
|
SchemaVersionLinkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: { node: "node", showExternalLink: "showExternalLink", linkClass: "linkClass", text: "text" }, ngImport: i0, template: "<ng-container *bindOnce=\"url\">\n <a [href]=\"url\" target=\"_blank\" [class]=\"linkClass\" (click)=\"$event.stopPropagation()\">\n <ng-content></ng-content>\n <fa-icon class=\"ml-2\" icon=\"external-link-alt\" size=\"sm\" *ngIf=\"showExternalLink\"></fa-icon>\n </a>\n</ng-container>\n", styles: ["a{color:inherit}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1361
1596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SchemaVersionLinkComponent, decorators: [{
|
|
1362
|
-
type: Component,
|
|
1597
|
+
type: Component$1,
|
|
1363
1598
|
args: [{
|
|
1364
1599
|
selector: 'he-schema-version-link',
|
|
1365
1600
|
templateUrl: './schema-version-link.component.html',
|
|
@@ -1394,7 +1629,7 @@ class SkeletonTextComponent {
|
|
|
1394
1629
|
SkeletonTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkeletonTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1395
1630
|
SkeletonTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkeletonTextComponent, selector: "he-skeleton-text", inputs: { animated: "animated", width: "width", height: "height" }, host: { properties: { "class.is-animated": "this.isAnimated", "style.width": "this.hasWidth", "style.height": "this.hasHeight" } }, ngImport: i0, template: "<span> </span>\n", styles: [":host{border-radius:2px;display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:rgba(0,0,0,.065);line-height:10px;-webkit-user-select:none;user-select:none;pointer-events:none}span{display:inline-block}:host(.is-animated){position:relative;background:linear-gradient(to right,rgba(0,0,0,.065) 8%,rgba(0,0,0,.135) 18%,rgba(0,0,0,.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-468px 0}to{background-position:468px 0}}\n"] });
|
|
1396
1631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkeletonTextComponent, decorators: [{
|
|
1397
|
-
type: Component,
|
|
1632
|
+
type: Component$1,
|
|
1398
1633
|
args: [{
|
|
1399
1634
|
selector: 'he-skeleton-text',
|
|
1400
1635
|
templateUrl: './skeleton-text.component.html',
|
|
@@ -1417,294 +1652,1564 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1417
1652
|
args: ['style.height']
|
|
1418
1653
|
}] } });
|
|
1419
1654
|
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
this.
|
|
1655
|
+
const parsePropertyValue = (value) => isNumber(value) ? +value : (isBoolean(value) ? value.toString() === 'true' : value);
|
|
1656
|
+
const parseResult = (value) => isNaN(value) ? '' : `${value}`.replace(',', '.');
|
|
1657
|
+
class UnitConverterComponent {
|
|
1658
|
+
constructor() {
|
|
1659
|
+
this.value = 1;
|
|
1660
|
+
this.ConvertUnits = ConvertUnits;
|
|
1661
|
+
this.result = '';
|
|
1662
|
+
this.arguments = [];
|
|
1425
1663
|
}
|
|
1426
1664
|
ngOnInit() {
|
|
1427
|
-
this.
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1665
|
+
return this.updateValue();
|
|
1666
|
+
}
|
|
1667
|
+
get args() {
|
|
1668
|
+
var _a;
|
|
1669
|
+
return (((_a = this.term) === null || _a === void 0 ? void 0 : _a.defaultProperties) || []).reduce((prev, prop) => {
|
|
1670
|
+
var _a, _b;
|
|
1671
|
+
return (Object.assign(Object.assign({}, prev), { [(_b = (_a = prop.term) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()]: parsePropertyValue(prop.value) }));
|
|
1672
|
+
}, {});
|
|
1673
|
+
}
|
|
1674
|
+
get units() {
|
|
1675
|
+
return this.fromUnits ?
|
|
1676
|
+
Object.values(ConvertUnits).filter(v => v in converters[this.fromUnits]) :
|
|
1677
|
+
[];
|
|
1678
|
+
}
|
|
1679
|
+
requireArgs(keys) {
|
|
1680
|
+
const args = this.args;
|
|
1681
|
+
this.arguments = keys.map(key => ({ key, value: args[key] || '' }));
|
|
1682
|
+
}
|
|
1683
|
+
updateUnits() {
|
|
1684
|
+
let requiredKeys = [];
|
|
1685
|
+
if (this.fromUnits === ConvertUnits.kg || this.toUnits === ConvertUnits.kg) {
|
|
1686
|
+
requiredKeys = ['density'];
|
|
1687
|
+
}
|
|
1688
|
+
this.requireArgs(requiredKeys);
|
|
1689
|
+
return this.updateValue();
|
|
1690
|
+
}
|
|
1691
|
+
updateValue() {
|
|
1692
|
+
if (!this.fromUnits || !this.toUnits) {
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1695
|
+
const args = Object.assign(Object.assign({}, this.args), this.arguments.reduce((prev, { key, value }) => (Object.assign(Object.assign({}, prev), { [key]: value })), {}));
|
|
1696
|
+
try {
|
|
1697
|
+
this.result = parseResult(convertValue(this.value, this.fromUnits, this.toUnits, args));
|
|
1698
|
+
}
|
|
1699
|
+
catch (_) { }
|
|
1436
1700
|
}
|
|
1437
1701
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type:
|
|
1441
|
-
type: Component,
|
|
1702
|
+
UnitConverterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UnitConverterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1703
|
+
UnitConverterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UnitConverterComponent, selector: "he-unit-converter", inputs: { term: "term", value: "value", fromUnits: "fromUnits", toUnits: "toUnits" }, ngImport: i0, template: "<div class=\"columns mb-0\">\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"value\">Value</label>\n </div>\n <div class=\"column\">\n <label class=\"label has-text-white\" for=\"result\">Convert To</label>\n </div>\n</div>\n\n<div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" [(ngModel)]=\"value\" name=\"value\" id=\"value\"\n (input)=\"updateValue()\"\n >\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"fromUnits\" name=\"fromUnits\" id=\"fromUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of ConvertUnits | keys\" [value]=\"unit.value\">{{unit.key}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <input type=\"string\" class=\"input\" [value]=\"result\" name=\"result\" id=\"result\" readonly>\n </div>\n <div class=\"control\">\n <div class=\"select is-fullwidth\">\n <select [(ngModel)]=\"toUnits\" name=\"toUnits\" id=\"toUnits\"\n (change)=\"updateUnits()\"\n >\n <option [value]=\"undefined\">Unit</option>\n <option *ngFor=\"let unit of units\" [value]=\"unit\">{{unit}}</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <he-clipboard clipboardClass=\"button is-white px-2\"\n [value]=\"result\" [disabled]=\"!result\" [hideText]=\"true\"\n ></he-clipboard>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"field is-horizontal\" *ngFor=\"let arg of arguments\">\n <div class=\"field-label is-normal\">\n <label class=\"label has-text-white\" [for]=\"arg.key\">\n <span class=\"is-capitalized\">{{arg.key}}</span>\n <span class=\"has-text-danger pl-1\">*</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <div class=\"control\">\n <input type=\"string\" class=\"input is-small\"\n [(ngModel)]=\"arg.value\" [id]=\"arg.key\"\n (input)=\"updateValue()\"\n placeholder=\"Required for conversion\"\n >\n </div>\n </div>\n </div>\n</div>\n", styles: [".select{min-width:85px}\n"], components: [{ type: ClipboardComponent, selector: "he-clipboard", inputs: ["value", "disabled", "hideText", "icon", "size", "rotate", "clipboardClass"] }], directives: [{ type: i1$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "keys": KeysPipe } });
|
|
1704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UnitConverterComponent, decorators: [{
|
|
1705
|
+
type: Component$1,
|
|
1442
1706
|
args: [{
|
|
1443
|
-
selector: 'he-
|
|
1444
|
-
templateUrl: './
|
|
1445
|
-
styleUrls: ['./
|
|
1707
|
+
selector: 'he-unit-converter',
|
|
1708
|
+
templateUrl: './unit-converter.component.html',
|
|
1709
|
+
styleUrls: ['./unit-converter.component.scss']
|
|
1446
1710
|
}]
|
|
1447
|
-
}],
|
|
1711
|
+
}], propDecorators: { term: [{
|
|
1712
|
+
type: Input
|
|
1713
|
+
}], value: [{
|
|
1714
|
+
type: Input
|
|
1715
|
+
}], fromUnits: [{
|
|
1716
|
+
type: Input
|
|
1717
|
+
}], toUnits: [{
|
|
1448
1718
|
type: Input
|
|
1449
|
-
}], classes: [{
|
|
1450
|
-
type: HostBinding,
|
|
1451
|
-
args: ['class']
|
|
1452
1719
|
}] } });
|
|
1453
1720
|
|
|
1454
|
-
|
|
1455
|
-
class
|
|
1456
|
-
constructor() {
|
|
1457
|
-
this.
|
|
1721
|
+
/* eslint-disable @angular-eslint/directive-selector */
|
|
1722
|
+
class ClickOutsideDirective {
|
|
1723
|
+
constructor(elementRef) {
|
|
1724
|
+
this.elementRef = elementRef;
|
|
1725
|
+
this.clickOutside = new EventEmitter$1();
|
|
1458
1726
|
}
|
|
1459
|
-
|
|
1460
|
-
this.
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
duration,
|
|
1464
|
-
color: 'success',
|
|
1465
|
-
showRawMessage: true
|
|
1466
|
-
});
|
|
1727
|
+
onClick(event) {
|
|
1728
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
1729
|
+
this.clickOutside.emit();
|
|
1730
|
+
}
|
|
1467
1731
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1732
|
+
}
|
|
1733
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1734
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0 });
|
|
1735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
1736
|
+
type: Directive,
|
|
1737
|
+
args: [{
|
|
1738
|
+
selector: '[clickOutside]'
|
|
1739
|
+
}]
|
|
1740
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
1741
|
+
type: Output
|
|
1742
|
+
}], onClick: [{
|
|
1743
|
+
type: HostListener,
|
|
1744
|
+
args: ['document:click', ['$event']]
|
|
1745
|
+
}] } });
|
|
1746
|
+
|
|
1747
|
+
const get$3 = require('lodash.get');
|
|
1748
|
+
class GetPipe {
|
|
1749
|
+
transform(value, key, defaultValue = '') {
|
|
1750
|
+
return get$3(value, key, defaultValue);
|
|
1476
1751
|
}
|
|
1477
1752
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type:
|
|
1481
|
-
type:
|
|
1753
|
+
GetPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1754
|
+
GetPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GetPipe, name: "get" });
|
|
1755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GetPipe, decorators: [{
|
|
1756
|
+
type: Pipe,
|
|
1482
1757
|
args: [{
|
|
1483
|
-
|
|
1758
|
+
name: 'get'
|
|
1484
1759
|
}]
|
|
1485
1760
|
}] });
|
|
1486
1761
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1762
|
+
/* eslint-disable */
|
|
1763
|
+
/**
|
|
1764
|
+
* @class EventEmitter
|
|
1765
|
+
*
|
|
1766
|
+
* @property {Array} _listeners
|
|
1767
|
+
*/
|
|
1768
|
+
class EventEmitter {
|
|
1769
|
+
/**
|
|
1770
|
+
* Construct EventEmitter
|
|
1771
|
+
*
|
|
1772
|
+
* @param listeners
|
|
1773
|
+
*/
|
|
1774
|
+
constructor(listeners = []) {
|
|
1775
|
+
this._listeners = new Map(listeners);
|
|
1492
1776
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1777
|
+
/**
|
|
1778
|
+
* Destroys EventEmitter
|
|
1779
|
+
*/
|
|
1780
|
+
destroy() {
|
|
1781
|
+
this._listeners = {};
|
|
1495
1782
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1783
|
+
/**
|
|
1784
|
+
* Count listeners registered for the provided eventName
|
|
1785
|
+
*
|
|
1786
|
+
* @param eventName
|
|
1787
|
+
*/
|
|
1788
|
+
listenerCount(eventName) {
|
|
1789
|
+
if (!this._listeners.has(eventName)) {
|
|
1790
|
+
return 0;
|
|
1791
|
+
}
|
|
1792
|
+
return this._listeners.get(eventName).length;
|
|
1498
1793
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1794
|
+
/**
|
|
1795
|
+
* Subscribes on event eventName specified function
|
|
1796
|
+
*
|
|
1797
|
+
* @param eventName
|
|
1798
|
+
* @param listener
|
|
1799
|
+
*/
|
|
1800
|
+
on(eventName, listener) {
|
|
1801
|
+
this._addListener(eventName, listener, false);
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Subscribes on event name specified function to fire only once
|
|
1805
|
+
*
|
|
1806
|
+
* @param eventName
|
|
1807
|
+
* @param listener
|
|
1808
|
+
*/
|
|
1809
|
+
once(eventName, listener) {
|
|
1810
|
+
this._addListener(eventName, listener, true);
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Removes event with specified eventName.
|
|
1814
|
+
*
|
|
1815
|
+
* @param eventName
|
|
1816
|
+
*/
|
|
1817
|
+
off(eventName) {
|
|
1818
|
+
this._removeListeners(eventName);
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Emits event with specified name and params.
|
|
1822
|
+
*
|
|
1823
|
+
* @param eventName
|
|
1824
|
+
* @param eventArgs
|
|
1825
|
+
*/
|
|
1826
|
+
emit(eventName, ...eventArgs) {
|
|
1827
|
+
return this._applyEvents(eventName, eventArgs);
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Register a new listener
|
|
1831
|
+
*
|
|
1832
|
+
* @param eventName
|
|
1833
|
+
* @param listener
|
|
1834
|
+
* @param once
|
|
1835
|
+
*/
|
|
1836
|
+
_addListener(eventName, listener, once = false) {
|
|
1837
|
+
if (Array.isArray(eventName)) {
|
|
1838
|
+
eventName.forEach(e => this._addListener(e, listener, once));
|
|
1839
|
+
}
|
|
1840
|
+
else {
|
|
1841
|
+
eventName = eventName.toString();
|
|
1842
|
+
const split = eventName.split(/,|, | /);
|
|
1843
|
+
if (split.length > 1) {
|
|
1844
|
+
split.forEach(e => this._addListener(e, listener, once));
|
|
1845
|
+
}
|
|
1846
|
+
else {
|
|
1847
|
+
if (!Array.isArray(this._listeners.get(eventName))) {
|
|
1848
|
+
this._listeners.set(eventName, []);
|
|
1849
|
+
}
|
|
1850
|
+
(this._listeners.get(eventName)).push({
|
|
1851
|
+
once,
|
|
1852
|
+
fn: listener
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1503
1855
|
}
|
|
1504
1856
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1857
|
+
/**
|
|
1858
|
+
*
|
|
1859
|
+
* @param eventName
|
|
1860
|
+
*/
|
|
1861
|
+
_removeListeners(eventName = null) {
|
|
1862
|
+
if (eventName !== null) {
|
|
1863
|
+
if (Array.isArray(eventName)) {
|
|
1864
|
+
eventName.forEach(e => this._removeListeners(e));
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
eventName = eventName.toString();
|
|
1868
|
+
const split = eventName.split(/,|, | /);
|
|
1869
|
+
if (split.length > 1) {
|
|
1870
|
+
split.forEach(e => this._removeListeners(e));
|
|
1871
|
+
}
|
|
1872
|
+
else {
|
|
1873
|
+
this._listeners.delete(eventName);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
else {
|
|
1878
|
+
this._listeners = new Map();
|
|
1879
|
+
}
|
|
1507
1880
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1881
|
+
/**
|
|
1882
|
+
* Applies arguments to specified event
|
|
1883
|
+
*
|
|
1884
|
+
* @param eventName
|
|
1885
|
+
* @param eventArguments
|
|
1886
|
+
* @protected
|
|
1887
|
+
*/
|
|
1888
|
+
_applyEvents(eventName, eventArguments) {
|
|
1889
|
+
let result = eventArguments;
|
|
1890
|
+
if (this._listeners.has(eventName)) {
|
|
1891
|
+
const listeners = this._listeners.get(eventName);
|
|
1892
|
+
const removableListeners = [];
|
|
1893
|
+
listeners.forEach((listener, index) => {
|
|
1894
|
+
if (result = listener.fn.apply(null, eventArguments)) {
|
|
1895
|
+
if (listener.once) {
|
|
1896
|
+
removableListeners.unshift(index);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
removableListeners.forEach(index => {
|
|
1901
|
+
listeners.splice(index, 1);
|
|
1902
|
+
});
|
|
1903
|
+
return result;
|
|
1525
1904
|
}
|
|
1526
|
-
return
|
|
1905
|
+
return result[0];
|
|
1527
1906
|
}
|
|
1528
1907
|
}
|
|
1529
|
-
KeysPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1530
|
-
KeysPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, name: "keys" });
|
|
1531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: KeysPipe, decorators: [{
|
|
1532
|
-
type: Pipe,
|
|
1533
|
-
args: [{
|
|
1534
|
-
name: 'keys'
|
|
1535
|
-
}]
|
|
1536
|
-
}] });
|
|
1537
1908
|
|
|
1538
|
-
const
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1909
|
+
const isFunction = unknown => typeof unknown === 'function';
|
|
1910
|
+
const isString = unknown => (typeof unknown === 'string' ||
|
|
1911
|
+
((!!unknown && typeof unknown === 'object') && Object.prototype.toString.call(unknown) === '[object String]'));
|
|
1912
|
+
const isObject = unknown => ((typeof unknown === 'function' || (typeof unknown === 'object' && !!unknown)) && !Array.isArray(unknown));
|
|
1913
|
+
// Returns true if the value has a "then" function. Adapted from
|
|
1914
|
+
// https://github.com/graphql/graphql-js/blob/499a75939f70c4863d44149371d6a99d57ff7c35/src/jsutils/isPromise.js
|
|
1915
|
+
const isPromise = value => Boolean(value && typeof value.then === 'function');
|
|
1916
|
+
const isNode = unknown => {
|
|
1917
|
+
try {
|
|
1918
|
+
Node.prototype.cloneNode.call(unknown, false);
|
|
1919
|
+
return true;
|
|
1920
|
+
}
|
|
1921
|
+
catch (err) {
|
|
1922
|
+
return false;
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
/**
|
|
1926
|
+
* Convert String (false,False,True,true,no,yes,0,1) to real Boolean
|
|
1927
|
+
*
|
|
1928
|
+
* @param val
|
|
1929
|
+
*/
|
|
1930
|
+
const BooleanParse = (val) => {
|
|
1931
|
+
const falsy = /^(?:f(?:alse)?|no?|0+)$/i;
|
|
1932
|
+
return !falsy.test(val) && !!val;
|
|
1933
|
+
};
|
|
1934
|
+
/**
|
|
1935
|
+
* Check if given query selector is valid
|
|
1936
|
+
*
|
|
1937
|
+
* @param selector
|
|
1938
|
+
*/
|
|
1939
|
+
const isSelectorValid = selector => {
|
|
1940
|
+
const queryCheck = s => document.createDocumentFragment().querySelector(s);
|
|
1941
|
+
try {
|
|
1942
|
+
queryCheck(selector);
|
|
1943
|
+
}
|
|
1944
|
+
catch (_a) {
|
|
1945
|
+
return false;
|
|
1946
|
+
}
|
|
1947
|
+
return true;
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
/* eslint-disable */
|
|
1951
|
+
/**
|
|
1952
|
+
* querySelector under steroid
|
|
1953
|
+
* Can use as selector:
|
|
1954
|
+
* - function
|
|
1955
|
+
* - DOM Node
|
|
1956
|
+
* - String
|
|
1957
|
+
*
|
|
1958
|
+
* @param selector
|
|
1959
|
+
* @param node
|
|
1960
|
+
*/
|
|
1961
|
+
const querySelector = (selector, node) => {
|
|
1962
|
+
if (isFunction(selector)) {
|
|
1963
|
+
return selector(node);
|
|
1964
|
+
}
|
|
1965
|
+
if (isNode(selector)) {
|
|
1966
|
+
return selector;
|
|
1967
|
+
}
|
|
1968
|
+
if (isString(selector)) {
|
|
1969
|
+
if (!node || !isNode(node) || node.nodeType !== 1) {
|
|
1970
|
+
node = document;
|
|
1971
|
+
}
|
|
1972
|
+
return node.querySelector(selector);
|
|
1973
|
+
}
|
|
1974
|
+
if (Array.isArray(selector) || (typeof NodeList !== 'undefined' && NodeList.prototype.isPrototypeOf(selector))) {
|
|
1975
|
+
return selector[0];
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
/**
|
|
1979
|
+
* querySelectorAll under steroid
|
|
1980
|
+
* Can use as selector:
|
|
1981
|
+
* - function
|
|
1982
|
+
* - DOM Node
|
|
1983
|
+
* - String
|
|
1984
|
+
*
|
|
1985
|
+
* @param selector
|
|
1986
|
+
* @param node
|
|
1987
|
+
*/
|
|
1988
|
+
const querySelectorAll = (selector, node) => {
|
|
1989
|
+
if (isFunction(selector)) {
|
|
1990
|
+
return selector(node);
|
|
1991
|
+
}
|
|
1992
|
+
if (isNode(selector)) {
|
|
1993
|
+
return [selector];
|
|
1994
|
+
}
|
|
1995
|
+
if (isString(selector)) {
|
|
1996
|
+
if (!node || !isNode(node) || node.nodeType !== 1) {
|
|
1997
|
+
node = document;
|
|
1998
|
+
}
|
|
1999
|
+
return node.querySelectorAll(selector);
|
|
2000
|
+
}
|
|
2001
|
+
if (typeof NodeList !== 'undefined' && NodeList.prototype.isPrototypeOf(selector)) {
|
|
2002
|
+
return selector;
|
|
2003
|
+
}
|
|
2004
|
+
return [];
|
|
2005
|
+
};
|
|
2006
|
+
// Convert dataset into Object
|
|
2007
|
+
const optionsFromDataset = (node, defaultOptions = {}) => {
|
|
2008
|
+
if (isNode(node)) {
|
|
2009
|
+
return node.dataset ? Object.keys(node.dataset)
|
|
2010
|
+
.filter(key => Object.keys(defaultOptions).includes(key))
|
|
2011
|
+
.reduce((obj, key) => (Object.assign(Object.assign({}, obj), { [key]: node.dataset[key] })), {}) : {};
|
|
2012
|
+
}
|
|
2013
|
+
return {};
|
|
2014
|
+
};
|
|
2015
|
+
/**
|
|
2016
|
+
* Copy HTML attributes from a source element to a target element
|
|
2017
|
+
*
|
|
2018
|
+
* @param target
|
|
2019
|
+
* @param source
|
|
2020
|
+
* @param except list of attributes to skip (separated by space)
|
|
2021
|
+
*/
|
|
2022
|
+
const cloneAttributes = (target, source, except = null) => {
|
|
2023
|
+
if (except !== null) {
|
|
2024
|
+
except = except.split(' ');
|
|
2025
|
+
}
|
|
2026
|
+
[...source.attributes].forEach(attr => {
|
|
2027
|
+
if (!except.includes(attr.nodeName)) {
|
|
2028
|
+
target.setAttribute(attr.nodeName === 'id' ? 'data-id' : attr.nodeName, attr.nodeValue);
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
};
|
|
2032
|
+
/**
|
|
2033
|
+
* Escapes string for insertion into HTML, replacing special characters with HTML
|
|
2034
|
+
* entities.
|
|
2035
|
+
*
|
|
2036
|
+
* @param string
|
|
2037
|
+
*/
|
|
2038
|
+
const escape = (string) => isString(string) ?
|
|
2039
|
+
string.replace(/(['"<>])/g, (char) => ({
|
|
2040
|
+
'<': '<',
|
|
2041
|
+
'>': '>',
|
|
2042
|
+
'"': '"',
|
|
2043
|
+
'\'': '''
|
|
2044
|
+
}[char]))
|
|
2045
|
+
: string;
|
|
2046
|
+
|
|
2047
|
+
/* eslint-disable */
|
|
2048
|
+
var uuid = (prefix = '') => (prefix + (1e7 + -1e3 + -4e3 + -8e3 + -1e11)).replace(/[018]/g, c => (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16));
|
|
2049
|
+
|
|
2050
|
+
/* eslint-disable */
|
|
2051
|
+
class Component extends EventEmitter {
|
|
2052
|
+
constructor(element, options = {}, defaultOptions = {}) {
|
|
2053
|
+
super();
|
|
2054
|
+
this.element = querySelector(element, document);
|
|
2055
|
+
// An invalid selector or non-DOM node has been provided.
|
|
2056
|
+
if (!this.element) {
|
|
2057
|
+
throw new Error(`An invalid selector or non-DOM node has been provided for ${this.constructor.name}.`);
|
|
2058
|
+
}
|
|
2059
|
+
this.id = uuid('c-');
|
|
2060
|
+
this.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), options), optionsFromDataset(this.element, defaultOptions) // Use Element dataset values to override options
|
|
2061
|
+
);
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Initiate all DOM element corresponding to selector
|
|
2065
|
+
*
|
|
2066
|
+
* @method
|
|
2067
|
+
* @return Array of all Plugin instances
|
|
2068
|
+
*/
|
|
2069
|
+
static attach(selector = null, options = {}, node = null) {
|
|
2070
|
+
const instances = new Array();
|
|
2071
|
+
if (selector !== null) {
|
|
2072
|
+
querySelectorAll(selector, node).forEach(element => {
|
|
2073
|
+
// Check if plugin has already been instantiated for element
|
|
2074
|
+
if (typeof element[this.name] === 'undefined') { // If no then instantiate it and register it in element
|
|
2075
|
+
instances.push(new this(element, Object.assign({ selector }, options)));
|
|
2076
|
+
}
|
|
2077
|
+
else { // If Yes then return the existing instance
|
|
2078
|
+
instances.push(element[this.name]);
|
|
2079
|
+
}
|
|
2080
|
+
});
|
|
2081
|
+
if (typeof window[this.name] === 'undefined') {
|
|
2082
|
+
window[this.name] = {
|
|
2083
|
+
observers: []
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
if (window[this.name]['observers'] && !window[this.name]['observers'].includes(selector)) {
|
|
2087
|
+
this.observeDom(selector, options);
|
|
2088
|
+
window[this.name]['observers'].push(selector);
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
return instances;
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Observe DOM mutations to automatically initialize plugin on new elements when added to the DOM
|
|
2095
|
+
*
|
|
2096
|
+
* @param selector
|
|
2097
|
+
* @param options
|
|
2098
|
+
*/
|
|
2099
|
+
static observeDom(selector, options) {
|
|
2100
|
+
const observer = new MutationObserver(mutations => {
|
|
2101
|
+
mutations.forEach(mutation => {
|
|
2102
|
+
for (let i = 0; i < mutation.addedNodes.length; i++) {
|
|
2103
|
+
if (typeof window[this.name] !== 'undefined') {
|
|
2104
|
+
this.attach(selector, options, mutation.addedNodes[i]);
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2109
|
+
if (typeof document !== 'undefined') {
|
|
2110
|
+
observer.observe(document, {
|
|
2111
|
+
childList: true,
|
|
2112
|
+
subtree: true
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
static _interface(name = null, options = {}) {
|
|
2117
|
+
if (typeof name === 'string') {
|
|
2118
|
+
if (typeof this[name] === 'undefined') {
|
|
2119
|
+
throw new TypeError(`No method named "${name}"`);
|
|
2120
|
+
}
|
|
2121
|
+
return this[name](options);
|
|
2122
|
+
}
|
|
2123
|
+
return this;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
const defaultOptions = {
|
|
2128
|
+
allowDuplicates: false,
|
|
2129
|
+
caseSensitive: true,
|
|
2130
|
+
clearSelectionOnTyping: false,
|
|
2131
|
+
closeDropdownOnItemSelect: true,
|
|
2132
|
+
delimiter: ',',
|
|
2133
|
+
freeInput: true,
|
|
2134
|
+
highlightDuplicate: true,
|
|
2135
|
+
highlightMatchesString: true,
|
|
2136
|
+
itemValue: undefined,
|
|
2137
|
+
itemText: undefined,
|
|
2138
|
+
maxTags: undefined,
|
|
2139
|
+
maxChars: undefined,
|
|
2140
|
+
minChars: 1,
|
|
2141
|
+
noResultsLabel: 'No results found',
|
|
2142
|
+
placeholder: '',
|
|
2143
|
+
removable: true,
|
|
2144
|
+
searchMinChars: 1,
|
|
2145
|
+
searchOn: 'text',
|
|
2146
|
+
selectable: true,
|
|
2147
|
+
source: undefined,
|
|
2148
|
+
tagClass: 'is-rounded',
|
|
2149
|
+
trim: true // Should we trim value before processing them ?
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
var tagTemplate = (data) => `<span class="tag ${escape(data.style)}" data-value="${escape(data.value)}">
|
|
2153
|
+
${escape(data.text)}
|
|
2154
|
+
${data.removable ? '<div class="delete is-small" data-tag="delete"></div>' : ''}
|
|
2155
|
+
</span>`;
|
|
2156
|
+
|
|
2157
|
+
var containerTemplate = (data) => `<div class="tags-input">
|
|
2158
|
+
<input class="input" type="text" placeholder="${escape(data.placeholder)}">
|
|
2159
|
+
<div id="${escape(data.uuid)}-list" class="dropdown-menu" role="menu">
|
|
2160
|
+
<div class="dropdown-content">
|
|
2161
|
+
<span class="dropdown-item empty-title">${escape(data.emptyTitle)}</span>
|
|
2162
|
+
</div>
|
|
2163
|
+
</div>
|
|
2164
|
+
</div>`;
|
|
2165
|
+
|
|
2166
|
+
var dropdownItemTemplate = (data) => `<a href="javascript:void(0);" class="dropdown-item" data-value="${escape(data.value)}" data-text="${escape(data.text)}">${escape(data.text)}</a>`;
|
|
2167
|
+
|
|
2168
|
+
/* eslint-disable */
|
|
2169
|
+
// TODO: add pattern or function to valdiate value before adding
|
|
2170
|
+
class BulmaTagsInput extends Component {
|
|
2171
|
+
constructor(element, options = {}) {
|
|
2172
|
+
super(element, options, defaultOptions);
|
|
2173
|
+
// Convert Boolean string options to full Boolean
|
|
2174
|
+
this.options.allowDuplicates = BooleanParse(this.options.allowDuplicates);
|
|
2175
|
+
this.options.caseSensitive = BooleanParse(this.options.caseSensitive);
|
|
2176
|
+
this.options.clearSelectionOnTyping = BooleanParse(this.options.clearSelectionOnTyping);
|
|
2177
|
+
this.options.closeDropdownOnItemSelect = BooleanParse(this.options.closeDropdownOnItemSelect);
|
|
2178
|
+
this.options.freeInput = BooleanParse(this.options.freeInput);
|
|
2179
|
+
this.options.highlightDuplicate = BooleanParse(this.options.highlightDuplicate);
|
|
2180
|
+
this.options.highlightMatchesString = BooleanParse(this.options.highlightMatchesString);
|
|
2181
|
+
this.options.removable = BooleanParse(this.options.removable);
|
|
2182
|
+
this.options.searchOn = this.options.searchOn.toLowerCase();
|
|
2183
|
+
this.options.selectable = BooleanParse(this.options.selectable);
|
|
2184
|
+
this.options.trim = BooleanParse(this.options.trim);
|
|
2185
|
+
//Bind events to current class
|
|
2186
|
+
this._onDocumentClick = this._onDocumentClick.bind(this);
|
|
2187
|
+
this._onInputChange = this._onInputChange.bind(this);
|
|
2188
|
+
this._onInputClick = this._onInputClick.bind(this);
|
|
2189
|
+
this._onInputFocusOut = this._onInputFocusOut.bind(this);
|
|
2190
|
+
this._onInputFocusIn = this._onInputFocusIn.bind(this);
|
|
2191
|
+
this._onInputKeyDown = this._onInputKeyDown.bind(this);
|
|
2192
|
+
this._onInputKeyPress = this._onInputKeyPress.bind(this);
|
|
2193
|
+
this._onOriginalInputChange = this._onOriginalInputChange.bind(this);
|
|
2194
|
+
this._onTagDeleteClick = this._onTagDeleteClick.bind(this);
|
|
2195
|
+
this._onTagClick = this._onTagClick.bind(this);
|
|
2196
|
+
this._onDropdownItemClick = this._onDropdownItemClick.bind(this);
|
|
2197
|
+
// Define internal variables
|
|
2198
|
+
this._items = [];
|
|
2199
|
+
this._selected = -1; // index of selected item
|
|
2200
|
+
// Initiate plugin
|
|
2201
|
+
this._init();
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Initiate all DOM element corresponding to selector
|
|
2205
|
+
*
|
|
2206
|
+
* @method
|
|
2207
|
+
* @return Array of all Plugin instances
|
|
2208
|
+
*/
|
|
2209
|
+
static attach(selector = 'input[data-type="tags"], input[type="tags"], select[data-type="tags"], select[type="tags"]', options = {}, container = null) {
|
|
2210
|
+
return super.attach(selector, options, container);
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Initiate plugin
|
|
2214
|
+
*
|
|
2215
|
+
* @method init
|
|
2216
|
+
* @return
|
|
2217
|
+
*/
|
|
2218
|
+
_init() {
|
|
2219
|
+
// Detect if original input was a Select element
|
|
2220
|
+
this._isSelect = (this.element.tagName === 'SELECT');
|
|
2221
|
+
this._isMultiple = (this._isSelect && this.element.hasAttribute('multiple'));
|
|
2222
|
+
// Detect if we work with Object items or not
|
|
2223
|
+
// Object Items is forced when working with select element
|
|
2224
|
+
this._objectItems = (typeof this.options.itemValue !== 'undefined') || this._isSelect;
|
|
2225
|
+
this.options.itemValue = this.options.itemValue ? this.options.itemValue : (this._isSelect ? 'value' : undefined);
|
|
2226
|
+
this.options.itemText = this.options.itemText ? this.options.itemText : (this._isSelect ? 'text' : undefined);
|
|
2227
|
+
// If no itemText pass then use itemValue as itemText
|
|
2228
|
+
if (typeof this.options.itemText === 'undefined') {
|
|
2229
|
+
this.options.itemText = this.options.itemValue;
|
|
2230
|
+
}
|
|
2231
|
+
// Force freeInput to False if working with object items
|
|
2232
|
+
this.options.freeInput = this._objectItems ? false : this.options.freeInput;
|
|
2233
|
+
// Init search engine
|
|
2234
|
+
this.source = null;
|
|
2235
|
+
if (typeof this.options.source !== 'undefined') {
|
|
2236
|
+
// Fix searchOn option if wrong
|
|
2237
|
+
if (!['value', 'text'].includes(this.options.searchOn)) {
|
|
2238
|
+
this.options.searchOn = defaultOptions.searchOn;
|
|
2239
|
+
}
|
|
2240
|
+
if (isPromise(this.options.source)) {
|
|
2241
|
+
this.source = this.options.source;
|
|
2242
|
+
}
|
|
2243
|
+
else if (isFunction(this.options.source)) {
|
|
2244
|
+
this.source = value => Promise.resolve(this.options.source(value));
|
|
2245
|
+
}
|
|
2246
|
+
else if (Array.isArray(this.options.source)) {
|
|
2247
|
+
this.source = value => Promise.resolve(this.options.source.filter(i => {
|
|
2248
|
+
const val = (this._objectItems ? i[this.options.itemValue] : i);
|
|
2249
|
+
return this.options.caseSensitive ? val.includes(value) : val.toLowerCase().includes(value.toLowerCase());
|
|
2250
|
+
}));
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
// Determine allowed input modes
|
|
2254
|
+
this._manualInputAllowed = !this._isSelect && this.options.freeInput;
|
|
2255
|
+
this._filterInputAllowed = this._isSelect || this.source;
|
|
2256
|
+
this._build();
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Build TagsInput DOM elements
|
|
2260
|
+
*/
|
|
2261
|
+
_build() {
|
|
2262
|
+
// Create TagsInput DOM
|
|
2263
|
+
const containerFragment = document.createRange().createContextualFragment(containerTemplate({
|
|
2264
|
+
emptyTitle: typeof this.options.noResultsLabel !== 'undefined' ? this.options.noResultsLabel : 'No results found',
|
|
2265
|
+
placeholder: this.element.placeholder ? this.element.placeholder : this.options.placeholder,
|
|
2266
|
+
uuid: this.id
|
|
2267
|
+
}));
|
|
2268
|
+
this.container = containerFragment.firstElementChild;
|
|
2269
|
+
this._input = this.container.querySelector('input');
|
|
2270
|
+
this.dropdown = this.container.querySelector(`#${this.id}-list .dropdown-content`);
|
|
2271
|
+
this.dropdownEmptyOption = this.dropdown.querySelector('.empty-title');
|
|
2272
|
+
// Clone attributes between original and new input
|
|
2273
|
+
cloneAttributes(this._input, this.element, 'data-type multiple name type value');
|
|
2274
|
+
if (this.element.disabled) {
|
|
2275
|
+
this.container.setAttribute('disabled', 'disabled');
|
|
2276
|
+
this.options.removable = false;
|
|
2277
|
+
this.options.selectable = false;
|
|
2278
|
+
}
|
|
2279
|
+
// Propagate original input disabled attribute to the container
|
|
2280
|
+
if (this._input.getAttribute('disabled') || this._input.classList.contains('is-disabled')) {
|
|
2281
|
+
this.container.setAttribute('disabled', 'disabled');
|
|
2282
|
+
}
|
|
2283
|
+
if (!this._manualInputAllowed) {
|
|
2284
|
+
this.container.classList.add(this._filterInputAllowed ? 'is-filter' : 'no-input');
|
|
2285
|
+
}
|
|
2286
|
+
// Remove dropdown if no source or original input is not a select element
|
|
2287
|
+
if (!this._isSelect && typeof this.options.source === 'undefined') {
|
|
2288
|
+
this.dropdown.remove();
|
|
2289
|
+
this.dropdown = null;
|
|
2290
|
+
this._input.setAttribute('list', null);
|
|
2291
|
+
}
|
|
2292
|
+
// Initialize plugin value from original input value
|
|
2293
|
+
if (this._isSelect) {
|
|
2294
|
+
Array.from(this.element.options).forEach((option) => {
|
|
2295
|
+
if (option.selected) {
|
|
2296
|
+
// HTML Option element contains value and text properties
|
|
2297
|
+
// Add it silently to not propagate to the original element
|
|
2298
|
+
this.add(option.value ? option : {
|
|
2299
|
+
value: option.text,
|
|
2300
|
+
text: option.text
|
|
2301
|
+
}, true);
|
|
2302
|
+
}
|
|
2303
|
+
this._createDropdownItem(option);
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
else {
|
|
2307
|
+
// We have on input element
|
|
2308
|
+
if (this.element.value.length) {
|
|
2309
|
+
this.add(this._objectItems ? JSON.parse(this.element.value) : this.element.value, true);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
this._bindEvents();
|
|
2313
|
+
// Insert container right before original input and make original input hidden
|
|
2314
|
+
this.element.parentNode.insertBefore(this.container, this.element);
|
|
2315
|
+
// Hide original input (type="hidden" only works on select)
|
|
2316
|
+
this.element.style.display = 'none';
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Bind all events listener
|
|
2320
|
+
*/
|
|
2321
|
+
_bindEvents() {
|
|
2322
|
+
// Bind document click event to close dropdown
|
|
2323
|
+
document.addEventListener('click', this._onDocumentClick);
|
|
2324
|
+
// Bind event handlers to orginal input
|
|
2325
|
+
this.element.addEventListener('change', this._onOriginalInputChange);
|
|
2326
|
+
// Bind event handlers to internal input
|
|
2327
|
+
this._input.addEventListener('input', this._onInputChange);
|
|
2328
|
+
this._input.addEventListener('click', this._onInputClick);
|
|
2329
|
+
this._input.addEventListener('keydown', this._onInputKeyDown);
|
|
2330
|
+
this._input.addEventListener('keypress', this._onInputKeyPress);
|
|
2331
|
+
this._input.addEventListener('focusout', this._onInputFocusOut);
|
|
2332
|
+
this._input.addEventListener('focusin', this._onInputFocusIn);
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Check if caret is at the beginning of the input value
|
|
2336
|
+
*/
|
|
2337
|
+
_caretAtStart() {
|
|
2338
|
+
try {
|
|
2339
|
+
return this._input.selectionStart === 0 && this._input.selectionEnd === 0;
|
|
2340
|
+
}
|
|
2341
|
+
catch (e) {
|
|
2342
|
+
return this._input.value === '';
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Check value length constraint if option activated
|
|
2347
|
+
*
|
|
2348
|
+
* @param item
|
|
2349
|
+
*/
|
|
2350
|
+
_checkLength(item) {
|
|
2351
|
+
const value = this._objectItems ? item[this.options.itemValue] : item;
|
|
2352
|
+
if (!isString(value)) {
|
|
2353
|
+
return true;
|
|
2354
|
+
}
|
|
2355
|
+
return value.length >= this.options.minChars && (typeof this.options.maxChars === 'undefined' || value.length <= this.options.maxChars);
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Close dropdown
|
|
2359
|
+
*/
|
|
2360
|
+
_closeDropdown() {
|
|
2361
|
+
if (this.dropdown) {
|
|
2362
|
+
this.emit('before.dropdown.close', this);
|
|
2363
|
+
this.container.classList.remove('is-active');
|
|
2364
|
+
this.emit('after.dropdown.close', this);
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Create a new dropdown item based on given item data
|
|
2369
|
+
*
|
|
2370
|
+
* @param item
|
|
2371
|
+
*/
|
|
2372
|
+
_createDropdownItem(item) {
|
|
2373
|
+
if (this.dropdown) {
|
|
2374
|
+
// TODO: add possibility to provide template through options
|
|
2375
|
+
const dropdownItemFragment = document.createRange().createContextualFragment(dropdownItemTemplate({
|
|
2376
|
+
text: item.text,
|
|
2377
|
+
value: item.value
|
|
2378
|
+
}));
|
|
2379
|
+
const dropdownItem = dropdownItemFragment.firstElementChild;
|
|
2380
|
+
// Save item data into dataset
|
|
2381
|
+
dropdownItem.dataset.value = item.value;
|
|
2382
|
+
dropdownItem.dataset.text = item.text;
|
|
2383
|
+
dropdownItem.addEventListener('click', this._onDropdownItemClick);
|
|
2384
|
+
this.dropdown.append(dropdownItem);
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
/**
|
|
2388
|
+
* Create a new tag and add it to the DOM
|
|
2389
|
+
*
|
|
2390
|
+
* @param string value
|
|
2391
|
+
*/
|
|
2392
|
+
_createTag(item) {
|
|
2393
|
+
const tagFragment = document.createRange().createContextualFragment(tagTemplate({
|
|
2394
|
+
removable: this.options.removable,
|
|
2395
|
+
style: this.options.tagClass,
|
|
2396
|
+
text: item.text,
|
|
2397
|
+
value: item.value
|
|
2398
|
+
}));
|
|
2399
|
+
const tag = tagFragment.firstElementChild;
|
|
2400
|
+
// Attach tag click event to select it
|
|
2401
|
+
tag.addEventListener('click', this._onTagClick);
|
|
2402
|
+
if (this.options.removable) {
|
|
2403
|
+
// Find delete button and attach click event
|
|
2404
|
+
const deleteButton = tag.querySelector('.delete');
|
|
2405
|
+
if (deleteButton) {
|
|
2406
|
+
deleteButton.addEventListener('click', this._onTagDeleteClick);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
// insert new tag at the end (ie just before input)
|
|
2410
|
+
this.container.insertBefore(tag, this._input);
|
|
2411
|
+
}
|
|
2412
|
+
/**
|
|
2413
|
+
* Remove all dropdown items except the empty title
|
|
2414
|
+
*/
|
|
2415
|
+
_emptyDropdown() {
|
|
2416
|
+
if (this.dropdown) {
|
|
2417
|
+
Array.from(this.dropdown.children).filter((child) => !child.classList.contains('empty-title')).forEach((child) => {
|
|
2418
|
+
child.remove();
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
/**
|
|
2423
|
+
* Find needle into a string and wrap it with <mark> HTML tag
|
|
2424
|
+
*
|
|
2425
|
+
* @param string
|
|
2426
|
+
* @param needle
|
|
2427
|
+
*/
|
|
2428
|
+
_highlightMatchesInString(string, needle) {
|
|
2429
|
+
const reg = '(' + needle + ')(?![^<]*>|[^<>]*</)'; // explanation: http://stackoverflow.com/a/18622606/1147859
|
|
2430
|
+
const regex = new RegExp(reg, 'i');
|
|
2431
|
+
// If the regex doesn't match the string just return initial string
|
|
2432
|
+
if (!string.match(regex)) {
|
|
2433
|
+
return string;
|
|
2434
|
+
}
|
|
2435
|
+
// Otherwise, get to highlighting
|
|
2436
|
+
const matchStartPosition = string.match(regex).index;
|
|
2437
|
+
const matchEndPosition = matchStartPosition + string.match(regex)[0].toString().length;
|
|
2438
|
+
const originalTextFoundByRegex = string.substring(matchStartPosition, matchEndPosition);
|
|
2439
|
+
string = string.replace(regex, `<mark class="is-highlighted">${originalTextFoundByRegex}</mark>`);
|
|
2440
|
+
return string;
|
|
2441
|
+
}
|
|
2442
|
+
/**
|
|
2443
|
+
* Open dropdown
|
|
2444
|
+
*/
|
|
2445
|
+
_openDropdown() {
|
|
2446
|
+
if (this.dropdown) {
|
|
2447
|
+
this.container.classList.add('is-active');
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
/**
|
|
2451
|
+
* Propagate internal input changes to the original input
|
|
2452
|
+
*/
|
|
2453
|
+
_propagateChange() {
|
|
2454
|
+
if (!this._isSelect) {
|
|
2455
|
+
// If original element is an input element
|
|
2456
|
+
this.element.value = this.value;
|
|
2457
|
+
}
|
|
2458
|
+
else {
|
|
2459
|
+
// If original element is a select element
|
|
2460
|
+
Array.from(this.element.options).forEach((option) => {
|
|
2461
|
+
option.setAttribute('selected', undefined);
|
|
2462
|
+
option.selected = false;
|
|
2463
|
+
// If option has been added by TagsInput then we remove it
|
|
2464
|
+
// Otherwise it is an original option
|
|
2465
|
+
if (typeof option.dataset.source !== 'undefined') {
|
|
2466
|
+
option.remove();
|
|
2467
|
+
}
|
|
2468
|
+
});
|
|
2469
|
+
// Update original element options selected attributes
|
|
2470
|
+
this._items.forEach(item => {
|
|
2471
|
+
this._updateSelectOptions({
|
|
2472
|
+
value: this._objectItems ? item[this.options.itemValue] : item,
|
|
2473
|
+
text: this._objectItems ? item[this.options.itemText] : item
|
|
2474
|
+
});
|
|
2475
|
+
});
|
|
2476
|
+
}
|
|
2477
|
+
// Trigger Change event manually (because original input is now hidden)
|
|
2478
|
+
// Trick: Passes current class constructor name to prevent loop with _onOriginalInputChange handler)
|
|
2479
|
+
const changeEvent = new CustomEvent('change', {
|
|
2480
|
+
detail: this.constructor.name
|
|
2481
|
+
});
|
|
2482
|
+
this.element.dispatchEvent(changeEvent);
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Trim value if option activated
|
|
2486
|
+
*
|
|
2487
|
+
* @param item
|
|
2488
|
+
*/
|
|
2489
|
+
_trim(item) {
|
|
2490
|
+
if (this.options.trim) {
|
|
2491
|
+
if (this._objectItems) {
|
|
2492
|
+
if (isString(item[this.options.itemValue])) {
|
|
2493
|
+
item[this.options.itemValue] = item[this.options.itemValue].trim();
|
|
2494
|
+
}
|
|
2495
|
+
if (isString(item[this.options.itemText])) {
|
|
2496
|
+
item[this.options.itemText] = item[this.options.itemText].trim();
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
else {
|
|
2500
|
+
item = item.trim();
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return item;
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Filter Dropdown items to be compliant with already selected items and current input value
|
|
2507
|
+
* Filtering is made on Text by default (can be changed with option)
|
|
2508
|
+
*/
|
|
2509
|
+
_filterDropdownItems(value = null) {
|
|
2510
|
+
if (this.dropdown) {
|
|
2511
|
+
if (this.emit('before.dropdown.filter', this)) {
|
|
2512
|
+
Array.from(this.dropdown.children).filter((child) => !child.classList.contains('empty-title')).forEach((child) => {
|
|
2513
|
+
const childValue = child.dataset[this.options.searchOn];
|
|
2514
|
+
// Remove highlights
|
|
2515
|
+
if (this.options.highlightMatchesString) {
|
|
2516
|
+
child.textContent = child.textContent.replace(/<\/?(mark\s?(class="is\-highlighted")?)?>]*>?/gm, '');
|
|
2517
|
+
}
|
|
2518
|
+
// If value is found in dropdown
|
|
2519
|
+
if ((value && value.length)) {
|
|
2520
|
+
if (this.options.caseSensitive) {
|
|
2521
|
+
child.style.display = childValue.includes(value) ? 'block' : 'none';
|
|
2522
|
+
}
|
|
2523
|
+
else {
|
|
2524
|
+
child.style.display = childValue.toLowerCase().includes(value.toLowerCase()) ? 'block' : 'none';
|
|
2525
|
+
}
|
|
2526
|
+
if (this.options.highlightMatchesString) {
|
|
2527
|
+
child.innerHTML = this._highlightMatchesInString(child.innerHTML, value);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
else {
|
|
2531
|
+
child.style.display = 'block';
|
|
2532
|
+
}
|
|
2533
|
+
if (!this.options.allowDuplicates || (this._isSelect && !this._isMultiple)) {
|
|
2534
|
+
const hasValue = this.options.searchOn === 'value' ? this.hasValue(childValue) : this.hasText(childValue);
|
|
2535
|
+
child.style.display = hasValue ? 'none' : child.style.display;
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
const hasActiveItems = Array.from(this.dropdown.children).filter((child) => !child.classList.contains('empty-title')).some((child) => child.style.display !== 'none');
|
|
2539
|
+
if (hasActiveItems) {
|
|
2540
|
+
this.dropdownEmptyOption.style.display = 'none';
|
|
2541
|
+
}
|
|
2542
|
+
else {
|
|
2543
|
+
this.dropdownEmptyOption.style.display = 'block';
|
|
2544
|
+
}
|
|
2545
|
+
this.emit('after.dropdown.filter', this);
|
|
2546
|
+
return hasActiveItems;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
return true;
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Update original select option based on given item
|
|
2553
|
+
*
|
|
2554
|
+
* @param item
|
|
2555
|
+
*/
|
|
2556
|
+
_updateSelectOptions(item) {
|
|
2557
|
+
if (this._isSelect) {
|
|
2558
|
+
// Check to see if the tag exists in its raw or uri-encoded form
|
|
2559
|
+
let option = this.element.querySelector(`option[value="${encodeURIComponent(item.value)}"]`) || this.element.querySelector(`option[value="${item.value}"]`);
|
|
2560
|
+
// add <option /> if item represents a value not present in one of the <select />'s options
|
|
2561
|
+
if (!option) {
|
|
2562
|
+
const optionFragment = document.createRange().createContextualFragment(`<option value="${item.value}" data-source="${this.id}" selected>${item.text}</option>`);
|
|
2563
|
+
option = optionFragment.firstElementChild;
|
|
2564
|
+
this.element.add(option);
|
|
2565
|
+
}
|
|
2566
|
+
// mark option as selected
|
|
2567
|
+
option.setAttribute('selected', 'selected');
|
|
2568
|
+
option.selected = true;
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* Add given item
|
|
2573
|
+
* item = 'john'
|
|
2574
|
+
* item = 'john,jane'
|
|
2575
|
+
* item = ['john', 'jane']
|
|
2576
|
+
* item = [{
|
|
2577
|
+
* "value": "1",
|
|
2578
|
+
* "text": "John"
|
|
2579
|
+
* }, {
|
|
2580
|
+
* "value": "2",
|
|
2581
|
+
* "text": "Jane"
|
|
2582
|
+
* }]
|
|
2583
|
+
*
|
|
2584
|
+
* @param item
|
|
2585
|
+
* @param silently Should the change be propagated to the original element
|
|
2586
|
+
*/
|
|
2587
|
+
add(items, silently = false) {
|
|
2588
|
+
// Check if number of items is limited ans reached
|
|
2589
|
+
if (typeof this.options.maxTags !== 'undefined' && this._items.length >= this.options.maxTags) {
|
|
2590
|
+
return this;
|
|
2591
|
+
}
|
|
2592
|
+
// Make sure to work with an array of items
|
|
2593
|
+
items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
|
|
2594
|
+
// If string items are expected then check every item is a string
|
|
2595
|
+
if (!this._objectItems && (items.filter(item => isString(item)).length !== items.length)) {
|
|
2596
|
+
throw ('Item must be a string or an array of strings');
|
|
2597
|
+
}
|
|
2598
|
+
// If object items are expected then check every item is an object
|
|
2599
|
+
if (this._objectItems && (items.filter(item => isObject(item)).length !== items.length)) {
|
|
2600
|
+
throw ('Item must be an object or an array of objects');
|
|
2601
|
+
}
|
|
2602
|
+
items.forEach(item => {
|
|
2603
|
+
item = this._trim(item);
|
|
2604
|
+
// Check if item respects min/max chars
|
|
2605
|
+
if (this._checkLength(item)) {
|
|
2606
|
+
// If original input is a non multiple select element
|
|
2607
|
+
if (this._isSelect && !this._isMultiple && this._items.length > 0) {
|
|
2608
|
+
this.removeAtIndex(0);
|
|
2609
|
+
this.element.remove(this.element.selectedIndex);
|
|
2610
|
+
}
|
|
2611
|
+
// check if duplicates are allowed or not
|
|
2612
|
+
if (item = this.emit('before.add', item)) {
|
|
2613
|
+
if (this.options.allowDuplicates || !this.has(item)) {
|
|
2614
|
+
const itemData = {
|
|
2615
|
+
value: this._objectItems ? item[this.options.itemValue] : item,
|
|
2616
|
+
text: this._objectItems ? item[this.options.itemText] : item
|
|
2617
|
+
};
|
|
2618
|
+
const tag = this._createTag(itemData);
|
|
2619
|
+
// save item into the internal array
|
|
2620
|
+
this._items.push(item);
|
|
2621
|
+
if (!silently) {
|
|
2622
|
+
// Propagate change event to the original input
|
|
2623
|
+
this._propagateChange();
|
|
2624
|
+
this.emit('after.add', {
|
|
2625
|
+
item,
|
|
2626
|
+
tag
|
|
2627
|
+
});
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
else {
|
|
2631
|
+
if (this.options.highlightDuplicate) {
|
|
2632
|
+
const duplicateTag = Array.from(this.container.children).filter((child) => child.classList.contains('tag'))[this.indexOf(item)];
|
|
2633
|
+
if (duplicateTag) {
|
|
2634
|
+
duplicateTag.classList.add('is-duplicate');
|
|
2635
|
+
setTimeout(() => {
|
|
2636
|
+
duplicateTag.classList.remove('is-duplicate');
|
|
2637
|
+
}, 1250);
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
this.emit('item.duplicate', item);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
});
|
|
2645
|
+
return this;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* Unselect the selected item
|
|
2649
|
+
*/
|
|
2650
|
+
clearSelection() {
|
|
2651
|
+
if (this._selected >= 0) {
|
|
2652
|
+
const item = this._items[this._selected];
|
|
2653
|
+
const tag = Array.from(this.container.children).filter((child) => child.classList.contains('tag'))[this._selected];
|
|
2654
|
+
if (this.emit('before.unselect', {
|
|
2655
|
+
item,
|
|
2656
|
+
tag
|
|
2657
|
+
})) {
|
|
2658
|
+
if (tag) {
|
|
2659
|
+
tag.classList.remove('is-selected');
|
|
2660
|
+
}
|
|
2661
|
+
this._selected = -1;
|
|
2662
|
+
this.emit('after.unselect', {
|
|
2663
|
+
item,
|
|
2664
|
+
tag
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
return this;
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* Shortcut to removeAll method
|
|
2672
|
+
*/
|
|
2673
|
+
flush() {
|
|
2674
|
+
return this.removeAll();
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* Sets focus on the input
|
|
2678
|
+
*/
|
|
2679
|
+
focus() {
|
|
2680
|
+
this.container.classList.add('is-focused');
|
|
2681
|
+
this._input.focus();
|
|
2682
|
+
return this;
|
|
2683
|
+
}
|
|
2684
|
+
/**
|
|
2685
|
+
* Check if given item is present
|
|
2686
|
+
*
|
|
2687
|
+
* @param item
|
|
2688
|
+
*/
|
|
2689
|
+
has(item) {
|
|
2690
|
+
item = this._trim(item);
|
|
2691
|
+
if (this._objectItems) {
|
|
2692
|
+
return this._items.some(i => this.options.caseSensitive || !isString(i[this.options.itemValue]) ? i[this.options.itemValue] === item[this.options.itemValue] : i[this.options.itemValue].toLowerCase() === item[this.options.itemValue].toLowerCase());
|
|
2693
|
+
}
|
|
2694
|
+
else {
|
|
2695
|
+
return this.hasValue(item);
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Check if given text is present
|
|
2700
|
+
*
|
|
2701
|
+
* @param value
|
|
2702
|
+
*/
|
|
2703
|
+
hasText(value) {
|
|
2704
|
+
if (this.options.trim) {
|
|
2705
|
+
value = value.trim();
|
|
2706
|
+
}
|
|
2707
|
+
return this._items.some(i => {
|
|
2708
|
+
const val = (this._objectItems ? i[this.options.itemText] : i);
|
|
2709
|
+
return this.options.caseSensitive ? val === value : val.toLowerCase() === value.toLowerCase();
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* Check if given value is present
|
|
2714
|
+
*
|
|
2715
|
+
* @param value
|
|
2716
|
+
*/
|
|
2717
|
+
hasValue(value) {
|
|
2718
|
+
if (this.options.trim) {
|
|
2719
|
+
value = value.trim();
|
|
2720
|
+
}
|
|
2721
|
+
return this._items.some(i => {
|
|
2722
|
+
const val = (this._objectItems ? i[this.options.itemValue] : i);
|
|
2723
|
+
return this.options.caseSensitive ? val === value : val.toLowerCase() === value.toLowerCase();
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Get index of given item
|
|
2728
|
+
*
|
|
2729
|
+
* @param item
|
|
2730
|
+
*/
|
|
2731
|
+
indexOf(item) {
|
|
2732
|
+
item = this._trim(item);
|
|
2733
|
+
if (this._objectItems) {
|
|
2734
|
+
if (!isObject(item)) {
|
|
2735
|
+
throw ('Item must be an object');
|
|
2736
|
+
}
|
|
2737
|
+
return this._items.map(function (e) { return e.value; }).indexOf(item.value);
|
|
2738
|
+
}
|
|
2739
|
+
else {
|
|
2740
|
+
return this._items.indexOf(item);
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* Returns the internal input element
|
|
2745
|
+
*/
|
|
2746
|
+
input() {
|
|
2747
|
+
return this._input;
|
|
2748
|
+
}
|
|
2749
|
+
/**
|
|
2750
|
+
* Get items
|
|
2751
|
+
*/
|
|
2752
|
+
items() {
|
|
2753
|
+
return this._items;
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Remove given item
|
|
2757
|
+
* item = 'john'
|
|
2758
|
+
* item = 'john,jane'
|
|
2759
|
+
*
|
|
2760
|
+
* @param String item
|
|
2761
|
+
*/
|
|
2762
|
+
remove(items) {
|
|
2763
|
+
if (this.options.removable) {
|
|
2764
|
+
// Make sure to work with an array of items
|
|
2765
|
+
items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
|
|
2766
|
+
// If string items are expected then check every item is a string
|
|
2767
|
+
if (!this._objectItems && (items.filter(item => isString(item)).length !== items.length)) {
|
|
2768
|
+
throw ('Item must be a string or an array of strings');
|
|
2769
|
+
}
|
|
2770
|
+
// If object items are expected then check every item is an object
|
|
2771
|
+
if (this._objectItems && (items.filter(item => isObject(item)).length !== items.length)) {
|
|
2772
|
+
throw ('Item must be an object or an array of objects');
|
|
2773
|
+
}
|
|
2774
|
+
items.forEach(item => {
|
|
2775
|
+
let index = this.indexOf(item);
|
|
2776
|
+
while (index >= 0) {
|
|
2777
|
+
this.removeAtIndex(index);
|
|
2778
|
+
index = this.indexOf(item);
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
return this;
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Remove all tags at once
|
|
2786
|
+
*/
|
|
2787
|
+
removeAll() {
|
|
2788
|
+
if (this.options.removable) {
|
|
2789
|
+
if (this.emit('before.flush', this._items)) {
|
|
2790
|
+
this.clearSelection();
|
|
2791
|
+
Array.from(this.container.children).filter((child) => child.classList.contains('tag')).forEach((tag) => tag.remove());
|
|
2792
|
+
this._items = [];
|
|
2793
|
+
this._filterDropdownItems();
|
|
2794
|
+
this._propagateChange();
|
|
2795
|
+
this.emit('after.flush', this._items);
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
return this;
|
|
2799
|
+
}
|
|
2800
|
+
/**
|
|
2801
|
+
* Remove item at given index
|
|
2802
|
+
*
|
|
2803
|
+
* @param Integer index
|
|
2804
|
+
*/
|
|
2805
|
+
removeAtIndex(index, clearSelection = true) {
|
|
2806
|
+
if (this.options.removable && !isNaN(index) && index >= 0 && index < this._items.length) {
|
|
2807
|
+
const tag = Array.from(this.container.children).filter((child) => child.classList.contains('tag'))[index];
|
|
2808
|
+
const item = this._items[index];
|
|
2809
|
+
if (this.emit('before.remove', item)) {
|
|
2810
|
+
if (clearSelection) {
|
|
2811
|
+
this.clearSelection();
|
|
2812
|
+
}
|
|
2813
|
+
if (tag) {
|
|
2814
|
+
tag.remove();
|
|
2815
|
+
}
|
|
2816
|
+
// If original input is a select element
|
|
2817
|
+
// then deselect related option
|
|
2818
|
+
if (this._isSelect) {
|
|
2819
|
+
this.element.options[index].selected = false;
|
|
2820
|
+
}
|
|
2821
|
+
if (this._selected == index) {
|
|
2822
|
+
this._selected = -1;
|
|
2823
|
+
}
|
|
2824
|
+
else if (this._selected >= 0) {
|
|
2825
|
+
// One item less so selected index is
|
|
2826
|
+
this._selected -= 1;
|
|
2827
|
+
}
|
|
2828
|
+
this._items.splice(index, 1);
|
|
2829
|
+
this._filterDropdownItems();
|
|
2830
|
+
this._propagateChange();
|
|
2831
|
+
this.emit('after.remove', item);
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
return this;
|
|
2835
|
+
}
|
|
2836
|
+
/**
|
|
2837
|
+
* Select given item
|
|
2838
|
+
*
|
|
2839
|
+
* @param item
|
|
2840
|
+
*/
|
|
2841
|
+
select(items) {
|
|
2842
|
+
if (this.options.selectable) {
|
|
2843
|
+
// Make sure to work with an array of items
|
|
2844
|
+
items = Array.isArray(items) ? items : isObject(items) ? [items] : items.split(this.options.delimiter);
|
|
2845
|
+
// If string items are expected then check every item is a string
|
|
2846
|
+
if (!this._objectItems && (items.filter(item => isString(item)).length !== items.length)) {
|
|
2847
|
+
throw ('Item must be a string or an array of strings');
|
|
2848
|
+
}
|
|
2849
|
+
// If object items are expected then check every item is an object
|
|
2850
|
+
if (this._objectItems && (items.filter(item => isObject(item)).length !== items.length)) {
|
|
2851
|
+
throw ('Item must be an object or an array of objects');
|
|
2852
|
+
}
|
|
2853
|
+
items.forEach(item => {
|
|
2854
|
+
this.selectAtIndex(this.indexOf(item));
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
return this;
|
|
2858
|
+
}
|
|
2859
|
+
/**
|
|
2860
|
+
* Select tag at given index
|
|
2861
|
+
*
|
|
2862
|
+
* @param Integer index
|
|
2863
|
+
*/
|
|
2864
|
+
selectAtIndex(index) {
|
|
2865
|
+
if (this.options.selectable) {
|
|
2866
|
+
// Clear selection
|
|
2867
|
+
this.clearSelection();
|
|
2868
|
+
if (!isNaN(index) && index >= 0 && index < this._items.length) {
|
|
2869
|
+
const tag = Array.from(this.container.children).filter((child) => child.classList.contains('tag'))[index];
|
|
2870
|
+
const item = this._items[index];
|
|
2871
|
+
if (this.emit('before.select', {
|
|
2872
|
+
item,
|
|
2873
|
+
tag
|
|
2874
|
+
})) {
|
|
2875
|
+
if (tag) {
|
|
2876
|
+
tag.classList.add('is-selected');
|
|
2877
|
+
}
|
|
2878
|
+
this._selected = index;
|
|
2879
|
+
this.emit('after.select', {
|
|
2880
|
+
item,
|
|
2881
|
+
tag
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
return this;
|
|
2887
|
+
}
|
|
2888
|
+
/**
|
|
2889
|
+
* Get selected item
|
|
2890
|
+
*/
|
|
2891
|
+
get selected() {
|
|
2892
|
+
if (this._selected >= 0) {
|
|
2893
|
+
return this._items[this._selected];
|
|
2894
|
+
}
|
|
2895
|
+
else {
|
|
2896
|
+
return null;
|
|
2897
|
+
}
|
|
1546
2898
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
2899
|
+
/**
|
|
2900
|
+
* Get selected item index
|
|
2901
|
+
*/
|
|
2902
|
+
get selectedIndex() {
|
|
2903
|
+
return this._selected;
|
|
1549
2904
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
2905
|
+
/**
|
|
2906
|
+
* Get value
|
|
2907
|
+
*/
|
|
2908
|
+
get value() {
|
|
2909
|
+
if (!this._isSelect) {
|
|
2910
|
+
if (this._objectItems) {
|
|
2911
|
+
return this._items.map(item => item.value).join(this.options.delimiter);
|
|
2912
|
+
}
|
|
2913
|
+
else {
|
|
2914
|
+
return this._items.join(this.options.delimiter);
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
else {
|
|
2918
|
+
return Array.from(this.element.options).filter((option) => option.selected).map((option) => option.value);
|
|
2919
|
+
}
|
|
1556
2920
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
2921
|
+
/**
|
|
2922
|
+
* Set value
|
|
2923
|
+
*/
|
|
2924
|
+
set value(string) {
|
|
2925
|
+
this.removeAll();
|
|
2926
|
+
this.add(string);
|
|
1561
2927
|
}
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
2928
|
+
/**
|
|
2929
|
+
* Document click event handler
|
|
2930
|
+
*
|
|
2931
|
+
* @param e
|
|
2932
|
+
*/
|
|
2933
|
+
_onDocumentClick(e) {
|
|
2934
|
+
if (this.dropdown) {
|
|
2935
|
+
// If we click on element inside container then do nothing
|
|
2936
|
+
if (this.container.contains(e.target)) {
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2939
|
+
// Tag and delete button already deleted when event triggered
|
|
2940
|
+
// So we check if target is a tag delete button
|
|
2941
|
+
if (e.target.dataset.tag && e.target.dataset.tag === 'delete') {
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
// Click outside dropdown so close it
|
|
2945
|
+
this._closeDropdown();
|
|
2946
|
+
}
|
|
1565
2947
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
2948
|
+
/**
|
|
2949
|
+
* Input focus lost event handler
|
|
2950
|
+
*
|
|
2951
|
+
* @param e
|
|
2952
|
+
*/
|
|
2953
|
+
_onDropdownItemClick(e) {
|
|
2954
|
+
e.preventDefault();
|
|
2955
|
+
if (this.dropdown) {
|
|
2956
|
+
if (this._objectItems) {
|
|
2957
|
+
const item = {};
|
|
2958
|
+
item[this.options.itemText] = e.currentTarget.dataset.text;
|
|
2959
|
+
item[this.options.itemValue] = e.currentTarget.dataset.value;
|
|
2960
|
+
this.add(item);
|
|
2961
|
+
}
|
|
2962
|
+
else {
|
|
2963
|
+
this.add(e.currentTarget.dataset.value);
|
|
2964
|
+
}
|
|
2965
|
+
this._filterDropdownItems();
|
|
2966
|
+
this._input.value = '';
|
|
2967
|
+
this._input.focus();
|
|
2968
|
+
if (this.options.closeDropdownOnItemSelect) {
|
|
2969
|
+
this._closeDropdown();
|
|
2970
|
+
}
|
|
1570
2971
|
}
|
|
1571
|
-
this.requireArgs(requiredKeys);
|
|
1572
|
-
return this.updateValue();
|
|
1573
2972
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
2973
|
+
/**
|
|
2974
|
+
* Input change event handler
|
|
2975
|
+
*
|
|
2976
|
+
* @param e
|
|
2977
|
+
*/
|
|
2978
|
+
_onInputChange(e) {
|
|
2979
|
+
this._filterDropdownItems(this._input.value);
|
|
2980
|
+
}
|
|
2981
|
+
/**
|
|
2982
|
+
* Input click event handler
|
|
2983
|
+
*
|
|
2984
|
+
* @param e
|
|
2985
|
+
*/
|
|
2986
|
+
_onInputClick(e) {
|
|
2987
|
+
e.preventDefault();
|
|
2988
|
+
if (!this.source || this._input.value.length >= this.options.searchMinChars) {
|
|
2989
|
+
this._openDropdown();
|
|
2990
|
+
this._filterDropdownItems();
|
|
1577
2991
|
}
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* Input focus event handler
|
|
2995
|
+
*
|
|
2996
|
+
* @param e
|
|
2997
|
+
*/
|
|
2998
|
+
_onInputFocusIn(e) {
|
|
2999
|
+
e.preventDefault();
|
|
3000
|
+
if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
|
|
3001
|
+
this._input.blur();
|
|
3002
|
+
return false;
|
|
1581
3003
|
}
|
|
1582
|
-
|
|
3004
|
+
this.container.classList.add('is-focused');
|
|
1583
3005
|
}
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
styleUrls: ['./unit-converter.component.scss']
|
|
1593
|
-
}]
|
|
1594
|
-
}], propDecorators: { term: [{
|
|
1595
|
-
type: Input
|
|
1596
|
-
}], value: [{
|
|
1597
|
-
type: Input
|
|
1598
|
-
}], fromUnits: [{
|
|
1599
|
-
type: Input
|
|
1600
|
-
}], toUnits: [{
|
|
1601
|
-
type: Input
|
|
1602
|
-
}] } });
|
|
1603
|
-
|
|
1604
|
-
/* eslint-disable @angular-eslint/directive-selector */
|
|
1605
|
-
class ClickOutsideDirective {
|
|
1606
|
-
constructor(elementRef) {
|
|
1607
|
-
this.elementRef = elementRef;
|
|
1608
|
-
this.clickOutside = new EventEmitter();
|
|
3006
|
+
/**
|
|
3007
|
+
* Input focus lost event handler
|
|
3008
|
+
*
|
|
3009
|
+
* @param e
|
|
3010
|
+
*/
|
|
3011
|
+
_onInputFocusOut(e) {
|
|
3012
|
+
e.preventDefault();
|
|
3013
|
+
this.container.classList.remove('is-focused');
|
|
1609
3014
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
3015
|
+
/**
|
|
3016
|
+
* Input Keydown event handler
|
|
3017
|
+
*
|
|
3018
|
+
* @param e
|
|
3019
|
+
*/
|
|
3020
|
+
_onInputKeyDown(e) {
|
|
3021
|
+
const key = e.charCode || e.keyCode || e.which;
|
|
3022
|
+
switch (key) {
|
|
3023
|
+
// BACKSPACE
|
|
3024
|
+
case 8:
|
|
3025
|
+
if (this.options.removable) {
|
|
3026
|
+
if (this._caretAtStart() && this._selected >= 0) {
|
|
3027
|
+
const currentItemIndex = this._selected;
|
|
3028
|
+
// If tag was selected then select next (or previous if next does not exists)
|
|
3029
|
+
if (currentItemIndex >= 0) {
|
|
3030
|
+
this.selectAtIndex(currentItemIndex + 1 < this._items.length ? currentItemIndex + 1 : currentItemIndex - 1);
|
|
3031
|
+
}
|
|
3032
|
+
this.removeAtIndex(currentItemIndex, false);
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
if (this.source && (this._input.value.length) < this.options.searchMinChars) {
|
|
3036
|
+
this._closeDropdown();
|
|
3037
|
+
}
|
|
3038
|
+
break;
|
|
3039
|
+
// ESCAPE
|
|
3040
|
+
case 27:
|
|
3041
|
+
if (this._selected >= 0) {
|
|
3042
|
+
this.clearSelection();
|
|
3043
|
+
}
|
|
3044
|
+
this._closeDropdown();
|
|
3045
|
+
break;
|
|
3046
|
+
// DELETE
|
|
3047
|
+
case 46:
|
|
3048
|
+
if (this.options.removable) {
|
|
3049
|
+
if (this._caretAtStart() && this._selected >= 0) {
|
|
3050
|
+
const currentItemIndex = this._selected;
|
|
3051
|
+
// If tag was selected then select next (or previous if next does not exists)
|
|
3052
|
+
if (currentItemIndex >= 0) {
|
|
3053
|
+
this.selectAtIndex(currentItemIndex + 1 < this._items.length ? currentItemIndex + 1 : currentItemIndex - 1);
|
|
3054
|
+
}
|
|
3055
|
+
this.removeAtIndex(currentItemIndex, false);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
if (this.source && (this._input.value.length) < this.options.searchMinChars) {
|
|
3059
|
+
this._closeDropdown();
|
|
3060
|
+
}
|
|
3061
|
+
break;
|
|
3062
|
+
// LEFT ARROW
|
|
3063
|
+
case 37:
|
|
3064
|
+
if (!this._input.value.length) {
|
|
3065
|
+
if (this._selected < 0) {
|
|
3066
|
+
this.selectAtIndex(this._items.length - 1);
|
|
3067
|
+
}
|
|
3068
|
+
else {
|
|
3069
|
+
this.selectAtIndex(this._selected - 1 >= 0 ? this._selected - 1 : this._items.length - 1);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
break;
|
|
3073
|
+
// RIGHT ARROW
|
|
3074
|
+
case 39:
|
|
3075
|
+
if (!this._input.value.length) {
|
|
3076
|
+
if (this._selected < 0) {
|
|
3077
|
+
this.selectAtIndex(0);
|
|
3078
|
+
}
|
|
3079
|
+
else {
|
|
3080
|
+
this.selectAtIndex(this._selected + 1 >= this._items.length ? 0 : this._selected + 1);
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
break;
|
|
3084
|
+
default:
|
|
3085
|
+
if (this.options.clearSelectionOnTyping) {
|
|
3086
|
+
this.clearSelection();
|
|
3087
|
+
}
|
|
3088
|
+
// ignore
|
|
1613
3089
|
}
|
|
1614
3090
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
3091
|
+
/**
|
|
3092
|
+
* Input Keypress event handler
|
|
3093
|
+
*
|
|
3094
|
+
* @param e
|
|
3095
|
+
*/
|
|
3096
|
+
_onInputKeyPress(e) {
|
|
3097
|
+
const key = e.charCode || e.keyCode || e.which;
|
|
3098
|
+
let value = this._trim(this._input.value) + String.fromCharCode(key);
|
|
3099
|
+
if (!this._manualInputAllowed && !this._filterInputAllowed) {
|
|
3100
|
+
e.preventDefault();
|
|
3101
|
+
return false;
|
|
3102
|
+
}
|
|
3103
|
+
// ENTER
|
|
3104
|
+
if (!value.length && key !== 13) {
|
|
3105
|
+
return false;
|
|
3106
|
+
}
|
|
3107
|
+
if (this._filterInputAllowed) {
|
|
3108
|
+
this._filterDropdownItems(value);
|
|
3109
|
+
}
|
|
3110
|
+
if (this._filterInputAllowed && this.source && value.length >= this.options.searchMinChars && key !== 13) {
|
|
3111
|
+
this._openDropdown();
|
|
3112
|
+
this.dropdown.classList.add('is-loading');
|
|
3113
|
+
this._emptyDropdown();
|
|
3114
|
+
this.source(value).then(results => {
|
|
3115
|
+
results = this.emit('on.results.received', results);
|
|
3116
|
+
if (results.length) {
|
|
3117
|
+
results.forEach(result => {
|
|
3118
|
+
const item = {
|
|
3119
|
+
value: null,
|
|
3120
|
+
text: null
|
|
3121
|
+
};
|
|
3122
|
+
if (!isObject(result)) {
|
|
3123
|
+
item.value = result;
|
|
3124
|
+
item.text = result;
|
|
3125
|
+
}
|
|
3126
|
+
else {
|
|
3127
|
+
item.value = result[this.options.itemValue];
|
|
3128
|
+
item.text = result[this.options.itemText];
|
|
3129
|
+
}
|
|
3130
|
+
this._createDropdownItem(item);
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
this._filterDropdownItems(value);
|
|
3134
|
+
this.dropdown.classList.remove('is-loading');
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
if (this._manualInputAllowed && (value.includes(this.options.delimiter) || key == 13)) {
|
|
3138
|
+
// Prevent default behavior (ie: add char into input value)
|
|
3139
|
+
e.preventDefault();
|
|
3140
|
+
// Split value by delimiter in case we copy/paste multiple values
|
|
3141
|
+
const values = value.split(this.options.delimiter);
|
|
3142
|
+
values.forEach(value => {
|
|
3143
|
+
// check if empty text when delimiter is removed
|
|
3144
|
+
if ((value = value.replace(this.options.delimiter, '')) != '') {
|
|
3145
|
+
// push to array and remove delimiter
|
|
3146
|
+
this.add(value);
|
|
3147
|
+
}
|
|
3148
|
+
});
|
|
3149
|
+
value = '';
|
|
3150
|
+
// clear input
|
|
3151
|
+
this._input.value = '';
|
|
3152
|
+
this._closeDropdown();
|
|
3153
|
+
return false;
|
|
3154
|
+
}
|
|
1654
3155
|
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
return get$3(value, key, defaultValue);
|
|
3156
|
+
/**
|
|
3157
|
+
* Original input change event handler
|
|
3158
|
+
* CAUTION: because original input is now hidden the change event must be triggered manually on change
|
|
3159
|
+
* Example how to trigger change event manually
|
|
3160
|
+
* var changeEvent = new Event('change');
|
|
3161
|
+
* input.dispatchEvent(changeEvent);
|
|
3162
|
+
*
|
|
3163
|
+
* @param e
|
|
3164
|
+
*/
|
|
3165
|
+
_onOriginalInputChange(e) {
|
|
3166
|
+
if (!e.detail || isString(e.detail) && e.detail !== this.constructor.name) {
|
|
3167
|
+
this.value = e.currentTarget.value;
|
|
3168
|
+
}
|
|
1669
3169
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
3170
|
+
/**
|
|
3171
|
+
* Tag click event handler
|
|
3172
|
+
*
|
|
3173
|
+
* @param e
|
|
3174
|
+
*/
|
|
3175
|
+
_onTagClick(e) {
|
|
3176
|
+
e.preventDefault();
|
|
3177
|
+
if (e.currentTarget.classList.contains('delete')) {
|
|
3178
|
+
return false;
|
|
3179
|
+
}
|
|
3180
|
+
if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
|
|
3181
|
+
return false;
|
|
3182
|
+
}
|
|
3183
|
+
this._input.focus();
|
|
3184
|
+
if (this.options.selectable) {
|
|
3185
|
+
const tag = e.currentTarget.closest('.tag');
|
|
3186
|
+
if (tag) {
|
|
3187
|
+
const tagIndex = Array.from(this.container.children).indexOf(tag);
|
|
3188
|
+
if (tagIndex === this._selected) {
|
|
3189
|
+
this.clearSelection();
|
|
3190
|
+
}
|
|
3191
|
+
else {
|
|
3192
|
+
this.selectAtIndex(tagIndex);
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
1684
3196
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
3197
|
+
/**
|
|
3198
|
+
* Delete tag button click event handler
|
|
3199
|
+
*
|
|
3200
|
+
* @param e
|
|
3201
|
+
*/
|
|
3202
|
+
_onTagDeleteClick(e) {
|
|
3203
|
+
e.preventDefault();
|
|
3204
|
+
if (this.container.getAttribute('disabled') !== null || this.container.classList.contains('is-disabled')) {
|
|
3205
|
+
return false;
|
|
3206
|
+
}
|
|
3207
|
+
const tag = e.currentTarget.closest('.tag');
|
|
3208
|
+
if (tag) {
|
|
3209
|
+
this.removeAtIndex(Array.from(this.container.children).indexOf(tag));
|
|
3210
|
+
}
|
|
1698
3211
|
}
|
|
1699
3212
|
}
|
|
1700
|
-
PluralizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1701
|
-
PluralizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, name: "pluralize" });
|
|
1702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PluralizePipe, decorators: [{
|
|
1703
|
-
type: Pipe,
|
|
1704
|
-
args: [{
|
|
1705
|
-
name: 'pluralize'
|
|
1706
|
-
}]
|
|
1707
|
-
}] });
|
|
1708
3213
|
|
|
1709
3214
|
const restrictToType = {
|
|
1710
3215
|
number: val => parseFloat(val) === +val ? val : false
|
|
@@ -1723,7 +3228,7 @@ class TagsInputDirective {
|
|
|
1723
3228
|
ngOnDestroy() {
|
|
1724
3229
|
this.inputEvents.map(({ event, listener }) => this.tagsInputInput.removeEventListener(event, listener));
|
|
1725
3230
|
this.inputEvents = [];
|
|
1726
|
-
this.tagsInput =
|
|
3231
|
+
this.tagsInput = undefined;
|
|
1727
3232
|
}
|
|
1728
3233
|
get input() {
|
|
1729
3234
|
return this.elementRef.nativeElement;
|
|
@@ -1804,18 +3309,9 @@ const components$6 = [
|
|
|
1804
3309
|
UnitConverterComponent,
|
|
1805
3310
|
BlankNodeDiffsComponent,
|
|
1806
3311
|
TimesPipe,
|
|
1807
|
-
ToastComponent,
|
|
1808
3312
|
ClickOutsideDirective,
|
|
1809
|
-
KeysPipe,
|
|
1810
|
-
PrecisionPipe,
|
|
1811
|
-
SocialTagsComponent,
|
|
1812
|
-
DefaultPipe,
|
|
1813
3313
|
SkeletonTextComponent,
|
|
1814
|
-
|
|
1815
|
-
KeyToLabelPipe,
|
|
1816
|
-
BindOnceDirective,
|
|
1817
|
-
GetPipe,
|
|
1818
|
-
EllipsisPipe
|
|
3314
|
+
GetPipe
|
|
1819
3315
|
];
|
|
1820
3316
|
class HeCommonModule {
|
|
1821
3317
|
}
|
|
@@ -1833,23 +3329,14 @@ HeCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
1833
3329
|
UnitConverterComponent,
|
|
1834
3330
|
BlankNodeDiffsComponent,
|
|
1835
3331
|
TimesPipe,
|
|
1836
|
-
ToastComponent,
|
|
1837
3332
|
ClickOutsideDirective,
|
|
1838
|
-
KeysPipe,
|
|
1839
|
-
PrecisionPipe,
|
|
1840
|
-
SocialTagsComponent,
|
|
1841
|
-
DefaultPipe,
|
|
1842
3333
|
SkeletonTextComponent,
|
|
1843
|
-
|
|
1844
|
-
KeyToLabelPipe,
|
|
1845
|
-
BindOnceDirective,
|
|
1846
|
-
GetPipe,
|
|
1847
|
-
EllipsisPipe], imports: [CommonModule, FormsModule, RouterModule,
|
|
3334
|
+
GetPipe], imports: [CommonModule, FormsModule, RouterModule,
|
|
1848
3335
|
NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1849
3336
|
GoogleMapsModule,
|
|
1850
|
-
|
|
3337
|
+
HeCommonLightModule], exports: [NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1851
3338
|
GoogleMapsModule,
|
|
1852
|
-
|
|
3339
|
+
HeCommonLightModule, ClipboardComponent,
|
|
1853
3340
|
PopoverComponent,
|
|
1854
3341
|
PopoverConfirmComponent,
|
|
1855
3342
|
TagsInputDirective,
|
|
@@ -1862,26 +3349,17 @@ HeCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
1862
3349
|
UnitConverterComponent,
|
|
1863
3350
|
BlankNodeDiffsComponent,
|
|
1864
3351
|
TimesPipe,
|
|
1865
|
-
ToastComponent,
|
|
1866
3352
|
ClickOutsideDirective,
|
|
1867
|
-
KeysPipe,
|
|
1868
|
-
PrecisionPipe,
|
|
1869
|
-
SocialTagsComponent,
|
|
1870
|
-
DefaultPipe,
|
|
1871
3353
|
SkeletonTextComponent,
|
|
1872
|
-
|
|
1873
|
-
KeyToLabelPipe,
|
|
1874
|
-
BindOnceDirective,
|
|
1875
|
-
GetPipe,
|
|
1876
|
-
EllipsisPipe] });
|
|
3354
|
+
GetPipe] });
|
|
1877
3355
|
HeCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonModule, imports: [[
|
|
1878
3356
|
CommonModule, FormsModule, RouterModule,
|
|
1879
3357
|
NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1880
3358
|
GoogleMapsModule,
|
|
1881
|
-
|
|
3359
|
+
HeCommonLightModule
|
|
1882
3360
|
], NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1883
3361
|
GoogleMapsModule,
|
|
1884
|
-
|
|
3362
|
+
HeCommonLightModule] });
|
|
1885
3363
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeCommonModule, decorators: [{
|
|
1886
3364
|
type: NgModule,
|
|
1887
3365
|
args: [{
|
|
@@ -1889,14 +3367,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1889
3367
|
exports: [
|
|
1890
3368
|
NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1891
3369
|
GoogleMapsModule,
|
|
1892
|
-
|
|
3370
|
+
HeCommonLightModule,
|
|
1893
3371
|
...components$6
|
|
1894
3372
|
],
|
|
1895
3373
|
imports: [
|
|
1896
3374
|
CommonModule, FormsModule, RouterModule,
|
|
1897
3375
|
NgbTypeaheadModule, NgbTooltipModule, NgbPopoverModule,
|
|
1898
3376
|
GoogleMapsModule,
|
|
1899
|
-
|
|
3377
|
+
HeCommonLightModule
|
|
1900
3378
|
]
|
|
1901
3379
|
}]
|
|
1902
3380
|
}] });
|
|
@@ -1922,14 +3400,14 @@ class HeMendeleyService {
|
|
|
1922
3400
|
return this.http.get(`${this.path}/${id}`).toPromise().catch(handleAPIError);
|
|
1923
3401
|
}
|
|
1924
3402
|
}
|
|
1925
|
-
HeMendeleyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeMendeleyService, deps: [{ token: i1$
|
|
3403
|
+
HeMendeleyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeMendeleyService, deps: [{ token: i1$2.HttpClient }, { token: HeCommonService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1926
3404
|
HeMendeleyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeMendeleyService, providedIn: 'root' });
|
|
1927
3405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeMendeleyService, decorators: [{
|
|
1928
3406
|
type: Injectable,
|
|
1929
3407
|
args: [{
|
|
1930
3408
|
providedIn: 'root'
|
|
1931
3409
|
}]
|
|
1932
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
3410
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: HeCommonService }]; } });
|
|
1933
3411
|
|
|
1934
3412
|
const searchableTypes = [
|
|
1935
3413
|
NodeType.Cycle,
|
|
@@ -2215,14 +3693,14 @@ class HeSearchService {
|
|
|
2215
3693
|
type: SchemaType.Bibliography }, source.bibliography) })))));
|
|
2216
3694
|
}
|
|
2217
3695
|
}
|
|
2218
|
-
HeSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSearchService, deps: [{ token: i1$
|
|
3696
|
+
HeSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSearchService, deps: [{ token: i1$2.HttpClient }, { token: HeCommonService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2219
3697
|
HeSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSearchService, providedIn: 'root' });
|
|
2220
3698
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSearchService, decorators: [{
|
|
2221
3699
|
type: Injectable,
|
|
2222
3700
|
args: [{
|
|
2223
3701
|
providedIn: 'root'
|
|
2224
3702
|
}]
|
|
2225
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
3703
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: HeCommonService }]; } });
|
|
2226
3704
|
|
|
2227
3705
|
class BibliographiesSearchConfirmComponent {
|
|
2228
3706
|
constructor(formBuilder, mendeleyService, searchService) {
|
|
@@ -2232,7 +3710,7 @@ class BibliographiesSearchConfirmComponent {
|
|
|
2232
3710
|
this.searchSources = true;
|
|
2233
3711
|
this.searchBibliographies = true;
|
|
2234
3712
|
this.searchBy = 'title';
|
|
2235
|
-
this.closed = new EventEmitter();
|
|
3713
|
+
this.closed = new EventEmitter$1();
|
|
2236
3714
|
this.loading = true;
|
|
2237
3715
|
this.hasResults = false;
|
|
2238
3716
|
this.formGroup = formBuilder.group({
|
|
@@ -2295,7 +3773,7 @@ class BibliographiesSearchConfirmComponent {
|
|
|
2295
3773
|
BibliographiesSearchConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BibliographiesSearchConfirmComponent, deps: [{ token: i1$4.FormBuilder }, { token: HeMendeleyService }, { token: HeSearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2296
3774
|
BibliographiesSearchConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: { search: "search", searchSources: "searchSources", searchBibliographies: "searchBibliographies", searchBy: "searchBy" }, outputs: { closed: "closed" }, ngImport: i0, template: "<div class=\"modal is-large is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Search Bibliographies</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"cancel()\"></button>\n </header>\n <section class=\"modal-card-body\">\n <form [formGroup]=\"formGroup\" novalidate>\n <div class=\"field has-addons\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input\"\n [attr.placeholder]=\"'Search bibliography by ' + searchBy\"\n formControlName=\"search\" name=\"randomname\" autocomplete=\"off\"\n (focus)=\"searchFocus($event)\"\n >\n <a class=\"icon is-small is-right\" (click)=\"!loading && resetSearch()\" [ngSwitch]=\"loading\">\n <fa-icon *ngSwitchCase=\"true\" icon=\"spinner\" [pulse]=\"true\"></fa-icon>\n <fa-icon *ngSwitchCase=\"false\" icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </form>\n\n <div class=\"mt-2\">\n <span [class.is-hidden]=\"loading || !searchControl?.value || hasResults\">\n No bibliographies found matching query.\n </span>\n\n <ul>\n <li *ngFor=\"let result of results | async\">\n <a class=\"is-block p-1 search-result\" (click)=\"selectResult(result)\"\n [class.is-active]=\"selectedResult === result\"\n >\n <ngb-highlight\n [result]=\"result.bibliography ? result.bibliography.title : result.title\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span class=\"px-1\">-</span>\n\n <span class=\"px-1\"><i>{{result.name}}</i></span>\n\n <span class=\"px-1\"\n *ngIf=\"result.bibliography?.documentDOI || result.documentDOI\"\n >- <b>documentDOI:</b>\n </span>\n <ngb-highlight\n [result]=\"result.bibliography ? result.bibliography.documentDOI : result.documentDOI\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span class=\"px-1\"\n *ngIf=\"result.bibliography?.scopus || result.scopus\"\n >- <b>scopus:</b>\n </span>\n <ngb-highlight\n [result]=\"result.bibliography?.scopus || result.scopus\"\n [term]=\"searchControl?.value\"\n ></ngb-highlight>\n\n <span>\n <ng-container *ngTemplateOutlet=\"mendeleyLink; context: {$implicit: result.bibliography ? result.bibliography.mendeleyID : result.mendeleyID}\"></ng-container>\n </span>\n </a>\n </li>\n </ul>\n </div>\n </section>\n <footer class=\"modal-card-foot\">\n <button class=\"button is-primary\" (click)=\"confirm()\" [disabled]=\"!selectedResult\">\n <span>Confirm</span>\n </button>\n <button class=\"button\" (click)=\"cancel()\">\n <span>Close</span>\n </button>\n </footer>\n </div>\n</div>\n\n<ng-template #mendeleyLink let-id>\n <a *ngIf=\"id\" [href]=\"'https://www.mendeley.com/catalogue/' + id\" target=\"_blank\"\n (click)=\"$event.stopPropagation()\"\n >\n <fa-icon class=\"ml-2\" icon=\"external-link-alt\" size=\"sm\"></fa-icon>\n </a>\n</ng-template>\n", styles: ["ngb-highlight,span{vertical-align:middle;white-space:normal;width:auto}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i3.AsyncPipe } });
|
|
2297
3775
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BibliographiesSearchConfirmComponent, decorators: [{
|
|
2298
|
-
type: Component,
|
|
3776
|
+
type: Component$1,
|
|
2299
3777
|
args: [{
|
|
2300
3778
|
selector: 'he-bibliographies-search-confirm',
|
|
2301
3779
|
templateUrl: './bibliographies-search-confirm.component.html',
|
|
@@ -2534,14 +4012,14 @@ class HeSchemaService {
|
|
|
2534
4012
|
}
|
|
2535
4013
|
;
|
|
2536
4014
|
}
|
|
2537
|
-
HeSchemaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSchemaService, deps: [{ token: i1$
|
|
4015
|
+
HeSchemaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSchemaService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2538
4016
|
HeSchemaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSchemaService, providedIn: 'root' });
|
|
2539
4017
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeSchemaService, decorators: [{
|
|
2540
4018
|
type: Injectable,
|
|
2541
4019
|
args: [{
|
|
2542
4020
|
providedIn: 'root'
|
|
2543
4021
|
}]
|
|
2544
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
4022
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
|
|
2545
4023
|
|
|
2546
4024
|
const headerGroup = (header) => {
|
|
2547
4025
|
const parts = header.split('.');
|
|
@@ -2558,7 +4036,7 @@ class NodeCsvSelectHeadersComponent {
|
|
|
2558
4036
|
this.schemaService = schemaService;
|
|
2559
4037
|
this.csv = '';
|
|
2560
4038
|
this.includeDefaultCSV = false;
|
|
2561
|
-
this.headersChanged = new EventEmitter();
|
|
4039
|
+
this.headersChanged = new EventEmitter$1();
|
|
2562
4040
|
this.headers = {};
|
|
2563
4041
|
this.allSelected = false;
|
|
2564
4042
|
this.showSelectTermFields = false;
|
|
@@ -2634,7 +4112,7 @@ class NodeCsvSelectHeadersComponent {
|
|
|
2634
4112
|
NodeCsvSelectHeadersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeCsvSelectHeadersComponent, deps: [{ token: HeSchemaService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2635
4113
|
NodeCsvSelectHeadersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeCsvSelectHeadersComponent, selector: "he-node-csv-select-headers", inputs: { csv: "csv", keys: "keys", includeDefaultCSV: "includeDefaultCSV" }, outputs: { headersChanged: "headersChanged" }, ngImport: i0, template: "<p class=\"mb-2\">Please select which columns you would like to include:</p>\n\n<p class=\"my-2 is-size-7\"><i>You can drag and drop the headers to sort them as they would appear in the CSV file.</i></p>\n\n<div class=\"columns toggle-all mx-4 pb-1 mb-0\">\n <div class=\"column\">\n <label class=\"checkbox ml-1\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"allSelected\"\n (change)=\"toggleAll(); reresh()\"\n >\n <span class=\"ml-2\">Toggle All</span>\n </label>\n </div>\n\n <div class=\"column is-narrow has-text-right\">\n <div class=\"dropdown is-right has-text-left\"\n [class.is-active]=\"showSelectTermFields\"\n (clickOutside)=\"showSelectTermFields = false\"\n >\n <div class=\"dropdown-trigger\" (click)=\"showSelectTermFields = !showSelectTermFields\">\n <button class=\"button is-small\"\n aria-haspopup=\"true\" aria-controls=\"select-menu\"\n >\n <span>Toggle Term Fields</span>\n <span class=\"icon is-small\">\n <fa-icon icon=\"filter\" aria-hidden=\"true\"></fa-icon>\n </span>\n </button>\n </div>\n <div class=\"dropdown-menu\" id=\"select-menu\" role=\"menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\"\n *ngFor=\"let field of termFields\"\n >\n <label class=\"checkbox ml-1\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"termFieldSelected[field]\"\n (change)=\"toggleTermField(field)\"\n >\n <span class=\"ml-2\">{{field}}</span>\n </label>\n </a>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"drag-container\">\n <div class=\"card\" *ngFor=\"let group of headers | keys\">\n <header class=\"card-header\" *ngIf=\"group.key\">\n <div class=\"card-header-title\">\n <label class=\"checkbox ml-1\">\n <input type=\"checkbox\" class=\"selector\"\n [indeterminate]=\"group.value.partialSelected\"\n [(ngModel)]=\"group.value.selected\"\n (change)=\"updateGroup(group.key); reresh()\"\n >\n <span class=\"ml-2\">{{group.key}}</span>\n </label>\n </div>\n <span class=\"card-header-icon has-text-link\" aria-label=\"open / close\"\n (click)=\"group.value.open = !group.value.open\" pointer\n >\n <span class=\"icon\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!group.value.open\"></fa-icon>\n <fa-icon icon=\"angle-left\" [class.is-hidden]=\"group.value.open\"></fa-icon>\n </span>\n </span>\n </header>\n\n <div class=\"card-content p-3\" [class.is-hidden]=\"!group.value.open\">\n <ul cdkDropList (cdkDropListDropped)=\"dropHeader($event, group.key)\">\n <li *ngFor=\"let header of group.value.headers\" cdkDrag>\n <label class=\"checkbox ml-2\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"header.selected\"\n (change)=\"updateGroupHeader(group.key); reresh()\"\n >\n <span class=\"ml-2\">{{header.header}}</span>\n </label>\n </li>\n </ul>\n </div>\n </div>\n</div>\n", styles: [".toggle-all{border-bottom:1px solid #7a7a7a}.drag-container,.table-container{max-height:45vh;overflow-y:auto}.cdk-drag-preview{border-radius:2px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;list-style:none}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i6.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], pipes: { "keys": KeysPipe } });
|
|
2636
4114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeCsvSelectHeadersComponent, decorators: [{
|
|
2637
|
-
type: Component,
|
|
4115
|
+
type: Component$1,
|
|
2638
4116
|
args: [{
|
|
2639
4117
|
selector: 'he-node-csv-select-headers',
|
|
2640
4118
|
templateUrl: './node-csv-select-headers.component.html',
|
|
@@ -2658,7 +4136,7 @@ class NodeCsvExportConfirmComponent {
|
|
|
2658
4136
|
this.filename = 'download';
|
|
2659
4137
|
this.extension = SupportedExtensions.csv;
|
|
2660
4138
|
this.isUpload = true;
|
|
2661
|
-
this.closed = new EventEmitter();
|
|
4139
|
+
this.closed = new EventEmitter$1();
|
|
2662
4140
|
this.showIncludeNodes = false;
|
|
2663
4141
|
this.includedNodes = [];
|
|
2664
4142
|
}
|
|
@@ -2682,16 +4160,16 @@ class NodeCsvExportConfirmComponent {
|
|
|
2682
4160
|
return fileToExt(this.filename, this.extension);
|
|
2683
4161
|
}
|
|
2684
4162
|
}
|
|
2685
|
-
NodeCsvExportConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeCsvExportConfirmComponent, deps: [{ token: i1$
|
|
4163
|
+
NodeCsvExportConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeCsvExportConfirmComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
2686
4164
|
NodeCsvExportConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: { nodes: "nodes", filename: "filename", headerKeys: "headerKeys", extension: "extension", isUpload: "isUpload" }, outputs: { closed: "closed" }, ngImport: i0, template: "<div class=\"modal is-active\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">Export as CSV</p>\n <button class=\"delete\" aria-label=\"close\" (click)=\"closed.next(true)\"></button>\n </header>\n <section class=\"modal-card-body\">\n <div class=\"notification is-info\" role=\"alert\" *ngIf=\"isUpload\">\n <span>After Download, you can edit and</span>\n <a class=\"px-1\" routerLink=\"../\">upload the CSV file</a>\n <span>to submit your content on the Hestia platform, and your draft will remain unchanged.</span>\n\n <p>\n <span>Alternatively, you can import the CSV file right back by clicking on the \"Import from CSV\" button and selecting the exported file.</span>\n </p>\n </div>\n\n <ng-container *ngIf=\"!isUpload && includedNodes.length > 1\">\n <p class=\"mb-2\">\n <b>{{includedNodes.length}}</b>\n <span class=\"px-1\">Nodes will be included in your download.</span>\n <a (click)=\"showIncludeNodes = !showIncludeNodes\">\n <ng-container *ngIf=\"!showIncludeNodes\">Show list</ng-container>\n <ng-container *ngIf=\"showIncludeNodes\">Hide list</ng-container>\n </a>\n </p>\n\n <div class=\"table-container\" *ngIf=\"showIncludeNodes\">\n <table class=\"table is-fullwidth is-hoverable mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">@type</span>\n </th>\n <th>\n <span class=\"has-text-white\">@id</span>\n </th>\n <th>\n <span class=\"has-text-white\">Name</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let node of includedNodes\">\n <td>\n <span *bindOnce=\"node\">{{node.node['@type']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node['@id']}}</span>\n </td>\n <td>\n <span *bindOnce=\"node\">{{node.node.name}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n\n <he-node-csv-select-headers [class.is-hidden]=\"isUpload\"\n [csv]=\"csvData\" [keys]=\"headerKeys\" [includeDefaultCSV]=\"isUpload\"\n (headersChanged)=\"headersUpdated($event)\"\n ></he-node-csv-select-headers>\n </section>\n <footer class=\"modal-card-foot\">\n <a class=\"button is-success\" target=\"_blank\"\n [attr.disabled]=\"csvContent ? null : true\"\n [href]=\"csvContent\"\n [attr.download]=\"csvContent ? downloadFilename : null\"\n (click)=\"closed.next(true)\"\n >\n <fa-icon class=\"mr-2\" icon=\"download\"></fa-icon>\n <span>Download CSV</span>\n </a>\n <button class=\"button\" (click)=\"closed.next(true)\">\n <span>Cancel</span>\n </button>\n </footer>\n </div>\n</div>\n", styles: [""], components: [{ type: NodeCsvSelectHeadersComponent, selector: "he-node-csv-select-headers", inputs: ["csv", "keys", "includeDefaultCSV"], outputs: ["headersChanged"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }] });
|
|
2687
4165
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeCsvExportConfirmComponent, decorators: [{
|
|
2688
|
-
type: Component,
|
|
4166
|
+
type: Component$1,
|
|
2689
4167
|
args: [{
|
|
2690
4168
|
selector: 'he-node-csv-export-confirm',
|
|
2691
4169
|
templateUrl: './node-csv-export-confirm.component.html',
|
|
2692
4170
|
styleUrls: ['./node-csv-export-confirm.component.scss']
|
|
2693
4171
|
}]
|
|
2694
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
4172
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { nodes: [{
|
|
2695
4173
|
type: Input
|
|
2696
4174
|
}], filename: [{
|
|
2697
4175
|
type: Input
|
|
@@ -2726,7 +4204,7 @@ class NodeDiffsComponent {
|
|
|
2726
4204
|
constructor(nodeService) {
|
|
2727
4205
|
this.nodeService = nodeService;
|
|
2728
4206
|
this.displayType = DiffsDisplayType.diffs;
|
|
2729
|
-
this.diffsLoaded = new EventEmitter();
|
|
4207
|
+
this.diffsLoaded = new EventEmitter$1();
|
|
2730
4208
|
this.DiffsDisplayType = DiffsDisplayType;
|
|
2731
4209
|
this.loading = true;
|
|
2732
4210
|
}
|
|
@@ -2752,7 +4230,7 @@ class NodeDiffsComponent {
|
|
|
2752
4230
|
NodeDiffsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeDiffsComponent, deps: [{ token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2753
4231
|
NodeDiffsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeDiffsComponent, selector: "he-node-diffs", inputs: { data: "data", id: "id", type: "type", displayType: "displayType" }, outputs: { diffsLoaded: "diffsLoaded" }, ngImport: i0, template: "<div *ngIf=\"loading\" class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n</div>\n\n<ng-container *ngIf=\"left && right\">\n <ng-container [ngSwitch]=\"displayType\">\n <div *ngSwitchCase=\"DiffsDisplayType.diffs\" [innerHTML]=\"diffHtml\"></div>\n\n <div *ngSwitchCase=\"DiffsDisplayType.sideBySide\" class=\"columns\">\n <div class=\"column is-6\">\n <pre class=\"has-background-black has-text-white\"><code>{{left | json}}</code></pre>\n </div>\n <div class=\"column is-6\">\n <pre class=\"has-background-black has-text-white\"><code>{{right | json}}</code></pre>\n </div>\n </div>\n </ng-container>\n</ng-container>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "json": i3.JsonPipe } });
|
|
2754
4232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeDiffsComponent, decorators: [{
|
|
2755
|
-
type: Component,
|
|
4233
|
+
type: Component$1,
|
|
2756
4234
|
args: [{
|
|
2757
4235
|
selector: 'he-node-diffs',
|
|
2758
4236
|
templateUrl: './node-diffs.component.html',
|
|
@@ -2790,7 +4268,7 @@ class NodeIconComponent {
|
|
|
2790
4268
|
NodeIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2791
4269
|
NodeIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeIconComponent, selector: "he-node-icon", inputs: { type: "type", size: "size" }, ngImport: i0, template: "<ng-container *ngIf=\"icon\">\n <fa-icon [icon]=\"icon\" [size]=\"size\"></fa-icon>\n</ng-container>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2792
4270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeIconComponent, decorators: [{
|
|
2793
|
-
type: Component,
|
|
4271
|
+
type: Component$1,
|
|
2794
4272
|
args: [{
|
|
2795
4273
|
selector: 'he-node-icon',
|
|
2796
4274
|
templateUrl: './node-icon.component.html',
|
|
@@ -2817,7 +4295,7 @@ class NodeLinkComponent {
|
|
|
2817
4295
|
NodeLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2818
4296
|
NodeLinkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLinkComponent, selector: "he-node-link", inputs: { node: "node", showExternalLink: "showExternalLink" }, ngImport: i0, template: "<a *ngIf=\"showLink; else content\"\n [href]=\"baseUrl + '/' + node!['@type'].toLowerCase() + '/' + node!['@id']\"\n [target]=\"target\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n <fa-icon class=\"no-print ml-2 is-align-middle\" icon=\"external-link-alt\" size=\"sm\" *ngIf=\"showExternalLink\"></fa-icon>\n</a>\n\n<ng-template #content>\n <span class=\"is-align-middle\" #placeholder><ng-content></ng-content></span>\n <span class=\"is-align-middle\" *ngIf=\"placeholder.children.length === 0\">{{node!['@id']}}</span>\n</ng-template>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2819
4297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLinkComponent, decorators: [{
|
|
2820
|
-
type: Component,
|
|
4298
|
+
type: Component$1,
|
|
2821
4299
|
args: [{
|
|
2822
4300
|
selector: 'he-node-link',
|
|
2823
4301
|
templateUrl: './node-link.component.html',
|
|
@@ -2862,16 +4340,16 @@ class NodeLogsFileComponent {
|
|
|
2862
4340
|
(!this.termFilter || code.toLocaleLowerCase().includes(`term=${this.termFilter.toLowerCase()}`)));
|
|
2863
4341
|
}
|
|
2864
4342
|
}
|
|
2865
|
-
NodeLogsFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsFileComponent, deps: [{ token: i1$
|
|
4343
|
+
NodeLogsFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsFileComponent, deps: [{ token: i1$1.DomSanitizer }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2866
4344
|
NodeLogsFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsFileComponent, selector: "he-node-logs-file", inputs: { node: "node", dataState: "dataState" }, ngImport: i0, template: "<div class=\"is-relative\">\n <div class=\"copy-clipboard\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <he-clipboard clipboardClass=\"button is-link is-small\"\n [value]=\"nodeLog | async\" [hideText]=\"true\" [icon]=\"['far', 'clone']\" size=\"lg\" rotate=\"180\"\n ></he-clipboard>\n </div>\n <ng-container *ngIf=\"showFilters\">\n <div class=\"control\">\n <input class=\"input is-link is-small\"\n [(ngModel)]=\"modelFilter\" id=\"modelFilter\"\n (input)=\"applyFilters()\"\n placeholder=\"Filter by Method / Model\"\n >\n </div>\n <div class=\"control\">\n <input class=\"input is-link is-small\"\n [(ngModel)]=\"termFilter\" id=\"termFilter\"\n (input)=\"applyFilters()\"\n placeholder=\"Filter by Term\"\n >\n </div>\n <div class=\"control\">\n <div class=\"select is-link is-small\">\n <select (change)=\"applyFilters()\"\n [(ngModel)]=\"selectedLevel\" id=\"selectedLevel\"\n >\n <option *ngFor=\"let level of Level | keys\" [value]=\"level.value\">{{level.value}}</option>\n </select>\n </div>\n </div>\n </ng-container>\n <div class=\"control\">\n <button class=\"button is-small\" (click)=\"showFilters = !showFilters\"\n [ngbTooltip]=\"showFilters ? 'Hide filters' : 'Show filters'\" placement=\"bottom\" container=\"body\"\n >\n <fa-icon icon=\"filter\"></fa-icon>\n </button>\n </div>\n <div class=\"control pl-3\">\n <a class=\"button is-dark is-outlined is-small\" target=\"_blank\"\n [href]=\"csvContent\"\n [download]=\"fileToExt(node!['@id'], 'csv')\"\n >\n <fa-icon class=\"mr-2\" icon=\"download\"></fa-icon>\n <span>Download (CSV)</span>\n </a>\n </div>\n </div>\n </div>\n\n <pre class=\"pl-3 pt-3 ml-3\"><code class=\"is-block {{line.class}}\" *ngFor=\"let line of nodeLogLines\">{{line.data.timestamp}} {{('[' + line.data.level + ']:').padEnd(9, ' ')}} {{line.data.message}}</code></pre>\n</div>\n", styles: [":host{display:block}pre{background-color:inherit;color:inherit;min-height:38px;max-height:500px}\n"], components: [{ type: ClipboardComponent, selector: "he-clipboard", inputs: ["value", "disabled", "hideText", "icon", "size", "rotate", "clipboardClass"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }], pipes: { "async": i3.AsyncPipe, "keys": KeysPipe } });
|
|
2867
4345
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsFileComponent, decorators: [{
|
|
2868
|
-
type: Component,
|
|
4346
|
+
type: Component$1,
|
|
2869
4347
|
args: [{
|
|
2870
4348
|
selector: 'he-node-logs-file',
|
|
2871
4349
|
templateUrl: './node-logs-file.component.html',
|
|
2872
4350
|
styleUrls: ['./node-logs-file.component.scss']
|
|
2873
4351
|
}]
|
|
2874
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
4352
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: HeNodeService }]; }, propDecorators: { node: [{
|
|
2875
4353
|
type: Input
|
|
2876
4354
|
}], dataState: [{
|
|
2877
4355
|
type: Input
|
|
@@ -3016,7 +4494,7 @@ class NodeLogsModelsComponent {
|
|
|
3016
4494
|
NodeLogsModelsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, deps: [{ token: HeSearchService }, { token: HeEngineService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3017
4495
|
NodeLogsModelsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: { nodeType: "nodeType", nodeKey: "nodeKey", logsUrl: "logsUrl", originalValues: "originalValues", recalculatedValues: "recalculatedValues", terms: "terms", logs: "logs", filteredType: "filteredType" }, ngImport: i0, template: "<div class=\"px-3 pb-3\">\n <div class=\"has-text-right mb-2\" *ngIf=\"!isExternal\">\n <a class=\"is-size-7\" *ngIf=\"logsUrl\" [href]=\"logsUrl\" target=\"_blank\">\n <fa-icon icon=\"external-link-alt\"></fa-icon>\n <span class=\"pl-2\">Open Full Logs</span>\n </a>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"field\">\n <div class=\"control is-expanded has-icons-right\">\n <input class=\"input search-input is-small\"\n [(ngModel)]=\"term\" name=\"term\"\n placeholder=\"Filter by name\"\n [editable]=\"false\"\n [ngbTypeahead]=\"suggestTerm\"\n (selectItem)=\"filterResults()\"\n >\n <a class=\"icon is-small is-right\"\n [class.is-hidden]=\"!term\"\n (click)=\"term = ''; filterResults();\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n </div>\n </th>\n <th>Original</th>\n <th>Recalculated</th>\n <th *ngIf=\"originalValues?.length\">Difference</th>\n <th *ngFor=\"let c of methodModelsCount | times; let i = index\">({{i + 1}})</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngIf=\"loading\">\n <td colspan=\"5\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n </td>\n </tr>\n <ng-container *ngFor=\"let blankNode of blankNodes; trackBy: trackByBlankNode\">\n <tr [class.has-sub-rows]=\"blankNode.canOpen\">\n <td class=\"width-auto\" [attr.title]=\"blankNode.term.name\">\n <a class=\"is-inline-block is-align-top pr-2 open-node\"\n (click)=\"blankNode.isOpen = !blankNode.isOpen\"\n *ngIf=\"blankNode.canOpen\"\n >\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!blankNode.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"blankNode.isOpen\"></fa-icon>\n </a>\n <he-node-link class=\"is-inline-block\" [node]=\"blankNode.term\">\n <span class=\"is-nowrap has-text-ellipsis\">{{blankNode.term.name}}</span>\n </he-node-link>\n </td>\n <td>\n <span>{{blankNode.original | precision:3 | default:'-'}}</span>\n </td>\n <td>\n <span *ngIf=\"blankNode.isRecalculated; else notUpdated\">\n {{blankNode.recalculated | precision:3 | default:'-'}}\n </span>\n </td>\n <td *ngIf=\"originalValues?.length\" class=\"is-nowrap\">\n <he-blank-node-value-delta *ngIf=\"blankNode.isRecalculated\"\n [value]=\"blankNode.recalculated\"\n [originalValue]=\"blankNode.original\"\n ></he-blank-node-value-delta>\n </td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode}\"></ng-container>\n </tr>\n\n <tr\n *ngIf=\"blankNode.keys?.length\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n [class.has-sub-rows]=\"blankNode.subValues?.length\"\n >\n <td class=\"width-auto\">\n <div class=\"pl-3 has-text-left\">\n <span>Fields</span>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <td *ngFor=\"let key of blankNode.keys\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: key}\"></ng-container>\n </td>\n <td *ngIf=\"methodModelsCount > blankNode.keys.length\" [attr.colspan]=\"methodModelsCount - blankNode.keys.length\"></td>\n </tr>\n\n <tr\n *ngFor=\"let subValue of blankNode.subValues\"\n [class.is-hidden]=\"!blankNode.isOpen\"\n >\n <td>\n <div class=\"pl-3 has-text-left\">\n <span class=\"is-inline-block is-nowrap has-text-ellipsis\">{{subValue.key | keyToLabel}}: {{subValue.value | keyToLabel}}</span>\n </div>\n </td>\n <td [attr.colspan]=\"originalValues?.length ? 3 : 2\"></td>\n <ng-container *ngTemplateOutlet=\"blankNodeModels; context: {blankNode: blankNode, subValue: subValue}\"></ng-container>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <div class=\"is-size-7 is-italic\">\n <div class=\"columns is-variable is-1 my-0\">\n <div class=\"column is-narrow\">\n <span>Models:</span>\n </div>\n <div class=\"column is-narrow has-text-success\">\n <fa-icon icon=\"check\"></fa-icon>\n <span class=\"pl-1\">successful</span>\n </div>\n <div class=\"column is-narrow has-text-danger\">\n <fa-icon icon=\"times\"></fa-icon>\n <span class=\"pl-1\">failed</span>\n </div>\n <div class=\"column is-narrow has-text-dark\">\n <fa-icon [icon]=\"['far', 'circle']\"></fa-icon>\n <span class=\"pl-1\">not run (model higher up hierarchy run instead)</span>\n </div>\n <div class=\"column has-text-right\" *ngIf=\"filteredType\">\n <label class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"onlyWithData\"\n (change)=\"filterResults()\"\n >\n <span class=\"ml-2\">Show only recalculated {{filteredType | pluralize}}</span>\n </label>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #blankNodeModels let-blankNode=\"blankNode\" let-subValue=\"subValue\">\n <td *ngFor=\"let c of methodModelsCount | times; let i = index\">\n <ng-container *ngIf=\"validSubValue(blankNode, i, subValue)\">\n <ng-container *ngIf=\"getMethodIdAt(blankNode, i, subValue); let methodId\">\n <ng-container *ngTemplateOutlet=\"blankNodeModel; context: {blankNode: blankNode, methodId: methodId}\"></ng-container>\n </ng-container>\n </ng-container>\n </td>\n</ng-template>\n\n<ng-template #blankNodeModel let-blankNode=\"blankNode\" let-methodId=\"methodId\">\n <span\n [class.trigger-popover]=\"hasLogDetails(blankNode, methodId)\"\n [ngbPopover]=\"logDetails\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"hasLogDetails(blankNode, methodId) ? togglePopover(p, { log: blankNode.logs[methodId] }) : null\"\n >\n <span class=\"is-capitalized\">{{methodName(blankNode, methodId)}}</span>\n <span class=\"pl-1\" *ngIf=\"hasLog(blankNode, methodId) && blankNode.logs[methodId].methodTier\">[{{blankNode.logs[methodId].methodTier}}]</span>\n <span class=\"pl-1 has-text-{{logColor(blankNode, methodId)}}\">\n <fa-icon *ngIf=\"!hasLog(blankNode, methodId)\" [icon]=\"['far', 'circle']\"></fa-icon>\n <fa-icon *ngIf=\"hasLog(blankNode, methodId)\" [icon]=\"blankNode.logs[methodId].shouldRun ? 'check' : 'times'\"></fa-icon>\n </span>\n </span>\n</ng-template>\n\n<ng-template #notUpdated>\n <span>not updated</span>\n</ng-template>\n\n<ng-template #logDetails let-log=\"log\">\n <ng-container *ngIf=\"log.requirements\">\n <p *ngFor=\"let key of log.requirements | keys\" class=\"has-text-{{requirementColor(key.value)}}\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.logs\">\n <p *ngFor=\"let key of log.logs | keys\">\n {{key.key}}: {{key.value}}\n </p>\n </ng-container>\n <ng-container *ngIf=\"log.missingLookups?.length\">\n <p class=\"mt-2\">Missing lookups:</p>\n\n <div class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"has-background-black has-text-white\">\n <tr *ngFor=\"let data of log.missingLookups\">\n <td>{{data.filename}}</td>\n <td>{{data.column}}</td>\n <td>{{data.termId}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </ng-container>\n</ng-template>\n", styles: [":host{display:block}table.data-table th:nth-child(2),table.data-table td:nth-child(2){min-width:60px}table.data-table th:nth-child(3),table.data-table td:nth-child(3){min-width:100px}table.data-table tr.has-sub-rows td{border-bottom-style:dotted}table.data-table td he-node-link{width:190px}table.data-table td .open-node+he-node-link{width:170px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeValueDeltaComponent, selector: "he-blank-node-value-delta", inputs: ["value", "originalValue", "displayType"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "times": TimesPipe, "default": DefaultPipe, "precision": PrecisionPipe, "keyToLabel": KeyToLabelPipe, "pluralize": PluralizePipe, "keys": KeysPipe } });
|
|
3018
4496
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeLogsModelsComponent, decorators: [{
|
|
3019
|
-
type: Component,
|
|
4497
|
+
type: Component$1,
|
|
3020
4498
|
args: [{
|
|
3021
4499
|
selector: 'he-node-logs-models',
|
|
3022
4500
|
templateUrl: './node-logs-models.component.html',
|
|
@@ -3057,7 +4535,7 @@ class NodeMissingLookupFactorsComponent {
|
|
|
3057
4535
|
NodeMissingLookupFactorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeMissingLookupFactorsComponent, deps: [{ token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3058
4536
|
NodeMissingLookupFactorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeMissingLookupFactorsComponent, selector: "he-node-missing-lookup-factors", inputs: { node: "node" }, ngImport: i0, template: "<div *ngIf=\"!loading; else loader\" class=\"table-container data-table-container\">\n <table class=\"table is-fullwidth is-hoverable mb-0\">\n <thead class=\"has-background-black\">\n <tr>\n <th>\n <span class=\"has-text-white\">Filename</span>\n </th>\n <th>\n <span class=\"has-text-white\">Column Title</span>\n </th>\n <th>\n <span class=\"has-text-white\">Row (term.id)</span>\n </th>\n <th>\n <span class=\"has-text-white\">Model</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngIf=\"!logs.length\">\n <td colspan=\"3\">\n <span>No missing lookup factors.</span>\n </td>\n </tr>\n <tr *ngFor=\"let log of logs\">\n <td>{{log.filename}}</td>\n <td>\n <span *ngIf=\"log.column; else na\">{{log.column}}</span>\n </td>\n <td>\n <span *ngIf=\"log.termId; else na\">{{log.termId}}</span>\n </td>\n <td>\n <ng-container *ngIf=\"log.model; else na\">\n <span>{{log.model}}</span>\n <span class=\"pl-1\" *ngIf=\"log.key\">/ {{log.key}}</span>\n <span class=\"pl-1\" *ngIf=\"log.term && log.term !== log.termId\">/ {{log.term}}</span>\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n\n<ng-template #na>\n <span>-</span>\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3059
4537
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeMissingLookupFactorsComponent, decorators: [{
|
|
3060
|
-
type: Component,
|
|
4538
|
+
type: Component$1,
|
|
3061
4539
|
args: [{
|
|
3062
4540
|
selector: 'he-node-missing-lookup-factors',
|
|
3063
4541
|
templateUrl: './node-missing-lookup-factors.component.html',
|
|
@@ -3092,7 +4570,7 @@ class NodeValueDetailsComponent {
|
|
|
3092
4570
|
NodeValueDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeValueDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3093
4571
|
NodeValueDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: { data: "data", nodeType: "nodeType", dataKey: "dataKey" }, ngImport: i0, template: "<ng-container *bindOnce=\"data\">\n <ng-container *ngIf=\"data?.nodes?.length === 1; else showTable\">\n <ng-container *ngFor=\"let key of keys\">\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </ng-container>\n <ng-container *ngFor=\"let key of additionalKeys\">\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #showTable>\n <he-link-key-value [node]=\"data!.nodes[0]\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" key=\"term\"></he-link-key-value>\n\n <div class=\"table-container mt-2\">\n <table class=\"table is-narrow\">\n <thead>\n <th *ngFor=\"let key of tableKeys\">\n <a [href]=\"baseUrl + '/schema/' + type + '#' + key\" target=\"_blank\"><b>{{key}}</b></a>\n </th>\n </thead>\n <tbody>\n <tr *ngFor=\"let node of data!.nodes\">\n <td *ngFor=\"let key of tableKeys\">\n <he-link-key-value [node]=\"node\" [nodeType]=\"nodeType\" [dataKey]=\"dataKey\" [key]=\"key\"></he-link-key-value>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</ng-template>\n", styles: ["table{background-color:transparent;color:#fff}table::ng-deep he-link-key-value a:first-child,table::ng-deep he-link-key-value a:first-child+span{display:none}\n"], components: [{ type: LinkKeyValueComponent, selector: "he-link-key-value", inputs: ["node", "nodeType", "dataKey", "key"] }], directives: [{ type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3094
4572
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NodeValueDetailsComponent, decorators: [{
|
|
3095
|
-
type: Component,
|
|
4573
|
+
type: Component$1,
|
|
3096
4574
|
args: [{
|
|
3097
4575
|
selector: 'he-node-value-details',
|
|
3098
4576
|
templateUrl: './node-value-details.component.html',
|
|
@@ -3165,7 +4643,7 @@ class CyclesFunctionalUnitMeasureComponent {
|
|
|
3165
4643
|
CyclesFunctionalUnitMeasureComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesFunctionalUnitMeasureComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3166
4644
|
CyclesFunctionalUnitMeasureComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: { cycle: "cycle" }, ngImport: i0, template: "<span class=\"pl-1\" [ngSwitch]=\"cycle?.functionalUnit\">\n <ng-container *ngSwitchCase=\"CycleFunctionalUnit['1 ha']\">1 hectare</ng-container>\n <ng-container *ngSwitchDefault>relative</ng-container>\n</span>\n", styles: [""], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
|
|
3167
4645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesFunctionalUnitMeasureComponent, decorators: [{
|
|
3168
|
-
type: Component,
|
|
4646
|
+
type: Component$1,
|
|
3169
4647
|
args: [{
|
|
3170
4648
|
selector: 'he-cycles-functional-unit-measure',
|
|
3171
4649
|
templateUrl: './cycles-functional-unit-measure.component.html',
|
|
@@ -3182,7 +4660,7 @@ class CyclesSuggestFormComponent {
|
|
|
3182
4660
|
this.nodeService = nodeService;
|
|
3183
4661
|
this.searchService = searchService;
|
|
3184
4662
|
this.cycles = [];
|
|
3185
|
-
this.cycleAdded = new EventEmitter();
|
|
4663
|
+
this.cycleAdded = new EventEmitter$1();
|
|
3186
4664
|
this.form = this.formBuilder.group({
|
|
3187
4665
|
search: ['', Validators.required]
|
|
3188
4666
|
});
|
|
@@ -3232,7 +4710,7 @@ class CyclesSuggestFormComponent {
|
|
|
3232
4710
|
CyclesSuggestFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesSuggestFormComponent, deps: [{ token: i1$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3233
4711
|
CyclesSuggestFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesSuggestFormComponent, selector: "he-cycles-suggest-form", inputs: { cycles: "cycles" }, outputs: { cycleAdded: "cycleAdded" }, ngImport: i0, template: "<form class=\"mt-2\" [formGroup]=\"form\" (submit)=\"form.valid && submit()\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Compare with Aggregated Cycle</span>\n </div>\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggesting || loading\">\n <input class=\"input is-small\"\n placeholder=\"Search by name or id\"\n formControlName=\"search\" name=\"search\"\n\n [ngbTypeahead]=\"suggestCycle\"\n [inputFormatter]=\"formatter\"\n [resultTemplate]=\"suggestion\"\n [focusFirst]=\"true\"\n >\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!(suggesting || loading)\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\" [disabled]=\"suggesting || loading\">\n <fa-icon icon=\"plus\"></fa-icon>\n </button>\n </div>\n </div>\n</form>\n\n<ng-template #suggestion let-cycle=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"cycle.site?.country?.name\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"cycle.site.country.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <!-- <div class=\"column\" *ngIf=\"impact.product\">\n <span class=\"pr-1 has-text-underline\">Product:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.product.name\" [term]=\"t\"></ngb-highlight></span>\n </div> -->\n <div class=\"column\" *ngIf=\"cycle.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"cycle.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3234
4712
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesSuggestFormComponent, decorators: [{
|
|
3235
|
-
type: Component,
|
|
4713
|
+
type: Component$1,
|
|
3236
4714
|
args: [{
|
|
3237
4715
|
selector: 'he-cycles-suggest-form',
|
|
3238
4716
|
templateUrl: './cycles-suggest-form.component.html',
|
|
@@ -3271,7 +4749,7 @@ class CyclesActivityLogsComponent {
|
|
|
3271
4749
|
CyclesActivityLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityLogsComponent, deps: [{ token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3272
4750
|
CyclesActivityLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: { original: "original", recalculated: "recalculated" }, ngImport: i0, template: "<ng-container *ngIf=\"!loading; else loader\">\n <div class=\"tabs mb-1\">\n <ul>\n <li [class.is-active]=\"selectedTab === Tab.inputs\">\n <a (click)=\"selectedTab = Tab.inputs\">Inputs</a>\n </li>\n <li [class.is-active]=\"selectedTab === Tab.products\">\n <a (click)=\"selectedTab = Tab.products\">Products</a>\n </li>\n </ul>\n </div>\n\n <he-node-logs-models [class.is-hidden]=\"selectedTab !== Tab.inputs\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.inputs\"\n [recalculatedValues]=\"recalculated?.inputs\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n\n <he-node-logs-models [class.is-hidden]=\"selectedTab !== Tab.products\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"original?.products\"\n [recalculatedValues]=\"recalculated?.products\"\n [logs]=\"logs\"\n ></he-node-logs-models>\n</ng-container>\n\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["nodeType", "nodeKey", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filteredType"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3273
4751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityLogsComponent, decorators: [{
|
|
3274
|
-
type: Component,
|
|
4752
|
+
type: Component$1,
|
|
3275
4753
|
args: [{
|
|
3276
4754
|
selector: 'he-cycles-activity-logs',
|
|
3277
4755
|
templateUrl: './cycles-activity-logs.component.html',
|
|
@@ -3339,7 +4817,7 @@ class CyclesActivityComponent {
|
|
|
3339
4817
|
CyclesActivityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3340
4818
|
CyclesActivityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"inputs.length || products.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{inputs.length + products.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.name\"\n >\n <he-node-link [node]=\"product.value.term\">\n <span>{{product.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.name\"\n >\n <he-node-link [node]=\"input.value.term\">\n <span>{{input.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let product of products\"\n [attr.title]=\"product.value.term.units\"\n >{{product.value.term.units}}</th>\n <th *ngFor=\"let input of inputs\"\n [attr.title]=\"input.value.term.units\"\n >{{input.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"cycle.name\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{cycle.name || cycle.id}}</span>\n </he-node-link>\n </td>\n <td>\n <he-cycles-functional-unit-measure [cycle]=\"cycle\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let product of products\">\n <span *ngIf=\"product.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: product.value.values[cycle['@id']], cycle: cycle, key: 'products' })\"\n >\n <span pointer>{{propertyValue(product.value.values[cycle['@id']].value) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"product.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let input of inputs\">\n <span *ngIf=\"input.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: input.value.values[cycle['@id']], cycle: cycle, key: 'inputs' })\"\n >\n <span pointer>{{propertyValue(input.value.values[cycle['@id']].value) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"input.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <he-cycles-suggest-form *ngIf=\"enableCompare\" [cycles]=\"cycles\" (cycleAdded)=\"addCycle($event)\"></he-cycles-suggest-form>\n </div>\n\n <he-cycles-activity-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [original]=\"originalValues[0]\"\n [recalculated]=\"cycles[0]\"\n ></he-cycles-activity-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-inputs-products.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.inputs.', 'cycle.products.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No activity data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }, { type: CyclesSuggestFormComponent, selector: "he-cycles-suggest-form", inputs: ["cycles"], outputs: ["cycleAdded"] }, { type: CyclesActivityLogsComponent, selector: "he-cycles-activity-logs", inputs: ["original", "recalculated"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
3341
4819
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesActivityComponent, decorators: [{
|
|
3342
|
-
type: Component,
|
|
4820
|
+
type: Component$1,
|
|
3343
4821
|
args: [{
|
|
3344
4822
|
selector: 'he-cycles-activity',
|
|
3345
4823
|
templateUrl: './cycles-activity.component.html',
|
|
@@ -3376,7 +4854,7 @@ class CyclesCompletenessComponent {
|
|
|
3376
4854
|
CyclesCompletenessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesCompletenessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3377
4855
|
CyclesCompletenessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", dataState: "dataState" }, ngImport: i0, template: "<div class=\"p-3\" *ngIf=\"cycles.length; else emptyTable\">\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{cycles.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let completeness of completenessKeys\"\n [attr.title]=\"completeness\"\n ><a [href]=\"baseUrl + '/schema/Completeness#' + completeness\" target=\"_blank\">{{keyToLabel(completeness)}}</a></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(cycle)\">\n <he-node-link [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(cycle)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let completeness of completenessKeys\">\n <span>{{cycle.dataCompleteness[completeness] ? 'Complete' : 'Incomplete'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"cycle.dataCompleteness\"\n [key]=\"completeness\"\n ></he-blank-node-state>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n</div>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No completeness data</span>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3378
4856
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesCompletenessComponent, decorators: [{
|
|
3379
|
-
type: Component,
|
|
4857
|
+
type: Component$1,
|
|
3380
4858
|
args: [{
|
|
3381
4859
|
selector: 'he-cycles-completeness',
|
|
3382
4860
|
templateUrl: './cycles-completeness.component.html',
|
|
@@ -3462,7 +4940,7 @@ class CyclesEmissionsChartComponent {
|
|
|
3462
4940
|
CyclesEmissionsChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3463
4941
|
CyclesEmissionsChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"chart-container\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
3464
4942
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsChartComponent, decorators: [{
|
|
3465
|
-
type: Component,
|
|
4943
|
+
type: Component$1,
|
|
3466
4944
|
args: [{
|
|
3467
4945
|
selector: 'he-cycles-emissions-chart',
|
|
3468
4946
|
templateUrl: './cycles-emissions-chart.component.html',
|
|
@@ -3513,7 +4991,7 @@ class CyclesEmissionsLogsComponent {
|
|
|
3513
4991
|
CyclesEmissionsLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3514
4992
|
CyclesEmissionsLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: { cycle: "cycle", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Cycle\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"emissions\"\n [logs]=\"logs\"\n filteredType=\"Emission\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [":host{display:block}\n"], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["nodeType", "nodeKey", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filteredType"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3515
4993
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsLogsComponent, decorators: [{
|
|
3516
|
-
type: Component,
|
|
4994
|
+
type: Component$1,
|
|
3517
4995
|
args: [{
|
|
3518
4996
|
selector: 'he-cycles-emissions-logs',
|
|
3519
4997
|
templateUrl: './cycles-emissions-logs.component.html',
|
|
@@ -3611,7 +5089,7 @@ class CyclesEmissionsComponent {
|
|
|
3611
5089
|
CyclesEmissionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3612
5090
|
CyclesEmissionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"emissions.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"cycles.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && cycles.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{emissions.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.name\"\n >\n <he-node-link [node]=\"emission.value.term\">\n <span>{{emission.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th>\n <a [href]=\"baseUrl + '/schema/Cycle#functionalUnit'\" target=\"_blank\">Functional unit</a>\n </th>\n <th *ngFor=\"let emission of emissions\"\n [attr.title]=\"emission.value.term.units\"\n >{{emission.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"cycle.name\" [style.border-left-color]=\"itemColor(i)\">\n <label *ngIf=\"enableCompare\" class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n (change)=\"toggleCycle(cycle)\"\n [checked]=\"isSelected(cycle)\"\n >\n </label>\n <he-node-link class=\"is-inline-block\" [node]=\"cycle\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{cycle.name || cycle.id}}</span>\n </he-node-link>\n </td>\n <td>\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let emission of emissions\">\n <span *ngIf=\"emission.value.values[cycle['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: emission.value.values[cycle['@id']], cycle: cycle, key: 'emissions' })\"\n >\n <span pointer>{{propertyValue(emission.value.values[cycle['@id']].value) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"emission.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n\n <he-cycles-suggest-form *ngIf=\"enableCompare\" [cycles]=\"cycles\" (cycleAdded)=\"addCycle($event)\"></he-cycles-suggest-form>\n </div>\n\n <he-cycles-emissions-chart *ngIf=\"cycles.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [cycles]=\"selectedCycles\"\n ></he-cycles-emissions-chart>\n\n <he-cycles-emissions-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [cycle]=\"cycles[0]\"\n [originalValues]=\"originalValues[0]?.emissions\"\n [recalculatedValues]=\"cycles[0]?.emissions\"\n ></he-cycles-emissions-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-emissions.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.emissions.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"cycle\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["label.checkbox{width:20px}td he-node-link{width:160px}table.data-table td:first-child{border-left-width:8px}fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: CyclesFunctionalUnitMeasureComponent, selector: "he-cycles-functional-unit-measure", inputs: ["cycle"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }, { type: CyclesSuggestFormComponent, selector: "he-cycles-suggest-form", inputs: ["cycles"], outputs: ["cycleAdded"] }, { type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: ["cycles"] }, { type: CyclesEmissionsLogsComponent, selector: "he-cycles-emissions-logs", inputs: ["cycle", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
3613
5091
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesEmissionsComponent, decorators: [{
|
|
3614
|
-
type: Component,
|
|
5092
|
+
type: Component$1,
|
|
3615
5093
|
args: [{
|
|
3616
5094
|
selector: 'he-cycles-emissions',
|
|
3617
5095
|
templateUrl: './cycles-emissions.component.html',
|
|
@@ -3702,7 +5180,7 @@ class CyclesResultComponent {
|
|
|
3702
5180
|
CyclesResultComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesResultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3703
5181
|
CyclesResultComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"chart-container\">\n <canvas #chart>{{chart}}</canvas>\n</div>\n", styles: [":host{display:block}.chart-container{height:100%;min-height:300px;position:relative}\n"] });
|
|
3704
5182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CyclesResultComponent, decorators: [{
|
|
3705
|
-
type: Component,
|
|
5183
|
+
type: Component$1,
|
|
3706
5184
|
args: [{
|
|
3707
5185
|
selector: 'he-cycles-result',
|
|
3708
5186
|
templateUrl: './cycles-result.component.html',
|
|
@@ -4602,9 +6080,9 @@ class SitesMapsComponent {
|
|
|
4602
6080
|
}
|
|
4603
6081
|
}
|
|
4604
6082
|
SitesMapsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMapsComponent, deps: [{ token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4605
|
-
SitesMapsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: GoogleMap, descendants: true }], ngImport: i0, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1$
|
|
6083
|
+
SitesMapsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: GoogleMap, descendants: true }], ngImport: i0, template: "<google-map *ngIf=\"googleLoaded\"\n height=\"100%\"\n width=\"100%\"\n [zoom]=\"zoom\"\n [center]=\"center\"\n></google-map>\n\n<p *ngIf=\"showNotice\" class=\"mt-2 is-italic is-size-7\">The information provided might not be complete</p>\n\n<div class=\"no-location has-text-center has-text-light\" *ngIf=\"showNoLocation\">\n <span>No precise location data</span>\n</div>\n", styles: [":host{display:block;height:100%;position:relative;width:100%}.no-location{background-color:#0000004d;left:0;height:100%;position:absolute;top:0;width:100%;z-index:9}.no-location>span{display:inline-block;margin-top:12%}\n"], components: [{ type: i1$3.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4606
6084
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMapsComponent, decorators: [{
|
|
4607
|
-
type: Component,
|
|
6085
|
+
type: Component$1,
|
|
4608
6086
|
args: [{
|
|
4609
6087
|
selector: 'he-sites-maps',
|
|
4610
6088
|
templateUrl: './sites-maps.component.html',
|
|
@@ -4674,7 +6152,7 @@ class SitesMeasurementsLogsComponent {
|
|
|
4674
6152
|
SitesMeasurementsLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMeasurementsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4675
6153
|
SitesMeasurementsLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: { site: "site", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.Site\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"measurements\"\n [logs]=\"logs\"\n filteredType=\"Measurement\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["nodeType", "nodeKey", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filteredType"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4676
6154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMeasurementsLogsComponent, decorators: [{
|
|
4677
|
-
type: Component,
|
|
6155
|
+
type: Component$1,
|
|
4678
6156
|
args: [{
|
|
4679
6157
|
selector: 'he-sites-measurements-logs',
|
|
4680
6158
|
templateUrl: './sites-measurements-logs.component.html',
|
|
@@ -4735,7 +6213,7 @@ class SitesMeasurementsComponent {
|
|
|
4735
6213
|
SitesMeasurementsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMeasurementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4736
6214
|
SitesMeasurementsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites", dataState: "dataState" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"measurements.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && sites.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"selectedView = View.logs\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n\n <div class=\"table-container data-table-container mb-1\">\n <table class=\"table is-narrow data-table has-children-{{measurements.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.name\"\n >\n <he-node-link [node]=\"measurement.value.term\">\n <span>{{measurement.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\"></th>\n <th *ngFor=\"let measurement of measurements\"\n [attr.title]=\"measurement.value.term.units\"\n >{{measurement.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let site of sites; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"defaultLabel(site)\">\n <he-node-link [node]=\"site\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{defaultLabel(site)}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let measurement of measurements\">\n <span *ngIf=\"measurement.value.values[site['@id']]\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: measurement.value.values[site['@id']], site: site, key: 'measurements' })\"\n >\n <span pointer>{{measurementValue(measurement.value.values[site['@id']]) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"measurement.value.values[site['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n <span *ngIf=\"!measurement.value.values[site['@id']]\">\n <span>-</span>\n <sup class=\"pl-1\" *ngIf=\"siteTooBig(site)\">(1)</sup>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <p class=\"is-size-7 is-italic\" *ngIf=\"showAreaTooBig\">\n (1) This region is >{{maxAreaSize}}km2 and is too large to reliably gap fill Measurements.\n </p>\n </div>\n\n <he-sites-measurements-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [site]=\"sites[0]\"\n [originalValues]=\"originalValues[0].measurements\"\n [recalculatedValues]=\"sites[0].measurements\"\n ></he-sites-measurements-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"sites\" filename=\"site-measurements.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['site.id', 'site.@id', 'site.measurements.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"site\" let-data=\"data\" let-key=\"key\">\n <p><b>{{node.name}}</b></p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n", styles: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }, { type: SitesMeasurementsLogsComponent, selector: "he-sites-measurements-logs", inputs: ["site", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
4737
6215
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SitesMeasurementsComponent, decorators: [{
|
|
4738
|
-
type: Component,
|
|
6216
|
+
type: Component$1,
|
|
4739
6217
|
args: [{
|
|
4740
6218
|
selector: 'he-sites-measurements',
|
|
4741
6219
|
templateUrl: './sites-measurements.component.html',
|
|
@@ -4814,9 +6292,9 @@ class FilesFormComponent {
|
|
|
4814
6292
|
this.errorMode = false;
|
|
4815
6293
|
this.deepEditable = true;
|
|
4816
6294
|
this.errorsEditable = false;
|
|
4817
|
-
this.nodeChange = new EventEmitter();
|
|
4818
|
-
this.nodeErorrResolved = new EventEmitter();
|
|
4819
|
-
this.nodeErrorAdded = new EventEmitter();
|
|
6295
|
+
this.nodeChange = new EventEmitter$1();
|
|
6296
|
+
this.nodeErorrResolved = new EventEmitter$1();
|
|
6297
|
+
this.nodeErrorAdded = new EventEmitter$1();
|
|
4820
6298
|
this.NodeType = NodeType;
|
|
4821
6299
|
this.SchemaType = SchemaType;
|
|
4822
6300
|
this.isOpen = true;
|
|
@@ -5176,7 +6654,7 @@ class FilesFormComponent {
|
|
|
5176
6654
|
FilesFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilesFormComponent, deps: [{ token: i0.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5177
6655
|
FilesFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "nodes", "center", "zoom", "showNotice"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
5178
6656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilesFormComponent, decorators: [{
|
|
5179
|
-
type: Component,
|
|
6657
|
+
type: Component$1,
|
|
5180
6658
|
args: [{
|
|
5181
6659
|
selector: 'he-files-form',
|
|
5182
6660
|
templateUrl: './files-form.component.html',
|
|
@@ -5363,16 +6841,16 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
5363
6841
|
});
|
|
5364
6842
|
}
|
|
5365
6843
|
}
|
|
5366
|
-
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorBreakdownChartComponent, deps: [{ token: i1$
|
|
6844
|
+
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorBreakdownChartComponent, deps: [{ token: i1$1.DomSanitizer }, { token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5367
6845
|
ImpactAssessmentsIndicatorBreakdownChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: { impactAssessment: "impactAssessment", indicators: "indicators" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], ngImport: i0, template: "<div class=\"p-3\" [class.is-hidden]=\"loading || !terms?.length\">\n <div class=\"columns\">\n <div class=\"column\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Select an Indicator</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-fullwidth is-small\">\n <select (change)=\"updateChart()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}} ({{term.units}})</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"button is-dark is-outlined is-small\" [href]=\"csvContent\" [download]=\"id + '-logs.csv'\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download All (CSV)</span>\n </a>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <p *ngIf=\"noData\" class=\"has-text-centered\">No breakdown available for {{selectedTerm?.name}}.</p>\n <div class=\"chart-container h-100\">\n <canvas #chart></canvas>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"loading\">\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-container>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
5368
6846
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorBreakdownChartComponent, decorators: [{
|
|
5369
|
-
type: Component,
|
|
6847
|
+
type: Component$1,
|
|
5370
6848
|
args: [{
|
|
5371
6849
|
selector: 'he-impact-assessments-indicator-breakdown-chart',
|
|
5372
6850
|
templateUrl: './impact-assessments-indicator-breakdown-chart.component.html',
|
|
5373
6851
|
styleUrls: ['./impact-assessments-indicator-breakdown-chart.component.scss']
|
|
5374
6852
|
}]
|
|
5375
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
6853
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: HeSearchService }, { type: HeNodeService }]; }, propDecorators: { chartRef: [{
|
|
5376
6854
|
type: ViewChild,
|
|
5377
6855
|
args: ['chart']
|
|
5378
6856
|
}], impactAssessment: [{
|
|
@@ -5497,7 +6975,7 @@ class ImpactAssessmentsIndicatorsChartComponent {
|
|
|
5497
6975
|
ImpactAssessmentsIndicatorsChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorsChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5498
6976
|
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments", key: "key", filterTermTypes: "filterTermTypes" }, viewQueries: [{ propertyName: "barChartRef", first: true, predicate: ["barChart"], descendants: true }, { propertyName: "pieChartRef", first: true, predicate: ["pieChart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"p-3\" [class.is-hidden]=\"!terms?.length\">\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-normal\">\n <label class=\"label\" for=\"selectedTerm\">\n <span>Select a column</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select (change)=\"updateCharts()\" [(ngModel)]=\"selectedTerm\" id=\"selectedTerm\">\n <option *ngFor=\"let term of terms\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mt-1\">\n <div class=\"columns h-100\">\n <div class=\"column is-12 chart-container\">\n <canvas #barChart></canvas>\n </div>\n <div class=\"column is-4 chart-container is-hidden\">\n <canvas #pieChart></canvas>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}.chart-container{height:400px;position:relative}\n"], directives: [{ type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
5499
6977
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsIndicatorsChartComponent, decorators: [{
|
|
5500
|
-
type: Component,
|
|
6978
|
+
type: Component$1,
|
|
5501
6979
|
args: [{
|
|
5502
6980
|
selector: 'he-impact-assessments-indicators-chart',
|
|
5503
6981
|
templateUrl: './impact-assessments-indicators-chart.component.html',
|
|
@@ -5556,7 +7034,7 @@ class ImpactAssessmentsProductsLogsComponent {
|
|
|
5556
7034
|
ImpactAssessmentsProductsLogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5557
7035
|
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: { impactAssessment: "impactAssessment", key: "key", filterTermTypes: "filterTermTypes", originalValues: "originalValues", recalculatedValues: "recalculatedValues" }, ngImport: i0, template: "<he-node-logs-models *ngIf=\"!loading; else loader\"\n [logsUrl]=\"logsUrl\"\n [nodeType]=\"NodeType.ImpactAssessment\"\n [nodeKey]=\"key\"\n [originalValues]=\"originalValues\"\n [recalculatedValues]=\"recalculatedValues\"\n [terms]=\"emissions\"\n [logs]=\"logs\"\n filteredType=\"Emission\"\n></he-node-logs-models>\n\n<ng-template #loader>\n <div class=\"has-text-center py-3\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"lg\"></fa-icon>\n </div>\n</ng-template>\n", styles: [""], components: [{ type: NodeLogsModelsComponent, selector: "he-node-logs-models", inputs: ["nodeType", "nodeKey", "logsUrl", "originalValues", "recalculatedValues", "terms", "logs", "filteredType"] }, { type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
5558
7036
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
5559
|
-
type: Component,
|
|
7037
|
+
type: Component$1,
|
|
5560
7038
|
args: [{
|
|
5561
7039
|
selector: 'he-impact-assessments-products-logs',
|
|
5562
7040
|
templateUrl: './impact-assessments-products-logs.component.html',
|
|
@@ -5774,7 +7252,7 @@ class ImpactAssessmentsProductsComponent {
|
|
|
5774
7252
|
ImpactAssessmentsProductsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsComponent, deps: [{ token: i1$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }, { token: HeToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5775
7253
|
ImpactAssessmentsProductsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", key: "key", dataState: "dataState", enableCompare: "enableCompare", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"indicators.length; else emptyTable\">\n <div class=\"columns is-variable is-2 m-0\">\n <div class=\"column is-hidden-mobile\"></div>\n <div class=\"column is-narrow\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.table\" (click)=\"selectedView = View.table\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"list\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Table view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"impactAssessments.length > 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.chart\" (click)=\"selectedView = View.chart\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Chart view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"enableBreakdown\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.breakdown\" (click)=\"selectedView = View.breakdown\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"chart-bar\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Breakdown view</span>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"!isOriginal && impactAssessments.length === 1\">\n <button class=\"button is-small\" [class.is-active]=\"selectedView === View.logs\" (click)=\"showRecalculationLogs()\">\n <span class=\"icon is-small\">\n <fa-icon icon=\"calculator\" aria-hidden=\"true\"></fa-icon>\n </span>\n <span>Recalculations logs</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"px-3 pb-3\" [class.is-hidden]=\"selectedView !== View.table\">\n <div class=\"has-text-right mb-2\">\n <button class=\"button is-dark is-outlined is-small\" (click)=\"showDownload = true\">\n <fa-icon icon=\"download\"></fa-icon>\n <span class=\"pl-2\">Download (CSV)</span>\n </button>\n </div>\n\n <div class=\"table-container data-table-container mb-1\" *bindOnce=\"indicators\">\n <table class=\"table is-narrow data-table has-children-{{indicators.length + 1}}\">\n <thead>\n <tr>\n <th class=\"width-auto\">\n <div class=\"select is-small\" *ngIf=\"enableFilterMethodModel\">\n <select name=\"selectedMethodModel\"\n (change)=\"updateImpacts()\" [(ngModel)]=\"selectedMethodModel\"\n >\n <option [ngValue]=\"undefined\">Filter Model</option>\n <option *ngFor=\"let term of methodModels\" [ngValue]=\"term\">{{term.name}}</option>\n </select>\n </div>\n </th>\n <th></th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.name\"\n >\n <he-node-link [node]=\"indicator.value.term\">\n <span>{{indicator.value.term.name | ellipsis:30}}</span>\n </he-node-link>\n </th>\n </tr>\n <tr>\n <th class=\"width-auto\">\n <a [href]=\"baseUrl + '/schema/ImpactAssessment#functionalUnit'\" target=\"_blank\">Functional unit:</a>\n <span class=\"pl-1\">1 kg</span>\n </th>\n <th>Product</th>\n <th *ngFor=\"let indicator of indicators\"\n [attr.title]=\"indicator.value.term.units\"\n >{{indicator.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\" [style.border-left-color]=\"itemColor(i)\">\n <label *ngIf=\"enableCompare\" class=\"is-inline-block checkbox\">\n <input type=\"checkbox\" class=\"selector\"\n (change)=\"toggleImpact(impactAssessment)\"\n [checked]=\"isSelected(impactAssessment)\"\n >\n </label>\n <he-node-link class=\"is-inline-block\" [node]=\"impactAssessment\">\n <span class=\"is-nowrap has-text-ellipsis\">{{i + 1}}. {{impactName(impactAssessment)}}</span>\n </he-node-link>\n </td>\n <td [attr.title]=\"impactAssessment.product?.name\">\n <he-node-link *ngIf=\"impactAssessment.product\" [node]=\"impactAssessment.product\">\n <span>{{impactAssessment.product.name | ellipsis:30}}</span>\n </he-node-link>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let indicator of indicators\">\n <span *ngIf=\"indicator.value.values[impactAssessment['@id']]; else emptyValue\"\n class=\"trigger-popover\"\n [ngbPopover]=\"details\" [autoClose]=\"'outside'\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"left\" container=\"body\"\n (click)=\"togglePopover(p, { data: indicator.value.values[impactAssessment['@id']], impactAssessment: impactAssessment, key: key })\"\n >\n <span pointer>{{propertyValue(indicator.value.values[impactAssessment['@id']].value, key === 'impacts') | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"indicator.value.values[impactAssessment['@id']].nodes[0]\"\n key=\"value\"\n [state]=\"impactAssessment.aggregated ? 'aggregated' : null\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\n\n <form *ngIf=\"enableCompare\" class=\"mt-2\" [formGroup]=\"form\" (submit)=\"form.valid && addImpact()\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <span class=\"button is-small is-static\">Compare with Aggregated Impact Assessment</span>\n </div>\n <div class=\"control is-expanded\" [class.has-icons-right]=\"suggesting || loading\">\n <input class=\"input is-small\"\n placeholder=\"Search by name or id\"\n formControlName=\"search\" name=\"search\"\n\n [ngbTypeahead]=\"suggestImpactAssessment\"\n [inputFormatter]=\"formatter\"\n [resultTemplate]=\"suggestion\"\n [focusFirst]=\"true\"\n >\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!(suggesting || loading)\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\" [disabled]=\"suggesting || loading\">\n <fa-icon icon=\"plus\"></fa-icon>\n </button>\n </div>\n </div>\n </form>\n </div>\n\n <he-impact-assessments-indicator-breakdown-chart *ngIf=\"selectedView === View.breakdown\"\n [impactAssessment]=\"impactAssessments[0]\"\n [indicators]=\"impactAssessments[0][key]\"\n ></he-impact-assessments-indicator-breakdown-chart>\n\n <he-impact-assessments-indicators-chart *ngIf=\"impactAssessments.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [key]=\"key\"\n [impactAssessments]=\"selectedImpactAssessments\"\n [filterTermTypes]=\"filterTermTypes\"\n ></he-impact-assessments-indicators-chart>\n\n <he-impact-assessments-products-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [key]=\"key\"\n [impactAssessment]=\"impactAssessments[0]\"\n [filterTermTypes]=\"filterTermTypes\"\n [originalValues]=\"originalValues[0][key]\"\n [recalculatedValues]=\"impactAssessments[0][key]\"\n ></he-impact-assessments-products-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"impactAssessments\" [filename]=\"'impact-' + key + '.csv'\" [isUpload]=\"false\"\n [headerKeys]=\"['impactAssessment.id', 'impactAssessment.@id', 'impactAssessment.' + key + '.']\"\n (closed)=\"showDownload = false\"\n></he-node-csv-export-confirm>\n\n<ng-template #emptyTable>\n <div class=\"panel-block\">\n <span>No data</span>\n </div>\n</ng-template>\n\n<ng-template #emptyValue>\n <span>-</span>\n</ng-template>\n\n<ng-template #details let-node=\"impactAssessment\" let-data=\"data\" let-key=\"key\">\n <p *bindOnce=\"node\">\n <b>\n <span *ngIf=\"data.cycle\">{{cycleLabel(node.cycle)}}</span>\n <span *ngIf=\"!data.cycle\">{{data.name}}</span>\n </b>\n </p>\n <he-node-value-details\n [data]=\"data\" [nodeType]=\"node['@type']\" [dataKey]=\"key\"\n ></he-node-value-details>\n</ng-template>\n\n<ng-template #suggestion let-impact=\"result\" let-t=\"term\">\n <div class=\"is-block\">\n <ngb-highlight [result]=\"impact.name || impact.cycle.name\" [term]=\"t\"></ngb-highlight>\n </div>\n <div class=\"columns is-flex\">\n <div class=\"column\" *ngIf=\"impact.country\">\n <span class=\"pr-1 has-text-underline\">Country:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.country.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.product\">\n <span class=\"pr-1 has-text-underline\">Product:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.product.name\" [term]=\"t\"></ngb-highlight></span>\n </div>\n <div class=\"column\" *ngIf=\"impact.endDate\">\n <span class=\"pr-1 has-text-underline\">Date:</span>\n <span class=\"is-inline-flex\"><ngb-highlight [result]=\"impact.endDate\" [term]=\"t\"></ngb-highlight></span>\n </div>\n </div>\n</ng-template>\n", styles: ["label.checkbox{width:20px}td he-node-link{width:160px}table.data-table td:first-child{border-left-width:8px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeLinkComponent, selector: "he-node-link", inputs: ["node", "showExternalLink"] }, { type: BlankNodeStateComponent, selector: "he-blank-node-state", inputs: ["nodeType", "dataKey", "key", "node", "state"] }, { type: BlankNodeStateNoticeComponent, selector: "he-blank-node-state-notice", inputs: ["dataState", "showDeleted"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "key", "filterTermTypes"] }, { type: ImpactAssessmentsProductsLogsComponent, selector: "he-impact-assessments-products-logs", inputs: ["impactAssessment", "key", "filterTermTypes", "originalValues", "recalculatedValues"] }, { type: NodeCsvExportConfirmComponent, selector: "he-node-csv-export-confirm", inputs: ["nodes", "filename", "headerKeys", "extension", "isUpload"], outputs: ["closed"] }, { type: NodeValueDetailsComponent, selector: "he-node-value-details", inputs: ["data", "nodeType", "dataKey"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
5776
7254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
5777
|
-
type: Component,
|
|
7255
|
+
type: Component$1,
|
|
5778
7256
|
args: [{
|
|
5779
7257
|
selector: 'he-impact-assessments-products',
|
|
5780
7258
|
templateUrl: './impact-assessments-products.component.html',
|
|
@@ -5865,5 +7343,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
5865
7343
|
* Generated bundle index. Do not edit.
|
|
5866
7344
|
*/
|
|
5867
7345
|
|
|
5868
|
-
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeDiffsComponent, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesResultComponent, CyclesSuggestFormComponent, DefaultPipe, DeltaColour, DeltaDisplayType, DiffsDisplayType, EllipsisPipe, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, calculatePercentDelta, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, customDeltaFuncs, dataPathToKey, dataValue, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, delta, deserializeSearchFilters, ellipsis, emptyValue, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatDiffValues, formatError, formatLinkNodesSuggestions, formatPropertyError, formatSuggestion, gitBranch, gitHome, gitRawBaseUrl, groupChanged, groupNodesByTerm, grouppedKeys, grouppedValueKeys, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, keyToLabel, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, propertyValue$1 as propertyValue, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, roundValue, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, toDashCase, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
7346
|
+
export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeDiffsComponent, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesResultComponent, CyclesSuggestFormComponent, DefaultPipe, DeltaColour, DeltaDisplayType, DiffsDisplayType, EllipsisPipe, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, calculatePercentDelta, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, customDeltaFuncs, dataPathToKey, dataValue, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, delta, deserializeSearchFilters, ellipsis, emptyValue, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatDiffValues, formatError, formatLinkNodesSuggestions, formatPropertyError, formatSuggestion, gitBranch, gitHome, gitRawBaseUrl, groupChanged, groupNodesByTerm, grouppedKeys, grouppedValueKeys, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, keyToLabel, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, propertyValue$1 as propertyValue, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, roundValue, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, toDashCase, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
|
|
5869
7347
|
//# sourceMappingURL=hestia-earth-ui-components.js.map
|