ng-tailwind 2.24.341 → 2.25.341
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/ng-tailwind.umd.js +18 -4
- package/bundles/ng-tailwind.umd.js.map +1 -1
- package/components/ngt-select/ngt-select.component.d.ts +2 -0
- package/esm2015/components/ngt-select/ngt-select.component.js +19 -5
- package/fesm2015/ng-tailwind.js +18 -4
- package/fesm2015/ng-tailwind.js.map +1 -1
- package/ng-tailwind.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -3062,6 +3062,7 @@
|
|
|
3062
3062
|
_this.searchable = true;
|
|
3063
3063
|
_this.clearSearchOnAdd = true;
|
|
3064
3064
|
_this.virtualScroll = true;
|
|
3065
|
+
_this.guessCompareWith = true;
|
|
3065
3066
|
/** Validation */
|
|
3066
3067
|
_this.isRequired = false;
|
|
3067
3068
|
_this.onLoadRemoteResource = new core.EventEmitter();
|
|
@@ -3225,6 +3226,7 @@
|
|
|
3225
3226
|
.get(_this.remoteResource, _this.currentState.filters, _this.currentState.pagination)
|
|
3226
3227
|
.subscribe(function (response) {
|
|
3227
3228
|
_this.loading = false;
|
|
3229
|
+
_this.bindCompareWithByResponse(response);
|
|
3228
3230
|
_this.ngSearchObserver.next(response.data);
|
|
3229
3231
|
_this.onLoadRemoteResource.emit(response.data);
|
|
3230
3232
|
_this.currentState.pagination = response.meta.pagination;
|
|
@@ -3371,10 +3373,21 @@
|
|
|
3371
3373
|
innerInput.id = uuid();
|
|
3372
3374
|
}
|
|
3373
3375
|
};
|
|
3376
|
+
NgtSelectComponent.prototype.bindCompareWithByResponse = function (response) {
|
|
3377
|
+
var _a;
|
|
3378
|
+
if (this.guessCompareWith) {
|
|
3379
|
+
if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.length) && typeof response.data[0]['getApiId'] === 'function') {
|
|
3380
|
+
this.compareWith = function (a, b) { return a.getApiId() == b.getApiId(); };
|
|
3381
|
+
}
|
|
3382
|
+
else {
|
|
3383
|
+
this.compareWith = function (a, b) { return a === b; };
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
};
|
|
3374
3387
|
NgtSelectComponent.prototype.hasTermInFilteredItems = function (term) {
|
|
3375
3388
|
var _this = this;
|
|
3376
3389
|
var filteredItems = this.ngSelectComponent.itemsList.filteredItems;
|
|
3377
|
-
if (this.isColoquentResource()) {
|
|
3390
|
+
if ((filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.length) && this.isColoquentResource()) {
|
|
3378
3391
|
return filteredItems.some(function (element) {
|
|
3379
3392
|
var elementValue = element.value.getAttribute(_this.bindLabel);
|
|
3380
3393
|
return elementValue && elementValue.toLocaleLowerCase() === term;
|
|
@@ -3388,7 +3401,7 @@
|
|
|
3388
3401
|
NgtSelectComponent.prototype.hasTermInSelectedItems = function (term) {
|
|
3389
3402
|
var _this = this;
|
|
3390
3403
|
var selectedItems = this.ngSelectComponent.selectedItems;
|
|
3391
|
-
if (this.isColoquentResource()) {
|
|
3404
|
+
if ((selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) && this.isColoquentResource()) {
|
|
3392
3405
|
return selectedItems.some(function (element) {
|
|
3393
3406
|
var elementValue = element.value.getAttribute(_this.bindLabel);
|
|
3394
3407
|
return elementValue && elementValue.toLocaleLowerCase() === term;
|
|
@@ -3405,8 +3418,8 @@
|
|
|
3405
3418
|
return !!((_a = this.originalItems) === null || _a === void 0 ? void 0 : _a.find(function (element) { return _this.compareWith(element, item); }));
|
|
3406
3419
|
};
|
|
3407
3420
|
NgtSelectComponent.prototype.isColoquentResource = function () {
|
|
3408
|
-
var
|
|
3409
|
-
return
|
|
3421
|
+
var items = this.ngSelectComponent.itemsList.items;
|
|
3422
|
+
return (items === null || items === void 0 ? void 0 : items.length) && typeof items[0].value['getAttribute'] === 'function';
|
|
3410
3423
|
};
|
|
3411
3424
|
NgtSelectComponent.prototype.isHidden = function () {
|
|
3412
3425
|
return this.ngSelectComponent.element.offsetParent === null;
|
|
@@ -3482,6 +3495,7 @@
|
|
|
3482
3495
|
virtualScroll: [{ type: core.Input }],
|
|
3483
3496
|
tabIndex: [{ type: core.Input }],
|
|
3484
3497
|
typeahead: [{ type: core.Input }],
|
|
3498
|
+
guessCompareWith: [{ type: core.Input }],
|
|
3485
3499
|
groupValue: [{ type: core.Input }],
|
|
3486
3500
|
trackBy: [{ type: core.Input }],
|
|
3487
3501
|
isRequired: [{ type: core.Input }],
|