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
package/chip/chip.esm.js DELETED
@@ -1,248 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { PrimeReactContext } from 'primereact/api';
5
- import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
6
- import { TimesCircleIcon } from 'primereact/icons/timescircle';
7
- import { classNames, ObjectUtils, mergeProps, IconUtils } from 'primereact/utils';
8
-
9
- function _typeof(o) {
10
- "@babel/helpers - typeof";
11
-
12
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
13
- return typeof o;
14
- } : function (o) {
15
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
16
- }, _typeof(o);
17
- }
18
-
19
- function _toPrimitive(input, hint) {
20
- if (_typeof(input) !== "object" || input === null) return input;
21
- var prim = input[Symbol.toPrimitive];
22
- if (prim !== undefined) {
23
- var res = prim.call(input, hint || "default");
24
- if (_typeof(res) !== "object") return res;
25
- throw new TypeError("@@toPrimitive must return a primitive value.");
26
- }
27
- return (hint === "string" ? String : Number)(input);
28
- }
29
-
30
- function _toPropertyKey(arg) {
31
- var key = _toPrimitive(arg, "string");
32
- return _typeof(key) === "symbol" ? key : String(key);
33
- }
34
-
35
- function _defineProperty(obj, key, value) {
36
- key = _toPropertyKey(key);
37
- if (key in obj) {
38
- Object.defineProperty(obj, key, {
39
- value: value,
40
- enumerable: true,
41
- configurable: true,
42
- writable: true
43
- });
44
- } else {
45
- obj[key] = value;
46
- }
47
- return obj;
48
- }
49
-
50
- function _extends() {
51
- _extends = Object.assign ? Object.assign.bind() : function (target) {
52
- for (var i = 1; i < arguments.length; i++) {
53
- var source = arguments[i];
54
- for (var key in source) {
55
- if (Object.prototype.hasOwnProperty.call(source, key)) {
56
- target[key] = source[key];
57
- }
58
- }
59
- }
60
- return target;
61
- };
62
- return _extends.apply(this, arguments);
63
- }
64
-
65
- function _arrayWithHoles(arr) {
66
- if (Array.isArray(arr)) return arr;
67
- }
68
-
69
- function _iterableToArrayLimit(r, l) {
70
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
71
- if (null != t) {
72
- var e,
73
- n,
74
- i,
75
- u,
76
- a = [],
77
- f = !0,
78
- o = !1;
79
- try {
80
- if (i = (t = t.call(r)).next, 0 === l) {
81
- if (Object(t) !== t) return;
82
- f = !1;
83
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
84
- } catch (r) {
85
- o = !0, n = r;
86
- } finally {
87
- try {
88
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
89
- } finally {
90
- if (o) throw n;
91
- }
92
- }
93
- return a;
94
- }
95
- }
96
-
97
- function _arrayLikeToArray(arr, len) {
98
- if (len == null || len > arr.length) len = arr.length;
99
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
100
- return arr2;
101
- }
102
-
103
- function _unsupportedIterableToArray(o, minLen) {
104
- if (!o) return;
105
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
106
- var n = Object.prototype.toString.call(o).slice(8, -1);
107
- if (n === "Object" && o.constructor) n = o.constructor.name;
108
- if (n === "Map" || n === "Set") return Array.from(o);
109
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
110
- }
111
-
112
- function _nonIterableRest() {
113
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
114
- }
115
-
116
- function _slicedToArray(arr, i) {
117
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
118
- }
119
-
120
- var classes = {
121
- root: function root(_ref) {
122
- var props = _ref.props;
123
- return classNames('p-chip p-component', {
124
- 'p-chip-image': props.image != null
125
- });
126
- },
127
- removeIcon: 'p-chip-remove-icon',
128
- icon: 'p-chip-icon',
129
- label: 'p-chip-text'
130
- };
131
- var styles = "\n@layer primereact {\n .p-chip {\n display: inline-flex;\n align-items: center;\n }\n \n .p-chip-text {\n line-height: 1.5;\n }\n \n .p-chip-icon.pi {\n line-height: 1.5;\n }\n \n .p-chip .p-chip-remove-icon {\n line-height: 1.5;\n cursor: pointer;\n }\n \n .p-chip img {\n border-radius: 50%;\n }\n}\n";
132
- var ChipBase = ComponentBase.extend({
133
- defaultProps: {
134
- __TYPE: 'Chip',
135
- label: null,
136
- icon: null,
137
- image: null,
138
- removable: false,
139
- removeIcon: null,
140
- className: null,
141
- style: null,
142
- template: null,
143
- imageAlt: 'chip',
144
- onImageError: null,
145
- onRemove: null,
146
- children: undefined
147
- },
148
- css: {
149
- classes: classes,
150
- styles: styles
151
- }
152
- });
153
-
154
- 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; }
155
- 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; }
156
- var Chip = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
157
- var context = React.useContext(PrimeReactContext);
158
- var props = ChipBase.getProps(inProps, context);
159
- var elementRef = React.useRef(null);
160
- var _React$useState = React.useState(true),
161
- _React$useState2 = _slicedToArray(_React$useState, 2),
162
- visibleState = _React$useState2[0],
163
- setVisibleState = _React$useState2[1];
164
- var _ChipBase$setMetaData = ChipBase.setMetaData({
165
- props: props
166
- }),
167
- ptm = _ChipBase$setMetaData.ptm,
168
- cx = _ChipBase$setMetaData.cx,
169
- isUnstyled = _ChipBase$setMetaData.isUnstyled;
170
- useHandleStyle(ChipBase.css.styles, isUnstyled, {
171
- name: 'chip'
172
- });
173
- var onKeyDown = function onKeyDown(event) {
174
- if (event.keyCode === 13) {
175
- // enter
176
- close(event);
177
- }
178
- };
179
- var close = function close(event) {
180
- setVisibleState(false);
181
- if (props.onRemove) {
182
- props.onRemove(event);
183
- }
184
- };
185
- var createContent = function createContent() {
186
- var content = [];
187
- var removeIconProps = mergeProps({
188
- key: 'removeIcon',
189
- tabIndex: 0,
190
- className: cx('removeIcon'),
191
- onClick: close,
192
- onKeyDown: onKeyDown
193
- }, ptm('removeIcon'));
194
- var icon = props.removeIcon || /*#__PURE__*/React.createElement(TimesCircleIcon, removeIconProps);
195
- if (props.image) {
196
- var imageProps = mergeProps({
197
- key: 'image',
198
- src: props.image,
199
- onError: props.onImageError
200
- }, ptm('image'));
201
- content.push( /*#__PURE__*/React.createElement("img", _extends({
202
- alt: props.imageAlt
203
- }, imageProps)));
204
- } else if (props.icon) {
205
- var chipIconProps = mergeProps({
206
- key: 'icon',
207
- className: cx('icon')
208
- }, ptm('icon'));
209
- content.push(IconUtils.getJSXIcon(props.icon, _objectSpread({}, chipIconProps), {
210
- props: props
211
- }));
212
- }
213
- if (props.label) {
214
- var labelProps = mergeProps({
215
- key: 'label',
216
- className: cx('label')
217
- }, ptm('label'));
218
- content.push( /*#__PURE__*/React.createElement("span", labelProps, props.label));
219
- }
220
- if (props.removable) {
221
- content.push(IconUtils.getJSXIcon(icon, _objectSpread({}, removeIconProps), {
222
- props: props
223
- }));
224
- }
225
- return content;
226
- };
227
- var createElement = function createElement() {
228
- var content = props.template ? ObjectUtils.getJSXElement(props.template, props) : createContent();
229
- var rootProps = mergeProps({
230
- ref: elementRef,
231
- style: props.style,
232
- className: classNames(props.className, cx('root'))
233
- }, ChipBase.getOtherProps(props), ptm('root'));
234
- return /*#__PURE__*/React.createElement("div", rootProps, content);
235
- };
236
- React.useImperativeHandle(ref, function () {
237
- return {
238
- props: props,
239
- getElement: function getElement() {
240
- return elementRef.current;
241
- }
242
- };
243
- });
244
- return visibleState && createElement();
245
- }));
246
- Chip.displayName = 'Chip';
247
-
248
- export { Chip };
@@ -1 +0,0 @@
1
- import*as e from"react";import{PrimeReactContext as r}from"primereact/api";import{ComponentBase as t,useHandleStyle as n}from"primereact/componentbase";import{TimesCircleIcon as o}from"primereact/icons/timescircle";import{classNames as i,ObjectUtils as l,mergeProps as a,IconUtils as c}from"primereact/utils";function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function u(e,r){if("object"!==p(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}function s(e){var r=u(e,"string");return"symbol"===p(r)?r:String(r)}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},m.apply(this,arguments)}function f(e){if(Array.isArray(e))return e}function y(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i,l,a=[],c=!0,p=!1;try{if(i=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=i.call(t)).done)&&(a.push(n.value),a.length!==r);c=!0);}catch(e){p=!0,o=e}finally{try{if(!c&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(p)throw o}}return a}}function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function v(e,r){if(e){if("string"==typeof e)return b(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b(e,r):void 0}}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=t.extend({defaultProps:{__TYPE:"Chip",label:null,icon:null,image:null,removable:!1,removeIcon:null,className:null,style:null,template:null,imageAlt:"chip",onImageError:null,onRemove:null,children:void 0},css:{classes:{root:function(e){return i("p-chip p-component",{"p-chip-image":null!=e.props.image})},removeIcon:"p-chip-remove-icon",icon:"p-chip-icon",label:"p-chip-text"},styles:"\n@layer primereact {\n .p-chip {\n display: inline-flex;\n align-items: center;\n }\n \n .p-chip-text {\n line-height: 1.5;\n }\n \n .p-chip-icon.pi {\n line-height: 1.5;\n }\n \n .p-chip .p-chip-remove-icon {\n line-height: 1.5;\n cursor: pointer;\n }\n \n .p-chip img {\n border-radius: 50%;\n }\n}\n"}});function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function O(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){var n,o,i;n=e,i=t[r],(o=s(o=r))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var j=e.memo(e.forwardRef((function(t,p){var u,s,b=e.useContext(r),d=h.getProps(t,b),j=e.useRef(null),S=e.useState(!0),w=(s=2,f(u=S)||y(u,s)||v(u,s)||g()),P=w[0],I=w[1],E=h.setMetaData({props:d}),x=E.ptm,A=E.cx;n(h.css.styles,E.isUnstyled,{name:"chip"});var N,k,C=function(e){13===e.keyCode&&D(e)},D=function(e){I(!1),d.onRemove&&d.onRemove(e)},R=function(){var r=[],t=a({key:"removeIcon",tabIndex:0,className:A("removeIcon"),onClick:D,onKeyDown:C},x("removeIcon")),n=d.removeIcon||e.createElement(o,t);if(d.image){var i=a({key:"image",src:d.image,onError:d.onImageError},x("image"));r.push(e.createElement("img",m({alt:d.imageAlt},i)))}else if(d.icon){var l=a({key:"icon",className:A("icon")},x("icon"));r.push(c.getJSXIcon(d.icon,O({},l),{props:d}))}if(d.label){var p=a({key:"label",className:A("label")},x("label"));r.push(e.createElement("span",p,d.label))}return d.removable&&r.push(c.getJSXIcon(n,O({},t),{props:d})),r};return e.useImperativeHandle(p,(function(){return{props:d,getElement:function(){return j.current}}})),P&&(N=d.template?l.getJSXElement(d.template,d):R(),k=a({ref:j,style:d.style,className:i(d.className,A("root"))},h.getOtherProps(d),x("root")),e.createElement("div",k,N))})));j.displayName="Chip";export{j as Chip};