primereact 10.0.0 → 10.0.1

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 (319) hide show
  1. package/README.md +1 -1
  2. package/componentbase/componentbase.cjs.js +12 -7
  3. package/componentbase/componentbase.cjs.min.js +1 -1
  4. package/componentbase/componentbase.esm.min.mjs +1 -1
  5. package/componentbase/componentbase.esm.mjs +12 -7
  6. package/componentbase/componentbase.js +12 -7
  7. package/componentbase/componentbase.min.js +1 -1
  8. package/core/core.js +12 -7
  9. package/core/core.min.js +1 -1
  10. package/package.json +1 -1
  11. package/primereact.all.cjs.js +12 -7
  12. package/primereact.all.cjs.min.js +1 -1
  13. package/primereact.all.esm.min.mjs +1 -1
  14. package/primereact.all.esm.mjs +12 -7
  15. package/primereact.all.js +12 -7
  16. package/primereact.all.min.js +1 -1
  17. package/web-types.json +1 -1
  18. package/accordion/accordion.esm.js +0 -421
  19. package/accordion/accordion.esm.min.js +0 -1
  20. package/api/api.esm.js +0 -944
  21. package/api/api.esm.min.js +0 -1
  22. package/autocomplete/autocomplete.esm.js +0 -1127
  23. package/autocomplete/autocomplete.esm.min.js +0 -1
  24. package/avatar/avatar.esm.js +0 -245
  25. package/avatar/avatar.esm.min.js +0 -1
  26. package/avatargroup/avatargroup.esm.js +0 -55
  27. package/avatargroup/avatargroup.esm.min.js +0 -1
  28. package/badge/badge.esm.js +0 -110
  29. package/badge/badge.esm.min.js +0 -1
  30. package/blockui/blockui.esm.js +0 -265
  31. package/blockui/blockui.esm.min.js +0 -1
  32. package/breadcrumb/breadcrumb.esm.js +0 -351
  33. package/breadcrumb/breadcrumb.esm.min.js +0 -1
  34. package/button/button.esm.js +0 -295
  35. package/button/button.esm.min.js +0 -1
  36. package/calendar/calendar.esm.js +0 -3473
  37. package/calendar/calendar.esm.min.js +0 -1
  38. package/card/card.esm.js +0 -98
  39. package/card/card.esm.min.js +0 -1
  40. package/carousel/carousel.esm.js +0 -801
  41. package/carousel/carousel.esm.min.js +0 -1
  42. package/cascadeselect/cascadeselect.esm.js +0 -819
  43. package/cascadeselect/cascadeselect.esm.min.js +0 -1
  44. package/chart/chart.esm.js +0 -155
  45. package/chart/chart.esm.min.js +0 -1
  46. package/checkbox/checkbox.esm.js +0 -357
  47. package/checkbox/checkbox.esm.min.js +0 -1
  48. package/chip/chip.esm.js +0 -248
  49. package/chip/chip.esm.min.js +0 -1
  50. package/chips/chips.esm.js +0 -501
  51. package/chips/chips.esm.min.js +0 -1
  52. package/colorpicker/colorpicker.esm.js +0 -788
  53. package/colorpicker/colorpicker.esm.min.js +0 -1
  54. package/column/column.esm.js +0 -8
  55. package/column/column.esm.min.js +0 -1
  56. package/columngroup/columngroup.esm.js +0 -6
  57. package/columngroup/columngroup.esm.min.js +0 -1
  58. package/componentbase/componentbase.esm.js +0 -323
  59. package/componentbase/componentbase.esm.min.js +0 -1
  60. package/confirmdialog/confirmdialog.esm.js +0 -376
  61. package/confirmdialog/confirmdialog.esm.min.js +0 -1
  62. package/confirmpopup/confirmpopup.esm.js +0 -610
  63. package/confirmpopup/confirmpopup.esm.min.js +0 -1
  64. package/contextmenu/contextmenu.esm.js +0 -664
  65. package/contextmenu/contextmenu.esm.min.js +0 -1
  66. package/csstransition/csstransition.esm.js +0 -138
  67. package/csstransition/csstransition.esm.min.js +0 -1
  68. package/datascroller/datascroller.esm.js +0 -320
  69. package/datascroller/datascroller.esm.min.js +0 -1
  70. package/datatable/datatable.esm.js +0 -6636
  71. package/datatable/datatable.esm.min.js +0 -1
  72. package/dataview/dataview.esm.js +0 -506
  73. package/dataview/dataview.esm.min.js +0 -1
  74. package/deferredcontent/deferredcontent.esm.js +0 -133
  75. package/deferredcontent/deferredcontent.esm.min.js +0 -1
  76. package/dialog/dialog.esm.js +0 -983
  77. package/dialog/dialog.esm.min.js +0 -1
  78. package/divider/divider.esm.js +0 -79
  79. package/divider/divider.esm.min.js +0 -1
  80. package/dock/dock.esm.js +0 -348
  81. package/dock/dock.esm.min.js +0 -1
  82. package/dropdown/dropdown.esm.js +0 -1380
  83. package/dropdown/dropdown.esm.min.js +0 -1
  84. package/editor/editor.esm.js +0 -338
  85. package/editor/editor.esm.min.js +0 -1
  86. package/fieldset/fieldset.esm.js +0 -270
  87. package/fieldset/fieldset.esm.min.js +0 -1
  88. package/fileupload/fileupload.esm.js +0 -1005
  89. package/fileupload/fileupload.esm.min.js +0 -1
  90. package/galleria/galleria.esm.js +0 -1090
  91. package/galleria/galleria.esm.min.js +0 -1
  92. package/hooks/hooks.esm.js +0 -1042
  93. package/hooks/hooks.esm.min.js +0 -1
  94. package/iconbase/iconbase.esm.js +0 -33
  95. package/iconbase/iconbase.esm.min.js +0 -1
  96. package/icons/angledoubledown/index.esm.js +0 -39
  97. package/icons/angledoubledown/index.esm.min.js +0 -1
  98. package/icons/angledoubleleft/index.esm.js +0 -39
  99. package/icons/angledoubleleft/index.esm.min.js +0 -1
  100. package/icons/angledoubleright/index.esm.js +0 -39
  101. package/icons/angledoubleright/index.esm.min.js +0 -1
  102. package/icons/angledoubleup/index.esm.js +0 -39
  103. package/icons/angledoubleup/index.esm.min.js +0 -1
  104. package/icons/angledown/index.esm.js +0 -37
  105. package/icons/angledown/index.esm.min.js +0 -1
  106. package/icons/angleleft/index.esm.js +0 -37
  107. package/icons/angleleft/index.esm.min.js +0 -1
  108. package/icons/angleright/index.esm.js +0 -37
  109. package/icons/angleright/index.esm.min.js +0 -1
  110. package/icons/angleup/index.esm.js +0 -37
  111. package/icons/angleup/index.esm.min.js +0 -1
  112. package/icons/arrowdown/index.esm.js +0 -661
  113. package/icons/arrowdown/index.esm.min.js +0 -1
  114. package/icons/arrowup/index.esm.js +0 -661
  115. package/icons/arrowup/index.esm.min.js +0 -1
  116. package/icons/ban/index.esm.js +0 -659
  117. package/icons/ban/index.esm.min.js +0 -1
  118. package/icons/bars/index.esm.js +0 -39
  119. package/icons/bars/index.esm.min.js +0 -1
  120. package/icons/calendar/index.esm.js +0 -37
  121. package/icons/calendar/index.esm.min.js +0 -1
  122. package/icons/check/index.esm.js +0 -37
  123. package/icons/check/index.esm.min.js +0 -1
  124. package/icons/chevrondown/index.esm.js +0 -37
  125. package/icons/chevrondown/index.esm.min.js +0 -1
  126. package/icons/chevronleft/index.esm.js +0 -37
  127. package/icons/chevronleft/index.esm.min.js +0 -1
  128. package/icons/chevronright/index.esm.js +0 -37
  129. package/icons/chevronright/index.esm.min.js +0 -1
  130. package/icons/chevronup/index.esm.js +0 -37
  131. package/icons/chevronup/index.esm.min.js +0 -1
  132. package/icons/download/index.esm.js +0 -661
  133. package/icons/download/index.esm.min.js +0 -1
  134. package/icons/exclamationtriangle/index.esm.js +0 -665
  135. package/icons/exclamationtriangle/index.esm.min.js +0 -1
  136. package/icons/eye/index.esm.js +0 -39
  137. package/icons/eye/index.esm.min.js +0 -1
  138. package/icons/eyeslash/index.esm.js +0 -661
  139. package/icons/eyeslash/index.esm.min.js +0 -1
  140. package/icons/filter/index.esm.js +0 -659
  141. package/icons/filter/index.esm.min.js +0 -1
  142. package/icons/filterslash/index.esm.js +0 -661
  143. package/icons/filterslash/index.esm.min.js +0 -1
  144. package/icons/infocircle/index.esm.js +0 -661
  145. package/icons/infocircle/index.esm.min.js +0 -1
  146. package/icons/minus/index.esm.js +0 -37
  147. package/icons/minus/index.esm.min.js +0 -1
  148. package/icons/pencil/index.esm.js +0 -659
  149. package/icons/pencil/index.esm.min.js +0 -1
  150. package/icons/plus/index.esm.js +0 -659
  151. package/icons/plus/index.esm.min.js +0 -1
  152. package/icons/refresh/index.esm.js +0 -661
  153. package/icons/refresh/index.esm.min.js +0 -1
  154. package/icons/search/index.esm.js +0 -661
  155. package/icons/search/index.esm.min.js +0 -1
  156. package/icons/searchminus/index.esm.js +0 -661
  157. package/icons/searchminus/index.esm.min.js +0 -1
  158. package/icons/searchplus/index.esm.js +0 -661
  159. package/icons/searchplus/index.esm.min.js +0 -1
  160. package/icons/sortalt/index.esm.js +0 -668
  161. package/icons/sortalt/index.esm.min.js +0 -1
  162. package/icons/sortamountdown/index.esm.js +0 -674
  163. package/icons/sortamountdown/index.esm.min.js +0 -1
  164. package/icons/sortamountupalt/index.esm.js +0 -674
  165. package/icons/sortamountupalt/index.esm.min.js +0 -1
  166. package/icons/spinner/index.esm.js +0 -659
  167. package/icons/spinner/index.esm.min.js +0 -1
  168. package/icons/star/index.esm.js +0 -659
  169. package/icons/star/index.esm.min.js +0 -1
  170. package/icons/starfill/index.esm.js +0 -659
  171. package/icons/starfill/index.esm.min.js +0 -1
  172. package/icons/thlarge/index.esm.js +0 -661
  173. package/icons/thlarge/index.esm.min.js +0 -1
  174. package/icons/times/index.esm.js +0 -37
  175. package/icons/times/index.esm.min.js +0 -1
  176. package/icons/timescircle/index.esm.js +0 -661
  177. package/icons/timescircle/index.esm.min.js +0 -1
  178. package/icons/trash/index.esm.js +0 -661
  179. package/icons/trash/index.esm.min.js +0 -1
  180. package/icons/undo/index.esm.js +0 -661
  181. package/icons/undo/index.esm.min.js +0 -1
  182. package/icons/upload/index.esm.js +0 -661
  183. package/icons/upload/index.esm.min.js +0 -1
  184. package/icons/windowmaximize/index.esm.js +0 -661
  185. package/icons/windowmaximize/index.esm.min.js +0 -1
  186. package/icons/windowminimize/index.esm.js +0 -661
  187. package/icons/windowminimize/index.esm.min.js +0 -1
  188. package/image/image.esm.js +0 -1162
  189. package/image/image.esm.min.js +0 -1
  190. package/inplace/inplace.esm.js +0 -243
  191. package/inplace/inplace.esm.min.js +0 -1
  192. package/inputmask/inputmask.esm.js +0 -560
  193. package/inputmask/inputmask.esm.min.js +0 -1
  194. package/inputnumber/inputnumber.esm.js +0 -1209
  195. package/inputnumber/inputnumber.esm.min.js +0 -1
  196. package/inputswitch/inputswitch.esm.js +0 -291
  197. package/inputswitch/inputswitch.esm.min.js +0 -1
  198. package/inputtext/inputtext.esm.js +0 -171
  199. package/inputtext/inputtext.esm.min.js +0 -1
  200. package/inputtextarea/inputtextarea.esm.js +0 -220
  201. package/inputtextarea/inputtextarea.esm.min.js +0 -1
  202. package/keyfilter/keyfilter.esm.js +0 -108
  203. package/keyfilter/keyfilter.esm.min.js +0 -1
  204. package/knob/knob.esm.js +0 -318
  205. package/knob/knob.esm.min.js +0 -1
  206. package/listbox/listbox.esm.js +0 -810
  207. package/listbox/listbox.esm.min.js +0 -1
  208. package/megamenu/megamenu.esm.js +0 -716
  209. package/megamenu/megamenu.esm.min.js +0 -1
  210. package/mention/mention.esm.js +0 -771
  211. package/mention/mention.esm.min.js +0 -1
  212. package/menu/menu.esm.js +0 -485
  213. package/menu/menu.esm.min.js +0 -1
  214. package/menubar/menubar.esm.js +0 -584
  215. package/menubar/menubar.esm.min.js +0 -1
  216. package/message/message.esm.js +0 -169
  217. package/message/message.esm.min.js +0 -1
  218. package/messages/messages.esm.js +0 -439
  219. package/messages/messages.esm.min.js +0 -1
  220. package/multiselect/multiselect.esm.js +0 -1724
  221. package/multiselect/multiselect.esm.min.js +0 -1
  222. package/multistatecheckbox/multistatecheckbox.esm.js +0 -352
  223. package/multistatecheckbox/multistatecheckbox.esm.min.js +0 -1
  224. package/orderlist/orderlist.esm.js +0 -816
  225. package/orderlist/orderlist.esm.min.js +0 -1
  226. package/organizationchart/organizationchart.esm.js +0 -480
  227. package/organizationchart/organizationchart.esm.min.js +0 -1
  228. package/overlaypanel/overlaypanel.esm.js +0 -516
  229. package/overlaypanel/overlaypanel.esm.min.js +0 -1
  230. package/overlayservice/overlayservice.esm.js +0 -7
  231. package/overlayservice/overlayservice.esm.min.js +0 -1
  232. package/paginator/paginator.esm.js +0 -933
  233. package/paginator/paginator.esm.min.js +0 -1
  234. package/panel/panel.esm.js +0 -316
  235. package/panel/panel.esm.min.js +0 -1
  236. package/panelmenu/panelmenu.esm.js +0 -645
  237. package/panelmenu/panelmenu.esm.min.js +0 -1
  238. package/passthrough/index.esm.js +0 -71
  239. package/passthrough/index.esm.min.js +0 -1
  240. package/passthrough/tailwind/index.esm.js +0 -3509
  241. package/passthrough/tailwind/index.esm.min.js +0 -1
  242. package/password/password.esm.js +0 -567
  243. package/password/password.esm.min.js +0 -1
  244. package/picklist/picklist.esm.js +0 -1119
  245. package/picklist/picklist.esm.min.js +0 -1
  246. package/portal/portal.esm.js +0 -110
  247. package/portal/portal.esm.min.js +0 -1
  248. package/primereact.all.esm.js +0 -51646
  249. package/primereact.all.esm.min.js +0 -1
  250. package/progressbar/progressbar.esm.js +0 -190
  251. package/progressbar/progressbar.esm.min.js +0 -1
  252. package/progressspinner/progressspinner.esm.js +0 -88
  253. package/progressspinner/progressspinner.esm.min.js +0 -1
  254. package/radiobutton/radiobutton.esm.js +0 -329
  255. package/radiobutton/radiobutton.esm.min.js +0 -1
  256. package/rating/rating.esm.js +0 -273
  257. package/rating/rating.esm.min.js +0 -1
  258. package/ripple/ripple.esm.js +0 -100
  259. package/ripple/ripple.esm.min.js +0 -1
  260. package/row/row.esm.js +0 -36
  261. package/row/row.esm.min.js +0 -1
  262. package/scrollpanel/scrollpanel.esm.js +0 -210
  263. package/scrollpanel/scrollpanel.esm.min.js +0 -1
  264. package/scrolltop/scrolltop.esm.js +0 -269
  265. package/scrolltop/scrolltop.esm.min.js +0 -1
  266. package/selectbutton/selectbutton.esm.js +0 -327
  267. package/selectbutton/selectbutton.esm.min.js +0 -1
  268. package/sidebar/sidebar.esm.js +0 -543
  269. package/sidebar/sidebar.esm.min.js +0 -1
  270. package/skeleton/skeleton.esm.js +0 -125
  271. package/skeleton/skeleton.esm.min.js +0 -1
  272. package/slidemenu/slidemenu.esm.js +0 -689
  273. package/slidemenu/slidemenu.esm.min.js +0 -1
  274. package/slider/slider.esm.js +0 -478
  275. package/slider/slider.esm.min.js +0 -1
  276. package/speeddial/speeddial.esm.js +0 -521
  277. package/speeddial/speeddial.esm.min.js +0 -1
  278. package/splitbutton/splitbutton.esm.js +0 -545
  279. package/splitbutton/splitbutton.esm.min.js +0 -1
  280. package/splitter/splitter.esm.js +0 -466
  281. package/splitter/splitter.esm.min.js +0 -1
  282. package/steps/steps.esm.js +0 -294
  283. package/steps/steps.esm.min.js +0 -1
  284. package/styleclass/styleclass.esm.js +0 -269
  285. package/styleclass/styleclass.esm.min.js +0 -1
  286. package/tabmenu/tabmenu.esm.js +0 -332
  287. package/tabmenu/tabmenu.esm.min.js +0 -1
  288. package/tabview/tabview.esm.js +0 -678
  289. package/tabview/tabview.esm.min.js +0 -1
  290. package/tag/tag.esm.js +0 -117
  291. package/tag/tag.esm.min.js +0 -1
  292. package/terminal/terminal.esm.js +0 -280
  293. package/terminal/terminal.esm.min.js +0 -1
  294. package/terminalservice/terminalservice.esm.js +0 -7
  295. package/terminalservice/terminalservice.esm.min.js +0 -1
  296. package/tieredmenu/tieredmenu.esm.js +0 -699
  297. package/tieredmenu/tieredmenu.esm.min.js +0 -1
  298. package/timeline/timeline.esm.js +0 -164
  299. package/timeline/timeline.esm.min.js +0 -1
  300. package/toast/toast.esm.js +0 -739
  301. package/toast/toast.esm.min.js +0 -1
  302. package/togglebutton/togglebutton.esm.js +0 -217
  303. package/togglebutton/togglebutton.esm.min.js +0 -1
  304. package/toolbar/toolbar.esm.js +0 -79
  305. package/toolbar/toolbar.esm.min.js +0 -1
  306. package/tooltip/tooltip.esm.js +0 -696
  307. package/tooltip/tooltip.esm.min.js +0 -1
  308. package/tree/tree.esm.js +0 -1403
  309. package/tree/tree.esm.min.js +0 -1
  310. package/treeselect/treeselect.esm.js +0 -930
  311. package/treeselect/treeselect.esm.min.js +0 -1
  312. package/treetable/treetable.esm.js +0 -3094
  313. package/treetable/treetable.esm.min.js +0 -1
  314. package/tristatecheckbox/tristatecheckbox.esm.js +0 -292
  315. package/tristatecheckbox/tristatecheckbox.esm.min.js +0 -1
  316. package/utils/utils.esm.js +0 -2383
  317. package/utils/utils.esm.min.js +0 -1
  318. package/virtualscroller/virtualscroller.esm.js +0 -972
  319. package/virtualscroller/virtualscroller.esm.min.js +0 -1
@@ -1,933 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { PrimeReactContext, ariaLabel, localeOption } from 'primereact/api';
5
- import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
6
- import { useUpdateEffect } from 'primereact/hooks';
7
- import { classNames, mergeProps, ObjectUtils, IconUtils } from 'primereact/utils';
8
- import { AngleDoubleLeftIcon } from 'primereact/icons/angledoubleleft';
9
- import { Ripple } from 'primereact/ripple';
10
- import { InputNumber } from 'primereact/inputnumber';
11
- import { AngleDoubleRightIcon } from 'primereact/icons/angledoubleright';
12
- import { AngleRightIcon } from 'primereact/icons/angleright';
13
- import { AngleLeftIcon } from 'primereact/icons/angleleft';
14
- import { Dropdown } from 'primereact/dropdown';
15
-
16
- function _arrayWithHoles(arr) {
17
- if (Array.isArray(arr)) return arr;
18
- }
19
-
20
- function _iterableToArrayLimit(r, l) {
21
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
22
- if (null != t) {
23
- var e,
24
- n,
25
- i,
26
- u,
27
- a = [],
28
- f = !0,
29
- o = !1;
30
- try {
31
- if (i = (t = t.call(r)).next, 0 === l) {
32
- if (Object(t) !== t) return;
33
- f = !1;
34
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
35
- } catch (r) {
36
- o = !0, n = r;
37
- } finally {
38
- try {
39
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
40
- } finally {
41
- if (o) throw n;
42
- }
43
- }
44
- return a;
45
- }
46
- }
47
-
48
- function _arrayLikeToArray(arr, len) {
49
- if (len == null || len > arr.length) len = arr.length;
50
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
51
- return arr2;
52
- }
53
-
54
- function _unsupportedIterableToArray(o, minLen) {
55
- if (!o) return;
56
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
57
- var n = Object.prototype.toString.call(o).slice(8, -1);
58
- if (n === "Object" && o.constructor) n = o.constructor.name;
59
- if (n === "Map" || n === "Set") return Array.from(o);
60
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
61
- }
62
-
63
- function _nonIterableRest() {
64
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
65
- }
66
-
67
- function _slicedToArray(arr, i) {
68
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
69
- }
70
-
71
- function _typeof(o) {
72
- "@babel/helpers - typeof";
73
-
74
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
75
- return typeof o;
76
- } : function (o) {
77
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
78
- }, _typeof(o);
79
- }
80
-
81
- function _toPrimitive(input, hint) {
82
- if (_typeof(input) !== "object" || input === null) return input;
83
- var prim = input[Symbol.toPrimitive];
84
- if (prim !== undefined) {
85
- var res = prim.call(input, hint || "default");
86
- if (_typeof(res) !== "object") return res;
87
- throw new TypeError("@@toPrimitive must return a primitive value.");
88
- }
89
- return (hint === "string" ? String : Number)(input);
90
- }
91
-
92
- function _toPropertyKey(arg) {
93
- var key = _toPrimitive(arg, "string");
94
- return _typeof(key) === "symbol" ? key : String(key);
95
- }
96
-
97
- function _defineProperty(obj, key, value) {
98
- key = _toPropertyKey(key);
99
- if (key in obj) {
100
- Object.defineProperty(obj, key, {
101
- value: value,
102
- enumerable: true,
103
- configurable: true,
104
- writable: true
105
- });
106
- } else {
107
- obj[key] = value;
108
- }
109
- return obj;
110
- }
111
-
112
- var classes = {
113
- root: 'p-paginator p-component',
114
- left: 'p-paginator-left-content',
115
- end: 'p-paginator-right-content',
116
- firstPageIcon: 'p-paginator-icon',
117
- firstPageButton: function firstPageButton(_ref) {
118
- var disabled = _ref.disabled;
119
- return classNames('p-paginator-first p-paginator-element p-link', {
120
- 'p-disabled': disabled
121
- });
122
- },
123
- prevPageIcon: 'p-paginator-icon',
124
- prevPageButton: function prevPageButton(_ref2) {
125
- var disabled = _ref2.disabled;
126
- return classNames('p-paginator-prev p-paginator-element p-link', {
127
- 'p-disabled': disabled
128
- });
129
- },
130
- nextPageIcon: 'p-paginator-icon',
131
- nextPageButton: function nextPageButton(_ref3) {
132
- var disabled = _ref3.disabled;
133
- return classNames('p-paginator-next p-paginator-element p-link', {
134
- 'p-disabled': disabled
135
- });
136
- },
137
- lastPageIcon: 'p-paginator-icon',
138
- lastPageButton: function lastPageButton(_ref4) {
139
- var disabled = _ref4.disabled;
140
- return classNames('p-paginator-last p-paginator-element p-link', {
141
- 'p-disabled': disabled
142
- });
143
- },
144
- pageButton: function pageButton(_ref5) {
145
- var pageLink = _ref5.pageLink,
146
- startPageInView = _ref5.startPageInView,
147
- endPageInView = _ref5.endPageInView,
148
- page = _ref5.page;
149
- return classNames('p-paginator-page p-paginator-element p-link', {
150
- 'p-paginator-page-start': pageLink === startPageInView,
151
- 'p-paginator-page-end': pageLink === endPageInView,
152
- 'p-highlight': pageLink - 1 === page
153
- });
154
- },
155
- pages: 'p-paginator-pages'
156
- };
157
- var styles = "\n@layer primereact {\n .p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n }\n \n .p-paginator-left-content {\n margin-right: auto;\n }\n \n .p-paginator-right-content {\n margin-left: auto;\n }\n \n .p-paginator-page,\n .p-paginator-next,\n .p-paginator-last,\n .p-paginator-first,\n .p-paginator-prev,\n .p-paginator-current {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n }\n \n .p-paginator-element:focus {\n z-index: 1;\n position: relative;\n }\n}\n";
158
- var PaginatorBase = ComponentBase.extend({
159
- defaultProps: {
160
- __TYPE: 'Paginator',
161
- __parentMetadata: null,
162
- totalRecords: 0,
163
- rows: 0,
164
- first: 0,
165
- pageLinkSize: 5,
166
- rowsPerPageOptions: null,
167
- alwaysShow: true,
168
- style: null,
169
- className: null,
170
- template: 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown',
171
- onPageChange: null,
172
- leftContent: null,
173
- rightContent: null,
174
- dropdownAppendTo: null,
175
- currentPageReportTemplate: '({currentPage} of {totalPages})',
176
- children: undefined
177
- },
178
- css: {
179
- classes: classes,
180
- styles: styles
181
- }
182
- });
183
- var CurrentPageReportBase = ComponentBase.extend({
184
- defaultProps: {
185
- __TYPE: 'CurrentPageReport',
186
- pageCount: null,
187
- page: null,
188
- first: null,
189
- rows: null,
190
- totalRecords: null,
191
- reportTemplate: '({currentPage} of {totalPages})',
192
- template: null,
193
- children: undefined
194
- }
195
- });
196
- var FirstPageLinkBase = ComponentBase.extend({
197
- defaultProps: {
198
- __TYPE: 'FirstPageLink',
199
- disabled: false,
200
- onClick: null,
201
- template: null,
202
- firstPageLinkIcon: null,
203
- children: undefined
204
- }
205
- });
206
- var JumpToPageInputBase = ComponentBase.extend({
207
- defaultProps: {
208
- __TYPE: 'JumpToPageInput',
209
- page: null,
210
- rows: null,
211
- pageCount: null,
212
- disabled: false,
213
- template: null,
214
- onChange: null,
215
- children: undefined,
216
- metaData: null,
217
- ptm: null
218
- }
219
- });
220
- var LastPageLinkBase = ComponentBase.extend({
221
- defaultProps: {
222
- __TYPE: 'LastPageLink',
223
- disabled: false,
224
- onClick: null,
225
- template: null,
226
- lastPageLinkIcon: null,
227
- children: undefined
228
- }
229
- });
230
- var NextPageLinkBase = ComponentBase.extend({
231
- defaultProps: {
232
- __TYPE: 'NextPageLink',
233
- disabled: false,
234
- onClick: null,
235
- template: null,
236
- nextPageLinkIcon: null,
237
- children: undefined
238
- }
239
- });
240
- var PageLinksBase = ComponentBase.extend({
241
- defaultProps: {
242
- __TYPE: 'PageLinks',
243
- value: null,
244
- page: null,
245
- rows: null,
246
- pageCount: null,
247
- links: null,
248
- template: null,
249
- children: undefined
250
- }
251
- });
252
- var PrevPageLinkBase = ComponentBase.extend({
253
- defaultProps: {
254
- __TYPE: 'PrevPageLink',
255
- disabled: false,
256
- onClick: null,
257
- template: null,
258
- prevPageLinkIcon: null,
259
- children: undefined
260
- }
261
- });
262
- var RowsPerPageDropdownBase = ComponentBase.extend({
263
- defaultProps: {
264
- __TYPE: 'RowsPerPageDropdown',
265
- options: null,
266
- value: null,
267
- page: null,
268
- pageCount: null,
269
- totalRecords: 0,
270
- appendTo: null,
271
- onChange: null,
272
- template: null,
273
- disabled: false,
274
- children: undefined
275
- }
276
- });
277
-
278
- function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
279
- function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
280
- var CurrentPageReport = /*#__PURE__*/React.memo(function (inProps) {
281
- var context = React.useContext(PrimeReactContext);
282
- var props = CurrentPageReportBase.getProps(inProps, context);
283
- var report = {
284
- currentPage: props.page + 1,
285
- totalPages: props.pageCount,
286
- first: Math.min(props.first + 1, props.totalRecords),
287
- last: Math.min(props.first + props.rows, props.totalRecords),
288
- rows: props.rows,
289
- totalRecords: props.totalRecords
290
- };
291
- var text = props.reportTemplate.replace('{currentPage}', report.currentPage).replace('{totalPages}', report.totalPages).replace('{first}', report.first).replace('{last}', report.last).replace('{rows}', report.rows).replace('{totalRecords}', report.totalRecords);
292
- var currentProps = mergeProps({
293
- className: 'p-paginator-current'
294
- }, props.ptm('current', {
295
- hostName: props.hostName
296
- }));
297
- var element = /*#__PURE__*/React.createElement("span", currentProps, text);
298
- if (props.template) {
299
- var defaultOptions = _objectSpread$5(_objectSpread$5({}, report), {
300
- className: 'p-paginator-current',
301
- element: element,
302
- props: props
303
- });
304
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
305
- }
306
- return element;
307
- });
308
- CurrentPageReport.displayName = 'CurrentPageReport';
309
-
310
- function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
311
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
312
- var FirstPageLink = /*#__PURE__*/React.memo(function (inProps) {
313
- var context = React.useContext(PrimeReactContext);
314
- var props = FirstPageLinkBase.getProps(inProps, context);
315
- var ptm = props.ptm,
316
- cx = props.cx;
317
- var getPTOptions = function getPTOptions(key) {
318
- return ptm(key, {
319
- hostName: props.hostName,
320
- context: {
321
- disabled: props.disabled
322
- }
323
- });
324
- };
325
- var className = classNames('p-paginator-first p-paginator-element p-link', {
326
- 'p-disabled': props.disabled
327
- });
328
- var iconClassName = 'p-paginator-icon';
329
- var firstPageIconProps = mergeProps({
330
- className: cx('firstPageIcon')
331
- }, getPTOptions('firstPageIcon'));
332
- var icon = props.firstPageLinkIcon || /*#__PURE__*/React.createElement(AngleDoubleLeftIcon, firstPageIconProps);
333
- var firstPageLinkIcon = IconUtils.getJSXIcon(icon, _objectSpread$4({}, firstPageIconProps), {
334
- props: props
335
- });
336
- var firstPageButtonProps = mergeProps({
337
- type: 'button',
338
- className: cx('firstPageButton', {
339
- disabled: props.disabled
340
- }),
341
- onClick: props.onClick,
342
- disabled: props.disabled,
343
- 'aria-label': ariaLabel('firstPageLabel')
344
- }, getPTOptions('firstPageButton'));
345
- var element = /*#__PURE__*/React.createElement("button", firstPageButtonProps, firstPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
346
- if (props.template) {
347
- var defaultOptions = {
348
- onClick: props.onClick,
349
- className: className,
350
- iconClassName: iconClassName,
351
- disabled: props.disabled,
352
- element: element,
353
- props: props
354
- };
355
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
356
- }
357
- return element;
358
- });
359
- FirstPageLink.displayName = 'FirstPageLink';
360
-
361
- var JumpToPageInput = /*#__PURE__*/React.memo(function (inProps) {
362
- var context = React.useContext(PrimeReactContext);
363
- var props = JumpToPageInputBase.getProps(inProps, context);
364
- var onChange = function onChange(event) {
365
- if (props.onChange) {
366
- props.onChange(props.rows * (event.value - 1), props.rows);
367
- }
368
- };
369
- var value = props.pageCount > 0 ? props.page + 1 : 0;
370
- var element = /*#__PURE__*/React.createElement(InputNumber, {
371
- value: value,
372
- onChange: onChange,
373
- className: "p-paginator-page-input",
374
- disabled: props.disabled,
375
- pt: props.ptm('JTPInput'),
376
- unstyled: props.unstyled,
377
- __parentMetadata: {
378
- parent: props.metaData
379
- }
380
- });
381
- if (props.template) {
382
- var defaultOptions = {
383
- value: value,
384
- onChange: onChange,
385
- disabled: props.disabled,
386
- className: 'p-paginator-page-input',
387
- element: element,
388
- props: props
389
- };
390
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
391
- }
392
- return element;
393
- });
394
- JumpToPageInput.displayName = 'JumpToPageInput';
395
-
396
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
397
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
398
- var LastPageLink = /*#__PURE__*/React.memo(function (inProps) {
399
- var context = React.useContext(PrimeReactContext);
400
- var props = LastPageLinkBase.getProps(inProps, context);
401
- var ptm = props.ptm,
402
- cx = props.cx;
403
- var getPTOptions = function getPTOptions(key) {
404
- return ptm(key, {
405
- hostName: props.hostName,
406
- context: {
407
- disabled: props.disabled
408
- }
409
- });
410
- };
411
- var className = classNames('p-paginator-last p-paginator-element p-link', {
412
- 'p-disabled': props.disabled
413
- });
414
- var iconClassName = 'p-paginator-icon';
415
- var lastPageIconProps = mergeProps({
416
- className: cx('lastPageIcon')
417
- }, getPTOptions('lastPageIcon'));
418
- var icon = props.lastPageLinkIcon || /*#__PURE__*/React.createElement(AngleDoubleRightIcon, lastPageIconProps);
419
- var lastPageLinkIcon = IconUtils.getJSXIcon(icon, _objectSpread$3({}, lastPageIconProps), {
420
- props: props
421
- });
422
- var lastPageButtonProps = mergeProps({
423
- type: 'button',
424
- className: cx('lastPageButton', {
425
- disabled: props.disabled
426
- }),
427
- onClick: props.onClick,
428
- disabled: props.disabled,
429
- 'aria-label': ariaLabel('lastPageLabel')
430
- }, getPTOptions('lastPageButton'));
431
- var element = /*#__PURE__*/React.createElement("button", lastPageButtonProps, lastPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
432
- if (props.template) {
433
- var defaultOptions = {
434
- onClick: props.onClick,
435
- className: className,
436
- iconClassName: iconClassName,
437
- disabled: props.disabled,
438
- element: element,
439
- props: props
440
- };
441
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
442
- }
443
- return element;
444
- });
445
- LastPageLink.displayName = 'LastPageLink';
446
-
447
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
448
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
449
- var NextPageLink = /*#__PURE__*/React.memo(function (inProps) {
450
- var context = React.useContext(PrimeReactContext);
451
- var props = NextPageLinkBase.getProps(inProps, context);
452
- var ptm = props.ptm,
453
- cx = props.cx;
454
- var getPTOptions = function getPTOptions(key) {
455
- return ptm(key, {
456
- hostName: props.hostName,
457
- context: {
458
- disabled: props.disabled
459
- }
460
- });
461
- };
462
- var className = classNames('p-paginator-next p-paginator-element p-link', {
463
- 'p-disabled': props.disabled
464
- });
465
- var iconClassName = 'p-paginator-icon';
466
- var nextPageIconProps = mergeProps({
467
- className: cx('nextPageIcon')
468
- }, getPTOptions('nextPageIcon'));
469
- var icon = props.nextPageLinkIcon || /*#__PURE__*/React.createElement(AngleRightIcon, nextPageIconProps);
470
- var nextPageLinkIcon = IconUtils.getJSXIcon(icon, _objectSpread$2({}, nextPageIconProps), {
471
- props: props
472
- });
473
- var nextPageButtonProps = mergeProps({
474
- type: 'button',
475
- className: cx('nextPageButton', {
476
- disabled: props.disabled
477
- }),
478
- onClick: props.onClick,
479
- disabled: props.disabled,
480
- 'aria-label': ariaLabel('nextPageLabel')
481
- }, getPTOptions('nextPageButton'));
482
- var element = /*#__PURE__*/React.createElement("button", nextPageButtonProps, nextPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
483
- if (props.template) {
484
- var defaultOptions = {
485
- onClick: props.onClick,
486
- className: className,
487
- iconClassName: iconClassName,
488
- disabled: props.disabled,
489
- element: element,
490
- nextPageLinkIcon: nextPageLinkIcon,
491
- props: props
492
- };
493
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
494
- }
495
- return element;
496
- });
497
- NextPageLink.displayName = 'NextPageLink';
498
-
499
- var PageLinks = /*#__PURE__*/React.memo(function (inProps) {
500
- var context = React.useContext(PrimeReactContext);
501
- var props = PageLinksBase.getProps(inProps, context);
502
- var ptm = props.ptm,
503
- cx = props.cx;
504
- var getPTOptions = function getPTOptions(pageLink, key) {
505
- return ptm(key, {
506
- hostName: props.hostName,
507
- context: {
508
- active: pageLink - 1 === props.page
509
- }
510
- });
511
- };
512
- var onPageLinkClick = function onPageLinkClick(event, pageLink) {
513
- if (props.onClick) {
514
- props.onClick({
515
- originalEvent: event,
516
- value: pageLink
517
- });
518
- }
519
- event.preventDefault();
520
- };
521
- var elements;
522
- if (props.value) {
523
- var startPageInView = props.value[0];
524
- var endPageInView = props.value[props.value.length - 1];
525
- elements = props.value.map(function (pageLink) {
526
- var className = classNames('p-paginator-page p-paginator-element p-link', {
527
- 'p-paginator-page-start': pageLink === startPageInView,
528
- 'p-paginator-page-end': pageLink === endPageInView,
529
- 'p-highlight': pageLink - 1 === props.page
530
- });
531
- var pageButtonProps = mergeProps({
532
- type: 'button',
533
- onClick: function onClick(e) {
534
- return onPageLinkClick(e, pageLink);
535
- },
536
- className: cx('pageButton', {
537
- pageLink: pageLink,
538
- startPageInView: startPageInView,
539
- endPageInView: endPageInView,
540
- page: props.page
541
- }),
542
- disabled: props.disabled,
543
- 'aria-label': ariaLabel('pageLabel', {
544
- page: pageLink
545
- })
546
- }, getPTOptions(pageLink, 'pageButton'));
547
- var element = /*#__PURE__*/React.createElement("button", pageButtonProps, pageLink, /*#__PURE__*/React.createElement(Ripple, null));
548
- if (props.template) {
549
- var defaultOptions = {
550
- onClick: function onClick(e) {
551
- return onPageLinkClick(e, pageLink);
552
- },
553
- className: className,
554
- view: {
555
- startPage: startPageInView - 1,
556
- endPage: endPageInView - 1
557
- },
558
- page: pageLink - 1,
559
- currentPage: props.page,
560
- totalPages: props.pageCount,
561
- element: element,
562
- props: props
563
- };
564
- element = ObjectUtils.getJSXElement(props.template, defaultOptions);
565
- }
566
- return /*#__PURE__*/React.createElement(React.Fragment, {
567
- key: pageLink
568
- }, element);
569
- });
570
- }
571
- var pagesProps = mergeProps({
572
- className: cx('pages')
573
- }, ptm('pages', {
574
- hostName: props.hostName
575
- }));
576
- return /*#__PURE__*/React.createElement("span", pagesProps, elements);
577
- });
578
- PageLinks.displayName = 'PageLinks';
579
-
580
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
581
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
582
- var PrevPageLink = /*#__PURE__*/React.memo(function (inProps) {
583
- var context = React.useContext(PrimeReactContext);
584
- var props = PrevPageLinkBase.getProps(inProps, context);
585
- var ptm = props.ptm,
586
- cx = props.cx;
587
- var getPTOptions = function getPTOptions(key) {
588
- return ptm(key, {
589
- hostName: props.hostName,
590
- context: {
591
- disabled: props.disabled
592
- }
593
- });
594
- };
595
- var className = classNames('p-paginator-prev p-paginator-element p-link', {
596
- 'p-disabled': props.disabled
597
- });
598
- var iconClassName = 'p-paginator-icon';
599
- var prevPageIconProps = mergeProps({
600
- className: cx('prevPageIcon')
601
- }, getPTOptions('prevPageIcon'));
602
- var icon = props.prevPageLinkIcon || /*#__PURE__*/React.createElement(AngleLeftIcon, prevPageIconProps);
603
- var prevPageLinkIcon = IconUtils.getJSXIcon(icon, _objectSpread$1({}, prevPageIconProps), {
604
- props: props
605
- });
606
- var prevPageButtonProps = mergeProps({
607
- type: 'button',
608
- className: cx('prevPageButton', {
609
- disabled: props.disabled
610
- }),
611
- onClick: props.onClick,
612
- disabled: props.disabled,
613
- 'aria-label': ariaLabel('previousPageLabel')
614
- }, getPTOptions('prevPageButton'));
615
- var element = /*#__PURE__*/React.createElement("button", prevPageButtonProps, prevPageLinkIcon, /*#__PURE__*/React.createElement(Ripple, null));
616
- if (props.template) {
617
- var defaultOptions = {
618
- onClick: props.onClick,
619
- className: className,
620
- iconClassName: iconClassName,
621
- disabled: props.disabled,
622
- element: element,
623
- props: props
624
- };
625
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
626
- }
627
- return element;
628
- });
629
- PrevPageLink.displayName = 'PrevPageLink';
630
-
631
- var RowsPerPageDropdown = /*#__PURE__*/React.memo(function (inProps) {
632
- var context = React.useContext(PrimeReactContext);
633
- var props = RowsPerPageDropdownBase.getProps(inProps, context);
634
- var hasOptions = props.options && props.options.length > 0;
635
- var options = hasOptions ? props.options.map(function (opt) {
636
- return {
637
- label: String(opt),
638
- value: opt
639
- };
640
- }) : [];
641
- var ariaLabel = localeOption('choose');
642
- var element = hasOptions ? /*#__PURE__*/React.createElement(Dropdown, {
643
- value: props.value,
644
- options: options,
645
- onChange: props.onChange,
646
- appendTo: props.appendTo,
647
- disabled: props.disabled,
648
- placeholder: ariaLabel,
649
- "aria-label": ariaLabel,
650
- pt: props.ptm('RPPDropdown'),
651
- unstyled: props.unstyled,
652
- __parentMetadata: {
653
- parent: props.metaData
654
- }
655
- }) : null;
656
- if (props.template) {
657
- var defaultOptions = {
658
- value: props.value,
659
- options: options,
660
- onChange: props.onChange,
661
- appendTo: props.appendTo,
662
- currentPage: props.page,
663
- totalPages: props.pageCount,
664
- totalRecords: props.totalRecords,
665
- disabled: props.disabled,
666
- element: element,
667
- props: props
668
- };
669
- return ObjectUtils.getJSXElement(props.template, defaultOptions);
670
- }
671
- return element;
672
- });
673
- RowsPerPageDropdown.displayName = 'RowsPerPageDropdown';
674
-
675
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
676
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
677
- var Paginator = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
678
- var context = React.useContext(PrimeReactContext);
679
- var props = PaginatorBase.getProps(inProps, context);
680
- var metaData = _objectSpread({
681
- props: props
682
- }, props.__parentMetadata);
683
- var _PaginatorBase$setMet = PaginatorBase.setMetaData(metaData),
684
- ptm = _PaginatorBase$setMet.ptm,
685
- cx = _PaginatorBase$setMet.cx,
686
- isUnstyled = _PaginatorBase$setMet.isUnstyled;
687
- useHandleStyle(PaginatorBase.css.styles, isUnstyled, {
688
- name: 'paginator'
689
- });
690
- var elementRef = React.useRef(null);
691
- var page = Math.floor(props.first / props.rows);
692
- var pageCount = Math.ceil(props.totalRecords / props.rows);
693
- var isFirstPage = page === 0;
694
- var isLastPage = page === pageCount - 1;
695
- var isEmpty = pageCount === 0;
696
- var calculatePageLinkBoundaries = function calculatePageLinkBoundaries() {
697
- var numberOfPages = pageCount;
698
- var visiblePages = Math.min(props.pageLinkSize, numberOfPages);
699
-
700
- //calculate range, keep current in middle if necessary
701
- var start = Math.max(0, Math.ceil(page - visiblePages / 2));
702
- var end = Math.min(numberOfPages - 1, start + visiblePages - 1);
703
-
704
- //check when approaching to last page
705
- var delta = props.pageLinkSize - (end - start + 1);
706
- start = Math.max(0, start - delta);
707
- return [start, end];
708
- };
709
- var updatePageLinks = function updatePageLinks() {
710
- var pageLinks = [];
711
- var boundaries = calculatePageLinkBoundaries();
712
- var start = boundaries[0];
713
- var end = boundaries[1];
714
- for (var i = start; i <= end; i++) {
715
- pageLinks.push(i + 1);
716
- }
717
- return pageLinks;
718
- };
719
- var changePage = function changePage(first, rows) {
720
- var pc = pageCount;
721
- var p = Math.floor(first / rows);
722
- if (p >= 0 && p < pc) {
723
- var newPageState = {
724
- first: first,
725
- rows: rows,
726
- page: p,
727
- pageCount: pc
728
- };
729
- if (props.onPageChange) {
730
- props.onPageChange(newPageState);
731
- }
732
- }
733
- };
734
- var changePageToFirst = function changePageToFirst(event) {
735
- changePage(0, props.rows);
736
- event.preventDefault();
737
- };
738
- var changePageToPrev = function changePageToPrev(event) {
739
- changePage(props.first - props.rows, props.rows);
740
- event.preventDefault();
741
- };
742
- var onPageLinkClick = function onPageLinkClick(event) {
743
- changePage((event.value - 1) * props.rows, props.rows);
744
- };
745
- var changePageToNext = function changePageToNext(event) {
746
- changePage(props.first + props.rows, props.rows);
747
- event.preventDefault();
748
- };
749
- var changePageToLast = function changePageToLast(event) {
750
- changePage((pageCount - 1) * props.rows, props.rows);
751
- event.preventDefault();
752
- };
753
- var onRowsChange = function onRowsChange(event) {
754
- var rows = event.value;
755
- changePage(0, rows);
756
- };
757
- React.useImperativeHandle(ref, function () {
758
- return {
759
- props: props,
760
- getElement: function getElement() {
761
- return elementRef.current;
762
- }
763
- };
764
- });
765
- useUpdateEffect(function () {
766
- if (page > 0 && props.first >= props.totalRecords) {
767
- changePage((pageCount - 1) * props.rows, props.rows);
768
- }
769
- }, [props.totalRecords]);
770
- var createElement = function createElement(key, template) {
771
- var element;
772
- switch (key) {
773
- case 'FirstPageLink':
774
- element = /*#__PURE__*/React.createElement(FirstPageLink, {
775
- hostName: "Paginator",
776
- key: key,
777
- onClick: changePageToFirst,
778
- disabled: isFirstPage || isEmpty,
779
- template: template,
780
- firstPageLinkIcon: props.firstPageLinkIcon,
781
- ptm: ptm,
782
- cx: cx
783
- });
784
- break;
785
- case 'PrevPageLink':
786
- element = /*#__PURE__*/React.createElement(PrevPageLink, {
787
- hostName: "Paginator",
788
- key: key,
789
- onClick: changePageToPrev,
790
- disabled: isFirstPage || isEmpty,
791
- template: template,
792
- prevPageLinkIcon: props.prevPageLinkIcon,
793
- ptm: ptm,
794
- cx: cx
795
- });
796
- break;
797
- case 'NextPageLink':
798
- element = /*#__PURE__*/React.createElement(NextPageLink, {
799
- hostName: "Paginator",
800
- key: key,
801
- onClick: changePageToNext,
802
- disabled: isLastPage || isEmpty,
803
- template: template,
804
- nextPageLinkIcon: props.nextPageLinkIcon,
805
- ptm: ptm,
806
- cx: cx
807
- });
808
- break;
809
- case 'LastPageLink':
810
- element = /*#__PURE__*/React.createElement(LastPageLink, {
811
- hostName: "Paginator",
812
- key: key,
813
- onClick: changePageToLast,
814
- disabled: isLastPage || isEmpty,
815
- template: template,
816
- lastPageLinkIcon: props.lastPageLinkIcon,
817
- ptm: ptm,
818
- cx: cx
819
- });
820
- break;
821
- case 'PageLinks':
822
- element = /*#__PURE__*/React.createElement(PageLinks, {
823
- hostName: "Paginator",
824
- key: key,
825
- value: updatePageLinks(),
826
- page: page,
827
- rows: props.rows,
828
- pageCount: pageCount,
829
- onClick: onPageLinkClick,
830
- template: template,
831
- ptm: ptm,
832
- cx: cx
833
- });
834
- break;
835
- case 'RowsPerPageDropdown':
836
- element = /*#__PURE__*/React.createElement(RowsPerPageDropdown, {
837
- hostName: "Paginator",
838
- key: key,
839
- value: props.rows,
840
- page: page,
841
- pageCount: pageCount,
842
- totalRecords: props.totalRecords,
843
- options: props.rowsPerPageOptions,
844
- onChange: onRowsChange,
845
- appendTo: props.dropdownAppendTo,
846
- template: template,
847
- disabled: isEmpty,
848
- unstyled: props.unstyled,
849
- ptm: ptm,
850
- cx: cx,
851
- metaData: metaData
852
- });
853
- break;
854
- case 'CurrentPageReport':
855
- element = /*#__PURE__*/React.createElement(CurrentPageReport, {
856
- hostName: "Paginator",
857
- reportTemplate: props.currentPageReportTemplate,
858
- key: key,
859
- page: page,
860
- pageCount: pageCount,
861
- first: props.first,
862
- rows: props.rows,
863
- totalRecords: props.totalRecords,
864
- template: template,
865
- ptm: ptm
866
- });
867
- break;
868
- case 'JumpToPageInput':
869
- element = /*#__PURE__*/React.createElement(JumpToPageInput, {
870
- hostName: "Paginator",
871
- key: key,
872
- rows: props.rows,
873
- page: page,
874
- pageCount: pageCount,
875
- onChange: changePage,
876
- disabled: isEmpty,
877
- template: template,
878
- ptm: ptm,
879
- unstyled: props.unstyled,
880
- metaData: metaData
881
- });
882
- break;
883
- default:
884
- element = null;
885
- break;
886
- }
887
- return element;
888
- };
889
- var createElements = function createElements() {
890
- var template = props.template;
891
- if (template) {
892
- if (_typeof(template) === 'object') {
893
- return template.layout ? template.layout.split(' ').map(function (value) {
894
- var key = value.trim();
895
- return createElement(key, template[key]);
896
- }) : Object.entries(template).map(function (_ref) {
897
- var _ref2 = _slicedToArray(_ref, 2),
898
- key = _ref2[0],
899
- _template = _ref2[1];
900
- return createElement(key, _template);
901
- });
902
- }
903
- return template.split(' ').map(function (value) {
904
- return createElement(value.trim());
905
- });
906
- }
907
- return null;
908
- };
909
- if (!props.alwaysShow && pageCount <= 1) {
910
- return null;
911
- } else {
912
- var leftContent = ObjectUtils.getJSXElement(props.leftContent, props);
913
- var rightContent = ObjectUtils.getJSXElement(props.rightContent, props);
914
- var elements = createElements();
915
- var leftProps = mergeProps({
916
- className: cx('left')
917
- }, ptm('left'));
918
- var leftElement = leftContent && /*#__PURE__*/React.createElement("div", leftProps, leftContent);
919
- var endProps = mergeProps({
920
- className: cx('end')
921
- }, ptm('end'));
922
- var rightElement = rightContent && /*#__PURE__*/React.createElement("div", endProps, rightContent);
923
- var rootProps = mergeProps({
924
- ref: elementRef,
925
- className: classNames(props.className, cx('root')),
926
- style: props.style
927
- }, PaginatorBase.getOtherProps(props), ptm('root'));
928
- return /*#__PURE__*/React.createElement("div", rootProps, leftElement, elements, rightElement);
929
- }
930
- }));
931
- Paginator.displayName = 'Paginator';
932
-
933
- export { Paginator };