@bnsights/bbsf-controls 1.0.194-beta.0 → 1.0.194-beta.10
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/esm2022/lib/controls/ImageUpload/ImageUpload.component.mjs +1 -1
- package/esm2022/lib/controls/Paging/JwPagination.component.mjs +21 -6
- package/esm2022/lib/controls/Paging/Paging.component.mjs +23 -15
- package/esm2022/lib/controls/page-header-component/page-header-component.component.mjs +1 -1
- package/fesm2022/bnsights-bbsf-controls.mjs +42 -18
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/controls/Paging/Paging.component.d.ts +4 -2
- package/package.json +3 -3
- package/src/lib/assets/Style.scss +0 -2
|
@@ -7,7 +7,7 @@ import { Validators, FormControl, FormsModule, ReactiveFormsModule, FormGroup, F
|
|
|
7
7
|
import * as i3$3 from '@angular/router';
|
|
8
8
|
import { RouterModule } from '@angular/router';
|
|
9
9
|
import * as i3$2 from '@ng-bootstrap/ng-bootstrap';
|
|
10
|
-
import { NgbModule, NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
10
|
+
import { NgbModule, NgbTooltip, NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
11
11
|
import * as i1$1 from '@ngrx/store-devtools';
|
|
12
12
|
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
13
13
|
import { TranslateService } from '@ngx-translate/core';
|
|
@@ -3134,11 +3134,26 @@ class JwPaginationComponent {
|
|
|
3134
3134
|
}
|
|
3135
3135
|
}
|
|
3136
3136
|
ngOnChanges(changes) {
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3137
|
+
// Handle items array changes
|
|
3138
|
+
if (changes.items && !changes.items.firstChange) {
|
|
3139
|
+
// reset page if items array has changed
|
|
3140
|
+
if (changes.items.currentValue !== changes.items.previousValue) {
|
|
3141
|
+
this.setPage(this.initialPage);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
// Handle initialPage changes (when navigating between pages)
|
|
3145
|
+
if (changes.initialPage && !changes.initialPage.firstChange) {
|
|
3146
|
+
if (changes.initialPage.currentValue !== changes.initialPage.previousValue) {
|
|
3147
|
+
this.setPage(this.initialPage);
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
// Handle pageSize or maxPages changes
|
|
3151
|
+
if ((changes.pageSize && !changes.pageSize.firstChange) ||
|
|
3152
|
+
(changes.maxPages && !changes.maxPages.firstChange)) {
|
|
3153
|
+
// Recalculate pagination with new settings
|
|
3154
|
+
if (this.items && this.items.length) {
|
|
3155
|
+
this.setPage(this.pager.currentPage || this.initialPage);
|
|
3156
|
+
}
|
|
3142
3157
|
}
|
|
3143
3158
|
}
|
|
3144
3159
|
setPage(page) {
|
|
@@ -3275,7 +3290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
3275
3290
|
}] } });
|
|
3276
3291
|
|
|
3277
3292
|
class PagingComponent {
|
|
3278
|
-
constructor(utilityService, http, router, route, location, onChangeService, requestHandlerService, cdr) {
|
|
3293
|
+
constructor(utilityService, http, router, route, location, onChangeService, requestHandlerService, cdr, renderer, elementRef) {
|
|
3279
3294
|
this.utilityService = utilityService;
|
|
3280
3295
|
this.http = http;
|
|
3281
3296
|
this.router = router;
|
|
@@ -3284,6 +3299,8 @@ class PagingComponent {
|
|
|
3284
3299
|
this.onChangeService = onChangeService;
|
|
3285
3300
|
this.requestHandlerService = requestHandlerService;
|
|
3286
3301
|
this.cdr = cdr;
|
|
3302
|
+
this.renderer = renderer;
|
|
3303
|
+
this.elementRef = elementRef;
|
|
3287
3304
|
this.items = [];
|
|
3288
3305
|
this.result = [];
|
|
3289
3306
|
this.pagerConfig = null;
|
|
@@ -3547,18 +3564,25 @@ class PagingComponent {
|
|
|
3547
3564
|
}
|
|
3548
3565
|
if (this.options.onKeyPressFiltersControlNames != null && this.options.onKeyPressFiltersControlNames.length > 0) {
|
|
3549
3566
|
const OnKeyPressFiltersControlNames = this.options.onKeyPressFiltersControlNames;
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3567
|
+
// Use Renderer2 to listen to document keypress event
|
|
3568
|
+
// This works with elements in parent component
|
|
3569
|
+
const keypressListener = this.renderer.listen('document', 'keypress', (event) => {
|
|
3570
|
+
if (event.key === "Enter") {
|
|
3571
|
+
const target = event.target;
|
|
3572
|
+
const formControlName = target.getAttribute('id');
|
|
3573
|
+
if (formControlName && OnKeyPressFiltersControlNames.includes(formControlName)) {
|
|
3574
|
+
event.preventDefault();
|
|
3575
|
+
event.stopPropagation();
|
|
3555
3576
|
this.currentPage = 1;
|
|
3556
3577
|
this.isFirstCall = true;
|
|
3557
3578
|
this.updateHistoryState();
|
|
3558
3579
|
this.getItemList(this.currentPage, true);
|
|
3580
|
+
return false;
|
|
3559
3581
|
}
|
|
3560
|
-
}
|
|
3561
|
-
}
|
|
3582
|
+
}
|
|
3583
|
+
});
|
|
3584
|
+
// Store the unsubscribe function
|
|
3585
|
+
this.subscriptions.add({ unsubscribe: keypressListener });
|
|
3562
3586
|
}
|
|
3563
3587
|
//Add click event on Reset Filter button
|
|
3564
3588
|
if (this.options.resetFilterButtonName != null) {
|
|
@@ -3844,8 +3868,8 @@ class PagingComponent {
|
|
|
3844
3868
|
}
|
|
3845
3869
|
return filters;
|
|
3846
3870
|
}
|
|
3847
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PagingComponent, deps: [{ token: i3.UtilityService }, { token: i1.HttpClient }, { token: i3$3.Router }, { token: i3$3.ActivatedRoute }, { token: i5.Location }, { token: OnPagingFiltersChangeService }, { token: i3$1.RequestHandlerService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3848
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PagingComponent, isStandalone: true, selector: "BBSF-Paging", inputs: { options: "options", group: "group" }, outputs: { Items: "Items", pageStateRestored: "pageStateRestored" }, host: { listeners: { "window:popstate": "onPopState($event)" } }, ngImport: i0, template: "<div class=\"form-group bbsf-control bbsf-paging\" *ngIf=\"(result.length > 0)\" role=\"navigation\" [attr.aria-label]=\"utilityService.getResourceValue('Pagination')\">\r\n <!--paging container-->\r\n <div class=\"bbsf-paging-container\" *ngIf=\"!options.isLoadMoreControl\">\r\n <!--items-->\r\n <div class=\"bbsf-pagination\">\r\n <jw-pagination [items]=\"items\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\"\r\n (changePage)=\"onChangePage($event)\" [pageSize]=\"options.pageSize\" [ShowFirstAndLast]=\"options.showFirstAndLast\"\r\n [initialPage]=\"currentPage\" [maxPages]=\"10\"></jw-pagination>\r\n </div>\r\n <!--page count-->\r\n <div class=\"bbsf-pages\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\">\r\n <select (change)=\"changePageSize($event)\" *ngIf=\"options.showPageSizeOption\" \r\n [attr.aria-label]=\"utilityService.getResourceValue('SelectPageSize')\" \r\n [ngbTooltip]=\"utilityService.getResourceValue('SelectPageSize')\">\r\n <option>10</option>\r\n <option>20</option>\r\n <option>50</option>\r\n <option>100</option>\r\n <option>200</option>\r\n </select>\r\n <div class=\"bssf-items\" [attr.aria-label]=\"utilityService.getResourceValue('PageInfo')\">\r\n <strong>{{totalRow}}</strong> {{itemsText}} {{utilityService.getResourceValue(\"In\")}} <strong>\r\n {{Pages}}</strong> {{pagesText}}\r\n </div>\r\n </div>\r\n </div>\r\n <!--load more-->\r\n <div class=\"bbsf-loadmore\" *ngIf=\"options.isLoadMoreControl\">\r\n <div class=\"search-results\" infinite-scroll [infiniteScrollDistance]=\"scrollDistance\"\r\n [infiniteScrollUpDistance]=\"scrollUpDistance\" [infiniteScrollThrottle]=\"throttle\"\r\n (scrolled)=\"options.isInfiniteScroll==true?onScrollDown():null\" [scrollWindow]=\"options.scrollWindow\"\r\n [infiniteScrollContainer]=\"options.infiniteScrollContainer\">\r\n </div>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"onScrollDown()\"\r\n *ngIf=\"!(result.length==totalRow)\"\r\n [attr.aria-label]=\"utilityService.getResourceValue('LoadMore')\"\r\n [ngbTooltip]=\"utilityService.getResourceValue('LoadMore')\">{{utilityService.getResourceValue(\"LoadMore\")}}</button>\r\n </div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "
|
|
3871
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PagingComponent, deps: [{ token: i3.UtilityService }, { token: i1.HttpClient }, { token: i3$3.Router }, { token: i3$3.ActivatedRoute }, { token: i5.Location }, { token: OnPagingFiltersChangeService }, { token: i3$1.RequestHandlerService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3872
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PagingComponent, isStandalone: true, selector: "BBSF-Paging", inputs: { options: "options", group: "group" }, outputs: { Items: "Items", pageStateRestored: "pageStateRestored" }, host: { listeners: { "window:popstate": "onPopState($event)" } }, ngImport: i0, template: "<div class=\"form-group bbsf-control bbsf-paging\" *ngIf=\"(result.length > 0)\" role=\"navigation\" [attr.aria-label]=\"utilityService.getResourceValue('Pagination')\">\r\n <!--paging container-->\r\n <div class=\"bbsf-paging-container\" *ngIf=\"!options.isLoadMoreControl\">\r\n <!--items-->\r\n <div class=\"bbsf-pagination\">\r\n <jw-pagination [items]=\"items\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\"\r\n (changePage)=\"onChangePage($event)\" [pageSize]=\"options.pageSize\" [ShowFirstAndLast]=\"options.showFirstAndLast\"\r\n [initialPage]=\"currentPage\" [maxPages]=\"10\"></jw-pagination>\r\n </div>\r\n <!--page count-->\r\n <div class=\"bbsf-pages\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\">\r\n <select (change)=\"changePageSize($event)\" *ngIf=\"options.showPageSizeOption\" \r\n [attr.aria-label]=\"utilityService.getResourceValue('SelectPageSize')\" \r\n [ngbTooltip]=\"utilityService.getResourceValue('SelectPageSize')\">\r\n <option>10</option>\r\n <option>20</option>\r\n <option>50</option>\r\n <option>100</option>\r\n <option>200</option>\r\n </select>\r\n <div class=\"bssf-items\" [attr.aria-label]=\"utilityService.getResourceValue('PageInfo')\">\r\n <strong>{{totalRow}}</strong> {{itemsText}} {{utilityService.getResourceValue(\"In\")}} <strong>\r\n {{Pages}}</strong> {{pagesText}}\r\n </div>\r\n </div>\r\n </div>\r\n <!--load more-->\r\n <div class=\"bbsf-loadmore\" *ngIf=\"options.isLoadMoreControl\">\r\n <div class=\"search-results\" infinite-scroll [infiniteScrollDistance]=\"scrollDistance\"\r\n [infiniteScrollUpDistance]=\"scrollUpDistance\" [infiniteScrollThrottle]=\"throttle\"\r\n (scrolled)=\"options.isInfiniteScroll==true?onScrollDown():null\" [scrollWindow]=\"options.scrollWindow\"\r\n [infiniteScrollContainer]=\"options.infiniteScrollContainer\">\r\n </div>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"onScrollDown()\"\r\n *ngIf=\"!(result.length==totalRow)\"\r\n [attr.aria-label]=\"utilityService.getResourceValue('LoadMore')\"\r\n [ngbTooltip]=\"utilityService.getResourceValue('LoadMore')\">{{utilityService.getResourceValue(\"LoadMore\")}}</button>\r\n </div>\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "tooltipContext", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "ngmodule", type: BlockUIModule }, { kind: "ngmodule", type: InlineSVGModule }, { kind: "component", type: JwPaginationComponent, selector: "jw-pagination", inputs: ["items", "initialPage", "pageSize", "maxPages", "ShowFirstAndLast"], outputs: ["changePage"] }] }); }
|
|
3849
3873
|
}
|
|
3850
3874
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PagingComponent, decorators: [{
|
|
3851
3875
|
type: Component,
|
|
@@ -3853,12 +3877,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
3853
3877
|
CommonModule,
|
|
3854
3878
|
FormsModule,
|
|
3855
3879
|
ReactiveFormsModule,
|
|
3856
|
-
|
|
3880
|
+
NgbTooltip,
|
|
3857
3881
|
BlockUIModule,
|
|
3858
3882
|
InlineSVGModule,
|
|
3859
3883
|
JwPaginationComponent
|
|
3860
3884
|
], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], template: "<div class=\"form-group bbsf-control bbsf-paging\" *ngIf=\"(result.length > 0)\" role=\"navigation\" [attr.aria-label]=\"utilityService.getResourceValue('Pagination')\">\r\n <!--paging container-->\r\n <div class=\"bbsf-paging-container\" *ngIf=\"!options.isLoadMoreControl\">\r\n <!--items-->\r\n <div class=\"bbsf-pagination\">\r\n <jw-pagination [items]=\"items\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\"\r\n (changePage)=\"onChangePage($event)\" [pageSize]=\"options.pageSize\" [ShowFirstAndLast]=\"options.showFirstAndLast\"\r\n [initialPage]=\"currentPage\" [maxPages]=\"10\"></jw-pagination>\r\n </div>\r\n <!--page count-->\r\n <div class=\"bbsf-pages\" *ngIf=\"!((Pages==1)&&options.hidePaginationWhenPageSizeEqualOne)\">\r\n <select (change)=\"changePageSize($event)\" *ngIf=\"options.showPageSizeOption\" \r\n [attr.aria-label]=\"utilityService.getResourceValue('SelectPageSize')\" \r\n [ngbTooltip]=\"utilityService.getResourceValue('SelectPageSize')\">\r\n <option>10</option>\r\n <option>20</option>\r\n <option>50</option>\r\n <option>100</option>\r\n <option>200</option>\r\n </select>\r\n <div class=\"bssf-items\" [attr.aria-label]=\"utilityService.getResourceValue('PageInfo')\">\r\n <strong>{{totalRow}}</strong> {{itemsText}} {{utilityService.getResourceValue(\"In\")}} <strong>\r\n {{Pages}}</strong> {{pagesText}}\r\n </div>\r\n </div>\r\n </div>\r\n <!--load more-->\r\n <div class=\"bbsf-loadmore\" *ngIf=\"options.isLoadMoreControl\">\r\n <div class=\"search-results\" infinite-scroll [infiniteScrollDistance]=\"scrollDistance\"\r\n [infiniteScrollUpDistance]=\"scrollUpDistance\" [infiniteScrollThrottle]=\"throttle\"\r\n (scrolled)=\"options.isInfiniteScroll==true?onScrollDown():null\" [scrollWindow]=\"options.scrollWindow\"\r\n [infiniteScrollContainer]=\"options.infiniteScrollContainer\">\r\n </div>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"onScrollDown()\"\r\n *ngIf=\"!(result.length==totalRow)\"\r\n [attr.aria-label]=\"utilityService.getResourceValue('LoadMore')\"\r\n [ngbTooltip]=\"utilityService.getResourceValue('LoadMore')\">{{utilityService.getResourceValue(\"LoadMore\")}}</button>\r\n </div>\r\n</div>" }]
|
|
3861
|
-
}], ctorParameters: () => [{ type: i3.UtilityService }, { type: i1.HttpClient }, { type: i3$3.Router }, { type: i3$3.ActivatedRoute }, { type: i5.Location }, { type: OnPagingFiltersChangeService }, { type: i3$1.RequestHandlerService }, { type: i0.ChangeDetectorRef }], propDecorators: { Items: [{
|
|
3885
|
+
}], ctorParameters: () => [{ type: i3.UtilityService }, { type: i1.HttpClient }, { type: i3$3.Router }, { type: i3$3.ActivatedRoute }, { type: i5.Location }, { type: OnPagingFiltersChangeService }, { type: i3$1.RequestHandlerService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { Items: [{
|
|
3862
3886
|
type: Output
|
|
3863
3887
|
}], pageStateRestored: [{
|
|
3864
3888
|
type: Output
|