@hestia-earth/ui-components 0.40.21 → 0.40.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ import { catchError, of, map, debounceTime, distinctUntilChanged, tap, switchMap
|
|
|
10
10
|
import { HttpClient } from '@angular/common/http';
|
|
11
11
|
import get from 'lodash.get';
|
|
12
12
|
import { SCHEMA_VERSION, SchemaType, NodeType, TermTermType, productTermTermType, nestedSearchableKeys, SiteSiteType, EmissionMethodTier, isExpandable, sortKeysByType, isTypeNode, BlankNodesKey, impactAssessmentTermTermType, measurementTermTermType, emissionTermTermType, inputTermTermType, CycleFunctionalUnit, NonBlankNodesKey, jsonldPath, isTypeValid, isTypeBlankNode, typeToSchemaType, infrastructureTermTermType, managementTermTermType } from '@hestia-earth/schema';
|
|
13
|
-
import { isUndefined, isEmpty, toPrecision, ellipsis as ellipsis$1, sum, toComma, isNumber, getPercentileValue, unique, monthsBefore, keyToLabel, isEqual as isEqual$2, max, toDashCase, diffInDays, min } from '@hestia-earth/utils';
|
|
13
|
+
import { isUndefined, isEmpty, toPrecision, ellipsis as ellipsis$1, sum, toComma, isNumber, getPercentileValue, unique, monthsBefore, duration, keyToLabel, isEqual as isEqual$2, max, toDashCase, diffInDays, min } from '@hestia-earth/utils';
|
|
14
14
|
import Gradient from 'javascript-color-gradient';
|
|
15
15
|
import { ShadeGenerator } from 'shade-generator/dist/shadeGenerator';
|
|
16
16
|
import { Chart, BarController, LineController, CategoryScale, LinearScale, PointElement, BarElement, LineElement, Title, Tooltip, Legend, TimeScale } from 'chart.js';
|
|
@@ -181,8 +181,12 @@ var Template;
|
|
|
181
181
|
})(Template || (Template = {}));
|
|
182
182
|
const reportIssueUrl = (repository, template, issueParams = {}) => [
|
|
183
183
|
`${gitHome}/${repository}/-/issues/new`,
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
[
|
|
185
|
+
template ? `issuable_template=${template}` : '',
|
|
186
|
+
...Object.entries(issueParams).map(([key, value]) => key && value ? `issue[${key}]=${encodeURIComponent(value)}` : null)
|
|
187
|
+
]
|
|
188
|
+
.filter(Boolean)
|
|
189
|
+
.join('&')
|
|
186
190
|
]
|
|
187
191
|
.filter(Boolean)
|
|
188
192
|
.join('?');
|
|
@@ -4436,29 +4440,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4436
4440
|
}]
|
|
4437
4441
|
}] });
|
|
4438
4442
|
|
|
4439
|
-
const parseTime = (timeInMs) => ({
|
|
4440
|
-
milliseconds: Math.floor(timeInMs % 1000),
|
|
4441
|
-
seconds: Math.floor((timeInMs / 1000) % 60),
|
|
4442
|
-
minutes: Math.floor((timeInMs / (1000 * 60)) % 60),
|
|
4443
|
-
hours: Math.floor((timeInMs / (1000 * 60 * 60)) % 24),
|
|
4444
|
-
days: Math.floor(timeInMs / (1000 * 60 * 60 * 24))
|
|
4445
|
-
});
|
|
4446
|
-
const formatValue = (value, suffix) => (value ? `${value}${suffix}` : '');
|
|
4447
|
-
const duration = (timeInMs, includeMs = false) => {
|
|
4448
|
-
const { milliseconds, seconds, minutes, hours, days } = parseTime(timeInMs);
|
|
4449
|
-
return [
|
|
4450
|
-
formatValue(days, 'd'),
|
|
4451
|
-
formatValue(hours, 'h'),
|
|
4452
|
-
formatValue(minutes, 'm'),
|
|
4453
|
-
formatValue(seconds, 's'),
|
|
4454
|
-
includeMs ? formatValue(milliseconds, 'ms') : ''
|
|
4455
|
-
]
|
|
4456
|
-
.filter(v => v !== '')
|
|
4457
|
-
.join(' ');
|
|
4458
|
-
};
|
|
4459
4443
|
class DurationPipe {
|
|
4460
|
-
|
|
4461
|
-
|
|
4444
|
+
constructor() {
|
|
4445
|
+
this.transform = duration;
|
|
4462
4446
|
}
|
|
4463
4447
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4464
4448
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: DurationPipe, isStandalone: true, name: "duration" }); }
|