@sankhyalabs/ezui 7.2.0-dev.2 → 7.2.0-dev.4

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 (231) hide show
  1. package/dist/cjs/{ApplicationUtils-006ca96f.js → ApplicationUtils-dc653b57.js} +1 -1
  2. package/dist/cjs/{app-globals-5cb12916.js → app-globals-16ec1ff7.js} +1 -1
  3. package/dist/cjs/classic-search-list_7.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-classic-combo-box.cjs.entry.js +2 -1
  9. package/dist/cjs/ez-classic-date-input.cjs.entry.js +2 -2
  10. package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-classic-number-input.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-classic-search-plus.cjs.entry.js +4 -4
  13. package/dist/cjs/ez-classic-search.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-classic-time-input.cjs.entry.js +4 -3
  15. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  16. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  17. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-empty-card.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  26. package/dist/cjs/ez-grid-pagination.cjs.entry.js +227 -0
  27. package/dist/cjs/ez-grid.cjs.entry.js +20 -148
  28. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-popover-core.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-record-navigation.cjs.entry.js +121 -0
  40. package/dist/cjs/ez-scroller_2.cjs.entry.js +81 -14
  41. package/dist/cjs/ez-search-plus.cjs.entry.js +4 -4
  42. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-search.cjs.entry.js +3 -3
  44. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  47. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  48. package/dist/cjs/ez-split-button.cjs.entry.js +4 -4
  49. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  50. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  51. package/dist/cjs/ez-tooltip.cjs.entry.js +1 -1
  52. package/dist/cjs/ez-tree.cjs.entry.js +1 -1
  53. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  54. package/dist/cjs/ezui.cjs.js +3 -3
  55. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  56. package/dist/cjs/{floating-ui.dom.esm-f4d87617.js → floating-ui.dom.esm-bea31048.js} +165 -119
  57. package/dist/cjs/index-a7b0c73d.js +8 -0
  58. package/dist/cjs/{index-350d0fa0.js → index-a8537087.js} +85 -30
  59. package/dist/cjs/loader.cjs.js +3 -3
  60. package/dist/cjs/{search-column-fbf680d7.js → search-column-cd0e44be.js} +4 -7
  61. package/dist/collection/collection-manifest.json +7 -0
  62. package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +2 -1
  63. package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.js +1 -1
  64. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.css +22 -0
  65. package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +1 -1
  66. package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.js +3 -2
  67. package/dist/collection/components/ez-dropdown/ez-dropdown.css +1 -1
  68. package/dist/collection/components/ez-empty-card/ez-empty-card.js +7 -7
  69. package/dist/collection/components/ez-grid/ez-grid.css +1 -60
  70. package/dist/collection/components/ez-grid/ez-grid.js +52 -150
  71. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.css +111 -0
  72. package/dist/collection/components/ez-grid-pagination/ez-grid-pagination.js +410 -0
  73. package/dist/collection/components/ez-icon/ez-icon.css +5 -5
  74. package/dist/collection/components/ez-record-navigation/ez-record-navigation.css +51 -0
  75. package/dist/collection/components/ez-record-navigation/ez-record-navigation.js +246 -0
  76. package/dist/collection/components/ez-scroller/EzScrollNavigationMode.js +5 -0
  77. package/dist/collection/components/ez-scroller/ez-scroller.css +117 -11
  78. package/dist/collection/components/ez-scroller/ez-scroller.js +118 -13
  79. package/dist/collection/components/ez-search/ez-search.css +4 -0
  80. package/dist/collection/components/ez-search-plus/ez-search-plus.js +2 -2
  81. package/dist/collection/components/ez-split-button/ez-split-button.css +1 -1
  82. package/dist/collection/components/ez-split-button/ez-split-button.js +2 -2
  83. package/dist/collection/utils/i18n/locales/en-us.js +25 -4
  84. package/dist/collection/utils/i18n/locales/es-es.js +25 -4
  85. package/dist/collection/utils/i18n/locales/pt-br.js +25 -4
  86. package/dist/collection/utils/searchColumn/search-column.js +2 -5
  87. package/dist/custom-elements/index.d.ts +12 -0
  88. package/dist/custom-elements/index.js +697 -321
  89. package/dist/esm/{ApplicationUtils-0c5cb207.js → ApplicationUtils-e99e53c8.js} +1 -1
  90. package/dist/esm/{app-globals-1db10325.js → app-globals-6e27b3bb.js} +1 -1
  91. package/dist/esm/classic-search-list_7.entry.js +2 -2
  92. package/dist/esm/ez-actions-button.entry.js +2 -2
  93. package/dist/esm/ez-alert-list.entry.js +1 -1
  94. package/dist/esm/ez-avatar.entry.js +1 -1
  95. package/dist/esm/ez-calendar.entry.js +1 -1
  96. package/dist/esm/ez-classic-combo-box.entry.js +2 -1
  97. package/dist/esm/ez-classic-date-input.entry.js +2 -2
  98. package/dist/esm/ez-classic-date-time-input.entry.js +1 -1
  99. package/dist/esm/ez-classic-number-input.entry.js +1 -1
  100. package/dist/esm/ez-classic-search-plus.entry.js +4 -4
  101. package/dist/esm/ez-classic-search.entry.js +2 -2
  102. package/dist/esm/ez-classic-time-input.entry.js +4 -3
  103. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  104. package/dist/esm/ez-combo-box.entry.js +2 -2
  105. package/dist/esm/ez-date-input.entry.js +1 -1
  106. package/dist/esm/ez-date-time-input.entry.js +1 -1
  107. package/dist/esm/ez-dialog.entry.js +1 -1
  108. package/dist/esm/ez-double-list.entry.js +1 -1
  109. package/dist/esm/ez-dropdown.entry.js +1 -1
  110. package/dist/esm/ez-empty-card.entry.js +1 -1
  111. package/dist/esm/ez-file-item.entry.js +1 -1
  112. package/dist/esm/ez-form-view.entry.js +1 -1
  113. package/dist/esm/ez-form.entry.js +3 -3
  114. package/dist/esm/ez-grid-pagination.entry.js +223 -0
  115. package/dist/esm/ez-grid.entry.js +21 -149
  116. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  117. package/dist/esm/ez-icon.entry.js +1 -1
  118. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  119. package/dist/esm/ez-list.entry.js +1 -1
  120. package/dist/esm/ez-modal-container.entry.js +1 -1
  121. package/dist/esm/ez-modal.entry.js +1 -1
  122. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  123. package/dist/esm/ez-number-input.entry.js +1 -1
  124. package/dist/esm/ez-pagination.entry.js +1 -1
  125. package/dist/esm/ez-popover-core.entry.js +1 -1
  126. package/dist/esm/ez-popup.entry.js +1 -1
  127. package/dist/esm/ez-record-navigation.entry.js +117 -0
  128. package/dist/esm/ez-scroller_2.entry.js +81 -14
  129. package/dist/esm/ez-search-plus.entry.js +4 -4
  130. package/dist/esm/ez-search-result-list.entry.js +1 -1
  131. package/dist/esm/ez-search.entry.js +3 -3
  132. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  133. package/dist/esm/ez-skeleton.entry.js +1 -1
  134. package/dist/esm/ez-sortable-list.entry.js +1 -1
  135. package/dist/esm/ez-spinner.entry.js +1 -1
  136. package/dist/esm/ez-split-button.entry.js +4 -4
  137. package/dist/esm/ez-split-item.entry.js +2 -2
  138. package/dist/esm/ez-time-input.entry.js +1 -1
  139. package/dist/esm/ez-tooltip.entry.js +1 -1
  140. package/dist/esm/ez-tree.entry.js +1 -1
  141. package/dist/esm/ez-upload.entry.js +2 -2
  142. package/dist/esm/ezui.js +3 -3
  143. package/dist/esm/filter-column.entry.js +1 -1
  144. package/dist/esm/{floating-ui.dom.esm-ad30f2f0.js → floating-ui.dom.esm-2964eae1.js} +165 -119
  145. package/dist/esm/{index-225aa0c3.js → index-a031816b.js} +85 -30
  146. package/dist/esm/index-baa5e267.js +8 -0
  147. package/dist/esm/loader.js +3 -3
  148. package/dist/esm/{search-column-40a78cac.js → search-column-33d72c20.js} +4 -7
  149. package/dist/ezui/ezui.esm.js +1 -1
  150. package/dist/ezui/{p-bf2a7f94.entry.js → p-05e4541a.entry.js} +1 -1
  151. package/dist/ezui/{p-56565777.entry.js → p-0bc16f75.entry.js} +1 -1
  152. package/dist/ezui/p-0d80e3ec.entry.js +1 -0
  153. package/dist/ezui/{p-556bf329.entry.js → p-0fc981e9.entry.js} +1 -1
  154. package/dist/ezui/{p-26cd4c2e.entry.js → p-1244fac0.entry.js} +1 -1
  155. package/dist/ezui/{p-0625743b.entry.js → p-160a268d.entry.js} +1 -1
  156. package/dist/ezui/p-178cb9df.entry.js +1 -0
  157. package/dist/ezui/{p-6ac056d7.entry.js → p-1ab5ba19.entry.js} +1 -1
  158. package/dist/ezui/p-2241dea1.js +1 -0
  159. package/dist/ezui/{p-9825c1d2.js → p-24582dd6.js} +1 -1
  160. package/dist/ezui/{p-62c149cb.entry.js → p-2887cbf9.entry.js} +1 -1
  161. package/dist/ezui/p-2b65728f.entry.js +1 -0
  162. package/dist/ezui/{p-b705b342.entry.js → p-318d4dc9.entry.js} +1 -1
  163. package/dist/ezui/{p-8e5f1c74.entry.js → p-32b8f057.entry.js} +1 -1
  164. package/dist/ezui/{p-f5552540.entry.js → p-3311e7ef.entry.js} +1 -1
  165. package/dist/ezui/{p-b0a716ef.entry.js → p-39d2bce5.entry.js} +1 -1
  166. package/dist/ezui/{p-e3cd5080.entry.js → p-3d772561.entry.js} +1 -1
  167. package/dist/ezui/{p-c56ee8c0.entry.js → p-473a397f.entry.js} +1 -1
  168. package/dist/ezui/{p-729bd1be.entry.js → p-4991931a.entry.js} +1 -1
  169. package/dist/ezui/{p-d5dc6b01.entry.js → p-4ca4e8d1.entry.js} +1 -1
  170. package/dist/ezui/{p-4f7ad3ee.entry.js → p-4f76dc28.entry.js} +1 -1
  171. package/dist/ezui/{p-2da9faf1.entry.js → p-510eccc7.entry.js} +1 -1
  172. package/dist/ezui/p-54975948.entry.js +1 -0
  173. package/dist/ezui/p-69344c23.js +1 -0
  174. package/dist/ezui/p-6bb36afc.entry.js +1 -0
  175. package/dist/ezui/{p-5abb220b.entry.js → p-700af412.entry.js} +1 -1
  176. package/dist/ezui/{p-a4351519.entry.js → p-7f475884.entry.js} +1 -1
  177. package/dist/ezui/{p-4c76b365.entry.js → p-84be1391.entry.js} +1 -1
  178. package/dist/ezui/{p-987185c4.entry.js → p-879cee4d.entry.js} +1 -1
  179. package/dist/ezui/{p-34d459e4.entry.js → p-8980b477.entry.js} +1 -1
  180. package/dist/ezui/{p-f969b65d.entry.js → p-8a5efec5.entry.js} +1 -1
  181. package/dist/ezui/p-91ff4511.entry.js +1 -0
  182. package/dist/ezui/{p-7134726a.entry.js → p-93097edc.entry.js} +1 -1
  183. package/dist/ezui/{p-e2972977.entry.js → p-96e5eaa2.entry.js} +1 -1
  184. package/dist/ezui/{p-0248846f.entry.js → p-a383fbc5.entry.js} +1 -1
  185. package/dist/ezui/{p-351fb12f.entry.js → p-a4735a12.entry.js} +1 -1
  186. package/dist/ezui/{p-a3bad8f8.entry.js → p-a4911d89.entry.js} +1 -1
  187. package/dist/ezui/{p-7edc3ef7.entry.js → p-a8f807ed.entry.js} +1 -1
  188. package/dist/ezui/{p-e3a42f47.entry.js → p-ab41edab.entry.js} +1 -1
  189. package/dist/ezui/{p-7953ecb9.entry.js → p-ab4da973.entry.js} +1 -1
  190. package/dist/ezui/{p-e493ad57.entry.js → p-adee66db.entry.js} +1 -1
  191. package/dist/ezui/{p-544605c4.entry.js → p-b5f45319.entry.js} +1 -1
  192. package/dist/ezui/p-c2d44132.entry.js +1 -0
  193. package/dist/ezui/{p-df802548.entry.js → p-c33d46e0.entry.js} +1 -1
  194. package/dist/ezui/{p-b36475f9.entry.js → p-c8584e28.entry.js} +1 -1
  195. package/dist/ezui/{p-a872c642.entry.js → p-caf3cd8f.entry.js} +1 -1
  196. package/dist/ezui/{p-4d30b703.entry.js → p-cf66ace0.entry.js} +1 -1
  197. package/dist/ezui/p-d2601b25.js +1 -0
  198. package/dist/ezui/{p-4c2a4435.entry.js → p-d98dd01a.entry.js} +1 -1
  199. package/dist/ezui/p-dd5326e6.entry.js +1 -0
  200. package/dist/ezui/{p-4af745e1.entry.js → p-ddc6432d.entry.js} +1 -1
  201. package/dist/ezui/{p-bea06aae.entry.js → p-ea0f78d1.entry.js} +46 -46
  202. package/dist/ezui/{p-97312709.entry.js → p-ed6b6e0f.entry.js} +1 -1
  203. package/dist/ezui/{p-4e869617.entry.js → p-f1390be9.entry.js} +1 -1
  204. package/dist/ezui/{p-6a794336.js → p-f71a4d97.js} +1 -1
  205. package/dist/ezui/{p-ef8bd3e8.entry.js → p-fc72aeb8.entry.js} +1 -1
  206. package/dist/ezui/p-fcdd861e.entry.js +1 -0
  207. package/dist/types/components/ez-empty-card/ez-empty-card.d.ts +2 -2
  208. package/dist/types/components/ez-grid/ez-grid.d.ts +10 -27
  209. package/dist/types/components/ez-grid-pagination/ez-grid-pagination.d.ts +75 -0
  210. package/dist/types/components/ez-record-navigation/ez-record-navigation.d.ts +43 -0
  211. package/dist/types/components/ez-scroller/EzScrollNavigationMode.d.ts +4 -0
  212. package/dist/types/components/ez-scroller/ez-scroller.d.ts +16 -2
  213. package/dist/types/components.d.ts +154 -6
  214. package/dist/types/utils/i18n/locales/en-us.d.ts +24 -3
  215. package/dist/types/utils/i18n/locales/es-es.d.ts +24 -3
  216. package/dist/types/utils/i18n/locales/pt-br.d.ts +24 -3
  217. package/dist/types/utils/i18n/translations.d.ts +72 -9
  218. package/package.json +3 -3
  219. package/react/components.d.ts +2 -0
  220. package/react/components.js +2 -0
  221. package/react/components.js.map +1 -1
  222. package/dist/ezui/p-07fb22c3.entry.js +0 -1
  223. package/dist/ezui/p-288631d1.entry.js +0 -1
  224. package/dist/ezui/p-2a806303.js +0 -1
  225. package/dist/ezui/p-2de94faf.entry.js +0 -1
  226. package/dist/ezui/p-619225ce.entry.js +0 -1
  227. package/dist/ezui/p-a813a748.entry.js +0 -1
  228. package/dist/ezui/p-c0ae79fa.entry.js +0 -1
  229. package/dist/ezui/p-c178730b.js +0 -1
  230. package/dist/ezui/p-d2645bdf.entry.js +0 -1
  231. package/dist/ezui/p-ff4312d5.js +0 -1
@@ -0,0 +1,410 @@
1
+ import { Host, h } from '@stencil/core';
2
+ import initI18n from '../../utils/i18n';
3
+ import { Action, ElementIDUtils } from '@sankhyalabs/core';
4
+ export class EzGridPagination {
5
+ constructor() {
6
+ this._dataUnitInitialized = false;
7
+ this.paginationInfo = undefined;
8
+ this.leftButtonDisabled = undefined;
9
+ this.rightButtonDisabled = undefined;
10
+ this.paginationCounterMode = 'auto';
11
+ this.dataUnit = undefined;
12
+ this.paginationTextPosition = 'left';
13
+ this.buttonsSize = 'large';
14
+ }
15
+ /**
16
+ * Navega para a página anterior.
17
+ */
18
+ async previousPage() {
19
+ if (!this.dataUnit) {
20
+ return;
21
+ }
22
+ await this.dataUnit.previousPage();
23
+ this.handlePageChange('previous');
24
+ }
25
+ /**
26
+ * Navega para a próxima página.
27
+ */
28
+ async nextPage() {
29
+ if (!this.dataUnit) {
30
+ return;
31
+ }
32
+ await this.dataUnit.nextPage();
33
+ this.handlePageChange('next');
34
+ }
35
+ /**
36
+ * Navega para a primeira página.
37
+ */
38
+ async firstPage() {
39
+ if (!this.dataUnit) {
40
+ return;
41
+ }
42
+ await this.dataUnit.gotoPage(0);
43
+ this.handlePageChange('previous');
44
+ }
45
+ /**
46
+ * Navega para a primeira página.
47
+ */
48
+ async lastPage() {
49
+ if (!this.dataUnit) {
50
+ return;
51
+ }
52
+ await this.dataUnit.gotoPage(this.getTotalPages() - 1);
53
+ this.handlePageChange('next');
54
+ }
55
+ onDataUnitChange() {
56
+ this.initializeDataUnit();
57
+ }
58
+ shouldPresentPaginationLabel() {
59
+ return this.paginationCounterMode !== 'hidden';
60
+ }
61
+ getRemainingPageLabel() {
62
+ var _a;
63
+ if (!this.paginationInfo)
64
+ return '';
65
+ return `${this.paginationInfo.total == undefined
66
+ ? this.i18n('ez-grid-pagination.remainingPageLabel', { count: ((_a = this.paginationInfo.count) !== null && _a !== void 0 ? _a : 0) + 1 })
67
+ : this.i18n('ez-grid-pagination.remainingTotalLabel', { total: this.paginationInfo.total, count: this.paginationInfo.count })}`;
68
+ }
69
+ getActualPageLabel() {
70
+ var _a, _b;
71
+ if (!this.paginationInfo)
72
+ return '0-0';
73
+ return `${(_a = this.paginationInfo.firstRecord) !== null && _a !== void 0 ? _a : 0} - ${(_b = this.paginationInfo.lastRecord) !== null && _b !== void 0 ? _b : 0}`;
74
+ }
75
+ getPaginationCount() {
76
+ var _a;
77
+ if (!this.paginationInfo || !this.dataUnit)
78
+ return '0-0';
79
+ const currentPage = ((_a = this.paginationInfo.currentPage) !== null && _a !== void 0 ? _a : 0) + 1;
80
+ let totalPages = this.getTotalPages();
81
+ return this.i18n('ez-grid-pagination.pageCounter', { currentPage, totalPages });
82
+ }
83
+ getTotalPages() {
84
+ var _a;
85
+ if (this.paginationInfo.total !== undefined) {
86
+ return Math.ceil(this.paginationInfo.total / this.dataUnit.pageSize);
87
+ }
88
+ else {
89
+ return Math.ceil(((_a = this.paginationInfo.count) !== null && _a !== void 0 ? _a : 0) / this.dataUnit.pageSize);
90
+ }
91
+ }
92
+ handlePageChange(direction) {
93
+ this.setPaginationInfo();
94
+ this.setStatusButtonPagination();
95
+ this.pageChange.emit(direction);
96
+ }
97
+ async handleCancelPagination() {
98
+ var _a;
99
+ if (!this.dataUnit)
100
+ return;
101
+ this.dataUnit.cancelPagination = true;
102
+ await ((_a = this._cancelPaginationPopoverElement) === null || _a === void 0 ? void 0 : _a.hide());
103
+ }
104
+ handleShowCancelPagination() {
105
+ var _a, _b, _c;
106
+ if (!this.hasToShowCancelPagination()) {
107
+ (_a = this._cancelPaginationPopoverElement) === null || _a === void 0 ? void 0 : _a.hide();
108
+ return;
109
+ }
110
+ if ((_b = this._cancelPaginationPopoverElement) === null || _b === void 0 ? void 0 : _b.opened)
111
+ return;
112
+ (_c = this._cancelPaginationPopoverElement) === null || _c === void 0 ? void 0 : _c.show('15px');
113
+ }
114
+ hasToShowCancelPagination() {
115
+ if (!this.dataUnit || !this.paginationInfo)
116
+ return false;
117
+ const hasMore = this.paginationInfo.total === undefined;
118
+ return !this.dataUnit.cancelPagination && hasMore && this.paginationInfo.count > this.dataUnit.pageSize;
119
+ }
120
+ setPaginationInfo() {
121
+ if (!this.dataUnit) {
122
+ this.paginationInfo = null;
123
+ return;
124
+ }
125
+ this.paginationInfo = this.dataUnit.getPaginationInfo() || null;
126
+ }
127
+ dataUnitObserver(action) {
128
+ switch (action.type) {
129
+ case Action.PAGINATION_UPDATED:
130
+ this.setPaginationInfo();
131
+ this.setStatusButtonPagination();
132
+ this.handleShowCancelPagination();
133
+ break;
134
+ case Action.DATA_LOADED:
135
+ this.setPaginationInfo();
136
+ break;
137
+ default:
138
+ break;
139
+ }
140
+ }
141
+ getLeftButtonDisabledStatus() {
142
+ var _a, _b;
143
+ if (!this.dataUnit)
144
+ return true;
145
+ return ((_b = (_a = this.paginationInfo) === null || _a === void 0 ? void 0 : _a.currentPage) !== null && _b !== void 0 ? _b : 0) <= 0;
146
+ }
147
+ getRightButtonDisabledStatus() {
148
+ var _a;
149
+ if (!this.dataUnit)
150
+ return true;
151
+ return !((_a = this.paginationInfo) === null || _a === void 0 ? void 0 : _a.hasMore);
152
+ }
153
+ setStatusButtonPagination() {
154
+ this.leftButtonDisabled = this.getLeftButtonDisabledStatus();
155
+ this.rightButtonDisabled = this.getRightButtonDisabledStatus();
156
+ }
157
+ initializeDataUnit() {
158
+ if (!this.dataUnit || this._dataUnitInitialized) {
159
+ return;
160
+ }
161
+ this.setPaginationInfo();
162
+ this.setStatusButtonPagination();
163
+ this._dataUnitObserverBound = this.dataUnitObserver.bind(this);
164
+ this.dataUnit.subscribe(this._dataUnitObserverBound);
165
+ this._dataUnitInitialized = true;
166
+ }
167
+ addInfoId() {
168
+ if (this._element) {
169
+ ElementIDUtils.addIDInfo(this._element);
170
+ }
171
+ }
172
+ renderCancelPagination() {
173
+ return (h("ez-popover", { ref: (element) => (this._cancelPaginationPopoverElement = element), "overlay-type": "none", autoClose: false }, h("div", { class: 'cancel-pagination' }, h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), h("span", { onClick: () => this.handleCancelPagination(), class: 'cancel-pagination-btn' }, this.i18n('ez-grid-pagination.cancelPagination')))));
174
+ }
175
+ async connectedCallback() {
176
+ this.i18n = await initI18n();
177
+ this.initializeDataUnit();
178
+ }
179
+ componentDidLoad() {
180
+ this.addInfoId();
181
+ }
182
+ disconnectedCallback() {
183
+ if (this.dataUnit && this._dataUnitInitialized && this._dataUnitObserverBound) {
184
+ this.dataUnit.unsubscribe(this._dataUnitObserverBound);
185
+ }
186
+ }
187
+ render() {
188
+ return (h(Host, null, h("div", { id: 'grid-pagination--container', class: {
189
+ 'pagination__container': true,
190
+ 'pagination-expanded': this.paginationCounterMode !== 'hidden',
191
+ 'pagination-contracted': this.paginationCounterMode === 'hidden',
192
+ 'pagination-text-right': this.paginationTextPosition === 'right',
193
+ } }, h("div", { id: "grid-pagination--page-navigator", class: "pagination__page-navigator" }, h("div", { id: 'grid-pagination--row-summary-panel', class: "pagination__row-summary-panel" }, h("span", { class: "pagination__label", "aria-live": "polite", "aria-atomic": "true", title: `${this.getActualPageLabel()} ${this.getRemainingPageLabel()}` }, this.shouldPresentPaginationLabel() && this.getActualPageLabel(), this.shouldPresentPaginationLabel() && this.getRemainingPageLabel())), this.renderCancelPagination(), h("div", { id: 'grid-pagination--page-summary-panel', class: {
194
+ 'pagination__page-summary-panel': true,
195
+ 'pagination__container': true,
196
+ 'pagination-expanded': this.paginationCounterMode !== 'hidden',
197
+ 'pagination-contracted': this.paginationCounterMode === 'hidden',
198
+ 'pagination-text-right': this.paginationTextPosition === 'right',
199
+ } }, h("div", { id: 'grid-pagination--first-tooltip', class: {
200
+ 'pagination__buttons-container': true,
201
+ 'disabled': this.leftButtonDisabled
202
+ } }, h("ez-tooltip", { message: this.i18n('ez-grid-pagination.firstPage') }, h("ez-icon", { size: this.buttonsSize, iconName: "dual-chevron-left", onClick: () => !this.leftButtonDisabled && this.firstPage() }))), h("div", { id: 'grid-pagination--previous-tooltip', class: {
203
+ 'pagination__buttons-container': true,
204
+ 'disabled': this.leftButtonDisabled
205
+ } }, h("ez-tooltip", { message: this.i18n('ez-grid-pagination.previousPage') }, h("ez-icon", { size: this.buttonsSize, iconName: "chevron-left", onClick: () => !this.leftButtonDisabled && this.previousPage() }))), h("div", { class: "pagination__container-label" }, h("span", { class: "pagination__label", "aria-live": "polite", "aria-atomic": "true", title: `${this.getActualPageLabel()} ${this.getRemainingPageLabel()}` }, this.shouldPresentPaginationLabel() && this.getPaginationCount())), h("div", { id: 'grid-pagination--next-tooltip', class: {
206
+ 'pagination__buttons-container': true,
207
+ 'disabled': this.rightButtonDisabled
208
+ } }, h("ez-tooltip", { message: this.i18n('ez-grid-pagination.nextPage') }, h("ez-icon", { size: this.buttonsSize, iconName: "chevron-right", onClick: () => !this.rightButtonDisabled && this.nextPage() }))), h("div", { id: 'grid-pagination--last-tooltip', class: {
209
+ 'pagination__buttons-container': true,
210
+ 'disabled': this.rightButtonDisabled
211
+ } }, h("ez-tooltip", { message: this.i18n('ez-grid-pagination.lastPage') }, h("ez-icon", { size: this.buttonsSize, iconName: "dual-chevron-right", onClick: () => !this.rightButtonDisabled && this.lastPage() }))))))));
212
+ }
213
+ static get is() { return "ez-grid-pagination"; }
214
+ static get encapsulation() { return "shadow"; }
215
+ static get originalStyleUrls() {
216
+ return {
217
+ "$": ["ez-grid-pagination.css"]
218
+ };
219
+ }
220
+ static get styleUrls() {
221
+ return {
222
+ "$": ["ez-grid-pagination.css"]
223
+ };
224
+ }
225
+ static get properties() {
226
+ return {
227
+ "paginationCounterMode": {
228
+ "type": "string",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "'show' | 'hidden' | 'auto'",
232
+ "resolved": "\"auto\" | \"hidden\" | \"show\"",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": true,
237
+ "docs": {
238
+ "tags": [{
239
+ "name": "default",
240
+ "text": "'auto'"
241
+ }],
242
+ "text": "Define a visibilidade do contador de pagina\u00E7\u00E3o.\n- `show`: Sempre exibe o contador (ex: \"1-10 de 100\")\n- `hidden`: Oculta o contador (exibe apenas os bot\u00F5es)\n- `auto`: Exibe/oculta baseado no espa\u00E7o dispon\u00EDvel (responsivo)"
243
+ },
244
+ "attribute": "pagination-counter-mode",
245
+ "reflect": false,
246
+ "defaultValue": "'auto'"
247
+ },
248
+ "dataUnit": {
249
+ "type": "unknown",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "DataUnit",
253
+ "resolved": "DataUnit",
254
+ "references": {
255
+ "DataUnit": {
256
+ "location": "import",
257
+ "path": "@sankhyalabs/core"
258
+ }
259
+ }
260
+ },
261
+ "required": false,
262
+ "optional": false,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": "DataUnit associada \u00E0 grid."
266
+ }
267
+ },
268
+ "paginationTextPosition": {
269
+ "type": "string",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "'left' | 'right'",
273
+ "resolved": "\"left\" | \"right\"",
274
+ "references": {}
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "Define o texto da pagina\u00E7\u00E3o \u00E0 esquerda ou \u00E0 direita."
281
+ },
282
+ "attribute": "pagination-text-position",
283
+ "reflect": false,
284
+ "defaultValue": "'left'"
285
+ },
286
+ "buttonsSize": {
287
+ "type": "string",
288
+ "mutable": false,
289
+ "complexType": {
290
+ "original": "'x-small' | 'small' | 'medium' | 'large'",
291
+ "resolved": "\"large\" | \"medium\" | \"small\" | \"x-small\"",
292
+ "references": {}
293
+ },
294
+ "required": false,
295
+ "optional": false,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": "Define o modo de visualiza\u00E7\u00E3o atual da grid."
299
+ },
300
+ "attribute": "buttons-size",
301
+ "reflect": false,
302
+ "defaultValue": "'large'"
303
+ }
304
+ };
305
+ }
306
+ static get states() {
307
+ return {
308
+ "paginationInfo": {},
309
+ "leftButtonDisabled": {},
310
+ "rightButtonDisabled": {}
311
+ };
312
+ }
313
+ static get events() {
314
+ return [{
315
+ "method": "pageChange",
316
+ "name": "pageChange",
317
+ "bubbles": true,
318
+ "cancelable": true,
319
+ "composed": true,
320
+ "docs": {
321
+ "tags": [],
322
+ "text": "Evento disparado quando a p\u00E1gina \u00E9 alterada."
323
+ },
324
+ "complexType": {
325
+ "original": "PageChangeDirection",
326
+ "resolved": "\"next\" | \"previous\"",
327
+ "references": {
328
+ "PageChangeDirection": {
329
+ "location": "local"
330
+ }
331
+ }
332
+ }
333
+ }];
334
+ }
335
+ static get methods() {
336
+ return {
337
+ "previousPage": {
338
+ "complexType": {
339
+ "signature": "() => Promise<void>",
340
+ "parameters": [],
341
+ "references": {
342
+ "Promise": {
343
+ "location": "global"
344
+ }
345
+ },
346
+ "return": "Promise<void>"
347
+ },
348
+ "docs": {
349
+ "text": "Navega para a p\u00E1gina anterior.",
350
+ "tags": []
351
+ }
352
+ },
353
+ "nextPage": {
354
+ "complexType": {
355
+ "signature": "() => Promise<void>",
356
+ "parameters": [],
357
+ "references": {
358
+ "Promise": {
359
+ "location": "global"
360
+ }
361
+ },
362
+ "return": "Promise<void>"
363
+ },
364
+ "docs": {
365
+ "text": "Navega para a pr\u00F3xima p\u00E1gina.",
366
+ "tags": []
367
+ }
368
+ },
369
+ "firstPage": {
370
+ "complexType": {
371
+ "signature": "() => Promise<void>",
372
+ "parameters": [],
373
+ "references": {
374
+ "Promise": {
375
+ "location": "global"
376
+ }
377
+ },
378
+ "return": "Promise<void>"
379
+ },
380
+ "docs": {
381
+ "text": "Navega para a primeira p\u00E1gina.",
382
+ "tags": []
383
+ }
384
+ },
385
+ "lastPage": {
386
+ "complexType": {
387
+ "signature": "() => Promise<void>",
388
+ "parameters": [],
389
+ "references": {
390
+ "Promise": {
391
+ "location": "global"
392
+ }
393
+ },
394
+ "return": "Promise<void>"
395
+ },
396
+ "docs": {
397
+ "text": "Navega para a primeira p\u00E1gina.",
398
+ "tags": []
399
+ }
400
+ }
401
+ };
402
+ }
403
+ static get elementRef() { return "_element"; }
404
+ static get watchers() {
405
+ return [{
406
+ "propName": "dataUnit",
407
+ "methodName": "onDataUnitChange"
408
+ }];
409
+ }
410
+ }
@@ -1433,25 +1433,25 @@ svg {
1433
1433
 
1434
1434
  .x-small--font {
1435
1435
  font-size: var(--font-size--small, 12px);
1436
- line-height: var(--line-height--16, 16px);
1436
+ line-height: var(--line-height--12, 12px);
1437
1437
  }
1438
1438
 
1439
1439
  .small--font {
1440
1440
  font-size: var(--font-size--medium, 16px);
1441
- line-height: var(--line-height--20, 20px);
1441
+ line-height: var(--line-height--16, 16px);
1442
1442
  }
1443
1443
 
1444
1444
  .medium--font {
1445
1445
  font-size: var(--font-size--xlarge, 20px);
1446
- line-height: var(--line-height--24, 24px);
1446
+ line-height: var(--line-height--20, 20px);
1447
1447
  }
1448
1448
 
1449
1449
  .large--font {
1450
1450
  font-size: var(--font-size--xxxlarge, 24px);
1451
- line-height: var(--line-height--28, 28px);
1451
+ line-height: var(--line-height--24, 24px);
1452
1452
  }
1453
1453
 
1454
1454
  .x-large--font {
1455
1455
  font-size: var(--font-size--6xlarge, 30px);
1456
- line-height: var(--line-height--34, 34px);
1456
+ line-height: var(--line-height--30, 30px);
1457
1457
  }
@@ -0,0 +1,51 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .record-navigation__container {
6
+ display: flex;
7
+ align-items: center;
8
+ flex-grow: 1;
9
+ flex-shrink: 1;
10
+ justify-content: flex-end;
11
+ flex-wrap: nowrap;
12
+ }
13
+
14
+ .record-navigation__buttons-container {
15
+ display: flex;
16
+ gap: var(--space--8, 8px);
17
+ }
18
+
19
+ .record-navigation__container-label {
20
+ font-size: var(--font-size--default, 14px);
21
+ font-family: var(--font--pattern, 'Roboto');
22
+ color: var(--color--gray-600, #1C1D22);
23
+ text-shadow: 0 0 var(--color--gray-500, #494A4E), 0 0 1px transparent;
24
+ margin-right: var(--space--12, 12px);
25
+ display: flex;
26
+ align-items: center;
27
+ }
28
+
29
+ .record-navigation-contracted {
30
+ width: 100px;
31
+ }
32
+
33
+ .record-navigation-expanded {
34
+ min-width: 150px;
35
+ }
36
+
37
+ .record-navigation__label {
38
+ width: 100%;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .record-navigation__divider {
43
+ width: 3px;
44
+ height: 15px;
45
+ background-color: var(--color--gray-300, #C1C2C6);
46
+ margin-inline: var(--space--8, 8px);
47
+ }
48
+
49
+ .record-navigation-text-right {
50
+ flex-direction: row-reverse;
51
+ }