@sumaris-net/ngx-components 1.23.43 → 1.23.45
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/sumaris-net.ngx-components.umd.js +26 -84
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +3 -0
- package/esm2015/src/app/core/icon/icon.component.js +2 -2
- package/esm2015/src/app/core/services/model/referential.model.js +8 -3
- package/esm2015/src/app/shared/graph/graph-colors.js +15 -70
- package/fesm2015/sumaris-net.ngx-components.js +24 -73
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/model/referential.model.d.ts +3 -0
- package/src/app/shared/graph/graph-colors.d.ts +7 -9
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
var SPACE_PLACEHOLDER_CHAR = '\u2000';
|
|
48
48
|
var KEYBOARD_HIDE_DELAY_MS = 250; // 1s
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
/*! *****************************************************************************
|
|
51
51
|
Copyright (c) Microsoft Corporation.
|
|
52
52
|
|
|
53
53
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -209,11 +209,7 @@
|
|
|
209
209
|
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
210
210
|
if (k2 === undefined)
|
|
211
211
|
k2 = k;
|
|
212
|
-
|
|
213
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
214
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
215
|
-
}
|
|
216
|
-
Object.defineProperty(o, k2, desc);
|
|
212
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
217
213
|
}) : (function (o, m, k, k2) {
|
|
218
214
|
if (k2 === undefined)
|
|
219
215
|
k2 = k;
|
|
@@ -368,11 +364,6 @@
|
|
|
368
364
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
369
365
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
370
366
|
}
|
|
371
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
372
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
373
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
374
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
375
|
-
}
|
|
376
367
|
|
|
377
368
|
function isNil(obj) {
|
|
378
369
|
return obj === undefined || obj === null;
|
|
@@ -15218,7 +15209,8 @@
|
|
|
15218
15209
|
minify: true,
|
|
15219
15210
|
keepTypename: true,
|
|
15220
15211
|
keepEntityName: true,
|
|
15221
|
-
keepLocalId: true
|
|
15212
|
+
keepLocalId: true,
|
|
15213
|
+
keepIcon: true
|
|
15222
15214
|
});
|
|
15223
15215
|
/**
|
|
15224
15216
|
* Used to send an entity to a pod
|
|
@@ -15227,7 +15219,8 @@
|
|
|
15227
15219
|
minify: true,
|
|
15228
15220
|
keepTypename: false,
|
|
15229
15221
|
keepEntityName: false,
|
|
15230
|
-
keepLocalId: false
|
|
15222
|
+
keepLocalId: false,
|
|
15223
|
+
keepIcon: false
|
|
15231
15224
|
});
|
|
15232
15225
|
// @dynamic
|
|
15233
15226
|
exports.ReferentialRef = ReferentialRef_1 = /** @class */ (function (_super) {
|
|
@@ -15246,6 +15239,8 @@
|
|
|
15246
15239
|
var target = _super.prototype.asObject.call(this, opts);
|
|
15247
15240
|
if (opts && opts.keepEntityName === false)
|
|
15248
15241
|
delete target.entityName;
|
|
15242
|
+
if (opts && opts.keepIcon === false)
|
|
15243
|
+
delete target.icon;
|
|
15249
15244
|
return target;
|
|
15250
15245
|
};
|
|
15251
15246
|
ReferentialRef.prototype.fromObject = function (source, opts) {
|
|
@@ -15256,6 +15251,7 @@
|
|
|
15256
15251
|
this.description = source.description;
|
|
15257
15252
|
this.statusId = source.statusId;
|
|
15258
15253
|
this.levelId = source.levelId;
|
|
15254
|
+
this.icon = source.icon;
|
|
15259
15255
|
};
|
|
15260
15256
|
return ReferentialRef;
|
|
15261
15257
|
}(Entity));
|
|
@@ -21687,10 +21683,6 @@
|
|
|
21687
21683
|
return null;
|
|
21688
21684
|
return new Color([+parts[0], +parts[1], +parts[2]], parts.length === 4 && +parts[3] || 1, 'custom');
|
|
21689
21685
|
};
|
|
21690
|
-
Color.parseHexa = function (hexColor) {
|
|
21691
|
-
var split = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor);
|
|
21692
|
-
return new Color(split ? split.slice(1, 4).map(function (i) { return parseInt(i, 16); }) : [0, 0, 0]);
|
|
21693
|
-
};
|
|
21694
21686
|
Object.defineProperty(Color.prototype, "name", {
|
|
21695
21687
|
get: function () {
|
|
21696
21688
|
return this._name;
|
|
@@ -21751,14 +21743,13 @@
|
|
|
21751
21743
|
// @dynamic
|
|
21752
21744
|
var ColorScale = /** @class */ (function () {
|
|
21753
21745
|
function ColorScale(colorArray, options) {
|
|
21754
|
-
this.colorArray = colorArray;
|
|
21755
21746
|
options = options || {};
|
|
21756
21747
|
// reserved last colors for value > max
|
|
21757
21748
|
var nbIntervalBeforeUpper = !options.upperMax ? colorArray.length : (colorArray.length - 1);
|
|
21758
21749
|
this._min = options.min || 0;
|
|
21759
21750
|
this._max = options.max || nbIntervalBeforeUpper;
|
|
21760
21751
|
this._rangeSize = Math.round((this._max - this._min) / nbIntervalBeforeUpper);
|
|
21761
|
-
this._legendItems = this.
|
|
21752
|
+
this._legendItems = this.computeLegendItems(colorArray);
|
|
21762
21753
|
}
|
|
21763
21754
|
ColorScale.default = function () {
|
|
21764
21755
|
return ColorScale.custom(25);
|
|
@@ -21793,17 +21784,20 @@
|
|
|
21793
21784
|
enumerable: false,
|
|
21794
21785
|
configurable: true
|
|
21795
21786
|
});
|
|
21796
|
-
ColorScale.prototype.
|
|
21797
|
-
var index = Math.floor(value * (this.
|
|
21798
|
-
return this.
|
|
21787
|
+
ColorScale.prototype.getLegendForValue = function (value) {
|
|
21788
|
+
var index = Math.floor(value * (this._legendItems.length - 1) / this._max);
|
|
21789
|
+
return this._legendItems[index];
|
|
21799
21790
|
};
|
|
21800
|
-
ColorScale.prototype.
|
|
21791
|
+
ColorScale.prototype.getLegendAtIndex = function (index) {
|
|
21792
|
+
return this._legendItems[index];
|
|
21793
|
+
};
|
|
21794
|
+
ColorScale.prototype.computeLegendItems = function (colorArray) {
|
|
21801
21795
|
var _this = this;
|
|
21802
|
-
return
|
|
21796
|
+
return colorArray.map(function (color, index) {
|
|
21803
21797
|
var start = index * _this._rangeSize;
|
|
21804
21798
|
var end = start + _this._rangeSize;
|
|
21805
21799
|
return {
|
|
21806
|
-
color: color,
|
|
21800
|
+
color: new Color(color),
|
|
21807
21801
|
label: (end < _this._max) ? start.toLocaleString() + " - " + end.toLocaleString() : " >= " + start
|
|
21808
21802
|
};
|
|
21809
21803
|
});
|
|
@@ -21813,12 +21807,10 @@
|
|
|
21813
21807
|
ColorScale.custom = function (count, options) {
|
|
21814
21808
|
options = options || {};
|
|
21815
21809
|
return new ColorScale(linearColorGradientWithIntermediate(count, {
|
|
21816
|
-
opacity: options.opacity,
|
|
21817
21810
|
startColor: options.startColor || undefined,
|
|
21818
21811
|
mainColor: options.mainColor || undefined,
|
|
21819
21812
|
mainColorIndex: isNotNil(options.mainColorIndex) ? options.mainColorIndex : undefined,
|
|
21820
|
-
endColor: options.endColor || undefined
|
|
21821
|
-
format: options.format
|
|
21813
|
+
endColor: options.endColor || undefined
|
|
21822
21814
|
}), options);
|
|
21823
21815
|
};
|
|
21824
21816
|
// Fill colorsMap
|
|
@@ -21826,29 +21818,6 @@
|
|
|
21826
21818
|
.forEach(function (key) {
|
|
21827
21819
|
colorsMap[key] = new Color(rgbArrayMap[key], 1, key);
|
|
21828
21820
|
});
|
|
21829
|
-
// Internal function
|
|
21830
|
-
function state2side(state) {
|
|
21831
|
-
switch (state) {
|
|
21832
|
-
case 0:
|
|
21833
|
-
return 0;
|
|
21834
|
-
case 1:
|
|
21835
|
-
return -1;
|
|
21836
|
-
case 2:
|
|
21837
|
-
return 0;
|
|
21838
|
-
case 3:
|
|
21839
|
-
return 1;
|
|
21840
|
-
}
|
|
21841
|
-
}
|
|
21842
|
-
var ɵ0$b = function (defaultStateSize) { return [
|
|
21843
|
-
Math.round((rgbArrayMap.red[0] - 50) / defaultStateSize),
|
|
21844
|
-
Math.round((255 - rgbArrayMap.red[1]) / defaultStateSize),
|
|
21845
|
-
Math.round((255 - rgbArrayMap.red[2]) / defaultStateSize)
|
|
21846
|
-
]; };
|
|
21847
|
-
var SCALE_OPTIONS_DEFAULT = {
|
|
21848
|
-
startColor: rgbArrayMap.red,
|
|
21849
|
-
startStates: [0, 2, 3],
|
|
21850
|
-
startStepsFn: ɵ0$b
|
|
21851
|
-
};
|
|
21852
21821
|
/**
|
|
21853
21822
|
* Internal function, that create a colors scale, using iteration
|
|
21854
21823
|
*
|
|
@@ -21861,34 +21830,26 @@
|
|
|
21861
21830
|
function linearColorGradientWithIntermediate(count, options) {
|
|
21862
21831
|
options = options || {};
|
|
21863
21832
|
// From [0,1]
|
|
21864
|
-
options.opacity = (options.opacity > 0 && options.opacity < 1) ? options.opacity : 1;
|
|
21865
21833
|
options.startColor = options.startColor || [255, 255, 190]; // default start = creme
|
|
21866
21834
|
options.mainColorIndex = options.mainColorIndex && options.mainColorIndex < count - 1 ? options.mainColorIndex : count - 1;
|
|
21867
21835
|
options.endColor = options.endColor || [255, 0, 0]; // default main = red
|
|
21868
|
-
options.format = options.format || 'rgb';
|
|
21869
21836
|
if (!options.mainColor) {
|
|
21870
21837
|
return linearColorGradient(count, {
|
|
21871
|
-
opacity: options.opacity,
|
|
21872
21838
|
startColor: options.startColor,
|
|
21873
|
-
endColor: options.endColor
|
|
21874
|
-
format: options.format
|
|
21839
|
+
endColor: options.endColor
|
|
21875
21840
|
});
|
|
21876
21841
|
}
|
|
21877
21842
|
else {
|
|
21878
21843
|
// Step 1: startColor -> mainColor
|
|
21879
21844
|
var result = linearColorGradient(options.mainColorIndex + 1, {
|
|
21880
|
-
opacity: options.opacity,
|
|
21881
21845
|
startColor: options.startColor,
|
|
21882
|
-
endColor: options.mainColor
|
|
21883
|
-
format: options.format
|
|
21846
|
+
endColor: options.mainColor
|
|
21884
21847
|
});
|
|
21885
21848
|
// Step 2: mainColor -> endColor
|
|
21886
21849
|
if (options.mainColorIndex < count - 1) {
|
|
21887
21850
|
return result.concat(linearColorGradient(count - options.mainColorIndex, {
|
|
21888
|
-
opacity: options.opacity,
|
|
21889
21851
|
startColor: options.mainColor,
|
|
21890
|
-
endColor: options.endColor
|
|
21891
|
-
format: options.format
|
|
21852
|
+
endColor: options.endColor
|
|
21892
21853
|
}));
|
|
21893
21854
|
}
|
|
21894
21855
|
else {
|
|
@@ -21899,10 +21860,8 @@
|
|
|
21899
21860
|
function linearColorGradient(count, options) {
|
|
21900
21861
|
options = options || {};
|
|
21901
21862
|
// From [0,1]
|
|
21902
|
-
options.opacity = (options.opacity > 0 && options.opacity < 1) ? options.opacity : 1;
|
|
21903
21863
|
options.startColor = options.startColor || [255, 255, 255]; // default start = white
|
|
21904
21864
|
options.endColor = options.endColor || [255, 0, 0]; // default end = red
|
|
21905
|
-
options.format = options.format || 'rgb';
|
|
21906
21865
|
var result = [];
|
|
21907
21866
|
var color = options.startColor.slice(); // copy the start color
|
|
21908
21867
|
var delta = [
|
|
@@ -21919,23 +21878,6 @@
|
|
|
21919
21878
|
// Force last color = end color
|
|
21920
21879
|
result.push(options.endColor.slice());
|
|
21921
21880
|
// Output as array
|
|
21922
|
-
if (options.format === 'array') {
|
|
21923
|
-
return result;
|
|
21924
|
-
}
|
|
21925
|
-
// Output as rgb(r,g,b) string
|
|
21926
|
-
if (options.format === 'rgb') {
|
|
21927
|
-
if (options.opacity >= 1) {
|
|
21928
|
-
return result.map(function (color) { return 'rgb(' + color.join(',') + ')'; });
|
|
21929
|
-
}
|
|
21930
|
-
else {
|
|
21931
|
-
return result.map(function (color) { return 'rgba(' + color.concat(options.opacity).join(',') + ')'; });
|
|
21932
|
-
}
|
|
21933
|
-
}
|
|
21934
|
-
// Output as hex
|
|
21935
|
-
// TODO
|
|
21936
|
-
// return result.map(color => {
|
|
21937
|
-
// return "rgb(" + color.join(',') + ")";
|
|
21938
|
-
// });
|
|
21939
21881
|
return result;
|
|
21940
21882
|
}
|
|
21941
21883
|
|
|
@@ -25395,7 +25337,7 @@
|
|
|
25395
25337
|
this.icon = value.icon;
|
|
25396
25338
|
this.matIcon = value.matIcon;
|
|
25397
25339
|
this.matSvgIcon = value.matSvgIcon;
|
|
25398
|
-
this.color = value.color;
|
|
25340
|
+
this.color = value.color || this.color; // Keep existing, if not defined in the reference
|
|
25399
25341
|
},
|
|
25400
25342
|
enumerable: false,
|
|
25401
25343
|
configurable: true
|
|
@@ -33109,7 +33051,7 @@
|
|
|
33109
33051
|
];
|
|
33110
33052
|
AdminModule.ctorParameters = function () { return []; };
|
|
33111
33053
|
|
|
33112
|
-
var ɵ0$
|
|
33054
|
+
var ɵ0$b = {
|
|
33113
33055
|
profile: 'ADMIN'
|
|
33114
33056
|
};
|
|
33115
33057
|
var routes = [
|
|
@@ -33119,7 +33061,7 @@
|
|
|
33119
33061
|
component: UsersPage,
|
|
33120
33062
|
canActivate: [AuthGuardService],
|
|
33121
33063
|
canDeactivate: [ComponentDirtyGuard],
|
|
33122
|
-
data: ɵ0$
|
|
33064
|
+
data: ɵ0$b
|
|
33123
33065
|
}
|
|
33124
33066
|
];
|
|
33125
33067
|
var AdminRoutingModule = /** @class */ (function () {
|