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,801 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PrimeReact, { PrimeReactContext, ariaLabel } from 'primereact/api';
5
- import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
6
- import { usePrevious, useResizeListener, useMountEffect, useUpdateEffect } from 'primereact/hooks';
7
- import { ChevronDownIcon } from 'primereact/icons/chevrondown';
8
- import { ChevronLeftIcon } from 'primereact/icons/chevronleft';
9
- import { ChevronRightIcon } from 'primereact/icons/chevronright';
10
- import { ChevronUpIcon } from 'primereact/icons/chevronup';
11
- import { Ripple } from 'primereact/ripple';
12
- import { classNames, mergeProps, UniqueComponentId, DomHandler, ObjectUtils, IconUtils } from 'primereact/utils';
13
-
14
- function _typeof(o) {
15
- "@babel/helpers - typeof";
16
-
17
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
18
- return typeof o;
19
- } : function (o) {
20
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
21
- }, _typeof(o);
22
- }
23
-
24
- function _toPrimitive(input, hint) {
25
- if (_typeof(input) !== "object" || input === null) return input;
26
- var prim = input[Symbol.toPrimitive];
27
- if (prim !== undefined) {
28
- var res = prim.call(input, hint || "default");
29
- if (_typeof(res) !== "object") return res;
30
- throw new TypeError("@@toPrimitive must return a primitive value.");
31
- }
32
- return (hint === "string" ? String : Number)(input);
33
- }
34
-
35
- function _toPropertyKey(arg) {
36
- var key = _toPrimitive(arg, "string");
37
- return _typeof(key) === "symbol" ? key : String(key);
38
- }
39
-
40
- function _defineProperty(obj, key, value) {
41
- key = _toPropertyKey(key);
42
- if (key in obj) {
43
- Object.defineProperty(obj, key, {
44
- value: value,
45
- enumerable: true,
46
- configurable: true,
47
- writable: true
48
- });
49
- } else {
50
- obj[key] = value;
51
- }
52
- return obj;
53
- }
54
-
55
- function _extends() {
56
- _extends = Object.assign ? Object.assign.bind() : function (target) {
57
- for (var i = 1; i < arguments.length; i++) {
58
- var source = arguments[i];
59
- for (var key in source) {
60
- if (Object.prototype.hasOwnProperty.call(source, key)) {
61
- target[key] = source[key];
62
- }
63
- }
64
- }
65
- return target;
66
- };
67
- return _extends.apply(this, arguments);
68
- }
69
-
70
- function _arrayLikeToArray(arr, len) {
71
- if (len == null || len > arr.length) len = arr.length;
72
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
73
- return arr2;
74
- }
75
-
76
- function _arrayWithoutHoles(arr) {
77
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
78
- }
79
-
80
- function _iterableToArray(iter) {
81
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
82
- }
83
-
84
- function _unsupportedIterableToArray(o, minLen) {
85
- if (!o) return;
86
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
87
- var n = Object.prototype.toString.call(o).slice(8, -1);
88
- if (n === "Object" && o.constructor) n = o.constructor.name;
89
- if (n === "Map" || n === "Set") return Array.from(o);
90
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
91
- }
92
-
93
- function _nonIterableSpread() {
94
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
95
- }
96
-
97
- function _toConsumableArray(arr) {
98
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
99
- }
100
-
101
- function _arrayWithHoles(arr) {
102
- if (Array.isArray(arr)) return arr;
103
- }
104
-
105
- function _iterableToArrayLimit(r, l) {
106
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
107
- if (null != t) {
108
- var e,
109
- n,
110
- i,
111
- u,
112
- a = [],
113
- f = !0,
114
- o = !1;
115
- try {
116
- if (i = (t = t.call(r)).next, 0 === l) {
117
- if (Object(t) !== t) return;
118
- f = !1;
119
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
120
- } catch (r) {
121
- o = !0, n = r;
122
- } finally {
123
- try {
124
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
125
- } finally {
126
- if (o) throw n;
127
- }
128
- }
129
- return a;
130
- }
131
- }
132
-
133
- function _nonIterableRest() {
134
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
135
- }
136
-
137
- function _slicedToArray(arr, i) {
138
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
139
- }
140
-
141
- var styles = "\n@layer primereact {\n .p-carousel {\n display: flex;\n flex-direction: column;\n }\n \n .p-carousel-content {\n display: flex;\n flex-direction: column;\n overflow: auto;\n }\n \n .p-carousel-prev,\n .p-carousel-next {\n align-self: center;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-carousel-container {\n display: flex;\n flex-direction: row;\n }\n \n .p-carousel-items-content {\n overflow: hidden;\n width: 100%;\n }\n \n .p-carousel-items-container {\n display: flex;\n flex-direction: row;\n }\n \n .p-carousel-indicators {\n display: flex;\n flex-direction: row;\n justify-content: center;\n flex-wrap: wrap;\n }\n \n .p-carousel-indicator > button {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n /* Vertical */\n .p-carousel-vertical .p-carousel-container {\n flex-direction: column;\n }\n \n .p-carousel-vertical .p-carousel-items-container {\n flex-direction: column;\n height: 100%;\n }\n \n /* Keyboard Support */\n .p-items-hidden .p-carousel-item {\n visibility: hidden;\n }\n \n .p-items-hidden .p-carousel-item.p-carousel-item-active {\n visibility: visible;\n }\n}\n";
142
- var classes = {
143
- root: function root(_ref) {
144
- var isVertical = _ref.isVertical;
145
- return classNames('p-carousel p-component', {
146
- 'p-carousel-vertical': isVertical,
147
- 'p-carousel-horizontal': !isVertical
148
- });
149
- },
150
- container: 'p-carousel-container',
151
- content: 'p-carousel-content',
152
- indicators: 'p-carousel-indicators p-reset',
153
- header: 'p-carousel-header',
154
- footer: 'p-carousel-footer',
155
- itemsContainer: 'p-carousel-items-container',
156
- itemsContent: 'p-carousel-items-content',
157
- previousButton: function previousButton(_ref2) {
158
- var isDisabled = _ref2.isDisabled;
159
- return classNames('p-carousel-prev p-link', {
160
- 'p-disabled': isDisabled
161
- });
162
- },
163
- previousButtonIcon: 'p-carousel-prev-icon',
164
- nextButton: function nextButton(_ref3) {
165
- var isDisabled = _ref3.isDisabled;
166
- return classNames('p-carousel-next p-link', {
167
- 'p-disabled': isDisabled
168
- });
169
- },
170
- nextButtonIcon: 'p-carousel-next-icon',
171
- indicator: function indicator(_ref4) {
172
- var isActive = _ref4.isActive;
173
- return classNames('p-carousel-indicator', {
174
- 'p-highlight': isActive
175
- });
176
- },
177
- indicatorButton: 'p-link',
178
- itemCloned: function itemCloned(_ref5) {
179
- var props = _ref5.itemProps;
180
- return classNames(props.className, 'p-carousel-item', {
181
- 'p-carousel-item-active': props.active,
182
- 'p-carousel-item-start': props.start,
183
- 'p-carousel-item-end': props.end
184
- });
185
- },
186
- item: function item(_ref6) {
187
- var props = _ref6.itemProps;
188
- return classNames(props.className, 'p-carousel-item', {
189
- 'p-carousel-item-active': props.active,
190
- 'p-carousel-item-start': props.start,
191
- 'p-carousel-item-end': props.end
192
- });
193
- }
194
- };
195
- var inlineStyles = {
196
- itemsContent: function itemsContent(_ref7) {
197
- var height = _ref7.height;
198
- return {
199
- height: height
200
- };
201
- }
202
- };
203
- var CarouselBase = ComponentBase.extend({
204
- defaultProps: {
205
- __TYPE: 'Carousel',
206
- id: null,
207
- value: null,
208
- page: 0,
209
- header: null,
210
- footer: null,
211
- style: null,
212
- className: null,
213
- itemTemplate: null,
214
- circular: false,
215
- showIndicators: true,
216
- showNavigators: true,
217
- autoplayInterval: 0,
218
- numVisible: 1,
219
- numScroll: 1,
220
- prevIcon: null,
221
- nextIcon: null,
222
- responsiveOptions: null,
223
- orientation: 'horizontal',
224
- verticalViewPortHeight: '300px',
225
- contentClassName: null,
226
- containerClassName: null,
227
- indicatorsContentClassName: null,
228
- onPageChange: null,
229
- children: undefined
230
- },
231
- css: {
232
- classes: classes,
233
- styles: styles,
234
- inlineStyles: inlineStyles
235
- }
236
- });
237
-
238
- 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; }
239
- 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; }
240
- var CarouselItem = /*#__PURE__*/React.memo(function (props) {
241
- var ptm = props.ptm,
242
- cx = props.cx;
243
- var key = props.className && props.className === 'p-carousel-item-cloned' ? 'itemCloned' : 'item';
244
- var content = props.template(props.item);
245
- var itemClonedProps = mergeProps({
246
- className: cx(key, {
247
- itemProps: props
248
- }),
249
- 'data-p-carousel-item-active': props.active,
250
- 'data-p-carousel-item-start': props.start,
251
- 'data-p-carousel-item-end': props.end
252
- }, ptm(key));
253
- return /*#__PURE__*/React.createElement("div", itemClonedProps, content);
254
- });
255
- var Carousel = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
256
- var context = React.useContext(PrimeReactContext);
257
- var props = CarouselBase.getProps(inProps, context);
258
- var _React$useState = React.useState(props.numVisible),
259
- _React$useState2 = _slicedToArray(_React$useState, 2),
260
- numVisibleState = _React$useState2[0],
261
- setNumVisibleState = _React$useState2[1];
262
- var _React$useState3 = React.useState(props.numScroll),
263
- _React$useState4 = _slicedToArray(_React$useState3, 2),
264
- numScrollState = _React$useState4[0],
265
- setNumScrollState = _React$useState4[1];
266
- var _React$useState5 = React.useState(props.page * props.numScroll * -1),
267
- _React$useState6 = _slicedToArray(_React$useState5, 2),
268
- totalShiftedItemsState = _React$useState6[0],
269
- setTotalShiftedItemsState = _React$useState6[1];
270
- var _React$useState7 = React.useState(props.page),
271
- _React$useState8 = _slicedToArray(_React$useState7, 2),
272
- pageState = _React$useState8[0],
273
- setPageState = _React$useState8[1];
274
- var _CarouselBase$setMeta = CarouselBase.setMetaData({
275
- props: props,
276
- state: {
277
- numVisible: numVisibleState,
278
- numScroll: numScrollState,
279
- totalShiftedItems: totalShiftedItemsState,
280
- page: pageState
281
- }
282
- }),
283
- ptm = _CarouselBase$setMeta.ptm,
284
- cx = _CarouselBase$setMeta.cx,
285
- sx = _CarouselBase$setMeta.sx,
286
- isUnstyled = _CarouselBase$setMeta.isUnstyled;
287
- useHandleStyle(CarouselBase.css.styles, isUnstyled, {
288
- name: 'carousel'
289
- });
290
- var elementRef = React.useRef(null);
291
- var itemsContainerRef = React.useRef(null);
292
- var remainingItems = React.useRef(0);
293
- var allowAutoplay = React.useRef(!!props.autoplayInterval);
294
- var attributeSelector = React.useRef('');
295
- var swipeThreshold = React.useRef(20);
296
- var startPos = React.useRef(null);
297
- var interval = React.useRef(null);
298
- var carouselStyle = React.useRef(null);
299
- var isRemainingItemsAdded = React.useRef(false);
300
- var responsiveOptions = React.useRef(null);
301
- var prevNumScroll = usePrevious(numScrollState);
302
- var prevNumVisible = usePrevious(numVisibleState);
303
- var prevValue = usePrevious(props.value);
304
- var prevPage = usePrevious(props.page);
305
- var isVertical = props.orientation === 'vertical';
306
- var circular = props.circular || !!props.autoplayInterval;
307
- var isCircular = circular && props.value && props.value.length >= numVisibleState;
308
- var totalIndicators = props.value ? Math.max(Math.ceil((props.value.length - numVisibleState) / numScrollState) + 1, 0) : 0;
309
- var isAutoplay = totalIndicators && props.autoplayInterval && allowAutoplay.current;
310
- var isControlled = props.onPageChange && !isAutoplay;
311
- var currentPage = isControlled ? props.page : pageState;
312
- var getPTOptions = function getPTOptions(key, index) {
313
- return ptm(key, {
314
- context: {
315
- active: currentPage === index
316
- }
317
- });
318
- };
319
- var _useResizeListener = useResizeListener({
320
- listener: function listener() {
321
- calculatePosition();
322
- },
323
- when: props.responsiveOptions
324
- }),
325
- _useResizeListener2 = _slicedToArray(_useResizeListener, 1),
326
- bindWindowResizeListener = _useResizeListener2[0];
327
- var step = function step(dir, page) {
328
- var totalShiftedItems = totalShiftedItemsState;
329
- if (page != null) {
330
- totalShiftedItems = numScrollState * page * -1;
331
- if (isCircular) {
332
- totalShiftedItems -= numVisibleState;
333
- }
334
- isRemainingItemsAdded.current = false;
335
- } else {
336
- totalShiftedItems += numScrollState * dir;
337
- if (isRemainingItemsAdded.current) {
338
- totalShiftedItems += remainingItems.current - numScrollState * dir;
339
- isRemainingItemsAdded.current = false;
340
- }
341
- var originalShiftedItems = isCircular ? totalShiftedItems + numVisibleState : totalShiftedItems;
342
- page = Math.abs(Math.floor(originalShiftedItems / numScrollState));
343
- }
344
- if (isCircular && pageState === totalIndicators - 1 && dir === -1) {
345
- totalShiftedItems = -1 * (props.value.length + numVisibleState);
346
- page = 0;
347
- } else if (isCircular && pageState === 0 && dir === 1) {
348
- totalShiftedItems = 0;
349
- page = totalIndicators - 1;
350
- } else if (page === totalIndicators - 1 && remainingItems.current > 0) {
351
- totalShiftedItems += remainingItems.current * -1 - numScrollState * dir;
352
- isRemainingItemsAdded.current = true;
353
- }
354
- if (itemsContainerRef.current) {
355
- !isUnstyled() && DomHandler.removeClass(itemsContainerRef.current, 'p-items-hidden');
356
- changePosition(totalShiftedItems);
357
- itemsContainerRef.current.style.transition = 'transform 500ms ease 0s';
358
- }
359
- changePage(page);
360
- setTotalShiftedItemsState(totalShiftedItems);
361
- };
362
- var calculatePosition = function calculatePosition() {
363
- if (itemsContainerRef.current && responsiveOptions.current) {
364
- var windowWidth = window.innerWidth;
365
- var matchedResponsiveData = {
366
- numVisible: props.numVisible,
367
- numScroll: props.numScroll
368
- };
369
- for (var i = 0; i < responsiveOptions.current.length; i++) {
370
- var res = responsiveOptions.current[i];
371
- if (parseInt(res.breakpoint, 10) >= windowWidth) {
372
- matchedResponsiveData = res;
373
- }
374
- }
375
- if (numScrollState !== matchedResponsiveData.numScroll) {
376
- var page = Math.floor(currentPage * numScrollState / matchedResponsiveData.numScroll);
377
- var totalShiftedItems = matchedResponsiveData.numScroll * page * -1;
378
- if (isCircular) {
379
- totalShiftedItems -= matchedResponsiveData.numVisible;
380
- }
381
- setTotalShiftedItemsState(totalShiftedItems);
382
- setNumScrollState(matchedResponsiveData.numScroll);
383
- changePage(page);
384
- }
385
- if (numVisibleState !== matchedResponsiveData.numVisible) {
386
- setNumVisibleState(matchedResponsiveData.numVisible);
387
- }
388
- }
389
- };
390
- var navBackward = function navBackward(e, page) {
391
- if (circular || currentPage !== 0) {
392
- step(1, page);
393
- }
394
- allowAutoplay.current = false;
395
- if (e.cancelable) {
396
- e.preventDefault();
397
- }
398
- };
399
- var navForward = function navForward(e, page) {
400
- if (circular || currentPage < totalIndicators - 1) {
401
- step(-1, page);
402
- }
403
- allowAutoplay.current = false;
404
- if (e.cancelable) {
405
- e.preventDefault();
406
- }
407
- };
408
- var onDotClick = function onDotClick(e, page) {
409
- if (page > currentPage) {
410
- navForward(e, page);
411
- } else if (page < currentPage) {
412
- navBackward(e, page);
413
- }
414
- };
415
- var onTransitionEnd = function onTransitionEnd(e) {
416
- if (itemsContainerRef.current && e.propertyName === 'transform') {
417
- DomHandler.addClass(itemsContainerRef.current, 'p-items-hidden');
418
- itemsContainerRef.current.style.transition = '';
419
- if ((pageState === 0 || pageState === totalIndicators - 1) && isCircular) {
420
- changePosition(totalShiftedItemsState);
421
- }
422
- }
423
- };
424
- var _onTouchStart = function onTouchStart(e) {
425
- var touchobj = e.changedTouches[0];
426
- startPos.current = {
427
- x: touchobj.pageX,
428
- y: touchobj.pageY
429
- };
430
- };
431
- var _onTouchMove = function onTouchMove(e) {
432
- if (e.cancelable) {
433
- e.preventDefault();
434
- }
435
- };
436
- var _onTouchEnd = function onTouchEnd(e) {
437
- var touchobj = e.changedTouches[0];
438
- if (isVertical) {
439
- changePageOnTouch(e, touchobj.pageY - startPos.current.y);
440
- } else {
441
- changePageOnTouch(e, touchobj.pageX - startPos.current.x);
442
- }
443
- };
444
- var changePageOnTouch = function changePageOnTouch(e, diff) {
445
- if (Math.abs(diff) > swipeThreshold.current) {
446
- if (diff < 0) {
447
- // left
448
- navForward(e);
449
- } else {
450
- // right
451
- navBackward(e);
452
- }
453
- }
454
- };
455
- var startAutoplay = function startAutoplay() {
456
- if (props.autoplayInterval > 0) {
457
- interval.current = setInterval(function () {
458
- if (pageState === totalIndicators - 1) {
459
- step(-1, 0);
460
- } else {
461
- step(-1, pageState + 1);
462
- }
463
- }, props.autoplayInterval);
464
- }
465
- };
466
- var stopAutoplay = function stopAutoplay() {
467
- if (interval.current) {
468
- clearInterval(interval.current);
469
- }
470
- };
471
- var createStyle = function createStyle() {
472
- if (!carouselStyle.current) {
473
- carouselStyle.current = DomHandler.createInlineStyle(context && context.nonce || PrimeReact.nonce);
474
- }
475
- var innerHTML = "\n .p-carousel[".concat(attributeSelector.current, "] .p-carousel-item {\n flex: 1 0 ").concat(100 / numVisibleState, "%\n }\n ");
476
- if (props.responsiveOptions) {
477
- var comparator = ObjectUtils.localeComparator(context && context.locale || PrimeReact.locale);
478
- responsiveOptions.current = _toConsumableArray(props.responsiveOptions);
479
- responsiveOptions.current.sort(function (data1, data2) {
480
- var value1 = data1.breakpoint;
481
- var value2 = data2.breakpoint;
482
- return ObjectUtils.sort(value1, value2, -1, comparator, context && context.nullSortOrder || PrimeReact.nullSortOrder);
483
- });
484
- for (var i = 0; i < responsiveOptions.current.length; i++) {
485
- var res = responsiveOptions.current[i];
486
- innerHTML += "\n @media screen and (max-width: ".concat(res.breakpoint, ") {\n .p-carousel[").concat(attributeSelector.current, "] .p-carousel-item {\n flex: 1 0 ").concat(100 / res.numVisible, "%\n }\n }\n ");
487
- }
488
- }
489
- carouselStyle.current.innerHTML = innerHTML;
490
- };
491
- var destroyStyle = function destroyStyle() {
492
- carouselStyle.current = DomHandler.removeInlineStyle(carouselStyle.current);
493
- };
494
- var changePosition = function changePosition(totalShiftedItems) {
495
- if (itemsContainerRef.current) {
496
- itemsContainerRef.current.style.transform = isVertical ? "translate3d(0, ".concat(totalShiftedItems * (100 / numVisibleState), "%, 0)") : "translate3d(".concat(totalShiftedItems * (100 / numVisibleState), "%, 0, 0)");
497
- }
498
- };
499
- var changePage = function changePage(page) {
500
- !isControlled && setPageState(page);
501
- props.onPageChange && props.onPageChange({
502
- page: page
503
- });
504
- };
505
- React.useImperativeHandle(ref, function () {
506
- return {
507
- props: props,
508
- startAutoplay: startAutoplay,
509
- stopAutoplay: stopAutoplay,
510
- getElement: function getElement() {
511
- return elementRef.current;
512
- }
513
- };
514
- });
515
- useMountEffect(function () {
516
- if (elementRef.current) {
517
- attributeSelector.current = UniqueComponentId();
518
- elementRef.current.setAttribute(attributeSelector.current, '');
519
- }
520
- if (!carouselStyle.current) {
521
- calculatePosition();
522
- changePosition(totalShiftedItemsState);
523
- bindWindowResizeListener();
524
- }
525
- });
526
- useUpdateEffect(function () {
527
- var stateChanged = false;
528
- var totalShiftedItems = totalShiftedItemsState;
529
- createStyle();
530
- if (props.autoplayInterval) {
531
- stopAutoplay();
532
- }
533
- if (prevNumScroll !== numScrollState || prevNumVisible !== numVisibleState || props.value && prevValue && prevValue.length !== props.value.length) {
534
- remainingItems.current = (props.value.length - numVisibleState) % numScrollState;
535
- var page = currentPage;
536
- if (totalIndicators !== 0 && page >= totalIndicators) {
537
- page = totalIndicators - 1;
538
- changePage(page);
539
- stateChanged = true;
540
- }
541
- totalShiftedItems = page * numScrollState * -1;
542
- if (isCircular) {
543
- totalShiftedItems -= numVisibleState;
544
- }
545
- if (page === totalIndicators - 1 && remainingItems.current > 0) {
546
- totalShiftedItems += -1 * remainingItems.current + numScrollState;
547
- isRemainingItemsAdded.current = true;
548
- } else {
549
- isRemainingItemsAdded.current = false;
550
- }
551
- if (totalShiftedItems !== totalShiftedItemsState) {
552
- setTotalShiftedItemsState(totalShiftedItems);
553
- stateChanged = true;
554
- }
555
- changePosition(totalShiftedItems);
556
- }
557
- if (isCircular) {
558
- if (pageState === 0) {
559
- totalShiftedItems = -1 * numVisibleState;
560
- } else if (totalShiftedItems === 0) {
561
- totalShiftedItems = -1 * props.value.length;
562
- if (remainingItems.current > 0) {
563
- isRemainingItemsAdded.current = true;
564
- }
565
- }
566
- if (totalShiftedItems !== totalShiftedItemsState) {
567
- setTotalShiftedItemsState(totalShiftedItems);
568
- stateChanged = true;
569
- }
570
- }
571
- if (prevPage !== props.page) {
572
- if (props.page > prevPage && props.page <= totalIndicators - 1) {
573
- step(-1, props.page);
574
- } else if (props.page < prevPage) {
575
- step(1, props.page);
576
- }
577
- }
578
- if (!stateChanged && isAutoplay) {
579
- startAutoplay();
580
- }
581
- return function () {
582
- if (props.autoplayInterval) {
583
- stopAutoplay();
584
- }
585
- destroyStyle();
586
- };
587
- });
588
- var createItems = function createItems() {
589
- if (props.value && props.value.length) {
590
- var clonedItemsForStarting = null;
591
- var clonedItemsForFinishing = null;
592
- if (isCircular) {
593
- var clonedElements = null;
594
- clonedElements = props.value.slice(-1 * numVisibleState);
595
- clonedItemsForStarting = clonedElements.map(function (item, index) {
596
- var isActive = totalShiftedItemsState * -1 === props.value.length + numVisibleState;
597
- var start = index === 0;
598
- var end = index === clonedElements.length - 1;
599
- var key = index + '_scloned';
600
- return /*#__PURE__*/React.createElement(CarouselItem, {
601
- key: key,
602
- className: "p-carousel-item-cloned",
603
- template: props.itemTemplate,
604
- item: item,
605
- active: isActive,
606
- start: start,
607
- end: end,
608
- ptm: ptm,
609
- cx: cx
610
- });
611
- });
612
- clonedElements = props.value.slice(0, numVisibleState);
613
- clonedItemsForFinishing = clonedElements.map(function (item, index) {
614
- var isActive = totalShiftedItemsState === 0;
615
- var start = index === 0;
616
- var end = index === clonedElements.length - 1;
617
- var key = index + '_fcloned';
618
- return /*#__PURE__*/React.createElement(CarouselItem, {
619
- key: key,
620
- className: "p-carousel-item-cloned",
621
- template: props.itemTemplate,
622
- item: item,
623
- active: isActive,
624
- start: start,
625
- end: end,
626
- ptm: ptm,
627
- cx: cx
628
- });
629
- });
630
- }
631
- var items = props.value.map(function (item, index) {
632
- var firstIndex = isCircular ? -1 * (totalShiftedItemsState + numVisibleState) : totalShiftedItemsState * -1;
633
- var lastIndex = firstIndex + numVisibleState - 1;
634
- var isActive = firstIndex <= index && lastIndex >= index;
635
- var start = firstIndex === index;
636
- var end = lastIndex === index;
637
- return /*#__PURE__*/React.createElement(CarouselItem, {
638
- key: index,
639
- template: props.itemTemplate,
640
- item: item,
641
- active: isActive,
642
- start: start,
643
- end: end,
644
- ptm: ptm,
645
- cx: cx
646
- });
647
- });
648
- return /*#__PURE__*/React.createElement(React.Fragment, null, clonedItemsForStarting, items, clonedItemsForFinishing);
649
- }
650
- };
651
- var createHeader = function createHeader() {
652
- if (props.header) {
653
- var headerProps = mergeProps({
654
- className: cx('header')
655
- }, ptm('header'));
656
- return /*#__PURE__*/React.createElement("div", headerProps, props.header);
657
- }
658
- return null;
659
- };
660
- var createFooter = function createFooter() {
661
- if (props.footer) {
662
- var footerProps = mergeProps({
663
- className: cx('footer')
664
- }, ptm('footer'));
665
- return /*#__PURE__*/React.createElement("div", footerProps, props.footer);
666
- }
667
- return null;
668
- };
669
- var createContent = function createContent() {
670
- var items = createItems();
671
- var height = isVertical ? props.verticalViewPortHeight : 'auto';
672
- var backwardNavigator = createBackwardNavigator();
673
- var forwardNavigator = createForwardNavigator();
674
- var itemsContentProps = mergeProps({
675
- className: cx('itemsContent'),
676
- style: sx('itemsContent', {
677
- height: height
678
- }),
679
- onTouchStart: function onTouchStart(e) {
680
- return _onTouchStart(e);
681
- },
682
- onTouchMove: function onTouchMove(e) {
683
- return _onTouchMove(e);
684
- },
685
- onTouchEnd: function onTouchEnd(e) {
686
- return _onTouchEnd(e);
687
- }
688
- }, ptm('itemsContent'));
689
- var containerProps = mergeProps({
690
- className: classNames(props.containerClassName, cx('container'))
691
- }, ptm('container'));
692
- var itemsContainerProps = mergeProps({
693
- className: cx('itemsContainer'),
694
- onTransitionEnd: onTransitionEnd
695
- }, ptm('itemsContainer'));
696
- return /*#__PURE__*/React.createElement("div", containerProps, backwardNavigator, /*#__PURE__*/React.createElement("div", itemsContentProps, /*#__PURE__*/React.createElement("div", _extends({
697
- ref: itemsContainerRef
698
- }, itemsContainerProps), items)), forwardNavigator);
699
- };
700
- var createBackwardNavigator = function createBackwardNavigator() {
701
- if (props.showNavigators) {
702
- var isDisabled = (!circular || props.value && props.value.length < numVisibleState) && currentPage === 0;
703
- var previousButtonIconProps = mergeProps({
704
- className: cx('previousButtonIcon')
705
- }, ptm('previousButtonIcon'));
706
- var icon = isVertical ? props.prevIcon || /*#__PURE__*/React.createElement(ChevronUpIcon, previousButtonIconProps) : props.prevIcon || /*#__PURE__*/React.createElement(ChevronLeftIcon, previousButtonIconProps);
707
- var backwardNavigatorIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, previousButtonIconProps), {
708
- props: props
709
- });
710
- var previousButtonProps = mergeProps({
711
- type: 'button',
712
- className: cx('previousButton', {
713
- isDisabled: isDisabled
714
- }),
715
- onClick: function onClick(e) {
716
- return navBackward(e);
717
- },
718
- disabled: isDisabled,
719
- 'aria-label': ariaLabel('previousPageLabel')
720
- }, ptm('previousButton'));
721
- return /*#__PURE__*/React.createElement("button", previousButtonProps, backwardNavigatorIcon, /*#__PURE__*/React.createElement(Ripple, null));
722
- }
723
- return null;
724
- };
725
- var createForwardNavigator = function createForwardNavigator() {
726
- if (props.showNavigators) {
727
- var isDisabled = (!circular || props.value && props.value.length < numVisibleState) && (currentPage === totalIndicators - 1 || totalIndicators === 0);
728
- var nextButtonIconProps = mergeProps({
729
- className: cx('nextButtonIcon')
730
- }, ptm('nextButtonIcon'));
731
- var icon = isVertical ? props.nextIcon || /*#__PURE__*/React.createElement(ChevronDownIcon, nextButtonIconProps) : props.nextIcon || /*#__PURE__*/React.createElement(ChevronRightIcon, nextButtonIconProps);
732
- var forwardNavigatorIcon = IconUtils.getJSXIcon(icon, _objectSpread({}, nextButtonIconProps), {
733
- props: props
734
- });
735
- var nextButtonProps = mergeProps({
736
- type: 'button',
737
- className: cx('nextButton', {
738
- isDisabled: isDisabled
739
- }),
740
- onClick: function onClick(e) {
741
- return navForward(e);
742
- },
743
- disabled: isDisabled,
744
- 'aria-label': ariaLabel('nextPageLabel')
745
- }, ptm('nextButton'));
746
- return /*#__PURE__*/React.createElement("button", nextButtonProps, forwardNavigatorIcon, /*#__PURE__*/React.createElement(Ripple, null));
747
- }
748
- return null;
749
- };
750
- var createIndicator = function createIndicator(index) {
751
- var isActive = currentPage === index;
752
- var key = 'carousel-indicator-' + index;
753
- var indicatorProps = mergeProps({
754
- key: key,
755
- className: cx('indicator', {
756
- isActive: isActive
757
- }),
758
- 'data-p-highlight': isActive
759
- }, getPTOptions('indicator'));
760
- var indicatorButtonProps = mergeProps({
761
- type: 'button',
762
- className: cx('indicatorButton'),
763
- onClick: function onClick(e) {
764
- return onDotClick(e, index);
765
- },
766
- 'aria-label': "".concat(ariaLabel('pageLabel'), " ").concat(index + 1)
767
- }, getPTOptions('indicatorButton'));
768
- return /*#__PURE__*/React.createElement("li", indicatorProps, /*#__PURE__*/React.createElement("button", indicatorButtonProps, /*#__PURE__*/React.createElement(Ripple, null)));
769
- };
770
- var createIndicators = function createIndicators() {
771
- if (props.showIndicators) {
772
- var _indicators = [];
773
- for (var i = 0; i < totalIndicators; i++) {
774
- _indicators.push(createIndicator(i));
775
- }
776
- var indicatorsProps = mergeProps({
777
- className: classNames(props.indicatorsContentClassName, cx('indicators'))
778
- }, ptm('indicators'));
779
- return /*#__PURE__*/React.createElement("ul", indicatorsProps, _indicators);
780
- }
781
- return null;
782
- };
783
- var content = createContent();
784
- var indicators = createIndicators();
785
- var header = createHeader();
786
- var footer = createFooter();
787
- var rootProps = mergeProps({
788
- id: props.id,
789
- ref: elementRef,
790
- className: classNames(props.className, cx('root')),
791
- style: props.style
792
- }, CarouselBase.getOtherProps(props), ptm('root'));
793
- var contentProps = mergeProps({
794
- className: classNames(props.contentClassName, cx('content'))
795
- }, ptm('content'));
796
- return /*#__PURE__*/React.createElement("div", rootProps, header, /*#__PURE__*/React.createElement("div", contentProps, content, indicators), footer);
797
- }));
798
- CarouselItem.displayName = 'CarouselItem';
799
- Carousel.displayName = 'Carousel';
800
-
801
- export { Carousel };