ng-tailwind 3.32.372 → 3.32.373
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 +13 -8
- package/bundles/ng-tailwind.umd.js.map +1 -1
- package/components/ngt-multi-select/ngt-multi-select.component.d.ts +1 -0
- package/esm2015/components/ngt-multi-select/ngt-multi-select.component.js +10 -5
- package/fesm2015/ng-tailwind.js +9 -4
- package/fesm2015/ng-tailwind.js.map +1 -1
- package/ng-tailwind.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -6771,7 +6771,7 @@
|
|
|
6771
6771
|
};
|
|
6772
6772
|
NgtMultiSelectComponent.prototype.refresh = function (itemsPerPage, searchTerm) {
|
|
6773
6773
|
return __awaiter(this, void 0, void 0, function () {
|
|
6774
|
-
return __generator(this, function (
|
|
6774
|
+
return __generator(this, function (_d) {
|
|
6775
6775
|
this.itemsPerPage = itemsPerPage !== undefined ? itemsPerPage : this.itemsPerPage;
|
|
6776
6776
|
this.searchTerm = searchTerm !== undefined ? searchTerm : this.searchTerm;
|
|
6777
6777
|
return [2 /*return*/, this.loadData(this.itemsPerPage, this.searchTerm)];
|
|
@@ -6791,7 +6791,8 @@
|
|
|
6791
6791
|
this.value = [];
|
|
6792
6792
|
this.nativeValue = [];
|
|
6793
6793
|
this.selectedElements = [];
|
|
6794
|
-
this.
|
|
6794
|
+
var perpage = this.selectAllCheckbox ? this.pagination.total : this.itemsPerPage;
|
|
6795
|
+
this.loadData(perpage, this.searchTerm)
|
|
6795
6796
|
.then(function () {
|
|
6796
6797
|
var _a, _b;
|
|
6797
6798
|
(_b = (_a = _this.containerRef) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.scrollTo({ top: 0 });
|
|
@@ -6861,16 +6862,17 @@
|
|
|
6861
6862
|
clearTimeout(this.searchTimeout);
|
|
6862
6863
|
}
|
|
6863
6864
|
this.searchTimeout = setTimeout(function () {
|
|
6864
|
-
var _a, _b;
|
|
6865
|
+
var _a, _b, _c;
|
|
6865
6866
|
_this.previousSearchTerm = term;
|
|
6867
|
+
_this.selectAllCheckbox = ((_a = _this.selectedElements) === null || _a === void 0 ? void 0 : _a.length) == _this.selectableResourcesCount;
|
|
6866
6868
|
if (!term) {
|
|
6867
6869
|
_this.inSearch = false;
|
|
6868
|
-
if ((
|
|
6870
|
+
if ((_b = _this.items) === null || _b === void 0 ? void 0 : _b.length) {
|
|
6869
6871
|
return;
|
|
6870
6872
|
}
|
|
6871
6873
|
}
|
|
6872
6874
|
_this.inSearch = true;
|
|
6873
|
-
if ((
|
|
6875
|
+
if ((_c = _this.items) === null || _c === void 0 ? void 0 : _c.length) {
|
|
6874
6876
|
_this.selectableElementsOnSearch = _this.selectableElements.filter(function (item) { return _this.getSelectableElementValue(item).includes(term); });
|
|
6875
6877
|
}
|
|
6876
6878
|
else {
|
|
@@ -6917,9 +6919,9 @@
|
|
|
6917
6919
|
if (perpage === void 0) { perpage = this.itemsPerPage; }
|
|
6918
6920
|
return __awaiter(this, void 0, void 0, function () {
|
|
6919
6921
|
var _this = this;
|
|
6920
|
-
return __generator(this, function (
|
|
6922
|
+
return __generator(this, function (_d) {
|
|
6921
6923
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
6922
|
-
var
|
|
6924
|
+
var _d;
|
|
6923
6925
|
var _a, _b;
|
|
6924
6926
|
if (_this.remoteResource) {
|
|
6925
6927
|
if (_this.loading) {
|
|
@@ -6932,12 +6934,15 @@
|
|
|
6932
6934
|
_this.loading = true;
|
|
6933
6935
|
_this.itemsPerPage = perpage;
|
|
6934
6936
|
var pagination = Object.assign(Object.assign({}, _this.pagination), { per_page: perpage });
|
|
6935
|
-
var filters = searchTerm ? (
|
|
6937
|
+
var filters = searchTerm ? (_d = {}, _d[_this.bindSearch] = searchTerm, _d) : null;
|
|
6936
6938
|
_this.subscriptions.push(_this.ngtHttpService.get(_this.remoteResource, filters, pagination).subscribe(function (response) {
|
|
6937
6939
|
_this.bindSelectableElements(response.data);
|
|
6938
6940
|
_this.pagination = response.meta.pagination;
|
|
6939
6941
|
_this.itemsTotal = _this.pagination.total;
|
|
6940
6942
|
_this.loading = false;
|
|
6943
|
+
if (!_this.selectableResourcesCount && !searchTerm) {
|
|
6944
|
+
_this.selectableResourcesCount = _this.pagination.total;
|
|
6945
|
+
}
|
|
6941
6946
|
_this.onDataChange.emit(_this.selectableElements);
|
|
6942
6947
|
_this.componentReady = true;
|
|
6943
6948
|
_this.changeDetector.detectChanges();
|