nexheal-lib 0.0.50 → 0.0.52
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/fesm2022/nexheal-lib.mjs +76 -5
- package/fesm2022/nexheal-lib.mjs.map +1 -1
- package/index.d.ts +10 -2
- package/package.json +1 -1
package/fesm2022/nexheal-lib.mjs
CHANGED
|
@@ -2787,7 +2787,7 @@ class PaginatedAutocompleteControl {
|
|
|
2787
2787
|
inputLoader = false;
|
|
2788
2788
|
readonly = false;
|
|
2789
2789
|
optionDisplayProperty = "displayname";
|
|
2790
|
-
/** 'scroll' = infinite scroll, 'click' = "Load more" button */
|
|
2790
|
+
/** 'scroll' = infinite scroll, 'click' = "Load more" button, 'arrow' = ←/→ keys */
|
|
2791
2791
|
paginationType = 'scroll';
|
|
2792
2792
|
pageSize = 10;
|
|
2793
2793
|
searchDebounce = 300;
|
|
@@ -2802,7 +2802,15 @@ class PaginatedAutocompleteControl {
|
|
|
2802
2802
|
_displayedOptions = [];
|
|
2803
2803
|
set options(value) {
|
|
2804
2804
|
const incoming = value || [];
|
|
2805
|
-
if (this.
|
|
2805
|
+
if (this.paginationType === 'arrow') {
|
|
2806
|
+
// Arrow mode: discrete pages — each load REPLACES the view and is cached
|
|
2807
|
+
this._displayedOptions = [...incoming];
|
|
2808
|
+
this.pageCache.set(this._pendingPage, [...incoming]);
|
|
2809
|
+
this.currentPage = this._pendingPage;
|
|
2810
|
+
this.highlightedIndex = incoming.length > 0 ? 0 : null;
|
|
2811
|
+
this.resetListScroll();
|
|
2812
|
+
}
|
|
2813
|
+
else if (this._pendingPage <= 1) {
|
|
2806
2814
|
this._displayedOptions = [...incoming];
|
|
2807
2815
|
}
|
|
2808
2816
|
else {
|
|
@@ -2818,7 +2826,7 @@ class PaginatedAutocompleteControl {
|
|
|
2818
2826
|
this.failedPage = null;
|
|
2819
2827
|
this.processValueBuffer();
|
|
2820
2828
|
if (this.isDropdownOpen) {
|
|
2821
|
-
if (this._pendingPage <= 1) {
|
|
2829
|
+
if (this._pendingPage <= 1 && this.paginationType !== 'arrow') {
|
|
2822
2830
|
this.highlightedIndex = this._displayedOptions.length > 0 ? 0 : null;
|
|
2823
2831
|
}
|
|
2824
2832
|
setTimeout(() => {
|
|
@@ -2854,6 +2862,8 @@ class PaginatedAutocompleteControl {
|
|
|
2854
2862
|
preventClearOnBlur = false;
|
|
2855
2863
|
searchInput$ = new Subject();
|
|
2856
2864
|
cancelPendingSearch = false;
|
|
2865
|
+
/** Arrow mode: cache of visited pages for the current search */
|
|
2866
|
+
pageCache = new Map();
|
|
2857
2867
|
onChange = () => { };
|
|
2858
2868
|
onTouched = () => { };
|
|
2859
2869
|
inputElement;
|
|
@@ -2870,6 +2880,11 @@ class PaginatedAutocompleteControl {
|
|
|
2870
2880
|
get hasMore() {
|
|
2871
2881
|
return this._displayedOptions.length < this.totalCount;
|
|
2872
2882
|
}
|
|
2883
|
+
get totalPages() {
|
|
2884
|
+
return this.pageSize > 0
|
|
2885
|
+
? Math.max(1, Math.ceil(this.totalCount / this.pageSize))
|
|
2886
|
+
: 1;
|
|
2887
|
+
}
|
|
2873
2888
|
constructor() { }
|
|
2874
2889
|
ngOnInit() {
|
|
2875
2890
|
this.inputControl.markAsPristine();
|
|
@@ -2941,6 +2956,10 @@ class PaginatedAutocompleteControl {
|
|
|
2941
2956
|
loadPage(page, search) {
|
|
2942
2957
|
this.currentPage = page;
|
|
2943
2958
|
this._pendingPage = page;
|
|
2959
|
+
if (page === 1) {
|
|
2960
|
+
// Fresh page-1 load = new search context; visited pages are stale
|
|
2961
|
+
this.pageCache.clear();
|
|
2962
|
+
}
|
|
2944
2963
|
this.lastLoadedSearch = search;
|
|
2945
2964
|
this.loadErrorMessage = null;
|
|
2946
2965
|
this.failedPage = null;
|
|
@@ -2961,6 +2980,41 @@ class PaginatedAutocompleteControl {
|
|
|
2961
2980
|
// which after a selection holds the display name, not the search term.
|
|
2962
2981
|
this.loadPage(this.currentPage + 1, this.lastLoadedSearch ?? (this.inputControl.value || ""));
|
|
2963
2982
|
}
|
|
2983
|
+
/** Arrow mode: show an already-visited page instantly, no API call */
|
|
2984
|
+
showCachedPage(page) {
|
|
2985
|
+
const cached = this.pageCache.get(page);
|
|
2986
|
+
if (!cached)
|
|
2987
|
+
return false;
|
|
2988
|
+
this.currentPage = page;
|
|
2989
|
+
this._pendingPage = page;
|
|
2990
|
+
this._displayedOptions = [...cached];
|
|
2991
|
+
this.highlightedIndex = cached.length > 0 ? 0 : null;
|
|
2992
|
+
this.resetListScroll();
|
|
2993
|
+
return true;
|
|
2994
|
+
}
|
|
2995
|
+
nextArrowPage() {
|
|
2996
|
+
if (this.isPageLoading || this.currentPage >= this.totalPages)
|
|
2997
|
+
return;
|
|
2998
|
+
const next = this.currentPage + 1;
|
|
2999
|
+
if (!this.showCachedPage(next)) {
|
|
3000
|
+
this.loadPage(next, this.lastLoadedSearch || "");
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
prevArrowPage() {
|
|
3004
|
+
if (this.isPageLoading || this.currentPage <= 1)
|
|
3005
|
+
return;
|
|
3006
|
+
const prev = this.currentPage - 1;
|
|
3007
|
+
if (!this.showCachedPage(prev)) {
|
|
3008
|
+
this.loadPage(prev, this.lastLoadedSearch || "");
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
resetListScroll() {
|
|
3012
|
+
setTimeout(() => {
|
|
3013
|
+
if (this.dropdownElement) {
|
|
3014
|
+
this.dropdownElement.nativeElement.scrollTop = 0;
|
|
3015
|
+
}
|
|
3016
|
+
}, 0);
|
|
3017
|
+
}
|
|
2964
3018
|
onListScroll(event) {
|
|
2965
3019
|
if (this.paginationType !== 'scroll')
|
|
2966
3020
|
return;
|
|
@@ -3051,6 +3105,9 @@ class PaginatedAutocompleteControl {
|
|
|
3051
3105
|
this.lastLoadedSearch === term &&
|
|
3052
3106
|
this._displayedOptions.length > 0) {
|
|
3053
3107
|
this.openDropdown();
|
|
3108
|
+
if (this.paginationType === 'arrow') {
|
|
3109
|
+
this.showCachedPage(1);
|
|
3110
|
+
}
|
|
3054
3111
|
const idx = this.selectedItems
|
|
3055
3112
|
? this._displayedOptions.findIndex((o) => o.id === this.selectedItems.id)
|
|
3056
3113
|
: -1;
|
|
@@ -3126,6 +3183,20 @@ class PaginatedAutocompleteControl {
|
|
|
3126
3183
|
event.preventDefault();
|
|
3127
3184
|
this.scrollHighlightedItemIntoView();
|
|
3128
3185
|
break;
|
|
3186
|
+
case "ArrowRight": {
|
|
3187
|
+
if (this.paginationType !== 'arrow')
|
|
3188
|
+
break; // caret moves normally
|
|
3189
|
+
this.nextArrowPage();
|
|
3190
|
+
event.preventDefault();
|
|
3191
|
+
break;
|
|
3192
|
+
}
|
|
3193
|
+
case "ArrowLeft": {
|
|
3194
|
+
if (this.paginationType !== 'arrow')
|
|
3195
|
+
break; // caret moves normally
|
|
3196
|
+
this.prevArrowPage();
|
|
3197
|
+
event.preventDefault();
|
|
3198
|
+
break;
|
|
3199
|
+
}
|
|
3129
3200
|
case "Enter":
|
|
3130
3201
|
if (this.highlightedIndex !== null &&
|
|
3131
3202
|
this._displayedOptions.length > 0) {
|
|
@@ -3214,7 +3285,7 @@ class PaginatedAutocompleteControl {
|
|
|
3214
3285
|
useExisting: PaginatedAutocompleteControl,
|
|
3215
3286
|
multi: true,
|
|
3216
3287
|
},
|
|
3217
|
-
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "dropdownElement", first: true, predicate: ["dropdownElement"], descendants: true }], ngImport: i0, template: "<div class=\"form-group auto-complete paginated-autocomplete\" [ngClass]=\"customClass\" [class.readonly]=\"readonly\">\n @if (title) {\n <label class=\"inp-label\" [ngClass]=\"{ 'required': required }\">{{ title }}</label>\n }\n\n <input #inputElement type=\"text\" class=\"form-control\" [placeholder]=\"placeholder\" [formControl]=\"inputControl\"\n (input)=\"onUserType($event)\" (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"\n [ngClass]=\"{'is-invalid': error}\" [attr.autocomplete]=\"autocomplete || null\" [readonly]=\"readonly\" />\n\n <span class=\"focus-border\"></span>\n\n @if (!inputLoader && inputControl.value && clearVal && hasFocus) {\n <label class=\"clear\" (mousedown)=\"onOptionMouseDown()\" (click)=\"resetInput()\">\n <i class=\"he he-close\"></i>\n </label>\n }\n\n @if (isDropdownOpen) {\n <div #dropdownElement class=\"option-list\" (mousedown)=\"onOptionMouseDown()\" (scroll)=\"onListScroll($event)\">\n @if (options.length === 0 && !isPageLoading && !loadErrorMessage) {\n <div class=\"no-results\">\n <div>No results found</div>\n </div>\n } @else {\n @for (suggestion of options; track suggestion.id; let i = $index) {\n <div class=\"list-item\" [ngClass]=\"{\n 'active': suggestion === selectedItems,\n 'highlighted': highlightedIndex === i\n }\" (click)=\"selectSuggestion(suggestion)\" (mouseover)=\"onMouseOver(i)\">\n {{ suggestion[optionDisplayProperty] }}\n </div>\n }\n\n @if (isPageLoading) {\n <div class=\"list-loading\">Loading...</div>\n }\n\n @if (loadErrorMessage) {\n <div class=\"load-error\" (click)=\"retryLoad($event)\">\n {{ loadErrorMessage }} \u00B7 <span class=\"retry\">Retry</span>\n </div>\n }\n\n @if (paginationType === 'click' && hasMore && !isPageLoading && !loadErrorMessage) {\n <div class=\"load-more\" (click)=\"onLoadMoreClick($event)\">\n Load more ({{ options.length }} of {{ totalCount }})\n </div>\n }\n\n @if (totalCount > 0 && options.length > 0 && !loadErrorMessage && !(paginationType === 'click' && hasMore)) {\n <div class=\"list-footer\">\n {{ options.length }} of {{ totalCount }}\n @if (hasMore && paginationType === 'scroll') {\n <span> \u00B7 scroll for more</span>\n }\n </div>\n }\n }\n </div>\n }\n\n @if (inputLoader) {\n <label class=\"loader input-loader\"></label>\n }\n\n @if (error) {\n <div class=\"val-msg\">{{ errorMessage }}</div>\n }\n</div>\n", styles: [".form-group.paginated-autocomplete .form-control{padding-right:unset}.form-group.paginated-autocomplete .clear{right:7px}.form-group.paginated-autocomplete .option-list{max-height:220px;overflow-y:auto}.form-group.paginated-autocomplete .option-list .no-results{padding:10px;color:#9b9b9b;text-align:center}.form-group.paginated-autocomplete .option-list .list-loading{padding:8px 10px;color:#9b9b9b;text-align:center;font-size:12px}.form-group.paginated-autocomplete .option-list .load-more{padding:8px 10px;text-align:center;cursor:pointer;color:#0d6efd;font-size:13px;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-more:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .load-error{padding:8px 10px;text-align:center;font-size:12px;color:#dc3545;cursor:pointer;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-error .retry{color:#0d6efd;text-decoration:underline}.form-group.paginated-autocomplete .option-list .load-error:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .list-footer{position:sticky;bottom:0;padding:4px 10px;text-align:center;font-size:11px;color:#9b9b9b;background-color:#fff;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
3288
|
+
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }, { propertyName: "dropdownElement", first: true, predicate: ["dropdownElement"], descendants: true }], ngImport: i0, template: "<div class=\"form-group auto-complete paginated-autocomplete\" [ngClass]=\"customClass\" [class.readonly]=\"readonly\">\n @if (title) {\n <label class=\"inp-label\" [ngClass]=\"{ 'required': required }\">{{ title }}</label>\n }\n\n <input #inputElement type=\"text\" class=\"form-control\" [placeholder]=\"placeholder\" [formControl]=\"inputControl\"\n (input)=\"onUserType($event)\" (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"\n [ngClass]=\"{'is-invalid': error}\" [attr.autocomplete]=\"autocomplete || null\" [readonly]=\"readonly\" />\n\n <span class=\"focus-border\"></span>\n\n @if (!inputLoader && inputControl.value && clearVal && hasFocus) {\n <label class=\"clear\" (mousedown)=\"onOptionMouseDown()\" (click)=\"resetInput()\">\n <i class=\"he he-close\"></i>\n </label>\n }\n\n @if (isDropdownOpen) {\n <div #dropdownElement class=\"option-list\" (mousedown)=\"onOptionMouseDown()\" (scroll)=\"onListScroll($event)\">\n @if (options.length === 0 && !isPageLoading && !loadErrorMessage) {\n <div class=\"no-results\">\n <div>No results found</div>\n </div>\n } @else {\n @for (suggestion of options; track suggestion.id; let i = $index) {\n <div class=\"list-item\" [ngClass]=\"{\n 'active': suggestion === selectedItems,\n 'highlighted': highlightedIndex === i\n }\" (click)=\"selectSuggestion(suggestion)\" (mouseover)=\"onMouseOver(i)\">\n {{ suggestion[optionDisplayProperty] }}\n </div>\n }\n\n @if (isPageLoading) {\n <div class=\"list-loading\">Loading...</div>\n }\n\n @if (loadErrorMessage) {\n <div class=\"load-error\" (click)=\"retryLoad($event)\">\n {{ loadErrorMessage }} \u00B7 <span class=\"retry\">Retry</span>\n </div>\n }\n\n @if (paginationType === 'click' && hasMore && !isPageLoading && !loadErrorMessage) {\n <div class=\"load-more\" (click)=\"onLoadMoreClick($event)\">\n Load more ({{ options.length }} of {{ totalCount }})\n </div>\n }\n\n @if (totalCount > 0 && options.length > 0 && !loadErrorMessage && !(paginationType === 'click' && hasMore)) {\n <div class=\"list-footer\">\n @if (paginationType === 'arrow') {\n <span class=\"pager\">\n <span class=\"pager-btn\" [class.disabled]=\"currentPage <= 1\" (click)=\"prevArrowPage()\">\u2190</span>\n Page {{ currentPage }} of {{ totalPages }}\n <span class=\"pager-btn\" [class.disabled]=\"currentPage >= totalPages\" (click)=\"nextArrowPage()\">\u2192</span>\n </span>\n } @else {\n {{ options.length }} of {{ totalCount }}\n @if (hasMore && paginationType === 'scroll') {\n <span> \u00B7 scroll for more</span>\n }\n }\n </div>\n }\n }\n </div>\n }\n\n @if (inputLoader) {\n <label class=\"loader input-loader\"></label>\n }\n\n @if (error) {\n <div class=\"val-msg\">{{ errorMessage }}</div>\n }\n</div>\n", styles: [".form-group.paginated-autocomplete .form-control{padding-right:unset}.form-group.paginated-autocomplete .clear{right:7px}.form-group.paginated-autocomplete .option-list{max-height:220px;overflow-y:auto}.form-group.paginated-autocomplete .option-list .no-results{padding:10px;color:#9b9b9b;text-align:center}.form-group.paginated-autocomplete .option-list .list-loading{padding:8px 10px;color:#9b9b9b;text-align:center;font-size:12px}.form-group.paginated-autocomplete .option-list .load-more{padding:8px 10px;text-align:center;cursor:pointer;color:#0d6efd;font-size:13px;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-more:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .load-error{padding:8px 10px;text-align:center;font-size:12px;color:#dc3545;cursor:pointer;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-error .retry{color:#0d6efd;text-decoration:underline}.form-group.paginated-autocomplete .option-list .load-error:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .list-footer{position:sticky;bottom:0;padding:4px 10px;text-align:center;font-size:11px;color:#9b9b9b;background-color:#fff;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
3218
3289
|
}
|
|
3219
3290
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PaginatedAutocompleteControl, decorators: [{
|
|
3220
3291
|
type: Component,
|
|
@@ -3224,7 +3295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
3224
3295
|
useExisting: PaginatedAutocompleteControl,
|
|
3225
3296
|
multi: true,
|
|
3226
3297
|
},
|
|
3227
|
-
], template: "<div class=\"form-group auto-complete paginated-autocomplete\" [ngClass]=\"customClass\" [class.readonly]=\"readonly\">\n @if (title) {\n <label class=\"inp-label\" [ngClass]=\"{ 'required': required }\">{{ title }}</label>\n }\n\n <input #inputElement type=\"text\" class=\"form-control\" [placeholder]=\"placeholder\" [formControl]=\"inputControl\"\n (input)=\"onUserType($event)\" (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"\n [ngClass]=\"{'is-invalid': error}\" [attr.autocomplete]=\"autocomplete || null\" [readonly]=\"readonly\" />\n\n <span class=\"focus-border\"></span>\n\n @if (!inputLoader && inputControl.value && clearVal && hasFocus) {\n <label class=\"clear\" (mousedown)=\"onOptionMouseDown()\" (click)=\"resetInput()\">\n <i class=\"he he-close\"></i>\n </label>\n }\n\n @if (isDropdownOpen) {\n <div #dropdownElement class=\"option-list\" (mousedown)=\"onOptionMouseDown()\" (scroll)=\"onListScroll($event)\">\n @if (options.length === 0 && !isPageLoading && !loadErrorMessage) {\n <div class=\"no-results\">\n <div>No results found</div>\n </div>\n } @else {\n @for (suggestion of options; track suggestion.id; let i = $index) {\n <div class=\"list-item\" [ngClass]=\"{\n 'active': suggestion === selectedItems,\n 'highlighted': highlightedIndex === i\n }\" (click)=\"selectSuggestion(suggestion)\" (mouseover)=\"onMouseOver(i)\">\n {{ suggestion[optionDisplayProperty] }}\n </div>\n }\n\n @if (isPageLoading) {\n <div class=\"list-loading\">Loading...</div>\n }\n\n @if (loadErrorMessage) {\n <div class=\"load-error\" (click)=\"retryLoad($event)\">\n {{ loadErrorMessage }} \u00B7 <span class=\"retry\">Retry</span>\n </div>\n }\n\n @if (paginationType === 'click' && hasMore && !isPageLoading && !loadErrorMessage) {\n <div class=\"load-more\" (click)=\"onLoadMoreClick($event)\">\n Load more ({{ options.length }} of {{ totalCount }})\n </div>\n }\n\n @if (totalCount > 0 && options.length > 0 && !loadErrorMessage && !(paginationType === 'click' && hasMore)) {\n <div class=\"list-footer\">\n {{ options.length }} of {{ totalCount }}\n @if (hasMore && paginationType === 'scroll') {\n <span> \u00B7 scroll for more</span>\n }\n </div>\n }\n }\n </div>\n }\n\n @if (inputLoader) {\n <label class=\"loader input-loader\"></label>\n }\n\n @if (error) {\n <div class=\"val-msg\">{{ errorMessage }}</div>\n }\n</div>\n", styles: [".form-group.paginated-autocomplete .form-control{padding-right:unset}.form-group.paginated-autocomplete .clear{right:7px}.form-group.paginated-autocomplete .option-list{max-height:220px;overflow-y:auto}.form-group.paginated-autocomplete .option-list .no-results{padding:10px;color:#9b9b9b;text-align:center}.form-group.paginated-autocomplete .option-list .list-loading{padding:8px 10px;color:#9b9b9b;text-align:center;font-size:12px}.form-group.paginated-autocomplete .option-list .load-more{padding:8px 10px;text-align:center;cursor:pointer;color:#0d6efd;font-size:13px;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-more:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .load-error{padding:8px 10px;text-align:center;font-size:12px;color:#dc3545;cursor:pointer;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-error .retry{color:#0d6efd;text-decoration:underline}.form-group.paginated-autocomplete .option-list .load-error:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .list-footer{position:sticky;bottom:0;padding:4px 10px;text-align:center;font-size:11px;color:#9b9b9b;background-color:#fff;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}\n"] }]
|
|
3298
|
+
], template: "<div class=\"form-group auto-complete paginated-autocomplete\" [ngClass]=\"customClass\" [class.readonly]=\"readonly\">\n @if (title) {\n <label class=\"inp-label\" [ngClass]=\"{ 'required': required }\">{{ title }}</label>\n }\n\n <input #inputElement type=\"text\" class=\"form-control\" [placeholder]=\"placeholder\" [formControl]=\"inputControl\"\n (input)=\"onUserType($event)\" (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" (focus)=\"onFocus()\" (click)=\"onInputClick()\"\n [ngClass]=\"{'is-invalid': error}\" [attr.autocomplete]=\"autocomplete || null\" [readonly]=\"readonly\" />\n\n <span class=\"focus-border\"></span>\n\n @if (!inputLoader && inputControl.value && clearVal && hasFocus) {\n <label class=\"clear\" (mousedown)=\"onOptionMouseDown()\" (click)=\"resetInput()\">\n <i class=\"he he-close\"></i>\n </label>\n }\n\n @if (isDropdownOpen) {\n <div #dropdownElement class=\"option-list\" (mousedown)=\"onOptionMouseDown()\" (scroll)=\"onListScroll($event)\">\n @if (options.length === 0 && !isPageLoading && !loadErrorMessage) {\n <div class=\"no-results\">\n <div>No results found</div>\n </div>\n } @else {\n @for (suggestion of options; track suggestion.id; let i = $index) {\n <div class=\"list-item\" [ngClass]=\"{\n 'active': suggestion === selectedItems,\n 'highlighted': highlightedIndex === i\n }\" (click)=\"selectSuggestion(suggestion)\" (mouseover)=\"onMouseOver(i)\">\n {{ suggestion[optionDisplayProperty] }}\n </div>\n }\n\n @if (isPageLoading) {\n <div class=\"list-loading\">Loading...</div>\n }\n\n @if (loadErrorMessage) {\n <div class=\"load-error\" (click)=\"retryLoad($event)\">\n {{ loadErrorMessage }} \u00B7 <span class=\"retry\">Retry</span>\n </div>\n }\n\n @if (paginationType === 'click' && hasMore && !isPageLoading && !loadErrorMessage) {\n <div class=\"load-more\" (click)=\"onLoadMoreClick($event)\">\n Load more ({{ options.length }} of {{ totalCount }})\n </div>\n }\n\n @if (totalCount > 0 && options.length > 0 && !loadErrorMessage && !(paginationType === 'click' && hasMore)) {\n <div class=\"list-footer\">\n @if (paginationType === 'arrow') {\n <span class=\"pager\">\n <span class=\"pager-btn\" [class.disabled]=\"currentPage <= 1\" (click)=\"prevArrowPage()\">\u2190</span>\n Page {{ currentPage }} of {{ totalPages }}\n <span class=\"pager-btn\" [class.disabled]=\"currentPage >= totalPages\" (click)=\"nextArrowPage()\">\u2192</span>\n </span>\n } @else {\n {{ options.length }} of {{ totalCount }}\n @if (hasMore && paginationType === 'scroll') {\n <span> \u00B7 scroll for more</span>\n }\n }\n </div>\n }\n }\n </div>\n }\n\n @if (inputLoader) {\n <label class=\"loader input-loader\"></label>\n }\n\n @if (error) {\n <div class=\"val-msg\">{{ errorMessage }}</div>\n }\n</div>\n", styles: [".form-group.paginated-autocomplete .form-control{padding-right:unset}.form-group.paginated-autocomplete .clear{right:7px}.form-group.paginated-autocomplete .option-list{max-height:220px;overflow-y:auto}.form-group.paginated-autocomplete .option-list .no-results{padding:10px;color:#9b9b9b;text-align:center}.form-group.paginated-autocomplete .option-list .list-loading{padding:8px 10px;color:#9b9b9b;text-align:center;font-size:12px}.form-group.paginated-autocomplete .option-list .load-more{padding:8px 10px;text-align:center;cursor:pointer;color:#0d6efd;font-size:13px;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-more:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .load-error{padding:8px 10px;text-align:center;font-size:12px;color:#dc3545;cursor:pointer;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}.form-group.paginated-autocomplete .option-list .load-error .retry{color:#0d6efd;text-decoration:underline}.form-group.paginated-autocomplete .option-list .load-error:hover{background-color:#f5f5f5}.form-group.paginated-autocomplete .option-list .list-footer{position:sticky;bottom:0;padding:4px 10px;text-align:center;font-size:11px;color:#9b9b9b;background-color:#fff;border-top:1px solid #eee;-webkit-user-select:none;user-select:none}\n"] }]
|
|
3228
3299
|
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
3229
3300
|
type: Input
|
|
3230
3301
|
}], required: [{
|