cmat 0.0.95 → 0.0.96

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.
@@ -26,11 +26,11 @@ class CmatMasonryComponent {
26
26
  ...(ngDevMode ? [{ debugName: "distributedColumns" }] : /* istanbul ignore next */ []));
27
27
  }
28
28
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatMasonryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
29
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: CmatMasonryComponent, isStandalone: true, selector: "cmat-masonry", inputs: { columnsTemplate: { classPropertyName: "columnsTemplate", publicName: "columnsTemplate", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatMasonry"], ngImport: i0, template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
29
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: CmatMasonryComponent, isStandalone: true, selector: "cmat-masonry", inputs: { columnsTemplate: { classPropertyName: "columnsTemplate", publicName: "columnsTemplate", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatMasonry"], ngImport: i0, template: "<div class=\"flex\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
30
30
  }
31
31
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatMasonryComponent, decorators: [{
32
32
  type: Component,
33
- args: [{ selector: 'cmat-masonry', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMasonry', imports: [NgTemplateOutlet], template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>" }]
33
+ args: [{ selector: 'cmat-masonry', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMasonry', imports: [NgTemplateOutlet], template: "<div class=\"flex\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>" }]
34
34
  }], propDecorators: { columnsTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsTemplate", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] } });
35
35
 
36
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-components-masonry.mjs","sources":["../../../projects/cmat/components/masonry/masonry.component.ts","../../../projects/cmat/components/masonry/masonry.component.html","../../../projects/cmat/components/masonry/cmat-components-masonry.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\n\r\ninterface MasonryColumn {\r\n items: unknown[];\r\n}\r\n\r\n@Component({\r\n selector: 'cmat-masonry',\r\n templateUrl: './masonry.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatMasonry',\r\n imports: [NgTemplateOutlet]\r\n})\r\nexport class CmatMasonryComponent {\r\n readonly columnsTemplate = input.required<TemplateRef<unknown>>(); \r\n readonly columns = input.required<number>();\r\n readonly items = input<unknown[]>([]);\r\n\r\n readonly distributedColumns = computed<MasonryColumn[]>(() => {\r\n const cols = this.columns();\r\n const itemList = this.items();\r\n\r\n if (!itemList || itemList.length === 0) {\r\n return [];\r\n }\r\n\r\n const newDistributedColumns: MasonryColumn[] = Array.from({ length: cols }, () => ({ items: [] }));\r\n\r\n for (let i = 0; i < itemList.length; i++) {\r\n const columnIndex = i % cols;\r\n newDistributedColumns[columnIndex].items.push(itemList[i]);\r\n }\r\n\r\n return newDistributedColumns;\r\n });\r\n}","<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAsBa,oBAAoB,CAAA;AARjC,IAAA,WAAA,GAAA;QASa,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,QAAQ;4FAAwB;QACxD,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ;oFAAU;QAClC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAY,EAAE;kFAAC;AAE5B,QAAA,IAAA,CAAA,kBAAkB,GAAG,QAAQ,CAAkB,MAAK;AACzD,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE;AAC3B,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE;YAE7B,IAAI,CA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AAA,EAAA,QAAA,ECtBjC,+JAEM,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDkBQ,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAEjB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,EAAA,aAAA,EAET,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,aAAa,EAAA,OAAA,EACd,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,+JAAA,EAAA;;;AEpB/B;;AAEG;;;;"}
1
+ {"version":3,"file":"cmat-components-masonry.mjs","sources":["../../../projects/cmat/components/masonry/masonry.component.ts","../../../projects/cmat/components/masonry/masonry.component.html","../../../projects/cmat/components/masonry/cmat-components-masonry.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n TemplateRef,\r\n ViewEncapsulation,\r\n computed,\r\n input,\r\n} from '@angular/core';\r\n\r\ninterface MasonryColumn {\r\n items: unknown[];\r\n}\r\n\r\n@Component({\r\n selector: 'cmat-masonry',\r\n templateUrl: './masonry.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'cmatMasonry',\r\n imports: [NgTemplateOutlet]\r\n})\r\nexport class CmatMasonryComponent {\r\n readonly columnsTemplate = input.required<TemplateRef<unknown>>(); \r\n readonly columns = input.required<number>();\r\n readonly items = input<unknown[]>([]);\r\n\r\n readonly distributedColumns = computed<MasonryColumn[]>(() => {\r\n const cols = this.columns();\r\n const itemList = this.items();\r\n\r\n if (!itemList || itemList.length === 0) {\r\n return [];\r\n }\r\n\r\n const newDistributedColumns: MasonryColumn[] = Array.from({ length: cols }, () => ({ items: [] }));\r\n\r\n for (let i = 0; i < itemList.length; i++) {\r\n const columnIndex = i % cols;\r\n newDistributedColumns[columnIndex].items.push(itemList[i]);\r\n }\r\n\r\n return newDistributedColumns;\r\n });\r\n}","<div class=\"flex\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAsBa,oBAAoB,CAAA;AARjC,IAAA,WAAA,GAAA;QASa,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,QAAQ;4FAAwB;QACxD,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ;oFAAU;QAClC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAY,EAAE;kFAAC;AAE5B,QAAA,IAAA,CAAA,kBAAkB,GAAG,QAAQ,CAAkB,MAAK;AACzD,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE;AAC3B,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE;YAE7B,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AACpC,gBAAA,OAAO,EAAE;YACb;YAEA,MAAM,qBAAqB,GAAoB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AAElG,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,gBAAA,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI;AAC5B,gBAAA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,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,EAAA,aAAA,EAET,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,aAAa,EAAA,OAAA,EACd,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAA,2JAAA,EAAA;;;AEpB/B;;AAEG;;;;"}
@@ -421,7 +421,7 @@ class CmatPaginationComponent {
421
421
  });
422
422
  }
423
423
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
424
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: CmatPaginationComponent, isStandalone: true, selector: "cmat-pagination", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPages: { classPropertyName: "itemsPerPages", publicName: "itemsPerPages", isSignal: true, isRequired: false, transformFunction: null }, initPerPage: { classPropertyName: "initPerPage", publicName: "initPerPage", isSignal: true, isRequired: false, transformFunction: null }, autoHide: { classPropertyName: "autoHide", publicName: "autoHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection", perPageCountChange: "perPageCountChange" }, exportAs: ["cmatPagination"], ngImport: i0, template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\" (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A + \u9875\u7801\u8DF3\u8F6C + \u6BCF\u9875\u6761\u6570 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n @if (isScreenSmall()) {\r\n <li>\r\n <span class=\"px-3 text-sm tabular-nums whitespace-nowrap\">{{ p.getCurrent() }} / {{ p.getLastPage() }}</span>\r\n </li>\r\n } @else {\r\n <li>\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-1\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n", dependencies: [{ kind: "directive", type: CmatPaginationDirective, selector: "pagination-template,[pagination-template]", inputs: ["id", "maxSize"], outputs: ["pageChange", "pageBoundsCorrection", "perPageCountChange"], exportAs: ["paginationApi"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
424
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: CmatPaginationComponent, isStandalone: true, selector: "cmat-pagination", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPages: { classPropertyName: "itemsPerPages", publicName: "itemsPerPages", isSignal: true, isRequired: false, transformFunction: null }, initPerPage: { classPropertyName: "initPerPage", publicName: "initPerPage", isSignal: true, isRequired: false, transformFunction: null }, autoHide: { classPropertyName: "autoHide", publicName: "autoHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection", perPageCountChange: "perPageCountChange" }, exportAs: ["cmatPagination"], ngImport: i0, template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n", styles: ["@media(hover:none)and (pointer:coarse){cmat-pagination button[matIconButton]{transition:transform .15s ease}cmat-pagination button[matIconButton]:active:not([disabled]){transform:scale(.88)}}\n"], dependencies: [{ kind: "directive", type: CmatPaginationDirective, selector: "pagination-template,[pagination-template]", inputs: ["id", "maxSize"], outputs: ["pageChange", "pageBoundsCorrection", "perPageCountChange"], exportAs: ["paginationApi"] }, { kind: "directive", type: CmatDigitOnlyDirective, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
425
425
  }
426
426
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatPaginationComponent, decorators: [{
427
427
  type: Component,
@@ -436,7 +436,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
436
436
  MatButtonModule,
437
437
  NgClass,
438
438
  NgStyle,
439
- ], template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\" (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A + \u9875\u7801\u8DF3\u8F6C + \u6BCF\u9875\u6761\u6570 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n @if (isScreenSmall()) {\r\n <li>\r\n <span class=\"px-3 text-sm tabular-nums whitespace-nowrap\">{{ p.getCurrent() }} / {{ p.getLastPage() }}</span>\r\n </li>\r\n } @else {\r\n <li>\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-1\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n" }]
439
+ ], template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n" }]
440
440
  }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], itemsPerPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPages", required: false }] }], initPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "initPerPage", required: false }] }], autoHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHide", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageBoundsCorrection: [{ type: i0.Output, args: ["pageBoundsCorrection"] }], perPageCountChange: [{ type: i0.Output, args: ["perPageCountChange"] }] } });
441
441
 
442
442
  const LARGE_NUMBER = Number.MAX_SAFE_INTEGER;
@@ -1 +1 @@
1
- {"version":3,"file":"cmat-components-pagination.mjs","sources":["../../../projects/cmat/components/pagination/pagination.service.ts","../../../projects/cmat/components/pagination/pagination.directive.ts","../../../projects/cmat/components/pagination/pagination.component.ts","../../../projects/cmat/components/pagination/pagination.component.html","../../../projects/cmat/components/pagination/pagination.pipe.ts","../../../projects/cmat/components/pagination/cmat-components-pagination.ts"],"sourcesContent":["import { Injectable, signal, untracked } from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatPaginationService {\r\n private readonly _instances = signal<Record<string, CmatPaginationInstance>>({});\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly instances = this._instances.asReadonly();\r\n\r\n private readonly _defaultPaginationId = 'DEFAULT_PAGINATION_ID';\r\n\r\n public defaultId(): string { return this._defaultPaginationId; }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public notifyChange(_id: string): void {\r\n // 使用 requestAnimationFrame 延迟 Signal 更新,避免在模板渲染周期中写入\r\n requestAnimationFrame(() => {\r\n this._instances.update(current => ({ ...current }));\r\n });\r\n }\r\n\r\n public register(instance: CmatPaginationInstance, fromPipe: boolean = false): boolean {\r\n const normalizedInstance: CmatPaginationInstance = {\r\n ...structuredClone(instance),\r\n id: instance.id ?? this._defaultPaginationId\r\n };\r\n const id = normalizedInstance.id!;\r\n\r\n let changed = false;\r\n const currentInstances = untracked(() => this._instances());\r\n\r\n if (!currentInstances[id]) {\r\n changed = true;\r\n } else {\r\n const needsUpdate = this._needsUpdate(currentInstances[id], normalizedInstance);\r\n if (needsUpdate) {\r\n changed = true;\r\n }\r\n }\r\n\r\n if (changed) {\r\n if (fromPipe) {\r\n requestAnimationFrame(() => {\r\n this._instances.update((current) => {\r\n if (!current[id]) {\r\n return { ...current, [id]: normalizedInstance };\r\n } else {\r\n this._updateInstance(current[id], normalizedInstance);\r\n return { ...current };\r\n }\r\n });\r\n });\r\n }\r\n else {\r\n this._instances.update((current) => {\r\n if (!current[id]) {\r\n return { ...current, [id]: normalizedInstance };\r\n } else {\r\n this._updateInstance(current[id], normalizedInstance);\r\n return { ...current };\r\n }\r\n });\r\n }\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n public getCurrentPage(id: string): number | undefined {\r\n return this._instances()[id]?.currentPage;\r\n }\r\n\r\n public getItemsPerPage(id: string): number | undefined {\r\n return this._instances()[id]?.itemsPerPage;\r\n }\r\n\r\n public setCurrentPage(id: string, page: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance) {\r\n const maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n if (page <= maxPage && 1 <= page) {\r\n // 创建新引用以确保 Signal 检测到变化\r\n current[id] = { ...instance, currentPage: page };\r\n return { ...current };\r\n }\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public setTotalItems(id: string, totalItems: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance && 0 <= totalItems) {\r\n current[id] = { ...instance, totalItems };\r\n return { ...current };\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public setItemsPerPage(id: string, itemsPerPage: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance) {\r\n current[id] = { ...instance, itemsPerPage };\r\n return { ...current };\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public getInstance(id: string = this._defaultPaginationId): CmatPaginationInstance | undefined {\r\n const instance = this._instances()[id];\r\n if (instance) {\r\n return this._clone(instance);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private _updateInstance(current: CmatPaginationInstance, incoming: CmatPaginationInstance): boolean {\r\n let changed = false;\r\n if (incoming.id) {\r\n const keys = new Set([...Object.keys(current), ...Object.keys(incoming)]);\r\n\r\n for (const prop of keys) {\r\n const key = prop as keyof CmatPaginationInstance;\r\n\r\n if (incoming[key] !== current[key]) {\r\n current[key] = incoming[key];\r\n changed = true;\r\n }\r\n }\r\n }\r\n return changed;\r\n }\r\n\r\n private _needsUpdate(current: CmatPaginationInstance, incoming: CmatPaginationInstance): boolean {\r\n // 检查是否有任何属性发生变化\r\n const keys = new Set([...Object.keys(current), ...Object.keys(incoming)]);\r\n for (const prop of keys) {\r\n const key = prop as keyof CmatPaginationInstance;\r\n if (incoming[key] !== current[key]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n private _clone<T extends Record<string, unknown>>(obj: T): T {\r\n return structuredClone(obj);\r\n }\r\n}\r\n","import {\r\n afterNextRender,\r\n Directive,\r\n inject,\r\n Injector,\r\n signal,\r\n input,\r\n output,\r\n effect,\r\n untracked,\r\n} from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\nimport { CmatPaginationService } from './pagination.service';\r\n\r\nexport interface Page {\r\n label: string | number;\r\n value: number;\r\n}\r\n@Directive({\r\n // eslint-disable-next-line @angular-eslint/directive-selector\r\n selector: 'pagination-template,[pagination-template]',\r\n exportAs: 'paginationApi',\r\n})\r\nexport class CmatPaginationDirective {\r\n readonly id = input<string>();\r\n readonly maxSize = input<number>(7);\r\n\r\n readonly pageChange = output<number>();\r\n readonly pageBoundsCorrection = output<number>();\r\n readonly perPageCountChange = output<number>();\r\n\r\n readonly pages = signal<Page[]>([]);\r\n\r\n private readonly service = inject(CmatPaginationService);\r\n private readonly _injector = inject(Injector);\r\n private _pageLinksUpdateQueued = false;\r\n\r\n constructor() {\r\n effect(() => {\r\n const instances = this.service.instances();\r\n\r\n if (this._getId() === instances[this._getId()]?.id) {\r\n untracked(() => {\r\n this._schedulePageLinksUpdate();\r\n });\r\n }\r\n });\r\n\r\n this._schedulePageLinksUpdate();\r\n }\r\n\r\n previous(): void {\r\n if (!this.isFirstPage()) {\r\n this._checkValidId();\r\n\r\n const current = this.getCurrent();\r\n if (current) this.setCurrent(current - 1);\r\n }\r\n }\r\n\r\n next(): void {\r\n if (!this.isLastPage()) {\r\n this._checkValidId();\r\n\r\n const current = this.getCurrent();\r\n if (current) this.setCurrent(current + 1);\r\n }\r\n }\r\n\r\n goFirstPage(): void {\r\n if (!this.isFirstPage()) {\r\n this._checkValidId();\r\n\r\n this.setCurrent(1);\r\n }\r\n }\r\n\r\n goLastPage(): void {\r\n if (!this.isLastPage()) {\r\n this._checkValidId();\r\n\r\n const lastPage = this.getLastPage();\r\n if (lastPage) this.setCurrent(lastPage);\r\n }\r\n }\r\n\r\n isFirstPage(): boolean {\r\n return this.getCurrent() === 1;\r\n }\r\n\r\n isLastPage(): boolean {\r\n return this.getLastPage() === this.getCurrent();\r\n }\r\n\r\n setCurrent(page: number | string): void {\r\n const nextPage = Number(page);\r\n\r\n if (!Number.isNaN(nextPage)) {\r\n this.pageChange.emit(nextPage);\r\n }\r\n }\r\n\r\n getCurrent(): number | void {\r\n return this.service.getCurrentPage(this._getId());\r\n }\r\n\r\n getLastPage(): number | void {\r\n const inst = this.service.getInstance(this._getId());\r\n if (!inst) {\r\n return;\r\n }\r\n\r\n if (inst.totalItems < 1) {\r\n return 1;\r\n }\r\n return Math.ceil(inst.totalItems / inst.itemsPerPage);\r\n }\r\n\r\n getTotalItems(): number | void {\r\n return this.service.getInstance(this._getId())?.totalItems;\r\n }\r\n\r\n setItemsPerPage(count: number): void {\r\n const id = this._getId();\r\n this.service.setItemsPerPage(id, count);\r\n\r\n this.perPageCountChange.emit(count);\r\n const inst = this.service.getInstance(id);\r\n if (!inst) {\r\n return;\r\n }\r\n\r\n this.setCurrent(this._outOfBoundCorrection(inst));\r\n }\r\n\r\n private _getId(): string {\r\n return this.id() ?? this.service.defaultId();\r\n }\r\n\r\n private _checkValidId(): void {\r\n const id = this._getId();\r\n if (this.service.getInstance(id)?.id == null) {\r\n console.warn(\r\n `PaginationControlsDirective: the specified id \"${id}\" does not match any registered PaginationInstance`,\r\n );\r\n }\r\n }\r\n\r\n private _updatePageLinks(): void {\r\n const inst = this.service.getInstance(this._getId());\r\n if (!inst) {\r\n this.pages.set([]);\r\n return;\r\n }\r\n\r\n const correctedCurrentPage = this._outOfBoundCorrection(inst);\r\n const pageForRender =\r\n correctedCurrentPage !== inst.currentPage\r\n ? correctedCurrentPage\r\n : inst.currentPage;\r\n\r\n this.pageBoundsCorrection.emit(correctedCurrentPage);\r\n this.pages.set(\r\n this._createPageArray(\r\n pageForRender,\r\n inst.itemsPerPage,\r\n inst.totalItems,\r\n this.maxSize(),\r\n ),\r\n );\r\n }\r\n\r\n private _schedulePageLinksUpdate(): void {\r\n if (this._pageLinksUpdateQueued) {\r\n return;\r\n }\r\n\r\n this._pageLinksUpdateQueued = true;\r\n afterNextRender(\r\n () => {\r\n this._pageLinksUpdateQueued = false;\r\n this._updatePageLinks();\r\n },\r\n { injector: this._injector },\r\n );\r\n }\r\n\r\n private _outOfBoundCorrection(instance: CmatPaginationInstance): number {\r\n const totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n if (totalPages < instance.currentPage && 0 < totalPages) {\r\n return totalPages;\r\n } else if (instance.currentPage < 1) {\r\n return 1;\r\n }\r\n\r\n return instance.currentPage;\r\n }\r\n\r\n private _createPageArray(\r\n currentPage: number,\r\n itemsPerPage: number,\r\n totalItems: number,\r\n paginationRange: number,\r\n ): Page[] {\r\n paginationRange = +paginationRange;\r\n const pages: Page[] = [];\r\n\r\n const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);\r\n const halfWay = Math.ceil(paginationRange / 2);\r\n\r\n const isStart = currentPage <= halfWay;\r\n const isEnd = totalPages - halfWay < currentPage;\r\n const isMiddle = !isStart && !isEnd;\r\n\r\n const ellipsesNeeded = paginationRange < totalPages;\r\n let i = 1;\r\n\r\n while (i <= totalPages && i <= paginationRange) {\r\n let label: string | number;\r\n const pageNumber = this._calculatePageNumber(\r\n i,\r\n currentPage,\r\n paginationRange,\r\n totalPages,\r\n );\r\n const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);\r\n const closingEllipsesNeeded =\r\n i === paginationRange - 1 && (isMiddle || isStart);\r\n if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {\r\n label = '...';\r\n } else {\r\n label = pageNumber;\r\n }\r\n pages.push({\r\n label: label,\r\n value: pageNumber,\r\n });\r\n i++;\r\n }\r\n\r\n return pages;\r\n }\r\n\r\n private _calculatePageNumber(\r\n i: number,\r\n currentPage: number,\r\n paginationRange: number,\r\n totalPages: number,\r\n ): number {\r\n const halfWay = Math.ceil(paginationRange / 2);\r\n if (i === paginationRange) {\r\n return totalPages;\r\n } else if (i === 1) {\r\n return i;\r\n } else if (paginationRange < totalPages) {\r\n if (totalPages - halfWay < currentPage) {\r\n return totalPages - paginationRange + i;\r\n } else if (halfWay < currentPage) {\r\n return currentPage - halfWay + i;\r\n } else {\r\n return i;\r\n }\r\n } else {\r\n return i;\r\n }\r\n }\r\n}\r\n","import { DecimalPipe, NgClass, NgStyle } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n output,\r\n computed,\r\n ElementRef,\r\n afterNextRender,\r\n signal,\r\n DestroyRef,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { CmatDigitOnlyDirective } from 'cmat/directives/digit-only';\r\nimport { CmatPaginationDirective } from './pagination.directive';\r\n\r\n@Component({\r\n selector: 'cmat-pagination',\r\n templateUrl: './pagination.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n exportAs: 'cmatPagination',\r\n imports: [\r\n CmatPaginationDirective,\r\n CmatDigitOnlyDirective,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatSelectModule,\r\n DecimalPipe,\r\n MatButtonModule,\r\n NgClass,\r\n NgStyle,\r\n ],\r\n})\r\nexport class CmatPaginationComponent {\r\n readonly id = input<string>();\r\n readonly maxSize = input<number>(7);\r\n readonly itemsPerPages = input<number[]>([10, 20, 30]);\r\n readonly initPerPage = input<number>(10);\r\n readonly autoHide = input<boolean>(false);\r\n\r\n readonly pageChange = output<number>();\r\n readonly pageBoundsCorrection = output<number>();\r\n readonly perPageCountChange = output<number>();\r\n\r\n private _elementRef = inject(ElementRef);\r\n private _destroyRef = inject(DestroyRef);\r\n\r\n // 组件宽度信号,初始化为一个合理默认值\r\n private _componentWidth = signal<number>(1024);\r\n \r\n // 根据组件自身宽度判断是否使用移动端样式(阈值:768px)\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly isScreenSmall = computed(() => {\r\n return this._componentWidth() < 768;\r\n });\r\n\r\n constructor() {\r\n // 使用 ResizeObserver 监听组件自身宽度变化\r\n afterNextRender(() => {\r\n const element = this._elementRef.nativeElement as HTMLElement;\r\n \r\n // 确保元素是块级或行内块级,可以正确测量宽度\r\n if (getComputedStyle(element).display === 'inline') {\r\n element.style.display = 'inline-block';\r\n element.style.width = '100%';\r\n }\r\n \r\n // 立即获取一次初始宽度\r\n const initialWidth = element.getBoundingClientRect().width;\r\n if (initialWidth > 0) {\r\n this._componentWidth.set(initialWidth);\r\n }\r\n \r\n // 创建 ResizeObserver\r\n const resizeObserver = new ResizeObserver((entries) => {\r\n for (const entry of entries) {\r\n const width = entry.contentRect.width;\r\n // 只有当宽度大于0时才更新,避免无效值\r\n if (width > 0) {\r\n this._componentWidth.set(width);\r\n }\r\n }\r\n });\r\n \r\n // 开始观察\r\n resizeObserver.observe(element);\r\n \r\n // 组件销毁时清理观察者\r\n this._destroyRef.onDestroy(() => {\r\n resizeObserver.disconnect();\r\n });\r\n });\r\n }\r\n}\r\n","<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\" (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- 左:总计 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">共 {{ p.getTotalItems() }} 条</span>\r\n </div>\r\n\r\n <!-- 右:导航 + 页码跳转 + 每页条数 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- 首页 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 上一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码 -->\r\n @if (isScreenSmall()) {\r\n <li>\r\n <span class=\"px-3 text-sm tabular-nums whitespace-nowrap\">{{ p.getCurrent() }} / {{ p.getLastPage() }}</span>\r\n </li>\r\n } @else {\r\n <li>\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n\r\n <!-- 下一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 末页 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码跳转(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-1\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- 每页条数(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\nimport { CmatPaginationService } from './pagination.service';\r\n\r\nconst LARGE_NUMBER = Number.MAX_SAFE_INTEGER;\r\n\r\nexport type Collection<T> = readonly T[];\r\n\r\nexport interface CmatPaginatePipeArgs {\r\n id?: string;\r\n currentPage: string | number;\r\n itemsPerPage: string | number;\r\n totalItems: string | number;\r\n}\r\n\r\nexport interface CmatPipeState {\r\n size: number;\r\n start?: number;\r\n end?: number;\r\n slice: readonly unknown[];\r\n}\r\n\r\n@Pipe({\r\n name: 'paginate',\r\n pure: true\r\n})\r\nexport class CmatPaginatePipe implements PipeTransform {\r\n private service = inject(CmatPaginationService);\r\n\r\n private readonly state: Record<string, CmatPipeState> = {};\r\n\r\n public transform<T, U extends Collection<T>>(collection: U, args: CmatPaginatePipeArgs): U {\r\n if (!Array.isArray(collection)) {\r\n const _id = args.id ?? this.service.defaultId();\r\n const cachedSlice = this.state[_id]?.slice as unknown as U | undefined;\r\n\r\n return cachedSlice ?? collection;\r\n }\r\n\r\n const totalItems = this._toNumber(args.totalItems) || collection.length;\r\n const serverSideMode = totalItems !== collection.length;\r\n const instance = this.createInstance(collection, { ...args, totalItems });\r\n\r\n const id = instance.id ?? this.service.defaultId();\r\n let start: number | undefined;\r\n let end: number | undefined;\r\n const perPage = this._toNumber(args.itemsPerPage);\r\n\r\n const emitChange = this.service.register(instance,true);\r\n\r\n if (!serverSideMode) {\r\n const pageSize = perPage || LARGE_NUMBER;\r\n start = (instance.currentPage - 1) * pageSize;\r\n end = start + pageSize;\r\n\r\n const isIdentical = this._stateIsIdentical(id, collection, start, end);\r\n if (isIdentical) {\r\n return this.state[id].slice as unknown as U;\r\n }\r\n\r\n const slice = collection.slice(start, end);\r\n this._saveState(id, collection, slice, start, end);\r\n this.service.notifyChange(id);\r\n return slice as unknown as U;\r\n }\r\n\r\n if (emitChange) {\r\n this.service.notifyChange(id);\r\n }\r\n\r\n this._saveState(id, collection, collection, start, end);\r\n\r\n return collection;\r\n\r\n }\r\n\r\n private createInstance(collection: readonly unknown[], config: CmatPaginatePipeArgs): CmatPaginationInstance {\r\n this.checkConfig(config);\r\n\r\n return {\r\n id: config.id ?? this.service.defaultId(),\r\n itemsPerPage: this._toNumber(config.itemsPerPage) || 10,\r\n currentPage: this._toNumber(config.currentPage) || 1,\r\n totalItems: this._toNumber(config.totalItems) || collection.length\r\n };\r\n }\r\n\r\n private checkConfig(config: CmatPaginatePipeArgs): void {\r\n const missing = ['itemsPerPage', 'currentPage'].filter(prop => !(prop in config));\r\n\r\n if (missing.length > 0) {\r\n throw new Error(`PaginatePipe: Argument is missing the following required properties: ${missing.join(', ')}`);\r\n }\r\n }\r\n\r\n private _saveState(id: string, collection: readonly unknown[], slice: readonly unknown[], start?: number, end?: number): void {\r\n this.state[id] = {\r\n size: collection.length,\r\n slice,\r\n start,\r\n end\r\n };\r\n }\r\n\r\n private _stateIsIdentical(id: string, collection: readonly unknown[], start: number, end: number): boolean {\r\n const state = this.state[id];\r\n if (!state) {\r\n return false;\r\n }\r\n const isMetaDataIdentical = state.size === collection.length &&\r\n state.start === start &&\r\n state.end === end;\r\n\r\n if (!isMetaDataIdentical) {\r\n return false;\r\n }\r\n\r\n return state.slice.every((element, index) => element === collection[start + index]);\r\n }\r\n\r\n private _toNumber(value: string | number): number {\r\n return Number(value);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAMa,qBAAqB,CAAA;AAHlC,I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;AAEG;;;;"}
1
+ {"version":3,"file":"cmat-components-pagination.mjs","sources":["../../../projects/cmat/components/pagination/pagination.service.ts","../../../projects/cmat/components/pagination/pagination.directive.ts","../../../projects/cmat/components/pagination/pagination.component.ts","../../../projects/cmat/components/pagination/pagination.component.html","../../../projects/cmat/components/pagination/pagination.pipe.ts","../../../projects/cmat/components/pagination/cmat-components-pagination.ts"],"sourcesContent":["import { Injectable, signal, untracked } from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CmatPaginationService {\r\n private readonly _instances = signal<Record<string, CmatPaginationInstance>>({});\r\n\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly instances = this._instances.asReadonly();\r\n\r\n private readonly _defaultPaginationId = 'DEFAULT_PAGINATION_ID';\r\n\r\n public defaultId(): string { return this._defaultPaginationId; }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public notifyChange(_id: string): void {\r\n // 使用 requestAnimationFrame 延迟 Signal 更新,避免在模板渲染周期中写入\r\n requestAnimationFrame(() => {\r\n this._instances.update(current => ({ ...current }));\r\n });\r\n }\r\n\r\n public register(instance: CmatPaginationInstance, fromPipe: boolean = false): boolean {\r\n const normalizedInstance: CmatPaginationInstance = {\r\n ...structuredClone(instance),\r\n id: instance.id ?? this._defaultPaginationId\r\n };\r\n const id = normalizedInstance.id!;\r\n\r\n let changed = false;\r\n const currentInstances = untracked(() => this._instances());\r\n\r\n if (!currentInstances[id]) {\r\n changed = true;\r\n } else {\r\n const needsUpdate = this._needsUpdate(currentInstances[id], normalizedInstance);\r\n if (needsUpdate) {\r\n changed = true;\r\n }\r\n }\r\n\r\n if (changed) {\r\n if (fromPipe) {\r\n requestAnimationFrame(() => {\r\n this._instances.update((current) => {\r\n if (!current[id]) {\r\n return { ...current, [id]: normalizedInstance };\r\n } else {\r\n this._updateInstance(current[id], normalizedInstance);\r\n return { ...current };\r\n }\r\n });\r\n });\r\n }\r\n else {\r\n this._instances.update((current) => {\r\n if (!current[id]) {\r\n return { ...current, [id]: normalizedInstance };\r\n } else {\r\n this._updateInstance(current[id], normalizedInstance);\r\n return { ...current };\r\n }\r\n });\r\n }\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n public getCurrentPage(id: string): number | undefined {\r\n return this._instances()[id]?.currentPage;\r\n }\r\n\r\n public getItemsPerPage(id: string): number | undefined {\r\n return this._instances()[id]?.itemsPerPage;\r\n }\r\n\r\n public setCurrentPage(id: string, page: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance) {\r\n const maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n if (page <= maxPage && 1 <= page) {\r\n // 创建新引用以确保 Signal 检测到变化\r\n current[id] = { ...instance, currentPage: page };\r\n return { ...current };\r\n }\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public setTotalItems(id: string, totalItems: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance && 0 <= totalItems) {\r\n current[id] = { ...instance, totalItems };\r\n return { ...current };\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public setItemsPerPage(id: string, itemsPerPage: number): void {\r\n this._instances.update((current) => {\r\n const instance = current[id];\r\n if (instance) {\r\n current[id] = { ...instance, itemsPerPage };\r\n return { ...current };\r\n }\r\n return current;\r\n });\r\n\r\n // 通知分页器更新显示\r\n this.notifyChange(id);\r\n }\r\n\r\n public getInstance(id: string = this._defaultPaginationId): CmatPaginationInstance | undefined {\r\n const instance = this._instances()[id];\r\n if (instance) {\r\n return this._clone(instance);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private _updateInstance(current: CmatPaginationInstance, incoming: CmatPaginationInstance): boolean {\r\n let changed = false;\r\n if (incoming.id) {\r\n const keys = new Set([...Object.keys(current), ...Object.keys(incoming)]);\r\n\r\n for (const prop of keys) {\r\n const key = prop as keyof CmatPaginationInstance;\r\n\r\n if (incoming[key] !== current[key]) {\r\n current[key] = incoming[key];\r\n changed = true;\r\n }\r\n }\r\n }\r\n return changed;\r\n }\r\n\r\n private _needsUpdate(current: CmatPaginationInstance, incoming: CmatPaginationInstance): boolean {\r\n // 检查是否有任何属性发生变化\r\n const keys = new Set([...Object.keys(current), ...Object.keys(incoming)]);\r\n for (const prop of keys) {\r\n const key = prop as keyof CmatPaginationInstance;\r\n if (incoming[key] !== current[key]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n private _clone<T extends Record<string, unknown>>(obj: T): T {\r\n return structuredClone(obj);\r\n }\r\n}\r\n","import {\r\n afterNextRender,\r\n Directive,\r\n inject,\r\n Injector,\r\n signal,\r\n input,\r\n output,\r\n effect,\r\n untracked,\r\n} from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\nimport { CmatPaginationService } from './pagination.service';\r\n\r\nexport interface Page {\r\n label: string | number;\r\n value: number;\r\n}\r\n@Directive({\r\n // eslint-disable-next-line @angular-eslint/directive-selector\r\n selector: 'pagination-template,[pagination-template]',\r\n exportAs: 'paginationApi',\r\n})\r\nexport class CmatPaginationDirective {\r\n readonly id = input<string>();\r\n readonly maxSize = input<number>(7);\r\n\r\n readonly pageChange = output<number>();\r\n readonly pageBoundsCorrection = output<number>();\r\n readonly perPageCountChange = output<number>();\r\n\r\n readonly pages = signal<Page[]>([]);\r\n\r\n private readonly service = inject(CmatPaginationService);\r\n private readonly _injector = inject(Injector);\r\n private _pageLinksUpdateQueued = false;\r\n\r\n constructor() {\r\n effect(() => {\r\n const instances = this.service.instances();\r\n\r\n if (this._getId() === instances[this._getId()]?.id) {\r\n untracked(() => {\r\n this._schedulePageLinksUpdate();\r\n });\r\n }\r\n });\r\n\r\n this._schedulePageLinksUpdate();\r\n }\r\n\r\n previous(): void {\r\n if (!this.isFirstPage()) {\r\n this._checkValidId();\r\n\r\n const current = this.getCurrent();\r\n if (current) this.setCurrent(current - 1);\r\n }\r\n }\r\n\r\n next(): void {\r\n if (!this.isLastPage()) {\r\n this._checkValidId();\r\n\r\n const current = this.getCurrent();\r\n if (current) this.setCurrent(current + 1);\r\n }\r\n }\r\n\r\n goFirstPage(): void {\r\n if (!this.isFirstPage()) {\r\n this._checkValidId();\r\n\r\n this.setCurrent(1);\r\n }\r\n }\r\n\r\n goLastPage(): void {\r\n if (!this.isLastPage()) {\r\n this._checkValidId();\r\n\r\n const lastPage = this.getLastPage();\r\n if (lastPage) this.setCurrent(lastPage);\r\n }\r\n }\r\n\r\n isFirstPage(): boolean {\r\n return this.getCurrent() === 1;\r\n }\r\n\r\n isLastPage(): boolean {\r\n return this.getLastPage() === this.getCurrent();\r\n }\r\n\r\n setCurrent(page: number | string): void {\r\n const nextPage = Number(page);\r\n\r\n if (!Number.isNaN(nextPage)) {\r\n this.pageChange.emit(nextPage);\r\n }\r\n }\r\n\r\n getCurrent(): number | void {\r\n return this.service.getCurrentPage(this._getId());\r\n }\r\n\r\n getLastPage(): number | void {\r\n const inst = this.service.getInstance(this._getId());\r\n if (!inst) {\r\n return;\r\n }\r\n\r\n if (inst.totalItems < 1) {\r\n return 1;\r\n }\r\n return Math.ceil(inst.totalItems / inst.itemsPerPage);\r\n }\r\n\r\n getTotalItems(): number | void {\r\n return this.service.getInstance(this._getId())?.totalItems;\r\n }\r\n\r\n setItemsPerPage(count: number): void {\r\n const id = this._getId();\r\n this.service.setItemsPerPage(id, count);\r\n\r\n this.perPageCountChange.emit(count);\r\n const inst = this.service.getInstance(id);\r\n if (!inst) {\r\n return;\r\n }\r\n\r\n this.setCurrent(this._outOfBoundCorrection(inst));\r\n }\r\n\r\n private _getId(): string {\r\n return this.id() ?? this.service.defaultId();\r\n }\r\n\r\n private _checkValidId(): void {\r\n const id = this._getId();\r\n if (this.service.getInstance(id)?.id == null) {\r\n console.warn(\r\n `PaginationControlsDirective: the specified id \"${id}\" does not match any registered PaginationInstance`,\r\n );\r\n }\r\n }\r\n\r\n private _updatePageLinks(): void {\r\n const inst = this.service.getInstance(this._getId());\r\n if (!inst) {\r\n this.pages.set([]);\r\n return;\r\n }\r\n\r\n const correctedCurrentPage = this._outOfBoundCorrection(inst);\r\n const pageForRender =\r\n correctedCurrentPage !== inst.currentPage\r\n ? correctedCurrentPage\r\n : inst.currentPage;\r\n\r\n this.pageBoundsCorrection.emit(correctedCurrentPage);\r\n this.pages.set(\r\n this._createPageArray(\r\n pageForRender,\r\n inst.itemsPerPage,\r\n inst.totalItems,\r\n this.maxSize(),\r\n ),\r\n );\r\n }\r\n\r\n private _schedulePageLinksUpdate(): void {\r\n if (this._pageLinksUpdateQueued) {\r\n return;\r\n }\r\n\r\n this._pageLinksUpdateQueued = true;\r\n afterNextRender(\r\n () => {\r\n this._pageLinksUpdateQueued = false;\r\n this._updatePageLinks();\r\n },\r\n { injector: this._injector },\r\n );\r\n }\r\n\r\n private _outOfBoundCorrection(instance: CmatPaginationInstance): number {\r\n const totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n if (totalPages < instance.currentPage && 0 < totalPages) {\r\n return totalPages;\r\n } else if (instance.currentPage < 1) {\r\n return 1;\r\n }\r\n\r\n return instance.currentPage;\r\n }\r\n\r\n private _createPageArray(\r\n currentPage: number,\r\n itemsPerPage: number,\r\n totalItems: number,\r\n paginationRange: number,\r\n ): Page[] {\r\n paginationRange = +paginationRange;\r\n const pages: Page[] = [];\r\n\r\n const totalPages = Math.max(Math.ceil(totalItems / itemsPerPage), 1);\r\n const halfWay = Math.ceil(paginationRange / 2);\r\n\r\n const isStart = currentPage <= halfWay;\r\n const isEnd = totalPages - halfWay < currentPage;\r\n const isMiddle = !isStart && !isEnd;\r\n\r\n const ellipsesNeeded = paginationRange < totalPages;\r\n let i = 1;\r\n\r\n while (i <= totalPages && i <= paginationRange) {\r\n let label: string | number;\r\n const pageNumber = this._calculatePageNumber(\r\n i,\r\n currentPage,\r\n paginationRange,\r\n totalPages,\r\n );\r\n const openingEllipsesNeeded = i === 2 && (isMiddle || isEnd);\r\n const closingEllipsesNeeded =\r\n i === paginationRange - 1 && (isMiddle || isStart);\r\n if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {\r\n label = '...';\r\n } else {\r\n label = pageNumber;\r\n }\r\n pages.push({\r\n label: label,\r\n value: pageNumber,\r\n });\r\n i++;\r\n }\r\n\r\n return pages;\r\n }\r\n\r\n private _calculatePageNumber(\r\n i: number,\r\n currentPage: number,\r\n paginationRange: number,\r\n totalPages: number,\r\n ): number {\r\n const halfWay = Math.ceil(paginationRange / 2);\r\n if (i === paginationRange) {\r\n return totalPages;\r\n } else if (i === 1) {\r\n return i;\r\n } else if (paginationRange < totalPages) {\r\n if (totalPages - halfWay < currentPage) {\r\n return totalPages - paginationRange + i;\r\n } else if (halfWay < currentPage) {\r\n return currentPage - halfWay + i;\r\n } else {\r\n return i;\r\n }\r\n } else {\r\n return i;\r\n }\r\n }\r\n}\r\n","import { DecimalPipe, NgClass, NgStyle } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n output,\r\n computed,\r\n ElementRef,\r\n afterNextRender,\r\n signal,\r\n DestroyRef,\r\n} from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { CmatDigitOnlyDirective } from 'cmat/directives/digit-only';\r\nimport { CmatPaginationDirective } from './pagination.directive';\r\n\r\n@Component({\r\n selector: 'cmat-pagination',\r\n templateUrl: './pagination.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n exportAs: 'cmatPagination',\r\n imports: [\r\n CmatPaginationDirective,\r\n CmatDigitOnlyDirective,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatSelectModule,\r\n DecimalPipe,\r\n MatButtonModule,\r\n NgClass,\r\n NgStyle,\r\n ],\r\n})\r\nexport class CmatPaginationComponent {\r\n readonly id = input<string>();\r\n readonly maxSize = input<number>(7);\r\n readonly itemsPerPages = input<number[]>([10, 20, 30]);\r\n readonly initPerPage = input<number>(10);\r\n readonly autoHide = input<boolean>(false);\r\n\r\n readonly pageChange = output<number>();\r\n readonly pageBoundsCorrection = output<number>();\r\n readonly perPageCountChange = output<number>();\r\n\r\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private _destroyRef = inject(DestroyRef);\r\n\r\n // 组件宽度信号,初始化为一个合理默认值\r\n private _componentWidth = signal<number>(1024);\r\n\r\n // 根据组件自身宽度判断是否使用移动端样式(阈值:768px)\r\n // eslint-disable-next-line @typescript-eslint/member-ordering\r\n readonly isScreenSmall = computed(() => {\r\n return this._componentWidth() < 768;\r\n });\r\n\r\n constructor() {\r\n // 使用 ResizeObserver 监听组件自身宽度变化\r\n afterNextRender(() => {\r\n const element = this._elementRef.nativeElement;\r\n\r\n // 确保元素是块级或行内块级,可以正确测量宽度\r\n if (getComputedStyle(element).display === 'inline') {\r\n element.style.display = 'inline-block';\r\n element.style.width = '100%';\r\n }\r\n\r\n // 立即获取一次初始宽度\r\n const initialWidth = element.getBoundingClientRect().width;\r\n if (initialWidth > 0) {\r\n this._componentWidth.set(initialWidth);\r\n }\r\n\r\n // 创建 ResizeObserver\r\n const resizeObserver = new ResizeObserver((entries) => {\r\n for (const entry of entries) {\r\n const width = entry.contentRect.width;\r\n // 只有当宽度大于0时才更新,避免无效值\r\n if (width > 0) {\r\n this._componentWidth.set(width);\r\n }\r\n }\r\n });\r\n\r\n // 开始观察\r\n resizeObserver.observe(element);\r\n\r\n // 组件销毁时清理观察者\r\n this._destroyRef.onDestroy(() => {\r\n resizeObserver.disconnect();\r\n });\r\n });\r\n }\r\n}\r\n","<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- 左:总计 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">共 {{ p.getTotalItems() }} 条</span>\r\n </div>\r\n\r\n <!-- 右:导航 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- 首页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 上一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- 下一页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 末页 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- 页码跳转(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- 每页条数(桌面端) -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { CmatPaginationInstance } from './pagination.instance';\r\nimport { CmatPaginationService } from './pagination.service';\r\n\r\nconst LARGE_NUMBER = Number.MAX_SAFE_INTEGER;\r\n\r\nexport type Collection<T> = readonly T[];\r\n\r\nexport interface CmatPaginatePipeArgs {\r\n id?: string;\r\n currentPage: string | number;\r\n itemsPerPage: string | number;\r\n totalItems: string | number;\r\n}\r\n\r\nexport interface CmatPipeState {\r\n size: number;\r\n start?: number;\r\n end?: number;\r\n slice: readonly unknown[];\r\n}\r\n\r\n@Pipe({\r\n name: 'paginate',\r\n pure: true\r\n})\r\nexport class CmatPaginatePipe implements PipeTransform {\r\n private service = inject(CmatPaginationService);\r\n\r\n private readonly state: Record<string, CmatPipeState> = {};\r\n\r\n public transform<T, U extends Collection<T>>(collection: U, args: CmatPaginatePipeArgs): U {\r\n if (!Array.isArray(collection)) {\r\n const _id = args.id ?? this.service.defaultId();\r\n const cachedSlice = this.state[_id]?.slice as unknown as U | undefined;\r\n\r\n return cachedSlice ?? collection;\r\n }\r\n\r\n const totalItems = this._toNumber(args.totalItems) || collection.length;\r\n const serverSideMode = totalItems !== collection.length;\r\n const instance = this.createInstance(collection, { ...args, totalItems });\r\n\r\n const id = instance.id ?? this.service.defaultId();\r\n let start: number | undefined;\r\n let end: number | undefined;\r\n const perPage = this._toNumber(args.itemsPerPage);\r\n\r\n const emitChange = this.service.register(instance,true);\r\n\r\n if (!serverSideMode) {\r\n const pageSize = perPage || LARGE_NUMBER;\r\n start = (instance.currentPage - 1) * pageSize;\r\n end = start + pageSize;\r\n\r\n const isIdentical = this._stateIsIdentical(id, collection, start, end);\r\n if (isIdentical) {\r\n return this.state[id].slice as unknown as U;\r\n }\r\n\r\n const slice = collection.slice(start, end);\r\n this._saveState(id, collection, slice, start, end);\r\n this.service.notifyChange(id);\r\n return slice as unknown as U;\r\n }\r\n\r\n if (emitChange) {\r\n this.service.notifyChange(id);\r\n }\r\n\r\n this._saveState(id, collection, collection, start, end);\r\n\r\n return collection;\r\n\r\n }\r\n\r\n private createInstance(collection: readonly unknown[], config: CmatPaginatePipeArgs): CmatPaginationInstance {\r\n this.checkConfig(config);\r\n\r\n return {\r\n id: config.id ?? this.service.defaultId(),\r\n itemsPerPage: this._toNumber(config.itemsPerPage) || 10,\r\n currentPage: this._toNumber(config.currentPage) || 1,\r\n totalItems: this._toNumber(config.totalItems) || collection.length\r\n };\r\n }\r\n\r\n private checkConfig(config: CmatPaginatePipeArgs): void {\r\n const missing = ['itemsPerPage', 'currentPage'].filter(prop => !(prop in config));\r\n\r\n if (missing.length > 0) {\r\n throw new Error(`PaginatePipe: Argument is missing the following required properties: ${missing.join(', ')}`);\r\n }\r\n }\r\n\r\n private _saveState(id: string, collection: readonly unknown[], slice: readonly unknown[], start?: number, end?: number): void {\r\n this.state[id] = {\r\n size: collection.length,\r\n slice,\r\n start,\r\n end\r\n };\r\n }\r\n\r\n private _stateIsIdentical(id: string, collection: readonly unknown[], start: number, end: number): boolean {\r\n const state = this.state[id];\r\n if (!state) {\r\n return false;\r\n }\r\n const isMetaDataIdentical = state.size === collection.length &&\r\n state.start === start &&\r\n state.end === end;\r\n\r\n if (!isMetaDataIdentical) {\r\n return false;\r\n }\r\n\r\n return state.slice.every((element, index) => element === collection[start + index]);\r\n }\r\n\r\n private _toNumber(value: string | number): number {\r\n return Number(value);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAMa,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AI,EAAE,UAAU;AAChB,oBAAA,IAAI,EAAE;AACT,iBAAA;;;ACzBD;;AAEG;;;;"}
package/fesm2022/cmat.mjs CHANGED
@@ -7666,11 +7666,11 @@ class CmatMasonryComponent {
7666
7666
  ...(ngDevMode ? [{ debugName: "distributedColumns" }] : /* istanbul ignore next */ []));
7667
7667
  }
7668
7668
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatMasonryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7669
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: CmatMasonryComponent, isStandalone: true, selector: "cmat-masonry", inputs: { columnsTemplate: { classPropertyName: "columnsTemplate", publicName: "columnsTemplate", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatMasonry"], ngImport: i0, template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
7669
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: CmatMasonryComponent, isStandalone: true, selector: "cmat-masonry", inputs: { columnsTemplate: { classPropertyName: "columnsTemplate", publicName: "columnsTemplate", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatMasonry"], ngImport: i0, template: "<div class=\"flex\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
7670
7670
  }
7671
7671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatMasonryComponent, decorators: [{
7672
7672
  type: Component,
7673
- args: [{ selector: 'cmat-masonry', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMasonry', imports: [NgTemplateOutlet], template: "<div class=\"flex p-2\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>" }]
7673
+ args: [{ selector: 'cmat-masonry', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatMasonry', imports: [NgTemplateOutlet], template: "<div class=\"flex\">\r\n <ng-container *ngTemplateOutlet=\"columnsTemplate(); context: { $implicit: distributedColumns() }\"></ng-container>\r\n</div>" }]
7674
7674
  }], propDecorators: { columnsTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnsTemplate", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] } });
7675
7675
 
7676
7676
  const baseColors = [
@@ -12475,7 +12475,7 @@ class CmatPaginationComponent {
12475
12475
  });
12476
12476
  }
12477
12477
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12478
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: CmatPaginationComponent, isStandalone: true, selector: "cmat-pagination", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPages: { classPropertyName: "itemsPerPages", publicName: "itemsPerPages", isSignal: true, isRequired: false, transformFunction: null }, initPerPage: { classPropertyName: "initPerPage", publicName: "initPerPage", isSignal: true, isRequired: false, transformFunction: null }, autoHide: { classPropertyName: "autoHide", publicName: "autoHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection", perPageCountChange: "perPageCountChange" }, exportAs: ["cmatPagination"], ngImport: i0, template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\" (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A + \u9875\u7801\u8DF3\u8F6C + \u6BCF\u9875\u6761\u6570 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n @if (isScreenSmall()) {\r\n <li>\r\n <span class=\"px-3 text-sm tabular-nums whitespace-nowrap\">{{ p.getCurrent() }} / {{ p.getLastPage() }}</span>\r\n </li>\r\n } @else {\r\n <li>\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-1\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n", dependencies: [{ kind: "directive", type: CmatPaginationDirective, selector: "pagination-template,[pagination-template]", inputs: ["id", "maxSize"], outputs: ["pageChange", "pageBoundsCorrection", "perPageCountChange"], exportAs: ["paginationApi"] }, { kind: "directive", type: CmatDigitOnlyDirective$1, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12478
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: CmatPaginationComponent, isStandalone: true, selector: "cmat-pagination", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, itemsPerPages: { classPropertyName: "itemsPerPages", publicName: "itemsPerPages", isSignal: true, isRequired: false, transformFunction: null }, initPerPage: { classPropertyName: "initPerPage", publicName: "initPerPage", isSignal: true, isRequired: false, transformFunction: null }, autoHide: { classPropertyName: "autoHide", publicName: "autoHide", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection", perPageCountChange: "perPageCountChange" }, exportAs: ["cmatPagination"], ngImport: i0, template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n", styles: ["@media(hover:none)and (pointer:coarse){cmat-pagination button[matIconButton]{transition:transform .15s ease}cmat-pagination button[matIconButton]:active:not([disabled]){transform:scale(.88)}}\n"], dependencies: [{ kind: "directive", type: CmatPaginationDirective, selector: "pagination-template,[pagination-template]", inputs: ["id", "maxSize"], outputs: ["pageChange", "pageBoundsCorrection", "perPageCountChange"], exportAs: ["paginationApi"] }, { kind: "directive", type: CmatDigitOnlyDirective$1, selector: "[cmatDigitOnly]", inputs: ["decimal", "decimalSeparator", "allowNegatives", "allowPaste", "negativeSign", "min", "max", "pattern"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12479
12479
  }
12480
12480
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CmatPaginationComponent, decorators: [{
12481
12481
  type: Component,
@@ -12490,7 +12490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
12490
12490
  MatButtonModule,
12491
12491
  NgClass,
12492
12492
  NgStyle,
12493
- ], template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\" (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A + \u9875\u7801\u8DF3\u8F6C + \u6BCF\u9875\u6761\u6570 -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n @if (isScreenSmall()) {\r\n <li>\r\n <span class=\"px-3 text-sm tabular-nums whitespace-nowrap\">{{ p.getCurrent() }} / {{ p.getLastPage() }}</span>\r\n </li>\r\n } @else {\r\n <li>\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n }\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-1\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n" }]
12493
+ ], template: "<pagination-template #p=\"paginationApi\" class=\"w-full px-4 py-2 flex items-center\" [id]=\"id()\"\r\n [maxSize]=\"isScreenSmall() && maxSize() > 5 ? 5 : maxSize()\"\r\n (pageChange)=\"pageChange.emit($event)\"\r\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\" (perPageCountChange)=\"perPageCountChange.emit($event)\">\r\n @if (!(autoHide() && p.pages().length <= 1)) {\r\n <!-- \u5DE6\uFF1A\u603B\u8BA1 -->\r\n <div class=\"flex-auto\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <span class=\"text-sm text-secondary whitespace-nowrap\">\u5171 {{ p.getTotalItems() }} \u6761</span>\r\n </div>\r\n\r\n <!-- \u53F3\uFF1A\u5BFC\u822A -->\r\n <nav role=\"navigation\" class=\"flex\" [ngClass]=\"{'w-full':isScreenSmall()}\">\r\n <ul class=\"flex items-center\"\r\n [ngClass]=\"{'justify-center w-full gap-0':isScreenSmall(),'flex-row gap-0.5':!isScreenSmall()}\">\r\n\r\n <!-- \u9996\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.goFirstPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:first_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u4E0A\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === 1\" (click)=\"p.previous()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-left\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801 -->\r\n <li class=\"mx-1\">\r\n <div class=\"flex items-center gap-0.5\">\r\n @for (page of p.pages(); track $index) {\r\n @if (page.label === \"...\") {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary\">...</span>\r\n } @else if (p.getCurrent() === page.value) {\r\n <span class=\"flex items-center justify-center w-8 h-8 rounded-full bg-primary-500 text-white text-sm font-medium\">\r\n {{ page.label | number: \"\" }}\r\n </span>\r\n } @else {\r\n <a tabindex=\"0\" role=\"presentation\"\r\n class=\"flex items-center justify-center w-8 h-8 rounded-full text-sm text-secondary cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors\"\r\n (click)=\"p.setCurrent(page.value)\">\r\n {{ page.label | number: \"\" }}\r\n </a>\r\n }\r\n }\r\n </div>\r\n </li>\r\n\r\n <!-- \u4E0B\u4E00\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.next()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"heroicons_outline:chevron-right\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u672B\u9875 -->\r\n <li>\r\n <button type=\"button\" matIconButton [disabled]=\"p.getCurrent() === p.getLastPage()\" (click)=\"p.goLastPage()\">\r\n <mat-icon class=\"icon-size-5\" svgIcon=\"mat_outline:last_page\"></mat-icon>\r\n </button>\r\n </li>\r\n\r\n <!-- \u9875\u7801\u8DF3\u8F6C\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field appearance=\"outline\" [ngStyle]=\"{\r\n width: (p.getLastPage()?.toString()?.length || 0) * 8 + 64 + 'px',\r\n }\">\r\n <input #current matInput type=\"text\" cmatDigitOnly class=\"text-end\" [value]=\"p.getCurrent()\"\r\n [autocomplete]=\"'off'\" [min]=\"0\" [max]=\"p.getLastPage() || 0\" (keyup.enter)=\"p.setCurrent(current.value)\" />\r\n <span matSuffix>/\r\n <div class=\"px-2\">{{ p.getLastPage() }}</div>\r\n </span>\r\n </mat-form-field>\r\n </li>\r\n\r\n <!-- \u6BCF\u9875\u6761\u6570\uFF08\u684C\u9762\u7AEF\uFF09 -->\r\n <li class=\"px-1\" [ngClass]=\"{'hidden':isScreenSmall(),'block':!isScreenSmall()}\">\r\n <mat-form-field class=\"w-20\" appearance=\"outline\">\r\n <mat-select #pageCount [value]=\"initPerPage()\" (selectionChange)=\"p.setItemsPerPage(pageCount.value)\">\r\n @for (perPage of itemsPerPages(); track perPage) {\r\n <mat-option [value]=\"perPage\">{{ perPage }}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n </li>\r\n </ul>\r\n </nav>\r\n }\r\n</pagination-template>\r\n\r\n<style>\r\n @media (hover: none) and (pointer: coarse) {\r\n cmat-pagination button[matIconButton] {\r\n transition: transform 150ms ease;\r\n }\r\n cmat-pagination button[matIconButton]:active:not([disabled]) {\r\n transform: scale(0.88);\r\n }\r\n }\r\n</style>\r\n" }]
12494
12494
  }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], itemsPerPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsPerPages", required: false }] }], initPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "initPerPage", required: false }] }], autoHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHide", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageBoundsCorrection: [{ type: i0.Output, args: ["pageBoundsCorrection"] }], perPageCountChange: [{ type: i0.Output, args: ["perPageCountChange"] }] } });
12495
12495
 
12496
12496
  const LARGE_NUMBER = Number.MAX_SAFE_INTEGER;