@hestia-earth/ui-components 0.0.23 → 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 +88 -138
- 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/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 +3 -2
- 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 +3 -2
- package/esm2015/files/files-error.model.js +3 -3
- 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/node/node-logs-models/node-logs-models.component.js +4 -3
- package/esm2015/sites/sites.model.js +2 -2
- package/esm2015/terms/terms.model.js +2 -2
- package/fesm2015/hestia-earth-ui-components.js +39 -77
- 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/package.json +3 -3
|
@@ -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; });
|
|
@@ -1398,8 +1378,8 @@
|
|
|
1398
1378
|
'docs',
|
|
1399
1379
|
[
|
|
1400
1380
|
'#hestia-calculation-models',
|
|
1401
|
-
toDashCase(model),
|
|
1402
|
-
toDashCase(term)
|
|
1381
|
+
utils.toDashCase(model),
|
|
1382
|
+
utils.toDashCase(term)
|
|
1403
1383
|
].filter(Boolean).join('-')
|
|
1404
1384
|
].join('/'); };
|
|
1405
1385
|
var HeEngineService = /** @class */ (function () {
|
|
@@ -1624,7 +1604,6 @@
|
|
|
1624
1604
|
type: i0.Input
|
|
1625
1605
|
}] } });
|
|
1626
1606
|
|
|
1627
|
-
var _a$4, _b$1, _c$1, _d$3;
|
|
1628
1607
|
var SUCCESS_CRITERION_MAX_DELTA_PERCENT = 5;
|
|
1629
1608
|
var WARNING_CRITERION_MAX_DELTA_PERCENT = 20;
|
|
1630
1609
|
exports.DeltaColour = void 0;
|
|
@@ -1633,46 +1612,6 @@
|
|
|
1633
1612
|
DeltaColour["Warning"] = "warning";
|
|
1634
1613
|
DeltaColour["Danger"] = "danger";
|
|
1635
1614
|
})(exports.DeltaColour || (exports.DeltaColour = {}));
|
|
1636
|
-
exports.DeltaDisplayType = void 0;
|
|
1637
|
-
(function (DeltaDisplayType) {
|
|
1638
|
-
DeltaDisplayType["absolute"] = "absolute";
|
|
1639
|
-
DeltaDisplayType["percent"] = "percent";
|
|
1640
|
-
})(exports.DeltaDisplayType || (exports.DeltaDisplayType = {}));
|
|
1641
|
-
var deltaPerType = (_a$4 = {},
|
|
1642
|
-
_a$4[exports.DeltaDisplayType.absolute] = function (value, original) { return value - original; },
|
|
1643
|
-
_a$4[exports.DeltaDisplayType.percent] = function (value, original) { return ((value - original) / original) * 100; },
|
|
1644
|
-
_a$4);
|
|
1645
|
-
var roundValue = function (value) { return +("" + value).substring(0, 10); };
|
|
1646
|
-
var delta = function (value, originalValue, displayType, mapping) {
|
|
1647
|
-
if (displayType === void 0) { displayType = exports.DeltaDisplayType.percent; }
|
|
1648
|
-
var vvalue = roundValue(propertyValue$1(value));
|
|
1649
|
-
var voriginalValue = roundValue(propertyValue$1(originalValue));
|
|
1650
|
-
var deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
|
|
1651
|
-
var diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
|
|
1652
|
-
return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
|
|
1653
|
-
};
|
|
1654
|
-
var PercentDeltaConditions;
|
|
1655
|
-
(function (PercentDeltaConditions) {
|
|
1656
|
-
PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
|
|
1657
|
-
PercentDeltaConditions["original0"] = "original is 0";
|
|
1658
|
-
})(PercentDeltaConditions || (PercentDeltaConditions = {}));
|
|
1659
|
-
var calculatePercentDeltaConditions = (_b$1 = {},
|
|
1660
|
-
_b$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return original > 0 && recalculated === 0; },
|
|
1661
|
-
_b$1[PercentDeltaConditions.original0] = function (original, recalculated) { return original === 0 && recalculated > 0; },
|
|
1662
|
-
_b$1);
|
|
1663
|
-
var calculatePercentDeltaResult = (_c$1 = {},
|
|
1664
|
-
_c$1[PercentDeltaConditions.recalculated0] = function (original, recalculated) { return (recalculated - original) / (original + 1); },
|
|
1665
|
-
// Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
1666
|
-
_c$1[PercentDeltaConditions.original0] = function (original, recalculated) { return Math.sign(recalculated - original); },
|
|
1667
|
-
_c$1.default = function (original, recalculated) { return (recalculated - original) / original; },
|
|
1668
|
-
_c$1);
|
|
1669
|
-
var calculatePercentDelta = function (recalculated, original) {
|
|
1670
|
-
var matchingCondition = Object.values(PercentDeltaConditions).find(function (value) { return calculatePercentDeltaConditions[value](original, recalculated); }) || 'default';
|
|
1671
|
-
return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
|
|
1672
|
-
};
|
|
1673
|
-
var customDeltaFuncs = (_d$3 = {},
|
|
1674
|
-
_d$3[exports.DeltaDisplayType.percent] = calculatePercentDelta,
|
|
1675
|
-
_d$3);
|
|
1676
1615
|
var evaluateSuccess = function (deltaValue) { return Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
|
|
1677
1616
|
? exports.DeltaColour.Success
|
|
1678
1617
|
: Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
|
|
@@ -1681,26 +1620,26 @@
|
|
|
1681
1620
|
|
|
1682
1621
|
var BlankNodeValueDeltaComponent = /** @class */ (function () {
|
|
1683
1622
|
function BlankNodeValueDeltaComponent() {
|
|
1684
|
-
this.displayType =
|
|
1685
|
-
this.DeltaDisplayType =
|
|
1623
|
+
this.displayType = delta.DeltaDisplayType.percent;
|
|
1624
|
+
this.DeltaDisplayType = delta.DeltaDisplayType;
|
|
1686
1625
|
}
|
|
1687
1626
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "hide", {
|
|
1688
1627
|
get: function () {
|
|
1689
|
-
return emptyValue(this.value) || emptyValue(this.originalValue);
|
|
1628
|
+
return term.emptyValue(this.value) || term.emptyValue(this.originalValue);
|
|
1690
1629
|
},
|
|
1691
1630
|
enumerable: false,
|
|
1692
1631
|
configurable: true
|
|
1693
1632
|
});
|
|
1694
1633
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "delta", {
|
|
1695
1634
|
get: function () {
|
|
1696
|
-
return delta(this.value, this.originalValue, this.displayType, customDeltaFuncs);
|
|
1635
|
+
return delta.delta(this.value, this.originalValue, this.displayType, delta.customDeltaFuncs);
|
|
1697
1636
|
},
|
|
1698
1637
|
enumerable: false,
|
|
1699
1638
|
configurable: true
|
|
1700
1639
|
});
|
|
1701
1640
|
Object.defineProperty(BlankNodeValueDeltaComponent.prototype, "color", {
|
|
1702
1641
|
get: function () {
|
|
1703
|
-
return this.displayType ===
|
|
1642
|
+
return this.displayType === delta.DeltaDisplayType.percent ? evaluateSuccess(this.delta) : '';
|
|
1704
1643
|
},
|
|
1705
1644
|
enumerable: false,
|
|
1706
1645
|
configurable: true
|
|
@@ -5282,7 +5221,7 @@
|
|
|
5282
5221
|
var propertyValues = values
|
|
5283
5222
|
.map(function (_d) {
|
|
5284
5223
|
var value = _d.value;
|
|
5285
|
-
return propertyValue
|
|
5224
|
+
return term.propertyValue(value, termId);
|
|
5286
5225
|
})
|
|
5287
5226
|
// propertyValue may return null if the value is null or undefined, therefore remove them from total
|
|
5288
5227
|
.filter(function (v) { return v !== null; });
|
|
@@ -5496,7 +5435,7 @@
|
|
|
5496
5435
|
return ((_a = this.methodsById[methodId]) === null || _a === void 0 ? void 0 : _a.name) ||
|
|
5497
5436
|
((_b = logs[methodId]) === null || _b === void 0 ? void 0 : _b.key) ||
|
|
5498
5437
|
((_c = logs[methodId]) === null || _c === void 0 ? void 0 : _c.model) ||
|
|
5499
|
-
(methodId ? keyToLabel(methodId) : '');
|
|
5438
|
+
(methodId ? utils.keyToLabel(methodId) : '');
|
|
5500
5439
|
};
|
|
5501
5440
|
NodeLogsModelsComponent.prototype.hasLog = function (_d, methodId, withOrchestrator) {
|
|
5502
5441
|
var logs = _d.logs;
|
|
@@ -5792,7 +5731,7 @@
|
|
|
5792
5731
|
this.selected = [];
|
|
5793
5732
|
this.enableCompare = true;
|
|
5794
5733
|
this.baseUrl = baseUrl();
|
|
5795
|
-
this.propertyValue = propertyValue
|
|
5734
|
+
this.propertyValue = term.propertyValue;
|
|
5796
5735
|
this.defaultLabel = defaultLabel;
|
|
5797
5736
|
this.showDownload = false;
|
|
5798
5737
|
this.View = View$4;
|
|
@@ -5862,7 +5801,7 @@
|
|
|
5862
5801
|
this.selected = [];
|
|
5863
5802
|
this.baseUrl = baseUrl();
|
|
5864
5803
|
this.defaultLabel = defaultLabel;
|
|
5865
|
-
this.keyToLabel = keyToLabel;
|
|
5804
|
+
this.keyToLabel = utils.keyToLabel;
|
|
5866
5805
|
}
|
|
5867
5806
|
CyclesCompletenessComponent.prototype.trackById = function (_index, item) {
|
|
5868
5807
|
return item['@id'];
|
|
@@ -5903,7 +5842,7 @@
|
|
|
5903
5842
|
var cycleDataset = function (values, termId, cycle, index) {
|
|
5904
5843
|
var label = cycleName(cycle, index);
|
|
5905
5844
|
var color = itemColor(index);
|
|
5906
|
-
var data = [propertyValue
|
|
5845
|
+
var data = [term.propertyValue(cycleValue(cycle, values), termId)];
|
|
5907
5846
|
return {
|
|
5908
5847
|
label: label,
|
|
5909
5848
|
axis: 'y',
|
|
@@ -5939,7 +5878,7 @@
|
|
|
5939
5878
|
var values = _d.values;
|
|
5940
5879
|
return Object.values(values).some(function (_d) {
|
|
5941
5880
|
var _e = __read(_d.nodes, 1), value = _e[0].value;
|
|
5942
|
-
return propertyValue
|
|
5881
|
+
return term.propertyValue(value) >= 0;
|
|
5943
5882
|
});
|
|
5944
5883
|
})
|
|
5945
5884
|
.map(function (_d) {
|
|
@@ -6088,7 +6027,7 @@
|
|
|
6088
6027
|
this.cycles = [];
|
|
6089
6028
|
this.selected = [];
|
|
6090
6029
|
this.baseUrl = baseUrl();
|
|
6091
|
-
this.propertyValue = propertyValue
|
|
6030
|
+
this.propertyValue = term.propertyValue;
|
|
6092
6031
|
this.defaultLabel = defaultLabel;
|
|
6093
6032
|
this.showDownload = false;
|
|
6094
6033
|
this.View = View$3;
|
|
@@ -6208,7 +6147,7 @@
|
|
|
6208
6147
|
this.cycles = [];
|
|
6209
6148
|
this.selected = [];
|
|
6210
6149
|
this.baseUrl = baseUrl();
|
|
6211
|
-
this.propertyValue = propertyValue
|
|
6150
|
+
this.propertyValue = term.propertyValue;
|
|
6212
6151
|
this.defaultLabel = defaultLabel;
|
|
6213
6152
|
this.showDownload = false;
|
|
6214
6153
|
this.View = View$2;
|
|
@@ -6312,7 +6251,7 @@
|
|
|
6312
6251
|
barPercentage: 0.5,
|
|
6313
6252
|
data: cycles.map(function (_b) {
|
|
6314
6253
|
var id = _b["@id"];
|
|
6315
|
-
return values[id] ? propertyValue
|
|
6254
|
+
return values[id] ? term.propertyValue(values[id].value, termId) : 0;
|
|
6316
6255
|
})
|
|
6317
6256
|
};
|
|
6318
6257
|
});
|
|
@@ -6441,7 +6380,7 @@
|
|
|
6441
6380
|
var parseDataPath = function (dataPath) {
|
|
6442
6381
|
if (dataPath === void 0) { dataPath = ''; }
|
|
6443
6382
|
var _f = __read(dataPath.split('.')), _ = _f[0], paths = _f.slice(1);
|
|
6444
|
-
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, '')) }); });
|
|
6445
6384
|
};
|
|
6446
6385
|
var contactUsEmail = 'community@hestia.earth';
|
|
6447
6386
|
var externalLink = function (href, text) { return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>"; };
|
|
@@ -6763,7 +6702,6 @@
|
|
|
6763
6702
|
queries: __spreadArray(__spreadArray([], __read(compileSuggestionQueries(nonExpandableArrayDataPath(parent), allOf))), __read((['country'].includes(parent) ? [matchCountry] : [])))
|
|
6764
6703
|
});
|
|
6765
6704
|
};
|
|
6766
|
-
var formatLinkNodesSuggestions = function (nodeMap, type) { return (nodeMap[type] || []).map(function (id) { return ({ type: type, id: id, name: "Link with " + type + ": " + id }); }); };
|
|
6767
6705
|
var typeToSuggestion = (_d = {},
|
|
6768
6706
|
_d[schema.NodeType.Actor] = defaultNodeTypeSuggestion(schema.NodeType.Actor),
|
|
6769
6707
|
_d[schema.NodeType.Cycle] = defaultNodeTypeSuggestion(schema.NodeType.Cycle),
|
|
@@ -6826,11 +6764,6 @@
|
|
|
6826
6764
|
typeToSuggestion[schema.type](fullKey, parentSchema, schema) :
|
|
6827
6765
|
undefined);
|
|
6828
6766
|
};
|
|
6829
|
-
var formatProperty = function (prop) { return (Object.assign(Object.assign({ '@type': schema.SchemaType.Property }, prop), { term: Object.assign({ '@type': schema.NodeType.Term }, prop.term) })); };
|
|
6830
|
-
var formatSuggestion = function (_c) {
|
|
6831
|
-
var defaultProperties = _c.defaultProperties, node = __rest(_c, ["defaultProperties"]);
|
|
6832
|
-
return (Object.assign(Object.assign({}, node), (defaultProperties ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
|
|
6833
|
-
};
|
|
6834
6767
|
var nodeAvailableProperties = function (node, _d) {
|
|
6835
6768
|
var fullKey = _d.fullKey, schema = _d.schema, schemaType = _d.schemaType;
|
|
6836
6769
|
return availableProperties(schema, schemaType, fullKey ? get$2(node, fullKey, {}) : node, fullKey.length > 0);
|
|
@@ -7580,7 +7513,7 @@
|
|
|
7580
7513
|
var value = _a.value, depthLower = _a.depthLower, depthUpper = _a.depthUpper;
|
|
7581
7514
|
return hasMultipleValues(value) && hasMultipleValues(depthLower) && hasMultipleValues(depthUpper) ?
|
|
7582
7515
|
weighedAverage({ value: value, depthLower: depthLower, depthUpper: depthUpper }) :
|
|
7583
|
-
propertyValue
|
|
7516
|
+
term.propertyValue(value, termId);
|
|
7584
7517
|
};
|
|
7585
7518
|
|
|
7586
7519
|
var SitesMeasurementsLogsComponent = /** @class */ (function () {
|
|
@@ -7787,11 +7720,19 @@
|
|
|
7787
7720
|
}] });
|
|
7788
7721
|
|
|
7789
7722
|
var get = require('lodash.get');
|
|
7790
|
-
var MIN_TYPEAHEAD_LENGTH
|
|
7723
|
+
var MIN_TYPEAHEAD_LENGTH = 2;
|
|
7791
7724
|
var populateTermFields = [
|
|
7792
|
-
'termType', 'units'
|
|
7725
|
+
'termType', 'units'
|
|
7726
|
+
];
|
|
7727
|
+
var populateTermDefaultProperties = [
|
|
7793
7728
|
'defaultProperties.term.name', 'defaultProperties.term.units', 'defaultProperties.value'
|
|
7794
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 }); }); };
|
|
7795
7736
|
var FilesFormComponent = /** @class */ (function () {
|
|
7796
7737
|
function FilesFormComponent(ref, searchService, usersService) {
|
|
7797
7738
|
var _c;
|
|
@@ -7801,10 +7742,21 @@
|
|
|
7801
7742
|
this.usersService = usersService;
|
|
7802
7743
|
this.errors = [];
|
|
7803
7744
|
this.nodeMap = {};
|
|
7745
|
+
/**
|
|
7746
|
+
* Allow editing nodes (`false` for readonly).
|
|
7747
|
+
*/
|
|
7804
7748
|
this.editable = false;
|
|
7805
7749
|
this.errorMode = false;
|
|
7806
7750
|
this.deepEditable = true;
|
|
7751
|
+
/**
|
|
7752
|
+
* Can edit errors.
|
|
7753
|
+
*/
|
|
7807
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;
|
|
7808
7760
|
this.nodeChange = new i0.EventEmitter();
|
|
7809
7761
|
this.nodeErorrResolved = new i0.EventEmitter();
|
|
7810
7762
|
this.nodeErrorAdded = new i0.EventEmitter();
|
|
@@ -7819,7 +7771,7 @@
|
|
|
7819
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)); })); }; };
|
|
7820
7772
|
this.suggestExistingNode = function (type, term, uniqueKey) {
|
|
7821
7773
|
if (uniqueKey === void 0) { uniqueKey = '@id'; }
|
|
7822
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7774
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7823
7775
|
rxjs.of([]) :
|
|
7824
7776
|
_this.searchService.suggest(term, type, [], {
|
|
7825
7777
|
bool: {
|
|
@@ -7831,7 +7783,7 @@
|
|
|
7831
7783
|
],
|
|
7832
7784
|
minimum_should_match: 1
|
|
7833
7785
|
}
|
|
7834
|
-
}, 5,
|
|
7786
|
+
}, 5, _this.suggestTermFields);
|
|
7835
7787
|
};
|
|
7836
7788
|
this.suggestNode = function (type, suggestDefault) { return function (term, property) {
|
|
7837
7789
|
var _a, _b;
|
|
@@ -7854,15 +7806,15 @@
|
|
|
7854
7806
|
_c[schema.NodeType.Site] = this.suggestNode(schema.NodeType.Site),
|
|
7855
7807
|
_c[schema.NodeType.Source] = this.suggestNode(schema.NodeType.Source, function (term, _c) {
|
|
7856
7808
|
var key = _c.key;
|
|
7857
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7809
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7858
7810
|
rxjs.of([]) :
|
|
7859
7811
|
_this.searchService.suggestSource(term, 5, ["bibliography." + key], ["bibliography." + key]);
|
|
7860
7812
|
}),
|
|
7861
7813
|
_c[schema.NodeType.Term] = this.suggestNode(schema.NodeType.Term, function (term, _c) {
|
|
7862
7814
|
var suggestions = _c.suggestions;
|
|
7863
|
-
return term.length < MIN_TYPEAHEAD_LENGTH
|
|
7815
|
+
return term.length < MIN_TYPEAHEAD_LENGTH ?
|
|
7864
7816
|
rxjs.of([]) :
|
|
7865
|
-
_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);
|
|
7866
7818
|
}),
|
|
7867
7819
|
_c);
|
|
7868
7820
|
this.propertySuggest = function (fullKey, suggestType) { return function (text$) { return text$.pipe(operators.debounceTime(suggestType === defaultSuggestionType ? 0 : 300), operators.distinctUntilChanged(), operators.mergeMap(function (term) {
|
|
@@ -7918,6 +7870,13 @@
|
|
|
7918
7870
|
var value = _c.value, isRequired = _c.isRequired;
|
|
7919
7871
|
return isRequired && utils.isEmpty(value);
|
|
7920
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
|
+
});
|
|
7921
7880
|
// --- Errors
|
|
7922
7881
|
FilesFormComponent.prototype.enableAddError = function (property) {
|
|
7923
7882
|
return this.errorsEditable && !property.hasError && !property.hasWarning;
|
|
@@ -8200,7 +8159,7 @@
|
|
|
8200
8159
|
return FilesFormComponent;
|
|
8201
8160
|
}());
|
|
8202
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 });
|
|
8203
|
-
FilesFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0__namespace, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1__namespace.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i10__namespace.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10__namespace.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6__namespace.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1__namespace$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10__namespace.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1__namespace$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1__namespace$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1__namespace$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
|
|
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 } });
|
|
8204
8163
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FilesFormComponent, decorators: [{
|
|
8205
8164
|
type: i0.Component,
|
|
8206
8165
|
args: [{
|
|
@@ -8224,6 +8183,8 @@
|
|
|
8224
8183
|
type: i0.Input
|
|
8225
8184
|
}], errorsEditable: [{
|
|
8226
8185
|
type: i0.Input
|
|
8186
|
+
}], showSuggestedDefaultProperties: [{
|
|
8187
|
+
type: i0.Input
|
|
8227
8188
|
}], nodeChange: [{
|
|
8228
8189
|
type: i0.Output
|
|
8229
8190
|
}], nodeErorrResolved: [{
|
|
@@ -8650,7 +8611,6 @@
|
|
|
8650
8611
|
}] } });
|
|
8651
8612
|
|
|
8652
8613
|
var orderBy = require('lodash.orderby');
|
|
8653
|
-
var MIN_TYPEAHEAD_LENGTH = 1;
|
|
8654
8614
|
var View;
|
|
8655
8615
|
(function (View) {
|
|
8656
8616
|
View["table"] = "table";
|
|
@@ -8667,7 +8627,7 @@
|
|
|
8667
8627
|
this.key = 'impacts';
|
|
8668
8628
|
this.enableFilterMethodModel = false;
|
|
8669
8629
|
this.loading = false;
|
|
8670
|
-
this.propertyValue = propertyValue
|
|
8630
|
+
this.propertyValue = term.propertyValue;
|
|
8671
8631
|
this.baseUrl = baseUrl();
|
|
8672
8632
|
this.showDownload = false;
|
|
8673
8633
|
this.View = View;
|
|
@@ -9001,23 +8961,19 @@
|
|
|
9001
8961
|
exports.calculateCycleDurationEnabled = calculateCycleDurationEnabled;
|
|
9002
8962
|
exports.calculateCycleStartDate = calculateCycleStartDate;
|
|
9003
8963
|
exports.calculateCycleStartDateEnabled = calculateCycleStartDateEnabled;
|
|
9004
|
-
exports.calculatePercentDelta = calculatePercentDelta;
|
|
9005
8964
|
exports.clustererImage = clustererImage;
|
|
9006
8965
|
exports.code = code;
|
|
9007
8966
|
exports.coordinatesToPoint = coordinatesToPoint;
|
|
9008
8967
|
exports.countriesQuery = countriesQuery;
|
|
9009
8968
|
exports.createMarker = createMarker;
|
|
9010
8969
|
exports.cropsQuery = cropsQuery;
|
|
9011
|
-
exports.customDeltaFuncs = customDeltaFuncs;
|
|
9012
8970
|
exports.dataPathToKey = dataPathToKey;
|
|
9013
8971
|
exports.defaultFeature = defaultFeature;
|
|
9014
8972
|
exports.defaultLabel = defaultLabel;
|
|
9015
8973
|
exports.defaultSuggestionType = defaultSuggestionType;
|
|
9016
8974
|
exports.definitionToSchemaType = definitionToSchemaType;
|
|
9017
|
-
exports.delta = delta;
|
|
9018
8975
|
exports.deserializeSearchFilters = deserializeSearchFilters;
|
|
9019
8976
|
exports.ellipsis = ellipsis;
|
|
9020
|
-
exports.emptyValue = emptyValue;
|
|
9021
8977
|
exports.errorHasError = errorHasError;
|
|
9022
8978
|
exports.errorHasWarning = errorHasWarning;
|
|
9023
8979
|
exports.errorText = errorText;
|
|
@@ -9032,9 +8988,7 @@
|
|
|
9032
8988
|
exports.findPropertyById = findPropertyById;
|
|
9033
8989
|
exports.formatCustomErrorMessage = formatCustomErrorMessage;
|
|
9034
8990
|
exports.formatError = formatError;
|
|
9035
|
-
exports.formatLinkNodesSuggestions = formatLinkNodesSuggestions;
|
|
9036
8991
|
exports.formatPropertyError = formatPropertyError;
|
|
9037
|
-
exports.formatSuggestion = formatSuggestion;
|
|
9038
8992
|
exports.gitBranch = gitBranch;
|
|
9039
8993
|
exports.gitHome = gitHome;
|
|
9040
8994
|
exports.gitRawBaseUrl = gitRawBaseUrl;
|
|
@@ -9054,7 +9008,6 @@
|
|
|
9054
9008
|
exports.isScrolledBelow = isScrolledBelow;
|
|
9055
9009
|
exports.itemColor = itemColor;
|
|
9056
9010
|
exports.keyToDataPath = keyToDataPath;
|
|
9057
|
-
exports.keyToLabel = keyToLabel;
|
|
9058
9011
|
exports.levels = levels;
|
|
9059
9012
|
exports.linkTypeEnabled = linkTypeEnabled;
|
|
9060
9013
|
exports.listColor = listColor;
|
|
@@ -9106,13 +9059,11 @@
|
|
|
9106
9059
|
exports.primaryProduct = primaryProduct;
|
|
9107
9060
|
exports.propertyError = propertyError;
|
|
9108
9061
|
exports.propertyId = propertyId;
|
|
9109
|
-
exports.propertyValue = propertyValue$1;
|
|
9110
9062
|
exports.recursiveProperties = recursiveProperties;
|
|
9111
9063
|
exports.refToSchemaType = refToSchemaType;
|
|
9112
9064
|
exports.refreshPropertyKeys = refreshPropertyKeys;
|
|
9113
9065
|
exports.regionsQuery = regionsQuery;
|
|
9114
9066
|
exports.repeat = repeat;
|
|
9115
|
-
exports.roundValue = roundValue;
|
|
9116
9067
|
exports.safeJSONParse = safeJSONParse;
|
|
9117
9068
|
exports.safeJSONStringify = safeJSONStringify;
|
|
9118
9069
|
exports.schemaRequiredProperties = schemaRequiredProperties;
|
|
@@ -9140,7 +9091,6 @@
|
|
|
9140
9091
|
exports.termTypeLabel = termTypeLabel;
|
|
9141
9092
|
exports.termTypeLookupUrl = termTypeLookupUrl;
|
|
9142
9093
|
exports.toCsv = toCsv$1;
|
|
9143
|
-
exports.toDashCase = toDashCase;
|
|
9144
9094
|
exports.typeToNewProperty = typeToNewProperty;
|
|
9145
9095
|
exports.updateProperties = updateProperties;
|
|
9146
9096
|
exports.valueTypeToDefault = valueTypeToDefault;
|