@sumaris-net/ngx-components 1.20.11 → 1.20.14
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 +20 -18
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +6 -0
- package/esm2015/src/app/core/menu/menu.component.js +11 -7
- package/esm2015/src/app/shared/form/field.model.js +1 -1
- package/esm2015/src/app/shared/validator/validators.js +11 -13
- package/fesm2015/sumaris-net.ngx-components.js +20 -18
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/config/core.config.d.ts +25 -25
- package/src/app/shared/form/field.model.d.ts +2 -2
- package/src/app/shared/validator/validators.d.ts +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -3371,15 +3371,15 @@
|
|
|
3371
3371
|
}
|
|
3372
3372
|
SharedValidators.getDoubleRegexp = function (maxDecimals) {
|
|
3373
3373
|
if (isNil(maxDecimals))
|
|
3374
|
-
return this.
|
|
3374
|
+
return this._DOUBLE_REGEXP_CACHE.NO_LIMIT;
|
|
3375
3375
|
if (maxDecimals < 0)
|
|
3376
3376
|
throw new Error("Invalid maxDecimals value: " + maxDecimals);
|
|
3377
|
-
var regexp = this.
|
|
3377
|
+
var regexp = this._DOUBLE_REGEXP_CACHE[maxDecimals];
|
|
3378
3378
|
if (regexp)
|
|
3379
3379
|
return regexp;
|
|
3380
|
-
// New
|
|
3381
|
-
this.
|
|
3382
|
-
return this.
|
|
3380
|
+
// New: add to cache
|
|
3381
|
+
this._DOUBLE_REGEXP_CACHE[maxDecimals] = new RegExp("^-?\\d+([.,]\\d{1," + maxDecimals + "})?$");
|
|
3382
|
+
return this._DOUBLE_REGEXP_CACHE[maxDecimals];
|
|
3383
3383
|
};
|
|
3384
3384
|
SharedValidators.latitude = function (control) {
|
|
3385
3385
|
var value = control.value;
|
|
@@ -3551,13 +3551,11 @@
|
|
|
3551
3551
|
};
|
|
3552
3552
|
return SharedValidators;
|
|
3553
3553
|
}());
|
|
3554
|
-
SharedValidators.
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
3: /^[-]?[0-9]+([.,][0-9]{1,2})?$/,
|
|
3560
|
-
}
|
|
3554
|
+
SharedValidators._DOUBLE_REGEXP_CACHE = {
|
|
3555
|
+
NO_LIMIT: /^-?\d+([.,]\d*)?$/,
|
|
3556
|
+
1: /^-?\d+([.,]\d)?$/,
|
|
3557
|
+
2: /^-?\d+([.,]\d{1,2})?$/,
|
|
3558
|
+
3: /^-?\d+([.,]\d{1,3})?$/ // 3 decimals max
|
|
3561
3559
|
};
|
|
3562
3560
|
SharedValidators.I18N_ERROR_KEYS = {
|
|
3563
3561
|
required: 'ERROR.FIELD_REQUIRED',
|
|
@@ -24302,11 +24300,11 @@
|
|
|
24302
24300
|
.pipe(operators.distinctUntilChanged())
|
|
24303
24301
|
.subscribe(function (value) { return value ? _this.open() : _this.close(); });
|
|
24304
24302
|
// Update component when refresh is need (=login events or config changed)
|
|
24305
|
-
this._subscription.add(rxjs.merge(this.accountService.onLogin, this.accountService.onLogout
|
|
24306
|
-
.pipe(operators.tap(function (config) { return _this._config = config; })))
|
|
24303
|
+
this._subscription.add(rxjs.merge(rxjs.merge(this.accountService.onLogin, this.accountService.onLogout)
|
|
24307
24304
|
.pipe(
|
|
24308
24305
|
// Wait account service ready (can be restarted)
|
|
24309
|
-
operators.mergeMap(function () { return _this.accountService.ready(); }), operators.map(function () { return _this.accountService.isLogin(); }), operators.distinctUntilChanged())
|
|
24306
|
+
operators.mergeMap(function () { return _this.accountService.ready(); }), operators.map(function () { return _this.accountService.isLogin(); }), operators.distinctUntilChanged()), this.configService.config
|
|
24307
|
+
.pipe(operators.tap(function (config) { return _this._config = config; }), operators.mergeMap(function () { return _this.accountService.ready(); }), operators.map(function () { return _this.accountService.isLogin(); })))
|
|
24310
24308
|
.subscribe(function (login) {
|
|
24311
24309
|
if (login) {
|
|
24312
24310
|
_this.onLogin(_this.accountService.account);
|
|
@@ -24326,7 +24324,7 @@
|
|
|
24326
24324
|
return __generator(this, function (_a) {
|
|
24327
24325
|
switch (_a.label) {
|
|
24328
24326
|
case 0:
|
|
24329
|
-
console.info('[menu] Update
|
|
24327
|
+
console.info('[menu] Update (login)');
|
|
24330
24328
|
this.accountAvatar = account.avatar;
|
|
24331
24329
|
this.accountName = account.displayName;
|
|
24332
24330
|
this.accountEmail = account.email;
|
|
@@ -24348,8 +24346,12 @@
|
|
|
24348
24346
|
return __generator(this, function (_a) {
|
|
24349
24347
|
switch (_a.label) {
|
|
24350
24348
|
case 0:
|
|
24351
|
-
if (!skipRedirect)
|
|
24352
|
-
console.debug('[menu]
|
|
24349
|
+
if (!skipRedirect) {
|
|
24350
|
+
console.debug('[menu] Logout');
|
|
24351
|
+
}
|
|
24352
|
+
else {
|
|
24353
|
+
console.debug('[menu] Update (logout)');
|
|
24354
|
+
}
|
|
24353
24355
|
this.isLogin = false;
|
|
24354
24356
|
this.accountAvatar = null;
|
|
24355
24357
|
this.accountEmail = null;
|