@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.
Files changed (27) hide show
  1. package/bundles/hestia-earth-ui-components.umd.js +88 -138
  2. package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
  3. package/common/blank-node-value-delta/blank-node-value-delta.component.d.ts +1 -1
  4. package/common/delta-utils.d.ts +0 -14
  5. package/common/utils.d.ts +0 -4
  6. package/esm2015/common/blank-node-value-delta/blank-node-value-delta.component.js +4 -3
  7. package/esm2015/common/delta-utils.js +1 -41
  8. package/esm2015/common/utils.js +2 -23
  9. package/esm2015/cycles/cycles-activity/cycles-activity.component.js +3 -2
  10. package/esm2015/cycles/cycles-completeness/cycles-completeness.component.js +3 -2
  11. package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +3 -2
  12. package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +3 -2
  13. package/esm2015/cycles/cycles-practices/cycles-practices.component.js +3 -2
  14. package/esm2015/cycles/cycles-result/cycles-result.component.js +3 -2
  15. package/esm2015/engine/engine.service.js +3 -2
  16. package/esm2015/files/files-error.model.js +3 -3
  17. package/esm2015/files/files-form/files-form.component.js +33 -6
  18. package/esm2015/files/files-form.model.js +1 -8
  19. package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +3 -3
  20. package/esm2015/node/node-logs-models/node-logs-models.component.js +4 -3
  21. package/esm2015/sites/sites.model.js +2 -2
  22. package/esm2015/terms/terms.model.js +2 -2
  23. package/fesm2015/hestia-earth-ui-components.js +39 -77
  24. package/fesm2015/hestia-earth-ui-components.js.map +1 -1
  25. package/files/files-form/files-form.component.d.ts +13 -1
  26. package/files/files-form.model.d.ts +0 -14
  27. package/package.json +3 -3
@@ -19,13 +19,14 @@ import { ReplaySubject, of, forkJoin, from, zip } from 'rxjs';
19
19
  import { getColor } from 'random-material-color';
20
20
  import { EmissionMethodTier, NodeType, isExpandable, TermTermType, nestedSearchableKeys, SchemaType, SCHEMA_VERSION, sortKeysByType, CycleFunctionalUnit, SiteSiteType, isTypeValid, isTypeNode, typeToSchemaType } from '@hestia-earth/schema';
21
21
  import { fileToExt, nodeTypeToParam, DataState, SupportedExtensions } from '@hestia-earth/api';
22
- import { isEmpty, isUndefined, isNumber, toPrecision, isBoolean, ConvertUnits, converters, convertValue, isEqual, unique, diffInDays } from '@hestia-earth/utils';
23
- import { getArrayTreatment } from '@hestia-earth/glossary';
22
+ import { propertyValue as propertyValue$1, emptyValue } from '@hestia-earth/utils/dist/term';
23
+ import { keyToLabel, isUndefined, isNumber, toPrecision, toDashCase, isBoolean, ConvertUnits, converters, convertValue, isEmpty, isEqual, unique, diffInDays } from '@hestia-earth/utils';
24
24
  import * as pluralize from 'pluralize';
25
25
  import { catchError, map, take, mergeMap, debounceTime, distinctUntilChanged, tap, switchMap, reduce, filter, distinct, toArray, mergeAll, groupBy } from 'rxjs/operators';
26
26
  import { __rest, __awaiter } from 'tslib';
27
27
  import * as csvtojson from 'csvtojson';
28
28
  import * as i1$2 from '@angular/common/http';
29
+ import { DeltaDisplayType, delta, customDeltaFuncs } from '@hestia-earth/utils/dist/delta';
29
30
  import { json2csvAsync } from 'json-2-csv';
30
31
  import * as i6$1 from '@angular/cdk/drag-drop';
31
32
  import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
@@ -289,11 +290,6 @@ const safeJSONParse = (value, defaultValue) => {
289
290
  };
290
291
  const safeJSONStringify = (value) => typeof value === 'string' ? value : JSON.stringify(value);
291
292
  const arrayValue = (values, isAverage) => (values || []).reduce((prev, curr) => prev + parseFloat(`${curr}`), 0) / (isAverage ? values.length : 1);
292
- const propertyValue$1 = (value, termId) => typeof value === 'undefined' || value === null ?
293
- null :
294
- (Array.isArray(value) ?
295
- arrayValue(value, (termId ? getArrayTreatment(termId) : null) === 'mean') :
296
- parseFloat(`${value}`));
297
293
  ;
298
294
  ;
299
295
  const grouppedKeys = (values) => Object.entries(values).map(([key, value]) => ({ key, value }));
@@ -358,20 +354,6 @@ const mapsQuery = 'https://www.google.com/maps/search/?api=1&query=';
358
354
  const mapsUrl = (location) => location ? (location.lat && location.lng ?
359
355
  `${mapsQuery}${location.lat},${location.lng}` :
360
356
  (location.name ? `${mapsQuery}${encodeURI(location.name)}` : undefined)) : undefined;
361
- const keyToLabel = (key) => `${key[0].toUpperCase()}${key.replace(/([a-z])([A-Z])/g, '$1 $2')
362
- .replace(/([_])([a-zA-Z])/g, g => ` ${g[1].toUpperCase()}`)
363
- .substring(1)}`;
364
- const toDashCase = (value) => value ?
365
- value
366
- // handle dates followed by capital letter
367
- .replace(/([\d]{4})([A-Z]{1})/g, g => `${g.substring(0, 4)}-${g[4].toLowerCase()}`)
368
- // handle molecules
369
- .replace(/([\d]{1}[A-Z]{1})/g, g => g.toLowerCase())
370
- // handle all capital letters
371
- .replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`)
372
- // handle years
373
- .replace(/([0-9]{4})/g, g => `-${g}`) :
374
- null;
375
357
  const nodeDefaultLabel = {
376
358
  [NodeType.ImpactAssessment]: ({ name, country, endDate, product }) => name ? name.replace(`${product === null || product === void 0 ? void 0 : product.name}, `, '') : [
377
359
  product === null || product === void 0 ? void 0 : product.name,
@@ -383,7 +365,6 @@ const nodeDefaultLabel = {
383
365
  const defaultLabel = (node) => node ? (node['@type'] in nodeDefaultLabel ? nodeDefaultLabel[node['@type']](node) : node.name) || node['@id'] || node.id : '';
384
366
  const itemColor = (index) => getColor({ text: `${index}` });
385
367
  const listColor = (_v, index) => itemColor(index);
386
- const emptyValue = (value) => isEmpty(value) || isNaN(propertyValue$1(value));
387
368
  const repeat = (times = 0) => (Array.from(Array(times), Math.random));
388
369
  const filenameWithoutExt = (filename = '') => {
389
370
  const file = fileToExt(filename, '');
@@ -1116,45 +1097,6 @@ var DeltaColour;
1116
1097
  DeltaColour["Warning"] = "warning";
1117
1098
  DeltaColour["Danger"] = "danger";
1118
1099
  })(DeltaColour || (DeltaColour = {}));
1119
- var DeltaDisplayType;
1120
- (function (DeltaDisplayType) {
1121
- DeltaDisplayType["absolute"] = "absolute";
1122
- DeltaDisplayType["percent"] = "percent";
1123
- })(DeltaDisplayType || (DeltaDisplayType = {}));
1124
- const deltaPerType = {
1125
- [DeltaDisplayType.absolute]: (value, original) => value - original,
1126
- [DeltaDisplayType.percent]: (value, original) => ((value - original) / original) * 100
1127
- };
1128
- const roundValue = (value) => +`${value}`.substring(0, 10);
1129
- const delta = (value, originalValue, displayType = DeltaDisplayType.percent, mapping) => {
1130
- const vvalue = roundValue(propertyValue$1(value));
1131
- const voriginalValue = roundValue(propertyValue$1(originalValue));
1132
- const deltaFuncs = Object.assign(Object.assign({}, deltaPerType), mapping);
1133
- const diff = vvalue === voriginalValue ? 0 : deltaFuncs[displayType](vvalue, voriginalValue);
1134
- return Number.isFinite(diff) ? (diff === -0 ? 0 : diff) : 0;
1135
- };
1136
- var PercentDeltaConditions;
1137
- (function (PercentDeltaConditions) {
1138
- PercentDeltaConditions["recalculated0"] = "recalculated should be 0";
1139
- PercentDeltaConditions["original0"] = "original is 0";
1140
- })(PercentDeltaConditions || (PercentDeltaConditions = {}));
1141
- const calculatePercentDeltaConditions = {
1142
- [PercentDeltaConditions.recalculated0]: (original, recalculated) => original > 0 && recalculated === 0,
1143
- [PercentDeltaConditions.original0]: (original, recalculated) => original === 0 && recalculated > 0
1144
- };
1145
- const calculatePercentDeltaResult = {
1146
- [PercentDeltaConditions.recalculated0]: (original, recalculated) => (recalculated - original) / (original + 1),
1147
- // Always considered an error so deliberately exceed SUCCESS_CRITERION_MAX_DELTA_PERCENT
1148
- [PercentDeltaConditions.original0]: (original, recalculated) => Math.sign(recalculated - original),
1149
- default: (original, recalculated) => (recalculated - original) / original
1150
- };
1151
- const calculatePercentDelta = (recalculated, original) => {
1152
- const matchingCondition = Object.values(PercentDeltaConditions).find((value) => calculatePercentDeltaConditions[value](original, recalculated)) || 'default';
1153
- return calculatePercentDeltaResult[matchingCondition](original, recalculated) * 100;
1154
- };
1155
- const customDeltaFuncs = {
1156
- [DeltaDisplayType.percent]: calculatePercentDelta
1157
- };
1158
1100
  const evaluateSuccess = (deltaValue) => Math.abs(deltaValue) < SUCCESS_CRITERION_MAX_DELTA_PERCENT
1159
1101
  ? DeltaColour.Success
1160
1102
  : Math.abs(deltaValue) < WARNING_CRITERION_MAX_DELTA_PERCENT
@@ -5617,7 +5559,6 @@ const termSuggestions = (parent, { allOf }) => ({
5617
5559
  ...(['country'].includes(parent) ? [matchCountry] : [])
5618
5560
  ]
5619
5561
  });
5620
- const formatLinkNodesSuggestions = (nodeMap, type) => (nodeMap[type] || []).map(id => ({ type, id, name: `Link with ${type}: ${id}` }));
5621
5562
  const typeToSuggestion = {
5622
5563
  [NodeType.Actor]: defaultNodeTypeSuggestion(NodeType.Actor),
5623
5564
  [NodeType.Cycle]: defaultNodeTypeSuggestion(NodeType.Cycle),
@@ -5680,11 +5621,6 @@ const enableSuggestions = (parentSchema, type, fullKey, schema) => {
5680
5621
  typeToSuggestion[schema.type](fullKey, parentSchema, schema) :
5681
5622
  undefined);
5682
5623
  };
5683
- const formatProperty = (prop) => (Object.assign(Object.assign({ '@type': SchemaType.Property }, prop), { term: Object.assign({ '@type': NodeType.Term }, prop.term) }));
5684
- const formatSuggestion = (_c) => {
5685
- var { defaultProperties } = _c, node = __rest(_c, ["defaultProperties"]);
5686
- return (Object.assign(Object.assign({}, node), (defaultProperties ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
5687
- };
5688
5624
  const nodeAvailableProperties = (node, { fullKey, schema, schemaType }) => availableProperties(schema, schemaType, fullKey ? get$2(node, fullKey, {}) : node, fullKey.length > 0);
5689
5625
  const isAddPropertyEnabled = (node, schemaType, schema, fullKey = '') => !!schema &&
5690
5626
  !!Object.keys(nodeAvailableProperties(node, { fullKey, schema })).length &&
@@ -6440,11 +6376,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6440
6376
  }] });
6441
6377
 
6442
6378
  const get = require('lodash.get');
6443
- const MIN_TYPEAHEAD_LENGTH$1 = 2;
6379
+ const MIN_TYPEAHEAD_LENGTH = 2;
6444
6380
  const populateTermFields = [
6445
- 'termType', 'units',
6381
+ 'termType', 'units'
6382
+ ];
6383
+ const populateTermDefaultProperties = [
6446
6384
  'defaultProperties.term.name', 'defaultProperties.term.units', 'defaultProperties.value'
6447
6385
  ];
6386
+ const formatProperty = (prop) => (Object.assign(Object.assign({ '@type': SchemaType.Property }, prop), { term: Object.assign({ '@type': NodeType.Term }, prop.term) }));
6387
+ const formatSuggestion = (_a) => {
6388
+ var { defaultProperties } = _a, node = __rest(_a, ["defaultProperties"]);
6389
+ return (Object.assign(Object.assign({}, node), ((defaultProperties === null || defaultProperties === void 0 ? void 0 : defaultProperties.length) ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
6390
+ };
6391
+ const formatLinkNodesSuggestions = (nodeMap, type) => (nodeMap[type] || []).map(id => ({ type, id, name: `Link with ${type}: ${id}` }));
6448
6392
  class FilesFormComponent {
6449
6393
  constructor(ref, searchService, usersService) {
6450
6394
  this.ref = ref;
@@ -6452,10 +6396,21 @@ class FilesFormComponent {
6452
6396
  this.usersService = usersService;
6453
6397
  this.errors = [];
6454
6398
  this.nodeMap = {};
6399
+ /**
6400
+ * Allow editing nodes (`false` for readonly).
6401
+ */
6455
6402
  this.editable = false;
6456
6403
  this.errorMode = false;
6457
6404
  this.deepEditable = true;
6405
+ /**
6406
+ * Can edit errors.
6407
+ */
6458
6408
  this.errorsEditable = false;
6409
+ /**
6410
+ * When selecting terms, will show default properties or not.
6411
+ * Should be `false` when using schema validation, as only the `name` would be added.
6412
+ */
6413
+ this.showSuggestedDefaultProperties = true;
6459
6414
  this.nodeChange = new EventEmitter$1();
6460
6415
  this.nodeErorrResolved = new EventEmitter$1();
6461
6416
  this.nodeErrorAdded = new EventEmitter$1();
@@ -6468,7 +6423,7 @@ class FilesFormComponent {
6468
6423
  this.properties = [];
6469
6424
  this.formatter = (value) => { var _a; return typeof value === 'object' ? ('bibliography' in value ? (_a = value.bibliography) === null || _a === void 0 ? void 0 : _a.title : value.name) : value; };
6470
6425
  this.suggestNewProperty = (fullKey) => (text$) => text$.pipe(distinctUntilChanged(), switchMap(term => of(this.newProperties(findProperty(this.properties, fullKey) || this.nodeProperty, term))));
6471
- this.suggestExistingNode = (type, term, uniqueKey = '@id') => term.length < MIN_TYPEAHEAD_LENGTH$1 ?
6426
+ this.suggestExistingNode = (type, term, uniqueKey = '@id') => term.length < MIN_TYPEAHEAD_LENGTH ?
6472
6427
  of([]) :
6473
6428
  this.searchService.suggest(term, type, [], {
6474
6429
  bool: {
@@ -6480,7 +6435,7 @@ class FilesFormComponent {
6480
6435
  ],
6481
6436
  minimum_should_match: 1
6482
6437
  }
6483
- }, 5, populateTermFields);
6438
+ }, 5, this.suggestTermFields);
6484
6439
  this.suggestNode = (type, suggestDefault) => (term, property) => {
6485
6440
  var _a, _b;
6486
6441
  return (((_a = property.suggestions) === null || _a === void 0 ? void 0 : _a.isUniqueKey) ? (this.suggestExistingNode(type, term, property.suggestions.isUniqueKey)) : (((_b = property.suggestions) === null || _b === void 0 ? void 0 : _b.isLinkNode) ?
@@ -6499,12 +6454,12 @@ class FilesFormComponent {
6499
6454
  [NodeType.ImpactAssessment]: this.suggestNode(NodeType.ImpactAssessment),
6500
6455
  [NodeType.Organisation]: this.suggestNode(NodeType.Organisation),
6501
6456
  [NodeType.Site]: this.suggestNode(NodeType.Site),
6502
- [NodeType.Source]: this.suggestNode(NodeType.Source, (term, { key }) => term.length < MIN_TYPEAHEAD_LENGTH$1 ?
6457
+ [NodeType.Source]: this.suggestNode(NodeType.Source, (term, { key }) => term.length < MIN_TYPEAHEAD_LENGTH ?
6503
6458
  of([]) :
6504
6459
  this.searchService.suggestSource(term, 5, [`bibliography.${key}`], [`bibliography.${key}`])),
6505
- [NodeType.Term]: this.suggestNode(NodeType.Term, (term, { suggestions }) => term.length < MIN_TYPEAHEAD_LENGTH$1 ?
6460
+ [NodeType.Term]: this.suggestNode(NodeType.Term, (term, { suggestions }) => term.length < MIN_TYPEAHEAD_LENGTH ?
6506
6461
  of([]) :
6507
- this.searchService.suggest(term, NodeType.Term, (suggestions === null || suggestions === void 0 ? void 0 : suggestions.queries) || [], null, 5, populateTermFields))
6462
+ this.searchService.suggest(term, NodeType.Term, (suggestions === null || suggestions === void 0 ? void 0 : suggestions.queries) || [], null, 5, this.suggestTermFields))
6508
6463
  };
6509
6464
  this.propertySuggest = (fullKey, suggestType) => (text$) => text$.pipe(debounceTime(suggestType === defaultSuggestionType ? 0 : 300), distinctUntilChanged(), mergeMap(term => {
6510
6465
  const property = findProperty(this.properties, fullKey);
@@ -6557,6 +6512,12 @@ class FilesFormComponent {
6557
6512
  isRequired({ value, isRequired }) {
6558
6513
  return isRequired && isEmpty(value);
6559
6514
  }
6515
+ get suggestTermFields() {
6516
+ return [
6517
+ ...populateTermFields,
6518
+ ...(this.showSuggestedDefaultProperties ? populateTermDefaultProperties : [])
6519
+ ];
6520
+ }
6560
6521
  // --- Errors
6561
6522
  enableAddError(property) {
6562
6523
  return this.errorsEditable && !property.hasError && !property.hasWarning;
@@ -6816,7 +6777,7 @@ class FilesFormComponent {
6816
6777
  }
6817
6778
  }
6818
6779
  FilesFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilesFormComponent, deps: [{ token: i0.ElementRef }, { token: HeSearchService }, { token: HeUsersService }], target: i0.ɵɵFactoryTarget.Component });
6819
- FilesFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
6780
+ FilesFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FilesFormComponent, selector: "he-files-form", inputs: { schemas: "schemas", errors: "errors", node: "node", nodeMap: "nodeMap", editable: "editable", errorMode: "errorMode", deepEditable: "deepEditable", errorsEditable: "errorsEditable", showSuggestedDefaultProperties: "showSuggestedDefaultProperties" }, outputs: { nodeChange: "nodeChange", nodeErorrResolved: "nodeErorrResolved", nodeErrorAdded: "nodeErrorAdded" }, ngImport: i0, template: "<div class=\"card\">\n <div class=\"card-toggle p-4\" (click)=\"isOpen = !isOpen\" pointer>\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"isOpen\"></fa-icon>\n <span *ngIf=\"nodeProperty\" class=\"is-px-2\"\n [class.has-text-danger]=\"nodeProperty.hasError\"\n [class.has-text-warning]=\"nodeProperty.hasWarning\"\n >\n <he-node-icon [type]=\"nodeProperty.schemaType\"></he-node-icon>\n </span>\n </div>\n\n <ng-container *ngIf=\"editable && isOpen && nodeProperty\">\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n\n <div class=\"card-content\">\n <ng-container *ngIf=\"isOpen\">\n <div class=\"pb-3 mb-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: nodeProperty}\"></ng-container>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"nodeProperty?.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: nodeProperty, edit: true}\"></ng-container>\n </div>\n </ng-container>\n\n <div class=\"columns is-multiline\">\n <ng-container *ngFor=\"let property of properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"isOpen\">\n <ng-container *ngTemplateOutlet=\"propertyMap; context: {$implicit: nodeProperty}\"></ng-container>\n </ng-container>\n </div>\n</div>\n\n<he-maps-drawing-confirm *ngIf=\"!!mapDrawingProperty\"\n [value]=\"mapDrawingProperty.value\" [modes]=\"mapDrawingModes(mapDrawingProperty)\"\n (closed)=\"onMapDrawingClosed($event)\"\n></he-maps-drawing-confirm>\n\n<he-bibliographies-search-confirm *ngIf=\"!!bibliographiesSearchProperty\"\n [search]=\"bibliographiesSearchProperty.value\"\n [searchBy]=\"bibliographiesSearchKey(bibliographiesSearchProperty)\"\n [searchSources]=\"bibliographiesSearchSources\"\n (closed)=\"onBibliographiesSearchClosed($event)\"\n></he-bibliographies-search-confirm>\n\n<ng-template #labelDescription let-property>\n <span\n class=\"trigger-popover\"\n [ngbPopover]=\"property.schema?.description\" [autoClose]=\"'outside'\"\n triggers=\"hover\" placement=\"right\" container=\"body\"\n >\n <span>{{property.key}}</span>\n </span>\n</ng-template>\n\n<ng-template #labelDefault let-property>\n <span>{{property.key}}</span>\n</ng-template>\n\n<ng-template #showProperty let-property>\n <ng-container *ngIf=\"(isOpen || property.closedVisible) && !property.isHidden\">\n <div class=\"column is-6\"\n [id]=\"property.fullKey + '_' + property.id\"\n [class.is-12]=\"property.properties.length || !property.key\"\n [ngSwitch]=\"!!property.properties.length\"\n >\n <div class=\"columns is-multiline is-variable is-1\" *ngSwitchCase=\"false\">\n <div class=\"column is-3 py-1\" *ngIf=\"property.key\">\n <label class=\"label has-text-right-tablet has-text-ellipsis\"\n *bindOnce=\"property\"\n [for]=\"property.id\"\n >\n <ng-container\n *ngTemplateOutlet=\"property.schema?.description && editable && property.editable ? labelDescription : labelDefault; context: {$implicit: property}\">\n </ng-container>\n </label>\n </div>\n\n <div class=\"column is-9 py-1\" [class.is-12]=\"!property.key\">\n <div class=\"field\">\n <ng-container *ngTemplateOutlet=\"inputForm; context: {$implicit: property}\"></ng-container>\n\n <ng-container *ngIf=\"(editable || errorsEditable) && (property.hasError || property.hasWarning)\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: false}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"panel\" *ngSwitchCase=\"true\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n [class.is-default]=\"!property.changed && !property.hasError && !property.hasWarning\"\n >\n <div class=\"open-group panel-heading py-0\"\n (click)=\"property.isOpen = !property.isOpen\" pointer\n [class.is-open]=\"property.isOpen\"\n [class.has-text-white]=\"(errorMode && property.changed) || property.hasError || property.hasWarning\"\n >\n <div class=\"columns is-mobile is-vcentered\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!property.isOpen\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"property.isOpen\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">{{property.key}}</span>\n </span>\n <span *ngIf=\"property.schemaType\" class=\"column is-narrow py-1 my-0\">\n <span class=\"tags mb-0 has-addons\">\n <span class=\"tag mb-0 is-light\">Type</span>\n <span class=\"tag mb-0 is-white\">\n <he-schema-version-link linkClass=\"is-small\" [node]=\"{'@type': property.schemaType}\">\n <span>{{property.schemaType}}</span>\n </he-schema-version-link>\n </span>\n </span>\n </span>\n <he-popover-confirm class=\"column is-narrow py-1 my-0 px-0\"\n *ngIf=\"editable && !errorsEditable\"\n ngbTooltip=\"Remove group\" placement=\"top\"\n [message]=\"'<p>This will remove the group completely.</p>' + (property.isRequired ? '<p><u>Warning: this field is required.</u></p>' : '') + '<p>Do you confirm?</p>'\"\n popoverClass=\"px-3\"\n (confirmed)=\"propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\" size=\"sm\"></fa-icon>\n </he-popover-confirm>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" *ngIf=\"property.isOpen\">\n <ng-container [ngSwitch]=\"property.isArray\">\n <div class=\"px-3 pt-4\" *ngIf=\"property.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: property, edit: true}\"></ng-container>\n </div>\n\n <div class=\"mt-3\" *ngSwitchCase=\"false\">\n <p class=\"help py-1 px-2\" *ngIf=\"editable && !property.editable\">\n To change the {{property.key}}, please delete it first, then add the field again\n </p>\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schema?.title\">\n <p class=\"help py-1 px-2\" *ngSwitchCase=\"'Bibliography'\">\n Search by Title or Document DOI to auto-populate the fields using the Mendeley catalogue\n </p>\n </ng-container>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: property}\"></ng-container>\n\n <div class=\"px-3 mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <div class=\"property-group py-2 px-3 mt-2\">\n <div class=\"columns is-multiline mb-0\">\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop2}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"py-2 px-3 mt-2\" *ngSwitchCase=\"true\">\n <div class=\"mt-1\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: property}\"></ng-container>\n </div>\n\n <ng-container *ngFor=\"let prop2 of property.properties; trackBy: trackByProperty\">\n <div class=\"card p-0 my-4\" *ngIf=\"prop2.key\"\n [id]=\"prop2.fullKey + '_' + prop2.id\"\n >\n <div class=\"property-array-number\">\n <div class=\"tags has-addons\">\n <span class=\"tag is-dark\">{{prop2.key}}</span>\n <ng-container *ngIf=\"editable && !errorsEditable && property.editable\">\n <span class=\"tag is-info\" pointer\n (click)=\"duplicateArrayGroup(property, prop2)\"\n [ngbTooltip]=\"'Duplicate ' + pluralize(property.key, 1)\" placement=\"top\"\n >\n <fa-icon icon=\"clone\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== '0'\"\n (click)=\"moveArrayGroupUp(property, prop2)\"\n ngbTooltip=\"Move Up\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-up\" size=\"sm\"></fa-icon>\n </span>\n <span class=\"tag is-light\" pointer\n *ngIf=\"prop2.key !== property.properties.length - 1\"\n (click)=\"moveArrayGroupDown(property, prop2)\"\n ngbTooltip=\"Move Down\" placement=\"top\"\n >\n <fa-icon icon=\"long-arrow-alt-down\" size=\"sm\"></fa-icon>\n </span>\n <he-popover-confirm class=\"tag is-delete\"\n [ngbTooltip]=\"'Remove ' + pluralize(property.key, 1)\" placement=\"top\"\n message=\"This will remove the group completely. Do you confirm?\" position=\"right\"\n (confirmed)=\"removeArrayGroup(property, prop2)\"\n ></he-popover-confirm>\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngTemplateOutlet=\"showNewProperty; context: {$implicit: prop2}\"></ng-container>\n\n <div class=\"px-4 mt-2\" *ngIf=\"errorsEditable\">\n <ng-container *ngTemplateOutlet=\"nodeErrorForm; context: {$implicit: prop2}\"></ng-container>\n </div>\n\n <div class=\"px-4 mt-2\" *ngIf=\"prop2.error\">\n <ng-container *ngTemplateOutlet=\"propertyError; context: {property: prop2, edit: true}\"></ng-container>\n </div>\n\n <div class=\"property-group card-content p-3\">\n <div class=\"columns is-multiline my-0\">\n <ng-container *ngFor=\"let prop3 of prop2.properties; trackBy: trackByProperty\">\n <ng-container *ngTemplateOutlet=\"showProperty; context: {$implicit: prop3}\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n\n <button class=\"button is-dark is-outlined is-small\" type=\"button\"\n *ngIf=\"editable && !errorsEditable\"\n (click)=\"addArrayGroup(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n <span class=\"pl-1\">{{property.key | pluralize:1}}</span>\n </button>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #inputForm let-property>\n <ng-container *ngIf=\"property.key\">\n <ng-container [ngSwitch]=\"property.suggestions?.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <ng-container *ngTemplateOutlet=\"inputSelect; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngTemplateOutlet=\"inputInput; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #inputInput let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\"\n [class.has-icons-right]=\"property.loading\"\n >\n <input class=\"input is-small search-input\"\n [class.is-dark]=\"property.key === 'type'\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [type]=\"property.schema?.type === 'number' ? 'number' : 'string'\"\n [id]=\"property.id\"\n name=\"randomname\"\n [readonly]=\"!editable || !property.editable || property.schema?.internal\"\n [placeholder]=\"property.placeholder\"\n [appTagsInput]=\"{enabled: editable && property.editable && property.schema?.type === 'array', items: property.schema?.items, delimiter: ';', allowDuplicates: true, placeholder: property.placeholder}\"\n (change)=\"propertyChanged($event.target.value, property)\"\n\n [pattern]=\"property.schema?.pattern\"\n [required]=\"property.fullKey.endsWith('id') && property.fullKey !== 'id'\"\n [min]=\"property.schema?.minimum\"\n [max]=\"property.schema?.maximum\"\n\n [ngbTypeahead]=\"propertySuggest(property.fullKey, property.suggestions?.type)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"true\"\n (focus)=\"editable && property.editable && typeaheadFocus($event)\"\n (selectItem)=\"suggestionSelected($event.item, property)\"\n >\n\n <span class=\"icon is-small is-right has-text-grey-dark\" [class.is-hidden]=\"!property.loading\">\n <fa-icon icon=\"spinner\" [pulse]=\"true\" size=\"sm\"></fa-icon>\n </span>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n <p class=\"help is-danger-light\"\n *ngIf=\"!property.hasError && propertyModel.invalid\"\n >\n <span *bindOnce=\"propertyModel.errors\" [innerHTML]=\"formatPropertyError(propertyModel.errors, property)\"></span>\n </p>\n</ng-template>\n\n<ng-template #inputSelect let-property>\n <div class=\"field mb-0\" [class.has-addons]=\"hasAddons(property)\">\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth\"\n [class.is-link]=\"errorMode && property.changed\"\n [class.is-danger]=\"(!property.changed && property.hasError) || isRequired(property)\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n >\n <select\n [(ngModel)]=\"property.value\" #propertyModel=\"ngModel\"\n [id]=\"property.id\"\n name=\"randomname\"\n [disabled]=\"!editable || !property.editable || property.schema?.internal\"\n (change)=\"propertyChanged($event.target.value, property)\"\n >\n <option value=\"\">Select</option>\n <ng-container *bindOnce=\"property.suggestions\">\n <option *ngFor=\"let value of property.suggestions.values; trackBy: trackByIndex\" [value]=\"value\">{{value}}</option>\n </ng-container>\n </select>\n </div>\n </div>\n <ng-container *ngTemplateOutlet=\"inputAddons; context: {$implicit: property}\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #removeFieldAddon let-property>\n <div class=\"control\" *ngIf=\"!errorsEditable && !property.isRequired\">\n <a class=\"button is-small\" title=\"Remove field\"\n [class.is-outlined]=\"!property.changed && (property.hasError || property.hasWarning)\"\n [class.is-danger]=\"!property.changed && property.hasError\"\n [class.is-warning]=\"!property.changed && property.hasWarning\"\n (click)=\"$event.stopPropagation(); propertyChanged(null, property)\"\n >\n <fa-icon icon=\"times\"></fa-icon>\n </a>\n </div>\n</ng-template>\n\n<ng-template #inputAddons let-property>\n <he-popover-confirm class=\"control\"\n *ngIf=\"enableAddError(property)\"\n position=\"left\"\n [content]=\"popupErrorForm\"\n (confirmed)=\"addError(property, $event)\"\n >\n <span class=\"button is-small\">\n <fa-icon icon=\"comments\"></fa-icon>\n </span>\n </he-popover-confirm>\n\n <ng-container *ngIf=\"editable && property.editable\">\n <ng-container [ngSwitch]=\"property.schemaType\">\n <ng-container *ngSwitchCase=\"SchemaType.Actor\">\n <ng-container *ngTemplateOutlet=\"actorAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"SchemaType.Cycle\">\n <ng-container *ngTemplateOutlet=\"cycleAddons; context: {$implicit: property}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *bindOnce=\"property\">\n <div class=\"control\" *ngIf=\"mapDrawingModes(property).length\">\n <button class=\"button is-small\" title=\"Pick on Map\"\n (click)=\"mapDrawingProperty = property\"\n >\n <fa-icon icon=\"map-marked-alt\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"bibliographiesSearchKey(property)\">\n <button class=\"button is-small\" title=\"Advanced Search\"\n (click)=\"bibliographiesSearchProperty = property\"\n >\n <fa-icon icon=\"search\"></fa-icon>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"removeFieldAddon; context: {$implicit: property}\"></ng-container>\n </ng-container>\n <div class=\"control\" *ngIf=\"addPropertyEnabled(property)\">\n <a class=\"button is-small is-danger\" title=\"Add field\"\n (click)=\"$event.stopPropagation(); addMissingProperty(property)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </a>\n </div>\n <div class=\"control\" *ngIf=\"isRequired(property)\">\n <label class=\"button is-small is-danger\" [for]=\"property.id\"\n ngbTooltip=\"This field is required\" placement=\"top\"\n >\n <fa-icon icon=\"exclamation-triangle\"></fa-icon>\n </label>\n </div>\n <ng-container *ngIf=\"property.externalUrl?.url\">\n <div class=\"control\">\n <a class=\"button is-small\"\n [href]=\"property.externalUrl.url + (property.externalUrl.urlParamValue ? property.value : '')\"\n target=\"_blank\"\n [title]=\"property.externalUrl.title\"\n [ngClass]=\"{'is-dark is-outlined': property.key === 'type'}\"\n [attr.disabled]=\"property.externalUrl.urlParamValue && !property.value ? true : null\"\n >\n <fa-icon [icon]=\"property.externalUrl.icon || 'external-link-alt'\"></fa-icon>\n </a>\n </div>\n </ng-container>\n <ng-container *ngIf=\"unitConverterEnabled(property)\">\n <div class=\"control\">\n <button class=\"button is-small\" title=\"Open calculator\"\n [ngbPopover]=\"convertUnits\" autoClose=\"outside\"\n triggers=\"manual\" #p=\"ngbPopover\" placement=\"bottom\" container=\"body\"\n (click)=\"openUnitConverter(p, property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #actorAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === '@id'\">\n <button class=\"button is-small\" title=\"Add myself as Actor\"\n (click)=\"setUserActorId(property)\"\n >\n <fa-icon [icon]=\"['far', 'id-badge']\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #cycleAddons let-property>\n <div class=\"control\" *ngIf=\"property.key === 'cycleDuration'\">\n <button class=\"button is-small\" title=\"Calculate value from startDate and endDate\"\n (click)=\"calculateCycleDuration(property)\"\n [disabled]=\"!calculateCycleDurationEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n <div class=\"control\" *ngIf=\"property.key === 'startDate'\">\n <button class=\"button is-small\" title=\"Calculate value from endDate and cycleDuration\"\n (click)=\"calculateCycleStartDate(property)\"\n [disabled]=\"!calculateCycleStartDateEnabled(property)\"\n >\n <fa-icon icon=\"calculator\"></fa-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #showNewProperty let-property>\n <header class=\"card-header\" *ngIf=\"editable && property.editable && (property.addPropertyEnabled || deepEditable); else padder\">\n <form class=\"py-3 px-4 is-flex-grow-1\" (submit)=\"addProperty(property)\" novalidate>\n <div class=\"field is-horizontal\">\n <div class=\"field-label is-small\">\n <label class=\"label\" [for]=\"property.id + '_new'\">\n <span>Add new field</span>\n </label>\n </div>\n <div class=\"field-body\">\n <div class=\"field has-addons\">\n <div class=\"control is-expanded\">\n <input class=\"input is-small\"\n [(ngModel)]=\"property.newProperty\"\n [id]=\"property.id + '_new'\"\n name=\"randomname\"\n placeholder=\"Search and select field from results\"\n\n [ngbTypeahead]=\"suggestNewProperty(property.fullKey)\"\n [resultTemplate]=\"suggestion\"\n [inputFormatter]=\"formatter\"\n [focusFirst]=\"false\"\n [editable]=\"false\"\n (focus)=\"typeaheadFocus($event)\"\n >\n </div>\n <div class=\"control\">\n <button class=\"button is-small\" type=\"submit\"\n [disabled]=\"!property.newProperty || !property.newProperty.name\"\n >\n <fa-icon icon=\"plus\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </form>\n </header>\n</ng-template>\n\n<ng-template #propertyError let-property=\"property\" let-edit=\"edit\">\n <p class=\"help\"\n [class.is-danger]=\"property.hasError\"\n [class.is-warning]=\"property.hasWarning\"\n *ngIf=\"property.error\"\n >\n <span class=\"is-pre-wrap\" *bindOnce=\"property.error\" [innerHTML]=\"property.error.message\"></span>\n <a class=\"pl-2\"\n *ngIf=\"edit && errorsEditable && property.error.index >= 0\"\n (click)=\"editError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"edit\"></fa-icon>\n <span>Edit</span>\n </a>\n <a class=\"pl-2\"\n *ngIf=\"(property.hasWarning || errorsEditable) && property.error.index >= 0\"\n (click)=\"resolveError(property)\"\n >\n <fa-icon class=\"pr-2\" icon=\"check\"></fa-icon>\n <span>Resolved</span>\n </a>\n </p>\n</ng-template>\n\n<ng-template #propertyMap let-property>\n <div class=\"panel is-default\" *ngIf=\"showMap\">\n <div class=\"open-group panel-heading py-0\"\n (click)=\"mapVisible = !mapVisible\" pointer\n [class.is-open]=\"mapVisible\"\n >\n <div class=\"columns is-mobile is-vcentered mb-0\">\n <span class=\"column is-narrow py-1 my-0\">\n <fa-icon icon=\"angle-down\" [class.is-hidden]=\"!mapVisible\"></fa-icon>\n <fa-icon icon=\"angle-right\" [class.is-hidden]=\"mapVisible\"></fa-icon>\n </span>\n <span class=\"column py-1 my-0\">\n <span class=\"is-size-6\">View on Map</span>\n </span>\n </div>\n </div>\n <div class=\"panel-block is-block p-0\" [class.is-hidden]=\"!mapVisible\">\n <he-sites-maps [sites]=\"[node]\" [showNotice]=\"false\"></he-sites-maps>\n </div>\n </div>\n</ng-template>\n\n<ng-template #nodeErrorForm let-property>\n <ng-container *ngIf=\"property.newError && property.editable\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select is-small\">\n <select [(ngModel)]=\"property.newError.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control is-expanded\">\n <textarea class=\"textarea is-small\"\n [(ngModel)]=\"property.newError.message\"\n placeholder=\"Enter your message here\"\n rows=\"1\"\n ></textarea>\n </div>\n <div class=\"control\">\n <button class=\"button is-small\"\n [disabled]=\"!property.newError.level || !property.newError.message\"\n (click)=\"addError(property, property.newError)\"\n >\n <fa-icon icon=\"plus-circle\"></fa-icon>\n <span class=\"pl-2\">Add</span>\n </button>\n </div>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #popupErrorForm let-data=\"data\">\n <div class=\"field has-addons\">\n <div class=\"control\">\n <div class=\"select\">\n <select [(ngModel)]=\"data.level\">\n <option [value]=\"undefined\">Select Level</option>\n <option value=\"error\">Error</option>\n <option value=\"warning\">Warning</option>\n </select>\n </div>\n </div>\n <div class=\"control\">\n <input class=\"input\"\n [(ngModel)]=\"data.message\"\n placeholder=\"Enter your message here\"\n >\n </div>\n </div>\n</ng-template>\n\n<ng-template #suggestion let-r=\"result\" let-t=\"term\">\n <ngb-highlight\n [title]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [result]=\"r.bibliography?.title || r.bibliography?.documentDOI || r.bibliography?.scopus || r.name\"\n [term]=\"t\"\n ></ngb-highlight>\n</ng-template>\n\n<ng-template #padder>\n <div class=\"pt-1\"></div>\n</ng-template>\n\n<ng-template #convertUnits let-value=\"value\" let-term=\"term\" let-units=\"units\">\n <he-unit-converter [value]=\"value\" [term]=\"term\" [toUnits]=\"units\"></he-unit-converter>\n</ng-template>\n", styles: [".panel.is-default .panel-heading{background-color:#ededed;color:#363636}.card-toggle{left:0;position:absolute;top:0}@media screen and (max-width: 768px){.card-toggle{position:relative}}.card-toggle>fa-icon{display:inline-block;width:10px}.card{overflow:visible}.card .card{box-shadow:2px 2px #36363652,0 0 0 1px #36363652}.card .card>.card-header{box-shadow:0 2px 1px #36363652}.property-array-number{left:-4px;position:absolute;top:-12px}.property-array-number .tag.is-delete{border:1px solid rgba(54,54,54,.32)}.control>.button{height:100%}.is-danger-light{color:#f5758f}he-sites-maps{height:200px}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: NodeIconComponent, selector: "he-node-icon", inputs: ["type", "size"] }, { type: MapsDrawingConfirmComponent, selector: "he-maps-drawing-confirm", inputs: ["value", "modes", "center", "zoom"], outputs: ["closed"] }, { type: BibliographiesSearchConfirmComponent, selector: "he-bibliographies-search-confirm", inputs: ["search", "searchSources", "searchBibliographies", "searchBy"], outputs: ["closed"] }, { type: SchemaVersionLinkComponent, selector: "he-schema-version-link", inputs: ["node", "showExternalLink", "linkClass", "text"] }, { type: PopoverConfirmComponent, selector: "he-popover-confirm", inputs: ["message", "content", "position", "popoverClass"], outputs: ["confirmed"] }, { type: SitesMapsComponent, selector: "he-sites-maps", inputs: ["loadPolygons", "sites", "selected", "nodes", "center", "zoom", "showNotice"] }, { type: i10.NgbHighlight, selector: "ngb-highlight", inputs: ["highlightClass", "result", "term"] }, { type: UnitConverterComponent, selector: "he-unit-converter", inputs: ["term", "value", "fromUnits", "toUnits"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgbPopover, selector: "[ngbPopover]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disablePopover", "popoverClass", "openDelay", "closeDelay", "ngbPopover", "popoverTitle"], outputs: ["shown", "hidden"], exportAs: ["ngbPopover"] }, { type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: BindOnceDirective, selector: "[bindOnce]", inputs: ["bindOnce"] }, { type: i10.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i6.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgbTypeahead, selector: "input[ngbTypeahead]", inputs: ["autocomplete", "placement", "container", "editable", "focusFirst", "showHint", "inputFormatter", "ngbTypeahead", "resultFormatter", "resultTemplate"], outputs: ["selectItem"], exportAs: ["ngbTypeahead"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: TagsInputDirective, selector: "[appTagsInput]", inputs: ["appTagsInput"] }, { type: i1$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { type: i1$4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1$4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1$4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], pipes: { "pluralize": PluralizePipe } });
6820
6781
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FilesFormComponent, decorators: [{
6821
6782
  type: Component$1,
6822
6783
  args: [{
@@ -6840,6 +6801,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
6840
6801
  type: Input
6841
6802
  }], errorsEditable: [{
6842
6803
  type: Input
6804
+ }], showSuggestedDefaultProperties: [{
6805
+ type: Input
6843
6806
  }], nodeChange: [{
6844
6807
  type: Output
6845
6808
  }], nodeErorrResolved: [{
@@ -7190,7 +7153,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
7190
7153
  }] } });
7191
7154
 
7192
7155
  const orderBy = require('lodash.orderby');
7193
- const MIN_TYPEAHEAD_LENGTH = 1;
7194
7156
  var View;
7195
7157
  (function (View) {
7196
7158
  View["table"] = "table";
@@ -7386,5 +7348,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
7386
7348
  * Generated bundle index. Do not edit.
7387
7349
  */
7388
7350
 
7389
- export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesResultComponent, DefaultPipe, DeltaColour, DeltaDisplayType, DiffsDisplayType, EllipsisPipe, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, calculatePercentDelta, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, customDeltaFuncs, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, delta, deserializeSearchFilters, ellipsis, emptyValue, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatLinkNodesSuggestions, formatPropertyError, formatSuggestion, gitBranch, gitHome, gitRawBaseUrl, groupChanged, groupNodesByTerm, grouppedKeys, grouppedValueKeys, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, keyToLabel, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, propertyValue$1 as propertyValue, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, roundValue, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, toDashCase, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
7351
+ export { ARRAY_DELIMITER, BibliographiesSearchConfirmComponent, BindOnceDirective, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, ClickOutsideDirective, ClipboardComponent, CyclesActivityComponent, CyclesActivityLogsComponent, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesEmissionsComponent, CyclesEmissionsLogsComponent, CyclesFunctionalUnitMeasureComponent, CyclesPracticesComponent, CyclesPracticesLogsComponent, CyclesResultComponent, DefaultPipe, DeltaColour, DiffsDisplayType, EllipsisPipe, FilesFormComponent, GetPipe, HE_API_BASE_URL, HE_ORCHESTRATOR_BASE_URL, HeAggregationEngineService, HeAuthService, HeBibliographiesModule, HeCommonLightModule, HeCommonModule, HeCommonService, HeCyclesModule, HeEngineService, HeFilesModule, HeFontawesomeModule, HeImpactAssessmentsModule, HeMendeleyService, HeNodeCsvService, HeNodeModule, HeNodeService, HeSchemaService, HeSearchModule, HeSearchService, HeSitesModule, HeToastService, HeUsersService, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, ImpactAssessmentsProductsLogsComponent, KeyToLabelPipe, KeysPipe, Level, LinkKeyValueComponent, MAX_RESULTS, MapsDrawingConfirmComponent, MendeleySearchResult, NodeCsvExportConfirmComponent, NodeCsvSelectHeadersComponent, NodeDiffsComponent, NodeIconComponent, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeMissingLookupFactorsComponent, NodeValueDetailsComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, SchemaVersionLinkComponent, SitesMapsComponent, SitesMeasurementsComponent, SitesMeasurementsLogsComponent, SkeletonTextComponent, SocialTagsComponent, TagsInputDirective, TimesPipe, ToastComponent, UnitConverterComponent, addPolygonToFeature, allCountriesQuery, arrayValue, availableProperties, baseUrl, bottom, buildSummary, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, clustererImage, code, coordinatesToPoint, countriesQuery, createMarker, cropsQuery, dataPathToKey, defaultFeature, defaultLabel, defaultSuggestionType, definitionToSchemaType, deserializeSearchFilters, ellipsis, errorHasError, errorHasWarning, errorText, evaluateSuccess, filenameWithoutExt, fillColor, fillStyle, filterError, filterParams, findConfigModels, findProperty, findPropertyById, formatCustomErrorMessage, formatError, formatPropertyError, gitBranch, gitHome, gitRawBaseUrl, groupChanged, groupNodesByTerm, grouppedKeys, grouppedValueKeys, handleAPIError, hasError, hasWarning, isAddPropertyEnabled, isChrome, isExternal, isMissingOneOfError, isMissingPropertyError, isSchemaIri, isScrolledBelow, itemColor, keyToDataPath, levels, linkTypeEnabled, listColor, locationQuery, lookupUrl, lookups, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, missingNodeErrorMessage, missingNodeErrors, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeLink, nodeLogsUrl, nodeUrl, numberGte, parentKey, parentProperty, parseData, parseDataPath, parseLines, parseMessage, parseNewValue, pathToApiDocsPath, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonsFromFeature, primaryProduct, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, repeat, safeJSONParse, safeJSONStringify, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchQuery, searchResultsFields, searchableTypes, serializeSearchFilters, siblingProperty, singleProperty, siteTooBig, sortOrder, sortProperties, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, termChildToParent, termLocation, termLocationName, termProperties, termTypeGroups, termTypeLabel, termTypeLookupUrl, toCsv$1 as toCsv, typeToNewProperty, updateProperties, valueTypeToDefault, waitFor, wildcardQuery, worldRegion };
7390
7352
  //# sourceMappingURL=hestia-earth-ui-components.js.map