@hestia-earth/ui-components 0.0.21 → 0.0.24
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 +149 -156
- package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
- package/common/blank-node-value-delta/blank-node-value-delta.component.d.ts +1 -1
- package/common/delta-utils.d.ts +0 -14
- package/common/utils.d.ts +0 -4
- package/engine/engine.service.d.ts +10 -1
- package/esm2015/common/blank-node-value-delta/blank-node-value-delta.component.js +4 -3
- package/esm2015/common/delta-utils.js +1 -41
- package/esm2015/common/utils.js +2 -23
- package/esm2015/cycles/cycles-activity/cycles-activity.component.js +3 -2
- package/esm2015/cycles/cycles-completeness/cycles-completeness.component.js +4 -3
- package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +3 -2
- package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +3 -2
- package/esm2015/cycles/cycles-practices/cycles-practices.component.js +3 -2
- package/esm2015/cycles/cycles-result/cycles-result.component.js +3 -2
- package/esm2015/engine/engine.service.js +18 -3
- package/esm2015/files/files-error.model.js +8 -5
- package/esm2015/files/files-form/files-form.component.js +33 -6
- package/esm2015/files/files-form.model.js +1 -8
- package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +3 -3
- 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 +14 -5
- package/esm2015/sites/sites.model.js +2 -2
- package/esm2015/terms/terms.model.js +2 -2
- package/fesm2015/hestia-earth-ui-components.js +84 -90
- package/fesm2015/hestia-earth-ui-components.js.map +1 -1
- package/files/files-form/files-form.component.d.ts +13 -1
- package/files/files-form.model.d.ts +0 -14
- 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 +6 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@ng-bootstrap/ng-bootstrap'), require('@angular/google-maps'), require('@fortawesome/angular-fontawesome'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-solid-svg-icons'), require('@angular/platform-browser'), require('rxjs'), require('random-material-color'), require('@hestia-earth/schema'), require('@hestia-earth/api'), require('@hestia-earth/utils'), require('@hestia-earth/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@hestia-earth/ui-components', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@ng-bootstrap/ng-bootstrap', '@angular/google-maps', '@fortawesome/angular-fontawesome', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-solid-svg-icons', '@angular/platform-browser', 'rxjs', 'random-material-color', '@hestia-earth/schema', '@hestia-earth/api', '@hestia-earth/utils', '@hestia-earth/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["hestia-earth"] = global["hestia-earth"] || {}, global["hestia-earth"]["ui-components"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.i10, global.ng.googleMaps, global.i1, global.freeRegularSvgIcons, global.freeSolidSvgIcons, global.ng.platformBrowser, global.rxjs, global.randomMaterialColor, global.schema, global.api, global.
|
|
5
|
-
})(this, (function (exports, i0, i6, i1$2, i5, i10, i1$4, i1, freeRegularSvgIcons, freeSolidSvgIcons, i1$1, rxjs, randomMaterialColor, schema, api,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@ng-bootstrap/ng-bootstrap'), require('@angular/google-maps'), require('@fortawesome/angular-fontawesome'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-solid-svg-icons'), require('@angular/platform-browser'), require('rxjs'), require('random-material-color'), require('@hestia-earth/schema'), require('@hestia-earth/api'), require('@hestia-earth/utils/dist/term'), require('@hestia-earth/utils'), require('pluralize'), require('rxjs/operators'), require('csvtojson'), require('@angular/common/http'), require('@hestia-earth/utils/dist/delta'), require('json-2-csv'), require('@angular/cdk/drag-drop'), require('@hestia-earth/schema-convert'), require('@hestia-earth/json-schema/schema-utils'), require('jsondiffpatch'), require('chart.js'), require('moment'), require('moment/locale/en-gb'), require('uuid'), require('@google/markerclustererplus'), require('chartjs-plugin-datalabels')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@hestia-earth/ui-components', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/router', '@ng-bootstrap/ng-bootstrap', '@angular/google-maps', '@fortawesome/angular-fontawesome', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-solid-svg-icons', '@angular/platform-browser', 'rxjs', 'random-material-color', '@hestia-earth/schema', '@hestia-earth/api', '@hestia-earth/utils/dist/term', '@hestia-earth/utils', 'pluralize', 'rxjs/operators', 'csvtojson', '@angular/common/http', '@hestia-earth/utils/dist/delta', 'json-2-csv', '@angular/cdk/drag-drop', '@hestia-earth/schema-convert', '@hestia-earth/json-schema/schema-utils', 'jsondiffpatch', 'chart.js', 'moment', 'moment/locale/en-gb', 'uuid', '@google/markerclustererplus', 'chartjs-plugin-datalabels'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["hestia-earth"] = global["hestia-earth"] || {}, global["hestia-earth"]["ui-components"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.router, global.i10, global.ng.googleMaps, global.i1, global.freeRegularSvgIcons, global.freeSolidSvgIcons, global.ng.platformBrowser, global.rxjs, global.randomMaterialColor, global.schema, global.api, global.term, global.utils, global.pluralize, global.rxjs.operators, global.csvtojson, global.ng.common.http, global.delta, global.json2Csv, global.ng.cdk.dragDrop, global.schemaConvert, global.schemaUtils, global.jsondiffpatch, global.chart_js, global.moment, null, global.uuid$1, global.MarkerClusterer, global.ChartDataLabels));
|
|
5
|
+
})(this, (function (exports, i0, i6, i1$2, i5, i10, i1$4, i1, freeRegularSvgIcons, freeSolidSvgIcons, i1$1, rxjs, randomMaterialColor, schema, api, term, utils, pluralize, operators, csvtojson, i1$3, delta, json2Csv, i6$1, schemaConvert, schemaUtils, jsondiffpatch, chart_js, moment, enGb, uuid$1, MarkerClusterer, ChartDataLabels) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
}]
|
|
572
572
|
}] });
|
|
573
573
|
|
|
574
|
-
var _c$
|
|
574
|
+
var _c$2;
|
|
575
575
|
var get$5 = require('lodash.get');
|
|
576
576
|
var gitHome = 'https://gitlab.com/hestia-earth';
|
|
577
577
|
var gitRawBaseUrl = 'https://glcdn.githack.com/hestia-earth';
|
|
@@ -636,11 +636,6 @@
|
|
|
636
636
|
};
|
|
637
637
|
var safeJSONStringify = function (value) { return typeof value === 'string' ? value : JSON.stringify(value); };
|
|
638
638
|
var arrayValue = function (values, isAverage) { return (values || []).reduce(function (prev, curr) { return prev + parseFloat("" + curr); }, 0) / (isAverage ? values.length : 1); };
|
|
639
|
-
var propertyValue$1 = function (value, termId) { return typeof value === 'undefined' || value === null ?
|
|
640
|
-
null :
|
|
641
|
-
(Array.isArray(value) ?
|
|
642
|
-
arrayValue(value, (termId ? glossary.getArrayTreatment(termId) : null) === 'mean') :
|
|
643
|
-
parseFloat("" + value)); };
|
|
644
639
|
;
|
|
645
640
|
;
|
|
646
641
|
var grouppedKeys = function (values) { return Object.entries(values).map(function (_c) {
|
|
@@ -696,7 +691,7 @@
|
|
|
696
691
|
var originalValue = get$5(originalValues, "[" + index + "]." + key, []).filter(function (val) { return val.term['@id'] === termId; });
|
|
697
692
|
if (originalValue.length > 0) {
|
|
698
693
|
var value = originalValue.reduce(function (array, curr) { return concatBlankNodeValue(array, curr.value); }, []);
|
|
699
|
-
group.originalValues[nodeId] = { value: propertyValue
|
|
694
|
+
group.originalValues[nodeId] = { value: term.propertyValue(value, termId) };
|
|
700
695
|
}
|
|
701
696
|
});
|
|
702
697
|
});
|
|
@@ -711,22 +706,8 @@
|
|
|
711
706
|
var mapsUrl = function (location) { return location ? (location.lat && location.lng ?
|
|
712
707
|
"" + mapsQuery + location.lat + "," + location.lng :
|
|
713
708
|
(location.name ? "" + mapsQuery + encodeURI(location.name) : undefined)) : undefined; };
|
|
714
|
-
var
|
|
715
|
-
.
|
|
716
|
-
.substring(1); };
|
|
717
|
-
var toDashCase = function (value) { return value ?
|
|
718
|
-
value
|
|
719
|
-
// handle dates followed by capital letter
|
|
720
|
-
.replace(/([\d]{4})([A-Z]{1})/g, function (g) { return g.substring(0, 4) + "-" + g[4].toLowerCase(); })
|
|
721
|
-
// handle molecules
|
|
722
|
-
.replace(/([\d]{1}[A-Z]{1})/g, function (g) { return g.toLowerCase(); })
|
|
723
|
-
// handle all capital letters
|
|
724
|
-
.replace(/([A-Z])/g, function (g) { return "-" + g[0].toLowerCase(); })
|
|
725
|
-
// handle years
|
|
726
|
-
.replace(/([0-9]{4})/g, function (g) { return "-" + g; }) :
|
|
727
|
-
null; };
|
|
728
|
-
var nodeDefaultLabel = (_c$3 = {},
|
|
729
|
-
_c$3[schema.NodeType.ImpactAssessment] = function (_c) {
|
|
709
|
+
var nodeDefaultLabel = (_c$2 = {},
|
|
710
|
+
_c$2[schema.NodeType.ImpactAssessment] = function (_c) {
|
|
730
711
|
var name = _c.name, country = _c.country, endDate = _c.endDate, product = _c.product;
|
|
731
712
|
return name ? name.replace((product === null || product === void 0 ? void 0 : product.name) + ", ", '') : [
|
|
732
713
|
product === null || product === void 0 ? void 0 : product.name,
|
|
@@ -734,15 +715,14 @@
|
|
|
734
715
|
endDate
|
|
735
716
|
].filter(Boolean).join(', ');
|
|
736
717
|
},
|
|
737
|
-
_c$
|
|
718
|
+
_c$2[schema.NodeType.Site] = function (_c) {
|
|
738
719
|
var name = _c.name, description = _c.description;
|
|
739
720
|
return name || description;
|
|
740
721
|
},
|
|
741
|
-
_c$
|
|
722
|
+
_c$2);
|
|
742
723
|
var defaultLabel = function (node) { return node ? (node['@type'] in nodeDefaultLabel ? nodeDefaultLabel[node['@type']](node) : node.name) || node['@id'] || node.id : ''; };
|
|
743
724
|
var itemColor = function (index) { return randomMaterialColor.getColor({ text: "" + index }); };
|
|
744
725
|
var listColor = function (_v, index) { return itemColor(index); };
|
|
745
|
-
var emptyValue = function (value) { return utils.isEmpty(value) || isNaN(propertyValue$1(value)); };
|
|
746
726
|
var repeat = function (times) {
|
|
747
727
|
if (times === void 0) { times = 0; }
|
|
748
728
|
return (Array.from(Array(times), Math.random));
|
|
@@ -771,7 +751,7 @@
|
|
|
771
751
|
}]
|
|
772
752
|
}] });
|
|
773
753
|
|
|
774
|
-
var _a$
|
|
754
|
+
var _a$4, _b$1, _c$1;
|
|
775
755
|
var termProperties = function (term) { return Object.keys(term).filter(function (key) { return !schema.isExpandable(term[key]) && ![
|
|
776
756
|
'pinned', 'expanded', 'extended', 'selected', 'loading',
|
|
777
757
|
'_score', '@type', '@id', '@context', 'createdAt',
|
|
@@ -797,20 +777,20 @@
|
|
|
797
777
|
lng: longitude
|
|
798
778
|
});
|
|
799
779
|
};
|
|
800
|
-
var termTypeToLabel = (_a$
|
|
801
|
-
_a$
|
|
802
|
-
_a$
|
|
803
|
-
_a$
|
|
804
|
-
_a$
|
|
805
|
-
_a$
|
|
806
|
-
_a$
|
|
780
|
+
var termTypeToLabel = (_a$4 = {},
|
|
781
|
+
_a$4[schema.TermTermType.methodEmissionResourceUse] = 'Method (Emissions)',
|
|
782
|
+
_a$4[schema.TermTermType.methodMeasurement] = 'Method (Measurement)',
|
|
783
|
+
_a$4[schema.TermTermType.pesticideAI] = 'Pesticide Active Ingredient',
|
|
784
|
+
_a$4[schema.TermTermType.standardsLabels] = 'Standards & Labels',
|
|
785
|
+
_a$4[schema.TermTermType.usdaSoilType] = 'USDA Soil Type',
|
|
786
|
+
_a$4);
|
|
807
787
|
var termTypeLabel = function (type) {
|
|
808
788
|
if (type === void 0) { type = 'N/A'; }
|
|
809
|
-
return type in termTypeToLabel ? termTypeToLabel[type] : keyToLabel(type);
|
|
789
|
+
return type in termTypeToLabel ? termTypeToLabel[type] : utils.keyToLabel(type);
|
|
810
790
|
};
|
|
811
791
|
var termTypesToChildren = function (termTypes) { return termTypes.map(function (termType) { return ({ label: termTypeLabel(termType), termType: termType }); }); };
|
|
812
|
-
var groups = Object.freeze((_b$
|
|
813
|
-
_b$
|
|
792
|
+
var groups = Object.freeze((_b$1 = {},
|
|
793
|
+
_b$1[schema.TermTermType.emission] = {
|
|
814
794
|
label: 'Emissions & Resource Use',
|
|
815
795
|
termType: 'Emissions & Resource Use',
|
|
816
796
|
children: termTypesToChildren([
|
|
@@ -822,12 +802,12 @@
|
|
|
822
802
|
schema.TermTermType.methodEmissionResourceUse
|
|
823
803
|
])
|
|
824
804
|
},
|
|
825
|
-
_b$
|
|
805
|
+
_b$1[schema.TermTermType.region] = {
|
|
826
806
|
label: termTypeLabel(schema.TermTermType.region),
|
|
827
807
|
termType: schema.TermTermType.region,
|
|
828
808
|
children: []
|
|
829
809
|
},
|
|
830
|
-
_b$
|
|
810
|
+
_b$1.infrastructure = {
|
|
831
811
|
label: 'Infrastructure & Equipment',
|
|
832
812
|
termType: 'Infrastructure & Equipment',
|
|
833
813
|
children: termTypesToChildren([
|
|
@@ -838,7 +818,7 @@
|
|
|
838
818
|
schema.TermTermType.machinery
|
|
839
819
|
])
|
|
840
820
|
},
|
|
841
|
-
_b$
|
|
821
|
+
_b$1.input = {
|
|
842
822
|
label: 'Inputs',
|
|
843
823
|
termType: 'Inputs',
|
|
844
824
|
children: termTypesToChildren([
|
|
@@ -856,7 +836,7 @@
|
|
|
856
836
|
schema.TermTermType.water
|
|
857
837
|
])
|
|
858
838
|
},
|
|
859
|
-
_b$
|
|
839
|
+
_b$1[schema.TermTermType.measurement] = {
|
|
860
840
|
label: 'Measurements',
|
|
861
841
|
termType: 'Measurements',
|
|
862
842
|
children: termTypesToChildren([
|
|
@@ -867,7 +847,7 @@
|
|
|
867
847
|
schema.TermTermType.methodMeasurement
|
|
868
848
|
])
|
|
869
849
|
},
|
|
870
|
-
_b$
|
|
850
|
+
_b$1.practice = {
|
|
871
851
|
label: 'Practices',
|
|
872
852
|
termType: 'Production Practices',
|
|
873
853
|
children: termTypesToChildren([
|
|
@@ -885,7 +865,7 @@
|
|
|
885
865
|
schema.TermTermType.waterRegime,
|
|
886
866
|
])
|
|
887
867
|
},
|
|
888
|
-
_b$
|
|
868
|
+
_b$1.product = {
|
|
889
869
|
label: 'Products',
|
|
890
870
|
termType: 'Products',
|
|
891
871
|
children: termTypesToChildren([
|
|
@@ -898,12 +878,12 @@
|
|
|
898
878
|
schema.TermTermType.processedFood
|
|
899
879
|
])
|
|
900
880
|
},
|
|
901
|
-
_b$
|
|
881
|
+
_b$1[schema.TermTermType.property] = {
|
|
902
882
|
label: termTypeLabel(schema.TermTermType.property),
|
|
903
883
|
termType: schema.TermTermType.property,
|
|
904
884
|
children: []
|
|
905
885
|
},
|
|
906
|
-
_b$
|
|
886
|
+
_b$1));
|
|
907
887
|
var termTypeGroups = [
|
|
908
888
|
groups.property,
|
|
909
889
|
groups.region,
|
|
@@ -914,10 +894,10 @@
|
|
|
914
894
|
groups.measurement,
|
|
915
895
|
groups.infrastructure
|
|
916
896
|
];
|
|
917
|
-
var termToParent = (_c$
|
|
918
|
-
_c$
|
|
919
|
-
_c$
|
|
920
|
-
_c$
|
|
897
|
+
var termToParent = (_c$1 = {},
|
|
898
|
+
_c$1[schema.TermTermType.property] = 'Properties',
|
|
899
|
+
_c$1[schema.TermTermType.region] = 'Geographies',
|
|
900
|
+
_c$1);
|
|
921
901
|
var termChildToParent = function (termType) { return termTypeGroups.find(function (_a) {
|
|
922
902
|
var children = _a.children;
|
|
923
903
|
return (children || []).some(function (child) { return child.termType === termType; });
|
|
@@ -1371,20 +1351,35 @@
|
|
|
1371
1351
|
var HE_ORCHESTRATOR_BASE_URL = new i0.InjectionToken('HE_ORCHESTRATOR_BASE_URL');
|
|
1372
1352
|
var gitUrl = function () { return gitHome + "/hestia-engine-models/-/blob/" + gitBranch(); };
|
|
1373
1353
|
var rawUrl = function () { return gitRawBaseUrl + "/hestia-engine-models/-/raw/" + gitBranch(); };
|
|
1374
|
-
var
|
|
1375
|
-
var
|
|
1376
|
-
return
|
|
1354
|
+
var findModels = function (models, termId) { return models.filter(function (_b) {
|
|
1355
|
+
var term = _b.term;
|
|
1356
|
+
return term === termId;
|
|
1357
|
+
}); };
|
|
1358
|
+
/**
|
|
1359
|
+
* Find models from the orchestrator configuration.
|
|
1360
|
+
*
|
|
1361
|
+
* @param config The orchestrator configuration content.
|
|
1362
|
+
* @param termId The `@id` of the Term.
|
|
1363
|
+
* @param model The `@id` of the model.
|
|
1364
|
+
* @param models Optional - list of models from `model-links.json` to default when orchestrator does not contain config.
|
|
1365
|
+
* @returns List of models from orchestrator or models if set.
|
|
1366
|
+
*/
|
|
1367
|
+
var findConfigModels = function (config, termId, model, models) {
|
|
1368
|
+
if (models === void 0) { models = []; }
|
|
1369
|
+
var configModels = config.models.flat()
|
|
1370
|
+
.filter(function (_b) {
|
|
1377
1371
|
var value = _b.value, key = _b.key;
|
|
1378
|
-
return
|
|
1372
|
+
return termId === value && (!model || key === model);
|
|
1379
1373
|
});
|
|
1374
|
+
return configModels.length ? configModels : findModels(models, termId);
|
|
1380
1375
|
};
|
|
1381
1376
|
var pathToApiDocsPath = function (model, term) { return [
|
|
1382
1377
|
baseUrl(),
|
|
1383
1378
|
'docs',
|
|
1384
1379
|
[
|
|
1385
1380
|
'#hestia-calculation-models',
|
|
1386
|
-
toDashCase(model),
|
|
1387
|
-
toDashCase(term)
|
|
1381
|
+
utils.toDashCase(model),
|
|
1382
|
+
utils.toDashCase(term)
|
|
1388
1383
|
].filter(Boolean).join('-')
|
|
1389
1384
|
].join('/'); };
|
|
1390
1385
|
var HeEngineService = /** @class */ (function () {
|
|
@@ -1609,7 +1604,6 @@
|
|
|
1609
1604
|
type: i0.Input
|
|
1610
1605
|
}] } });
|
|
1611
1606
|
|
|
1612
|
-
var _a$4, _b$1, _c$1, _d$3;
|
|
1613
1607
|
var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
|
|
1614
1608
|
var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
|
|
1615
1609
|
exports.DeltaColour = void 0;
|
|
@@ -1618,46 +1612,6 @@
|
|
|
1618
1612
|
DeltaColour["Warning"] = "warning";
|
|
1619
1613
|
DeltaColour["Danger"] = "danger";
|
|
1620
1614
|
})(exports.DeltaColour || (exports.DeltaColour = {}));
|
|
1621
|
-
exports.DeltaDisplayType = void 0;
|
|
1622
|
-
(function (DeltaDisplayType) {
|
|
1623
|
-
DeltaDisplayType["absolute"] = "absolute";
|
|
1624
|
-
DeltaDisplayType["percent"] = "percent";
|
|
1625
|
-
})(exports.DeltaDisplayType || (exports.DeltaDisplayType = {}));
|
|
1626
|
-
var deltaPerType = (_a$4 = {},
|
|
1627
|
-
_a$4[exports.DeltaDisplayType.absolute] = function (value, original) { return value - original; },
|
|
1628
|
-
_a$4[exports.DeltaDisplayType.percent] = function (value, original) { return ((value - original) / original) * 100; },
|
|
1629
|
-
_a$4);
|
|
1630
|
-
var roundValue = function (value) { return +("" + value).substring(0, 10); };
|
|
1631
|
-
var delta = function (value, originalValue, displayType, mapping) {
|
|
1632
|
-
if (displayType === void 0) { displayType = exports.DeltaDisplayType.percent; }
|
|
1633
|
-
var vvalue = roundValue(propertyValue$1(value));
|
|
1634
|
-
var voriginalValue = roundValue(propertyValue$1(originalValue));
|
|
1635
|
-
var deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
|
|
1636
|
-
var diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
|
|
1637
|
-
return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
|
|
1638
|
-
};
|
|
1639
|
-
var PercentDeltaConditions;
|
|
1640
|
-
(function (PercentDeltaConditions) {
|
|
1641
|
-
PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
|
|
1642
|
-
PercentDeltaConditions["original0"] = "original is 0";
|
|
1643
|
-
})(PercentDeltaConditions || (PercentDeltaConditions = {}));
|
|
1644
|
-
var calculatePercentDeltaConditions = (_b$1 = {},
|
|
1645
|
-
_b$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return original > 0 && recalculated === 0; },
|
|
1646
|
-
_b$1[PercentDeltaConditions.original0] = function (original, recalculated) { return original === 0 && recalculated > 0; },
|
|
1647
|
-
_b$1);
|
|
1648
|
-
var calculatePercentDeltaResult = (_c$1 = {},
|
|
1649
|
-
_c$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return (recalculated - original) / (original + 1); },
|
|
1650
|
-
// Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
1651
|
-
_c$1[PercentDeltaConditions.original0] = function (original, recalculated) { return Math.sign(recalculated - original); },
|
|
1652
|
-
_c$1.default = function (original, recalculated) { return (recalculated - original) / original; },
|
|
1653
|
-
_c$1);
|
|
1654
|
-
var calculatePercentDelta = function (recalculated, original) {
|
|
1655
|
-
var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
|
|
1656
|
-
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
1657
|
-
};
|
|
1658
|
-
var customDeltaFuncs = (_d$3 = {},
|
|
1659
|
-
_d$3[exports.DeltaDisplayType.percent] = calculatePercentDelta,
|
|
1660
|
-
_d$3);
|
|
1661
1615
|
var evaluateSuccess = function (deltaValue) { return Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
1662
1616
|
? exports.DeltaColour.Success
|
|
1663
1617
|
: Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
@@ -1666,26 +1620,26 @@
|
|
|
1666
1620
|
|
|
1667
1621
|
var BlankNodeValueDeltaComponent = /** @class */ (function () {
|
|
1668
1622
|
function BlankNodeValueDeltaComponent() {
|
|
1669
|
-
this.displayType =
|
|
1670
|
-
this.DeltaDisplayType =
|
|
1623
|
+
this.displayType = delta.DeltaDisplayType.percent;
|
|
1624
|
+
this.DeltaDisplayType = delta.DeltaDisplayType;
|
|
1671
1625
|
}
|
|
1672
1626
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "hide", {
|
|
1673
1627
|
get: function () {
|
|
1674
|
-
return emptyValue(this.value) || emptyValue(this.originalValue);
|
|
1628
|
+
return term.emptyValue(this.value) || term.emptyValue(this.originalValue);
|
|
1675
1629
|
},
|
|
1676
1630
|
enumerable: false,
|
|
1677
1631
|
configurable: true
|
|
1678
1632
|
});
|
|
1679
1633
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "delta", {
|
|
1680
1634
|
get: function () {
|
|
1681
|
-
return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
|
|
1635
|
+
return delta.delta(this.value, this.originalValue, this.displayType, delta.customDeltaFuncs);
|
|
1682
1636
|
},
|
|
1683
1637
|
enumerable: false,
|
|
1684
1638
|
configurable: true
|
|
1685
1639
|
});
|
|
1686
1640
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "color", {
|
|
1687
1641
|
get: function () {
|
|
1688
|
-
return this.displayType ===
|
|
1642
|
+
return this.displayType === delta.DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
|
|
1689
1643
|
},
|
|
1690
1644
|
enumerable: false,
|
|
1691
1645
|
configurable: true
|
|
@@ -4825,15 +4779,17 @@
|
|
|
4825
4779
|
this.csv = '';
|
|
4826
4780
|
this.includeDefaultCSV = false;
|
|
4827
4781
|
this.headersChanged = new i0.EventEmitter();
|
|
4782
|
+
this.loading = true;
|
|
4828
4783
|
this.headers = {};
|
|
4829
4784
|
this.allSelected = false;
|
|
4830
4785
|
this.showSelectTermFields = false;
|
|
4831
4786
|
this.termFields = termFields;
|
|
4832
4787
|
this.termFieldSelected = {};
|
|
4788
|
+
this.showNonIncluded = false;
|
|
4833
4789
|
}
|
|
4834
4790
|
NodeCsvSelectHeadersComponent.prototype.ngOnInit = function () {
|
|
4835
4791
|
return __awaiter(this, void 0, void 0, function () {
|
|
4836
|
-
var schemas, isSelected, headers;
|
|
4792
|
+
var schemas, isSelected, isIncluded, headers;
|
|
4837
4793
|
var _this = this;
|
|
4838
4794
|
return __generator(this, function (_b) {
|
|
4839
4795
|
switch (_b.label) {
|
|
@@ -4843,13 +4799,14 @@
|
|
|
4843
4799
|
return [4 /*yield*/, this.isSelected(schemas)];
|
|
4844
4800
|
case 2:
|
|
4845
4801
|
isSelected = _b.sent();
|
|
4802
|
+
isIncluded = schemaUtils.isCSVIncluded(schemas);
|
|
4846
4803
|
return [4 /*yield*/, this.schemaService.parseHeaders(this.csv)];
|
|
4847
4804
|
case 3:
|
|
4848
4805
|
headers = _b.sent();
|
|
4849
|
-
this.headers = headers.
|
|
4806
|
+
this.headers = headers.reduce(function (prev, header) {
|
|
4850
4807
|
var group = headerGroup(header);
|
|
4851
4808
|
prev[group] = prev[group] || { headers: [], selected: false, partialSelected: false, open: true };
|
|
4852
|
-
prev[group].headers.push({ header: header, selected: isSelected(header) });
|
|
4809
|
+
prev[group].headers.push({ header: header, selected: isSelected(header), included: isIncluded(header) });
|
|
4853
4810
|
return prev;
|
|
4854
4811
|
}, {});
|
|
4855
4812
|
Object.keys(this.headers).map(function (groupKey) { return _this.updateGroupHeader(groupKey); });
|
|
@@ -4857,7 +4814,8 @@
|
|
|
4857
4814
|
var _b;
|
|
4858
4815
|
return (Object.assign(Object.assign({}, prev), (_b = {}, _b[curr] = curr === '@id', _b)));
|
|
4859
4816
|
}, {});
|
|
4860
|
-
this.
|
|
4817
|
+
this.refresh();
|
|
4818
|
+
this.loading = false;
|
|
4861
4819
|
return [2 /*return*/];
|
|
4862
4820
|
}
|
|
4863
4821
|
});
|
|
@@ -4910,14 +4868,15 @@
|
|
|
4910
4868
|
};
|
|
4911
4869
|
Object.defineProperty(NodeCsvSelectHeadersComponent.prototype, "selectedHeaders", {
|
|
4912
4870
|
get: function () {
|
|
4871
|
+
var _this = this;
|
|
4913
4872
|
return Object.values(this.headers)
|
|
4914
4873
|
.flatMap(function (_b) {
|
|
4915
4874
|
var headers = _b.headers;
|
|
4916
4875
|
return headers;
|
|
4917
4876
|
})
|
|
4918
4877
|
.filter(function (_b) {
|
|
4919
|
-
var selected = _b.selected;
|
|
4920
|
-
return selected;
|
|
4878
|
+
var selected = _b.selected, included = _b.included;
|
|
4879
|
+
return selected && (included || _this.showNonIncluded);
|
|
4921
4880
|
})
|
|
4922
4881
|
.map(function (_b) {
|
|
4923
4882
|
var header = _b.header;
|
|
@@ -4927,7 +4886,7 @@
|
|
|
4927
4886
|
enumerable: false,
|
|
4928
4887
|
configurable: true
|
|
4929
4888
|
});
|
|
4930
|
-
NodeCsvSelectHeadersComponent.prototype.
|
|
4889
|
+
NodeCsvSelectHeadersComponent.prototype.refresh = function () {
|
|
4931
4890
|
this.updateAllSelected();
|
|
4932
4891
|
this.headersChanged.emit(this.selectedHeaders);
|
|
4933
4892
|
};
|
|
@@ -4944,7 +4903,7 @@
|
|
|
4944
4903
|
return NodeCsvSelectHeadersComponent;
|
|
4945
4904
|
}());
|
|
4946
4905
|
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();
|
|
4906
|
+
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
4907
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: NodeCsvSelectHeadersComponent, decorators: [{
|
|
4949
4908
|
type: i0.Component,
|
|
4950
4909
|
args: [{
|
|
@@ -5258,7 +5217,16 @@
|
|
|
5258
5217
|
var _d$1, _e;
|
|
5259
5218
|
var get$3 = require('lodash.get');
|
|
5260
5219
|
var orderBy$5 = require('lodash.orderby');
|
|
5261
|
-
var reduceValues = function (values, termId) {
|
|
5220
|
+
var reduceValues = function (values, termId) {
|
|
5221
|
+
var propertyValues = values
|
|
5222
|
+
.map(function (_d) {
|
|
5223
|
+
var value = _d.value;
|
|
5224
|
+
return term.propertyValue(value, termId);
|
|
5225
|
+
})
|
|
5226
|
+
// propertyValue may return null if the value is null or undefined, therefore remove them from total
|
|
5227
|
+
.filter(function (v) { return v !== null; });
|
|
5228
|
+
return propertyValues.length ? propertyValues.reduce(function (p, v) { return p + v; }, 0) : undefined;
|
|
5229
|
+
};
|
|
5262
5230
|
var logSubValue = function (logs, key, prop) { return logs[key][prop] ? (Array.isArray(logs[key][prop]) ?
|
|
5263
5231
|
logs[key][prop].map(function (value) { return ({ key: prop, value: value }); }) :
|
|
5264
5232
|
{ key: prop, value: logs[key][prop] }) : undefined; };
|
|
@@ -5320,7 +5288,7 @@
|
|
|
5320
5288
|
}
|
|
5321
5289
|
NodeLogsModelsComponent.prototype.ngOnInit = function () {
|
|
5322
5290
|
return __awaiter(this, void 0, void 0, function () {
|
|
5323
|
-
var _d, models, _e, originalValues, recalculatedValues, type, _f;
|
|
5291
|
+
var _d, models, _e, allModels, originalValues, recalculatedValues, type, _f;
|
|
5324
5292
|
var _this = this;
|
|
5325
5293
|
return __generator(this, function (_g) {
|
|
5326
5294
|
switch (_g.label) {
|
|
@@ -5351,6 +5319,9 @@
|
|
|
5351
5319
|
}, {})).toPromise()];
|
|
5352
5320
|
case 3:
|
|
5353
5321
|
_e.methodsById = _g.sent();
|
|
5322
|
+
return [4 /*yield*/, this.hestiaEngineService.models()];
|
|
5323
|
+
case 4:
|
|
5324
|
+
allModels = _g.sent();
|
|
5354
5325
|
originalValues = (this.originalValues || []).filter(function (value) { return !value.deleted; });
|
|
5355
5326
|
recalculatedValues = (this.recalculatedValues || []).filter(function (value) { return !value.deleted; });
|
|
5356
5327
|
type = originalValues.length ?
|
|
@@ -5360,14 +5331,14 @@
|
|
|
5360
5331
|
undefined;
|
|
5361
5332
|
_f = this;
|
|
5362
5333
|
return [4 /*yield*/, this.fetchAllTerms()];
|
|
5363
|
-
case
|
|
5334
|
+
case 5:
|
|
5364
5335
|
_f.allTerms = _g.sent();
|
|
5365
5336
|
this.allBlankNodes = this.allTerms.flatMap(function (term) {
|
|
5366
5337
|
var termLogs = get$3(_this.logs, term['@id'], {});
|
|
5367
5338
|
var original = originalValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5368
5339
|
var recalculated = recalculatedValues.filter(function (v) { return term['@id'] === v.term['@id']; });
|
|
5369
5340
|
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) {
|
|
5341
|
+
var configModels = utils.unique(__spreadArray(__spreadArray([], __read(findConfigModels(_this.config, term['@id'], _this.nodeKey, allModels).map(function (_d) {
|
|
5371
5342
|
var model = _d.model;
|
|
5372
5343
|
return model;
|
|
5373
5344
|
}))), __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); });
|
|
@@ -5464,7 +5435,7 @@
|
|
|
5464
5435
|
return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) ||
|
|
5465
5436
|
((_b = logs[methodId]) === null || _b === void 0 ? void 0 : _b.key) ||
|
|
5466
5437
|
((_c = logs[methodId]) === null || _c === void 0 ? void 0 : _c.model) ||
|
|
5467
|
-
(methodId ? keyToLabel(methodId) : '');
|
|
5438
|
+
(methodId ? utils.keyToLabel(methodId) : '');
|
|
5468
5439
|
};
|
|
5469
5440
|
NodeLogsModelsComponent.prototype.hasLog = function (_d, methodId, withOrchestrator) {
|
|
5470
5441
|
var logs = _d.logs;
|
|
@@ -5760,7 +5731,7 @@
|
|
|
5760
5731
|
this.selected = [];
|
|
5761
5732
|
this.enableCompare = true;
|
|
5762
5733
|
this.baseUrl = baseUrl();
|
|
5763
|
-
this.propertyValue = propertyValue
|
|
5734
|
+
this.propertyValue = term.propertyValue;
|
|
5764
5735
|
this.defaultLabel = defaultLabel;
|
|
5765
5736
|
this.showDownload = false;
|
|
5766
5737
|
this.View = View$4;
|
|
@@ -5822,7 +5793,7 @@
|
|
|
5822
5793
|
}] } });
|
|
5823
5794
|
|
|
5824
5795
|
var ignoreKeys = [
|
|
5825
|
-
'@type', 'added', 'updated', 'addedVersion', 'updatedVersion'
|
|
5796
|
+
'@type', 'type', 'added', 'updated', 'addedVersion', 'updatedVersion'
|
|
5826
5797
|
];
|
|
5827
5798
|
var CyclesCompletenessComponent = /** @class */ (function () {
|
|
5828
5799
|
function CyclesCompletenessComponent() {
|
|
@@ -5830,7 +5801,7 @@
|
|
|
5830
5801
|
this.selected = [];
|
|
5831
5802
|
this.baseUrl = baseUrl();
|
|
5832
5803
|
this.defaultLabel = defaultLabel;
|
|
5833
|
-
this.keyToLabel = keyToLabel;
|
|
5804
|
+
this.keyToLabel = utils.keyToLabel;
|
|
5834
5805
|
}
|
|
5835
5806
|
CyclesCompletenessComponent.prototype.trackById = function (_index, item) {
|
|
5836
5807
|
return item['@id'];
|
|
@@ -5871,7 +5842,7 @@
|
|
|
5871
5842
|
var cycleDataset = function (values, termId, cycle, index) {
|
|
5872
5843
|
var label = cycleName(cycle, index);
|
|
5873
5844
|
var color = itemColor(index);
|
|
5874
|
-
var data = [propertyValue
|
|
5845
|
+
var data = [term.propertyValue(cycleValue(cycle, values), termId)];
|
|
5875
5846
|
return {
|
|
5876
5847
|
label: label,
|
|
5877
5848
|
axis: 'y',
|
|
@@ -5907,7 +5878,7 @@
|
|
|
5907
5878
|
var values = _d.values;
|
|
5908
5879
|
return Object.values(values).some(function (_d) {
|
|
5909
5880
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
5910
|
-
return propertyValue
|
|
5881
|
+
return term.propertyValue(value) >= 0;
|
|
5911
5882
|
});
|
|
5912
5883
|
})
|
|
5913
5884
|
.map(function (_d) {
|
|
@@ -6056,7 +6027,7 @@
|
|
|
6056
6027
|
this.cycles = [];
|
|
6057
6028
|
this.selected = [];
|
|
6058
6029
|
this.baseUrl = baseUrl();
|
|
6059
|
-
this.propertyValue = propertyValue
|
|
6030
|
+
this.propertyValue = term.propertyValue;
|
|
6060
6031
|
this.defaultLabel = defaultLabel;
|
|
6061
6032
|
this.showDownload = false;
|
|
6062
6033
|
this.View = View$3;
|
|
@@ -6176,7 +6147,7 @@
|
|
|
6176
6147
|
this.cycles = [];
|
|
6177
6148
|
this.selected = [];
|
|
6178
6149
|
this.baseUrl = baseUrl();
|
|
6179
|
-
this.propertyValue = propertyValue
|
|
6150
|
+
this.propertyValue = term.propertyValue;
|
|
6180
6151
|
this.defaultLabel = defaultLabel;
|
|
6181
6152
|
this.showDownload = false;
|
|
6182
6153
|
this.View = View$2;
|
|
@@ -6280,7 +6251,7 @@
|
|
|
6280
6251
|
barPercentage: 0.5,
|
|
6281
6252
|
data: cycles.map(function (_b) {
|
|
6282
6253
|
var id = _b["@id"];
|
|
6283
|
-
return values[id] ? propertyValue
|
|
6254
|
+
return values[id] ? term.propertyValue(values[id].value, termId) : 0;
|
|
6284
6255
|
})
|
|
6285
6256
|
};
|
|
6286
6257
|
});
|
|
@@ -6409,7 +6380,7 @@
|
|
|
6409
6380
|
var parseDataPath = function (dataPath) {
|
|
6410
6381
|
if (dataPath === void 0) { dataPath = ''; }
|
|
6411
6382
|
var _f = __read(dataPath.split('.')), _ = _f[0], paths = _f.slice(1);
|
|
6412
|
-
return paths.map(function (path) { return ({ path: path, label: keyToLabel(path.replace(/\[\d+\]/g, '')) }); });
|
|
6383
|
+
return paths.map(function (path) { return ({ path: path, label: utils.keyToLabel(path.replace(/\[\d+\]/g, '')) }); });
|
|
6413
6384
|
};
|
|
6414
6385
|
var contactUsEmail = 'community@hestia.earth';
|
|
6415
6386
|
var externalLink = function (href, text) { return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>"; };
|
|
@@ -6496,7 +6467,7 @@
|
|
|
6496
6467
|
"The " + paths[0].path + " are invalid";
|
|
6497
6468
|
},
|
|
6498
6469
|
_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.'; },
|
|
6499
|
-
_f['may not all be set to false'] = function () { return "You may have forgotten to fill in
|
|
6470
|
+
_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') + "."; },
|
|
6500
6471
|
_f['may not be empty'] = function () { return 'if this value signifies no data, Hestia only accepts "-" or empty for no data'; },
|
|
6501
6472
|
_f['may not be 0'] = function (_f, errorCount) {
|
|
6502
6473
|
var dataPath = _f.dataPath;
|
|
@@ -6576,6 +6547,10 @@
|
|
|
6576
6547
|
var params = _f.params;
|
|
6577
6548
|
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.";
|
|
6578
6549
|
},
|
|
6550
|
+
_f['should add a source'] = function (_f) {
|
|
6551
|
+
var params = _f.params;
|
|
6552
|
+
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).";
|
|
6553
|
+
},
|
|
6579
6554
|
_f);
|
|
6580
6555
|
var formatCustomErrorMessage = function (message, error, errorCount) {
|
|
6581
6556
|
if (errorCount === void 0) { errorCount = 1; }
|
|
@@ -6727,7 +6702,6 @@
|
|
|
6727
6702
|
queries: __spreadArray(__spreadArray([], __read(compileSuggestionQueries(nonExpandableArrayDataPath(parent), allOf))), __read((['country'].includes(parent) ? [matchCountry] : [])))
|
|
6728
6703
|
});
|
|
6729
6704
|
};
|
|
6730
|
-
var formatLinkNodesSuggestions = function (nodeMap, type) { return (nodeMap[type] || []).map(function (id) { return ({ type: type, id: id, name: "Link with " + type + ": " + id }); }); };
|
|
6731
6705
|
var typeToSuggestion = (_d = {},
|
|
6732
6706
|
_d[schema.NodeType.Actor] = defaultNodeTypeSuggestion(schema.NodeType.Actor),
|
|
6733
6707
|
_d[schema.NodeType.Cycle] = defaultNodeTypeSuggestion(schema.NodeType.Cycle),
|
|
@@ -6790,11 +6764,6 @@
|
|
|
6790
6764
|
typeToSuggestion[schema.type](fullKey, parentSchema, schema) :
|
|
6791
6765
|
undefined);
|
|
6792
6766
|
};
|
|
6793
|
-
var formatProperty = function (prop) { return (Object.assign(Object.assign({ '@type': schema.SchemaType.Property }, prop), { term: Object.assign({ '@type': schema.NodeType.Term }, prop.term) })); };
|
|
6794
|
-
var formatSuggestion = function (_c) {
|
|
6795
|
-
var defaultProperties = _c.defaultProperties, node = __rest(_c, ["defaultProperties"]);
|
|
6796
|
-
return (Object.assign(Object.assign({}, node), (defaultProperties ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
|
|
6797
|
-
};
|
|
6798
6767
|
var nodeAvailableProperties = function (node, _d) {
|
|
6799
6768
|
var fullKey = _d.fullKey, schema = _d.schema, schemaType = _d.schemaType;
|
|
6800
6769
|
return availableProperties(schema, schemaType, fullKey ? get$2(node, fullKey, {}) : node, fullKey.length > 0);
|
|
@@ -7544,7 +7513,7 @@
|
|
|
7544
7513
|
var value = _a.value, depthLower = _a.depthLower, depthUpper = _a.depthUpper;
|
|
7545
7514
|
return hasMultipleValues(value) && hasMultipleValues(depthLower) && hasMultipleValues(depthUpper) ?
|
|
7546
7515
|
weighedAverage({ value: value, depthLower: depthLower, depthUpper: depthUpper }) :
|
|
7547
|
-
propertyValue
|
|
7516
|
+
term.propertyValue(value, termId);
|
|
7548
7517
|
};
|
|
7549
7518
|
|
|
7550
7519
|
var SitesMeasurementsLogsComponent = /** @class */ (function () {
|
|
@@ -7751,11 +7720,19 @@
|
|
|
7751
7720
|
}] });
|
|
7752
7721
|
|
|
7753
7722
|
var get = require('lodash.get');
|
|
7754
|
-
var MIN_TYPEAHEAD_LENGTH
|
|
7723
|
+
var MIN_TYPEAHEAD_LENGTH = 2;
|
|
7755
7724
|
var populateTermFields = [
|
|
7756
|
-
'termType', 'units'
|
|
7725
|
+
'termType', 'units'
|
|
7726
|
+
];
|
|
7727
|
+
var populateTermDefaultProperties = [
|
|
7757
7728
|
'defaultProperties.term.name', 'defaultProperties.term.units', 'defaultProperties.value'
|
|
7758
7729
|
];
|
|
7730
|
+
var formatProperty = function (prop) { return (Object.assign(Object.assign({ '@type': schema.SchemaType.Property }, prop), { term: Object.assign({ '@type': schema.NodeType.Term }, prop.term) })); };
|
|
7731
|
+
var formatSuggestion = function (_a) {
|
|
7732
|
+
var defaultProperties = _a.defaultProperties, node = __rest(_a, ["defaultProperties"]);
|
|
7733
|
+
return (Object.assign(Object.assign({}, node), ((defaultProperties === null || defaultProperties === void 0 ? void 0 : defaultProperties.length) ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
|
|
7734
|
+
};
|
|
7735
|
+
var formatLinkNodesSuggestions = function (nodeMap, type) { return (nodeMap[type] || []).map(function (id) { return ({ type: type, id: id, name: "Link with " + type + ": " + id }); }); };
|
|
7759
7736
|
var FilesFormComponent = /** @class */ (function () {
|
|
7760
7737
|
function FilesFormComponent(ref, searchService, usersService) {
|
|
7761
7738
|
var _c;
|
|
@@ -7765,10 +7742,21 @@
|
|
|
7765
7742
|
this.usersService = usersService;
|
|
7766
7743
|
this.errors = [];
|
|
7767
7744
|
this.nodeMap = {};
|
|
7745
|
+
/**
|
|
7746
|
+
* Allow editing nodes (`false` for readonly).
|
|
7747
|
+
*/
|
|
7768
7748
|
this.editable = false;
|
|
7769
7749
|
this.errorMode = false;
|
|
7770
7750
|
this.deepEditable = true;
|
|
7751
|
+
/**
|
|
7752
|
+
* Can edit errors.
|
|
7753
|
+
*/
|
|
7771
7754
|
this.errorsEditable = false;
|
|
7755
|
+
/**
|
|
7756
|
+
* When selecting terms, will show default properties or not.
|
|
7757
|
+
* Should be `false` when using schema validation, as only the `name` would be added.
|
|
7758
|
+
*/
|
|
7759
|
+
this.showSuggestedDefaultProperties = true;
|
|
7772
7760
|
this.nodeChange = new i0.EventEmitter();
|
|
7773
7761
|
this.nodeErorrResolved = new i0.EventEmitter();
|
|
7774
7762
|
this.nodeErrorAdded = new i0.EventEmitter();
|
|
@@ -7783,7 +7771,7 @@
|
|
|
7783
7771
|
this.suggestNewProperty = function (fullKey) { return function (text$) { return text$.pipe(operators.distinctUntilChanged(), operators.switchMap(function (term) { return rxjs.of(_this.newProperties(findProperty(_this.properties, fullKey) || _this.nodeProperty, term)); })); }; };
|
|
7784
7772
|
this.suggestExistingNode = function (type, term, uniqueKey) {
|
|
7785
7773
|
if (uniqueKey === void 0) { uniqueKey = '@id'; }
|
|
7786
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7774
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7787
7775
|
rxjs.of([]) :
|
|
7788
7776
|
_this.searchService.suggest(term, type, [], {
|
|
7789
7777
|
bool: {
|
|
@@ -7795,7 +7783,7 @@
|
|
|
7795
7783
|
],
|
|
7796
7784
|
minimum_should_match: 1
|
|
7797
7785
|
}
|
|
7798
|
-
}, 5,
|
|
7786
|
+
}, 5, _this.suggestTermFields);
|
|
7799
7787
|
};
|
|
7800
7788
|
this.suggestNode = function (type, suggestDefault) { return function (term, property) {
|
|
7801
7789
|
var _a, _b;
|
|
@@ -7818,15 +7806,15 @@
|
|
|
7818
7806
|
_c[schema.NodeType.Site] = this.suggestNode(schema.NodeType.Site),
|
|
7819
7807
|
_c[schema.NodeType.Source] = this.suggestNode(schema.NodeType.Source, function (term, _c) {
|
|
7820
7808
|
var key = _c.key;
|
|
7821
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7809
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7822
7810
|
rxjs.of([]) :
|
|
7823
7811
|
_this.searchService.suggestSource(term, 5, ["bibliography." + key], ["bibliography." + key]);
|
|
7824
7812
|
}),
|
|
7825
7813
|
_c[schema.NodeType.Term] = this.suggestNode(schema.NodeType.Term, function (term, _c) {
|
|
7826
7814
|
var suggestions = _c.suggestions;
|
|
7827
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7815
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7828
7816
|
rxjs.of([]) :
|
|
7829
|
-
_this.searchService.suggest(term, schema.NodeType.Term, (suggestions === null || suggestions === void 0 ? void 0 : suggestions.queries) || [], null, 5,
|
|
7817
|
+
_this.searchService.suggest(term, schema.NodeType.Term, (suggestions === null || suggestions === void 0 ? void 0 : suggestions.queries) || [], null, 5, _this.suggestTermFields);
|
|
7830
7818
|
}),
|
|
7831
7819
|
_c);
|
|
7832
7820
|
this.propertySuggest = function (fullKey, suggestType) { return function (text$) { return text$.pipe(operators.debounceTime(suggestType === defaultSuggestionType ? 0 : 300), operators.distinctUntilChanged(), operators.mergeMap(function (term) {
|
|
@@ -7882,6 +7870,13 @@
|
|
|
7882
7870
|
var value = _c.value, isRequired = _c.isRequired;
|
|
7883
7871
|
return isRequired && utils.isEmpty(value);
|
|
7884
7872
|
};
|
|
7873
|
+
Object.defineProperty(FilesFormComponent.prototype, "suggestTermFields", {
|
|
7874
|
+
get: function () {
|
|
7875
|
+
return __spreadArray(__spreadArray([], __read(populateTermFields)), __read((this.showSuggestedDefaultProperties ? populateTermDefaultProperties : [])));
|
|
7876
|
+
},
|
|
7877
|
+
enumerable: false,
|
|
7878
|
+
configurable: true
|
|
7879
|
+
});
|
|
7885
7880
|
// --- Errors
|
|
7886
7881
|
FilesFormComponent.prototype.enableAddError = function (property) {
|
|
7887
7882
|
return this.errorsEditable && !property.hasError && !property.hasWarning;
|
|
@@ -8164,7 +8159,7 @@
|
|
|
8164
8159
|
return FilesFormComponent;
|
|
8165
8160
|
}());
|
|
8166
8161
|
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 });
|
|
8167
|
-
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 } });
|
|
8162
|
+
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", showSuggestedDefaultProperties: "showSuggestedDefaultProperties" }, 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 } });
|
|
8168
8163
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
8169
8164
|
type: i0.Component,
|
|
8170
8165
|
args: [{
|
|
@@ -8188,6 +8183,8 @@
|
|
|
8188
8183
|
type: i0.Input
|
|
8189
8184
|
}], errorsEditable: [{
|
|
8190
8185
|
type: i0.Input
|
|
8186
|
+
}], showSuggestedDefaultProperties: [{
|
|
8187
|
+
type: i0.Input
|
|
8191
8188
|
}], nodeChange: [{
|
|
8192
8189
|
type: i0.Output
|
|
8193
8190
|
}], nodeErorrResolved: [{
|
|
@@ -8583,10 +8580,17 @@
|
|
|
8583
8580
|
enumerable: false,
|
|
8584
8581
|
configurable: true
|
|
8585
8582
|
});
|
|
8583
|
+
Object.defineProperty(ImpactAssessmentsProductsLogsComponent.prototype, "filteredType", {
|
|
8584
|
+
get: function () {
|
|
8585
|
+
return this.filterTermTypes.map(termTypeLabel).join(' & ');
|
|
8586
|
+
},
|
|
8587
|
+
enumerable: false,
|
|
8588
|
+
configurable: true
|
|
8589
|
+
});
|
|
8586
8590
|
return ImpactAssessmentsProductsLogsComponent;
|
|
8587
8591
|
}());
|
|
8588
8592
|
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 });
|
|
8589
|
-
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=\"
|
|
8593
|
+
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"] }] });
|
|
8590
8594
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ImpactAssessmentsProductsLogsComponent, decorators: [{
|
|
8591
8595
|
type: i0.Component,
|
|
8592
8596
|
args: [{
|
|
@@ -8607,7 +8611,6 @@
|
|
|
8607
8611
|
}] } });
|
|
8608
8612
|
|
|
8609
8613
|
var orderBy = require('lodash.orderby');
|
|
8610
|
-
var MIN_TYPEAHEAD_LENGTH = 1;
|
|
8611
8614
|
var View;
|
|
8612
8615
|
(function (View) {
|
|
8613
8616
|
View["table"] = "table";
|
|
@@ -8624,7 +8627,7 @@
|
|
|
8624
8627
|
this.key = 'impacts';
|
|
8625
8628
|
this.enableFilterMethodModel = false;
|
|
8626
8629
|
this.loading = false;
|
|
8627
|
-
this.propertyValue = propertyValue
|
|
8630
|
+
this.propertyValue = term.propertyValue;
|
|
8628
8631
|
this.baseUrl = baseUrl();
|
|
8629
8632
|
this.showDownload = false;
|
|
8630
8633
|
this.View = View;
|
|
@@ -8958,23 +8961,19 @@
|
|
|
8958
8961
|
exports.calculateCycleDurationEnabled = calculateCycleDurationEnabled;
|
|
8959
8962
|
exports.calculateCycleStartDate = calculateCycleStartDate;
|
|
8960
8963
|
exports.calculateCycleStartDateEnabled = calculateCycleStartDateEnabled;
|
|
8961
|
-
exports.calculatePercentDelta = calculatePercentDelta;
|
|
8962
8964
|
exports.clustererImage = clustererImage;
|
|
8963
8965
|
exports.code = code;
|
|
8964
8966
|
exports.coordinatesToPoint = coordinatesToPoint;
|
|
8965
8967
|
exports.countriesQuery = countriesQuery;
|
|
8966
8968
|
exports.createMarker = createMarker;
|
|
8967
8969
|
exports.cropsQuery = cropsQuery;
|
|
8968
|
-
exports.customDeltaFuncs = customDeltaFuncs;
|
|
8969
8970
|
exports.dataPathToKey = dataPathToKey;
|
|
8970
8971
|
exports.defaultFeature = defaultFeature;
|
|
8971
8972
|
exports.defaultLabel = defaultLabel;
|
|
8972
8973
|
exports.defaultSuggestionType = defaultSuggestionType;
|
|
8973
8974
|
exports.definitionToSchemaType = definitionToSchemaType;
|
|
8974
|
-
exports.delta = delta;
|
|
8975
8975
|
exports.deserializeSearchFilters = deserializeSearchFilters;
|
|
8976
8976
|
exports.ellipsis = ellipsis;
|
|
8977
|
-
exports.emptyValue = emptyValue;
|
|
8978
8977
|
exports.errorHasError = errorHasError;
|
|
8979
8978
|
exports.errorHasWarning = errorHasWarning;
|
|
8980
8979
|
exports.errorText = errorText;
|
|
@@ -8989,9 +8988,7 @@
|
|
|
8989
8988
|
exports.findPropertyById = findPropertyById;
|
|
8990
8989
|
exports.formatCustomErrorMessage = formatCustomErrorMessage;
|
|
8991
8990
|
exports.formatError = formatError;
|
|
8992
|
-
exports.formatLinkNodesSuggestions = formatLinkNodesSuggestions;
|
|
8993
8991
|
exports.formatPropertyError = formatPropertyError;
|
|
8994
|
-
exports.formatSuggestion = formatSuggestion;
|
|
8995
8992
|
exports.gitBranch = gitBranch;
|
|
8996
8993
|
exports.gitHome = gitHome;
|
|
8997
8994
|
exports.gitRawBaseUrl = gitRawBaseUrl;
|
|
@@ -9011,7 +9008,6 @@
|
|
|
9011
9008
|
exports.isScrolledBelow = isScrolledBelow;
|
|
9012
9009
|
exports.itemColor = itemColor;
|
|
9013
9010
|
exports.keyToDataPath = keyToDataPath;
|
|
9014
|
-
exports.keyToLabel = keyToLabel;
|
|
9015
9011
|
exports.levels = levels;
|
|
9016
9012
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
9017
9013
|
exports.listColor = listColor;
|
|
@@ -9063,13 +9059,11 @@
|
|
|
9063
9059
|
exports.primaryProduct = primaryProduct;
|
|
9064
9060
|
exports.propertyError = propertyError;
|
|
9065
9061
|
exports.propertyId = propertyId;
|
|
9066
|
-
exports.propertyValue = propertyValue$1;
|
|
9067
9062
|
exports.recursiveProperties = recursiveProperties;
|
|
9068
9063
|
exports.refToSchemaType = refToSchemaType;
|
|
9069
9064
|
exports.refreshPropertyKeys = refreshPropertyKeys;
|
|
9070
9065
|
exports.regionsQuery = regionsQuery;
|
|
9071
9066
|
exports.repeat = repeat;
|
|
9072
|
-
exports.roundValue = roundValue;
|
|
9073
9067
|
exports.safeJSONParse = safeJSONParse;
|
|
9074
9068
|
exports.safeJSONStringify = safeJSONStringify;
|
|
9075
9069
|
exports.schemaRequiredProperties = schemaRequiredProperties;
|
|
@@ -9097,7 +9091,6 @@
|
|
|
9097
9091
|
exports.termTypeLabel = termTypeLabel;
|
|
9098
9092
|
exports.termTypeLookupUrl = termTypeLookupUrl;
|
|
9099
9093
|
exports.toCsv = toCsv$1;
|
|
9100
|
-
exports.toDashCase = toDashCase;
|
|
9101
9094
|
exports.typeToNewProperty = typeToNewProperty;
|
|
9102
9095
|
exports.updateProperties = updateProperties;
|
|
9103
9096
|
exports.valueTypeToDefault = valueTypeToDefault;
|