primereact 10.9.5 → 10.9.6

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 (120) hide show
  1. package/api/api.cjs.js +9 -1
  2. package/api/api.cjs.min.js +1 -1
  3. package/api/api.d.ts +5 -3
  4. package/api/api.esm.js +9 -1
  5. package/api/api.esm.min.js +1 -1
  6. package/api/api.js +9 -1
  7. package/api/api.min.js +1 -1
  8. package/autocomplete/autocomplete.d.ts +5 -5
  9. package/calendar/calendar.cjs.js +27 -5
  10. package/calendar/calendar.cjs.min.js +1 -1
  11. package/calendar/calendar.esm.js +27 -5
  12. package/calendar/calendar.esm.min.js +1 -1
  13. package/calendar/calendar.js +27 -5
  14. package/calendar/calendar.min.js +1 -1
  15. package/cascadeselect/cascadeselect.cjs.js +53 -3
  16. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  17. package/cascadeselect/cascadeselect.d.ts +13 -0
  18. package/cascadeselect/cascadeselect.esm.js +54 -4
  19. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  20. package/cascadeselect/cascadeselect.js +54 -5
  21. package/cascadeselect/cascadeselect.min.js +1 -1
  22. package/core/core.js +44 -10
  23. package/core/core.min.js +6 -6
  24. package/datatable/datatable.cjs.js +86 -58
  25. package/datatable/datatable.cjs.min.js +1 -1
  26. package/datatable/datatable.d.ts +79 -3
  27. package/datatable/datatable.esm.js +86 -58
  28. package/datatable/datatable.esm.min.js +1 -1
  29. package/datatable/datatable.js +86 -58
  30. package/datatable/datatable.min.js +1 -1
  31. package/dialog/dialog.cjs.js +3 -2
  32. package/dialog/dialog.cjs.min.js +1 -1
  33. package/dialog/dialog.d.ts +6 -1
  34. package/dialog/dialog.esm.js +3 -2
  35. package/dialog/dialog.esm.min.js +1 -1
  36. package/dialog/dialog.js +3 -2
  37. package/dialog/dialog.min.js +1 -1
  38. package/dropdown/dropdown.cjs.js +13 -3
  39. package/dropdown/dropdown.cjs.min.js +1 -1
  40. package/dropdown/dropdown.esm.js +13 -3
  41. package/dropdown/dropdown.esm.min.js +1 -1
  42. package/dropdown/dropdown.js +13 -3
  43. package/dropdown/dropdown.min.js +1 -1
  44. package/fileupload/fileupload.cjs.js +4 -2
  45. package/fileupload/fileupload.cjs.min.js +1 -1
  46. package/fileupload/fileupload.esm.js +4 -2
  47. package/fileupload/fileupload.esm.min.js +1 -1
  48. package/fileupload/fileupload.js +4 -2
  49. package/fileupload/fileupload.min.js +1 -1
  50. package/galleria/galleria.cjs.js +1 -0
  51. package/galleria/galleria.cjs.min.js +1 -1
  52. package/galleria/galleria.esm.js +1 -0
  53. package/galleria/galleria.esm.min.js +1 -1
  54. package/galleria/galleria.js +1 -0
  55. package/galleria/galleria.min.js +1 -1
  56. package/inputnumber/inputnumber.cjs.js +7 -2
  57. package/inputnumber/inputnumber.cjs.min.js +1 -1
  58. package/inputnumber/inputnumber.esm.js +7 -2
  59. package/inputnumber/inputnumber.esm.min.js +1 -1
  60. package/inputnumber/inputnumber.js +7 -2
  61. package/inputnumber/inputnumber.min.js +1 -1
  62. package/listbox/listbox.d.ts +4 -4
  63. package/menu/menu.cjs.js +3 -0
  64. package/menu/menu.cjs.min.js +1 -1
  65. package/menu/menu.esm.js +3 -0
  66. package/menu/menu.esm.min.js +1 -1
  67. package/menu/menu.js +3 -0
  68. package/menu/menu.min.js +1 -1
  69. package/multiselect/multiselect.cjs.js +61 -15
  70. package/multiselect/multiselect.cjs.min.js +1 -1
  71. package/multiselect/multiselect.esm.js +61 -15
  72. package/multiselect/multiselect.esm.min.js +1 -1
  73. package/multiselect/multiselect.js +61 -15
  74. package/multiselect/multiselect.min.js +1 -1
  75. package/multistatecheckbox/multistatecheckbox.cjs.js +16 -8
  76. package/multistatecheckbox/multistatecheckbox.cjs.min.js +1 -1
  77. package/multistatecheckbox/multistatecheckbox.esm.js +16 -8
  78. package/multistatecheckbox/multistatecheckbox.esm.min.js +1 -1
  79. package/multistatecheckbox/multistatecheckbox.js +16 -8
  80. package/multistatecheckbox/multistatecheckbox.min.js +1 -1
  81. package/package.json +1 -1
  82. package/paginator/paginator.cjs.js +9 -1
  83. package/paginator/paginator.cjs.min.js +1 -1
  84. package/paginator/paginator.esm.js +9 -1
  85. package/paginator/paginator.esm.min.js +1 -1
  86. package/paginator/paginator.js +9 -1
  87. package/paginator/paginator.min.js +1 -1
  88. package/picklist/picklist.cjs.js +9 -1
  89. package/picklist/picklist.cjs.min.js +1 -1
  90. package/picklist/picklist.esm.js +9 -1
  91. package/picklist/picklist.esm.min.js +1 -1
  92. package/picklist/picklist.js +9 -1
  93. package/picklist/picklist.min.js +1 -1
  94. package/primereact.all.cjs.js +297 -115
  95. package/primereact.all.cjs.min.js +1 -1
  96. package/primereact.all.esm.js +297 -115
  97. package/primereact.all.esm.min.js +1 -1
  98. package/primereact.all.js +297 -115
  99. package/primereact.all.min.js +1 -1
  100. package/treeselect/treeselect.cjs.js +4 -0
  101. package/treeselect/treeselect.cjs.min.js +1 -1
  102. package/treeselect/treeselect.d.ts +33 -0
  103. package/treeselect/treeselect.esm.js +4 -0
  104. package/treeselect/treeselect.esm.min.js +1 -1
  105. package/treeselect/treeselect.js +4 -0
  106. package/treeselect/treeselect.min.js +1 -1
  107. package/tristatecheckbox/tristatecheckbox.cjs.js +1 -0
  108. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  109. package/tristatecheckbox/tristatecheckbox.esm.js +1 -0
  110. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  111. package/tristatecheckbox/tristatecheckbox.js +1 -0
  112. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  113. package/utils/utils.cjs.js +3 -1
  114. package/utils/utils.cjs.min.js +1 -1
  115. package/utils/utils.d.ts +1 -1
  116. package/utils/utils.esm.js +3 -1
  117. package/utils/utils.esm.min.js +1 -1
  118. package/utils/utils.js +3 -1
  119. package/utils/utils.min.js +1 -1
  120. package/web-types.json +77 -10
@@ -393,6 +393,7 @@ var DialogBase = componentbase.ComponentBase.extend({
393
393
  resizable: true,
394
394
  rtl: false,
395
395
  showHeader: true,
396
+ showCloseIcon: true,
396
397
  style: null,
397
398
  transitionOptions: null,
398
399
  visible: false,
@@ -524,7 +525,7 @@ var Dialog = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
524
525
  var focus = function focus() {
525
526
  var activeElement = document.activeElement;
526
527
  var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
527
- if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
528
+ if (!isActiveElementInDialog && props.closable && props.showCloseIcon && props.showHeader && closeRef.current) {
528
529
  closeRef.current.focus();
529
530
  }
530
531
  };
@@ -830,7 +831,7 @@ var Dialog = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref) {
830
831
  };
831
832
  });
832
833
  var createCloseIcon = function createCloseIcon() {
833
- if (props.closable) {
834
+ if (props.closable && props.showCloseIcon) {
834
835
  var labelAria = props.ariaCloseIconLabel || PrimeReact.ariaLabel('close');
835
836
  var closeButtonIconProps = mergeProps({
836
837
  className: cx('closeButtonIcon'),
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),r=require("primereact/csstransition"),o=require("primereact/hooks"),a=require("primereact/utils"),i=require("primereact/icons/times"),l=require("primereact/icons/windowmaximize"),c=require("primereact/icons/windowminimize"),s=require("primereact/portal"),u=require("primereact/ripple");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=p(e),f=d(e),g=p(t);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(null,arguments)}function h(e){return h="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},h(e)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return y(e)}function x(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.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)?y(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){if("object"!=h(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function D(e){var t=E(e,"string");return"symbol"==h(t)?t:t+""}function S(e,t,n){return(t=D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}function I(){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 j(e,t){return P(e)||z(e,t)||O(e,t)||I()}var k=n.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return a.ObjectUtils.getMergedProps(e,k.defaultProps)},getOtherProps:function(e){return a.ObjectUtils.getDiffProps(e,k.defaultProps)}});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 R(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){S(e,t,n[t])})):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 H=m.default.memo(m.default.forwardRef((function(e,n){var r=m.default.useRef(null),i=m.default.useRef(null),l=m.default.useRef(null),c=m.default.useContext(t.PrimeReactContext),s=k.getProps(e,c),u={props:s};o.useStyle(k.css.styles,{name:"focustrap"});k.setMetaData(R({},u));m.default.useImperativeHandle(n,(function(){return{props:s,getInk:function(){return i.current},getTarget:function(){return r.current}}})),o.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,f,g,b,h=function(){return i.current&&i.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,i=t.autoFocus,l=void 0!==i&&i,c="".concat(v(void 0===n?"":n)),u="[autofocus]".concat(c,", [data-pc-autofocus='true']").concat(c),p=a.DomHandler.getFirstFocusableElement(e,u);l&&!p&&(p=a.DomHandler.getFirstFocusableElement(e,v(o))),a.DomHandler.focus(p)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:a.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(f=function(e,t,n){return m.default.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:t,"data-pc-section":n})})(i,(function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:a.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)}),"firstfocusableelement"),b=f(l,x,"lastfocusableelement"),i.current&&l.current&&(i.current.$_pfocustrap_lasthiddenfocusableelement=l.current,l.current.$_pfocustrap_firsthiddenfocusableelement=i.current),m.default.createElement(m.default.Fragment,null,g,s.children,b)})));function _(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=n.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return a.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return a.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return a.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return a.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return a.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===g.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===g.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return N({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function T(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 B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=f.forwardRef((function(e,p){var d=o.useMergeProps(),m=f.useContext(t.PrimeReactContext),h=M.getProps(e,m),y=h.id?h.id:a.UniqueComponentId(),E=j(f.useState(y),2),D=E[0],S=j(f.useState(!1),2),P=S[0],z=S[1],I=j(f.useState(!1),2),k=I[0],C=I[1],R=j(f.useState(h.maximized),2),_=R[0],N=R[1],T=f.useRef(null),F=f.useRef(null),U=f.useRef(null),X=f.useRef(null),A=f.useRef(null),L=f.useRef(null),q=f.useRef(null),Y=f.useRef(!1),$=f.useRef(!1),V=f.useRef(null),Z=f.useRef(null),J=f.useRef(null),W=f.useRef(y),G=f.useRef(null),K=h.onMaximize?h.maximized:_,Q=k&&(h.blockScroll||h.maximizable&&K),ee=h.closable&&h.closeOnEscape&&k,te=o.useDisplayOrder("dialog",ee),ne=M.setMetaData(B(B({props:h},h.__parentMetadata),{},{state:{id:D,maximized:K,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ae=ne.sx,ie=ne.isUnstyled;n.useHandleStyle(M.css.styles,ie,{name:"dialog"}),o.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[o.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=j(o.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ce=le[0],se=le[1],ue=j(o.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return je(e)}}),2),pe=ue[0],de=ue[1],me=j(o.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=j(o.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){h.onHide(e),e.preventDefault()},xe=function(e){U.current=e.target,h.onPointerDown&&h.onPointerDown(e)},Oe=function(e){h.dismissableMask&&h.modal&&F.current===e.target&&!U.current&&ve(e),h.onMaskClick&&h.onMaskClick(e),U.current=null},we=function(e){h.onMaximize?h.onMaximize({originalEvent:e,maximized:!K}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){a.DomHandler.hasClass(e.target,"p-dialog-header-icon")||a.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||h.draggable&&(Y.current=!0,V.current=e.pageX,Z.current=e.pageY,a.DomHandler.addClass(document.body,"p-unselectable-text"),h.onDragStart&&h.onDragStart(e))},De=function(e){if(Y.current){var t=a.DomHandler.getOuterWidth(T.current),n=a.DomHandler.getOuterHeight(T.current),r=e.pageX-V.current,o=e.pageY-Z.current,i=T.current.getBoundingClientRect(),l=i.left+r,c=i.top+o,s=a.DomHandler.getViewport(),u=getComputedStyle(T.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);T.current.style.position="fixed",h.keepInViewport?(l>=h.minX&&l+t<s.width&&(V.current=e.pageX,T.current.style.left=l-p+"px"),c>=h.minY&&c+n<s.height&&(Z.current=e.pageY,T.current.style.top=c-d+"px")):(V.current=e.pageX,T.current.style.left=l-p+"px",Z.current=e.pageY,T.current.style.top=c-d+"px"),h.onDrag&&h.onDrag(e)}},Se=function(e){Y.current&&(Y.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),h.onDragEnd&&h.onDragEnd(e))},Pe=function(e){h.resizable&&($.current=!0,V.current=e.pageX,Z.current=e.pageY,a.DomHandler.addClass(document.body,"p-unselectable-text"),h.onResizeStart&&h.onResizeStart(e))},ze=function(e,t,n){!n&&(n=a.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},Ie=function(e){if($.current){var t=e.pageX-V.current,n=e.pageY-Z.current,r=a.DomHandler.getOuterWidth(T.current),o=a.DomHandler.getOuterHeight(T.current),i=T.current.getBoundingClientRect(),l=a.DomHandler.getViewport(),c=!parseInt(T.current.style.top)||!parseInt(T.current.style.left),s=ze(T.current.style.minWidth,"width",l),u=ze(T.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&i.left+p<l.width&&(T.current.style.width=p+"px"),(!u||d>u)&&i.top+d<l.height&&(T.current.style.height=d+"px"),V.current=e.pageX,Z.current=e.pageY,h.onResize&&h.onResize(e)}},je=function(e){$.current&&($.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),h.onResizeEnd&&h.onResizeEnd(e))},ke=function(){T.current.style.position="",T.current.style.left="",T.current.style.top="",T.current.style.margin=""},Ce=function(){T.current.setAttribute(W.current,"")},Re=function(){var e;h.onShow&&h.onShow(),h.focusOnShow&&!((e=document.activeElement)&&T.current&&T.current.contains(e))&&h.closable&&h.showHeader&&q.current&&q.current.focus(),Ne()},He=function(){h.modal&&!ie()&&a.DomHandler.addClass(F.current,"p-component-overlay-leave")},_e=function(){Y.current=!1,a.ZIndexUtils.clear(F.current),z(!1),Me(),a.DomHandler.focus(G.current),G.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&k){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(v(r=document.primeDialogParams)||x(r)||O(r)||w(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?a.DomHandler.blockBodyScroll():a.DomHandler.unblockBodyScroll()},Be=function(){h.draggable&&(fe(),he()),h.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){J.current=a.DomHandler.createInlineStyle(m&&m.nonce||g.default.nonce,m&&m.styleContainer);var e="";for(var t in h.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(W.current,"] {\n width: ").concat(h.breakpoints[t]," !important;\n }\n }\n ");J.current.innerHTML=e};o.useMountEffect((function(){Te(!0),h.visible&&z(!0)})),f.useEffect((function(){return h.breakpoints&&Ue(),function(){J.current=a.DomHandler.removeInlineStyle(J.current)}}),[h.breakpoints]),o.useUpdateEffect((function(){h.visible&&!P&&z(!0),h.visible!==k&&P&&C(h.visible),h.visible&&(G.current=document.activeElement)}),[h.visible,P]),o.useUpdateEffect((function(){P&&(a.ZIndexUtils.set("modal",F.current,m&&m.autoZIndex||g.default.autoZIndex,h.baseZIndex||m&&m.zIndex.modal||g.default.zIndex.modal),C(!0))}),[P]),o.useUpdateEffect((function(){Te(!0)}),[Q,k]),o.useUnmountEffect((function(){Me(),Te(!1),a.DomHandler.removeInlineStyle(J.current),a.ZIndexUtils.clear(F.current)})),f.useImperativeHandle(p,(function(){return{props:h,resetPosition:ke,getElement:function(){return T.current},getMask:function(){return F.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return q.current}}}));var Xe=function(){if(h.closable){var e=h.ariaCloseIconLabel||t.ariaLabel("close"),n=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=a.IconUtils.getJSXIcon(h.closeIcon||f.createElement(i.TimesIcon,n),B({},n),{props:h}),o=d({ref:q,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},re("closeButton"));return f.createElement("button",o,r,f.createElement(u.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=a.IconUtils.getJSXIcon(K?h.minimizeIcon||f.createElement(c.WindowMinimizeIcon,e):h.maximizeIcon||f.createElement(l.WindowMaximizeIcon,e),e,{props:h});if(h.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return f.createElement("button",n,t,f.createElement(u.Ripple,null))}return null},Le=function(){if(h.showHeader){var e=Xe(),t=Ae(),n=a.ObjectUtils.getJSXElement(h.icons,h),r=a.ObjectUtils.getJSXElement(h.header,h),o=D+"_header",i=d({ref:A,style:h.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return f.createElement("div",i,f.createElement("div",l,r),f.createElement("div",c,n,t,e))}return null},qe=function(){var e=a.ObjectUtils.getJSXElement(h.footer,h),t=d({ref:L,className:oe("footer")},re("footer"));return e&&f.createElement("div",t,e)};return P&&function(){var t,n,o,i,l,c,u=D+"_header",p=D+"_content",g={enter:"center"===h.position?150:300,exit:"center"===h.position?150:300},y=d({ref:F,style:ae("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:T,id:D,className:a.classNames(h.className,oe("root",{props:h,maximized:K,context:m})),style:h.style,onClick:h.onClick,role:"dialog","aria-labelledby":u,"aria-describedby":p,"aria-modal":h.modal,onPointerDown:xe},M.getOtherProps(h),re("root")),x=d({classNames:oe("transition"),timeout:g,in:k,options:h.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:h.header,content:h.message,message:null==h||null===(l=h.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=a.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:q,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:h.contentStyle,className:oe("content")},re("content")),o=f.createElement("div",t,h.children),i=qe(),O=f.createElement(f.Fragment,null,n,o,i,h.resizable?f.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=f.createElement("div",y,f.createElement(r.CSSTransition,b({nodeRef:T},x),f.createElement("div",v,f.createElement(H,{autoFocus:h.focusOnShow},O))));return f.createElement(s.Portal,{element:w,appendTo:h.appendTo,visible:!0})}()}));F.displayName="Dialog",exports.Dialog=F;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/componentbase"),r=require("primereact/csstransition"),o=require("primereact/hooks"),a=require("primereact/utils"),i=require("primereact/icons/times"),l=require("primereact/icons/windowmaximize"),c=require("primereact/icons/windowminimize"),s=require("primereact/portal"),u=require("primereact/ripple");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=p(e),f=d(e),g=p(t);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(null,arguments)}function h(e){return h="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},h(e)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return y(e)}function x(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.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)?y(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e,t){if("object"!=h(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function D(e){var t=E(e,"string");return"symbol"==h(t)?t:t+""}function S(e,t,n){return(t=D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){if(Array.isArray(e))return e}function I(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}function z(){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 j(e,t){return P(e)||I(e,t)||O(e,t)||z()}var k=n.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return a.ObjectUtils.getMergedProps(e,k.defaultProps)},getOtherProps:function(e){return a.ObjectUtils.getDiffProps(e,k.defaultProps)}});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 R(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){S(e,t,n[t])})):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 H=m.default.memo(m.default.forwardRef((function(e,n){var r=m.default.useRef(null),i=m.default.useRef(null),l=m.default.useRef(null),c=m.default.useContext(t.PrimeReactContext),s=k.getProps(e,c),u={props:s};o.useStyle(k.css.styles,{name:"focustrap"});k.setMetaData(R({},u));m.default.useImperativeHandle(n,(function(){return{props:s,getInk:function(){return i.current},getTarget:function(){return r.current}}})),o.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,f,g,b,h=function(){return i.current&&i.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,i=t.autoFocus,l=void 0!==i&&i,c="".concat(v(void 0===n?"":n)),u="[autofocus]".concat(c,", [data-pc-autofocus='true']").concat(c),p=a.DomHandler.getFirstFocusableElement(e,u);l&&!p&&(p=a.DomHandler.getFirstFocusableElement(e,v(o))),a.DomHandler.focus(p)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:a.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(f=function(e,t,n){return m.default.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:t,"data-pc-section":n})})(i,(function(e){var t,n=e.currentTarget,o=e.relatedTarget,i=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:a.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));a.DomHandler.focus(i)}),"firstfocusableelement"),b=f(l,x,"lastfocusableelement"),i.current&&l.current&&(i.current.$_pfocustrap_lasthiddenfocusableelement=l.current,l.current.$_pfocustrap_firsthiddenfocusableelement=i.current),m.default.createElement(m.default.Fragment,null,g,s.children,b)})));function _(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=n.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,showCloseIcon:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return a.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return a.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return a.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return a.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return a.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===g.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===g.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return N({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function T(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 B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=f.forwardRef((function(e,p){var d=o.useMergeProps(),m=f.useContext(t.PrimeReactContext),h=M.getProps(e,m),y=h.id?h.id:a.UniqueComponentId(),E=j(f.useState(y),2),D=E[0],S=j(f.useState(!1),2),P=S[0],I=S[1],z=j(f.useState(!1),2),k=z[0],C=z[1],R=j(f.useState(h.maximized),2),_=R[0],N=R[1],T=f.useRef(null),F=f.useRef(null),U=f.useRef(null),X=f.useRef(null),A=f.useRef(null),L=f.useRef(null),q=f.useRef(null),Y=f.useRef(!1),$=f.useRef(!1),V=f.useRef(null),Z=f.useRef(null),J=f.useRef(null),W=f.useRef(y),G=f.useRef(null),K=h.onMaximize?h.maximized:_,Q=k&&(h.blockScroll||h.maximizable&&K),ee=h.closable&&h.closeOnEscape&&k,te=o.useDisplayOrder("dialog",ee),ne=M.setMetaData(B(B({props:h},h.__parentMetadata),{},{state:{id:D,maximized:K,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ae=ne.sx,ie=ne.isUnstyled;n.useHandleStyle(M.css.styles,ie,{name:"dialog"}),o.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[o.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=j(o.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ze(e)}}),2),ce=le[0],se=le[1],ue=j(o.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return je(e)}}),2),pe=ue[0],de=ue[1],me=j(o.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=j(o.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){h.onHide(e),e.preventDefault()},xe=function(e){U.current=e.target,h.onPointerDown&&h.onPointerDown(e)},Oe=function(e){h.dismissableMask&&h.modal&&F.current===e.target&&!U.current&&ve(e),h.onMaskClick&&h.onMaskClick(e),U.current=null},we=function(e){h.onMaximize?h.onMaximize({originalEvent:e,maximized:!K}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){a.DomHandler.hasClass(e.target,"p-dialog-header-icon")||a.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||h.draggable&&(Y.current=!0,V.current=e.pageX,Z.current=e.pageY,a.DomHandler.addClass(document.body,"p-unselectable-text"),h.onDragStart&&h.onDragStart(e))},De=function(e){if(Y.current){var t=a.DomHandler.getOuterWidth(T.current),n=a.DomHandler.getOuterHeight(T.current),r=e.pageX-V.current,o=e.pageY-Z.current,i=T.current.getBoundingClientRect(),l=i.left+r,c=i.top+o,s=a.DomHandler.getViewport(),u=getComputedStyle(T.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);T.current.style.position="fixed",h.keepInViewport?(l>=h.minX&&l+t<s.width&&(V.current=e.pageX,T.current.style.left=l-p+"px"),c>=h.minY&&c+n<s.height&&(Z.current=e.pageY,T.current.style.top=c-d+"px")):(V.current=e.pageX,T.current.style.left=l-p+"px",Z.current=e.pageY,T.current.style.top=c-d+"px"),h.onDrag&&h.onDrag(e)}},Se=function(e){Y.current&&(Y.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),h.onDragEnd&&h.onDragEnd(e))},Pe=function(e){h.resizable&&($.current=!0,V.current=e.pageX,Z.current=e.pageY,a.DomHandler.addClass(document.body,"p-unselectable-text"),h.onResizeStart&&h.onResizeStart(e))},Ie=function(e,t,n){!n&&(n=a.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},ze=function(e){if($.current){var t=e.pageX-V.current,n=e.pageY-Z.current,r=a.DomHandler.getOuterWidth(T.current),o=a.DomHandler.getOuterHeight(T.current),i=T.current.getBoundingClientRect(),l=a.DomHandler.getViewport(),c=!parseInt(T.current.style.top)||!parseInt(T.current.style.left),s=Ie(T.current.style.minWidth,"width",l),u=Ie(T.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&i.left+p<l.width&&(T.current.style.width=p+"px"),(!u||d>u)&&i.top+d<l.height&&(T.current.style.height=d+"px"),V.current=e.pageX,Z.current=e.pageY,h.onResize&&h.onResize(e)}},je=function(e){$.current&&($.current=!1,a.DomHandler.removeClass(document.body,"p-unselectable-text"),h.onResizeEnd&&h.onResizeEnd(e))},ke=function(){T.current.style.position="",T.current.style.left="",T.current.style.top="",T.current.style.margin=""},Ce=function(){T.current.setAttribute(W.current,"")},Re=function(){var e;h.onShow&&h.onShow(),h.focusOnShow&&!((e=document.activeElement)&&T.current&&T.current.contains(e))&&h.closable&&h.showCloseIcon&&h.showHeader&&q.current&&q.current.focus(),Ne()},He=function(){h.modal&&!ie()&&a.DomHandler.addClass(F.current,"p-component-overlay-leave")},_e=function(){Y.current=!1,a.ZIndexUtils.clear(F.current),I(!1),Me(),a.DomHandler.focus(G.current),G.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&k){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(v(r=document.primeDialogParams)||x(r)||O(r)||w(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?a.DomHandler.blockBodyScroll():a.DomHandler.unblockBodyScroll()},Be=function(){h.draggable&&(fe(),he()),h.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){J.current=a.DomHandler.createInlineStyle(m&&m.nonce||g.default.nonce,m&&m.styleContainer);var e="";for(var t in h.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(W.current,"] {\n width: ").concat(h.breakpoints[t]," !important;\n }\n }\n ");J.current.innerHTML=e};o.useMountEffect((function(){Te(!0),h.visible&&I(!0)})),f.useEffect((function(){return h.breakpoints&&Ue(),function(){J.current=a.DomHandler.removeInlineStyle(J.current)}}),[h.breakpoints]),o.useUpdateEffect((function(){h.visible&&!P&&I(!0),h.visible!==k&&P&&C(h.visible),h.visible&&(G.current=document.activeElement)}),[h.visible,P]),o.useUpdateEffect((function(){P&&(a.ZIndexUtils.set("modal",F.current,m&&m.autoZIndex||g.default.autoZIndex,h.baseZIndex||m&&m.zIndex.modal||g.default.zIndex.modal),C(!0))}),[P]),o.useUpdateEffect((function(){Te(!0)}),[Q,k]),o.useUnmountEffect((function(){Me(),Te(!1),a.DomHandler.removeInlineStyle(J.current),a.ZIndexUtils.clear(F.current)})),f.useImperativeHandle(p,(function(){return{props:h,resetPosition:ke,getElement:function(){return T.current},getMask:function(){return F.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return q.current}}}));var Xe=function(){if(h.closable&&h.showCloseIcon){var e=h.ariaCloseIconLabel||t.ariaLabel("close"),n=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=a.IconUtils.getJSXIcon(h.closeIcon||f.createElement(i.TimesIcon,n),B({},n),{props:h}),o=d({ref:q,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},re("closeButton"));return f.createElement("button",o,r,f.createElement(u.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=a.IconUtils.getJSXIcon(K?h.minimizeIcon||f.createElement(c.WindowMinimizeIcon,e):h.maximizeIcon||f.createElement(l.WindowMaximizeIcon,e),e,{props:h});if(h.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return f.createElement("button",n,t,f.createElement(u.Ripple,null))}return null},Le=function(){if(h.showHeader){var e=Xe(),t=Ae(),n=a.ObjectUtils.getJSXElement(h.icons,h),r=a.ObjectUtils.getJSXElement(h.header,h),o=D+"_header",i=d({ref:A,style:h.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return f.createElement("div",i,f.createElement("div",l,r),f.createElement("div",c,n,t,e))}return null},qe=function(){var e=a.ObjectUtils.getJSXElement(h.footer,h),t=d({ref:L,className:oe("footer")},re("footer"));return e&&f.createElement("div",t,e)};return P&&function(){var t,n,o,i,l,c,u=D+"_header",p=D+"_content",g={enter:"center"===h.position?150:300,exit:"center"===h.position?150:300},y=d({ref:F,style:ae("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:T,id:D,className:a.classNames(h.className,oe("root",{props:h,maximized:K,context:m})),style:h.style,onClick:h.onClick,role:"dialog","aria-labelledby":u,"aria-describedby":p,"aria-modal":h.modal,onPointerDown:xe},M.getOtherProps(h),re("root")),x=d({classNames:oe("transition"),timeout:g,in:k,options:h.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:h.header,content:h.message,message:null==h||null===(l=h.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=a.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:q,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:h.contentStyle,className:oe("content")},re("content")),o=f.createElement("div",t,h.children),i=qe(),O=f.createElement(f.Fragment,null,n,o,i,h.resizable?f.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=f.createElement("div",y,f.createElement(r.CSSTransition,b({nodeRef:T},x),f.createElement("div",v,f.createElement(H,{autoFocus:h.focusOnShow},O))));return f.createElement(s.Portal,{element:w,appendTo:h.appendTo,visible:!0})}()}));F.displayName="Dialog",exports.Dialog=F;
@@ -219,7 +219,7 @@ export interface DialogProps {
219
219
  */
220
220
  className?: string | undefined;
221
221
  /**
222
- * Adds a close icon to the header to hide the dialog.
222
+ * When enabled, the dialog can be closed by clicking the close icon, pressing escape key or clicking the modal background.
223
223
  * @defaultValue true
224
224
  */
225
225
  closable?: boolean | undefined;
@@ -337,6 +337,11 @@ export interface DialogProps {
337
337
  * @defaultValue true
338
338
  */
339
339
  showHeader?: boolean | undefined;
340
+ /**
341
+ * When enabled, the close icon is displayed in the header.
342
+ * @defaultValue true
343
+ */
344
+ showCloseIcon?: boolean | undefined;
340
345
  /**
341
346
  * Icon to display in the dialog maximize button when dialog is not maximized.
342
347
  */
@@ -366,6 +366,7 @@ var DialogBase = ComponentBase.extend({
366
366
  resizable: true,
367
367
  rtl: false,
368
368
  showHeader: true,
369
+ showCloseIcon: true,
369
370
  style: null,
370
371
  transitionOptions: null,
371
372
  visible: false,
@@ -497,7 +498,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
497
498
  var focus = function focus() {
498
499
  var activeElement = document.activeElement;
499
500
  var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
500
- if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
501
+ if (!isActiveElementInDialog && props.closable && props.showCloseIcon && props.showHeader && closeRef.current) {
501
502
  closeRef.current.focus();
502
503
  }
503
504
  };
@@ -803,7 +804,7 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
803
804
  };
804
805
  });
805
806
  var createCloseIcon = function createCloseIcon() {
806
- if (props.closable) {
807
+ if (props.closable && props.showCloseIcon) {
807
808
  var labelAria = props.ariaCloseIconLabel || ariaLabel('close');
808
809
  var closeButtonIconProps = mergeProps({
809
810
  className: cx('closeButtonIcon'),
@@ -1 +1 @@
1
- import*as e from"react";import t from"react";import n,{PrimeReactContext as r,ariaLabel as o}from"primereact/api";import{ComponentBase as i,useHandleStyle as a}from"primereact/componentbase";import{CSSTransition as l}from"primereact/csstransition";import{useStyle as c,useMountEffect as s,useMergeProps as u,useDisplayOrder as p,useGlobalOnEscapeKey as d,ESC_KEY_HANDLING_PRIORITIES as m,useEventListener as f,useUpdateEffect as g,useUnmountEffect as b}from"primereact/hooks";import{ObjectUtils as h,DomHandler as y,classNames as v,UniqueComponentId as x,ZIndexUtils as w,IconUtils as O}from"primereact/utils";import{TimesIcon as S}from"primereact/icons/times";import{WindowMaximizeIcon as E}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as P}from"primereact/icons/windowminimize";import{Portal as z}from"primereact/portal";import{Ripple as k}from"primereact/ripple";function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(null,arguments)}function D(e){return D="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},D(e)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){if(Array.isArray(e))return j(e)}function C(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.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)?j(e,t):void 0}}function N(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if("object"!=D(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function M(e){var t=T(e,"string");return"symbol"==D(t)?t:t+""}function F(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){if(Array.isArray(e))return e}function X(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function A(){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 H(e,t){return B(e)||X(e,t)||_(e,t)||A()}var Y=i.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return h.getMergedProps(e,Y.defaultProps)},getOtherProps:function(e){return h.getDiffProps(e,Y.defaultProps)}});function $(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?$(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var V=t.memo(t.forwardRef((function(e,n){var o=t.useRef(null),i=t.useRef(null),a=t.useRef(null),l=t.useContext(r),u=Y.getProps(e,l),p={props:u};c(Y.css.styles,{name:"focustrap"});Y.setMetaData(L({},p));t.useImperativeHandle(n,(function(){return{props:u,getInk:function(){return i.current},getTarget:function(){return o.current}}})),s((function(){u.disabled||(o.current=h(),v(o.current))}));var d,m,f,g,b,h=function(){return i.current&&i.current.parentElement},v=function(e){var t=u||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,i=t.autoFocus,a=void 0!==i&&i,l="".concat(x(void 0===n?"":n)),c="[autofocus]".concat(l,", [data-pc-autofocus='true']").concat(l),s=y.getFirstFocusableElement(e,c);a&&!s&&(s=y.getFirstFocusableElement(e,x(o))),y.focus(s)},x=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},w=function(e){var t,n=e.currentTarget,r=e.relatedTarget,i=r!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=o.current)&&void 0!==t&&t.contains(r)?n.$_pfocustrap_firsthiddenfocusableelement:y.getLastFocusableElement(n.parentElement,x(n.$_pfocustrap_focusableselector));y.focus(i)};return m=void 0===(d=(u||{}).tabIndex)?0:d,g=(f=function(e,n,r){return t.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:m,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:n,"data-pc-section":r})})(i,(function(e){var t,n=e.currentTarget,r=e.relatedTarget,i=r!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=o.current)&&void 0!==t&&t.contains(r)?n.$_pfocustrap_lasthiddenfocusableelement:y.getFirstFocusableElement(n.parentElement,x(n.$_pfocustrap_focusableselector));y.focus(i)}),"firstfocusableelement"),b=f(a,w,"lastfocusableelement"),i.current&&a.current&&(i.current.$_pfocustrap_lasthiddenfocusableelement=a.current,a.current.$_pfocustrap_firsthiddenfocusableelement=i.current),t.createElement(t.Fragment,null,g,u.children,b)})));function J(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 Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=i.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return v("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return v("p-dialog-content",e.props.contentClassName)},footer:function(e){return v("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return v("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,r=e.context;return v("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":r&&"filled"===r.inputStyle||"filled"===n.inputStyle,"p-ripple-disabled":r&&!1===r.ripple||!1===n.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return Z({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function W(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var K=e.forwardRef((function(t,i){var c=u(),D=e.useContext(r),j=U.getProps(t,D),T=j.id?j.id:x(),M=H(e.useState(T),2),F=M[0],B=H(e.useState(!1),2),X=B[0],A=B[1],Y=H(e.useState(!1),2),$=Y[0],L=Y[1],J=H(e.useState(j.maximized),2),Z=J[0],W=J[1],K=e.useRef(null),q=e.useRef(null),Q=e.useRef(null),ee=e.useRef(null),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(!1),ie=e.useRef(!1),ae=e.useRef(null),le=e.useRef(null),ce=e.useRef(null),se=e.useRef(T),ue=e.useRef(null),pe=j.onMaximize?j.maximized:Z,de=$&&(j.blockScroll||j.maximizable&&pe),me=j.closable&&j.closeOnEscape&&$,fe=p("dialog",me),ge=U.setMetaData(G(G({props:j},j.__parentMetadata),{},{state:{id:F,maximized:pe,containerVisible:X}})),be=ge.ptm,he=ge.cx,ye=ge.sx,ve=ge.isUnstyled;a(U.css.styles,ve,{name:"dialog"}),d({callback:function(e){Ce(e)},when:me&&fe,priority:[m.DIALOG,fe]});var xe=H(f({type:"mousemove",target:function(){return window.document},listener:function(e){return He(e)}}),2),we=xe[0],Oe=xe[1],Se=H(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Ye(e)}}),2),Ee=Se[0],Pe=Se[1],ze=H(f({type:"mousemove",target:function(){return window.document},listener:function(e){return Fe(e)}}),2),ke=ze[0],Ie=ze[1],De=H(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),je=De[0],Re=De[1],Ce=function(e){j.onHide(e),e.preventDefault()},_e=function(e){Q.current=e.target,j.onPointerDown&&j.onPointerDown(e)},Ne=function(e){j.dismissableMask&&j.modal&&q.current===e.target&&!Q.current&&Ce(e),j.onMaskClick&&j.onMaskClick(e),Q.current=null},Te=function(e){j.onMaximize?j.onMaximize({originalEvent:e,maximized:!pe}):W((function(e){return!e})),e.preventDefault()},Me=function(e){y.hasClass(e.target,"p-dialog-header-icon")||y.hasClass(e.target.parentElement,"p-dialog-header-icon")||j.draggable&&(oe.current=!0,ae.current=e.pageX,le.current=e.pageY,y.addClass(document.body,"p-unselectable-text"),j.onDragStart&&j.onDragStart(e))},Fe=function(e){if(oe.current){var t=y.getOuterWidth(K.current),n=y.getOuterHeight(K.current),r=e.pageX-ae.current,o=e.pageY-le.current,i=K.current.getBoundingClientRect(),a=i.left+r,l=i.top+o,c=y.getViewport(),s=getComputedStyle(K.current),u=parseFloat(s.marginLeft),p=parseFloat(s.marginTop);K.current.style.position="fixed",j.keepInViewport?(a>=j.minX&&a+t<c.width&&(ae.current=e.pageX,K.current.style.left=a-u+"px"),l>=j.minY&&l+n<c.height&&(le.current=e.pageY,K.current.style.top=l-p+"px")):(ae.current=e.pageX,K.current.style.left=a-u+"px",le.current=e.pageY,K.current.style.top=l-p+"px"),j.onDrag&&j.onDrag(e)}},Be=function(e){oe.current&&(oe.current=!1,y.removeClass(document.body,"p-unselectable-text"),j.onDragEnd&&j.onDragEnd(e))},Xe=function(e){j.resizable&&(ie.current=!0,ae.current=e.pageX,le.current=e.pageY,y.addClass(document.body,"p-unselectable-text"),j.onResizeStart&&j.onResizeStart(e))},Ae=function(e,t,n){!n&&(n=y.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},He=function(e){if(ie.current){var t=e.pageX-ae.current,n=e.pageY-le.current,r=y.getOuterWidth(K.current),o=y.getOuterHeight(K.current),i=K.current.getBoundingClientRect(),a=y.getViewport(),l=!parseInt(K.current.style.top)||!parseInt(K.current.style.left),c=Ae(K.current.style.minWidth,"width",a),s=Ae(K.current.style.minHeight,"height",a),u=r+t,p=o+n;l&&(u+=t,p+=n),(!c||u>c)&&i.left+u<a.width&&(K.current.style.width=u+"px"),(!s||p>s)&&i.top+p<a.height&&(K.current.style.height=p+"px"),ae.current=e.pageX,le.current=e.pageY,j.onResize&&j.onResize(e)}},Ye=function(e){ie.current&&(ie.current=!1,y.removeClass(document.body,"p-unselectable-text"),j.onResizeEnd&&j.onResizeEnd(e))},$e=function(){K.current.style.position="",K.current.style.left="",K.current.style.top="",K.current.style.margin=""},Le=function(){K.current.setAttribute(se.current,"")},Ve=function(){var e;j.onShow&&j.onShow(),j.focusOnShow&&!((e=document.activeElement)&&K.current&&K.current.contains(e))&&j.closable&&j.showHeader&&re.current&&re.current.focus(),Ue()},Je=function(){j.modal&&!ve()&&y.addClass(q.current,"p-component-overlay-leave")},Ze=function(){oe.current=!1,w.clear(q.current),A(!1),We(),y.focus(ue.current),ue.current=null},Ue=function(){Ke()},We=function(){qe()},Ge=function(e){if(e&&$){var t={id:F,hasBlockScroll:de};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===F}));document.primeDialogParams=-1===n?[].concat(R(r=document.primeDialogParams)||C(r)||_(r)||N(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==F}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?y.blockBodyScroll():y.unblockBodyScroll()},Ke=function(){j.draggable&&(ke(),je()),j.resizable&&(we(),Ee())},qe=function(){Ie(),Re(),Oe(),Pe()},Qe=function(){ce.current=y.createInlineStyle(D&&D.nonce||n.nonce,D&&D.styleContainer);var e="";for(var t in j.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(se.current,"] {\n width: ").concat(j.breakpoints[t]," !important;\n }\n }\n ");ce.current.innerHTML=e};s((function(){Ge(!0),j.visible&&A(!0)})),e.useEffect((function(){return j.breakpoints&&Qe(),function(){ce.current=y.removeInlineStyle(ce.current)}}),[j.breakpoints]),g((function(){j.visible&&!X&&A(!0),j.visible!==$&&X&&L(j.visible),j.visible&&(ue.current=document.activeElement)}),[j.visible,X]),g((function(){X&&(w.set("modal",q.current,D&&D.autoZIndex||n.autoZIndex,j.baseZIndex||D&&D.zIndex.modal||n.zIndex.modal),L(!0))}),[X]),g((function(){Ge(!0)}),[de,$]),b((function(){We(),Ge(!1),y.removeInlineStyle(ce.current),w.clear(q.current)})),e.useImperativeHandle(i,(function(){return{props:j,resetPosition:$e,getElement:function(){return K.current},getMask:function(){return q.current},getContent:function(){return ee.current},getHeader:function(){return te.current},getFooter:function(){return ne.current},getCloseButton:function(){return re.current}}}));var et=function(){if(j.closable){var t=j.ariaCloseIconLabel||o("close"),n=c({className:he("closeButtonIcon"),"aria-hidden":!0},be("closeButtonIcon")),r=O.getJSXIcon(j.closeIcon||e.createElement(S,n),G({},n),{props:j}),i=c({ref:re,type:"button",className:he("closeButton"),"aria-label":t,onClick:Ce,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},be("closeButton"));return e.createElement("button",i,r,e.createElement(k,null))}return null},tt=function(){var t=c({className:he("maximizableIcon")},be("maximizableIcon")),n=O.getJSXIcon(pe?j.minimizeIcon||e.createElement(P,t):j.maximizeIcon||e.createElement(E,t),t,{props:j});if(j.maximizable){var r=c({type:"button",className:he("maximizableButton"),onClick:Te},be("maximizableButton"));return e.createElement("button",r,n,e.createElement(k,null))}return null},nt=function(){if(j.showHeader){var t=et(),n=tt(),r=h.getJSXElement(j.icons,j),o=h.getJSXElement(j.header,j),i=F+"_header",a=c({ref:te,style:j.headerStyle,className:he("header"),onMouseDown:Me},be("header")),l=c({id:i,className:he("headerTitle")},be("headerTitle")),s=c({className:he("headerIcons")},be("headerIcons"));return e.createElement("div",a,e.createElement("div",l,o),e.createElement("div",s,r,n,t))}return null},rt=function(){var t=h.getJSXElement(j.footer,j),n=c({ref:ne,className:he("footer")},be("footer"));return t&&e.createElement("div",n,t)};return X&&function(){var n,r,o,i,a,s,u=F+"_header",p=F+"_content",d={enter:"center"===j.position?150:300,exit:"center"===j.position?150:300},m=c({ref:q,style:ye("mask"),className:he("mask"),onPointerUp:Ne},be("mask")),f=c({ref:K,id:F,className:v(j.className,he("root",{props:j,maximized:pe,context:D})),style:j.style,onClick:j.onClick,role:"dialog","aria-labelledby":u,"aria-describedby":p,"aria-modal":j.modal,onPointerDown:_e},U.getOtherProps(j),be("root")),g=c({classNames:he("transition"),timeout:d,in:$,options:j.transitionOptions,unmountOnExit:!0,onEnter:Le,onEntered:Ve,onExiting:Je,onExited:Ze},be("transition")),b=null;null!=t&&t.content?(s={header:j.header,content:j.message,message:null==j||null===(a=j.children)||void 0===a||null===(a=a[1])||void 0===a||null===(a=a.props)||void 0===a?void 0:a.children},b=h.getJSXElement(t.content,{headerRef:te,contentRef:ee,footerRef:ne,closeRef:re,hide:Ce,message:s})):(r=nt(),n=c({id:F+"_content",ref:ee,style:j.contentStyle,className:he("content")},be("content")),o=e.createElement("div",n,j.children),i=rt(),b=e.createElement(e.Fragment,null,r,o,i,j.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Xe}):null));var y=e.createElement("div",m,e.createElement(l,I({nodeRef:K},g),e.createElement("div",f,e.createElement(V,{autoFocus:j.focusOnShow},b))));return e.createElement(z,{element:y,appendTo:j.appendTo,visible:!0})}()}));K.displayName="Dialog";export{K as Dialog};
1
+ import*as e from"react";import t from"react";import n,{PrimeReactContext as r,ariaLabel as o}from"primereact/api";import{ComponentBase as i,useHandleStyle as a}from"primereact/componentbase";import{CSSTransition as l}from"primereact/csstransition";import{useStyle as c,useMountEffect as s,useMergeProps as u,useDisplayOrder as p,useGlobalOnEscapeKey as d,ESC_KEY_HANDLING_PRIORITIES as m,useEventListener as f,useUpdateEffect as g,useUnmountEffect as b}from"primereact/hooks";import{ObjectUtils as h,DomHandler as y,classNames as v,UniqueComponentId as x,ZIndexUtils as w,IconUtils as O}from"primereact/utils";import{TimesIcon as S}from"primereact/icons/times";import{WindowMaximizeIcon as E}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as P}from"primereact/icons/windowminimize";import{Portal as z}from"primereact/portal";import{Ripple as k}from"primereact/ripple";function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(null,arguments)}function D(e){return D="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},D(e)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e){if(Array.isArray(e))return j(e)}function R(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.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)?j(e,t):void 0}}function N(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if("object"!=D(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function M(e){var t=T(e,"string");return"symbol"==D(t)?t:t+""}function F(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){if(Array.isArray(e))return e}function X(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function A(){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 H(e,t){return B(e)||X(e,t)||_(e,t)||A()}var Y=i.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return h.getMergedProps(e,Y.defaultProps)},getOtherProps:function(e){return h.getDiffProps(e,Y.defaultProps)}});function $(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?$(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var V=t.memo(t.forwardRef((function(e,n){var o=t.useRef(null),i=t.useRef(null),a=t.useRef(null),l=t.useContext(r),u=Y.getProps(e,l),p={props:u};c(Y.css.styles,{name:"focustrap"});Y.setMetaData(L({},p));t.useImperativeHandle(n,(function(){return{props:u,getInk:function(){return i.current},getTarget:function(){return o.current}}})),s((function(){u.disabled||(o.current=h(),v(o.current))}));var d,m,f,g,b,h=function(){return i.current&&i.current.parentElement},v=function(e){var t=u||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,i=t.autoFocus,a=void 0!==i&&i,l="".concat(x(void 0===n?"":n)),c="[autofocus]".concat(l,", [data-pc-autofocus='true']").concat(l),s=y.getFirstFocusableElement(e,c);a&&!s&&(s=y.getFirstFocusableElement(e,x(o))),y.focus(s)},x=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},w=function(e){var t,n=e.currentTarget,r=e.relatedTarget,i=r!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=o.current)&&void 0!==t&&t.contains(r)?n.$_pfocustrap_firsthiddenfocusableelement:y.getLastFocusableElement(n.parentElement,x(n.$_pfocustrap_focusableselector));y.focus(i)};return m=void 0===(d=(u||{}).tabIndex)?0:d,g=(f=function(e,n,r){return t.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:m,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:n,"data-pc-section":r})})(i,(function(e){var t,n=e.currentTarget,r=e.relatedTarget,i=r!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=o.current)&&void 0!==t&&t.contains(r)?n.$_pfocustrap_lasthiddenfocusableelement:y.getFirstFocusableElement(n.parentElement,x(n.$_pfocustrap_focusableselector));y.focus(i)}),"firstfocusableelement"),b=f(a,w,"lastfocusableelement"),i.current&&a.current&&(i.current.$_pfocustrap_lasthiddenfocusableelement=a.current,a.current.$_pfocustrap_firsthiddenfocusableelement=i.current),t.createElement(t.Fragment,null,g,u.children,b)})));function J(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 Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=i.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,showCloseIcon:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return v("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return v("p-dialog-content",e.props.contentClassName)},footer:function(e){return v("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return v("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,r=e.context;return v("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":r&&"filled"===r.inputStyle||"filled"===n.inputStyle,"p-ripple-disabled":r&&!1===r.ripple||!1===n.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return Z({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function W(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var K=e.forwardRef((function(t,i){var c=u(),D=e.useContext(r),j=U.getProps(t,D),T=j.id?j.id:x(),M=H(e.useState(T),2),F=M[0],B=H(e.useState(!1),2),X=B[0],A=B[1],Y=H(e.useState(!1),2),$=Y[0],L=Y[1],J=H(e.useState(j.maximized),2),Z=J[0],W=J[1],K=e.useRef(null),q=e.useRef(null),Q=e.useRef(null),ee=e.useRef(null),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(!1),ie=e.useRef(!1),ae=e.useRef(null),le=e.useRef(null),ce=e.useRef(null),se=e.useRef(T),ue=e.useRef(null),pe=j.onMaximize?j.maximized:Z,de=$&&(j.blockScroll||j.maximizable&&pe),me=j.closable&&j.closeOnEscape&&$,fe=p("dialog",me),ge=U.setMetaData(G(G({props:j},j.__parentMetadata),{},{state:{id:F,maximized:pe,containerVisible:X}})),be=ge.ptm,he=ge.cx,ye=ge.sx,ve=ge.isUnstyled;a(U.css.styles,ve,{name:"dialog"}),d({callback:function(e){Re(e)},when:me&&fe,priority:[m.DIALOG,fe]});var xe=H(f({type:"mousemove",target:function(){return window.document},listener:function(e){return He(e)}}),2),we=xe[0],Oe=xe[1],Se=H(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Ye(e)}}),2),Ee=Se[0],Pe=Se[1],ze=H(f({type:"mousemove",target:function(){return window.document},listener:function(e){return Fe(e)}}),2),ke=ze[0],Ie=ze[1],De=H(f({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),je=De[0],Ce=De[1],Re=function(e){j.onHide(e),e.preventDefault()},_e=function(e){Q.current=e.target,j.onPointerDown&&j.onPointerDown(e)},Ne=function(e){j.dismissableMask&&j.modal&&q.current===e.target&&!Q.current&&Re(e),j.onMaskClick&&j.onMaskClick(e),Q.current=null},Te=function(e){j.onMaximize?j.onMaximize({originalEvent:e,maximized:!pe}):W((function(e){return!e})),e.preventDefault()},Me=function(e){y.hasClass(e.target,"p-dialog-header-icon")||y.hasClass(e.target.parentElement,"p-dialog-header-icon")||j.draggable&&(oe.current=!0,ae.current=e.pageX,le.current=e.pageY,y.addClass(document.body,"p-unselectable-text"),j.onDragStart&&j.onDragStart(e))},Fe=function(e){if(oe.current){var t=y.getOuterWidth(K.current),n=y.getOuterHeight(K.current),r=e.pageX-ae.current,o=e.pageY-le.current,i=K.current.getBoundingClientRect(),a=i.left+r,l=i.top+o,c=y.getViewport(),s=getComputedStyle(K.current),u=parseFloat(s.marginLeft),p=parseFloat(s.marginTop);K.current.style.position="fixed",j.keepInViewport?(a>=j.minX&&a+t<c.width&&(ae.current=e.pageX,K.current.style.left=a-u+"px"),l>=j.minY&&l+n<c.height&&(le.current=e.pageY,K.current.style.top=l-p+"px")):(ae.current=e.pageX,K.current.style.left=a-u+"px",le.current=e.pageY,K.current.style.top=l-p+"px"),j.onDrag&&j.onDrag(e)}},Be=function(e){oe.current&&(oe.current=!1,y.removeClass(document.body,"p-unselectable-text"),j.onDragEnd&&j.onDragEnd(e))},Xe=function(e){j.resizable&&(ie.current=!0,ae.current=e.pageX,le.current=e.pageY,y.addClass(document.body,"p-unselectable-text"),j.onResizeStart&&j.onResizeStart(e))},Ae=function(e,t,n){!n&&(n=y.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},He=function(e){if(ie.current){var t=e.pageX-ae.current,n=e.pageY-le.current,r=y.getOuterWidth(K.current),o=y.getOuterHeight(K.current),i=K.current.getBoundingClientRect(),a=y.getViewport(),l=!parseInt(K.current.style.top)||!parseInt(K.current.style.left),c=Ae(K.current.style.minWidth,"width",a),s=Ae(K.current.style.minHeight,"height",a),u=r+t,p=o+n;l&&(u+=t,p+=n),(!c||u>c)&&i.left+u<a.width&&(K.current.style.width=u+"px"),(!s||p>s)&&i.top+p<a.height&&(K.current.style.height=p+"px"),ae.current=e.pageX,le.current=e.pageY,j.onResize&&j.onResize(e)}},Ye=function(e){ie.current&&(ie.current=!1,y.removeClass(document.body,"p-unselectable-text"),j.onResizeEnd&&j.onResizeEnd(e))},$e=function(){K.current.style.position="",K.current.style.left="",K.current.style.top="",K.current.style.margin=""},Le=function(){K.current.setAttribute(se.current,"")},Ve=function(){var e;j.onShow&&j.onShow(),j.focusOnShow&&!((e=document.activeElement)&&K.current&&K.current.contains(e))&&j.closable&&j.showCloseIcon&&j.showHeader&&re.current&&re.current.focus(),Ue()},Je=function(){j.modal&&!ve()&&y.addClass(q.current,"p-component-overlay-leave")},Ze=function(){oe.current=!1,w.clear(q.current),A(!1),We(),y.focus(ue.current),ue.current=null},Ue=function(){Ke()},We=function(){qe()},Ge=function(e){if(e&&$){var t={id:F,hasBlockScroll:de};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===F}));document.primeDialogParams=-1===n?[].concat(C(r=document.primeDialogParams)||R(r)||_(r)||N(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==F}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?y.blockBodyScroll():y.unblockBodyScroll()},Ke=function(){j.draggable&&(ke(),je()),j.resizable&&(we(),Ee())},qe=function(){Ie(),Ce(),Oe(),Pe()},Qe=function(){ce.current=y.createInlineStyle(D&&D.nonce||n.nonce,D&&D.styleContainer);var e="";for(var t in j.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(se.current,"] {\n width: ").concat(j.breakpoints[t]," !important;\n }\n }\n ");ce.current.innerHTML=e};s((function(){Ge(!0),j.visible&&A(!0)})),e.useEffect((function(){return j.breakpoints&&Qe(),function(){ce.current=y.removeInlineStyle(ce.current)}}),[j.breakpoints]),g((function(){j.visible&&!X&&A(!0),j.visible!==$&&X&&L(j.visible),j.visible&&(ue.current=document.activeElement)}),[j.visible,X]),g((function(){X&&(w.set("modal",q.current,D&&D.autoZIndex||n.autoZIndex,j.baseZIndex||D&&D.zIndex.modal||n.zIndex.modal),L(!0))}),[X]),g((function(){Ge(!0)}),[de,$]),b((function(){We(),Ge(!1),y.removeInlineStyle(ce.current),w.clear(q.current)})),e.useImperativeHandle(i,(function(){return{props:j,resetPosition:$e,getElement:function(){return K.current},getMask:function(){return q.current},getContent:function(){return ee.current},getHeader:function(){return te.current},getFooter:function(){return ne.current},getCloseButton:function(){return re.current}}}));var et=function(){if(j.closable&&j.showCloseIcon){var t=j.ariaCloseIconLabel||o("close"),n=c({className:he("closeButtonIcon"),"aria-hidden":!0},be("closeButtonIcon")),r=O.getJSXIcon(j.closeIcon||e.createElement(S,n),G({},n),{props:j}),i=c({ref:re,type:"button",className:he("closeButton"),"aria-label":t,onClick:Re,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},be("closeButton"));return e.createElement("button",i,r,e.createElement(k,null))}return null},tt=function(){var t=c({className:he("maximizableIcon")},be("maximizableIcon")),n=O.getJSXIcon(pe?j.minimizeIcon||e.createElement(P,t):j.maximizeIcon||e.createElement(E,t),t,{props:j});if(j.maximizable){var r=c({type:"button",className:he("maximizableButton"),onClick:Te},be("maximizableButton"));return e.createElement("button",r,n,e.createElement(k,null))}return null},nt=function(){if(j.showHeader){var t=et(),n=tt(),r=h.getJSXElement(j.icons,j),o=h.getJSXElement(j.header,j),i=F+"_header",a=c({ref:te,style:j.headerStyle,className:he("header"),onMouseDown:Me},be("header")),l=c({id:i,className:he("headerTitle")},be("headerTitle")),s=c({className:he("headerIcons")},be("headerIcons"));return e.createElement("div",a,e.createElement("div",l,o),e.createElement("div",s,r,n,t))}return null},rt=function(){var t=h.getJSXElement(j.footer,j),n=c({ref:ne,className:he("footer")},be("footer"));return t&&e.createElement("div",n,t)};return X&&function(){var n,r,o,i,a,s,u=F+"_header",p=F+"_content",d={enter:"center"===j.position?150:300,exit:"center"===j.position?150:300},m=c({ref:q,style:ye("mask"),className:he("mask"),onPointerUp:Ne},be("mask")),f=c({ref:K,id:F,className:v(j.className,he("root",{props:j,maximized:pe,context:D})),style:j.style,onClick:j.onClick,role:"dialog","aria-labelledby":u,"aria-describedby":p,"aria-modal":j.modal,onPointerDown:_e},U.getOtherProps(j),be("root")),g=c({classNames:he("transition"),timeout:d,in:$,options:j.transitionOptions,unmountOnExit:!0,onEnter:Le,onEntered:Ve,onExiting:Je,onExited:Ze},be("transition")),b=null;null!=t&&t.content?(s={header:j.header,content:j.message,message:null==j||null===(a=j.children)||void 0===a||null===(a=a[1])||void 0===a||null===(a=a.props)||void 0===a?void 0:a.children},b=h.getJSXElement(t.content,{headerRef:te,contentRef:ee,footerRef:ne,closeRef:re,hide:Re,message:s})):(r=nt(),n=c({id:F+"_content",ref:ee,style:j.contentStyle,className:he("content")},be("content")),o=e.createElement("div",n,j.children),i=rt(),b=e.createElement(e.Fragment,null,r,o,i,j.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Xe}):null));var y=e.createElement("div",m,e.createElement(l,I({nodeRef:K},g),e.createElement("div",f,e.createElement(V,{autoFocus:j.focusOnShow},b))));return e.createElement(z,{element:y,appendTo:j.appendTo,visible:!0})}()}));K.displayName="Dialog";export{K as Dialog};
package/dialog/dialog.js CHANGED
@@ -380,6 +380,7 @@ this.primereact.dialog = (function (exports, React, PrimeReact, componentbase, c
380
380
  resizable: true,
381
381
  rtl: false,
382
382
  showHeader: true,
383
+ showCloseIcon: true,
383
384
  style: null,
384
385
  transitionOptions: null,
385
386
  visible: false,
@@ -511,7 +512,7 @@ this.primereact.dialog = (function (exports, React, PrimeReact, componentbase, c
511
512
  var focus = function focus() {
512
513
  var activeElement = document.activeElement;
513
514
  var isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
514
- if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
515
+ if (!isActiveElementInDialog && props.closable && props.showCloseIcon && props.showHeader && closeRef.current) {
515
516
  closeRef.current.focus();
516
517
  }
517
518
  };
@@ -817,7 +818,7 @@ this.primereact.dialog = (function (exports, React, PrimeReact, componentbase, c
817
818
  };
818
819
  });
819
820
  var createCloseIcon = function createCloseIcon() {
820
- if (props.closable) {
821
+ if (props.closable && props.showCloseIcon) {
821
822
  var labelAria = props.ariaCloseIconLabel || PrimeReact.ariaLabel('close');
822
823
  var closeButtonIconProps = mergeProps({
823
824
  className: cx('closeButtonIcon'),
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,a,i,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=d(t),g=m(t),b=d(n);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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function y(e){return y="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},y(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return v(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.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)?v(e,t):void 0}}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e){var t=D(e,"string");return"symbol"==y(t)?t:t+""}function P(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){if(Array.isArray(e))return e}function I(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}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 k(e,t){return z(e)||I(e,t)||w(e,t)||j()}var R=r.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return i.ObjectUtils.getMergedProps(e,R.defaultProps)},getOtherProps:function(e){return i.ObjectUtils.getDiffProps(e,R.defaultProps)}});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 H(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){P(e,t,n[t])})):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 _=f.default.memo(f.default.forwardRef((function(e,t){var r=f.default.useRef(null),o=f.default.useRef(null),l=f.default.useRef(null),c=f.default.useContext(n.PrimeReactContext),s=R.getProps(e,c),u={props:s};a.useStyle(R.css.styles,{name:"focustrap"});R.setMetaData(H({},u));f.default.useImperativeHandle(t,(function(){return{props:s,getInk:function(){return o.current},getTarget:function(){return r.current}}})),a.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,m,g,b,h=function(){return o.current&&o.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,a=t.autoFocus,l=void 0!==a&&a,c="".concat(v(void 0===n?"":n)),u="[autofocus]".concat(c,", [data-pc-autofocus='true']").concat(c),p=i.DomHandler.getFirstFocusableElement(e,u);l&&!p&&(p=i.DomHandler.getFirstFocusableElement(e,v(o))),i.DomHandler.focus(p)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:i.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(m=function(e,t,n){return f.default.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:t,"data-pc-section":n})})(o,(function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:i.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)}),"firstfocusableelement"),b=m(l,x,"lastfocusableelement"),o.current&&l.current&&(o.current.$_pfocustrap_lasthiddenfocusableelement=l.current,l.current.$_pfocustrap_firsthiddenfocusableelement=o.current),f.default.createElement(f.default.Fragment,null,g,s.children,b)})));function N(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 M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return i.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return i.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return i.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return i.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return i.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===b.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===b.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return M({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function B(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 F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=g.forwardRef((function(e,t){var d=a.useMergeProps(),m=g.useContext(n.PrimeReactContext),f=T.getProps(e,m),y=f.id?f.id:i.UniqueComponentId(),v=k(g.useState(y),2),D=v[0],S=k(g.useState(!1),2),P=S[0],z=S[1],I=k(g.useState(!1),2),j=I[0],R=I[1],C=k(g.useState(f.maximized),2),H=C[0],N=C[1],M=g.useRef(null),B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),A=g.useRef(null),L=g.useRef(null),Y=g.useRef(null),$=g.useRef(!1),V=g.useRef(!1),Z=g.useRef(null),J=g.useRef(null),W=g.useRef(null),G=g.useRef(y),K=g.useRef(null),q=f.onMaximize?f.maximized:H,Q=j&&(f.blockScroll||f.maximizable&&q),ee=f.closable&&f.closeOnEscape&&j,te=a.useDisplayOrder("dialog",ee),ne=T.setMetaData(F(F({props:f},f.__parentMetadata),{},{state:{id:D,maximized:q,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ae=ne.sx,ie=ne.isUnstyled;r.useHandleStyle(T.css.styles,ie,{name:"dialog"}),a.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[a.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ce=le[0],se=le[1],ue=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return je(e)}}),2),pe=ue[0],de=ue[1],me=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){f.onHide(e),e.preventDefault()},xe=function(e){U.current=e.target,f.onPointerDown&&f.onPointerDown(e)},Oe=function(e){f.dismissableMask&&f.modal&&B.current===e.target&&!U.current&&ve(e),f.onMaskClick&&f.onMaskClick(e),U.current=null},we=function(e){f.onMaximize?f.onMaximize({originalEvent:e,maximized:!q}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||f.draggable&&($.current=!0,Z.current=e.pageX,J.current=e.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onDragStart&&f.onDragStart(e))},De=function(e){if($.current){var t=i.DomHandler.getOuterWidth(M.current),n=i.DomHandler.getOuterHeight(M.current),r=e.pageX-Z.current,o=e.pageY-J.current,a=M.current.getBoundingClientRect(),l=a.left+r,c=a.top+o,s=i.DomHandler.getViewport(),u=getComputedStyle(M.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);M.current.style.position="fixed",f.keepInViewport?(l>=f.minX&&l+t<s.width&&(Z.current=e.pageX,M.current.style.left=l-p+"px"),c>=f.minY&&c+n<s.height&&(J.current=e.pageY,M.current.style.top=c-d+"px")):(Z.current=e.pageX,M.current.style.left=l-p+"px",J.current=e.pageY,M.current.style.top=c-d+"px"),f.onDrag&&f.onDrag(e)}},Se=function(e){$.current&&($.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onDragEnd&&f.onDragEnd(e))},Pe=function(e){f.resizable&&(V.current=!0,Z.current=e.pageX,J.current=e.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onResizeStart&&f.onResizeStart(e))},ze=function(e,t,n){!n&&(n=i.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},Ie=function(e){if(V.current){var t=e.pageX-Z.current,n=e.pageY-J.current,r=i.DomHandler.getOuterWidth(M.current),o=i.DomHandler.getOuterHeight(M.current),a=M.current.getBoundingClientRect(),l=i.DomHandler.getViewport(),c=!parseInt(M.current.style.top)||!parseInt(M.current.style.left),s=ze(M.current.style.minWidth,"width",l),u=ze(M.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&a.left+p<l.width&&(M.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(M.current.style.height=d+"px"),Z.current=e.pageX,J.current=e.pageY,f.onResize&&f.onResize(e)}},je=function(e){V.current&&(V.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onResizeEnd&&f.onResizeEnd(e))},ke=function(){M.current.style.position="",M.current.style.left="",M.current.style.top="",M.current.style.margin=""},Re=function(){M.current.setAttribute(G.current,"")},Ce=function(){var e;f.onShow&&f.onShow(),f.focusOnShow&&!((e=document.activeElement)&&M.current&&M.current.contains(e))&&f.closable&&f.showHeader&&Y.current&&Y.current.focus(),Ne()},He=function(){f.modal&&!ie()&&i.DomHandler.addClass(B.current,"p-component-overlay-leave")},_e=function(){$.current=!1,i.ZIndexUtils.clear(B.current),z(!1),Me(),i.DomHandler.focus(K.current),K.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&j){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(x(r=document.primeDialogParams)||O(r)||w(r)||E(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?i.DomHandler.blockBodyScroll():i.DomHandler.unblockBodyScroll()},Be=function(){f.draggable&&(fe(),he()),f.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){W.current=i.DomHandler.createInlineStyle(m&&m.nonce||b.default.nonce,m&&m.styleContainer);var e="";for(var t in f.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(G.current,"] {\n width: ").concat(f.breakpoints[t]," !important;\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){Te(!0),f.visible&&z(!0)})),g.useEffect((function(){return f.breakpoints&&Ue(),function(){W.current=i.DomHandler.removeInlineStyle(W.current)}}),[f.breakpoints]),a.useUpdateEffect((function(){f.visible&&!P&&z(!0),f.visible!==j&&P&&R(f.visible),f.visible&&(K.current=document.activeElement)}),[f.visible,P]),a.useUpdateEffect((function(){P&&(i.ZIndexUtils.set("modal",B.current,m&&m.autoZIndex||b.default.autoZIndex,f.baseZIndex||m&&m.zIndex.modal||b.default.zIndex.modal),R(!0))}),[P]),a.useUpdateEffect((function(){Te(!0)}),[Q,j]),a.useUnmountEffect((function(){Me(),Te(!1),i.DomHandler.removeInlineStyle(W.current),i.ZIndexUtils.clear(B.current)})),g.useImperativeHandle(t,(function(){return{props:f,resetPosition:ke,getElement:function(){return M.current},getMask:function(){return B.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return Y.current}}}));var Xe=function(){if(f.closable){var e=f.ariaCloseIconLabel||n.ariaLabel("close"),t=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=i.IconUtils.getJSXIcon(f.closeIcon||g.createElement(l.TimesIcon,t),F({},t),{props:f}),o=d({ref:Y,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},re("closeButton"));return g.createElement("button",o,r,g.createElement(p.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=i.IconUtils.getJSXIcon(q?f.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):f.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:f});if(f.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return g.createElement("button",n,t,g.createElement(p.Ripple,null))}return null},Le=function(){if(f.showHeader){var e=Xe(),t=Ae(),n=i.ObjectUtils.getJSXElement(f.icons,f),r=i.ObjectUtils.getJSXElement(f.header,f),o=D+"_header",a=d({ref:A,style:f.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return g.createElement("div",a,g.createElement("div",l,r),g.createElement("div",c,n,t,e))}return null},Ye=function(){var e=i.ObjectUtils.getJSXElement(f.footer,f),t=d({ref:L,className:oe("footer")},re("footer"));return e&&g.createElement("div",t,e)};return P&&function(){var t,n,r,a,l,c,s=D+"_header",p=D+"_content",b={enter:"center"===f.position?150:300,exit:"center"===f.position?150:300},y=d({ref:B,style:ae("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:M,id:D,className:i.classNames(f.className,oe("root",{props:f,maximized:q,context:m})),style:f.style,onClick:f.onClick,role:"dialog","aria-labelledby":s,"aria-describedby":p,"aria-modal":f.modal,onPointerDown:xe},T.getOtherProps(f),re("root")),x=d({classNames:oe("transition"),timeout:b,in:j,options:f.transitionOptions,unmountOnExit:!0,onEnter:Re,onEntered:Ce,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:f.header,content:f.message,message:null==f||null===(l=f.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=i.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:Y,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:f.contentStyle,className:oe("content")},re("content")),r=g.createElement("div",t,f.children),a=Ye(),O=g.createElement(g.Fragment,null,n,r,a,f.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=g.createElement("div",y,g.createElement(o.CSSTransition,h({nodeRef:M},x),g.createElement("div",v,g.createElement(_,{autoFocus:f.focusOnShow},O))));return g.createElement(u.Portal,{element:w,appendTo:f.appendTo,visible:!0})}()}));return U.displayName="Dialog",e.Dialog=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.utils,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
1
+ this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,a,i,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=d(t),g=m(t),b=d(n);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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function y(e){return y="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},y(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return v(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.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)?v(e,t):void 0}}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(e,t){if("object"!=y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e){var t=D(e,"string");return"symbol"==y(t)?t:t+""}function P(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],c=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}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 k(e,t){return I(e)||z(e,t)||w(e,t)||j()}var C=r.ComponentBase.extend({defaultProps:{__TYPE:"FocusTrap",children:void 0},css:{styles:""},getProps:function(e){return i.ObjectUtils.getMergedProps(e,C.defaultProps)},getOtherProps:function(e){return i.ObjectUtils.getDiffProps(e,C.defaultProps)}});function R(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 H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=f.default.memo(f.default.forwardRef((function(e,t){var r=f.default.useRef(null),o=f.default.useRef(null),l=f.default.useRef(null),c=f.default.useContext(n.PrimeReactContext),s=C.getProps(e,c),u={props:s};a.useStyle(C.css.styles,{name:"focustrap"});C.setMetaData(H({},u));f.default.useImperativeHandle(t,(function(){return{props:s,getInk:function(){return o.current},getTarget:function(){return r.current}}})),a.useMountEffect((function(){s.disabled||(r.current=h(),y(r.current))}));var p,d,m,g,b,h=function(){return o.current&&o.current.parentElement},y=function(e){var t=s||{},n=t.autoFocusSelector,r=t.firstFocusableSelector,o=void 0===r?"":r,a=t.autoFocus,l=void 0!==a&&a,c="".concat(v(void 0===n?"":n)),u="[autofocus]".concat(c,", [data-pc-autofocus='true']").concat(c),p=i.DomHandler.getFirstFocusableElement(e,u);l&&!p&&(p=i.DomHandler.getFirstFocusableElement(e,v(o))),i.DomHandler.focus(p)},v=function(e){return':not(.p-hidden-focusable):not([data-p-hidden-focusable="true"])'.concat(null!=e?e:"")},x=function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_firsthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_firsthiddenfocusableelement:i.DomHandler.getLastFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)};return d=void 0===(p=(s||{}).tabIndex)?0:p,g=(m=function(e,t,n){return f.default.createElement("span",{ref:e,className:"p-hidden-accessible p-hidden-focusable",tabIndex:d,role:"presentation","aria-hidden":!0,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0,onFocus:t,"data-pc-section":n})})(o,(function(e){var t,n=e.currentTarget,o=e.relatedTarget,a=o!==n.$_pfocustrap_lasthiddenfocusableelement&&null!==(t=r.current)&&void 0!==t&&t.contains(o)?n.$_pfocustrap_lasthiddenfocusableelement:i.DomHandler.getFirstFocusableElement(n.parentElement,v(n.$_pfocustrap_focusableselector));i.DomHandler.focus(a)}),"firstfocusableelement"),b=m(l,x,"lastfocusableelement"),o.current&&l.current&&(o.current.$_pfocustrap_lasthiddenfocusableelement=l.current,l.current.$_pfocustrap_firsthiddenfocusableelement=o.current),f.default.createElement(f.default.Fragment,null,g,s.children,b)})));function N(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 M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,content:null,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,footerClassName:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,showCloseIcon:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return i.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return i.classNames("p-dialog-content",e.props.contentClassName)},footer:function(e){return i.classNames("p-dialog-footer",e.props.footerClassName)},mask:function(e){var t=e.props,n=e.maskVisibleState,r=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return i.classNames("p-dialog-mask",r?"p-dialog-".concat(r):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.maximized,n=e.context;return i.classNames("p-dialog p-component",{"p-dialog-rtl":e.props.rtl,"p-dialog-maximized":t,"p-dialog-default":!t,"p-input-filled":n&&"filled"===n.inputStyle||"filled"===b.default.inputStyle,"p-ripple-disabled":n&&!1===n.ripple||!1===b.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n\n .p-dialog-visible {\n display: flex;\n }\n\n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n\n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n\n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .p-dialog-footer {\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n\n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n\n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n\n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n\n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n\n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-dialog-enter-done {\n transform: none;\n }\n\n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n\n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n\n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n\n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n\n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n\n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n\n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n\n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n }\n\n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n\n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n\n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n\n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n }\n}\n",inlineStyles:{mask:function(e){var t=e.props;return M({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function B(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 F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=g.forwardRef((function(e,t){var d=a.useMergeProps(),m=g.useContext(n.PrimeReactContext),f=T.getProps(e,m),y=f.id?f.id:i.UniqueComponentId(),v=k(g.useState(y),2),D=v[0],S=k(g.useState(!1),2),P=S[0],I=S[1],z=k(g.useState(!1),2),j=z[0],C=z[1],R=k(g.useState(f.maximized),2),H=R[0],N=R[1],M=g.useRef(null),B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),A=g.useRef(null),L=g.useRef(null),Y=g.useRef(null),$=g.useRef(!1),V=g.useRef(!1),Z=g.useRef(null),J=g.useRef(null),W=g.useRef(null),G=g.useRef(y),K=g.useRef(null),q=f.onMaximize?f.maximized:H,Q=j&&(f.blockScroll||f.maximizable&&q),ee=f.closable&&f.closeOnEscape&&j,te=a.useDisplayOrder("dialog",ee),ne=T.setMetaData(F(F({props:f},f.__parentMetadata),{},{state:{id:D,maximized:q,containerVisible:P}})),re=ne.ptm,oe=ne.cx,ae=ne.sx,ie=ne.isUnstyled;r.useHandleStyle(T.css.styles,ie,{name:"dialog"}),a.useGlobalOnEscapeKey({callback:function(e){ve(e)},when:ee&&te,priority:[a.ESC_KEY_HANDLING_PRIORITIES.DIALOG,te]});var le=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ze(e)}}),2),ce=le[0],se=le[1],ue=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return je(e)}}),2),pe=ue[0],de=ue[1],me=k(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),fe=me[0],ge=me[1],be=k(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),he=be[0],ye=be[1],ve=function(e){f.onHide(e),e.preventDefault()},xe=function(e){U.current=e.target,f.onPointerDown&&f.onPointerDown(e)},Oe=function(e){f.dismissableMask&&f.modal&&B.current===e.target&&!U.current&&ve(e),f.onMaskClick&&f.onMaskClick(e),U.current=null},we=function(e){f.onMaximize?f.onMaximize({originalEvent:e,maximized:!q}):N((function(e){return!e})),e.preventDefault()},Ee=function(e){i.DomHandler.hasClass(e.target,"p-dialog-header-icon")||i.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||f.draggable&&($.current=!0,Z.current=e.pageX,J.current=e.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onDragStart&&f.onDragStart(e))},De=function(e){if($.current){var t=i.DomHandler.getOuterWidth(M.current),n=i.DomHandler.getOuterHeight(M.current),r=e.pageX-Z.current,o=e.pageY-J.current,a=M.current.getBoundingClientRect(),l=a.left+r,c=a.top+o,s=i.DomHandler.getViewport(),u=getComputedStyle(M.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);M.current.style.position="fixed",f.keepInViewport?(l>=f.minX&&l+t<s.width&&(Z.current=e.pageX,M.current.style.left=l-p+"px"),c>=f.minY&&c+n<s.height&&(J.current=e.pageY,M.current.style.top=c-d+"px")):(Z.current=e.pageX,M.current.style.left=l-p+"px",J.current=e.pageY,M.current.style.top=c-d+"px"),f.onDrag&&f.onDrag(e)}},Se=function(e){$.current&&($.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onDragEnd&&f.onDragEnd(e))},Pe=function(e){f.resizable&&(V.current=!0,Z.current=e.pageX,J.current=e.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),f.onResizeStart&&f.onResizeStart(e))},Ie=function(e,t,n){!n&&(n=i.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},ze=function(e){if(V.current){var t=e.pageX-Z.current,n=e.pageY-J.current,r=i.DomHandler.getOuterWidth(M.current),o=i.DomHandler.getOuterHeight(M.current),a=M.current.getBoundingClientRect(),l=i.DomHandler.getViewport(),c=!parseInt(M.current.style.top)||!parseInt(M.current.style.left),s=Ie(M.current.style.minWidth,"width",l),u=Ie(M.current.style.minHeight,"height",l),p=r+t,d=o+n;c&&(p+=t,d+=n),(!s||p>s)&&a.left+p<l.width&&(M.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(M.current.style.height=d+"px"),Z.current=e.pageX,J.current=e.pageY,f.onResize&&f.onResize(e)}},je=function(e){V.current&&(V.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),f.onResizeEnd&&f.onResizeEnd(e))},ke=function(){M.current.style.position="",M.current.style.left="",M.current.style.top="",M.current.style.margin=""},Ce=function(){M.current.setAttribute(G.current,"")},Re=function(){var e;f.onShow&&f.onShow(),f.focusOnShow&&!((e=document.activeElement)&&M.current&&M.current.contains(e))&&f.closable&&f.showCloseIcon&&f.showHeader&&Y.current&&Y.current.focus(),Ne()},He=function(){f.modal&&!ie()&&i.DomHandler.addClass(B.current,"p-component-overlay-leave")},_e=function(){$.current=!1,i.ZIndexUtils.clear(B.current),I(!1),Me(),i.DomHandler.focus(K.current),K.current=null},Ne=function(){Be()},Me=function(){Fe()},Te=function(e){if(e&&j){var t={id:D,hasBlockScroll:Q};document.primeDialogParams||(document.primeDialogParams=[]);var n=document.primeDialogParams.findIndex((function(e){return e.id===D}));document.primeDialogParams=-1===n?[].concat(x(r=document.primeDialogParams)||O(r)||w(r)||E(),[t]):document.primeDialogParams.toSpliced(n,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==D}));var r;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?i.DomHandler.blockBodyScroll():i.DomHandler.unblockBodyScroll()},Be=function(){f.draggable&&(fe(),he()),f.resizable&&(ce(),pe())},Fe=function(){ge(),ye(),se(),de()},Ue=function(){W.current=i.DomHandler.createInlineStyle(m&&m.nonce||b.default.nonce,m&&m.styleContainer);var e="";for(var t in f.breakpoints)e+="\n @media screen and (max-width: ".concat(t,') {\n [data-pc-name="dialog"][').concat(G.current,"] {\n width: ").concat(f.breakpoints[t]," !important;\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){Te(!0),f.visible&&I(!0)})),g.useEffect((function(){return f.breakpoints&&Ue(),function(){W.current=i.DomHandler.removeInlineStyle(W.current)}}),[f.breakpoints]),a.useUpdateEffect((function(){f.visible&&!P&&I(!0),f.visible!==j&&P&&C(f.visible),f.visible&&(K.current=document.activeElement)}),[f.visible,P]),a.useUpdateEffect((function(){P&&(i.ZIndexUtils.set("modal",B.current,m&&m.autoZIndex||b.default.autoZIndex,f.baseZIndex||m&&m.zIndex.modal||b.default.zIndex.modal),C(!0))}),[P]),a.useUpdateEffect((function(){Te(!0)}),[Q,j]),a.useUnmountEffect((function(){Me(),Te(!1),i.DomHandler.removeInlineStyle(W.current),i.ZIndexUtils.clear(B.current)})),g.useImperativeHandle(t,(function(){return{props:f,resetPosition:ke,getElement:function(){return M.current},getMask:function(){return B.current},getContent:function(){return X.current},getHeader:function(){return A.current},getFooter:function(){return L.current},getCloseButton:function(){return Y.current}}}));var Xe=function(){if(f.closable&&f.showCloseIcon){var e=f.ariaCloseIconLabel||n.ariaLabel("close"),t=d({className:oe("closeButtonIcon"),"aria-hidden":!0},re("closeButtonIcon")),r=i.IconUtils.getJSXIcon(f.closeIcon||g.createElement(l.TimesIcon,t),F({},t),{props:f}),o=d({ref:Y,type:"button",className:oe("closeButton"),"aria-label":e,onClick:ve,onKeyDown:function(e){"Escape"!==e.key&&e.stopPropagation()}},re("closeButton"));return g.createElement("button",o,r,g.createElement(p.Ripple,null))}return null},Ae=function(){var e=d({className:oe("maximizableIcon")},re("maximizableIcon")),t=i.IconUtils.getJSXIcon(q?f.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):f.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:f});if(f.maximizable){var n=d({type:"button",className:oe("maximizableButton"),onClick:we},re("maximizableButton"));return g.createElement("button",n,t,g.createElement(p.Ripple,null))}return null},Le=function(){if(f.showHeader){var e=Xe(),t=Ae(),n=i.ObjectUtils.getJSXElement(f.icons,f),r=i.ObjectUtils.getJSXElement(f.header,f),o=D+"_header",a=d({ref:A,style:f.headerStyle,className:oe("header"),onMouseDown:Ee},re("header")),l=d({id:o,className:oe("headerTitle")},re("headerTitle")),c=d({className:oe("headerIcons")},re("headerIcons"));return g.createElement("div",a,g.createElement("div",l,r),g.createElement("div",c,n,t,e))}return null},Ye=function(){var e=i.ObjectUtils.getJSXElement(f.footer,f),t=d({ref:L,className:oe("footer")},re("footer"));return e&&g.createElement("div",t,e)};return P&&function(){var t,n,r,a,l,c,s=D+"_header",p=D+"_content",b={enter:"center"===f.position?150:300,exit:"center"===f.position?150:300},y=d({ref:B,style:ae("mask"),className:oe("mask"),onPointerUp:Oe},re("mask")),v=d({ref:M,id:D,className:i.classNames(f.className,oe("root",{props:f,maximized:q,context:m})),style:f.style,onClick:f.onClick,role:"dialog","aria-labelledby":s,"aria-describedby":p,"aria-modal":f.modal,onPointerDown:xe},T.getOtherProps(f),re("root")),x=d({classNames:oe("transition"),timeout:b,in:j,options:f.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:_e},re("transition")),O=null;null!=e&&e.content?(c={header:f.header,content:f.message,message:null==f||null===(l=f.children)||void 0===l||null===(l=l[1])||void 0===l||null===(l=l.props)||void 0===l?void 0:l.children},O=i.ObjectUtils.getJSXElement(e.content,{headerRef:A,contentRef:X,footerRef:L,closeRef:Y,hide:ve,message:c})):(n=Le(),t=d({id:D+"_content",ref:X,style:f.contentStyle,className:oe("content")},re("content")),r=g.createElement("div",t,f.children),a=Ye(),O=g.createElement(g.Fragment,null,n,r,a,f.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null));var w=g.createElement("div",y,g.createElement(o.CSSTransition,h({nodeRef:M},x),g.createElement("div",v,g.createElement(_,{autoFocus:f.focusOnShow},O))));return g.createElement(u.Portal,{element:w,appendTo:f.appendTo,visible:!0})}()}));return U.displayName="Dialog",e.Dialog=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.utils,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
@@ -287,6 +287,7 @@ var DropdownBase = componentbase.ComponentBase.extend({
287
287
  name: null,
288
288
  onBlur: null,
289
289
  onChange: null,
290
+ onClick: null,
290
291
  onContextMenu: null,
291
292
  onFilter: null,
292
293
  onFocus: null,
@@ -1158,15 +1159,24 @@ var Dropdown = /*#__PURE__*/React__namespace.memo(/*#__PURE__*/React__namespace.
1158
1159
  !pressedInInputText && onEnterKey(event);
1159
1160
  };
1160
1161
  var onEnterKey = function onEnterKey(event) {
1162
+ event.preventDefault();
1161
1163
  if (!overlayVisibleState) {
1162
1164
  setFocusedOptionIndex(-1);
1163
1165
  onArrowDownKey(event);
1164
1166
  } else {
1165
- if (focusedOptionIndex !== -1) {
1166
- onOptionSelect(event, visibleOptions[focusedOptionIndex]);
1167
+ if (focusedOptionIndex === -1) {
1168
+ return;
1167
1169
  }
1170
+ var focusedOption = visibleOptions[focusedOptionIndex];
1171
+ var optionValue = getOptionValue(focusedOption);
1172
+ if (optionValue == null || optionValue == undefined) {
1173
+ hide();
1174
+ resetFilter();
1175
+ updateEditableLabel(selectedOption);
1176
+ return;
1177
+ }
1178
+ onOptionSelect(event, focusedOption);
1168
1179
  }
1169
- event.preventDefault();
1170
1180
  };
1171
1181
  var onEscapeKey = function onEscapeKey(event) {
1172
1182
  overlayVisibleState && hide();