ngx-tethys 19.0.13 → 19.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -2
- package/action/action.component.d.ts +12 -20
- package/action/actions.component.d.ts +5 -7
- package/affix/affix.component.d.ts +7 -10
- package/alert/alert.component.d.ts +1 -1
- package/anchor/anchor-link.component.d.ts +8 -8
- package/anchor/anchor.component.d.ts +15 -21
- package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
- package/autocomplete/autocomplete.component.d.ts +10 -17
- package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
- package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
- package/avatar/avatar.component.d.ts +25 -39
- package/back-top/back-top.component.d.ts +9 -12
- package/badge/badge.component.d.ts +19 -59
- package/breadcrumb/breadcrumb.component.d.ts +15 -20
- package/button/button-icon.component.d.ts +3 -2
- package/button/button.component.d.ts +3 -2
- package/calendar/calendar-header.component.d.ts +9 -8
- package/calendar/calendar.component.d.ts +16 -16
- package/card/card.component.d.ts +5 -11
- package/card/content.component.d.ts +3 -8
- package/card/header.component.d.ts +7 -8
- package/carousel/carousel.component.d.ts +22 -27
- package/cascader/cascader-li.component.d.ts +13 -21
- package/cascader/cascader-search-option.component.d.ts +8 -16
- package/cascader/cascader.component.d.ts +58 -80
- package/checkbox/checkbox.component.d.ts +2 -5
- package/collapse/collapse-item.component.d.ts +12 -19
- package/collapse/collapse.component.d.ts +6 -12
- package/collapse/collapse.token.d.ts +3 -3
- package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
- package/color-picker/color-picker-panel.component.d.ts +7 -11
- package/color-picker/color-picker.component.d.ts +19 -35
- package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
- package/color-picker/parts/hue/hue.component.d.ts +6 -6
- package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
- package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
- package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
- package/comment/comment.component.d.ts +4 -5
- package/copy/copy.directive.d.ts +8 -9
- package/date-picker/abstract-picker.component.d.ts +8 -7
- package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
- package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
- package/date-picker/picker.component.d.ts +2 -1
- package/date-range/date-range.component.d.ts +2 -2
- package/dialog/body/dialog-body.component.d.ts +2 -6
- package/dialog/confirm/confirm.component.d.ts +2 -2
- package/dialog/footer/dialog-footer.component.d.ts +6 -9
- package/dialog/header/dialog-header.component.d.ts +9 -11
- package/divider/divider.component.d.ts +12 -16
- package/dot/dot.component.d.ts +5 -13
- package/drag-drop/drag-handle.directive.d.ts +2 -1
- package/drag-drop/drag.directive.d.ts +2 -1
- package/drag-drop/drop-container.directive.d.ts +2 -1
- package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
- package/dropdown/dropdown-menu.component.d.ts +2 -1
- package/dropdown/dropdown.directive.d.ts +2 -1
- package/empty/empty.component.d.ts +21 -27
- package/fesm2022/ngx-tethys-action.mjs +54 -91
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +29 -26
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-anchor.mjs +91 -118
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +117 -162
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +33 -46
- package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.mjs +104 -208
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +85 -87
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +72 -77
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +82 -99
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +313 -468
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
- package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +66 -71
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +16 -10
- package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-copy.mjs +25 -28
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +81 -82
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +49 -58
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +45 -68
- package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +107 -95
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +161 -200
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +160 -152
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +25 -25
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +101 -114
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +268 -271
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +1 -1
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +17 -35
- package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
- package/fesm2022/ngx-tethys-mention.mjs +52 -74
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +106 -179
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +169 -201
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +230 -294
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +67 -70
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +196 -244
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +102 -105
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +34 -38
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +46 -28
- package/fesm2022/ngx-tethys-result.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +75 -108
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +26 -46
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +114 -151
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +74 -107
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +80 -140
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +1 -1
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +69 -87
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +42 -64
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +104 -129
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +36 -33
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +91 -130
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-watermark.mjs +36 -40
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/form/form-group-error/form-group-error.component.d.ts +2 -3
- package/form/form-group-label.directive.d.ts +2 -1
- package/form/form-group.component.d.ts +17 -24
- package/form/form-submit.directive.d.ts +2 -2
- package/form/form.directive.d.ts +6 -8
- package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
- package/form/validator/confirm-validator.directive.d.ts +2 -2
- package/form/validator/unique-validator.directive.d.ts +2 -2
- package/fullscreen/fullscreen.component.d.ts +7 -7
- package/grid/flex.d.ts +14 -19
- package/grid/thy-col.directive.d.ts +6 -9
- package/grid/thy-grid-item.component.d.ts +3 -4
- package/grid/thy-grid.component.d.ts +11 -12
- package/grid/thy-row.directive.d.ts +12 -12
- package/icon/icon.component.d.ts +3 -2
- package/image/image.directive.d.ts +3 -2
- package/input/input-count.component.d.ts +4 -5
- package/input/input-group.component.d.ts +20 -20
- package/input/input-search.component.d.ts +15 -20
- package/input/input.component.d.ts +20 -21
- package/input/input.directive.d.ts +4 -6
- package/input-number/input-number.component.d.ts +21 -29
- package/layout/header.component.d.ts +4 -9
- package/layout/sidebar-header.component.d.ts +2 -1
- package/layout/sidebar.component.d.ts +8 -7
- package/list/list.component.d.ts +2 -1
- package/list/selection/selection-list.d.ts +4 -3
- package/loading/loading.component.d.ts +4 -10
- package/mention/mention.directive.d.ts +6 -7
- package/mention/suggestions/suggestions.component.d.ts +8 -9
- package/menu/group/menu-group.component.d.ts +16 -33
- package/menu/item/action/menu-item-action.component.d.ts +7 -8
- package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
- package/menu/item/menu-item.component.d.ts +4 -4
- package/menu/item/name/menu-item-name.component.d.ts +2 -3
- package/menu/menu.component.d.ts +3 -7
- package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
- package/nav/icon-nav/icon-nav.component.d.ts +3 -8
- package/nav/nav-ink-bar.directive.d.ts +4 -6
- package/nav/nav-item.directive.d.ts +7 -10
- package/nav/nav.component.d.ts +20 -48
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +48 -109
- package/popover/header/popover-header.component.d.ts +7 -6
- package/popover/popover.directive.d.ts +11 -18
- package/progress/progress-circle.component.d.ts +32 -21
- package/progress/progress-strip.component.d.ts +10 -14
- package/progress/progress.component.d.ts +15 -23
- package/property/examples/single/single.component.scss +6 -0
- package/property/properties.component.d.ts +6 -13
- package/property/property-item.component.d.ts +21 -26
- package/property/styles/properties.scss +124 -52
- package/property-operation/property-operation.component.d.ts +6 -5
- package/radio/button/radio-button.component.d.ts +2 -2
- package/radio/group/radio-group.component.d.ts +8 -7
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.token.d.ts +2 -2
- package/rate/rate-item.component.d.ts +2 -1
- package/rate/rate.component.d.ts +4 -3
- package/resizable/resizable.directive.d.ts +4 -9
- package/resizable/resize-handle.component.d.ts +2 -1
- package/resizable/resize-handles.component.d.ts +2 -1
- package/result/result.component.d.ts +9 -10
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/segment-item.component.d.ts +2 -1
- package/segment/segment.component.d.ts +2 -1
- package/select/custom-select/custom-select.component.d.ts +11 -10
- package/select/native-select/native-select.component.d.ts +2 -1
- package/shared/base-form-check.component.d.ts +3 -2
- package/shared/directives/thy-autofocus.directive.d.ts +3 -2
- package/shared/directives/thy-scroll.directive.d.ts +2 -1
- package/shared/directives/thy-show.d.ts +2 -1
- package/shared/option/group/option-group.component.d.ts +2 -1
- package/shared/option/list-option/list-option.component.d.ts +2 -7
- package/shared/option/option.component.d.ts +2 -1
- package/shared/select/select-control/select-control.component.d.ts +7 -6
- package/skeleton/skeleton-circle.component.d.ts +16 -19
- package/skeleton/skeleton-rectangle.component.d.ts +20 -23
- package/skeleton/skeleton.component.d.ts +5 -6
- package/skeleton/stylized/bullet-list.component.d.ts +11 -13
- package/skeleton/stylized/list.component.d.ts +10 -12
- package/skeleton/stylized/paragraph.component.d.ts +12 -14
- package/slide/slide-body/slide-body-section.component.d.ts +2 -1
- package/slider/slider.component.d.ts +17 -24
- package/space/space.component.d.ts +8 -8
- package/statistic/statistic.component.d.ts +35 -40
- package/stepper/step-header.component.d.ts +6 -10
- package/stepper/step.component.d.ts +6 -6
- package/stepper/stepper.component.d.ts +15 -20
- package/switch/switch.component.d.ts +24 -35
- package/table/table-column.component.d.ts +6 -5
- package/table/table-skeleton.component.d.ts +3 -10
- package/table/table.component.d.ts +11 -10
- package/tabs/tab-content.component.d.ts +4 -4
- package/tabs/tab.component.d.ts +4 -5
- package/tabs/tabs.component.d.ts +13 -15
- package/tag/tag.component.d.ts +10 -16
- package/time-picker/time-picker-panel.component.d.ts +3 -2
- package/time-picker/time-picker.component.d.ts +6 -5
- package/timeline/timeline-item.component.d.ts +9 -13
- package/timeline/timeline.component.d.ts +13 -17
- package/tooltip/tooltip.directive.d.ts +3 -2
- package/tree/tree-node.component.d.ts +6 -15
- package/tree/tree.component.d.ts +8 -7
- package/tree-select/tree-select.component.d.ts +8 -7
- package/typography/bg-color.directive.d.ts +3 -3
- package/typography/text/text.component.d.ts +2 -2
- package/typography/text-color.directive.d.ts +3 -3
- package/upload/file-drop.directive.d.ts +9 -11
- package/upload/file-select-base.d.ts +6 -10
- package/upload/file-select.component.d.ts +10 -20
- package/util/helpers/helpers.d.ts +2 -1
- package/vote/vote.component.d.ts +4 -3
- package/watermark/watermark.directive.d.ts +7 -9
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Pipe,
|
|
2
|
+
import { InjectionToken, inject, Pipe, input, numberAttribute, output, signal, model, computed, effect, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
6
|
-
import { useHostRenderer } from '@tethys/cdk/dom';
|
|
7
6
|
import { ThyIcon, ThyIconModule } from 'ngx-tethys/icon';
|
|
8
7
|
import { ThySelect, ThySelectModule } from 'ngx-tethys/select';
|
|
9
8
|
import { ThyOption, ThyEnterDirective, ThySharedModule } from 'ngx-tethys/shared';
|
|
10
|
-
import { isTemplateRef, coerceBooleanProperty } from 'ngx-tethys/util';
|
|
9
|
+
import { isTemplateRef, coerceBooleanProperty, isBoolean, isArray, isString } from 'ngx-tethys/util';
|
|
11
10
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
12
11
|
import { injectLocale } from 'ngx-tethys/i18n';
|
|
13
12
|
|
|
@@ -96,258 +95,252 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
96
95
|
class ThyPagination {
|
|
97
96
|
constructor() {
|
|
98
97
|
this.paginationConfig = inject(THY_PAGINATION_CONFIG, { optional: true });
|
|
99
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
100
98
|
this.allLocale = injectLocale();
|
|
101
|
-
this.
|
|
99
|
+
this.paginationLocale = injectLocale('pagination');
|
|
102
100
|
this.isTemplateRef = isTemplateRef;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
/**
|
|
102
|
+
* 设置当前页,支持双向绑定
|
|
103
|
+
* @default 1
|
|
104
|
+
*/
|
|
105
|
+
this.thyPageIndex = input(undefined, { transform: numberAttribute });
|
|
106
|
+
/**
|
|
107
|
+
* 每页条目数量
|
|
108
|
+
* @default 20
|
|
109
|
+
*/
|
|
110
|
+
this.thyPageSize = input(undefined, { transform: numberAttribute });
|
|
111
|
+
/**
|
|
112
|
+
* 数据总数
|
|
113
|
+
*/
|
|
114
|
+
this.thyTotal = input(undefined, { transform: numberAttribute });
|
|
115
|
+
/**
|
|
116
|
+
* 自定义分页页码,设置自定义分页页码后将不根据 Total 和 PageSize 来自动计算页码,完全以传入的页码为准
|
|
117
|
+
* @type number[]
|
|
118
|
+
*/
|
|
119
|
+
this.thyCustomPages = input();
|
|
109
120
|
/**
|
|
110
121
|
* 是否禁用
|
|
111
122
|
*/
|
|
112
|
-
this.
|
|
123
|
+
this.thyDisabled = input(false, { transform: coerceBooleanProperty });
|
|
113
124
|
/**
|
|
114
|
-
*
|
|
125
|
+
* 是否显示快速跳转
|
|
126
|
+
* @default false
|
|
115
127
|
*/
|
|
116
|
-
this.
|
|
128
|
+
this.thyShowQuickJumper = input(undefined, { transform: coerceBooleanProperty });
|
|
117
129
|
/**
|
|
118
|
-
*
|
|
130
|
+
* 设置是否显示总页数信息
|
|
131
|
+
* @default true
|
|
119
132
|
*/
|
|
120
|
-
this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.
|
|
133
|
+
this.thyShowTotalPageCount = input(undefined, { transform: coerceBooleanProperty });
|
|
134
|
+
/**
|
|
135
|
+
* 设置分页组件的大小
|
|
136
|
+
* @type sm | md | lg
|
|
137
|
+
* @default md
|
|
138
|
+
*/
|
|
139
|
+
this.thySize = input('md', { alias: 'thySize' });
|
|
140
|
+
/**
|
|
141
|
+
* 设置最大显示数量,超出最大显示数后会自动进行分割显示
|
|
142
|
+
* @default 9
|
|
143
|
+
*/
|
|
144
|
+
this.thyMaxCount = input(undefined, { transform: numberAttribute });
|
|
145
|
+
/**
|
|
146
|
+
* 设置边缘显示数量
|
|
147
|
+
* @default 2
|
|
148
|
+
*/
|
|
149
|
+
this.thyMarginalCount = input(undefined, { transform: numberAttribute });
|
|
150
|
+
/**
|
|
151
|
+
* 设置中间区域显示数量
|
|
152
|
+
* @default 5
|
|
153
|
+
*/
|
|
154
|
+
this.thyRangeCount = input(undefined, { transform: numberAttribute });
|
|
155
|
+
/**
|
|
156
|
+
* 是否显示分页大小选择器
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
this.thyShowSizeChanger = input(undefined, { transform: coerceBooleanProperty });
|
|
160
|
+
/**
|
|
161
|
+
* @type number[]
|
|
162
|
+
*/
|
|
163
|
+
this.thyPageSizeOptions = input(undefined);
|
|
164
|
+
/**
|
|
165
|
+
* 只有一页时是否隐藏分页器
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
this.thyHideOnSinglePage = input(undefined, { transform: coerceBooleanProperty });
|
|
169
|
+
/**
|
|
170
|
+
* 分页器单位
|
|
171
|
+
* @default 条
|
|
172
|
+
*/
|
|
173
|
+
this.thyUnit = input();
|
|
132
174
|
/**
|
|
133
175
|
* 是否显示范围和total
|
|
134
176
|
* @default false
|
|
135
177
|
*/
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* 总页数 与 totalPages 二选一传入
|
|
163
|
-
*/
|
|
164
|
-
set thyTotal(total) {
|
|
165
|
-
this.total = total;
|
|
166
|
-
if (this.initialized) {
|
|
167
|
-
this.calculatePageCount();
|
|
168
|
-
this.setPageIndex(this.pageIndex);
|
|
169
|
-
this.cdr.markForCheck();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* 自定义分页页码,设置自定义分页页码后将不根据 Total 和 PageSize 来自动计算页码,完全以传入的页码为准
|
|
174
|
-
* @type number[]
|
|
175
|
-
*/
|
|
176
|
-
set thyCustomPages(pages) {
|
|
177
|
-
this.customPages = pages;
|
|
178
|
-
this.config.showTotalPageCount = false;
|
|
179
|
-
if (this.initialized) {
|
|
180
|
-
this.calculatePageCount();
|
|
181
|
-
this.initializePages(this.pageIndex, this.pageCount);
|
|
182
|
-
this.cdr.markForCheck();
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* 是否显示快速跳转
|
|
187
|
-
* @default false
|
|
188
|
-
*/
|
|
189
|
-
set showQuickJumper(value) {
|
|
190
|
-
this.config.showQuickJumper = value;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* 设置是否显示总页数信息
|
|
194
|
-
* @default true
|
|
195
|
-
*/
|
|
196
|
-
set showTotalPageCount(value) {
|
|
197
|
-
this.config.showTotalPageCount = value;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* 设置分页组件的大小
|
|
201
|
-
* @type sm | md | lg
|
|
202
|
-
* @default md
|
|
203
|
-
*/
|
|
204
|
-
set size(size) {
|
|
205
|
-
this.selectSize = size;
|
|
206
|
-
this.hostRenderer.addClass(`thy-pagination-${size}`);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* 设置最大显示数量,超出最大显示数后会自动进行分割显示
|
|
210
|
-
* @default 9
|
|
211
|
-
*/
|
|
212
|
-
set maxCount(value) {
|
|
213
|
-
this.config.maxCount = value;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* 设置中间区域显示数量
|
|
217
|
-
* @default 5
|
|
218
|
-
*/
|
|
219
|
-
set thyRangeCount(value) {
|
|
220
|
-
if (Number.isInteger(value)) {
|
|
221
|
-
this.config.rangeCount = value;
|
|
222
|
-
if (this.initialized) {
|
|
223
|
-
this.setMarginalCount(value);
|
|
178
|
+
this.thyShowTotal = input(false);
|
|
179
|
+
/**
|
|
180
|
+
* 页码改变的回调
|
|
181
|
+
*/
|
|
182
|
+
this.thyPageIndexChange = output();
|
|
183
|
+
/**
|
|
184
|
+
* 与Bootstrap pagination 兼容,后续版本会进行删除,参数保持与 bootstrap 一致
|
|
185
|
+
*/
|
|
186
|
+
this.thyPageChanged = output();
|
|
187
|
+
this.thyPageSizeChanged = output();
|
|
188
|
+
this.currentPageIndex = signal(1);
|
|
189
|
+
this.currentPageSize = signal(null);
|
|
190
|
+
this.selectedPageSize = model();
|
|
191
|
+
this.firstIndex = 1;
|
|
192
|
+
this.computedConfig = computed(() => {
|
|
193
|
+
const result = Object.assign({}, PaginationDefaultConfig, {
|
|
194
|
+
firstText: this.paginationLocale().firstPage,
|
|
195
|
+
lastText: this.paginationLocale().lastPage,
|
|
196
|
+
totalPagesFormat: this.paginationLocale().totalCount,
|
|
197
|
+
unit: this.paginationLocale().defaultUnit
|
|
198
|
+
}, this.paginationConfig.main);
|
|
199
|
+
if (isBoolean(this.thyShowQuickJumper())) {
|
|
200
|
+
result.showQuickJumper = this.thyShowQuickJumper();
|
|
224
201
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
set showSizeChanger(value) {
|
|
228
|
-
this.config.showSizeChanger = value;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* @type number[]
|
|
232
|
-
*/
|
|
233
|
-
set pageSizeOptions(value) {
|
|
234
|
-
this.config.pageSizeOptions = value;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* 分页器单位
|
|
238
|
-
* @default 条
|
|
239
|
-
*/
|
|
240
|
-
set unit(value) {
|
|
241
|
-
if (value) {
|
|
242
|
-
this.config.unit = value;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
ngOnInit() {
|
|
246
|
-
this.setMarginalCount(this.config.rangeCount);
|
|
247
|
-
this.calculatePageCount();
|
|
248
|
-
this.setPageIndex(this.pageIndex);
|
|
249
|
-
this.initialized = true;
|
|
250
|
-
}
|
|
251
|
-
setMarginalCount(range) {
|
|
252
|
-
if (!this.marginalCount) {
|
|
253
|
-
this.marginalCount = range <= DEFAULT_RANGE_COUNT ? 1 : 2;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
setPageIndex(pageIndex) {
|
|
257
|
-
this.pageIndex = pageIndex > this.pageCount ? this.pageCount : pageIndex || 1;
|
|
258
|
-
const toPageSize = this.pageIndex * this.pageSize;
|
|
259
|
-
this.range = {
|
|
260
|
-
from: (this.pageIndex - 1) * this.pageSize + 1,
|
|
261
|
-
to: toPageSize > this.total ? this.total : toPageSize
|
|
262
|
-
};
|
|
263
|
-
this.initializePages(this.pageIndex, this.pageCount);
|
|
264
|
-
this.cdr.markForCheck();
|
|
265
|
-
}
|
|
266
|
-
calculatePageCount() {
|
|
267
|
-
let pageCount = null;
|
|
268
|
-
if (this.customPages && this.customPages.length > 0) {
|
|
269
|
-
pageCount = this.customPages[this.customPages.length - 1];
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
pageCount = this.pageSize < 1 ? 1 : Math.ceil(this.total / this.pageSize);
|
|
273
|
-
}
|
|
274
|
-
this.pageCount = Math.max(pageCount || 0, 1);
|
|
275
|
-
}
|
|
276
|
-
makePage(index, text, active) {
|
|
277
|
-
return { index, text, active };
|
|
278
|
-
}
|
|
279
|
-
initializePages(pageIndex, pageCount) {
|
|
280
|
-
if (this.customPages && this.customPages.length > 0) {
|
|
281
|
-
this.pages = this.customPages.map(page => {
|
|
282
|
-
return {
|
|
283
|
-
index: page,
|
|
284
|
-
text: page.toString(),
|
|
285
|
-
active: page === +pageIndex
|
|
286
|
-
};
|
|
287
|
-
});
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
let pages = [];
|
|
291
|
-
const marginalCount = this.marginalCount;
|
|
292
|
-
const rangeCount = this.config.rangeCount;
|
|
293
|
-
const maxCount = this.config.maxCount;
|
|
294
|
-
const isMaxSized = pageCount > maxCount;
|
|
295
|
-
if (isMaxSized) {
|
|
296
|
-
const beforePages = [];
|
|
297
|
-
const afterPages = [];
|
|
298
|
-
// mainPages
|
|
299
|
-
let start = Math.ceil(Math.max(marginalCount + 1, pageIndex - (rangeCount - 1) / 2));
|
|
300
|
-
let end = Math.ceil(Math.min(pageIndex + (rangeCount - 1) / 2, pageCount - marginalCount));
|
|
301
|
-
if (pageIndex - 1 < marginalCount) {
|
|
302
|
-
end = rangeCount;
|
|
202
|
+
if (isBoolean(this.thyShowTotalPageCount())) {
|
|
203
|
+
result.showTotalPageCount = this.thyShowTotalPageCount();
|
|
303
204
|
}
|
|
304
|
-
if (
|
|
305
|
-
|
|
205
|
+
if (this.thyCustomPages() && isArray(this.thyCustomPages())) {
|
|
206
|
+
result.showTotalPageCount = false;
|
|
306
207
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
index: i,
|
|
310
|
-
text: i.toString(),
|
|
311
|
-
active: i === +pageIndex
|
|
312
|
-
});
|
|
208
|
+
if (Number.isInteger(this.thyMaxCount())) {
|
|
209
|
+
result.maxCount = this.thyMaxCount();
|
|
313
210
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
beforePages.push(this.makePage(i, i.toString(), i === pageIndex));
|
|
211
|
+
if (isString(this.thyUnit()) && this.thyUnit()) {
|
|
212
|
+
result.unit = this.thyUnit();
|
|
317
213
|
}
|
|
318
|
-
if (
|
|
319
|
-
|
|
214
|
+
if (isBoolean(this.thyShowSizeChanger())) {
|
|
215
|
+
result.showSizeChanger = this.thyShowSizeChanger();
|
|
320
216
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
afterPages.push(this.makePage(Math.ceil((pageCount - marginalCount + 1 + end) / 2), '···', null));
|
|
217
|
+
if (this.thyPageSizeOptions() && isArray(this.thyPageSizeOptions())) {
|
|
218
|
+
result.pageSizeOptions = this.thyPageSizeOptions();
|
|
324
219
|
}
|
|
325
|
-
|
|
326
|
-
|
|
220
|
+
if (Number.isInteger(this.thyRangeCount())) {
|
|
221
|
+
result.rangeCount = this.thyRangeCount();
|
|
327
222
|
}
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
223
|
+
return result;
|
|
224
|
+
});
|
|
225
|
+
this.marginalCount = computed(() => {
|
|
226
|
+
if (!this.thyMarginalCount()) {
|
|
227
|
+
return this.computedConfig().rangeCount <= DEFAULT_RANGE_COUNT ? 1 : 2;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
return this.thyMarginalCount();
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
this.computedPageCount = computed(() => {
|
|
234
|
+
let pageCount = null;
|
|
235
|
+
if (this.thyCustomPages() && this.thyCustomPages().length > 0) {
|
|
236
|
+
pageCount = this.thyCustomPages()[this.thyCustomPages().length - 1];
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
pageCount = this.currentPageSize() < 1 ? 1 : Math.ceil(this.thyTotal() / this.currentPageSize());
|
|
240
|
+
}
|
|
241
|
+
return Math.max(pageCount || 0, 1);
|
|
242
|
+
});
|
|
243
|
+
this.computedPages = computed(() => {
|
|
244
|
+
const pageCount = this.computedPageCount();
|
|
245
|
+
const pageIndex = this.currentPageIndex();
|
|
246
|
+
const config = this.computedConfig();
|
|
247
|
+
if (this.thyCustomPages() && this.thyCustomPages().length > 0) {
|
|
248
|
+
return this.thyCustomPages().map(page => {
|
|
249
|
+
return { index: page, text: page.toString(), active: page === +pageIndex };
|
|
336
250
|
});
|
|
337
251
|
}
|
|
338
|
-
|
|
339
|
-
|
|
252
|
+
let pages = [];
|
|
253
|
+
const marginalCount = this.marginalCount();
|
|
254
|
+
const rangeCount = config.rangeCount;
|
|
255
|
+
const maxCount = config.maxCount;
|
|
256
|
+
const isMaxSized = pageCount > maxCount;
|
|
257
|
+
if (isMaxSized) {
|
|
258
|
+
const beforePages = [];
|
|
259
|
+
const afterPages = [];
|
|
260
|
+
// mainPages
|
|
261
|
+
let start = Math.ceil(Math.max(marginalCount + 1, pageIndex - (rangeCount - 1) / 2));
|
|
262
|
+
let end = Math.ceil(Math.min(pageIndex + (rangeCount - 1) / 2, pageCount - marginalCount));
|
|
263
|
+
if (pageIndex - 1 < marginalCount) {
|
|
264
|
+
end = rangeCount;
|
|
265
|
+
}
|
|
266
|
+
if (pageCount - pageIndex <= marginalCount) {
|
|
267
|
+
start = pageCount - rangeCount + 1;
|
|
268
|
+
}
|
|
269
|
+
for (let i = start; i <= end; i++) {
|
|
270
|
+
pages.push({ index: i, text: i.toString(), active: i === +pageIndex });
|
|
271
|
+
}
|
|
272
|
+
// beforePages
|
|
273
|
+
for (let i = 1; i <= marginalCount; i++) {
|
|
274
|
+
beforePages.push(this.makePage(i, i.toString(), i === pageIndex));
|
|
275
|
+
}
|
|
276
|
+
if (pageIndex - Math.ceil(rangeCount / 2) > this.firstIndex && marginalCount + 1 < start) {
|
|
277
|
+
beforePages.push(this.makePage(Math.ceil((marginalCount + start) / 2), '···', null));
|
|
278
|
+
}
|
|
279
|
+
// afterPages
|
|
280
|
+
if (pageIndex + Math.ceil(rangeCount / 2) < pageCount && pageCount - marginalCount > end) {
|
|
281
|
+
afterPages.push(this.makePage(Math.ceil((pageCount - marginalCount + 1 + end) / 2), '···', null));
|
|
282
|
+
}
|
|
283
|
+
for (let i = pageCount - marginalCount + 1; i <= pageCount; i++) {
|
|
284
|
+
afterPages.push(this.makePage(i, i.toString(), i === pageIndex));
|
|
285
|
+
}
|
|
286
|
+
pages = [...beforePages, ...pages, ...afterPages];
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
for (let i = 1; i <= pageCount; i++) {
|
|
290
|
+
pages.push({ index: i, text: i.toString(), active: i === +pageIndex });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return pages;
|
|
294
|
+
});
|
|
295
|
+
this.computedRange = computed(() => {
|
|
296
|
+
const pageIndex = this.currentPageIndex();
|
|
297
|
+
const pageSize = this.currentPageSize();
|
|
298
|
+
const total = this.thyTotal();
|
|
299
|
+
const toPageSize = pageIndex * pageSize;
|
|
300
|
+
return { from: (pageIndex - 1) * pageSize + 1, to: toPageSize > total ? total : toPageSize };
|
|
301
|
+
});
|
|
302
|
+
effect(() => {
|
|
303
|
+
const pageIndex = this.thyPageIndex();
|
|
304
|
+
if (Number.isInteger(pageIndex)) {
|
|
305
|
+
this.setPageIndex(pageIndex);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
effect(() => {
|
|
309
|
+
let pageSize = this.thyPageSize();
|
|
310
|
+
if (Number.isInteger(pageSize)) {
|
|
311
|
+
this.currentPageSize.set(pageSize);
|
|
312
|
+
this.selectedPageSize.set(pageSize);
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
const config = this.computedConfig();
|
|
316
|
+
if (config.pageSizeOptions && config.pageSizeOptions.length > 0) {
|
|
317
|
+
pageSize = config.pageSizeOptions[0];
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
pageSize = config.pageSize;
|
|
321
|
+
}
|
|
322
|
+
this.currentPageSize.set(pageSize);
|
|
323
|
+
this.selectedPageSize.set(pageSize);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
setPageIndex(pageIndex) {
|
|
328
|
+
pageIndex = pageIndex > this.computedPageCount() ? this.computedPageCount() : pageIndex || 1;
|
|
329
|
+
this.currentPageIndex.set(pageIndex);
|
|
330
|
+
}
|
|
331
|
+
makePage(index, text, active) {
|
|
332
|
+
return { index, text, active };
|
|
340
333
|
}
|
|
341
334
|
pageChange(pageIndex) {
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
335
|
+
this.thyPageIndexChange.emit(pageIndex);
|
|
336
|
+
this.thyPageChanged.emit({ page: pageIndex });
|
|
344
337
|
}
|
|
345
338
|
selectPage(pageIndex) {
|
|
346
|
-
if (this.
|
|
339
|
+
if (this.thyDisabled() || pageIndex === this.firstIndex - 1 || pageIndex === this.computedPageCount() + 1) {
|
|
347
340
|
return;
|
|
348
341
|
}
|
|
349
342
|
this.setPageIndex(pageIndex);
|
|
350
|
-
this.pageChange(this.
|
|
343
|
+
this.pageChange(this.currentPageIndex());
|
|
351
344
|
}
|
|
352
345
|
jumpPage(input) {
|
|
353
346
|
const pageIndex = +input.value;
|
|
@@ -357,13 +350,12 @@ class ThyPagination {
|
|
|
357
350
|
input.value = '';
|
|
358
351
|
}
|
|
359
352
|
onPageSizeChange(event) {
|
|
360
|
-
this.
|
|
361
|
-
this.
|
|
362
|
-
this.
|
|
363
|
-
this.pageSizeChanged.emit(event);
|
|
353
|
+
this.currentPageSize.set(event);
|
|
354
|
+
this.setPageIndex(event);
|
|
355
|
+
this.thyPageSizeChanged.emit(event);
|
|
364
356
|
}
|
|
365
357
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyPagination, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
366
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyPagination, isStandalone: true, selector: "thy-pagination", inputs: { thyPageIndex:
|
|
358
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.8", type: ThyPagination, isStandalone: true, selector: "thy-pagination", inputs: { thyPageIndex: { classPropertyName: "thyPageIndex", publicName: "thyPageIndex", isSignal: true, isRequired: false, transformFunction: null }, thyPageSize: { classPropertyName: "thyPageSize", publicName: "thyPageSize", isSignal: true, isRequired: false, transformFunction: null }, thyTotal: { classPropertyName: "thyTotal", publicName: "thyTotal", isSignal: true, isRequired: false, transformFunction: null }, thyCustomPages: { classPropertyName: "thyCustomPages", publicName: "thyCustomPages", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: true, isRequired: false, transformFunction: null }, thyShowQuickJumper: { classPropertyName: "thyShowQuickJumper", publicName: "thyShowQuickJumper", isSignal: true, isRequired: false, transformFunction: null }, thyShowTotalPageCount: { classPropertyName: "thyShowTotalPageCount", publicName: "thyShowTotalPageCount", isSignal: true, isRequired: false, transformFunction: null }, thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null }, thyMaxCount: { classPropertyName: "thyMaxCount", publicName: "thyMaxCount", isSignal: true, isRequired: false, transformFunction: null }, thyMarginalCount: { classPropertyName: "thyMarginalCount", publicName: "thyMarginalCount", isSignal: true, isRequired: false, transformFunction: null }, thyRangeCount: { classPropertyName: "thyRangeCount", publicName: "thyRangeCount", isSignal: true, isRequired: false, transformFunction: null }, thyShowSizeChanger: { classPropertyName: "thyShowSizeChanger", publicName: "thyShowSizeChanger", isSignal: true, isRequired: false, transformFunction: null }, thyPageSizeOptions: { classPropertyName: "thyPageSizeOptions", publicName: "thyPageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, thyHideOnSinglePage: { classPropertyName: "thyHideOnSinglePage", publicName: "thyHideOnSinglePage", isSignal: true, isRequired: false, transformFunction: null }, thyUnit: { classPropertyName: "thyUnit", publicName: "thyUnit", isSignal: true, isRequired: false, transformFunction: null }, thyShowTotal: { classPropertyName: "thyShowTotal", publicName: "thyShowTotal", isSignal: true, isRequired: false, transformFunction: null }, selectedPageSize: { classPropertyName: "selectedPageSize", publicName: "selectedPageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyPageIndexChange: "thyPageIndexChange", thyPageChanged: "thyPageChanged", thyPageSizeChanged: "thyPageSizeChanged", selectedPageSize: "selectedPageSizeChange" }, host: { properties: { "class.thy-pagination-sm": "thySize() === \"sm\"", "class.thy-pagination-md": "thySize() === \"md\"", "class.thy-pagination-lg": "thySize() === \"lg\"", "class.thy-pagination-has-total": "thyShowTotal()" }, classAttribute: "thy-pagination" }, ngImport: i0, template: "@let locale = paginationLocale();\n@let hideOnSinglePage = thyHideOnSinglePage();\n@let pageIndex = currentPageIndex();\n@let pageSize = currentPageSize();\n@let total = thyTotal();\n@let range = computedRange();\n@let config = computedConfig();\n@let pages = computedPages();\n@let pageCount = computedPageCount();\n@let disabled = thyDisabled();\n@let size = thySize();\n@let showTotal = thyShowTotal();\n\n@if ((hideOnSinglePage && total > pageSize) || !hideOnSinglePage) {\n @if (showTotal) {\n <div\n class=\"thy-pagination-total\"\n [class.thy-pagination-total-sm]=\"size === 'sm'\"\n [class.thy-pagination-total-md]=\"size === 'md'\"\n [class.thy-pagination-total-lg]=\"size === 'lg'\">\n @if (!isTemplateRef(showTotal)) {\n @if (total > 0) {\n <div class=\"mr-3\">\n {{ locale.order }}<span class=\"number\"> {{ range.from }}-{{ range.to }} </span>{{ config.unit }}\n </div>\n <div>\n {{ locale.total }}<span class=\"number\"> {{ total }} </span>{{ config.unit }}\n </div>\n }\n } @else {\n <ng-template [ngTemplateOutlet]=\"showTotal\" [ngTemplateOutletContext]=\"{ $implicit: total, range: range }\"></ng-template>\n }\n </div>\n }\n <div class=\"thy-pagination-content\">\n @if (config.showSizeChanger) {\n <div class=\"thy-pagination-size\">\n <thy-select [(ngModel)]=\"selectedPageSize\" [thySize]=\"size\" [thyDisabled]=\"disabled\" (ngModelChange)=\"onPageSizeChange($event)\">\n @for (option of config.pageSizeOptions; track option) {\n <thy-option\n class=\"page-size-option\"\n [thyValue]=\"option\"\n [thyLabelText]=\"option + (config.unit | paginationPerPageFormat: allLocale())\"></thy-option>\n }\n </thy-select>\n </div>\n }\n <ul class=\"thy-pagination-pages\">\n @if (config.boundaryLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === firstIndex\" (click)=\"selectPage(firstIndex)\">\n <a class=\"thy-page-link thy-page-link-first\" href=\"javascript:;\">\n @if (config.firstText) {\n {{ config.firstText }}\n }\n @if (config.firstIcon) {\n <thy-icon [thyIconName]=\"config.firstIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @if (config.directionLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === firstIndex\" (click)=\"selectPage(pageIndex - 1)\">\n <a class=\"thy-page-link page-link-pre\" href=\"javascript:;\">\n @if (config.previousText) {\n {{ config.previousText }}\n }\n @if (config.previousIcon) {\n <thy-icon [thyIconName]=\"config.previousIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @for (page of pages; track page.index) {\n <li class=\"thy-page-item thy-page-number\" [class.active]=\"page.active\" [class.disabled]=\"disabled\" (click)=\"selectPage(page.index)\">\n <a class=\"thy-page-link\" href=\"javascript:;\">{{ page.text }}</a>\n </li>\n }\n @if (config.directionLinks) {\n <li class=\"thy-page-item page-item-next\" [class.disabled]=\"disabled || pageIndex === pageCount\" (click)=\"selectPage(pageIndex + 1)\">\n <a class=\"thy-page-link thy-page-link-next\" href=\"javascript:;\">\n @if (config.nextText) {\n {{ config.nextText }}\n }\n @if (config.nextIcon) {\n <thy-icon [thyIconName]=\"config.nextIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @if (config.boundaryLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === pageCount\" (click)=\"selectPage(pageCount)\">\n <a class=\"thy-page-link thy-page-link-last\" href=\"javascript:;\">\n @if (config.lastText) {\n {{ config.lastText }}\n }\n @if (config.lastIcon) {\n <thy-icon [thyIconName]=\"config.lastIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n </ul>\n @if (config.showTotalPageCount && config.totalPagesFormat) {\n <div class=\"thy-pagination-count\" [innerHTML]=\"pageCount | paginationTotalPagesFormat: config.totalPagesFormat\"></div>\n }\n @if (config.showQuickJumper) {\n <div class=\"thy-pagination-jumper\">\n <div class=\"thy-pagination-jumper-input\">\n {{ locale.jumpTo }}\n <input type=\"text\" [disabled]=\"disabled\" #jumperInput (thyEnter)=\"jumpPage(jumperInput)\" (blur)=\"jumpPage(jumperInput)\" />\n {{ locale.page }}\n </div>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyEnterDirective, selector: "[thyEnter]", outputs: ["thyEnter"] }, { kind: "pipe", type: PaginationTotalCountFormat, name: "paginationTotalPagesFormat" }, { kind: "pipe", type: PaginationPerPageFormat, name: "paginationPerPageFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
367
359
|
}
|
|
368
360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyPagination, decorators: [{
|
|
369
361
|
type: Component,
|
|
@@ -376,70 +368,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
376
368
|
ThyEnterDirective,
|
|
377
369
|
PaginationTotalCountFormat,
|
|
378
370
|
PaginationPerPageFormat
|
|
379
|
-
],
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
type: Input,
|
|
388
|
-
args: [{ transform: numberAttribute }]
|
|
389
|
-
}], thyCustomPages: [{
|
|
390
|
-
type: Input
|
|
391
|
-
}], disabled: [{
|
|
392
|
-
type: Input,
|
|
393
|
-
args: [{ alias: 'thyDisabled', transform: coerceBooleanProperty }]
|
|
394
|
-
}], showQuickJumper: [{
|
|
395
|
-
type: Input,
|
|
396
|
-
args: [{ alias: 'thyShowQuickJumper', transform: coerceBooleanProperty }]
|
|
397
|
-
}], showTotalPageCount: [{
|
|
398
|
-
type: Input,
|
|
399
|
-
args: [{ alias: 'thyShowTotalPageCount', transform: coerceBooleanProperty }]
|
|
400
|
-
}], size: [{
|
|
401
|
-
type: Input,
|
|
402
|
-
args: ['thySize']
|
|
403
|
-
}], maxCount: [{
|
|
404
|
-
type: Input,
|
|
405
|
-
args: [{ alias: 'thyMaxCount', transform: numberAttribute }]
|
|
406
|
-
}], marginalCount: [{
|
|
407
|
-
type: Input,
|
|
408
|
-
args: [{ alias: 'thyMarginalCount', transform: numberAttribute }]
|
|
409
|
-
}], thyRangeCount: [{
|
|
410
|
-
type: Input,
|
|
411
|
-
args: [{ transform: numberAttribute }]
|
|
412
|
-
}], showSizeChanger: [{
|
|
413
|
-
type: Input,
|
|
414
|
-
args: [{ alias: 'thyShowSizeChanger', transform: coerceBooleanProperty }]
|
|
415
|
-
}], pageSizeOptions: [{
|
|
416
|
-
type: Input,
|
|
417
|
-
args: ['thyPageSizeOptions']
|
|
418
|
-
}], hideOnSinglePage: [{
|
|
419
|
-
type: Input,
|
|
420
|
-
args: [{ alias: 'thyHideOnSinglePage', transform: coerceBooleanProperty }]
|
|
421
|
-
}], unit: [{
|
|
422
|
-
type: Input,
|
|
423
|
-
args: ['thyUnit']
|
|
424
|
-
}], pageIndexChange: [{
|
|
425
|
-
type: Output,
|
|
426
|
-
args: ['thyPageIndexChange']
|
|
427
|
-
}], pageChanged: [{
|
|
428
|
-
type: Output,
|
|
429
|
-
args: ['thyPageChanged']
|
|
430
|
-
}], pageSizeChanged: [{
|
|
431
|
-
type: Output,
|
|
432
|
-
args: ['thyPageSizeChanged']
|
|
433
|
-
}], isPaginationClass: [{
|
|
434
|
-
type: HostBinding,
|
|
435
|
-
args: ['class.thy-pagination']
|
|
436
|
-
}], showTotal: [{
|
|
437
|
-
type: HostBinding,
|
|
438
|
-
args: ['class.thy-pagination-has-total']
|
|
439
|
-
}, {
|
|
440
|
-
type: Input,
|
|
441
|
-
args: ['thyShowTotal']
|
|
442
|
-
}] } });
|
|
371
|
+
], host: {
|
|
372
|
+
class: 'thy-pagination',
|
|
373
|
+
'[class.thy-pagination-sm]': 'thySize() === "sm"',
|
|
374
|
+
'[class.thy-pagination-md]': 'thySize() === "md"',
|
|
375
|
+
'[class.thy-pagination-lg]': 'thySize() === "lg"',
|
|
376
|
+
'[class.thy-pagination-has-total]': 'thyShowTotal()'
|
|
377
|
+
}, template: "@let locale = paginationLocale();\n@let hideOnSinglePage = thyHideOnSinglePage();\n@let pageIndex = currentPageIndex();\n@let pageSize = currentPageSize();\n@let total = thyTotal();\n@let range = computedRange();\n@let config = computedConfig();\n@let pages = computedPages();\n@let pageCount = computedPageCount();\n@let disabled = thyDisabled();\n@let size = thySize();\n@let showTotal = thyShowTotal();\n\n@if ((hideOnSinglePage && total > pageSize) || !hideOnSinglePage) {\n @if (showTotal) {\n <div\n class=\"thy-pagination-total\"\n [class.thy-pagination-total-sm]=\"size === 'sm'\"\n [class.thy-pagination-total-md]=\"size === 'md'\"\n [class.thy-pagination-total-lg]=\"size === 'lg'\">\n @if (!isTemplateRef(showTotal)) {\n @if (total > 0) {\n <div class=\"mr-3\">\n {{ locale.order }}<span class=\"number\"> {{ range.from }}-{{ range.to }} </span>{{ config.unit }}\n </div>\n <div>\n {{ locale.total }}<span class=\"number\"> {{ total }} </span>{{ config.unit }}\n </div>\n }\n } @else {\n <ng-template [ngTemplateOutlet]=\"showTotal\" [ngTemplateOutletContext]=\"{ $implicit: total, range: range }\"></ng-template>\n }\n </div>\n }\n <div class=\"thy-pagination-content\">\n @if (config.showSizeChanger) {\n <div class=\"thy-pagination-size\">\n <thy-select [(ngModel)]=\"selectedPageSize\" [thySize]=\"size\" [thyDisabled]=\"disabled\" (ngModelChange)=\"onPageSizeChange($event)\">\n @for (option of config.pageSizeOptions; track option) {\n <thy-option\n class=\"page-size-option\"\n [thyValue]=\"option\"\n [thyLabelText]=\"option + (config.unit | paginationPerPageFormat: allLocale())\"></thy-option>\n }\n </thy-select>\n </div>\n }\n <ul class=\"thy-pagination-pages\">\n @if (config.boundaryLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === firstIndex\" (click)=\"selectPage(firstIndex)\">\n <a class=\"thy-page-link thy-page-link-first\" href=\"javascript:;\">\n @if (config.firstText) {\n {{ config.firstText }}\n }\n @if (config.firstIcon) {\n <thy-icon [thyIconName]=\"config.firstIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @if (config.directionLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === firstIndex\" (click)=\"selectPage(pageIndex - 1)\">\n <a class=\"thy-page-link page-link-pre\" href=\"javascript:;\">\n @if (config.previousText) {\n {{ config.previousText }}\n }\n @if (config.previousIcon) {\n <thy-icon [thyIconName]=\"config.previousIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @for (page of pages; track page.index) {\n <li class=\"thy-page-item thy-page-number\" [class.active]=\"page.active\" [class.disabled]=\"disabled\" (click)=\"selectPage(page.index)\">\n <a class=\"thy-page-link\" href=\"javascript:;\">{{ page.text }}</a>\n </li>\n }\n @if (config.directionLinks) {\n <li class=\"thy-page-item page-item-next\" [class.disabled]=\"disabled || pageIndex === pageCount\" (click)=\"selectPage(pageIndex + 1)\">\n <a class=\"thy-page-link thy-page-link-next\" href=\"javascript:;\">\n @if (config.nextText) {\n {{ config.nextText }}\n }\n @if (config.nextIcon) {\n <thy-icon [thyIconName]=\"config.nextIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n @if (config.boundaryLinks) {\n <li class=\"thy-page-item\" [class.disabled]=\"disabled || pageIndex === pageCount\" (click)=\"selectPage(pageCount)\">\n <a class=\"thy-page-link thy-page-link-last\" href=\"javascript:;\">\n @if (config.lastText) {\n {{ config.lastText }}\n }\n @if (config.lastIcon) {\n <thy-icon [thyIconName]=\"config.lastIcon\"></thy-icon>\n }\n </a>\n </li>\n }\n </ul>\n @if (config.showTotalPageCount && config.totalPagesFormat) {\n <div class=\"thy-pagination-count\" [innerHTML]=\"pageCount | paginationTotalPagesFormat: config.totalPagesFormat\"></div>\n }\n @if (config.showQuickJumper) {\n <div class=\"thy-pagination-jumper\">\n <div class=\"thy-pagination-jumper-input\">\n {{ locale.jumpTo }}\n <input type=\"text\" [disabled]=\"disabled\" #jumperInput (thyEnter)=\"jumpPage(jumperInput)\" (blur)=\"jumpPage(jumperInput)\" />\n {{ locale.page }}\n </div>\n </div>\n }\n </div>\n}\n" }]
|
|
378
|
+
}], ctorParameters: () => [] });
|
|
443
379
|
|
|
444
380
|
class ThyPaginationModule {
|
|
445
381
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ThyPaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|