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,567 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PrimeReact, { PrimeReactContext, localeOption } from 'primereact/api';
5
- import { ComponentBase, useHandleStyle } from 'primereact/componentbase';
6
- import { CSSTransition } from 'primereact/csstransition';
7
- import { useOverlayListener, useUnmountEffect } from 'primereact/hooks';
8
- import { EyeIcon } from 'primereact/icons/eye';
9
- import { EyeSlashIcon } from 'primereact/icons/eyeslash';
10
- import { InputText } from 'primereact/inputtext';
11
- import { OverlayService } from 'primereact/overlayservice';
12
- import { Portal } from 'primereact/portal';
13
- import { classNames, ObjectUtils, DomHandler, ZIndexUtils, mergeProps, IconUtils } from 'primereact/utils';
14
-
15
- function _extends() {
16
- _extends = Object.assign ? Object.assign.bind() : function (target) {
17
- for (var i = 1; i < arguments.length; i++) {
18
- var source = arguments[i];
19
- for (var key in source) {
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
- return target;
26
- };
27
- return _extends.apply(this, arguments);
28
- }
29
-
30
- function _typeof(o) {
31
- "@babel/helpers - typeof";
32
-
33
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
34
- return typeof o;
35
- } : function (o) {
36
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
37
- }, _typeof(o);
38
- }
39
-
40
- function _toPrimitive(input, hint) {
41
- if (_typeof(input) !== "object" || input === null) return input;
42
- var prim = input[Symbol.toPrimitive];
43
- if (prim !== undefined) {
44
- var res = prim.call(input, hint || "default");
45
- if (_typeof(res) !== "object") return res;
46
- throw new TypeError("@@toPrimitive must return a primitive value.");
47
- }
48
- return (hint === "string" ? String : Number)(input);
49
- }
50
-
51
- function _toPropertyKey(arg) {
52
- var key = _toPrimitive(arg, "string");
53
- return _typeof(key) === "symbol" ? key : String(key);
54
- }
55
-
56
- function _defineProperty(obj, key, value) {
57
- key = _toPropertyKey(key);
58
- if (key in obj) {
59
- Object.defineProperty(obj, key, {
60
- value: value,
61
- enumerable: true,
62
- configurable: true,
63
- writable: true
64
- });
65
- } else {
66
- obj[key] = value;
67
- }
68
- return obj;
69
- }
70
-
71
- function _arrayWithHoles(arr) {
72
- if (Array.isArray(arr)) return arr;
73
- }
74
-
75
- function _iterableToArrayLimit(r, l) {
76
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
77
- if (null != t) {
78
- var e,
79
- n,
80
- i,
81
- u,
82
- a = [],
83
- f = !0,
84
- o = !1;
85
- try {
86
- if (i = (t = t.call(r)).next, 0 === l) {
87
- if (Object(t) !== t) return;
88
- f = !1;
89
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
90
- } catch (r) {
91
- o = !0, n = r;
92
- } finally {
93
- try {
94
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
95
- } finally {
96
- if (o) throw n;
97
- }
98
- }
99
- return a;
100
- }
101
- }
102
-
103
- function _arrayLikeToArray(arr, len) {
104
- if (len == null || len > arr.length) len = arr.length;
105
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
106
- return arr2;
107
- }
108
-
109
- function _unsupportedIterableToArray(o, minLen) {
110
- if (!o) return;
111
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
112
- var n = Object.prototype.toString.call(o).slice(8, -1);
113
- if (n === "Object" && o.constructor) n = o.constructor.name;
114
- if (n === "Map" || n === "Set") return Array.from(o);
115
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
116
- }
117
-
118
- function _nonIterableRest() {
119
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
120
- }
121
-
122
- function _slicedToArray(arr, i) {
123
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
124
- }
125
-
126
- var classes = {
127
- root: function root(_ref) {
128
- var props = _ref.props,
129
- isFilled = _ref.isFilled,
130
- focusedState = _ref.focusedState;
131
- return classNames('p-password p-component p-inputwrapper', {
132
- 'p-inputwrapper-filled': isFilled,
133
- 'p-inputwrapper-focus': focusedState,
134
- 'p-input-icon-right': props.toggleMask
135
- }, props.className);
136
- },
137
- input: function input(_ref2) {
138
- var props = _ref2.props;
139
- return classNames('p-password-input', props.inputClassName);
140
- },
141
- panel: function panel(_ref3) {
142
- var props = _ref3.props,
143
- context = _ref3.context;
144
- return classNames('p-password-panel p-component', props.panelClassName, {
145
- 'p-input-filled': context && context.inputStyle === 'filled' || PrimeReact.inputStyle === 'filled',
146
- 'p-ripple-disabled': context && context.ripple === false || PrimeReact.ripple === false
147
- });
148
- },
149
- meter: 'p-password-meter',
150
- meterLabel: function meterLabel(_ref4) {
151
- var strength = _ref4.strength;
152
- return classNames('p-password-strength', strength);
153
- },
154
- info: function info(_ref5) {
155
- var strength = _ref5.strength;
156
- return classNames('p-password-info', strength);
157
- },
158
- transition: 'p-connected-overlay'
159
- };
160
- var styles = "\n@layer primereact {\n .p-password {\n position: relative;\n display: inline-flex;\n }\n \n .p-password-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-password .p-password-panel {\n min-width: 100%;\n }\n \n .p-password-meter {\n height: 10px;\n }\n \n .p-password-strength {\n height: 100%;\n width: 0%;\n transition: width 1s ease-in-out;\n }\n \n .p-fluid .p-password {\n display: flex;\n }\n \n .p-password-input::-ms-reveal,\n .p-password-input::-ms-clear {\n display: none;\n }\n}\n";
161
- var PasswordBase = ComponentBase.extend({
162
- defaultProps: {
163
- __TYPE: 'Password',
164
- id: null,
165
- inputId: null,
166
- inputRef: null,
167
- promptLabel: null,
168
- weakLabel: null,
169
- mediumLabel: null,
170
- strongLabel: null,
171
- mediumRegex: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})',
172
- strongRegex: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})',
173
- feedback: true,
174
- toggleMask: false,
175
- appendTo: null,
176
- header: null,
177
- content: null,
178
- footer: null,
179
- showIcon: null,
180
- hideIcon: null,
181
- icon: null,
182
- tooltip: null,
183
- tooltipOptions: null,
184
- style: null,
185
- className: null,
186
- inputStyle: null,
187
- inputClassName: null,
188
- panelStyle: null,
189
- panelClassName: null,
190
- transitionOptions: null,
191
- tabIndex: null,
192
- value: undefined,
193
- onInput: null,
194
- onShow: null,
195
- onHide: null,
196
- children: undefined
197
- },
198
- css: {
199
- classes: classes,
200
- styles: styles
201
- }
202
- });
203
-
204
- 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; }
205
- 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; }
206
- var Password = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (inProps, ref) {
207
- var context = React.useContext(PrimeReactContext);
208
- var props = PasswordBase.getProps(inProps, context);
209
- var promptLabel = props.promptLabel || localeOption('passwordPrompt');
210
- var weakLabel = props.weakLabel || localeOption('weak');
211
- var mediumLabel = props.mediumLabel || localeOption('medium');
212
- var strongLabel = props.strongLabel || localeOption('strong');
213
- var _React$useState = React.useState(false),
214
- _React$useState2 = _slicedToArray(_React$useState, 2),
215
- overlayVisibleState = _React$useState2[0],
216
- setOverlayVisibleState = _React$useState2[1];
217
- var _React$useState3 = React.useState(null),
218
- _React$useState4 = _slicedToArray(_React$useState3, 2),
219
- meterState = _React$useState4[0],
220
- setMeterState = _React$useState4[1];
221
- var _React$useState5 = React.useState(promptLabel),
222
- _React$useState6 = _slicedToArray(_React$useState5, 2),
223
- infoTextState = _React$useState6[0],
224
- setInfoTextState = _React$useState6[1];
225
- var _React$useState7 = React.useState(false),
226
- _React$useState8 = _slicedToArray(_React$useState7, 2),
227
- focusedState = _React$useState8[0],
228
- setFocusedState = _React$useState8[1];
229
- var _React$useState9 = React.useState(false),
230
- _React$useState10 = _slicedToArray(_React$useState9, 2),
231
- unmaskedState = _React$useState10[0],
232
- setUnmaskedState = _React$useState10[1];
233
- var elementRef = React.useRef(null);
234
- var overlayRef = React.useRef(null);
235
- var inputRef = React.useRef(props.inputRef);
236
- var mediumCheckRegExp = React.useRef(new RegExp(props.mediumRegex));
237
- var strongCheckRegExp = React.useRef(new RegExp(props.strongRegex));
238
- var type = unmaskedState ? 'text' : 'password';
239
- var metaData = {
240
- props: props,
241
- state: {
242
- overlayVisible: overlayVisibleState,
243
- meter: meterState,
244
- infoText: infoTextState,
245
- focused: focusedState,
246
- unmasked: unmaskedState
247
- }
248
- };
249
- var _PasswordBase$setMeta = PasswordBase.setMetaData(metaData),
250
- ptm = _PasswordBase$setMeta.ptm,
251
- cx = _PasswordBase$setMeta.cx,
252
- isUnstyled = _PasswordBase$setMeta.isUnstyled;
253
- useHandleStyle(PasswordBase.css.styles, isUnstyled, {
254
- name: 'password'
255
- });
256
- var _useOverlayListener = useOverlayListener({
257
- target: elementRef,
258
- overlay: overlayRef,
259
- listener: function listener(event, _ref) {
260
- var valid = _ref.valid;
261
- valid && hide();
262
- },
263
- when: overlayVisibleState
264
- }),
265
- _useOverlayListener2 = _slicedToArray(_useOverlayListener, 2),
266
- bindOverlayListener = _useOverlayListener2[0],
267
- unbindOverlayListener = _useOverlayListener2[1];
268
- var currentValue = inputRef.current && inputRef.current.value;
269
- var isFilled = React.useMemo(function () {
270
- return ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue);
271
- }, [props.value, props.defaultValue, currentValue]);
272
- var updateLabels = function updateLabels() {
273
- if (meterState) {
274
- var label = null;
275
- switch (meterState.strength) {
276
- case 'weak':
277
- label = weakLabel;
278
- break;
279
- case 'medium':
280
- label = mediumLabel;
281
- break;
282
- case 'strong':
283
- label = strongLabel;
284
- break;
285
- }
286
- if (label && infoTextState !== label) {
287
- setInfoTextState(label);
288
- }
289
- } else {
290
- if (infoTextState !== promptLabel) {
291
- setInfoTextState(promptLabel);
292
- }
293
- }
294
- };
295
- var onPanelClick = function onPanelClick(event) {
296
- if (props.feedback) {
297
- OverlayService.emit('overlay-click', {
298
- originalEvent: event,
299
- target: elementRef.current
300
- });
301
- }
302
- };
303
- var onMaskToggle = function onMaskToggle() {
304
- setUnmaskedState(function (prevUnmasked) {
305
- return !prevUnmasked;
306
- });
307
- };
308
- var show = function show() {
309
- updateLabels();
310
- setOverlayVisibleState(true);
311
- };
312
- var hide = function hide() {
313
- setOverlayVisibleState(false);
314
- };
315
- var alignOverlay = function alignOverlay() {
316
- if (inputRef.current) {
317
- DomHandler.alignOverlay(overlayRef.current, inputRef.current.parentElement, props.appendTo || context && context.appendTo || PrimeReact.appendTo);
318
- }
319
- };
320
- var onOverlayEnter = function onOverlayEnter() {
321
- ZIndexUtils.set('overlay', overlayRef.current, context && context.autoZIndex || PrimeReact.autoZIndex, context && context.zIndex['overlay'] || PrimeReact.zIndex['overlay']);
322
- DomHandler.addStyles(overlayRef.current, {
323
- position: 'absolute',
324
- top: '0',
325
- left: '0'
326
- });
327
- alignOverlay();
328
- };
329
- var onOverlayEntered = function onOverlayEntered() {
330
- bindOverlayListener();
331
- props.onShow && props.onShow();
332
- };
333
- var onOverlayExit = function onOverlayExit() {
334
- unbindOverlayListener();
335
- };
336
- var onOverlayExited = function onOverlayExited() {
337
- ZIndexUtils.clear(overlayRef.current);
338
- props.onHide && props.onHide();
339
- };
340
- var onFocus = function onFocus(event) {
341
- setFocusedState(true);
342
- if (props.feedback) {
343
- show();
344
- }
345
- props.onFocus && props.onFocus(event);
346
- };
347
- var onBlur = function onBlur(event) {
348
- setFocusedState(false);
349
- if (props.feedback) {
350
- hide();
351
- }
352
- props.onBlur && props.onBlur(event);
353
- };
354
- var onKeyup = function onKeyup(e) {
355
- var keyCode = e.keyCode || e.which;
356
- if (props.feedback) {
357
- var value = e.target.value;
358
- var label = null;
359
- var meter = null;
360
- switch (testStrength(value)) {
361
- case 1:
362
- label = weakLabel;
363
- meter = {
364
- strength: 'weak',
365
- width: '33.33%'
366
- };
367
- break;
368
- case 2:
369
- label = mediumLabel;
370
- meter = {
371
- strength: 'medium',
372
- width: '66.66%'
373
- };
374
- break;
375
- case 3:
376
- label = strongLabel;
377
- meter = {
378
- strength: 'strong',
379
- width: '100%'
380
- };
381
- break;
382
- default:
383
- label = promptLabel;
384
- meter = null;
385
- break;
386
- }
387
- setMeterState(meter);
388
- setInfoTextState(label);
389
- if (!!keyCode && !overlayVisibleState) {
390
- show();
391
- }
392
- }
393
- props.onKeyUp && props.onKeyUp(e);
394
- };
395
- var onInput = function onInput(event, validatePattern) {
396
- if (props.onInput) {
397
- props.onInput(event, validatePattern);
398
- }
399
- if (!props.onChange) {
400
- ObjectUtils.isNotEmpty(event.target.value) ? DomHandler.addClass(elementRef.current, 'p-inputwrapper-filled') : DomHandler.removeClass(elementRef.current, 'p-inputwrapper-filled');
401
- }
402
- };
403
- var testStrength = function testStrength(str) {
404
- if (strongCheckRegExp.current.test(str)) return 3;else if (mediumCheckRegExp.current.test(str)) return 2;else if (str.length) return 1;
405
- return 0;
406
- };
407
- React.useImperativeHandle(ref, function () {
408
- return {
409
- props: props,
410
- focus: function focus() {
411
- return DomHandler.focus(inputRef.current);
412
- },
413
- getElement: function getElement() {
414
- return elementRef.current;
415
- },
416
- getOverlay: function getOverlay() {
417
- return overlayRef.current;
418
- },
419
- getInput: function getInput() {
420
- return inputRef.current;
421
- }
422
- };
423
- });
424
- React.useEffect(function () {
425
- ObjectUtils.combinedRefs(inputRef, props.inputRef);
426
- }, [inputRef, props.inputRef]);
427
- React.useEffect(function () {
428
- mediumCheckRegExp.current = new RegExp(props.mediumRegex);
429
- }, [props.mediumRegex]);
430
- React.useEffect(function () {
431
- strongCheckRegExp.current = new RegExp(props.strongRegex);
432
- }, [props.strongRegex]);
433
- React.useEffect(function () {
434
- if (!isFilled && DomHandler.hasClass(elementRef.current, 'p-inputwrapper-filled')) {
435
- DomHandler.removeClass(elementRef.current, 'p-inputwrapper-filled');
436
- }
437
- }, [isFilled]);
438
- useUnmountEffect(function () {
439
- ZIndexUtils.clear(overlayRef.current);
440
- });
441
- var createIcon = function createIcon() {
442
- var icon;
443
- var hideIconProps = mergeProps(ptm('hideIcon'));
444
- var showIconProps = mergeProps(ptm('showIcon'));
445
- if (unmaskedState) {
446
- icon = props.hideIcon || /*#__PURE__*/React.createElement(EyeSlashIcon, hideIconProps);
447
- } else {
448
- icon = props.showIcon || /*#__PURE__*/React.createElement(EyeIcon, showIconProps);
449
- }
450
- var eyeIcon = IconUtils.getJSXIcon(icon, unmaskedState ? _objectSpread({}, hideIconProps) : _objectSpread({}, showIconProps), {
451
- props: props
452
- });
453
- if (props.toggleMask) {
454
- var content = /*#__PURE__*/React.createElement("i", {
455
- onClick: onMaskToggle
456
- }, " ", eyeIcon, " ");
457
- if (props.icon) {
458
- var defaultIconOptions = {
459
- onClick: onMaskToggle,
460
- className: className,
461
- element: content,
462
- props: props
463
- };
464
- content = ObjectUtils.getJSXElement(props.icon, defaultIconOptions);
465
- }
466
- return content;
467
- }
468
- return null;
469
- };
470
- var createPanel = function createPanel() {
471
- var _ref2 = meterState || {
472
- strength: '',
473
- width: '0%'
474
- },
475
- strength = _ref2.strength,
476
- width = _ref2.width;
477
- var header = ObjectUtils.getJSXElement(props.header, props);
478
- var footer = ObjectUtils.getJSXElement(props.footer, props);
479
- var panelProps = mergeProps({
480
- className: cx('panel', {
481
- context: context
482
- }),
483
- style: props.panelStyle,
484
- onClick: onPanelClick
485
- }, ptm('panel'));
486
- var meterProps = mergeProps({
487
- className: cx('meter')
488
- }, ptm('meter'));
489
- var meterLabelProps = mergeProps({
490
- className: cx('meterLabel', {
491
- strength: strength
492
- }),
493
- style: {
494
- width: width
495
- }
496
- }, ptm('meterLabel'));
497
- var infoProps = mergeProps({
498
- className: cx('info', {
499
- strength: strength
500
- })
501
- }, ptm('info'));
502
- var content = props.content ? ObjectUtils.getJSXElement(props.content, props) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", meterProps, /*#__PURE__*/React.createElement("div", meterLabelProps)), /*#__PURE__*/React.createElement("div", infoProps, infoTextState));
503
- var transitionProps = mergeProps({
504
- classNames: cx('transition'),
505
- "in": overlayVisibleState,
506
- timeout: {
507
- enter: 120,
508
- exit: 100
509
- },
510
- options: props.transitionOptions,
511
- unmountOnExit: true,
512
- onEnter: onOverlayEnter,
513
- onEntered: onOverlayEntered,
514
- onExit: onOverlayExit,
515
- onExited: onOverlayExited
516
- }, ptm('transition'));
517
- var panel = /*#__PURE__*/React.createElement(CSSTransition, _extends({
518
- nodeRef: overlayRef
519
- }, transitionProps), /*#__PURE__*/React.createElement("div", _extends({
520
- ref: overlayRef
521
- }, panelProps), header, content, footer));
522
- return /*#__PURE__*/React.createElement(Portal, {
523
- element: panel,
524
- appendTo: props.appendTo
525
- });
526
- };
527
- var className = classNames('p-password p-component p-inputwrapper', {
528
- 'p-inputwrapper-filled': isFilled,
529
- 'p-inputwrapper-focus': focusedState,
530
- 'p-input-icon-right': props.toggleMask
531
- }, props.className);
532
- var inputProps = PasswordBase.getOtherProps(props);
533
- var icon = createIcon();
534
- var panel = createPanel();
535
- var rootProps = mergeProps({
536
- ref: elementRef,
537
- id: props.id,
538
- className: cx('root', {
539
- isFilled: isFilled,
540
- focusedState: focusedState
541
- }),
542
- style: props.style
543
- }, ptm('root'));
544
- var inputTextProps = mergeProps(_objectSpread(_objectSpread({
545
- ref: inputRef,
546
- id: props.inputId
547
- }, inputProps), {}, {
548
- className: cx('input'),
549
- onBlur: onBlur,
550
- onFocus: onFocus,
551
- onInput: onInput,
552
- onKeyUp: onKeyup,
553
- style: props.inputStyle,
554
- tabIndex: props.tabIndex,
555
- tooltip: props.tooltip,
556
- tooltipOptions: props.tooltipOptions,
557
- type: type,
558
- value: props.value,
559
- __parentMetadata: {
560
- parent: metaData
561
- }
562
- }), ptm('input'));
563
- return /*#__PURE__*/React.createElement("div", rootProps, /*#__PURE__*/React.createElement(InputText, inputTextProps), icon, panel);
564
- }));
565
- Password.displayName = 'Password';
566
-
567
- export { Password };
@@ -1 +0,0 @@
1
- import*as e from"react";import t,{PrimeReactContext as n,localeOption as r}from"primereact/api";import{ComponentBase as o,useHandleStyle as i}from"primereact/componentbase";import{CSSTransition as a}from"primereact/csstransition";import{useOverlayListener as l,useUnmountEffect as u}from"primereact/hooks";import{EyeIcon as p}from"primereact/icons/eye";import{EyeSlashIcon as s}from"primereact/icons/eyeslash";import{InputText as c}from"primereact/inputtext";import{OverlayService as f}from"primereact/overlayservice";import{Portal as m}from"primereact/portal";import{classNames as d,ObjectUtils as y,DomHandler as g,ZIndexUtils as b,mergeProps as w,IconUtils as v}from"primereact/utils";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function E(e){return E="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},E(e)}function S(e,t){if("object"!==E(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function x(e){var t=S(e,"string");return"symbol"===E(t)?t:String(t)}function O(e){if(Array.isArray(e))return e}function k(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,p=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){p=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(p)throw o}}return l}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e,t){return O(e)||k(e,t)||R(e,t)||j()}var P=o.extend({defaultProps:{__TYPE:"Password",id:null,inputId:null,inputRef:null,promptLabel:null,weakLabel:null,mediumLabel:null,strongLabel:null,mediumRegex:"^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})",strongRegex:"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})",feedback:!0,toggleMask:!1,appendTo:null,header:null,content:null,footer:null,showIcon:null,hideIcon:null,icon:null,tooltip:null,tooltipOptions:null,style:null,className:null,inputStyle:null,inputClassName:null,panelStyle:null,panelClassName:null,transitionOptions:null,tabIndex:null,value:void 0,onInput:null,onShow:null,onHide:null,children:void 0},css:{classes:{root:function(e){var t=e.props;return d("p-password p-component p-inputwrapper",{"p-inputwrapper-filled":e.isFilled,"p-inputwrapper-focus":e.focusedState,"p-input-icon-right":t.toggleMask},t.className)},input:function(e){return d("p-password-input",e.props.inputClassName)},panel:function(e){var n=e.context;return d("p-password-panel p-component",e.props.panelClassName,{"p-input-filled":n&&"filled"===n.inputStyle||"filled"===t.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===t.ripple})},meter:"p-password-meter",meterLabel:function(e){return d("p-password-strength",e.strength)},info:function(e){return d("p-password-info",e.strength)},transition:"p-connected-overlay"},styles:"\n@layer primereact {\n .p-password {\n position: relative;\n display: inline-flex;\n }\n \n .p-password-panel {\n position: absolute;\n top: 0;\n left: 0;\n }\n \n .p-password .p-password-panel {\n min-width: 100%;\n }\n \n .p-password-meter {\n height: 10px;\n }\n \n .p-password-strength {\n height: 100%;\n width: 0%;\n transition: width 1s ease-in-out;\n }\n \n .p-fluid .p-password {\n display: flex;\n }\n \n .p-password-input::-ms-reveal,\n .p-password-input::-ms-clear {\n display: none;\n }\n}\n"}});function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){var r,o,i;r=e,i=n[t],(o=x(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=e.memo(e.forwardRef((function(o,E){var S=e.useContext(n),x=P.getProps(o,S),O=x.promptLabel||r("passwordPrompt"),k=x.weakLabel||r("weak"),I=x.mediumLabel||r("medium"),R=x.strongLabel||r("strong"),j=N(e.useState(!1),2),C=j[0],T=j[1],A=N(e.useState(null),2),M=A[0],F=A[1],z=N(e.useState(O),2),D=z[0],J=z[1],U=N(e.useState(!1),2),X=U[0],Z=U[1],H=N(e.useState(!1),2),_=H[0],B=H[1],K=e.useRef(null),V=e.useRef(null),Y=e.useRef(x.inputRef),$=e.useRef(new RegExp(x.mediumRegex)),q=e.useRef(new RegExp(x.strongRegex)),G=_?"text":"password",Q={props:x,state:{overlayVisible:C,meter:M,infoText:D,focused:X,unmasked:_}},W=P.setMetaData(Q),ee=W.ptm,te=W.cx;i(P.css.styles,W.isUnstyled,{name:"password"});var ne=N(l({target:K,overlay:V,listener:function(e,t){t.valid&&ce()},when:C}),2),re=ne[0],oe=ne[1],ie=Y.current&&Y.current.value,ae=e.useMemo((function(){return y.isNotEmpty(x.value)||y.isNotEmpty(x.defaultValue)||y.isNotEmpty(ie)}),[x.value,x.defaultValue,ie]),le=function(){if(M){var e=null;switch(M.strength){case"weak":e=k;break;case"medium":e=I;break;case"strong":e=R}e&&D!==e&&J(e)}else D!==O&&J(O)},ue=function(e){x.feedback&&f.emit("overlay-click",{originalEvent:e,target:K.current})},pe=function(){B((function(e){return!e}))},se=function(){le(),T(!0)},ce=function(){T(!1)},fe=function(){b.set("overlay",V.current,S&&S.autoZIndex||t.autoZIndex,S&&S.zIndex.overlay||t.zIndex.overlay),g.addStyles(V.current,{position:"absolute",top:"0",left:"0"}),Y.current&&g.alignOverlay(V.current,Y.current.parentElement,x.appendTo||S&&S.appendTo||t.appendTo)},me=function(){re(),x.onShow&&x.onShow()},de=function(){oe()},ye=function(){b.clear(V.current),x.onHide&&x.onHide()},ge=function(e){return q.current.test(e)?3:$.current.test(e)?2:e.length?1:0};e.useImperativeHandle(E,(function(){return{props:x,focus:function(){return g.focus(Y.current)},getElement:function(){return K.current},getOverlay:function(){return V.current},getInput:function(){return Y.current}}})),e.useEffect((function(){y.combinedRefs(Y,x.inputRef)}),[Y,x.inputRef]),e.useEffect((function(){$.current=new RegExp(x.mediumRegex)}),[x.mediumRegex]),e.useEffect((function(){q.current=new RegExp(x.strongRegex)}),[x.strongRegex]),e.useEffect((function(){!ae&&g.hasClass(K.current,"p-inputwrapper-filled")&&g.removeClass(K.current,"p-inputwrapper-filled")}),[ae]),u((function(){b.clear(V.current)}));var be=d("p-password p-component p-inputwrapper",{"p-inputwrapper-filled":ae,"p-inputwrapper-focus":X,"p-input-icon-right":x.toggleMask},x.className),we=P.getOtherProps(x),ve=function(){var t=w(ee("hideIcon")),n=w(ee("showIcon")),r=v.getJSXIcon(_?x.hideIcon||e.createElement(s,t):x.showIcon||e.createElement(p,n),L({},_?t:n),{props:x});if(x.toggleMask){var o=e.createElement("i",{onClick:pe}," ",r," ");if(x.icon)o=y.getJSXElement(x.icon,{onClick:pe,className:be,element:o,props:x});return o}return null}(),he=function(){var t=M||{strength:"",width:"0%"},n=t.strength,r=t.width,o=y.getJSXElement(x.header,x),i=y.getJSXElement(x.footer,x),l=w({className:te("panel",{context:S}),style:x.panelStyle,onClick:ue},ee("panel")),u=w({className:te("meter")},ee("meter")),p=w({className:te("meterLabel",{strength:n}),style:{width:r}},ee("meterLabel")),s=w({className:te("info",{strength:n})},ee("info")),c=x.content?y.getJSXElement(x.content,x):e.createElement(e.Fragment,null,e.createElement("div",u,e.createElement("div",p)),e.createElement("div",s,D)),f=w({classNames:te("transition"),in:C,timeout:{enter:120,exit:100},options:x.transitionOptions,unmountOnExit:!0,onEnter:fe,onEntered:me,onExit:de,onExited:ye},ee("transition")),d=e.createElement(a,h({nodeRef:V},f),e.createElement("div",h({ref:V},l),o,c,i));return e.createElement(m,{element:d,appendTo:x.appendTo})}(),Ee=w({ref:K,id:x.id,className:te("root",{isFilled:ae,focusedState:X}),style:x.style},ee("root")),Se=w(L(L({ref:Y,id:x.inputId},we),{},{className:te("input"),onBlur:function(e){Z(!1),x.feedback&&ce(),x.onBlur&&x.onBlur(e)},onFocus:function(e){Z(!0),x.feedback&&se(),x.onFocus&&x.onFocus(e)},onInput:function(e,t){x.onInput&&x.onInput(e,t),x.onChange||(y.isNotEmpty(e.target.value)?g.addClass(K.current,"p-inputwrapper-filled"):g.removeClass(K.current,"p-inputwrapper-filled"))},onKeyUp:function(e){var t=e.keyCode||e.which;if(x.feedback){var n=null,r=null;switch(ge(e.target.value)){case 1:n=k,r={strength:"weak",width:"33.33%"};break;case 2:n=I,r={strength:"medium",width:"66.66%"};break;case 3:n=R,r={strength:"strong",width:"100%"};break;default:n=O,r=null}F(r),J(n),t&&!C&&se()}x.onKeyUp&&x.onKeyUp(e)},style:x.inputStyle,tabIndex:x.tabIndex,tooltip:x.tooltip,tooltipOptions:x.tooltipOptions,type:G,value:x.value,__parentMetadata:{parent:Q}}),ee("input"));return e.createElement("div",Ee,e.createElement(c,Se),ve,he)})));T.displayName="Password";export{T as Password};