ng-tailwind 5.0.18 → 5.0.19
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/esm2020/components/ngt-select/ngt-select.component.mjs +11 -4
- package/esm2020/helpers/promise/promise-helper.mjs +4 -0
- package/fesm2015/ng-tailwind.mjs +27 -15
- package/fesm2015/ng-tailwind.mjs.map +1 -1
- package/fesm2020/ng-tailwind.mjs +13 -3
- package/fesm2020/ng-tailwind.mjs.map +1 -1
- package/helpers/promise/promise-helper.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/ng-tailwind.mjs
CHANGED
|
@@ -3028,6 +3028,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
3028
3028
|
args: [{ selector: '[ngt-select-header]' }]
|
|
3029
3029
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
3030
3030
|
|
|
3031
|
+
function delay(ms) {
|
|
3032
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3031
3035
|
class NgtSelectComponent extends NgtBaseNgModel {
|
|
3032
3036
|
constructor(ngtStylizableDirective, formContainer, ngtTranslateService, injector, ngtHttp, changeDetector, ngtForm, ngtSection, ngtModal) {
|
|
3033
3037
|
super();
|
|
@@ -3077,7 +3081,6 @@ class NgtSelectComponent extends NgtBaseNgModel {
|
|
|
3077
3081
|
this.onClear = new EventEmitter();
|
|
3078
3082
|
this.onClose = new EventEmitter();
|
|
3079
3083
|
this.nativeName = uuid();
|
|
3080
|
-
this.ngSelectItems = [];
|
|
3081
3084
|
this.componentReady = false;
|
|
3082
3085
|
this.originalPerPage = 15;
|
|
3083
3086
|
this.subscriptions = [];
|
|
@@ -3321,7 +3324,14 @@ class NgtSelectComponent extends NgtBaseNgModel {
|
|
|
3321
3324
|
disabled() {
|
|
3322
3325
|
return this.isDisabled || this.isDisabledByParent();
|
|
3323
3326
|
}
|
|
3324
|
-
calculateDropdownPosition(parentElement) {
|
|
3327
|
+
async calculateDropdownPosition(parentElement) {
|
|
3328
|
+
while (!this.componentReady || this.loading || this.ngSelectComponent.showNoItemsFound()) {
|
|
3329
|
+
await delay(200);
|
|
3330
|
+
if (this.ngSelectComponent.showNoItemsFound() && !this.loading && this.componentReady) {
|
|
3331
|
+
break;
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
this.changeDetector.detectChanges();
|
|
3325
3335
|
setTimeout(() => {
|
|
3326
3336
|
const ngSelectElement = this.ngSelectComponent.element;
|
|
3327
3337
|
const ngSelectHeight = ngSelectElement.offsetHeight;
|
|
@@ -3331,7 +3341,7 @@ class NgtSelectComponent extends NgtBaseNgModel {
|
|
|
3331
3341
|
const parentYPosition = parentElement.getBoundingClientRect().y;
|
|
3332
3342
|
const ngSelectYPositionInsideParent = ngSelectYPosition - parentYPosition;
|
|
3333
3343
|
const openedSelectTotalHeight = openedSelectHeight + ngSelectYPositionInsideParent;
|
|
3334
|
-
const dropdownPosition = openedSelectTotalHeight > parentElement.clientHeight
|
|
3344
|
+
const dropdownPosition = openedSelectTotalHeight > (parentElement.clientHeight * 0.9)
|
|
3335
3345
|
? 'top'
|
|
3336
3346
|
: 'bottom';
|
|
3337
3347
|
this.ngSelectComponent.dropdownPanel['_currentPosition'] = dropdownPosition;
|