@sumaris-net/ngx-components 1.4.3 → 1.4.4
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 +16 -10
- 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/esm2015/src/app/core/services/local-settings.service.js +6 -4
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +12 -8
- package/fesm2015/sumaris-net.ngx-components.js +16 -10
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -1368,14 +1368,14 @@
|
|
|
1368
1368
|
});
|
|
1369
1369
|
Object.defineProperty(MatAutocompleteField.prototype, "disabled", {
|
|
1370
1370
|
get: function () {
|
|
1371
|
-
return this.
|
|
1371
|
+
return this._readonly || this.formControl.disabled;
|
|
1372
1372
|
},
|
|
1373
1373
|
enumerable: false,
|
|
1374
1374
|
configurable: true
|
|
1375
1375
|
});
|
|
1376
1376
|
Object.defineProperty(MatAutocompleteField.prototype, "enabled", {
|
|
1377
1377
|
get: function () {
|
|
1378
|
-
return !this.
|
|
1378
|
+
return !this._readonly && this.formControl.enabled;
|
|
1379
1379
|
},
|
|
1380
1380
|
enumerable: false,
|
|
1381
1381
|
configurable: true
|
|
@@ -1491,7 +1491,7 @@
|
|
|
1491
1491
|
operators.tap(function (value) { return console.debug(_this.logPrefix + ' Search text changes:', value); })),
|
|
1492
1492
|
// Object set: use it (no distinctUntilChanged() pipe need)
|
|
1493
1493
|
this.formControl.valueChanges
|
|
1494
|
-
.pipe(operators.startWith(this.formControl.value), operators.filter(function (value) { return _this.searchable && (typeof value === 'object'); }), operators.tap(function (value) {
|
|
1494
|
+
.pipe(operators.startWith(this.formControl.value), operators.filter(function (value) { return (_this.searchable && isNotNil(value) && typeof value === 'object'); }), operators.tap(function (value) {
|
|
1495
1495
|
// DEBUG
|
|
1496
1496
|
//console.debug(this.logPrefix + ' object changes:', value)
|
|
1497
1497
|
// Update the display value (if need)
|
|
@@ -1510,11 +1510,13 @@
|
|
|
1510
1510
|
rxjs.merge(
|
|
1511
1511
|
// Focus or click => Load all
|
|
1512
1512
|
rxjs.merge(this.onFocus, this.onClick)
|
|
1513
|
-
.pipe(operators.filter(function (_) { return _this.
|
|
1513
|
+
.pipe(operators.filter(function (_) { return _this.enabled && _this.searchable; }), operators.map(function (_) { return _this.showAllOnFocus ? '*' : _this.formControl.value; })),
|
|
1514
1514
|
// On dropdown button click
|
|
1515
1515
|
this.onDropButtonClick
|
|
1516
|
-
.pipe(operators.filter(function (event) { return _this.searchable && (!event || !event.defaultPrevented)
|
|
1517
|
-
.pipe(operators.
|
|
1516
|
+
.pipe(operators.filter(function (event) { return _this.enabled && _this.searchable && (!event || !event.defaultPrevented); }), operators.map(function (_) { return _this.showAllOnFocus ? '*' : _this.formControl.value; })), rxjs.merge(this.$inputItems, this._filter$)
|
|
1517
|
+
.pipe(operators.filter(function (event) { return _this.enabled && _this.searchable; }), operators.map(function (_) { return _this.formControl.value; }),
|
|
1518
|
+
// DEBUG
|
|
1519
|
+
operators.tap(function (value) { return console.debug(_this.logPrefix + ' Received $inputItems or filter event: ', value); })))
|
|
1518
1520
|
.pipe(
|
|
1519
1521
|
// If value is a string (and is not = '*'), filter if not enough character
|
|
1520
1522
|
operators.filter(function (value) { return value === '*' || !(typeof value === 'string') || value.length >= _this.suggestLengthThreshold; }),
|
|
@@ -1581,7 +1583,9 @@
|
|
|
1581
1583
|
}));
|
|
1582
1584
|
// Listen form control status change
|
|
1583
1585
|
this._subscription.add(this.formControl.statusChanges
|
|
1584
|
-
.pipe(
|
|
1586
|
+
.pipe(
|
|
1587
|
+
//filter(() => this.enabled),
|
|
1588
|
+
operators.distinctUntilChanged())
|
|
1585
1589
|
// Update component state
|
|
1586
1590
|
.subscribe(function () { return _this.checkIfTouched(); }));
|
|
1587
1591
|
this._subscription.add(this.onKeydownEscape.subscribe(function (event) {
|
|
@@ -10871,7 +10875,7 @@
|
|
|
10871
10875
|
});
|
|
10872
10876
|
};
|
|
10873
10877
|
LocalSettingsService.prototype.setProperty = function (keyOrDef, value) {
|
|
10874
|
-
if (!this._data)
|
|
10878
|
+
if (!this._data || !keyOrDef)
|
|
10875
10879
|
return;
|
|
10876
10880
|
if (typeof keyOrDef === 'object') {
|
|
10877
10881
|
this.setProperty(keyOrDef.key, value);
|
|
@@ -10994,8 +10998,9 @@
|
|
|
10994
10998
|
var feature = this._data.offlineFeatures.find(function (f) {
|
|
10995
10999
|
if (typeof f === 'string')
|
|
10996
11000
|
return f.toLowerCase().startsWith(featurePrefix);
|
|
10997
|
-
if (typeof f === 'object' && f.name)
|
|
11001
|
+
if (f && typeof f === 'object' && f.name)
|
|
10998
11002
|
return f.name === featureName;
|
|
11003
|
+
return false;
|
|
10999
11004
|
});
|
|
11000
11005
|
if (!feature)
|
|
11001
11006
|
return; // Not found
|
|
@@ -11026,8 +11031,9 @@
|
|
|
11026
11031
|
var existingIndex = this._data.offlineFeatures.findIndex(function (f) {
|
|
11027
11032
|
if (typeof f === 'string')
|
|
11028
11033
|
return f.toLowerCase().startsWith(featurePrefix);
|
|
11029
|
-
if (typeof f === 'object' && f.name)
|
|
11034
|
+
if (f && typeof f === 'object' && f.name)
|
|
11030
11035
|
return f.name === feature.name;
|
|
11036
|
+
return false;
|
|
11031
11037
|
});
|
|
11032
11038
|
if (existingIndex !== -1) {
|
|
11033
11039
|
this._data.offlineFeatures[existingIndex] = feature;
|