@hestia-earth/ui-components 0.0.20 → 0.0.23
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/bundles/hestia-earth-ui-components.umd.js +232 -463
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/cycles/cycles-activity/cycles-activity.component.d.ts +4 -2
- package/cycles/cycles-completeness/cycles-completeness.component.d.ts +3 -1
- package/cycles/cycles-emissions/cycles-emissions.component.d.ts +3 -11
- package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +2 -1
- package/cycles/cycles-practices/cycles-practices.component.d.ts +3 -11
- package/cycles/cycles-result/cycles-result.component.d.ts +3 -1
- package/cycles/cycles.module.d.ts +5 -6
- package/cycles/index.d.ts +0 -1
- package/engine/engine.service.d.ts +10 -1
- package/esm2015/cycles/cycles-activity/cycles-activity.component.js +17 -23
- package/esm2015/cycles/cycles-completeness/cycles-completeness.component.js +9 -3
- package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +17 -56
- package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +18 -8
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +16 -55
- package/esm2015/cycles/cycles-result/cycles-result.component.js +19 -6
- package/esm2015/cycles/cycles.module.js +4 -8
- package/esm2015/cycles/index.js +1 -2
- package/esm2015/engine/engine.service.js +16 -2
- package/esm2015/files/files-error.model.js +8 -5
- package/esm2015/files/files-form/files-form.component.js +1 -1
- package/esm2015/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.js +24 -54
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +30 -131
- package/esm2015/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.js +6 -2
- package/esm2015/node/node-csv-select-headers/node-csv-select-headers.component.js +11 -7
- package/esm2015/node/node-logs-models/node-logs-models.component.js +11 -3
- package/esm2015/sites/sites-maps/sites-maps.component.js +10 -3
- package/esm2015/sites/sites-measurements/sites-measurements.component.js +8 -2
- package/fesm2015/hestia-earth-ui-components.js +160 -357
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +5 -8
- package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +5 -30
- package/impact-assessments/impact-assessments-products-logs/impact-assessments-products-logs.component.d.ts +3 -2
- package/node/node-csv-select-headers/node-csv-select-headers.component.d.ts +9 -3
- package/package.json +4 -4
- package/sites/sites-maps/sites-maps.component.d.ts +3 -1
- package/sites/sites-measurements/sites-measurements.component.d.ts +3 -1
- package/cycles/cycles-suggest-form/cycles-suggest-form.component.d.ts +0 -23
- package/esm2015/cycles/cycles-suggest-form/cycles-suggest-form.component.js +0 -83
|
@@ -1371,12 +1371,27 @@
|
|
|
1371
1371
|
var HE_ORCHESTRATOR_BASE_URL = new i0.InjectionToken('HE_ORCHESTRATOR_BASE_URL');
|
|
1372
1372
|
var gitUrl = function () { return gitHome + "/hestia-engine-models/-/blob/" + gitBranch(); };
|
|
1373
1373
|
var rawUrl = function () { return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + gitBranch(); };
|
|
1374
|
-
var
|
|
1375
|
-
var
|
|
1376
|
-
return
|
|
1374
|
+
var findModels = function (models, termId) { return models.filter(function (_b) {
|
|
1375
|
+
var term = _b.term;
|
|
1376
|
+
return term === termId;
|
|
1377
|
+
}); };
|
|
1378
|
+
/**
|
|
1379
|
+
* Find models from the orchestrator configuration.
|
|
1380
|
+
*
|
|
1381
|
+
* @param config The orchestrator configuration content.
|
|
1382
|
+
* @param termId The `@id` of the Term.
|
|
1383
|
+
* @param model The `@id` of the model.
|
|
1384
|
+
* @param models Optional - list of models from `model-links.json` to default when orchestrator does not contain config.
|
|
1385
|
+
* @returns List of models from orchestrator or models if set.
|
|
1386
|
+
*/
|
|
1387
|
+
var findConfigModels = function (config, termId, model, models) {
|
|
1388
|
+
if (models === void 0) { models = []; }
|
|
1389
|
+
var configModels = config.models.flat()
|
|
1390
|
+
.filter(function (_b) {
|
|
1377
1391
|
var value = _b.value, key = _b.key;
|
|
1378
|
-
return
|
|
1392
|
+
return termId === value && (!model || key === model);
|
|
1379
1393
|
});
|
|
1394
|
+
return configModels.length ? configModels : findModels(models, termId);
|
|
1380
1395
|
};
|
|
1381
1396
|
var pathToApiDocsPath = function (model, term) { return [
|
|
1382
1397
|
baseUrl(),
|
|
@@ -4825,15 +4840,17 @@
|
|
|
4825
4840
|
this.csv = '';
|
|
4826
4841
|
this.includeDefaultCSV = false;
|
|
4827
4842
|
this.headersChanged = new i0.EventEmitter();
|
|
4843
|
+
this.loading = true;
|
|
4828
4844
|
this.headers = {};
|
|
4829
4845
|
this.allSelected = false;
|
|
4830
4846
|
this.showSelectTermFields = false;
|
|
4831
4847
|
this.termFields = termFields;
|
|
4832
4848
|
this.termFieldSelected = {};
|
|
4849
|
+
this.showNonIncluded = false;
|
|
4833
4850
|
}
|
|
4834
4851
|
NodeCsvSelectHeadersComponent.prototype.ngOnInit = function () {
|
|
4835
4852
|
return __awaiter(this, void 0, void 0, function () {
|
|
4836
|
-
var schemas, isSelected, headers;
|
|
4853
|
+
var schemas, isSelected, isIncluded, headers;
|
|
4837
4854
|
var _this = this;
|
|
4838
4855
|
return __generator(this, function (_b) {
|
|
4839
4856
|
switch (_b.label) {
|
|
@@ -4843,13 +4860,14 @@
|
|
|
4843
4860
|
return [4 /*yield*/, this.isSelected(schemas)];
|
|
4844
4861
|
case 2:
|
|
4845
4862
|
isSelected = _b.sent();
|
|
4863
|
+
isIncluded = schemaUtils.isCSVIncluded(schemas);
|
|
4846
4864
|
return [4 /*yield*/, this.schemaService.parseHeaders(this.csv)];
|
|
4847
4865
|
case 3:
|
|
4848
4866
|
headers = _b.sent();
|
|
4849
|
-
this.headers = headers.
|
|
4867
|
+
this.headers = headers.reduce(function (prev, header) {
|
|
4850
4868
|
var group = headerGroup(header);
|
|
4851
4869
|
prev[group] = prev[group] || { headers: [], selected: false, partialSelected: false, open: true };
|
|
4852
|
-
prev[group].headers.push({ header: header, selected: isSelected(header) });
|
|
4870
|
+
prev[group].headers.push({ header: header, selected: isSelected(header), included: isIncluded(header) });
|
|
4853
4871
|
return prev;
|
|
4854
4872
|
}, {});
|
|
4855
4873
|
Object.keys(this.headers).map(function (groupKey) { return _this.updateGroupHeader(groupKey); });
|
|
@@ -4857,7 +4875,8 @@
|
|
|
4857
4875
|
var _b;
|
|
4858
4876
|
return (Object.assign(Object.assign({}, prev), (_b = {}, _b[curr] = curr === '@id', _b)));
|
|
4859
4877
|
}, {});
|
|
4860
|
-
this.
|
|
4878
|
+
this.refresh();
|
|
4879
|
+
this.loading = false;
|
|
4861
4880
|
return [2 /*return*/];
|
|
4862
4881
|
}
|
|
4863
4882
|
});
|
|
@@ -4910,14 +4929,15 @@
|
|
|
4910
4929
|
};
|
|
4911
4930
|
Object.defineProperty(NodeCsvSelectHeadersComponent.prototype, "selectedHeaders", {
|
|
4912
4931
|
get: function () {
|
|
4932
|
+
var _this = this;
|
|
4913
4933
|
return Object.values(this.headers)
|
|
4914
4934
|
.flatMap(function (_b) {
|
|
4915
4935
|
var headers = _b.headers;
|
|
4916
4936
|
return headers;
|
|
4917
4937
|
})
|
|
4918
4938
|
.filter(function (_b) {
|
|
4919
|
-
var selected = _b.selected;
|
|
4920
|
-
return selected;
|
|
4939
|
+
var selected = _b.selected, included = _b.included;
|
|
4940
|
+
return selected && (included || _this.showNonIncluded);
|
|
4921
4941
|
})
|
|
4922
4942
|
.map(function (_b) {
|
|
4923
4943
|
var header = _b.header;
|
|
@@ -4927,7 +4947,7 @@
|
|
|
4927
4947
|
enumerable: false,
|
|
4928
4948
|
configurable: true
|
|
4929
4949
|
});
|
|
4930
|
-
NodeCsvSelectHeadersComponent.prototype.
|
|
4950
|
+
NodeCsvSelectHeadersComponent.prototype.refresh = function () {
|
|
4931
4951
|
this.updateAllSelected();
|
|
4932
4952
|
this.headersChanged.emit(this.selectedHeaders);
|
|
4933
4953
|
};
|
|
@@ -4944,7 +4964,7 @@
|
|
|
4944
4964
|
return NodeCsvSelectHeadersComponent;
|
|
4945
4965
|
}());
|
|
4946
4966
|
NodeCsvSelectHeadersComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvSelectHeadersComponent, deps: [{ token: HeSchemaService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4947
|
-
NodeCsvSelectHeadersComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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();
|
|
4967
|
+
NodeCsvSelectHeadersComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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(); refresh()\"\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>Advanced Filters</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 <label class=\"checkbox ml-1\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"showNonIncluded\"\n (change)=\"refresh()\"\n >\n <span class=\"ml-2\">Include <code>internal</code> fields</span>\n </label>\n </a>\n <div class=\"dropdown-item\">\n <p>Toggle Term Fields</p>\n </div>\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\" *ngIf=\"!loading; else loader\">\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); refresh()\"\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 <ng-container *ngFor=\"let header of group.value.headers\">\n <ng-container *ngIf=\"header.included || showNonIncluded\">\n <li cdkDrag>\n <label class=\"checkbox ml-2\">\n <input type=\"checkbox\" class=\"selector\"\n [(ngModel)]=\"header.selected\"\n (change)=\"updateGroupHeader(group.key); refresh()\"\n >\n <span class=\"ml-2\">{{header.header}}</span>\n </label>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\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", 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__namespace.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__namespace$4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace$1.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__namespace$1.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 } });
|
|
4948
4968
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvSelectHeadersComponent, decorators: [{
|
|
4949
4969
|
type: i0.Component,
|
|
4950
4970
|
args: [{
|
|
@@ -5258,7 +5278,16 @@
|
|
|
5258
5278
|
var _d$1, _e;
|
|
5259
5279
|
var get$3 = require('lodash.get');
|
|
5260
5280
|
var orderBy$5 = require('lodash.orderby');
|
|
5261
|
-
var reduceValues = function (values, termId) {
|
|
5281
|
+
var reduceValues = function (values, termId) {
|
|
5282
|
+
var propertyValues = values
|
|
5283
|
+
.map(function (_d) {
|
|
5284
|
+
var value = _d.value;
|
|
5285
|
+
return propertyValue$1(value, termId);
|
|
5286
|
+
})
|
|
5287
|
+
// propertyValue may return null if the value is null or undefined, therefore remove them from total
|
|
5288
|
+
.filter(function (v) { return v !== null; });
|
|
5289
|
+
return propertyValues.length ? propertyValues.reduce(function (p, v) { return p + v; }, 0) : undefined;
|
|
5290
|
+
};
|
|
5262
5291
|
var logSubValue = function (logs, key, prop) { return logs[key][prop] ? (Array.isArray(logs[key][prop]) ?
|
|
5263
5292
|
logs[key][prop].map(function (value) { return ({ key: prop, value: value }); }) :
|
|
5264
5293
|
{ key: prop, value: logs[key][prop] }) : undefined; };
|
|
@@ -5320,7 +5349,7 @@
|
|
|
5320
5349
|
}
|
|
5321
5350
|
NodeLogsModelsComponent.prototype.ngOnInit = function () {
|
|
5322
5351
|
return __awaiter(this, void 0, void 0, function () {
|
|
5323
|
-
var _d, models, _e, originalValues, recalculatedValues, type, _f;
|
|
5352
|
+
var _d, models, _e, allModels, originalValues, recalculatedValues, type, _f;
|
|
5324
5353
|
var _this = this;
|
|
5325
5354
|
return __generator(this, function (_g) {
|
|
5326
5355
|
switch (_g.label) {
|
|
@@ -5351,6 +5380,9 @@
|
|
|
5351
5380
|
}, {})).toPromise()];
|
|
5352
5381
|
case 3:
|
|
5353
5382
|
_e.methodsById = _g.sent();
|
|
5383
|
+
return [4 /*yield*/, this.hestiaEngineService.models()];
|
|
5384
|
+
case 4:
|
|
5385
|
+
allModels = _g.sent();
|
|
5354
5386
|
originalValues = (this.originalValues || []).filter(function (value) { return !value.deleted; });
|
|
5355
5387
|
recalculatedValues = (this.recalculatedValues || []).filter(function (value) { return !value.deleted; });
|
|
5356
5388
|
type = originalValues.length ?
|
|
@@ -5360,14 +5392,14 @@
|
|
|
5360
5392
|
undefined;
|
|
5361
5393
|
_f = this;
|
|
5362
5394
|
return [4 /*yield*/, this.fetchAllTerms()];
|
|
5363
|
-
case
|
|
5395
|
+
case 5:
|
|
5364
5396
|
_f.allTerms = _g.sent();
|
|
5365
5397
|
this.allBlankNodes = this.allTerms.flatMap(function (term) {
|
|
5366
5398
|
var termLogs = get$3(_this.logs, term['@id'], {});
|
|
5367
5399
|
var original = originalValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5368
5400
|
var recalculated = recalculatedValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5369
5401
|
var hasData = !!original.length || !!recalculated.length || Object.keys(termLogs).length > 0;
|
|
5370
|
-
var configModels = utils.unique(__spreadArray(__spreadArray([], __read(findConfigModels(_this.config, term['@id'], _this.nodeKey).map(function (_d) {
|
|
5402
|
+
var configModels = utils.unique(__spreadArray(__spreadArray([], __read(findConfigModels(_this.config, term['@id'], _this.nodeKey, allModels).map(function (_d) {
|
|
5371
5403
|
var model = _d.model;
|
|
5372
5404
|
return model;
|
|
5373
5405
|
}))), __read(Object.keys(termLogs).filter(function (key) { return !isBackgroundNoInput(termLogs, key); })))).filter(function (key) { return !(key in termLogs) || (!termLogs[key].isKey && !termLogs[key].input && !termLogs[key].property); });
|
|
@@ -5693,92 +5725,6 @@
|
|
|
5693
5725
|
type: i0.Input
|
|
5694
5726
|
}] } });
|
|
5695
5727
|
|
|
5696
|
-
var MIN_TYPEAHEAD_LENGTH$2 = 1;
|
|
5697
|
-
var CyclesSuggestFormComponent = /** @class */ (function () {
|
|
5698
|
-
function CyclesSuggestFormComponent(formBuilder, nodeService, searchService) {
|
|
5699
|
-
var _this = this;
|
|
5700
|
-
this.formBuilder = formBuilder;
|
|
5701
|
-
this.nodeService = nodeService;
|
|
5702
|
-
this.searchService = searchService;
|
|
5703
|
-
this.cycles = [];
|
|
5704
|
-
this.cycleAdded = new i0.EventEmitter();
|
|
5705
|
-
this.form = this.formBuilder.group({
|
|
5706
|
-
search: ['', i1$2.Validators.required]
|
|
5707
|
-
});
|
|
5708
|
-
this.loading = false;
|
|
5709
|
-
this.suggesting = false;
|
|
5710
|
-
this.formatter = function (_b) {
|
|
5711
|
-
var id = _b["@id"];
|
|
5712
|
-
return id;
|
|
5713
|
-
};
|
|
5714
|
-
this.suggestCycle = function (text$) { return text$.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.tap(function () { return _this.suggesting = true; }), operators.switchMap(function (term) { return _this.suggest(term); }), operators.tap(function () { return _this.suggesting = false; })); };
|
|
5715
|
-
}
|
|
5716
|
-
CyclesSuggestFormComponent.prototype.suggest = function (term) {
|
|
5717
|
-
return term.length < MIN_TYPEAHEAD_LENGTH$2 ?
|
|
5718
|
-
rxjs.of([]) :
|
|
5719
|
-
this.searchService.suggest(term, schema.NodeType.Cycle, [], {
|
|
5720
|
-
bool: {
|
|
5721
|
-
must: [
|
|
5722
|
-
matchType(schema.NodeType.Cycle),
|
|
5723
|
-
matchAggregatedQuery
|
|
5724
|
-
],
|
|
5725
|
-
must_not: this.cycles.map(function (_b) {
|
|
5726
|
-
var id = _b["@id"];
|
|
5727
|
-
return matchExactQuery('@id', id);
|
|
5728
|
-
}),
|
|
5729
|
-
should: [
|
|
5730
|
-
matchPhraseQuery(term, 100, '@id', 'name'),
|
|
5731
|
-
matchPhrasePrefixQuery(term, 20, '@id', 'name'),
|
|
5732
|
-
matchBoolPrefixQuery(term, 10, '@id', 'name')
|
|
5733
|
-
],
|
|
5734
|
-
minimum_should_match: 1
|
|
5735
|
-
}
|
|
5736
|
-
}, 10, ['name', 'site.country.name', 'products.name', 'endDate']);
|
|
5737
|
-
};
|
|
5738
|
-
CyclesSuggestFormComponent.prototype.loadCycle = function (id) {
|
|
5739
|
-
return this.nodeService.get({
|
|
5740
|
-
'@type': schema.NodeType.Cycle,
|
|
5741
|
-
'@id': id
|
|
5742
|
-
}, false);
|
|
5743
|
-
};
|
|
5744
|
-
CyclesSuggestFormComponent.prototype.submit = function () {
|
|
5745
|
-
var _a;
|
|
5746
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5747
|
-
var id, cycle;
|
|
5748
|
-
return __generator(this, function (_b) {
|
|
5749
|
-
switch (_b.label) {
|
|
5750
|
-
case 0:
|
|
5751
|
-
this.loading = true;
|
|
5752
|
-
id = this.form.value.search["@id"];
|
|
5753
|
-
return [4 /*yield*/, this.loadCycle(id)];
|
|
5754
|
-
case 1:
|
|
5755
|
-
cycle = _b.sent();
|
|
5756
|
-
this.cycleAdded.emit(cycle);
|
|
5757
|
-
(_a = this.form.get('search')) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
5758
|
-
this.form.updateValueAndValidity();
|
|
5759
|
-
this.loading = false;
|
|
5760
|
-
return [2 /*return*/];
|
|
5761
|
-
}
|
|
5762
|
-
});
|
|
5763
|
-
});
|
|
5764
|
-
};
|
|
5765
|
-
return CyclesSuggestFormComponent;
|
|
5766
|
-
}());
|
|
5767
|
-
CyclesSuggestFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesSuggestFormComponent, deps: [{ token: i1__namespace$4.FormBuilder }, { token: HeNodeService }, { token: HeSearchService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5768
|
-
CyclesSuggestFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesSuggestFormComponent, selector: "he-cycles-suggest-form", inputs: { cycles: "cycles" }, outputs: { cycleAdded: "cycleAdded" }, ngImport: i0__namespace, 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__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$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__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
5769
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesSuggestFormComponent, decorators: [{
|
|
5770
|
-
type: i0.Component,
|
|
5771
|
-
args: [{
|
|
5772
|
-
selector: 'he-cycles-suggest-form',
|
|
5773
|
-
templateUrl: './cycles-suggest-form.component.html',
|
|
5774
|
-
styleUrls: ['./cycles-suggest-form.component.scss']
|
|
5775
|
-
}]
|
|
5776
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$4.FormBuilder }, { type: HeNodeService }, { type: HeSearchService }]; }, propDecorators: { cycles: [{
|
|
5777
|
-
type: i0.Input
|
|
5778
|
-
}], cycleAdded: [{
|
|
5779
|
-
type: i0.Output
|
|
5780
|
-
}] } });
|
|
5781
|
-
|
|
5782
5728
|
var Tab;
|
|
5783
5729
|
(function (Tab) {
|
|
5784
5730
|
Tab["inputs"] = "Inputs";
|
|
@@ -5843,9 +5789,11 @@
|
|
|
5843
5789
|
function CyclesActivityComponent() {
|
|
5844
5790
|
this.originalValues = [];
|
|
5845
5791
|
this.cycles = [];
|
|
5792
|
+
this.selected = [];
|
|
5846
5793
|
this.enableCompare = true;
|
|
5847
5794
|
this.baseUrl = baseUrl();
|
|
5848
5795
|
this.propertyValue = propertyValue$1;
|
|
5796
|
+
this.defaultLabel = defaultLabel;
|
|
5849
5797
|
this.showDownload = false;
|
|
5850
5798
|
this.View = View$4;
|
|
5851
5799
|
this.selectedView = View$4.table;
|
|
@@ -5879,21 +5827,13 @@
|
|
|
5879
5827
|
CyclesActivityComponent.prototype.togglePopover = function (popover, context) {
|
|
5880
5828
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
5881
5829
|
};
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5885
|
-
return __generator(this, function (_a) {
|
|
5886
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
5887
|
-
cycle
|
|
5888
|
-
]);
|
|
5889
|
-
return [2 /*return*/, this.update()];
|
|
5890
|
-
});
|
|
5891
|
-
});
|
|
5830
|
+
CyclesActivityComponent.prototype.isSelected = function (cycle) {
|
|
5831
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
5892
5832
|
};
|
|
5893
5833
|
return CyclesActivityComponent;
|
|
5894
5834
|
}());
|
|
5895
5835
|
CyclesActivityComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5896
|
-
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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 <
|
|
5836
|
+
CyclesActivityComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesActivityComponent, selector: "he-cycles-activity", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState", enableCompare: "enableCompare" }, usesOnChanges: true, ngImport: i0__namespace, 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 <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\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>\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, product.value.term['@id']) | 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, input.value.term['@id']) | 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 </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\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__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { 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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.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 } });
|
|
5897
5837
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesActivityComponent, decorators: [{
|
|
5898
5838
|
type: i0.Component,
|
|
5899
5839
|
args: [{
|
|
@@ -5905,6 +5845,8 @@
|
|
|
5905
5845
|
type: i0.Input
|
|
5906
5846
|
}], cycles: [{
|
|
5907
5847
|
type: i0.Input
|
|
5848
|
+
}], selected: [{
|
|
5849
|
+
type: i0.Input
|
|
5908
5850
|
}], dataState: [{
|
|
5909
5851
|
type: i0.Input
|
|
5910
5852
|
}], enableCompare: [{
|
|
@@ -5912,11 +5854,12 @@
|
|
|
5912
5854
|
}] } });
|
|
5913
5855
|
|
|
5914
5856
|
var ignoreKeys = [
|
|
5915
|
-
'@type', 'added', 'updated', 'addedVersion', 'updatedVersion'
|
|
5857
|
+
'@type', 'type', 'added', 'updated', 'addedVersion', 'updatedVersion'
|
|
5916
5858
|
];
|
|
5917
5859
|
var CyclesCompletenessComponent = /** @class */ (function () {
|
|
5918
5860
|
function CyclesCompletenessComponent() {
|
|
5919
5861
|
this.cycles = [];
|
|
5862
|
+
this.selected = [];
|
|
5920
5863
|
this.baseUrl = baseUrl();
|
|
5921
5864
|
this.defaultLabel = defaultLabel;
|
|
5922
5865
|
this.keyToLabel = keyToLabel;
|
|
@@ -5932,10 +5875,13 @@
|
|
|
5932
5875
|
enumerable: false,
|
|
5933
5876
|
configurable: true
|
|
5934
5877
|
});
|
|
5878
|
+
CyclesCompletenessComponent.prototype.isSelected = function (cycle) {
|
|
5879
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
5880
|
+
};
|
|
5935
5881
|
return CyclesCompletenessComponent;
|
|
5936
5882
|
}());
|
|
5937
5883
|
CyclesCompletenessComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
5938
|
-
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", dataState: "dataState" }, ngImport: i0__namespace, 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 <
|
|
5884
|
+
CyclesCompletenessComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesCompletenessComponent, selector: "he-cycles-completeness", inputs: { cycles: "cycles", selected: "selected", dataState: "dataState" }, ngImport: i0__namespace, 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 <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\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 </ng-container>\n </tbody>\n </table>\n </div>\n <he-blank-node-state-notice [dataState]=\"dataState\" [showAggregated]=\"false\"></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", "showAggregated", "showDeleted", "showUnchanged"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
5939
5885
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesCompletenessComponent, decorators: [{
|
|
5940
5886
|
type: i0.Component,
|
|
5941
5887
|
args: [{
|
|
@@ -5945,13 +5891,16 @@
|
|
|
5945
5891
|
}]
|
|
5946
5892
|
}], propDecorators: { cycles: [{
|
|
5947
5893
|
type: i0.Input
|
|
5894
|
+
}], selected: [{
|
|
5895
|
+
type: i0.Input
|
|
5948
5896
|
}], dataState: [{
|
|
5949
5897
|
type: i0.Input
|
|
5950
5898
|
}] } });
|
|
5951
5899
|
|
|
5900
|
+
var isSelected$1 = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
5952
5901
|
var cycleValue = function (cycle, values) { var _a; return (((_a = values[cycle['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: [0] }).value; };
|
|
5953
|
-
var cycleName = function (cycle, index) { return index + 1 + ". " + cycle
|
|
5954
|
-
var cycleDataset = function (values, termId
|
|
5902
|
+
var cycleName = function (cycle, index) { return index + 1 + ". " + defaultLabel(cycle); };
|
|
5903
|
+
var cycleDataset = function (values, termId, cycle, index) {
|
|
5955
5904
|
var label = cycleName(cycle, index);
|
|
5956
5905
|
var color = itemColor(index);
|
|
5957
5906
|
var data = [propertyValue$1(cycleValue(cycle, values), termId)];
|
|
@@ -5962,10 +5911,11 @@
|
|
|
5962
5911
|
backgroundColor: color,
|
|
5963
5912
|
borderColor: color
|
|
5964
5913
|
};
|
|
5965
|
-
};
|
|
5914
|
+
};
|
|
5966
5915
|
var CyclesEmissionsChartComponent = /** @class */ (function () {
|
|
5967
5916
|
function CyclesEmissionsChartComponent() {
|
|
5968
5917
|
this.cycles = [];
|
|
5918
|
+
this.selected = [];
|
|
5969
5919
|
this.emissionPerCycle = {};
|
|
5970
5920
|
this.terms = [];
|
|
5971
5921
|
}
|
|
@@ -5976,15 +5926,20 @@
|
|
|
5976
5926
|
if ('cycles' in changes && !changes.cycles.firstChange) {
|
|
5977
5927
|
return this.init();
|
|
5978
5928
|
}
|
|
5929
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
5930
|
+
return this.init();
|
|
5931
|
+
}
|
|
5979
5932
|
};
|
|
5980
5933
|
CyclesEmissionsChartComponent.prototype.init = function () {
|
|
5981
|
-
|
|
5934
|
+
var _this = this;
|
|
5935
|
+
var cycles = this.cycles.filter(function (v) { return isSelected$1(_this.selected, v); });
|
|
5936
|
+
this.emissionPerCycle = groupNodesByTerm(cycles, 'emissions');
|
|
5982
5937
|
this.terms = Object.values(this.emissionPerCycle)
|
|
5983
5938
|
.filter(function (_d) {
|
|
5984
5939
|
var values = _d.values;
|
|
5985
5940
|
return Object.values(values).some(function (_d) {
|
|
5986
5941
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
5987
|
-
return propertyValue$1(value)
|
|
5942
|
+
return propertyValue$1(value) >= 0;
|
|
5988
5943
|
});
|
|
5989
5944
|
})
|
|
5990
5945
|
.map(function (_d) {
|
|
@@ -5995,11 +5950,14 @@
|
|
|
5995
5950
|
return this.selectedTerm ? this.updateChart() : null;
|
|
5996
5951
|
};
|
|
5997
5952
|
CyclesEmissionsChartComponent.prototype.updateChart = function () {
|
|
5953
|
+
var _this = this;
|
|
5998
5954
|
var _a, _b, _c;
|
|
5999
5955
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
6000
5956
|
var termId = this.selectedTerm['@id'];
|
|
6001
5957
|
var values = this.emissionPerCycle[termId].values;
|
|
6002
|
-
var datasets = this.cycles
|
|
5958
|
+
var datasets = this.cycles
|
|
5959
|
+
.map(function (cycle, index) { return isSelected$1(_this.selected, cycle) ? cycleDataset(values, termId, cycle, index) : null; })
|
|
5960
|
+
.filter(Boolean);
|
|
6003
5961
|
if (this.chart) {
|
|
6004
5962
|
this.chart.destroy();
|
|
6005
5963
|
}
|
|
@@ -6032,7 +5990,7 @@
|
|
|
6032
5990
|
return CyclesEmissionsChartComponent;
|
|
6033
5991
|
}());
|
|
6034
5992
|
CyclesEmissionsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6035
|
-
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
5993
|
+
CyclesEmissionsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: { cycles: "cycles", selected: "selected" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, 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__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
6036
5994
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsChartComponent, decorators: [{
|
|
6037
5995
|
type: i0.Component,
|
|
6038
5996
|
args: [{
|
|
@@ -6045,6 +6003,8 @@
|
|
|
6045
6003
|
args: ['chart']
|
|
6046
6004
|
}], cycles: [{
|
|
6047
6005
|
type: i0.Input
|
|
6006
|
+
}], selected: [{
|
|
6007
|
+
type: i0.Input
|
|
6048
6008
|
}] } });
|
|
6049
6009
|
|
|
6050
6010
|
var CyclesEmissionsLogsComponent = /** @class */ (function () {
|
|
@@ -6126,14 +6086,13 @@
|
|
|
6126
6086
|
function CyclesEmissionsComponent() {
|
|
6127
6087
|
this.originalValues = [];
|
|
6128
6088
|
this.cycles = [];
|
|
6129
|
-
this.
|
|
6089
|
+
this.selected = [];
|
|
6130
6090
|
this.baseUrl = baseUrl();
|
|
6131
6091
|
this.propertyValue = propertyValue$1;
|
|
6132
|
-
this.
|
|
6092
|
+
this.defaultLabel = defaultLabel;
|
|
6133
6093
|
this.showDownload = false;
|
|
6134
6094
|
this.View = View$3;
|
|
6135
6095
|
this.selectedView = View$3.table;
|
|
6136
|
-
this.selectedCycles = [];
|
|
6137
6096
|
this.emissions = [];
|
|
6138
6097
|
}
|
|
6139
6098
|
CyclesEmissionsComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -6157,52 +6116,17 @@
|
|
|
6157
6116
|
CyclesEmissionsComponent.prototype.update = function () {
|
|
6158
6117
|
var emissionsPerCycle = groupNodesByTerm(this.cycles, 'emissions', this.originalValues);
|
|
6159
6118
|
this.emissions = orderBy$3(grouppedKeys(emissionsPerCycle), ['value.methodTierOrder', 'key'], ['asc', 'asc']);
|
|
6160
|
-
this.selectAllCycles();
|
|
6161
6119
|
};
|
|
6162
6120
|
CyclesEmissionsComponent.prototype.togglePopover = function (popover, context) {
|
|
6163
6121
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6164
6122
|
};
|
|
6165
|
-
// Add from suggestion
|
|
6166
|
-
CyclesEmissionsComponent.prototype.addCycle = function (cycle) {
|
|
6167
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6168
|
-
return __generator(this, function (_a) {
|
|
6169
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
6170
|
-
cycle
|
|
6171
|
-
]);
|
|
6172
|
-
return [2 /*return*/, this.update()];
|
|
6173
|
-
});
|
|
6174
|
-
});
|
|
6175
|
-
};
|
|
6176
|
-
// Cycle selection
|
|
6177
|
-
CyclesEmissionsComponent.prototype.selectAllCycles = function () {
|
|
6178
|
-
this.selectedCycles = this.cycles.slice();
|
|
6179
|
-
};
|
|
6180
|
-
CyclesEmissionsComponent.prototype.unselectAllCycles = function () {
|
|
6181
|
-
this.selectedCycles = [];
|
|
6182
|
-
};
|
|
6183
|
-
CyclesEmissionsComponent.prototype.toggleAllCycles = function () {
|
|
6184
|
-
return this.selectedCycles.length ? this.selectAllCycles() : this.unselectAllCycles();
|
|
6185
|
-
};
|
|
6186
|
-
CyclesEmissionsComponent.prototype.selectCycle = function (cycle) {
|
|
6187
|
-
this.selectedCycles = __spreadArray(__spreadArray([], __read(this.selectedCycles)), [
|
|
6188
|
-
cycle
|
|
6189
|
-
]);
|
|
6190
|
-
};
|
|
6191
|
-
CyclesEmissionsComponent.prototype.unselectCycle = function (index) {
|
|
6192
|
-
this.selectedCycles.splice(index, 1);
|
|
6193
|
-
this.selectedCycles = this.selectedCycles.slice();
|
|
6194
|
-
};
|
|
6195
|
-
CyclesEmissionsComponent.prototype.toggleCycle = function (cycle) {
|
|
6196
|
-
var index = this.selectedCycles.indexOf(cycle);
|
|
6197
|
-
return index >= 0 ? this.unselectCycle(index) : this.selectCycle(cycle);
|
|
6198
|
-
};
|
|
6199
6123
|
CyclesEmissionsComponent.prototype.isSelected = function (cycle) {
|
|
6200
|
-
return this.
|
|
6124
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6201
6125
|
};
|
|
6202
6126
|
return CyclesEmissionsComponent;
|
|
6203
6127
|
}());
|
|
6204
6128
|
CyclesEmissionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6205
|
-
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6129
|
+
CyclesEmissionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesEmissionsComponent, selector: "he-cycles-emissions", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, 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 <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\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>\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, emission.value.term['@id']) | 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 </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </div>\n\n <he-cycles-emissions-chart *ngIf=\"cycles.length > 1\" [class.is-hidden]=\"selectedView !== View.chart\"\n [cycles]=\"cycles\" [selected]=\"selected\"\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: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesEmissionsChartComponent, selector: "he-cycles-emissions-chart", inputs: ["cycles", "selected"] }, { 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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.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 } });
|
|
6206
6130
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesEmissionsComponent, decorators: [{
|
|
6207
6131
|
type: i0.Component,
|
|
6208
6132
|
args: [{
|
|
@@ -6214,9 +6138,9 @@
|
|
|
6214
6138
|
type: i0.Input
|
|
6215
6139
|
}], cycles: [{
|
|
6216
6140
|
type: i0.Input
|
|
6217
|
-
}],
|
|
6141
|
+
}], selected: [{
|
|
6218
6142
|
type: i0.Input
|
|
6219
|
-
}],
|
|
6143
|
+
}], dataState: [{
|
|
6220
6144
|
type: i0.Input
|
|
6221
6145
|
}] } });
|
|
6222
6146
|
|
|
@@ -6282,14 +6206,13 @@
|
|
|
6282
6206
|
function CyclesPracticesComponent() {
|
|
6283
6207
|
this.originalValues = [];
|
|
6284
6208
|
this.cycles = [];
|
|
6285
|
-
this.
|
|
6209
|
+
this.selected = [];
|
|
6286
6210
|
this.baseUrl = baseUrl();
|
|
6287
6211
|
this.propertyValue = propertyValue$1;
|
|
6288
|
-
this.
|
|
6212
|
+
this.defaultLabel = defaultLabel;
|
|
6289
6213
|
this.showDownload = false;
|
|
6290
6214
|
this.View = View$2;
|
|
6291
6215
|
this.selectedView = View$2.table;
|
|
6292
|
-
this.selectedCycles = [];
|
|
6293
6216
|
this.practices = [];
|
|
6294
6217
|
}
|
|
6295
6218
|
CyclesPracticesComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -6313,52 +6236,17 @@
|
|
|
6313
6236
|
CyclesPracticesComponent.prototype.update = function () {
|
|
6314
6237
|
var practicesPerCycle = groupNodesByTerm(this.cycles, 'practices', this.originalValues);
|
|
6315
6238
|
this.practices = orderBy$2(grouppedKeys(practicesPerCycle), ['key'], ['asc']);
|
|
6316
|
-
this.selectAllCycles();
|
|
6317
6239
|
};
|
|
6318
6240
|
CyclesPracticesComponent.prototype.togglePopover = function (popover, context) {
|
|
6319
6241
|
return popover.isOpen() ? popover.close() : popover.open(context);
|
|
6320
6242
|
};
|
|
6321
|
-
// Add from suggestion
|
|
6322
|
-
CyclesPracticesComponent.prototype.addCycle = function (cycle) {
|
|
6323
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6324
|
-
return __generator(this, function (_a) {
|
|
6325
|
-
this.cycles = __spreadArray(__spreadArray([], __read(this.cycles)), [
|
|
6326
|
-
cycle
|
|
6327
|
-
]);
|
|
6328
|
-
return [2 /*return*/, this.update()];
|
|
6329
|
-
});
|
|
6330
|
-
});
|
|
6331
|
-
};
|
|
6332
|
-
// Cycle selection
|
|
6333
|
-
CyclesPracticesComponent.prototype.selectAllCycles = function () {
|
|
6334
|
-
this.selectedCycles = this.cycles.slice();
|
|
6335
|
-
};
|
|
6336
|
-
CyclesPracticesComponent.prototype.unselectAllCycles = function () {
|
|
6337
|
-
this.selectedCycles = [];
|
|
6338
|
-
};
|
|
6339
|
-
CyclesPracticesComponent.prototype.toggleAllCycles = function () {
|
|
6340
|
-
return this.selectedCycles.length ? this.selectAllCycles() : this.unselectAllCycles();
|
|
6341
|
-
};
|
|
6342
|
-
CyclesPracticesComponent.prototype.selectCycle = function (cycle) {
|
|
6343
|
-
this.selectedCycles = __spreadArray(__spreadArray([], __read(this.selectedCycles)), [
|
|
6344
|
-
cycle
|
|
6345
|
-
]);
|
|
6346
|
-
};
|
|
6347
|
-
CyclesPracticesComponent.prototype.unselectCycle = function (index) {
|
|
6348
|
-
this.selectedCycles.splice(index, 1);
|
|
6349
|
-
this.selectedCycles = this.selectedCycles.slice();
|
|
6350
|
-
};
|
|
6351
|
-
CyclesPracticesComponent.prototype.toggleCycle = function (cycle) {
|
|
6352
|
-
var index = this.selectedCycles.indexOf(cycle);
|
|
6353
|
-
return index >= 0 ? this.unselectCycle(index) : this.selectCycle(cycle);
|
|
6354
|
-
};
|
|
6355
6243
|
CyclesPracticesComponent.prototype.isSelected = function (cycle) {
|
|
6356
|
-
return this.
|
|
6244
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6357
6245
|
};
|
|
6358
6246
|
return CyclesPracticesComponent;
|
|
6359
6247
|
}());
|
|
6360
6248
|
CyclesPracticesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6361
|
-
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles",
|
|
6249
|
+
CyclesPracticesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesPracticesComponent, selector: "he-cycles-practices", inputs: { originalValues: "originalValues", cycles: "cycles", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"practices.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-{{practices.length}}\">\n <thead>\n <tr>\n <th class=\"width-auto\"></th>\n <th></th>\n <th *ngFor=\"let practice of practices\"\n [attr.title]=\"practice.value.term.name\"\n >\n <he-node-link [node]=\"practice.value.term\">\n <span>{{practice.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 practice of practices\"\n [attr.title]=\"practice.value.term.units\"\n >{{practice.value.term.units}}</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor=\"let cycle of cycles; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(cycle)\">\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>\n <he-cycles-functional-unit-measure [cycle]=\"cycles[0]\"></he-cycles-functional-unit-measure>\n </td>\n <td class=\"is-nowrap\" *ngFor=\"let practice of practices\">\n <span *ngIf=\"practice.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: practice.value.values[cycle['@id']], cycle: cycle, key: 'practices' })\"\n >\n <span pointer>{{propertyValue(practice.value.values[cycle['@id']].value, practice.value.term['@id']) | precision:3 | default:'-'}}</span>\n <he-blank-node-state class=\"ml-1\"\n [node]=\"practice.value.values[cycle['@id']].nodes[0]\"\n key=\"value\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\" [showDeleted]=\"true\"></he-blank-node-state-notice>\n </div>\n\n <he-cycles-practices-logs *ngIf=\"selectedView === View.logs && !isOriginal\"\n [cycle]=\"cycles[0]\"\n [originalValues]=\"originalValues[0]?.practices\"\n [recalculatedValues]=\"cycles[0]?.practices\"\n ></he-cycles-practices-logs>\n</ng-container>\n\n<he-node-csv-export-confirm *ngIf=\"showDownload\"\n [nodes]=\"cycles\" filename=\"cycle-practices.csv\" [isUpload]=\"false\"\n [headerKeys]=\"['cycle.id', 'cycle.@id', 'cycle.practices.']\"\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: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { type: CyclesPracticesLogsComponent, selector: "he-cycles-practices-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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.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 } });
|
|
6362
6250
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesPracticesComponent, decorators: [{
|
|
6363
6251
|
type: i0.Component,
|
|
6364
6252
|
args: [{
|
|
@@ -6370,15 +6258,16 @@
|
|
|
6370
6258
|
type: i0.Input
|
|
6371
6259
|
}], cycles: [{
|
|
6372
6260
|
type: i0.Input
|
|
6373
|
-
}],
|
|
6261
|
+
}], selected: [{
|
|
6374
6262
|
type: i0.Input
|
|
6375
|
-
}],
|
|
6263
|
+
}], dataState: [{
|
|
6376
6264
|
type: i0.Input
|
|
6377
6265
|
}] } });
|
|
6378
6266
|
|
|
6379
6267
|
var CyclesResultComponent = /** @class */ (function () {
|
|
6380
6268
|
function CyclesResultComponent() {
|
|
6381
6269
|
this.cycles = [];
|
|
6270
|
+
this.selected = [];
|
|
6382
6271
|
}
|
|
6383
6272
|
CyclesResultComponent.prototype.ngAfterViewInit = function () {
|
|
6384
6273
|
chart_js.Chart.scaleService.updateScaleDefaults('category', {
|
|
@@ -6392,14 +6281,27 @@
|
|
|
6392
6281
|
if ('cycles' in changes && !changes.cycles.firstChange) {
|
|
6393
6282
|
return this.init();
|
|
6394
6283
|
}
|
|
6284
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
6285
|
+
return this.init();
|
|
6286
|
+
}
|
|
6287
|
+
};
|
|
6288
|
+
CyclesResultComponent.prototype.isSelected = function (cycle) {
|
|
6289
|
+
return this.selected.length === 0 || this.selected.includes(cycle['@id']);
|
|
6395
6290
|
};
|
|
6396
6291
|
CyclesResultComponent.prototype.init = function () {
|
|
6397
6292
|
var _this = this;
|
|
6398
|
-
var labels = this.cycles
|
|
6399
|
-
|
|
6400
|
-
|
|
6293
|
+
var labels = this.cycles
|
|
6294
|
+
.map(function (cycle, index) { return ({ cycle: cycle, index: index }); })
|
|
6295
|
+
.filter(function (_b) {
|
|
6296
|
+
var cycle = _b.cycle;
|
|
6297
|
+
return _this.isSelected(cycle);
|
|
6298
|
+
})
|
|
6299
|
+
.map(function (_b) {
|
|
6300
|
+
var cycle = _b.cycle, index = _b.index;
|
|
6301
|
+
return index + 1 + ". " + defaultLabel(cycle);
|
|
6401
6302
|
});
|
|
6402
|
-
var
|
|
6303
|
+
var cycles = this.cycles.filter(function (v) { return _this.isSelected(v); });
|
|
6304
|
+
var productsPerCycle = groupNodesByTerm(cycles, 'products');
|
|
6403
6305
|
var datasets = Object.values(productsPerCycle).map(function (_b, index) {
|
|
6404
6306
|
var _c = _b.term, name = _c.name, units = _c.units, termId = _c["@id"], values = _b.values;
|
|
6405
6307
|
var color = itemColor(index);
|
|
@@ -6408,7 +6310,7 @@
|
|
|
6408
6310
|
backgroundColor: color,
|
|
6409
6311
|
borderColor: color,
|
|
6410
6312
|
barPercentage: 0.5,
|
|
6411
|
-
data:
|
|
6313
|
+
data: cycles.map(function (_b) {
|
|
6412
6314
|
var id = _b["@id"];
|
|
6413
6315
|
return values[id] ? propertyValue$1(values[id].value, termId) : 0;
|
|
6414
6316
|
})
|
|
@@ -6460,7 +6362,7 @@
|
|
|
6460
6362
|
return CyclesResultComponent;
|
|
6461
6363
|
}());
|
|
6462
6364
|
CyclesResultComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6463
|
-
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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"] });
|
|
6365
|
+
CyclesResultComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CyclesResultComponent, selector: "he-cycles-result", inputs: { cycles: "cycles", selected: "selected" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, 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"] });
|
|
6464
6366
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: CyclesResultComponent, decorators: [{
|
|
6465
6367
|
type: i0.Component,
|
|
6466
6368
|
args: [{
|
|
@@ -6473,6 +6375,8 @@
|
|
|
6473
6375
|
args: ['chart']
|
|
6474
6376
|
}], cycles: [{
|
|
6475
6377
|
type: i0.Input
|
|
6378
|
+
}], selected: [{
|
|
6379
|
+
type: i0.Input
|
|
6476
6380
|
}] } });
|
|
6477
6381
|
|
|
6478
6382
|
var components$3 = [
|
|
@@ -6485,8 +6389,7 @@
|
|
|
6485
6389
|
CyclesFunctionalUnitMeasureComponent,
|
|
6486
6390
|
CyclesPracticesComponent,
|
|
6487
6391
|
CyclesPracticesLogsComponent,
|
|
6488
|
-
CyclesResultComponent
|
|
6489
|
-
CyclesSuggestFormComponent
|
|
6392
|
+
CyclesResultComponent
|
|
6490
6393
|
];
|
|
6491
6394
|
var HeCyclesModule = /** @class */ (function () {
|
|
6492
6395
|
function HeCyclesModule() {
|
|
@@ -6503,8 +6406,7 @@
|
|
|
6503
6406
|
CyclesFunctionalUnitMeasureComponent,
|
|
6504
6407
|
CyclesPracticesComponent,
|
|
6505
6408
|
CyclesPracticesLogsComponent,
|
|
6506
|
-
CyclesResultComponent,
|
|
6507
|
-
CyclesSuggestFormComponent], imports: [i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6409
|
+
CyclesResultComponent], imports: [i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6508
6410
|
HeCommonModule,
|
|
6509
6411
|
HeNodeModule], exports: [CyclesActivityComponent,
|
|
6510
6412
|
CyclesActivityLogsComponent,
|
|
@@ -6515,8 +6417,7 @@
|
|
|
6515
6417
|
CyclesFunctionalUnitMeasureComponent,
|
|
6516
6418
|
CyclesPracticesComponent,
|
|
6517
6419
|
CyclesPracticesLogsComponent,
|
|
6518
|
-
CyclesResultComponent
|
|
6519
|
-
CyclesSuggestFormComponent] });
|
|
6420
|
+
CyclesResultComponent] });
|
|
6520
6421
|
HeCyclesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: HeCyclesModule, imports: [[
|
|
6521
6422
|
i6.CommonModule, i1$2.FormsModule, i1$2.ReactiveFormsModule,
|
|
6522
6423
|
HeCommonModule,
|
|
@@ -6627,7 +6528,7 @@
|
|
|
6627
6528
|
"The " + paths[0].path + " are invalid";
|
|
6628
6529
|
},
|
|
6629
6530
|
_f['may be between 0 and 100'] = function () { return 'percentages should be between 0 and 100, not 0 and 1. This may be an error.'; },
|
|
6630
|
-
_f['may not all be set to false'] = function () { return "You may have forgotten to fill in
|
|
6531
|
+
_f['may not all be set to false'] = function () { return "Every value in the data completeness assessment is " + code('false') + ". You may have forgotten to fill it in.\n For information on how to fill it in, please see the " + schemaLink('Cycle#dataCompleteness', 'schema') + "."; },
|
|
6631
6532
|
_f['may not be empty'] = function () { return 'if this value signifies no data, Hestia only accepts "-" or empty for no data'; },
|
|
6632
6533
|
_f['may not be 0'] = function (_f, errorCount) {
|
|
6633
6534
|
var dataPath = _f.dataPath;
|
|
@@ -6663,7 +6564,7 @@
|
|
|
6663
6564
|
},
|
|
6664
6565
|
_f['must contain as many items as values'] = function (_f) {
|
|
6665
6566
|
var params = _f.params, dataPath = _f.dataPath;
|
|
6666
|
-
return "The number of " + dataPath.split('.').pop() + " must match the number of
|
|
6567
|
+
return "The number of " + code(dataPath.split('.').pop()) + " must match the number of " + code('value') + ".\n Currently there are " + (params === null || params === void 0 ? void 0 : params.current) + " " + code(dataPath.split('.').pop()) + " but " + (params === null || params === void 0 ? void 0 : params.expected) + " " + code('value') + ".";
|
|
6667
6568
|
},
|
|
6668
6569
|
_f['is too generic'] = function (_f) {
|
|
6669
6570
|
var params = _f.params;
|
|
@@ -6707,6 +6608,10 @@
|
|
|
6707
6608
|
var params = _f.params;
|
|
6708
6609
|
return "If the amount produced is zero, the revenue of " + (errorCount === 1 ? code(params === null || params === void 0 ? void 0 : params.term.name) : 'that product') + " must also be zero.";
|
|
6709
6610
|
},
|
|
6611
|
+
_f['should add a source'] = function (_f) {
|
|
6612
|
+
var params = _f.params;
|
|
6613
|
+
return "We recommend adding a Source to all data items.\n This can be done by adding the " + code(params === null || params === void 0 ? void 0 : params.current) + " field.\n Sources can also be specified for each data item (i.e., each Input, Emission, Product, Practice, Measurement, or Infrastructure).";
|
|
6614
|
+
},
|
|
6710
6615
|
_f);
|
|
6711
6616
|
var formatCustomErrorMessage = function (message, error, errorCount) {
|
|
6712
6617
|
if (errorCount === void 0) { errorCount = 1; }
|
|
@@ -7414,19 +7319,19 @@
|
|
|
7414
7319
|
}); }));
|
|
7415
7320
|
};
|
|
7416
7321
|
|
|
7417
|
-
var isSite = function (
|
|
7418
|
-
var type =
|
|
7322
|
+
var isSite = function (_b) {
|
|
7323
|
+
var type = _b["@type"], id = _b["@id"];
|
|
7419
7324
|
return type === schema.NodeType.Site && !!id;
|
|
7420
7325
|
};
|
|
7421
|
-
var siteLocation = function (
|
|
7422
|
-
var latitude =
|
|
7326
|
+
var siteLocation = function (_b) {
|
|
7327
|
+
var latitude = _b.latitude, longitude = _b.longitude;
|
|
7423
7328
|
return latitude && longitude ? ({
|
|
7424
7329
|
lat: latitude,
|
|
7425
7330
|
lng: longitude
|
|
7426
7331
|
}) : undefined;
|
|
7427
7332
|
};
|
|
7428
|
-
var siteDefaultLocation = function (
|
|
7429
|
-
var region =
|
|
7333
|
+
var siteDefaultLocation = function (_b) {
|
|
7334
|
+
var region = _b.region, country = _b.country;
|
|
7430
7335
|
var markers = [
|
|
7431
7336
|
region ? createMarker(termLocation(region), termLocationName(region).name, undefined, 20) : undefined,
|
|
7432
7337
|
country ? createMarker(termLocation(country), termLocationName(country).name, undefined, 40) : undefined
|
|
@@ -7434,12 +7339,12 @@
|
|
|
7434
7339
|
return (markers.length ? markers[0] : undefined);
|
|
7435
7340
|
};
|
|
7436
7341
|
var siteMarker = function (site) { return createMarker(site ? siteLocation(site) : undefined, site.name); };
|
|
7437
|
-
var sitePolygon = function (
|
|
7438
|
-
var boundary =
|
|
7342
|
+
var sitePolygon = function (_b) {
|
|
7343
|
+
var boundary = _b.boundary;
|
|
7439
7344
|
return (boundary ? polygonsFromFeature(boundary) : undefined);
|
|
7440
7345
|
};
|
|
7441
|
-
var regions = function (sites) { return utils.unique(sites.map(function (
|
|
7442
|
-
var country =
|
|
7346
|
+
var regions = function (sites) { return utils.unique(sites.map(function (_b) {
|
|
7347
|
+
var country = _b.country, region = _b.region;
|
|
7443
7348
|
return region ? region['@id'] : (country ? country['@id'] : null);
|
|
7444
7349
|
}).filter(Boolean)); };
|
|
7445
7350
|
var defaultCenter = { lat: 0, lng: 0 };
|
|
@@ -7449,6 +7354,7 @@
|
|
|
7449
7354
|
this.loaded = false;
|
|
7450
7355
|
this.loadPolygons = true;
|
|
7451
7356
|
this.sites = [];
|
|
7357
|
+
this.selected = [];
|
|
7452
7358
|
this.nodes = [];
|
|
7453
7359
|
this.center = defaultCenter;
|
|
7454
7360
|
this.zoom = 2;
|
|
@@ -7466,25 +7372,28 @@
|
|
|
7466
7372
|
SitesMapsComponent.prototype.ngAfterViewInit = function () {
|
|
7467
7373
|
return this.googleLoaded && this.loadData();
|
|
7468
7374
|
};
|
|
7375
|
+
SitesMapsComponent.prototype.isSelected = function (site) {
|
|
7376
|
+
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
7377
|
+
};
|
|
7469
7378
|
SitesMapsComponent.prototype.loadData = function () {
|
|
7470
7379
|
return __awaiter(this, void 0, void 0, function () {
|
|
7471
7380
|
var sites, markers, polygons, termPolygons;
|
|
7472
7381
|
var _this = this;
|
|
7473
|
-
return __generator(this, function (
|
|
7474
|
-
switch (
|
|
7382
|
+
return __generator(this, function (_b) {
|
|
7383
|
+
switch (_b.label) {
|
|
7475
7384
|
case 0:
|
|
7476
7385
|
// loaded data as geojson
|
|
7477
7386
|
this.map.googleMap.data.setStyle(function () { return (Object.assign(Object.assign({}, strokeStyle), { strokeOpacity: 0.1 })); });
|
|
7478
7387
|
return [4 /*yield*/, this.getSites()];
|
|
7479
7388
|
case 1:
|
|
7480
|
-
sites =
|
|
7389
|
+
sites = _b.sent();
|
|
7481
7390
|
markers = this.addSiteMarkers(sites);
|
|
7482
7391
|
polygons = sites.flatMap(sitePolygon).filter(Boolean);
|
|
7483
7392
|
polygons.map(function (polygon) { return polygon === null || polygon === void 0 ? void 0 : polygon.setMap(_this.map.googleMap); });
|
|
7484
7393
|
this.loaded = true;
|
|
7485
7394
|
return [4 /*yield*/, Promise.all(regions(sites).map(function (v) { return _this.addTermsPolygons(v); }))];
|
|
7486
7395
|
case 2:
|
|
7487
|
-
termPolygons = (
|
|
7396
|
+
termPolygons = (_b.sent()).flat();
|
|
7488
7397
|
this.showNoLocation = markers.length === 0 && polygons.length === 0 && termPolygons.length === 0;
|
|
7489
7398
|
return [2 /*return*/, markers.length ?
|
|
7490
7399
|
this.centerMarker(markers[0]) :
|
|
@@ -7502,19 +7411,19 @@
|
|
|
7502
7411
|
};
|
|
7503
7412
|
SitesMapsComponent.prototype.addTermsPolygons = function (id) {
|
|
7504
7413
|
return __awaiter(this, void 0, void 0, function () {
|
|
7505
|
-
var
|
|
7506
|
-
return __generator(this, function (
|
|
7507
|
-
switch (
|
|
7414
|
+
var _b;
|
|
7415
|
+
return __generator(this, function (_c) {
|
|
7416
|
+
switch (_c.label) {
|
|
7508
7417
|
case 0:
|
|
7509
7418
|
if (!this.loadPolygons) return [3 /*break*/, 2];
|
|
7510
7419
|
return [4 /*yield*/, this.termPolygons(id)];
|
|
7511
7420
|
case 1:
|
|
7512
|
-
|
|
7421
|
+
_b = _c.sent();
|
|
7513
7422
|
return [3 /*break*/, 3];
|
|
7514
7423
|
case 2:
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
case 3: return [2 /*return*/,
|
|
7424
|
+
_b = [];
|
|
7425
|
+
_c.label = 3;
|
|
7426
|
+
case 3: return [2 /*return*/, _b];
|
|
7518
7427
|
}
|
|
7519
7428
|
});
|
|
7520
7429
|
});
|
|
@@ -7542,82 +7451,83 @@
|
|
|
7542
7451
|
};
|
|
7543
7452
|
SitesMapsComponent.prototype.loadSite = function (node) {
|
|
7544
7453
|
return __awaiter(this, void 0, void 0, function () {
|
|
7545
|
-
var
|
|
7546
|
-
return __generator(this, function (
|
|
7547
|
-
switch (
|
|
7454
|
+
var _b;
|
|
7455
|
+
return __generator(this, function (_c) {
|
|
7456
|
+
switch (_c.label) {
|
|
7548
7457
|
case 0:
|
|
7549
7458
|
if (!('schemaVersion' in node)) return [3 /*break*/, 1];
|
|
7550
|
-
|
|
7459
|
+
_b = node;
|
|
7551
7460
|
return [3 /*break*/, 3];
|
|
7552
7461
|
case 1: return [4 /*yield*/, this.nodeService.get(node)];
|
|
7553
7462
|
case 2:
|
|
7554
|
-
|
|
7555
|
-
|
|
7463
|
+
_b = _c.sent();
|
|
7464
|
+
_c.label = 3;
|
|
7556
7465
|
case 3:
|
|
7557
7466
|
// means the site was already downloaded
|
|
7558
|
-
return [2 /*return*/,
|
|
7467
|
+
return [2 /*return*/, _b];
|
|
7559
7468
|
}
|
|
7560
7469
|
});
|
|
7561
7470
|
});
|
|
7562
7471
|
};
|
|
7563
7472
|
SitesMapsComponent.prototype.siteData = function (node) {
|
|
7564
7473
|
return __awaiter(this, void 0, void 0, function () {
|
|
7565
|
-
var
|
|
7566
|
-
return __generator(this, function (
|
|
7567
|
-
switch (
|
|
7474
|
+
var _b, _c, _d, _e;
|
|
7475
|
+
return __generator(this, function (_f) {
|
|
7476
|
+
switch (_f.label) {
|
|
7568
7477
|
case 0:
|
|
7569
7478
|
if (![
|
|
7570
7479
|
schema.NodeType.Site,
|
|
7571
7480
|
schema.NodeType.Organisation
|
|
7572
7481
|
].includes(node.type)) return [3 /*break*/, 1];
|
|
7573
|
-
|
|
7482
|
+
_b = node;
|
|
7574
7483
|
return [3 /*break*/, 7];
|
|
7575
7484
|
case 1:
|
|
7576
7485
|
if (!isSite(node)) return [3 /*break*/, 2];
|
|
7577
|
-
|
|
7486
|
+
_c = this.loadSite(node);
|
|
7578
7487
|
return [3 /*break*/, 6];
|
|
7579
7488
|
case 2:
|
|
7580
7489
|
if (!('site' in node && isSite(node.site))) return [3 /*break*/, 3];
|
|
7581
|
-
|
|
7490
|
+
_d = this.loadSite(node.site);
|
|
7582
7491
|
return [3 /*break*/, 5];
|
|
7583
7492
|
case 3:
|
|
7584
|
-
|
|
7493
|
+
_e = this.siteData;
|
|
7585
7494
|
return [4 /*yield*/, this.loadSite(node)];
|
|
7586
7495
|
case 4:
|
|
7587
|
-
|
|
7588
|
-
|
|
7496
|
+
_d = _e.apply(this, [_f.sent()]);
|
|
7497
|
+
_f.label = 5;
|
|
7589
7498
|
case 5:
|
|
7590
|
-
|
|
7591
|
-
|
|
7499
|
+
_c = (_d);
|
|
7500
|
+
_f.label = 6;
|
|
7592
7501
|
case 6:
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
case 7: return [2 /*return*/,
|
|
7502
|
+
_b = (_c);
|
|
7503
|
+
_f.label = 7;
|
|
7504
|
+
case 7: return [2 /*return*/, _b];
|
|
7596
7505
|
}
|
|
7597
7506
|
});
|
|
7598
7507
|
});
|
|
7599
7508
|
};
|
|
7600
7509
|
SitesMapsComponent.prototype.getSites = function () {
|
|
7601
7510
|
var _this = this;
|
|
7602
|
-
var
|
|
7511
|
+
var _a;
|
|
7512
|
+
var nodes = ((_a = this.sites) === null || _a === void 0 ? void 0 : _a.length) ? this.sites.filter(function (site) { return _this.isSelected(site); }) : this.nodes;
|
|
7603
7513
|
return Promise.all(nodes.map(function (node) { return _this.siteData(node); }));
|
|
7604
7514
|
};
|
|
7605
7515
|
SitesMapsComponent.prototype.termPolygons = function (id) {
|
|
7606
7516
|
return __awaiter(this, void 0, void 0, function () {
|
|
7607
7517
|
var data, polygons, _err_1;
|
|
7608
7518
|
var _this = this;
|
|
7609
|
-
return __generator(this, function (
|
|
7610
|
-
switch (
|
|
7519
|
+
return __generator(this, function (_b) {
|
|
7520
|
+
switch (_b.label) {
|
|
7611
7521
|
case 0:
|
|
7612
|
-
|
|
7522
|
+
_b.trys.push([0, 2, , 3]);
|
|
7613
7523
|
return [4 /*yield*/, this.nodeService.downloadRaw(baseUrl() + "/gadm/" + id + ".geojson")];
|
|
7614
7524
|
case 1:
|
|
7615
|
-
data =
|
|
7525
|
+
data = _b.sent();
|
|
7616
7526
|
polygons = polygonsFromFeature(data);
|
|
7617
7527
|
polygons.map(function (polygon) { return polygon.setMap(_this.map.googleMap); });
|
|
7618
7528
|
return [2 /*return*/, polygons];
|
|
7619
7529
|
case 2:
|
|
7620
|
-
_err_1 =
|
|
7530
|
+
_err_1 = _b.sent();
|
|
7621
7531
|
// ignore error if the file does not exist
|
|
7622
7532
|
return [2 /*return*/, []];
|
|
7623
7533
|
case 3: return [2 /*return*/];
|
|
@@ -7628,7 +7538,7 @@
|
|
|
7628
7538
|
return SitesMapsComponent;
|
|
7629
7539
|
}());
|
|
7630
7540
|
SitesMapsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7631
|
-
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵ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: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, 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__namespace$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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7541
|
+
SitesMapsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMapsComponent, selector: "he-sites-maps", inputs: { loadPolygons: "loadPolygons", sites: "sites", selected: "selected", nodes: "nodes", center: "center", zoom: "zoom", showNotice: "showNotice" }, viewQueries: [{ propertyName: "map", first: true, predicate: i1$4.GoogleMap, descendants: true }], ngImport: i0__namespace, 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__namespace$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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
7632
7542
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMapsComponent, decorators: [{
|
|
7633
7543
|
type: i0.Component,
|
|
7634
7544
|
args: [{
|
|
@@ -7643,6 +7553,8 @@
|
|
|
7643
7553
|
type: i0.Input
|
|
7644
7554
|
}], sites: [{
|
|
7645
7555
|
type: i0.Input
|
|
7556
|
+
}], selected: [{
|
|
7557
|
+
type: i0.Input
|
|
7646
7558
|
}], nodes: [{
|
|
7647
7559
|
type: i0.Input
|
|
7648
7560
|
}], center: [{
|
|
@@ -7750,6 +7662,7 @@
|
|
|
7750
7662
|
function SitesMeasurementsComponent() {
|
|
7751
7663
|
this.originalValues = [];
|
|
7752
7664
|
this.sites = [];
|
|
7665
|
+
this.selected = [];
|
|
7753
7666
|
this.showDownload = false;
|
|
7754
7667
|
this.View = View$1;
|
|
7755
7668
|
this.selectedView = View$1.table;
|
|
@@ -7791,10 +7704,13 @@
|
|
|
7791
7704
|
enumerable: false,
|
|
7792
7705
|
configurable: true
|
|
7793
7706
|
});
|
|
7707
|
+
SitesMeasurementsComponent.prototype.isSelected = function (site) {
|
|
7708
|
+
return this.selected.length === 0 || this.selected.includes(site['@id']);
|
|
7709
|
+
};
|
|
7794
7710
|
return SitesMeasurementsComponent;
|
|
7795
7711
|
}());
|
|
7796
7712
|
SitesMeasurementsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7797
|
-
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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 <
|
|
7713
|
+
SitesMeasurementsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SitesMeasurementsComponent, selector: "he-sites-measurements", inputs: { originalValues: "originalValues", sites: "sites", selected: "selected", dataState: "dataState" }, usesOnChanges: true, ngImport: i0__namespace, 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 <ng-container *ngFor=\"let site of sites; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(site)\">\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']], measurement.value.term['@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 </ng-container>\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__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { 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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.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 } });
|
|
7798
7714
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SitesMeasurementsComponent, decorators: [{
|
|
7799
7715
|
type: i0.Component,
|
|
7800
7716
|
args: [{
|
|
@@ -7806,6 +7722,8 @@
|
|
|
7806
7722
|
type: i0.Input
|
|
7807
7723
|
}], sites: [{
|
|
7808
7724
|
type: i0.Input
|
|
7725
|
+
}], selected: [{
|
|
7726
|
+
type: i0.Input
|
|
7809
7727
|
}], dataState: [{
|
|
7810
7728
|
type: i0.Input
|
|
7811
7729
|
}] } });
|
|
@@ -8282,7 +8200,7 @@
|
|
|
8282
8200
|
return FilesFormComponent;
|
|
8283
8201
|
}());
|
|
8284
8202
|
FilesFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, deps: [{ token: i0__namespace.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8285
|
-
FilesFormComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$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__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$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__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
8203
|
+
FilesFormComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$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__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$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__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
8286
8204
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
8287
8205
|
type: i0.Component,
|
|
8288
8206
|
args: [{
|
|
@@ -8532,9 +8450,10 @@
|
|
|
8532
8450
|
type: i0.Input
|
|
8533
8451
|
}] } });
|
|
8534
8452
|
|
|
8453
|
+
var isSelected = function (selected, v) { return selected.length === 0 || selected.includes(v['@id']); };
|
|
8535
8454
|
var impactValue = function (impact, values) { var _a; return (((_a = values[impact['@id']]) === null || _a === void 0 ? void 0 : _a.nodes[0]) || { value: 0 }).value; };
|
|
8536
8455
|
var impactName = function (impact, index) { return index + 1 + ". " + defaultLabel(impact); };
|
|
8537
|
-
var impactAssessmentDataset = function (values
|
|
8456
|
+
var impactAssessmentDataset = function (values, impact, index) {
|
|
8538
8457
|
var label = impactName(impact, index);
|
|
8539
8458
|
var color = itemColor(index);
|
|
8540
8459
|
var data = [impactValue(impact, values)];
|
|
@@ -8545,10 +8464,11 @@
|
|
|
8545
8464
|
backgroundColor: color,
|
|
8546
8465
|
borderColor: color
|
|
8547
8466
|
};
|
|
8548
|
-
};
|
|
8467
|
+
};
|
|
8549
8468
|
var ImpactAssessmentsIndicatorsChartComponent = /** @class */ (function () {
|
|
8550
8469
|
function ImpactAssessmentsIndicatorsChartComponent() {
|
|
8551
8470
|
this.impactAssessments = [];
|
|
8471
|
+
this.selected = [];
|
|
8552
8472
|
this.key = 'impacts';
|
|
8553
8473
|
this.indicatorPerImpactAssessment = {};
|
|
8554
8474
|
this.terms = [];
|
|
@@ -8560,6 +8480,9 @@
|
|
|
8560
8480
|
if ('impactAssessments' in changes && !changes.impactAssessments.firstChange) {
|
|
8561
8481
|
return this.init();
|
|
8562
8482
|
}
|
|
8483
|
+
if ('selected' in changes && !changes.selected.firstChange) {
|
|
8484
|
+
return this.init();
|
|
8485
|
+
}
|
|
8563
8486
|
};
|
|
8564
8487
|
ImpactAssessmentsIndicatorsChartComponent.prototype.termAllowed = function (term) {
|
|
8565
8488
|
var _a;
|
|
@@ -8567,13 +8490,14 @@
|
|
|
8567
8490
|
};
|
|
8568
8491
|
ImpactAssessmentsIndicatorsChartComponent.prototype.init = function () {
|
|
8569
8492
|
var _this = this;
|
|
8570
|
-
this.
|
|
8493
|
+
var impacts = this.impactAssessments.filter(function (v) { return isSelected(_this.selected, v); });
|
|
8494
|
+
this.indicatorPerImpactAssessment = groupNodesByTerm(impacts, this.key);
|
|
8571
8495
|
this.terms = Object.values(this.indicatorPerImpactAssessment)
|
|
8572
8496
|
.filter(function (_d) {
|
|
8573
8497
|
var term = _d.term, values = _d.values;
|
|
8574
8498
|
return _this.termAllowed(term) && Object.values(values).some(function (_d) {
|
|
8575
8499
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
8576
|
-
return value
|
|
8500
|
+
return value >= 0;
|
|
8577
8501
|
});
|
|
8578
8502
|
})
|
|
8579
8503
|
.map(function (_d) {
|
|
@@ -8581,17 +8505,20 @@
|
|
|
8581
8505
|
return term;
|
|
8582
8506
|
});
|
|
8583
8507
|
this.selectedTerm = this.terms.includes(this.selectedTerm) ? this.selectedTerm : this.terms[0];
|
|
8584
|
-
return this.selectedTerm ? this.
|
|
8508
|
+
return this.selectedTerm ? this.updateChart() : null;
|
|
8585
8509
|
};
|
|
8586
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.
|
|
8510
|
+
ImpactAssessmentsIndicatorsChartComponent.prototype.updateChart = function () {
|
|
8511
|
+
var _this = this;
|
|
8587
8512
|
var _a, _b, _c;
|
|
8588
8513
|
var labels = [(_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''];
|
|
8589
8514
|
var values = this.indicatorPerImpactAssessment[this.selectedTerm['@id']].values;
|
|
8590
|
-
var datasets = this.impactAssessments
|
|
8591
|
-
|
|
8592
|
-
|
|
8515
|
+
var datasets = this.impactAssessments
|
|
8516
|
+
.map(function (impact, index) { return isSelected(_this.selected, impact) ? impactAssessmentDataset(values, impact, index) : null; })
|
|
8517
|
+
.filter(Boolean);
|
|
8518
|
+
if (this.chart) {
|
|
8519
|
+
this.chart.destroy();
|
|
8593
8520
|
}
|
|
8594
|
-
this.
|
|
8521
|
+
this.chart = new chart_js.Chart((_c = this.chartRef) === null || _c === void 0 ? void 0 : _c.nativeElement, {
|
|
8595
8522
|
type: 'bar',
|
|
8596
8523
|
data: {
|
|
8597
8524
|
labels: labels,
|
|
@@ -8617,47 +8544,10 @@
|
|
|
8617
8544
|
}
|
|
8618
8545
|
});
|
|
8619
8546
|
};
|
|
8620
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.updatePieChart = function () {
|
|
8621
|
-
var _a, _b, _c;
|
|
8622
|
-
var values = this.indicatorPerImpactAssessment[this.selectedTerm['@id']].values;
|
|
8623
|
-
var labels = this.impactAssessments.map(impactName);
|
|
8624
|
-
var colors = this.impactAssessments.map(listColor);
|
|
8625
|
-
var data = this.impactAssessments.map(function (impact) { return impactValue(impact, values); });
|
|
8626
|
-
var datasets = [{
|
|
8627
|
-
label: (_b = (_a = this.selectedTerm) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '',
|
|
8628
|
-
data: data,
|
|
8629
|
-
backgroundColor: colors,
|
|
8630
|
-
hoverOffset: 4
|
|
8631
|
-
}];
|
|
8632
|
-
if (this.pieChart) {
|
|
8633
|
-
this.pieChart.destroy();
|
|
8634
|
-
}
|
|
8635
|
-
this.pieChart = new chart_js.Chart((_c = this.pieChartRef) === null || _c === void 0 ? void 0 : _c.nativeElement, {
|
|
8636
|
-
type: 'pie',
|
|
8637
|
-
data: {
|
|
8638
|
-
labels: labels,
|
|
8639
|
-
datasets: datasets
|
|
8640
|
-
},
|
|
8641
|
-
options: {
|
|
8642
|
-
responsive: true,
|
|
8643
|
-
maintainAspectRatio: false,
|
|
8644
|
-
legend: {
|
|
8645
|
-
display: false
|
|
8646
|
-
},
|
|
8647
|
-
layout: {
|
|
8648
|
-
padding: 0
|
|
8649
|
-
}
|
|
8650
|
-
}
|
|
8651
|
-
});
|
|
8652
|
-
};
|
|
8653
|
-
ImpactAssessmentsIndicatorsChartComponent.prototype.updateCharts = function () {
|
|
8654
|
-
this.updateBarChart();
|
|
8655
|
-
this.updatePieChart();
|
|
8656
|
-
};
|
|
8657
8547
|
return ImpactAssessmentsIndicatorsChartComponent;
|
|
8658
8548
|
}());
|
|
8659
8549
|
ImpactAssessmentsIndicatorsChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8660
|
-
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵ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: "
|
|
8550
|
+
ImpactAssessmentsIndicatorsChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: { impactAssessments: "impactAssessments", selected: "selected", key: "key", filterTermTypes: "filterTermTypes" }, viewQueries: [{ propertyName: "chartRef", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, 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__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
8661
8551
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsIndicatorsChartComponent, decorators: [{
|
|
8662
8552
|
type: i0.Component,
|
|
8663
8553
|
args: [{
|
|
@@ -8665,14 +8555,13 @@
|
|
|
8665
8555
|
templateUrl: './impact-assessments-indicators-chart.component.html',
|
|
8666
8556
|
styleUrls: ['./impact-assessments-indicators-chart.component.scss']
|
|
8667
8557
|
}]
|
|
8668
|
-
}], propDecorators: {
|
|
8669
|
-
type: i0.ViewChild,
|
|
8670
|
-
args: ['barChart']
|
|
8671
|
-
}], pieChartRef: [{
|
|
8558
|
+
}], propDecorators: { chartRef: [{
|
|
8672
8559
|
type: i0.ViewChild,
|
|
8673
|
-
args: ['
|
|
8560
|
+
args: ['chart']
|
|
8674
8561
|
}], impactAssessments: [{
|
|
8675
8562
|
type: i0.Input
|
|
8563
|
+
}], selected: [{
|
|
8564
|
+
type: i0.Input
|
|
8676
8565
|
}], key: [{
|
|
8677
8566
|
type: i0.Input
|
|
8678
8567
|
}], filterTermTypes: [{
|
|
@@ -8730,10 +8619,17 @@
|
|
|
8730
8619
|
enumerable: false,
|
|
8731
8620
|
configurable: true
|
|
8732
8621
|
});
|
|
8622
|
+
Object.defineProperty(ImpactAssessmentsProductsLogsComponent.prototype, "filteredType", {
|
|
8623
|
+
get: function () {
|
|
8624
|
+
return this.filterTermTypes.map(termTypeLabel).join(' & ');
|
|
8625
|
+
},
|
|
8626
|
+
enumerable: false,
|
|
8627
|
+
configurable: true
|
|
8628
|
+
});
|
|
8733
8629
|
return ImpactAssessmentsProductsLogsComponent;
|
|
8734
8630
|
}());
|
|
8735
8631
|
ImpactAssessmentsProductsLogsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, deps: [{ token: HeSearchService }, { token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8736
|
-
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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=\"
|
|
8632
|
+
ImpactAssessmentsProductsLogsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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]=\"filteredType\"\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__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
8737
8633
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
8738
8634
|
type: i0.Component,
|
|
8739
8635
|
args: [{
|
|
@@ -8763,42 +8659,25 @@
|
|
|
8763
8659
|
View["logs"] = "logs";
|
|
8764
8660
|
})(View || (View = {}));
|
|
8765
8661
|
var ImpactAssessmentsProductsComponent = /** @class */ (function () {
|
|
8766
|
-
function ImpactAssessmentsProductsComponent(
|
|
8767
|
-
var _this = this;
|
|
8768
|
-
this.formBuilder = formBuilder;
|
|
8662
|
+
function ImpactAssessmentsProductsComponent(nodeService) {
|
|
8769
8663
|
this.nodeService = nodeService;
|
|
8770
|
-
this.searchService = searchService;
|
|
8771
|
-
this.toastService = toastService;
|
|
8772
8664
|
this.dataStateValues = {};
|
|
8773
8665
|
this.impactAssessments = [];
|
|
8666
|
+
this.selected = [];
|
|
8774
8667
|
this.key = 'impacts';
|
|
8775
|
-
this.enableCompare = true;
|
|
8776
8668
|
this.enableFilterMethodModel = false;
|
|
8669
|
+
this.loading = false;
|
|
8777
8670
|
this.propertyValue = propertyValue$1;
|
|
8778
|
-
this.itemColor = itemColor;
|
|
8779
8671
|
this.baseUrl = baseUrl();
|
|
8780
8672
|
this.showDownload = false;
|
|
8781
8673
|
this.View = View;
|
|
8782
8674
|
this.selectedView = View.table;
|
|
8783
8675
|
this.methodModels = [];
|
|
8784
8676
|
this.indicators = [];
|
|
8785
|
-
// Adding impacts to compare
|
|
8786
|
-
this.form = this.formBuilder.group({
|
|
8787
|
-
search: ['', i1$2.Validators.required]
|
|
8788
|
-
});
|
|
8789
|
-
this.selectedImpactAssessments = [];
|
|
8790
|
-
this.loading = false;
|
|
8791
|
-
this.suggesting = false;
|
|
8792
|
-
this.formatter = function (_b) {
|
|
8793
|
-
var id = _b["@id"];
|
|
8794
|
-
return id;
|
|
8795
|
-
};
|
|
8796
|
-
this.suggestImpactAssessment = function (text$) { return text$.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.tap(function () { return _this.suggesting = true; }), operators.switchMap(function (term) { return _this.suggest(term); }), operators.tap(function () { return _this.suggesting = false; })); };
|
|
8797
8677
|
}
|
|
8798
8678
|
ImpactAssessmentsProductsComponent.prototype.ngOnChanges = function (changes) {
|
|
8799
8679
|
if ('impactAssessments' in changes) {
|
|
8800
8680
|
this.dataStateValues[this.dataState] = changes.impactAssessments.currentValue.slice();
|
|
8801
|
-
this.selectAllImpacts();
|
|
8802
8681
|
return this.update();
|
|
8803
8682
|
}
|
|
8804
8683
|
if ('dataState' in changes) {
|
|
@@ -8900,6 +8779,9 @@
|
|
|
8900
8779
|
enumerable: false,
|
|
8901
8780
|
configurable: true
|
|
8902
8781
|
});
|
|
8782
|
+
ImpactAssessmentsProductsComponent.prototype.isSelected = function (impact) {
|
|
8783
|
+
return this.selected.length === 0 || this.selected.includes(impact['@id']);
|
|
8784
|
+
};
|
|
8903
8785
|
// Recalculation logs
|
|
8904
8786
|
ImpactAssessmentsProductsComponent.prototype.showRecalculationLogs = function () {
|
|
8905
8787
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -8919,122 +8801,10 @@
|
|
|
8919
8801
|
});
|
|
8920
8802
|
});
|
|
8921
8803
|
};
|
|
8922
|
-
// Compare
|
|
8923
|
-
ImpactAssessmentsProductsComponent.prototype.selectAllImpacts = function () {
|
|
8924
|
-
this.selectedImpactAssessments = this.impactAssessments.slice();
|
|
8925
|
-
};
|
|
8926
|
-
ImpactAssessmentsProductsComponent.prototype.unselectAllImpacts = function () {
|
|
8927
|
-
this.selectedImpactAssessments = [];
|
|
8928
|
-
};
|
|
8929
|
-
ImpactAssessmentsProductsComponent.prototype.toggleAllImpacts = function () {
|
|
8930
|
-
return this.selectedImpactAssessments.length ? this.selectAllImpacts() : this.unselectAllImpacts();
|
|
8931
|
-
};
|
|
8932
|
-
ImpactAssessmentsProductsComponent.prototype.selectImpact = function (impact) {
|
|
8933
|
-
this.selectedImpactAssessments = __spreadArray(__spreadArray([], __read(this.selectedImpactAssessments)), [
|
|
8934
|
-
impact
|
|
8935
|
-
]);
|
|
8936
|
-
};
|
|
8937
|
-
ImpactAssessmentsProductsComponent.prototype.unselectImpact = function (index) {
|
|
8938
|
-
this.selectedImpactAssessments.splice(index, 1);
|
|
8939
|
-
this.selectedImpactAssessments = this.selectedImpactAssessments.slice();
|
|
8940
|
-
};
|
|
8941
|
-
ImpactAssessmentsProductsComponent.prototype.toggleImpact = function (impact) {
|
|
8942
|
-
var index = this.selectedImpactAssessments.indexOf(impact);
|
|
8943
|
-
return index >= 0 ? this.unselectImpact(index) : this.selectImpact(impact);
|
|
8944
|
-
};
|
|
8945
|
-
ImpactAssessmentsProductsComponent.prototype.isSelected = function (impact) {
|
|
8946
|
-
return this.selectedImpactAssessments.includes(impact);
|
|
8947
|
-
};
|
|
8948
|
-
ImpactAssessmentsProductsComponent.prototype.suggest = function (term) {
|
|
8949
|
-
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
8950
|
-
rxjs.of([]) :
|
|
8951
|
-
this.searchService.suggest(term, schema.NodeType.ImpactAssessment, [], {
|
|
8952
|
-
bool: {
|
|
8953
|
-
must: [
|
|
8954
|
-
matchType(schema.NodeType.ImpactAssessment),
|
|
8955
|
-
matchAggregatedQuery
|
|
8956
|
-
],
|
|
8957
|
-
must_not: this.impactAssessments.map(function (_b) {
|
|
8958
|
-
var id = _b["@id"];
|
|
8959
|
-
return matchExactQuery('@id', id);
|
|
8960
|
-
}),
|
|
8961
|
-
should: [
|
|
8962
|
-
matchPhraseQuery(term, 100, '@id', 'name', 'cycle.name'),
|
|
8963
|
-
matchPhrasePrefixQuery(term, 20, '@id', 'name', 'cycle.name'),
|
|
8964
|
-
matchBoolPrefixQuery(term, 10, '@id', 'name', 'cycle.name')
|
|
8965
|
-
],
|
|
8966
|
-
minimum_should_match: 1
|
|
8967
|
-
}
|
|
8968
|
-
}, 10, ['cycle.name', 'country.name', 'product.name', 'endDate']);
|
|
8969
|
-
};
|
|
8970
|
-
ImpactAssessmentsProductsComponent.prototype.loadImpact = function (id) {
|
|
8971
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
8972
|
-
var impact, _b, _c, _d, _e, _f;
|
|
8973
|
-
return __generator(this, function (_g) {
|
|
8974
|
-
switch (_g.label) {
|
|
8975
|
-
case 0: return [4 /*yield*/, this.nodeService.get({
|
|
8976
|
-
'@type': schema.NodeType.ImpactAssessment,
|
|
8977
|
-
'@id': id,
|
|
8978
|
-
dataState: api.DataState.recalculated
|
|
8979
|
-
}, false)];
|
|
8980
|
-
case 1:
|
|
8981
|
-
impact = _g.sent();
|
|
8982
|
-
if (!impact['@id']) return [3 /*break*/, 3];
|
|
8983
|
-
_d = (_c = Object).assign;
|
|
8984
|
-
_e = [Object.assign({}, impact)];
|
|
8985
|
-
_f = {};
|
|
8986
|
-
return [4 /*yield*/, this.fetchCycle(impact)];
|
|
8987
|
-
case 2:
|
|
8988
|
-
_b = _d.apply(_c, _e.concat([(_f.cycle = _g.sent(), _f)]));
|
|
8989
|
-
return [3 /*break*/, 4];
|
|
8990
|
-
case 3:
|
|
8991
|
-
_b = null;
|
|
8992
|
-
_g.label = 4;
|
|
8993
|
-
case 4: return [2 /*return*/, _b];
|
|
8994
|
-
}
|
|
8995
|
-
});
|
|
8996
|
-
});
|
|
8997
|
-
};
|
|
8998
|
-
ImpactAssessmentsProductsComponent.prototype.fetchCycle = function (_b) {
|
|
8999
|
-
var cycle = _b.cycle;
|
|
9000
|
-
return !cycle || cycle.name ? cycle : this.nodeService.get({
|
|
9001
|
-
'@type': schema.NodeType.Cycle,
|
|
9002
|
-
'@id': cycle['@id']
|
|
9003
|
-
});
|
|
9004
|
-
};
|
|
9005
|
-
ImpactAssessmentsProductsComponent.prototype.addImpact = function () {
|
|
9006
|
-
var _a;
|
|
9007
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
9008
|
-
var _b, id, name, impact;
|
|
9009
|
-
return __generator(this, function (_c) {
|
|
9010
|
-
switch (_c.label) {
|
|
9011
|
-
case 0:
|
|
9012
|
-
this.loading = true;
|
|
9013
|
-
_b = this.form.value.search, id = _b["@id"], name = _b.name;
|
|
9014
|
-
return [4 /*yield*/, this.loadImpact(id)];
|
|
9015
|
-
case 1:
|
|
9016
|
-
impact = _c.sent();
|
|
9017
|
-
if (impact) {
|
|
9018
|
-
this.impactAssessments = __spreadArray(__spreadArray([], __read(this.impactAssessments)), [
|
|
9019
|
-
impact
|
|
9020
|
-
]);
|
|
9021
|
-
this.selectImpact(impact);
|
|
9022
|
-
}
|
|
9023
|
-
else {
|
|
9024
|
-
this.toastService.error("Error while loading " + (name || id));
|
|
9025
|
-
}
|
|
9026
|
-
this.loading = false;
|
|
9027
|
-
(_a = this.form.get('search')) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
9028
|
-
this.form.updateValueAndValidity();
|
|
9029
|
-
return [2 /*return*/, this.update()];
|
|
9030
|
-
}
|
|
9031
|
-
});
|
|
9032
|
-
});
|
|
9033
|
-
};
|
|
9034
8804
|
return ImpactAssessmentsProductsComponent;
|
|
9035
8805
|
}());
|
|
9036
|
-
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token:
|
|
9037
|
-
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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, indicator.value.term['@id']) | 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' : undefined\"\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__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { 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__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace$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__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
8806
|
+
ImpactAssessmentsProductsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, deps: [{ token: HeNodeService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8807
|
+
ImpactAssessmentsProductsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ImpactAssessmentsProductsComponent, selector: "he-impact-assessments-products", inputs: { cycles: "cycles", impactAssessments: "impactAssessments", selected: "selected", key: "key", dataState: "dataState", filterTermTypes: "filterTermTypes", enableFilterMethodModel: "enableFilterMethodModel" }, usesOnChanges: true, ngImport: i0__namespace, 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\">\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 <ng-container *ngFor=\"let impactAssessment of impactAssessments; trackBy: trackById; let i = index\">\n <tr *ngIf=\"isSelected(impactAssessment)\">\n <td class=\"width-auto\" [attr.title]=\"impactName(impactAssessment)\">\n <he-node-link [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, indicator.value.term['@id']) | 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' : undefined\"\n ></he-blank-node-state>\n </span>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n\n <he-blank-node-state-notice [dataState]=\"dataState\"></he-blank-node-state-notice>\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]=\"impactAssessments\" [selected]=\"selected\"\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: ["fa-icon{display:inline-block;width:10px}\n"], components: [{ type: i1__namespace.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", "showAggregated", "showDeleted", "showUnchanged"] }, { type: ImpactAssessmentsIndicatorBreakdownChartComponent, selector: "he-impact-assessments-indicator-breakdown-chart", inputs: ["impactAssessment", "indicators"] }, { type: ImpactAssessmentsIndicatorsChartComponent, selector: "he-impact-assessments-indicators-chart", inputs: ["impactAssessments", "selected", "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__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }], pipes: { "ellipsis": EllipsisPipe, "default": DefaultPipe, "precision": PrecisionPipe } });
|
|
9038
8808
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsComponent, decorators: [{
|
|
9039
8809
|
type: i0.Component,
|
|
9040
8810
|
args: [{
|
|
@@ -9042,16 +8812,16 @@
|
|
|
9042
8812
|
templateUrl: './impact-assessments-products.component.html',
|
|
9043
8813
|
styleUrls: ['./impact-assessments-products.component.scss']
|
|
9044
8814
|
}]
|
|
9045
|
-
}], ctorParameters: function () { return [{ type:
|
|
8815
|
+
}], ctorParameters: function () { return [{ type: HeNodeService }]; }, propDecorators: { cycles: [{
|
|
9046
8816
|
type: i0.Input
|
|
9047
8817
|
}], impactAssessments: [{
|
|
9048
8818
|
type: i0.Input
|
|
8819
|
+
}], selected: [{
|
|
8820
|
+
type: i0.Input
|
|
9049
8821
|
}], key: [{
|
|
9050
8822
|
type: i0.Input
|
|
9051
8823
|
}], dataState: [{
|
|
9052
8824
|
type: i0.Input
|
|
9053
|
-
}], enableCompare: [{
|
|
9054
|
-
type: i0.Input
|
|
9055
8825
|
}], filterTermTypes: [{
|
|
9056
8826
|
type: i0.Input
|
|
9057
8827
|
}], enableFilterMethodModel: [{
|
|
@@ -9160,7 +8930,6 @@
|
|
|
9160
8930
|
exports.CyclesPracticesComponent = CyclesPracticesComponent;
|
|
9161
8931
|
exports.CyclesPracticesLogsComponent = CyclesPracticesLogsComponent;
|
|
9162
8932
|
exports.CyclesResultComponent = CyclesResultComponent;
|
|
9163
|
-
exports.CyclesSuggestFormComponent = CyclesSuggestFormComponent;
|
|
9164
8933
|
exports.DefaultPipe = DefaultPipe;
|
|
9165
8934
|
exports.EllipsisPipe = EllipsisPipe;
|
|
9166
8935
|
exports.FilesFormComponent = FilesFormComponent;
|