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.
Files changed (280) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/action/action.component.d.ts +12 -20
  3. package/action/actions.component.d.ts +5 -7
  4. package/affix/affix.component.d.ts +7 -10
  5. package/alert/alert.component.d.ts +1 -1
  6. package/anchor/anchor-link.component.d.ts +8 -8
  7. package/anchor/anchor.component.d.ts +15 -21
  8. package/arrow-switcher/arrow-switcher.component.d.ts +15 -22
  9. package/autocomplete/autocomplete.component.d.ts +10 -17
  10. package/autocomplete/autocomplete.trigger.directive.d.ts +10 -18
  11. package/avatar/avatar-list/avatar-list.component.d.ts +8 -14
  12. package/avatar/avatar.component.d.ts +25 -39
  13. package/back-top/back-top.component.d.ts +9 -12
  14. package/badge/badge.component.d.ts +19 -59
  15. package/breadcrumb/breadcrumb.component.d.ts +15 -20
  16. package/button/button-icon.component.d.ts +3 -2
  17. package/button/button.component.d.ts +3 -2
  18. package/calendar/calendar-header.component.d.ts +9 -8
  19. package/calendar/calendar.component.d.ts +16 -16
  20. package/card/card.component.d.ts +5 -11
  21. package/card/content.component.d.ts +3 -8
  22. package/card/header.component.d.ts +7 -8
  23. package/carousel/carousel.component.d.ts +22 -27
  24. package/cascader/cascader-li.component.d.ts +13 -21
  25. package/cascader/cascader-search-option.component.d.ts +8 -16
  26. package/cascader/cascader.component.d.ts +58 -80
  27. package/checkbox/checkbox.component.d.ts +2 -5
  28. package/collapse/collapse-item.component.d.ts +12 -19
  29. package/collapse/collapse.component.d.ts +6 -12
  30. package/collapse/collapse.token.d.ts +3 -3
  31. package/color-picker/color-picker-custom-panel.component.d.ts +5 -5
  32. package/color-picker/color-picker-panel.component.d.ts +7 -11
  33. package/color-picker/color-picker.component.d.ts +19 -35
  34. package/color-picker/parts/alpha/alpha.component.d.ts +8 -8
  35. package/color-picker/parts/hue/hue.component.d.ts +6 -6
  36. package/color-picker/parts/indicator/indicator.component.d.ts +4 -3
  37. package/color-picker/parts/inputs/inputs.component.d.ts +9 -9
  38. package/color-picker/parts/saturation/saturation.component.d.ts +9 -9
  39. package/comment/comment.component.d.ts +4 -5
  40. package/copy/copy.directive.d.ts +8 -9
  41. package/date-picker/abstract-picker.component.d.ts +8 -7
  42. package/date-picker/lib/calendar/calendar-footer.component.d.ts +2 -1
  43. package/date-picker/lib/popups/inner-popup.component.d.ts +2 -1
  44. package/date-picker/picker.component.d.ts +2 -1
  45. package/date-range/date-range.component.d.ts +2 -2
  46. package/dialog/body/dialog-body.component.d.ts +2 -6
  47. package/dialog/confirm/confirm.component.d.ts +2 -2
  48. package/dialog/footer/dialog-footer.component.d.ts +6 -9
  49. package/dialog/header/dialog-header.component.d.ts +9 -11
  50. package/divider/divider.component.d.ts +12 -16
  51. package/dot/dot.component.d.ts +5 -13
  52. package/drag-drop/drag-handle.directive.d.ts +2 -1
  53. package/drag-drop/drag.directive.d.ts +2 -1
  54. package/drag-drop/drop-container.directive.d.ts +2 -1
  55. package/dropdown/dropdown-menu-item.directive.d.ts +3 -2
  56. package/dropdown/dropdown-menu.component.d.ts +2 -1
  57. package/dropdown/dropdown.directive.d.ts +2 -1
  58. package/empty/empty.component.d.ts +21 -27
  59. package/fesm2022/ngx-tethys-action.mjs +54 -91
  60. package/fesm2022/ngx-tethys-action.mjs.map +1 -1
  61. package/fesm2022/ngx-tethys-affix.mjs +29 -26
  62. package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
  63. package/fesm2022/ngx-tethys-anchor.mjs +91 -118
  64. package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
  65. package/fesm2022/ngx-tethys-arrow-switcher.mjs +51 -77
  66. package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
  67. package/fesm2022/ngx-tethys-autocomplete.mjs +69 -103
  68. package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
  69. package/fesm2022/ngx-tethys-avatar.mjs +117 -162
  70. package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
  71. package/fesm2022/ngx-tethys-back-top.mjs +33 -46
  72. package/fesm2022/ngx-tethys-back-top.mjs.map +1 -1
  73. package/fesm2022/ngx-tethys-badge.mjs +104 -208
  74. package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
  75. package/fesm2022/ngx-tethys-breadcrumb.mjs +66 -70
  76. package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
  77. package/fesm2022/ngx-tethys-calendar.mjs +85 -87
  78. package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
  79. package/fesm2022/ngx-tethys-card.mjs +72 -77
  80. package/fesm2022/ngx-tethys-card.mjs.map +1 -1
  81. package/fesm2022/ngx-tethys-carousel.mjs +82 -99
  82. package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
  83. package/fesm2022/ngx-tethys-cascader.mjs +313 -468
  84. package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
  85. package/fesm2022/ngx-tethys-checkbox.mjs +10 -17
  86. package/fesm2022/ngx-tethys-checkbox.mjs.map +1 -1
  87. package/fesm2022/ngx-tethys-collapse.mjs +66 -71
  88. package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
  89. package/fesm2022/ngx-tethys-color-picker.mjs +187 -246
  90. package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
  91. package/fesm2022/ngx-tethys-comment.mjs +16 -10
  92. package/fesm2022/ngx-tethys-comment.mjs.map +1 -1
  93. package/fesm2022/ngx-tethys-copy.mjs +25 -28
  94. package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
  95. package/fesm2022/ngx-tethys-dialog.mjs +81 -82
  96. package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
  97. package/fesm2022/ngx-tethys-divider.mjs +49 -58
  98. package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
  99. package/fesm2022/ngx-tethys-dot.mjs +45 -68
  100. package/fesm2022/ngx-tethys-dot.mjs.map +1 -1
  101. package/fesm2022/ngx-tethys-empty.mjs +107 -95
  102. package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
  103. package/fesm2022/ngx-tethys-form.mjs +161 -200
  104. package/fesm2022/ngx-tethys-form.mjs.map +1 -1
  105. package/fesm2022/ngx-tethys-fullscreen.mjs +21 -23
  106. package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
  107. package/fesm2022/ngx-tethys-grid.mjs +160 -152
  108. package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
  109. package/fesm2022/ngx-tethys-i18n.mjs +25 -25
  110. package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
  111. package/fesm2022/ngx-tethys-input-number.mjs +101 -114
  112. package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
  113. package/fesm2022/ngx-tethys-input.mjs +268 -271
  114. package/fesm2022/ngx-tethys-input.mjs.map +1 -1
  115. package/fesm2022/ngx-tethys-list.mjs +1 -1
  116. package/fesm2022/ngx-tethys-list.mjs.map +1 -1
  117. package/fesm2022/ngx-tethys-loading.mjs +17 -35
  118. package/fesm2022/ngx-tethys-loading.mjs.map +1 -1
  119. package/fesm2022/ngx-tethys-mention.mjs +52 -74
  120. package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
  121. package/fesm2022/ngx-tethys-menu.mjs +106 -179
  122. package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
  123. package/fesm2022/ngx-tethys-nav.mjs +169 -201
  124. package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
  125. package/fesm2022/ngx-tethys-pagination.mjs +230 -294
  126. package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
  127. package/fesm2022/ngx-tethys-popover.mjs +67 -70
  128. package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
  129. package/fesm2022/ngx-tethys-progress.mjs +196 -244
  130. package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
  131. package/fesm2022/ngx-tethys-property.mjs +102 -105
  132. package/fesm2022/ngx-tethys-property.mjs.map +1 -1
  133. package/fesm2022/ngx-tethys-radio.mjs +34 -38
  134. package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
  135. package/fesm2022/ngx-tethys-result.mjs +46 -28
  136. package/fesm2022/ngx-tethys-result.mjs.map +1 -1
  137. package/fesm2022/ngx-tethys-skeleton.mjs +339 -342
  138. package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
  139. package/fesm2022/ngx-tethys-slider.mjs +75 -108
  140. package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
  141. package/fesm2022/ngx-tethys-space.mjs +26 -46
  142. package/fesm2022/ngx-tethys-space.mjs.map +1 -1
  143. package/fesm2022/ngx-tethys-statistic.mjs +114 -151
  144. package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
  145. package/fesm2022/ngx-tethys-stepper.mjs +74 -107
  146. package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
  147. package/fesm2022/ngx-tethys-switch.mjs +80 -140
  148. package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
  149. package/fesm2022/ngx-tethys-table.mjs +1 -1
  150. package/fesm2022/ngx-tethys-table.mjs.map +1 -1
  151. package/fesm2022/ngx-tethys-tabs.mjs +69 -87
  152. package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
  153. package/fesm2022/ngx-tethys-tag.mjs +42 -64
  154. package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
  155. package/fesm2022/ngx-tethys-timeline.mjs +104 -129
  156. package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
  157. package/fesm2022/ngx-tethys-typography.mjs +36 -33
  158. package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
  159. package/fesm2022/ngx-tethys-upload.mjs +91 -130
  160. package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
  161. package/fesm2022/ngx-tethys-util.mjs.map +1 -1
  162. package/fesm2022/ngx-tethys-watermark.mjs +36 -40
  163. package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
  164. package/fesm2022/ngx-tethys.mjs +1 -1
  165. package/fesm2022/ngx-tethys.mjs.map +1 -1
  166. package/form/form-group-error/form-group-error.component.d.ts +2 -3
  167. package/form/form-group-label.directive.d.ts +2 -1
  168. package/form/form-group.component.d.ts +17 -24
  169. package/form/form-submit.directive.d.ts +2 -2
  170. package/form/form.directive.d.ts +6 -8
  171. package/form/from-group-footer/form-group-footer.component.d.ts +2 -2
  172. package/form/validator/confirm-validator.directive.d.ts +2 -2
  173. package/form/validator/unique-validator.directive.d.ts +2 -2
  174. package/fullscreen/fullscreen.component.d.ts +7 -7
  175. package/grid/flex.d.ts +14 -19
  176. package/grid/thy-col.directive.d.ts +6 -9
  177. package/grid/thy-grid-item.component.d.ts +3 -4
  178. package/grid/thy-grid.component.d.ts +11 -12
  179. package/grid/thy-row.directive.d.ts +12 -12
  180. package/icon/icon.component.d.ts +3 -2
  181. package/image/image.directive.d.ts +3 -2
  182. package/input/input-count.component.d.ts +4 -5
  183. package/input/input-group.component.d.ts +20 -20
  184. package/input/input-search.component.d.ts +15 -20
  185. package/input/input.component.d.ts +20 -21
  186. package/input/input.directive.d.ts +4 -6
  187. package/input-number/input-number.component.d.ts +21 -29
  188. package/layout/header.component.d.ts +4 -9
  189. package/layout/sidebar-header.component.d.ts +2 -1
  190. package/layout/sidebar.component.d.ts +8 -7
  191. package/list/list.component.d.ts +2 -1
  192. package/list/selection/selection-list.d.ts +4 -3
  193. package/loading/loading.component.d.ts +4 -10
  194. package/mention/mention.directive.d.ts +6 -7
  195. package/mention/suggestions/suggestions.component.d.ts +8 -9
  196. package/menu/group/menu-group.component.d.ts +16 -33
  197. package/menu/item/action/menu-item-action.component.d.ts +7 -8
  198. package/menu/item/icon/menu-item-icon.component.d.ts +2 -2
  199. package/menu/item/menu-item.component.d.ts +4 -4
  200. package/menu/item/name/menu-item-name.component.d.ts +2 -3
  201. package/menu/menu.component.d.ts +3 -7
  202. package/nav/icon-nav/icon-nav-link.directive.d.ts +3 -7
  203. package/nav/icon-nav/icon-nav.component.d.ts +3 -8
  204. package/nav/nav-ink-bar.directive.d.ts +4 -6
  205. package/nav/nav-item.directive.d.ts +7 -10
  206. package/nav/nav.component.d.ts +20 -48
  207. package/package.json +1 -1
  208. package/pagination/pagination.component.d.ts +48 -109
  209. package/popover/header/popover-header.component.d.ts +7 -6
  210. package/popover/popover.directive.d.ts +11 -18
  211. package/progress/progress-circle.component.d.ts +32 -21
  212. package/progress/progress-strip.component.d.ts +10 -14
  213. package/progress/progress.component.d.ts +15 -23
  214. package/property/examples/single/single.component.scss +6 -0
  215. package/property/properties.component.d.ts +6 -13
  216. package/property/property-item.component.d.ts +21 -26
  217. package/property/styles/properties.scss +124 -52
  218. package/property-operation/property-operation.component.d.ts +6 -5
  219. package/radio/button/radio-button.component.d.ts +2 -2
  220. package/radio/group/radio-group.component.d.ts +8 -7
  221. package/radio/radio.component.d.ts +2 -2
  222. package/radio/radio.token.d.ts +2 -2
  223. package/rate/rate-item.component.d.ts +2 -1
  224. package/rate/rate.component.d.ts +4 -3
  225. package/resizable/resizable.directive.d.ts +4 -9
  226. package/resizable/resize-handle.component.d.ts +2 -1
  227. package/resizable/resize-handles.component.d.ts +2 -1
  228. package/result/result.component.d.ts +9 -10
  229. package/schematics/version.d.ts +1 -1
  230. package/schematics/version.js +1 -1
  231. package/segment/segment-item.component.d.ts +2 -1
  232. package/segment/segment.component.d.ts +2 -1
  233. package/select/custom-select/custom-select.component.d.ts +11 -10
  234. package/select/native-select/native-select.component.d.ts +2 -1
  235. package/shared/base-form-check.component.d.ts +3 -2
  236. package/shared/directives/thy-autofocus.directive.d.ts +3 -2
  237. package/shared/directives/thy-scroll.directive.d.ts +2 -1
  238. package/shared/directives/thy-show.d.ts +2 -1
  239. package/shared/option/group/option-group.component.d.ts +2 -1
  240. package/shared/option/list-option/list-option.component.d.ts +2 -7
  241. package/shared/option/option.component.d.ts +2 -1
  242. package/shared/select/select-control/select-control.component.d.ts +7 -6
  243. package/skeleton/skeleton-circle.component.d.ts +16 -19
  244. package/skeleton/skeleton-rectangle.component.d.ts +20 -23
  245. package/skeleton/skeleton.component.d.ts +5 -6
  246. package/skeleton/stylized/bullet-list.component.d.ts +11 -13
  247. package/skeleton/stylized/list.component.d.ts +10 -12
  248. package/skeleton/stylized/paragraph.component.d.ts +12 -14
  249. package/slide/slide-body/slide-body-section.component.d.ts +2 -1
  250. package/slider/slider.component.d.ts +17 -24
  251. package/space/space.component.d.ts +8 -8
  252. package/statistic/statistic.component.d.ts +35 -40
  253. package/stepper/step-header.component.d.ts +6 -10
  254. package/stepper/step.component.d.ts +6 -6
  255. package/stepper/stepper.component.d.ts +15 -20
  256. package/switch/switch.component.d.ts +24 -35
  257. package/table/table-column.component.d.ts +6 -5
  258. package/table/table-skeleton.component.d.ts +3 -10
  259. package/table/table.component.d.ts +11 -10
  260. package/tabs/tab-content.component.d.ts +4 -4
  261. package/tabs/tab.component.d.ts +4 -5
  262. package/tabs/tabs.component.d.ts +13 -15
  263. package/tag/tag.component.d.ts +10 -16
  264. package/time-picker/time-picker-panel.component.d.ts +3 -2
  265. package/time-picker/time-picker.component.d.ts +6 -5
  266. package/timeline/timeline-item.component.d.ts +9 -13
  267. package/timeline/timeline.component.d.ts +13 -17
  268. package/tooltip/tooltip.directive.d.ts +3 -2
  269. package/tree/tree-node.component.d.ts +6 -15
  270. package/tree/tree.component.d.ts +8 -7
  271. package/tree-select/tree-select.component.d.ts +8 -7
  272. package/typography/bg-color.directive.d.ts +3 -3
  273. package/typography/text/text.component.d.ts +2 -2
  274. package/typography/text-color.directive.d.ts +3 -3
  275. package/upload/file-drop.directive.d.ts +9 -11
  276. package/upload/file-select-base.d.ts +6 -10
  277. package/upload/file-select.component.d.ts +10 -20
  278. package/util/helpers/helpers.d.ts +2 -1
  279. package/vote/vote.component.d.ts +4 -3
  280. 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, ChangeDetectorRef, EventEmitter, numberAttribute, HostBinding, Input, Output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
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.locale = injectLocale('pagination');
99
+ this.paginationLocale = injectLocale('pagination');
102
100
  this.isTemplateRef = isTemplateRef;
103
- this.config = Object.assign({}, PaginationDefaultConfig, {
104
- firstText: this.locale().firstPage,
105
- lastText: this.locale().lastPage,
106
- totalPagesFormat: this.locale().totalCount,
107
- unit: this.locale().defaultUnit
108
- }, this.paginationConfig.main);
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.disabled = false;
123
+ this.thyDisabled = input(false, { transform: coerceBooleanProperty });
113
124
  /**
114
- * 页码改变的回调
125
+ * 是否显示快速跳转
126
+ * @default false
115
127
  */
116
- this.pageIndexChange = new EventEmitter();
128
+ this.thyShowQuickJumper = input(undefined, { transform: coerceBooleanProperty });
117
129
  /**
118
- * 与Bootstrap pagination 兼容,后续版本会进行删除,参数保持与 bootstrap 一致
130
+ * 设置是否显示总页数信息
131
+ * @default true
119
132
  */
120
- this.pageChanged = new EventEmitter();
121
- this.pageSizeChanged = new EventEmitter();
122
- this.pages = [];
123
- this.pageIndex = 1;
124
- this.range = { from: 0, to: 0 };
125
- this.firstIndex = 1;
126
- this.isHideOnSinglePage = false;
127
- this.initialized = false;
128
- this.hostRenderer = useHostRenderer();
129
- this.selectSize = 'md';
130
- this.selectPageSize = 20;
131
- this.isPaginationClass = true;
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.showTotal = false;
137
- }
138
- /**
139
- * 设置当前页,支持双向绑定
140
- * @default 1
141
- */
142
- set thyPageIndex(pageIndex) {
143
- this.pageIndex = pageIndex;
144
- if (this.initialized) {
145
- this.setPageIndex(pageIndex);
146
- }
147
- }
148
- /**
149
- * 每页条目数量
150
- * @default 20
151
- */
152
- set thyPageSize(pageSize) {
153
- this.pageSize = pageSize;
154
- this.selectPageSize = pageSize;
155
- if (this.initialized) {
156
- this.calculatePageCount();
157
- this.initializePages(this.pageIndex, this.pageCount);
158
- this.cdr.markForCheck();
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 (pageCount - pageIndex <= marginalCount) {
305
- start = pageCount - rangeCount + 1;
205
+ if (this.thyCustomPages() && isArray(this.thyCustomPages())) {
206
+ result.showTotalPageCount = false;
306
207
  }
307
- for (let i = start; i <= end; i++) {
308
- pages.push({
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
- // beforePages
315
- for (let i = 1; i <= marginalCount; i++) {
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 (pageIndex - Math.ceil(rangeCount / 2) > this.firstIndex && marginalCount + 1 < start) {
319
- beforePages.push(this.makePage(Math.ceil((marginalCount + start) / 2), '···', null));
214
+ if (isBoolean(this.thyShowSizeChanger())) {
215
+ result.showSizeChanger = this.thyShowSizeChanger();
320
216
  }
321
- // afterPages
322
- if (pageIndex + Math.ceil(rangeCount / 2) < pageCount && pageCount - marginalCount > end) {
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
- for (let i = pageCount - marginalCount + 1; i <= pageCount; i++) {
326
- afterPages.push(this.makePage(i, i.toString(), i === pageIndex));
220
+ if (Number.isInteger(this.thyRangeCount())) {
221
+ result.rangeCount = this.thyRangeCount();
327
222
  }
328
- pages = [...beforePages, ...pages, ...afterPages];
329
- }
330
- else {
331
- for (let i = 1; i <= pageCount; i++) {
332
- pages.push({
333
- index: i,
334
- text: i.toString(),
335
- active: i === +pageIndex
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
- this.pages = pages;
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.pageIndexChange.emit(pageIndex);
343
- this.pageChanged.emit({ page: pageIndex });
335
+ this.thyPageIndexChange.emit(pageIndex);
336
+ this.thyPageChanged.emit({ page: pageIndex });
344
337
  }
345
338
  selectPage(pageIndex) {
346
- if (this.disabled || pageIndex === this.firstIndex - 1 || pageIndex === this.pageCount + 1) {
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.pageIndex);
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.pageSize = event;
361
- this.calculatePageCount();
362
- this.setPageIndex(this.pageIndex);
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: ["thyPageIndex", "thyPageIndex", numberAttribute], thyPageSize: ["thyPageSize", "thyPageSize", numberAttribute], thyTotal: ["thyTotal", "thyTotal", numberAttribute], thyCustomPages: "thyCustomPages", disabled: ["thyDisabled", "disabled", coerceBooleanProperty], showQuickJumper: ["thyShowQuickJumper", "showQuickJumper", coerceBooleanProperty], showTotalPageCount: ["thyShowTotalPageCount", "showTotalPageCount", coerceBooleanProperty], size: ["thySize", "size"], maxCount: ["thyMaxCount", "maxCount", numberAttribute], marginalCount: ["thyMarginalCount", "marginalCount", numberAttribute], thyRangeCount: ["thyRangeCount", "thyRangeCount", numberAttribute], showSizeChanger: ["thyShowSizeChanger", "showSizeChanger", coerceBooleanProperty], pageSizeOptions: ["thyPageSizeOptions", "pageSizeOptions"], hideOnSinglePage: ["thyHideOnSinglePage", "hideOnSinglePage", coerceBooleanProperty], unit: ["thyUnit", "unit"], showTotal: ["thyShowTotal", "showTotal"] }, outputs: { pageIndexChange: "thyPageIndexChange", pageChanged: "thyPageChanged", pageSizeChanged: "thyPageSizeChanged" }, host: { properties: { "class.thy-pagination": "this.isPaginationClass", "class.thy-pagination-has-total": "this.showTotal" } }, ngImport: i0, template: "@if ((hideOnSinglePage && total > pageSize) || !hideOnSinglePage) {\n @if (showTotal) {\n <div class=\"thy-pagination-total\">\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)]=\"selectPageSize\" [thySize]=\"selectSize\" [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 }); }
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
- ], template: "@if ((hideOnSinglePage && total > pageSize) || !hideOnSinglePage) {\n @if (showTotal) {\n <div class=\"thy-pagination-total\">\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)]=\"selectPageSize\" [thySize]=\"selectSize\" [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" }]
380
- }], propDecorators: { thyPageIndex: [{
381
- type: Input,
382
- args: [{ transform: numberAttribute }]
383
- }], thyPageSize: [{
384
- type: Input,
385
- args: [{ transform: numberAttribute }]
386
- }], thyTotal: [{
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 }); }