@eduboxpro/studio 0.1.25 → 0.1.26
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/eduboxpro-studio.mjs +366 -1
- package/fesm2022/eduboxpro-studio.mjs.map +1 -1
- package/index.d.ts +102 -36
- package/package.json +1 -1
|
@@ -5372,6 +5372,371 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
5372
5372
|
* Switch component
|
|
5373
5373
|
*/
|
|
5374
5374
|
|
|
5375
|
+
/**
|
|
5376
|
+
* Pagination component for navigating through pages of data
|
|
5377
|
+
*
|
|
5378
|
+
* @example
|
|
5379
|
+
* <studio-pagination
|
|
5380
|
+
* [(page)]="currentPage"
|
|
5381
|
+
* [(pageSize)]="pageSize"
|
|
5382
|
+
* [totalItems]="100"
|
|
5383
|
+
* [pageSizeOptions]="[10, 25, 50]"
|
|
5384
|
+
* (pageChange)="onPageChange($event)"
|
|
5385
|
+
* />
|
|
5386
|
+
*/
|
|
5387
|
+
class PaginationComponent {
|
|
5388
|
+
// Two-way bindings
|
|
5389
|
+
page = model(1, ...(ngDevMode ? [{ debugName: "page" }] : []));
|
|
5390
|
+
pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
5391
|
+
// Inputs
|
|
5392
|
+
totalItems = input(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
|
|
5393
|
+
pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
5394
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
5395
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
5396
|
+
maxVisiblePages = input(5, ...(ngDevMode ? [{ debugName: "maxVisiblePages" }] : []));
|
|
5397
|
+
// Display options
|
|
5398
|
+
showPageSizeSelector = input(true, ...(ngDevMode ? [{ debugName: "showPageSizeSelector" }] : []));
|
|
5399
|
+
showPageNumbers = input(true, ...(ngDevMode ? [{ debugName: "showPageNumbers" }] : []));
|
|
5400
|
+
showInfo = input(true, ...(ngDevMode ? [{ debugName: "showInfo" }] : []));
|
|
5401
|
+
showFirstLast = input(false, ...(ngDevMode ? [{ debugName: "showFirstLast" }] : []));
|
|
5402
|
+
// Labels
|
|
5403
|
+
pageSizeLabel = input('Показать:', ...(ngDevMode ? [{ debugName: "pageSizeLabel" }] : []));
|
|
5404
|
+
previousLabel = input('Предыдущая', ...(ngDevMode ? [{ debugName: "previousLabel" }] : []));
|
|
5405
|
+
nextLabel = input('Следующая', ...(ngDevMode ? [{ debugName: "nextLabel" }] : []));
|
|
5406
|
+
firstLabel = input('Первая', ...(ngDevMode ? [{ debugName: "firstLabel" }] : []));
|
|
5407
|
+
lastLabel = input('Последняя', ...(ngDevMode ? [{ debugName: "lastLabel" }] : []));
|
|
5408
|
+
infoTemplate = input('Показано {from}-{to} из {total}', ...(ngDevMode ? [{ debugName: "infoTemplate" }] : []));
|
|
5409
|
+
// Outputs
|
|
5410
|
+
pageChange = output();
|
|
5411
|
+
pageSizeChange = output();
|
|
5412
|
+
// Computed values
|
|
5413
|
+
totalPages = computed(() => {
|
|
5414
|
+
const total = this.totalItems();
|
|
5415
|
+
const size = this.pageSize();
|
|
5416
|
+
return Math.max(1, Math.ceil(total / size));
|
|
5417
|
+
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
5418
|
+
isFirstPage = computed(() => this.page() <= 1, ...(ngDevMode ? [{ debugName: "isFirstPage" }] : []));
|
|
5419
|
+
isLastPage = computed(() => this.page() >= this.totalPages(), ...(ngDevMode ? [{ debugName: "isLastPage" }] : []));
|
|
5420
|
+
iconSize = computed(() => {
|
|
5421
|
+
const sizeMap = { sm: 14, md: 16, lg: 20 };
|
|
5422
|
+
return sizeMap[this.size()];
|
|
5423
|
+
}, ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
|
|
5424
|
+
hostClasses = computed(() => classNames('studio-pagination', `pagination--${this.size()}`, `pagination--${this.variant()}`), ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
5425
|
+
infoText = computed(() => {
|
|
5426
|
+
const currentPage = this.page();
|
|
5427
|
+
const size = this.pageSize();
|
|
5428
|
+
const total = this.totalItems();
|
|
5429
|
+
const from = total === 0 ? 0 : (currentPage - 1) * size + 1;
|
|
5430
|
+
const to = Math.min(currentPage * size, total);
|
|
5431
|
+
return this.infoTemplate()
|
|
5432
|
+
.replace('{from}', from.toString())
|
|
5433
|
+
.replace('{to}', to.toString())
|
|
5434
|
+
.replace('{total}', total.toString());
|
|
5435
|
+
}, ...(ngDevMode ? [{ debugName: "infoText" }] : []));
|
|
5436
|
+
visiblePages = computed(() => {
|
|
5437
|
+
const totalPages = this.totalPages();
|
|
5438
|
+
const currentPage = this.page();
|
|
5439
|
+
const maxVisible = this.maxVisiblePages();
|
|
5440
|
+
if (totalPages <= maxVisible) {
|
|
5441
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5442
|
+
}
|
|
5443
|
+
const pages = [];
|
|
5444
|
+
const half = Math.floor(maxVisible / 2);
|
|
5445
|
+
let start = Math.max(1, currentPage - half);
|
|
5446
|
+
let end = Math.min(totalPages, start + maxVisible - 1);
|
|
5447
|
+
if (end - start < maxVisible - 1) {
|
|
5448
|
+
start = Math.max(1, end - maxVisible + 1);
|
|
5449
|
+
}
|
|
5450
|
+
// Always show first page
|
|
5451
|
+
if (start > 1) {
|
|
5452
|
+
pages.push(1);
|
|
5453
|
+
if (start > 2) {
|
|
5454
|
+
pages.push(-1); // Ellipsis
|
|
5455
|
+
}
|
|
5456
|
+
}
|
|
5457
|
+
// Middle pages
|
|
5458
|
+
for (let i = start; i <= end; i++) {
|
|
5459
|
+
if (!pages.includes(i)) {
|
|
5460
|
+
pages.push(i);
|
|
5461
|
+
}
|
|
5462
|
+
}
|
|
5463
|
+
// Always show last page
|
|
5464
|
+
if (end < totalPages) {
|
|
5465
|
+
if (end < totalPages - 1) {
|
|
5466
|
+
pages.push(-1); // Ellipsis
|
|
5467
|
+
}
|
|
5468
|
+
pages.push(totalPages);
|
|
5469
|
+
}
|
|
5470
|
+
return pages;
|
|
5471
|
+
}, ...(ngDevMode ? [{ debugName: "visiblePages" }] : []));
|
|
5472
|
+
// Methods
|
|
5473
|
+
goToPage(pageNum) {
|
|
5474
|
+
if (pageNum < 1 || pageNum > this.totalPages() || pageNum === this.page()) {
|
|
5475
|
+
return;
|
|
5476
|
+
}
|
|
5477
|
+
this.page.set(pageNum);
|
|
5478
|
+
this.emitPageChange();
|
|
5479
|
+
}
|
|
5480
|
+
goToFirst() {
|
|
5481
|
+
this.goToPage(1);
|
|
5482
|
+
}
|
|
5483
|
+
goToLast() {
|
|
5484
|
+
this.goToPage(this.totalPages());
|
|
5485
|
+
}
|
|
5486
|
+
goToPrevious() {
|
|
5487
|
+
this.goToPage(this.page() - 1);
|
|
5488
|
+
}
|
|
5489
|
+
goToNext() {
|
|
5490
|
+
this.goToPage(this.page() + 1);
|
|
5491
|
+
}
|
|
5492
|
+
onPageSizeChange(newSize) {
|
|
5493
|
+
const previousSize = this.pageSize();
|
|
5494
|
+
const newSizeNum = Number(newSize);
|
|
5495
|
+
if (newSizeNum === previousSize)
|
|
5496
|
+
return;
|
|
5497
|
+
// Calculate new page to keep similar position
|
|
5498
|
+
const currentFirstItem = (this.page() - 1) * previousSize + 1;
|
|
5499
|
+
const newPage = Math.ceil(currentFirstItem / newSizeNum);
|
|
5500
|
+
this.pageSize.set(newSizeNum);
|
|
5501
|
+
this.page.set(Math.max(1, Math.min(newPage, Math.ceil(this.totalItems() / newSizeNum))));
|
|
5502
|
+
this.pageSizeChange.emit({
|
|
5503
|
+
pageSize: newSizeNum,
|
|
5504
|
+
previousPageSize: previousSize,
|
|
5505
|
+
});
|
|
5506
|
+
this.emitPageChange();
|
|
5507
|
+
}
|
|
5508
|
+
emitPageChange() {
|
|
5509
|
+
this.pageChange.emit({
|
|
5510
|
+
page: this.page(),
|
|
5511
|
+
pageSize: this.pageSize(),
|
|
5512
|
+
totalItems: this.totalItems(),
|
|
5513
|
+
totalPages: this.totalPages(),
|
|
5514
|
+
});
|
|
5515
|
+
}
|
|
5516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5517
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: PaginationComponent, isStandalone: true, selector: "studio-pagination", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, maxVisiblePages: { classPropertyName: "maxVisiblePages", publicName: "maxVisiblePages", isSignal: true, isRequired: false, transformFunction: null }, showPageSizeSelector: { classPropertyName: "showPageSizeSelector", publicName: "showPageSizeSelector", isSignal: true, isRequired: false, transformFunction: null }, showPageNumbers: { classPropertyName: "showPageNumbers", publicName: "showPageNumbers", isSignal: true, isRequired: false, transformFunction: null }, showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, showFirstLast: { classPropertyName: "showFirstLast", publicName: "showFirstLast", isSignal: true, isRequired: false, transformFunction: null }, pageSizeLabel: { classPropertyName: "pageSizeLabel", publicName: "pageSizeLabel", isSignal: true, isRequired: false, transformFunction: null }, previousLabel: { classPropertyName: "previousLabel", publicName: "previousLabel", isSignal: true, isRequired: false, transformFunction: null }, nextLabel: { classPropertyName: "nextLabel", publicName: "nextLabel", isSignal: true, isRequired: false, transformFunction: null }, firstLabel: { classPropertyName: "firstLabel", publicName: "firstLabel", isSignal: true, isRequired: false, transformFunction: null }, lastLabel: { classPropertyName: "lastLabel", publicName: "lastLabel", isSignal: true, isRequired: false, transformFunction: null }, infoTemplate: { classPropertyName: "infoTemplate", publicName: "infoTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", pageSize: "pageSizeChange", pageChange: "pageChange", pageSizeChange: "pageSizeChange" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
|
|
5518
|
+
<div class="studio-pagination__container">
|
|
5519
|
+
<!-- Page size selector -->
|
|
5520
|
+
@if (showPageSizeSelector()) {
|
|
5521
|
+
<div class="studio-pagination__page-size">
|
|
5522
|
+
<span class="studio-pagination__label">{{ pageSizeLabel() }}</span>
|
|
5523
|
+
<select
|
|
5524
|
+
class="studio-pagination__select"
|
|
5525
|
+
[ngModel]="pageSize()"
|
|
5526
|
+
(ngModelChange)="onPageSizeChange($event)"
|
|
5527
|
+
>
|
|
5528
|
+
@for (option of pageSizeOptions(); track option) {
|
|
5529
|
+
<option [value]="option">{{ option }}</option>
|
|
5530
|
+
}
|
|
5531
|
+
</select>
|
|
5532
|
+
</div>
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5535
|
+
<!-- Info text -->
|
|
5536
|
+
@if (showInfo()) {
|
|
5537
|
+
<div class="studio-pagination__info">
|
|
5538
|
+
{{ infoText() }}
|
|
5539
|
+
</div>
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
<!-- Navigation -->
|
|
5543
|
+
<div class="studio-pagination__nav">
|
|
5544
|
+
<!-- First page button -->
|
|
5545
|
+
@if (showFirstLast()) {
|
|
5546
|
+
<button
|
|
5547
|
+
type="button"
|
|
5548
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5549
|
+
[disabled]="isFirstPage()"
|
|
5550
|
+
(click)="goToFirst()"
|
|
5551
|
+
[attr.aria-label]="firstLabel()"
|
|
5552
|
+
>
|
|
5553
|
+
<studio-icon name="chevrons-left" [size]="iconSize()" />
|
|
5554
|
+
</button>
|
|
5555
|
+
}
|
|
5556
|
+
|
|
5557
|
+
<!-- Previous button -->
|
|
5558
|
+
<button
|
|
5559
|
+
type="button"
|
|
5560
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5561
|
+
[disabled]="isFirstPage()"
|
|
5562
|
+
(click)="goToPrevious()"
|
|
5563
|
+
[attr.aria-label]="previousLabel()"
|
|
5564
|
+
>
|
|
5565
|
+
<studio-icon name="chevron-left" [size]="iconSize()" />
|
|
5566
|
+
</button>
|
|
5567
|
+
|
|
5568
|
+
<!-- Page numbers -->
|
|
5569
|
+
@if (showPageNumbers()) {
|
|
5570
|
+
<div class="studio-pagination__pages">
|
|
5571
|
+
@for (pageNum of visiblePages(); track pageNum) {
|
|
5572
|
+
@if (pageNum === -1) {
|
|
5573
|
+
<span class="studio-pagination__ellipsis">...</span>
|
|
5574
|
+
} @else {
|
|
5575
|
+
<button
|
|
5576
|
+
type="button"
|
|
5577
|
+
class="studio-pagination__btn studio-pagination__btn--page"
|
|
5578
|
+
[class.studio-pagination__btn--active]="pageNum === page()"
|
|
5579
|
+
(click)="goToPage(pageNum)"
|
|
5580
|
+
[attr.aria-label]="'Page ' + pageNum"
|
|
5581
|
+
[attr.aria-current]="pageNum === page() ? 'page' : null"
|
|
5582
|
+
>
|
|
5583
|
+
{{ pageNum }}
|
|
5584
|
+
</button>
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
</div>
|
|
5588
|
+
} @else {
|
|
5589
|
+
<!-- Simple page indicator -->
|
|
5590
|
+
<span class="studio-pagination__indicator">
|
|
5591
|
+
{{ page() }} / {{ totalPages() }}
|
|
5592
|
+
</span>
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
<!-- Next button -->
|
|
5596
|
+
<button
|
|
5597
|
+
type="button"
|
|
5598
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5599
|
+
[disabled]="isLastPage()"
|
|
5600
|
+
(click)="goToNext()"
|
|
5601
|
+
[attr.aria-label]="nextLabel()"
|
|
5602
|
+
>
|
|
5603
|
+
<studio-icon name="chevron-right" [size]="iconSize()" />
|
|
5604
|
+
</button>
|
|
5605
|
+
|
|
5606
|
+
<!-- Last page button -->
|
|
5607
|
+
@if (showFirstLast()) {
|
|
5608
|
+
<button
|
|
5609
|
+
type="button"
|
|
5610
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5611
|
+
[disabled]="isLastPage()"
|
|
5612
|
+
(click)="goToLast()"
|
|
5613
|
+
[attr.aria-label]="lastLabel()"
|
|
5614
|
+
>
|
|
5615
|
+
<studio-icon name="chevrons-right" [size]="iconSize()" />
|
|
5616
|
+
</button>
|
|
5617
|
+
}
|
|
5618
|
+
</div>
|
|
5619
|
+
</div>
|
|
5620
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--studio-font-family)}.studio-pagination__container{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}.studio-pagination__page-size{display:flex;align-items:center;gap:.5rem}.studio-pagination__label{font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}.studio-pagination__select{padding:.375rem .75rem;font-size:.875rem;border:1px solid var(--studio-border-primary);border-radius:var(--studio-radius-md);background:var(--studio-bg-primary);color:var(--studio-text-primary);cursor:pointer;outline:none;transition:border-color var(--studio-transition-fast)}.studio-pagination__select:hover{border-color:var(--studio-border-hover, var(--studio-border-primary))}.studio-pagination__select:focus{border-color:var(--studio-color-primary);box-shadow:0 0 0 2px var(--studio-color-primary-alpha, rgba(59, 130, 246, .2))}.studio-pagination__info{font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}.studio-pagination__nav{display:flex;align-items:center;gap:.25rem}.studio-pagination__btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--studio-border-primary);border-radius:var(--studio-radius-md);background:var(--studio-bg-primary);color:var(--studio-text-primary);cursor:pointer;transition:all var(--studio-transition-fast)}.studio-pagination__btn:hover:not(:disabled){background:var(--studio-bg-secondary);border-color:var(--studio-border-hover, var(--studio-border-primary))}.studio-pagination__btn:active:not(:disabled){transform:scale(.95)}.studio-pagination__btn:disabled{opacity:.5;cursor:not-allowed}.studio-pagination__btn--nav{padding:.375rem}.studio-pagination__btn--page{min-width:2rem;padding:.375rem .5rem;font-size:.875rem}.studio-pagination__btn--active{background:var(--studio-color-primary);border-color:var(--studio-color-primary);color:#fff}.studio-pagination__btn--active:hover:not(:disabled){background:var(--studio-color-primary-hover, var(--studio-color-primary));border-color:var(--studio-color-primary-hover, var(--studio-color-primary))}.studio-pagination__pages{display:flex;align-items:center;gap:.25rem}.studio-pagination__ellipsis{padding:0 .5rem;color:var(--studio-text-secondary)}.studio-pagination__indicator{padding:0 .75rem;font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}:host(.pagination--sm) .studio-pagination__label,:host(.pagination--sm) .studio-pagination__info,:host(.pagination--sm) .studio-pagination__indicator{font-size:.75rem}:host(.pagination--sm) .studio-pagination__select{padding:.25rem .5rem;font-size:.75rem}:host(.pagination--sm) .studio-pagination__btn--nav{padding:.25rem}:host(.pagination--sm) .studio-pagination__btn--page{min-width:1.75rem;padding:.25rem .375rem;font-size:.75rem}:host(.pagination--lg) .studio-pagination__label,:host(.pagination--lg) .studio-pagination__info,:host(.pagination--lg) .studio-pagination__indicator{font-size:1rem}:host(.pagination--lg) .studio-pagination__select{padding:.5rem 1rem;font-size:1rem}:host(.pagination--lg) .studio-pagination__btn--nav{padding:.5rem}:host(.pagination--lg) .studio-pagination__btn--page{min-width:2.5rem;padding:.5rem .75rem;font-size:1rem}:host(.pagination--minimal) .studio-pagination__btn{border:none;background:transparent}:host(.pagination--minimal) .studio-pagination__btn:hover:not(:disabled){background:var(--studio-bg-secondary)}:host(.pagination--minimal) .studio-pagination__btn--active{background:var(--studio-color-primary);color:#fff}:host(.pagination--compact) .studio-pagination__container{gap:.5rem}:host(.pagination--compact) .studio-pagination__nav,:host(.pagination--compact) .studio-pagination__pages{gap:.125rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "studio-icon", inputs: ["name", "size", "color", "strokeWidth", "absoluteStrokeWidth", "showFallback", "fallbackIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5621
|
+
}
|
|
5622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
5623
|
+
type: Component,
|
|
5624
|
+
args: [{ selector: 'studio-pagination', imports: [CommonModule, FormsModule, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5625
|
+
'[class]': 'hostClasses()',
|
|
5626
|
+
}, template: `
|
|
5627
|
+
<div class="studio-pagination__container">
|
|
5628
|
+
<!-- Page size selector -->
|
|
5629
|
+
@if (showPageSizeSelector()) {
|
|
5630
|
+
<div class="studio-pagination__page-size">
|
|
5631
|
+
<span class="studio-pagination__label">{{ pageSizeLabel() }}</span>
|
|
5632
|
+
<select
|
|
5633
|
+
class="studio-pagination__select"
|
|
5634
|
+
[ngModel]="pageSize()"
|
|
5635
|
+
(ngModelChange)="onPageSizeChange($event)"
|
|
5636
|
+
>
|
|
5637
|
+
@for (option of pageSizeOptions(); track option) {
|
|
5638
|
+
<option [value]="option">{{ option }}</option>
|
|
5639
|
+
}
|
|
5640
|
+
</select>
|
|
5641
|
+
</div>
|
|
5642
|
+
}
|
|
5643
|
+
|
|
5644
|
+
<!-- Info text -->
|
|
5645
|
+
@if (showInfo()) {
|
|
5646
|
+
<div class="studio-pagination__info">
|
|
5647
|
+
{{ infoText() }}
|
|
5648
|
+
</div>
|
|
5649
|
+
}
|
|
5650
|
+
|
|
5651
|
+
<!-- Navigation -->
|
|
5652
|
+
<div class="studio-pagination__nav">
|
|
5653
|
+
<!-- First page button -->
|
|
5654
|
+
@if (showFirstLast()) {
|
|
5655
|
+
<button
|
|
5656
|
+
type="button"
|
|
5657
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5658
|
+
[disabled]="isFirstPage()"
|
|
5659
|
+
(click)="goToFirst()"
|
|
5660
|
+
[attr.aria-label]="firstLabel()"
|
|
5661
|
+
>
|
|
5662
|
+
<studio-icon name="chevrons-left" [size]="iconSize()" />
|
|
5663
|
+
</button>
|
|
5664
|
+
}
|
|
5665
|
+
|
|
5666
|
+
<!-- Previous button -->
|
|
5667
|
+
<button
|
|
5668
|
+
type="button"
|
|
5669
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5670
|
+
[disabled]="isFirstPage()"
|
|
5671
|
+
(click)="goToPrevious()"
|
|
5672
|
+
[attr.aria-label]="previousLabel()"
|
|
5673
|
+
>
|
|
5674
|
+
<studio-icon name="chevron-left" [size]="iconSize()" />
|
|
5675
|
+
</button>
|
|
5676
|
+
|
|
5677
|
+
<!-- Page numbers -->
|
|
5678
|
+
@if (showPageNumbers()) {
|
|
5679
|
+
<div class="studio-pagination__pages">
|
|
5680
|
+
@for (pageNum of visiblePages(); track pageNum) {
|
|
5681
|
+
@if (pageNum === -1) {
|
|
5682
|
+
<span class="studio-pagination__ellipsis">...</span>
|
|
5683
|
+
} @else {
|
|
5684
|
+
<button
|
|
5685
|
+
type="button"
|
|
5686
|
+
class="studio-pagination__btn studio-pagination__btn--page"
|
|
5687
|
+
[class.studio-pagination__btn--active]="pageNum === page()"
|
|
5688
|
+
(click)="goToPage(pageNum)"
|
|
5689
|
+
[attr.aria-label]="'Page ' + pageNum"
|
|
5690
|
+
[attr.aria-current]="pageNum === page() ? 'page' : null"
|
|
5691
|
+
>
|
|
5692
|
+
{{ pageNum }}
|
|
5693
|
+
</button>
|
|
5694
|
+
}
|
|
5695
|
+
}
|
|
5696
|
+
</div>
|
|
5697
|
+
} @else {
|
|
5698
|
+
<!-- Simple page indicator -->
|
|
5699
|
+
<span class="studio-pagination__indicator">
|
|
5700
|
+
{{ page() }} / {{ totalPages() }}
|
|
5701
|
+
</span>
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5704
|
+
<!-- Next button -->
|
|
5705
|
+
<button
|
|
5706
|
+
type="button"
|
|
5707
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5708
|
+
[disabled]="isLastPage()"
|
|
5709
|
+
(click)="goToNext()"
|
|
5710
|
+
[attr.aria-label]="nextLabel()"
|
|
5711
|
+
>
|
|
5712
|
+
<studio-icon name="chevron-right" [size]="iconSize()" />
|
|
5713
|
+
</button>
|
|
5714
|
+
|
|
5715
|
+
<!-- Last page button -->
|
|
5716
|
+
@if (showFirstLast()) {
|
|
5717
|
+
<button
|
|
5718
|
+
type="button"
|
|
5719
|
+
class="studio-pagination__btn studio-pagination__btn--nav"
|
|
5720
|
+
[disabled]="isLastPage()"
|
|
5721
|
+
(click)="goToLast()"
|
|
5722
|
+
[attr.aria-label]="lastLabel()"
|
|
5723
|
+
>
|
|
5724
|
+
<studio-icon name="chevrons-right" [size]="iconSize()" />
|
|
5725
|
+
</button>
|
|
5726
|
+
}
|
|
5727
|
+
</div>
|
|
5728
|
+
</div>
|
|
5729
|
+
`, styles: [":host{display:block;font-family:var(--studio-font-family)}.studio-pagination__container{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}.studio-pagination__page-size{display:flex;align-items:center;gap:.5rem}.studio-pagination__label{font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}.studio-pagination__select{padding:.375rem .75rem;font-size:.875rem;border:1px solid var(--studio-border-primary);border-radius:var(--studio-radius-md);background:var(--studio-bg-primary);color:var(--studio-text-primary);cursor:pointer;outline:none;transition:border-color var(--studio-transition-fast)}.studio-pagination__select:hover{border-color:var(--studio-border-hover, var(--studio-border-primary))}.studio-pagination__select:focus{border-color:var(--studio-color-primary);box-shadow:0 0 0 2px var(--studio-color-primary-alpha, rgba(59, 130, 246, .2))}.studio-pagination__info{font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}.studio-pagination__nav{display:flex;align-items:center;gap:.25rem}.studio-pagination__btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--studio-border-primary);border-radius:var(--studio-radius-md);background:var(--studio-bg-primary);color:var(--studio-text-primary);cursor:pointer;transition:all var(--studio-transition-fast)}.studio-pagination__btn:hover:not(:disabled){background:var(--studio-bg-secondary);border-color:var(--studio-border-hover, var(--studio-border-primary))}.studio-pagination__btn:active:not(:disabled){transform:scale(.95)}.studio-pagination__btn:disabled{opacity:.5;cursor:not-allowed}.studio-pagination__btn--nav{padding:.375rem}.studio-pagination__btn--page{min-width:2rem;padding:.375rem .5rem;font-size:.875rem}.studio-pagination__btn--active{background:var(--studio-color-primary);border-color:var(--studio-color-primary);color:#fff}.studio-pagination__btn--active:hover:not(:disabled){background:var(--studio-color-primary-hover, var(--studio-color-primary));border-color:var(--studio-color-primary-hover, var(--studio-color-primary))}.studio-pagination__pages{display:flex;align-items:center;gap:.25rem}.studio-pagination__ellipsis{padding:0 .5rem;color:var(--studio-text-secondary)}.studio-pagination__indicator{padding:0 .75rem;font-size:.875rem;color:var(--studio-text-secondary);white-space:nowrap}:host(.pagination--sm) .studio-pagination__label,:host(.pagination--sm) .studio-pagination__info,:host(.pagination--sm) .studio-pagination__indicator{font-size:.75rem}:host(.pagination--sm) .studio-pagination__select{padding:.25rem .5rem;font-size:.75rem}:host(.pagination--sm) .studio-pagination__btn--nav{padding:.25rem}:host(.pagination--sm) .studio-pagination__btn--page{min-width:1.75rem;padding:.25rem .375rem;font-size:.75rem}:host(.pagination--lg) .studio-pagination__label,:host(.pagination--lg) .studio-pagination__info,:host(.pagination--lg) .studio-pagination__indicator{font-size:1rem}:host(.pagination--lg) .studio-pagination__select{padding:.5rem 1rem;font-size:1rem}:host(.pagination--lg) .studio-pagination__btn--nav{padding:.5rem}:host(.pagination--lg) .studio-pagination__btn--page{min-width:2.5rem;padding:.5rem .75rem;font-size:1rem}:host(.pagination--minimal) .studio-pagination__btn{border:none;background:transparent}:host(.pagination--minimal) .studio-pagination__btn:hover:not(:disabled){background:var(--studio-bg-secondary)}:host(.pagination--minimal) .studio-pagination__btn--active{background:var(--studio-color-primary);color:#fff}:host(.pagination--compact) .studio-pagination__container{gap:.5rem}:host(.pagination--compact) .studio-pagination__nav,:host(.pagination--compact) .studio-pagination__pages{gap:.125rem}\n"] }]
|
|
5730
|
+
}], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], maxVisiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisiblePages", required: false }] }], showPageSizeSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageSizeSelector", required: false }] }], showPageNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageNumbers", required: false }] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], showFirstLast: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLast", required: false }] }], pageSizeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeLabel", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], firstLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstLabel", required: false }] }], lastLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastLabel", required: false }] }], infoTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "infoTemplate", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }] } });
|
|
5731
|
+
|
|
5732
|
+
/**
|
|
5733
|
+
* Pagination component types
|
|
5734
|
+
*/
|
|
5735
|
+
|
|
5736
|
+
/**
|
|
5737
|
+
* Pagination component
|
|
5738
|
+
*/
|
|
5739
|
+
|
|
5375
5740
|
/**
|
|
5376
5741
|
* Directive for declarative column definition
|
|
5377
5742
|
*
|
|
@@ -7214,5 +7579,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
7214
7579
|
* Generated bundle index. Do not edit.
|
|
7215
7580
|
*/
|
|
7216
7581
|
|
|
7217
|
-
export { BadgeComponent, BadgeWrapperComponent, BottomNavigationComponent, ButtonComponent, ButtonGroupComponent, ButtonToggleGroupComponent, COUNTRY_OPTIONS, CardComponent, ChatComponent, ChatInputComponent, ChatMessageComponent, CheckboxComponent, ColorPickerCompactComponent, ColorPickerComponent, DEFAULT_COLOR_PRESETS, DrawerComponent, DrawerService, DropdownComponent, IconComponent, InputComponent, InspectorComponent, MASK_PRESETS, MaskDirective, MaskEngine, MenuComponent, ModalComponent, NavbarComponent, PhoneInputComponent, PopoverComponent, RadioButtonComponent, STUDIO_CONFIG, SelectComponent, SidebarComponent, StudioConfigService, SwitchComponent, TableColumnDirective, TableComponent, TabsComponent, TextareaComponent, ThemeSwitchComponent, TooltipComponent, classNames, isSafeUrl, loadGoogleFont, loadGoogleFonts, provideStudioConfig, provideStudioIcons, sanitizeUrl, withConfigDefault };
|
|
7582
|
+
export { BadgeComponent, BadgeWrapperComponent, BottomNavigationComponent, ButtonComponent, ButtonGroupComponent, ButtonToggleGroupComponent, COUNTRY_OPTIONS, CardComponent, ChatComponent, ChatInputComponent, ChatMessageComponent, CheckboxComponent, ColorPickerCompactComponent, ColorPickerComponent, DEFAULT_COLOR_PRESETS, DrawerComponent, DrawerService, DropdownComponent, IconComponent, InputComponent, InspectorComponent, MASK_PRESETS, MaskDirective, MaskEngine, MenuComponent, ModalComponent, NavbarComponent, PaginationComponent, PhoneInputComponent, PopoverComponent, RadioButtonComponent, STUDIO_CONFIG, SelectComponent, SidebarComponent, StudioConfigService, SwitchComponent, TableColumnDirective, TableComponent, TabsComponent, TextareaComponent, ThemeSwitchComponent, TooltipComponent, classNames, isSafeUrl, loadGoogleFont, loadGoogleFonts, provideStudioConfig, provideStudioIcons, sanitizeUrl, withConfigDefault };
|
|
7218
7583
|
//# sourceMappingURL=eduboxpro-studio.mjs.map
|