2 lines
136 KiB
JavaScript
2 lines
136 KiB
JavaScript
import e,{Component as t}from"react";import{Paginator as o}from"primereact/paginator";import{classNames as n,ObjectUtils as r,DomHandler as i,ZIndexUtils as s,ConnectedOverlayScrollHandler as l,UniqueComponentId as a}from"primereact/utils";import p,{localeOption as u,FilterMatchMode as c,FilterOperator as h,FilterService as d}from"primereact/api";import{OverlayService as f}from"primereact/overlayservice";import{Ripple as g}from"primereact/ripple";import{CSSTransition as m}from"primereact/csstransition";import{Portal as v}from"primereact/portal";import{InputText as y}from"primereact/inputtext";import{Dropdown as b}from"primereact/dropdown";import{Button as w}from"primereact/button";import{VirtualScroller as C}from"primereact/virtualscroller";function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},S.apply(this,arguments)}function k(e){if(Array.isArray(e))return e}function R(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,r,i=[],s=!0,l=!1;try{for(o=o.call(e);!(s=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){l=!0,r=e}finally{try{s||null==o.return||o.return()}finally{if(l)throw r}}return i}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function x(e,t){if(e){if("string"==typeof e)return E(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?E(e,t):void 0}}function D(){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 M(e){if(Array.isArray(e))return E(e)}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(){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 I(e){return M(e)||O(e)||x(e)||P()}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t,o){return t&&z(e.prototype,t),o&&z(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function L(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N(e,t){return N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},N(e,t)}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}function B(e){return B="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},B(e)}function H(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return L(e)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function K(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function G(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(o=i[n])>=0||(r[o]=e[o]);return r}function U(e,t){if(null==e)return{};var o,n,r=G(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t.indexOf(o=i[n])>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function V(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var W=function(o){j(l,t);var r,i,s=(r=l,i=V(),function(){var e,t=A(r);if(i){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function l(e){var t;return F(this,l),(t=s.call(this,e)).state={focused:!1},t.onClick=t.onClick.bind(L(t)),t.onFocus=t.onFocus.bind(L(t)),t.onBlur=t.onBlur.bind(L(t)),t.onChange=t.onChange.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t}return T(l,[{key:"onClick",value:function(e){this.props.disabled||(this.props.onChange(e),this.input.focus())}},{key:"onFocus",value:function(){this.setState({focused:!0})}},{key:"onBlur",value:function(){this.setState({focused:!1})}},{key:"onChange",value:function(e){this.onClick(e)}},{key:"onKeyDown",value:function(e){"Space"===e.code&&(this.onClick(e),e.preventDefault())}},{key:"render",value:function(){var t=this,o=n("p-radiobutton p-component",{"p-radiobutton-focused":this.state.focused}),r=n("p-radiobutton-box p-component",{"p-highlight":this.props.checked,"p-focus":this.state.focused,"p-disabled":this.props.disabled}),i="".concat(this.props.tableSelector,"_dt_radio");return e.createElement("div",{className:o},e.createElement("div",{className:"p-hidden-accessible"},e.createElement("input",{name:i,ref:function(e){return t.input=e},type:"radio",checked:this.props.checked,onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown})),e.createElement("div",{className:r,onClick:this.onClick,role:"radio","aria-checked":this.props.checked},e.createElement("div",{className:"p-radiobutton-icon"})))}}]),l}();function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var X=function(o){j(l,t);var r,i,s=(r=l,i=_(),function(){var e,t=A(r);if(i){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function l(e){var t;return F(this,l),(t=s.call(this,e)).state={focused:!1},t.onClick=t.onClick.bind(L(t)),t.onFocus=t.onFocus.bind(L(t)),t.onBlur=t.onBlur.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t}return T(l,[{key:"onClick",value:function(e){this.props.disabled||(this.setState({focused:!0}),this.props.onChange(e))}},{key:"onFocus",value:function(){this.setState({focused:!0})}},{key:"onBlur",value:function(){this.setState({focused:!1})}},{key:"onKeyDown",value:function(e){"Space"===e.code&&(this.onClick(e),e.preventDefault())}},{key:"render",value:function(){var t=n("p-checkbox p-component",{"p-checkbox-focused":this.state.focused}),o=n("p-checkbox-box p-component",{"p-highlight":this.props.checked,"p-disabled":this.props.disabled,"p-focus":this.state.focused}),r=n("p-checkbox-icon",{"pi pi-check":this.props.checked});return e.createElement("div",{className:t,onClick:this.onClick},e.createElement("div",{className:o,role:"checkbox","aria-checked":this.props.checked,tabIndex:this.props.disabled?null:"0",onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},e.createElement("span",{className:r})))}}]),l}();function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function J(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?q(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function Y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var Z=function(o){j(p,t);var s,l,a=(s=p,l=Y(),function(){var e,t=A(s);if(l){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function p(e){var t;return F(this,p),(t=a.call(this,e)).state={editing:e.editing,editingRowData:e.rowData,styleObject:{}},t.onClick=t.onClick.bind(L(t)),t.onMouseDown=t.onMouseDown.bind(L(t)),t.onMouseUp=t.onMouseUp.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t.onBlur=t.onBlur.bind(L(t)),t.onEditorFocus=t.onEditorFocus.bind(L(t)),t.onRowToggle=t.onRowToggle.bind(L(t)),t.onRadioChange=t.onRadioChange.bind(L(t)),t.onCheckboxChange=t.onCheckboxChange.bind(L(t)),t.onRowEditSave=t.onRowEditSave.bind(L(t)),t.onRowEditCancel=t.onRowEditCancel.bind(L(t)),t.onRowEditInit=t.onRowEditInit.bind(L(t)),t.editorCallback=t.editorCallback.bind(L(t)),t}return T(p,[{key:"field",get:function(){return this.getColumnProp("field")||"field_".concat(this.props.index)}},{key:"isEditable",value:function(){return this.getColumnProp("editor")}},{key:"isSelected",value:function(){return!!this.props.selection&&(this.props.selection instanceof Array?this.findIndex(this.props.selection)>-1:this.equals(this.props.selection))}},{key:"equalsData",value:function(e){return"equals"===this.props.compareSelectionBy?e===this.props.rowData:r.equals(e,this.props.rowData,this.props.dataKey)}},{key:"equals",value:function(e){return(e.rowIndex===this.props.rowIndex||this.equalsData(e.rowData))&&(e.field===this.field||e.cellIndex===this.props.index)}},{key:"isOutsideClicked",value:function(e){return this.el&&!(this.el.isSameNode(e)||this.el.contains(e))}},{key:"getColumnProp",value:function(e){return this.props.column?this.props.column.props[e]:null}},{key:"getVirtualScrollerOption",value:function(e){return this.props.virtualScrollerOptions?this.props.virtualScrollerOptions[e]:null}},{key:"getStyle",value:function(){var e=this.getColumnProp("bodyStyle"),t=this.getColumnProp("style");return this.getColumnProp("frozen")?Object.assign({},t,e,this.state.styleObject):Object.assign({},t,e)}},{key:"getCellParams",value:function(){return{value:this.resolveFieldData(),field:this.field,rowData:this.props.rowData,rowIndex:this.props.rowIndex,cellIndex:this.props.index,selected:this.isSelected(),column:this.props.column,props:this.props}}},{key:"getCellCallbackParams",value:function(e){return J({originalEvent:e},this.getCellParams())}},{key:"resolveFieldData",value:function(e){return r.resolveFieldData(e||this.props.rowData,this.field)}},{key:"getEditingRowData",value:function(){return this.props.editingMeta&&this.props.editingMeta[this.props.rowIndex]?this.props.editingMeta[this.props.rowIndex].data:this.props.rowData}},{key:"getTabIndex",value:function(e){return this.props.allowCellSelection?e?0:0===this.props.rowIndex&&0===this.props.index?this.props.tabIndex:-1:null}},{key:"findIndex",value:function(e){var t=this;return(e||[]).findIndex((function(e){return t.equals(e)}))}},{key:"closeCell",value:function(e){var t=this,o=this.getCellCallbackParams(e),n=this.getColumnProp("onBeforeCellEditHide");n&&n(o),setTimeout((function(){t.setState({editing:!1},(function(){t.unbindDocumentEditListener(),f.off("overlay-click",t.overlayEventListener),t.overlayEventListener=null}))}),1)}},{key:"switchCellToViewMode",value:function(e,t){var o=this.getCellCallbackParams(e),n=this.state.editingRowData,r=this.resolveFieldData(n),i=J(J({},o),{},{newRowData:n,newValue:r}),s=this.getColumnProp("onCellEditCancel"),l=this.getColumnProp("cellEditValidator"),a=this.getColumnProp("onCellEditComplete");!t&&s&&s(i);var p=!0;l&&(p=l(i)),p?(t&&a&&a(i),this.closeCell(e)):e.preventDefault()}},{key:"findNextSelectableCell",value:function(e){var t=e.nextElementSibling;return t?i.hasClass(t,"p-selectable-cell")?t:this.findNextSelectableCell(t):null}},{key:"findPrevSelectableCell",value:function(e){var t=e.previousElementSibling;return t?i.hasClass(t,"p-selectable-cell")?t:this.findPrevSelectableCell(t):null}},{key:"findDownSelectableCell",value:function(e){var t=e.parentElement.nextElementSibling,o=t?t.children[this.props.index]:null;return t&&o?i.hasClass(t,"p-selectable-row")&&i.hasClass(o,"p-selectable-cell")?o:this.findDownSelectableCell(o):null}},{key:"findUpSelectableCell",value:function(e){var t=e.parentElement.previousElementSibling,o=t?t.children[this.props.index]:null;return t&&o?i.hasClass(t,"p-selectable-row")&&i.hasClass(o,"p-selectable-cell")?o:this.findUpSelectableCell(o):null}},{key:"changeTabIndex",value:function(e,t){e&&t&&(e.tabIndex=-1,t.tabIndex=this.props.tabIndex)}},{key:"focusOnElement",value:function(){var e=this;clearTimeout(this.tabindexTimeout),this.tabindexTimeout=setTimeout((function(){if(e.state.editing){var t="cell"===e.props.editMode?i.getFirstFocusableElement(e.el,":not(.p-cell-editor-key-helper)"):i.findSingle(e.el,".p-row-editor-save");t&&t.focus()}e.keyHelper&&(e.keyHelper.tabIndex=e.state.editing?-1:0)}),1)}},{key:"focusOnInit",value:function(){var e=this;clearTimeout(this.initFocusTimeout),this.initFocusTimeout=setTimeout((function(){var t="row"===e.props.editMode?i.findSingle(e.el,".p-row-editor-init"):null;t&&t.focus()}),1)}},{key:"updateStickyPosition",value:function(){if(this.getColumnProp("frozen")){var e=J({},this.state.styleObject);if("right"===this.getColumnProp("alignFrozen")){var t=0,o=this.el.nextElementSibling;o&&(t=i.getOuterWidth(o)+parseFloat(o.style.right||0)),e.right=t+"px"}else{var n=0,r=this.el.previousElementSibling;r&&(n=i.getOuterWidth(r)+parseFloat(r.style.left||0)),e.left=n+"px"}!(this.state.styleObject.left===e.left&&this.state.styleObject.right===e.right)&&this.setState({styleObject:e})}}},{key:"editorCallback",value:function(e){var t=J({},this.state.editingRowData);t[this.field]=e,this.setState({editingRowData:t}),this.props.editingMeta[this.props.rowIndex].data[this.field]=e}},{key:"onClick",value:function(e){var t=this,o=this.getCellCallbackParams(e);if("row"!==this.props.editMode&&this.isEditable()&&!this.state.editing&&(this.props.selectOnEdit||!this.props.selectOnEdit&&this.props.selected)){this.selfClick=!0;var n=this.getColumnProp("onBeforeCellEditShow"),r=this.getColumnProp("onCellEditInit"),i=this.getColumnProp("cellEditValidatorEvent");n&&n(o),setTimeout((function(){t.setState({editing:!0},(function(){r&&r(o),"click"===i&&(t.bindDocumentEditListener(),t.overlayEventListener=function(e){t.isOutsideClicked(e.target)||(t.selfClick=!0)},f.on("overlay-click",t.overlayEventListener))}))}),1)}this.props.allowCellSelection&&this.props.onClick&&this.props.onClick(o)}},{key:"onMouseDown",value:function(e){var t=this.getCellCallbackParams(e);this.props.onMouseDown&&this.props.onMouseDown(t)}},{key:"onMouseUp",value:function(e){var t=this.getCellCallbackParams(e);this.props.onMouseUp&&this.props.onMouseUp(t)}},{key:"onKeyDown",value:function(e){if("row"!==this.props.editMode&&(13!==e.which&&9!==e.which||this.switchCellToViewMode(e,!0),27===e.which&&this.switchCellToViewMode(e,!1)),this.props.allowCellSelection){var t=e.target,o=e.currentTarget;switch(e.which){case 37:var n=this.findPrevSelectableCell(o);n&&(this.changeTabIndex(o,n),n.focus()),e.preventDefault();break;case 39:var r=this.findNextSelectableCell(o);r&&(this.changeTabIndex(o,r),r.focus()),e.preventDefault();break;case 38:var s=this.findUpSelectableCell(o);s&&(this.changeTabIndex(o,s),s.focus()),e.preventDefault();break;case 40:var l=this.findDownSelectableCell(o);l&&(this.changeTabIndex(o,l),l.focus()),e.preventDefault();break;case 13:i.isClickable(t)||(this.onClick(e),e.preventDefault());break;case 32:i.isClickable(t)||t.readOnly||(this.onClick(e),e.preventDefault())}}}},{key:"onBlur",value:function(e){this.selfClick=!1,"row"!==this.props.editMode&&this.state.editing&&"blur"===this.getColumnProp("cellEditValidatorEvent")&&this.switchCellToViewMode(e,!0)}},{key:"onEditorFocus",value:function(e){this.onClick(e)}},{key:"onRadioChange",value:function(e){this.props.onRadioChange({originalEvent:e,data:this.props.rowData,index:this.props.rowIndex})}},{key:"onCheckboxChange",value:function(e){this.props.onCheckboxChange({originalEvent:e,data:this.props.rowData,index:this.props.rowIndex})}},{key:"onRowToggle",value:function(e){this.props.onRowToggle({originalEvent:e,data:this.props.rowData}),e.preventDefault()}},{key:"onRowEditInit",value:function(e){this.props.onRowEditInit({originalEvent:e,data:this.props.rowData,newData:this.getEditingRowData(),field:this.field,index:this.props.rowIndex})}},{key:"onRowEditSave",value:function(e){this.props.onRowEditSave({originalEvent:e,data:this.props.rowData,newData:this.getEditingRowData(),field:this.field,index:this.props.rowIndex}),this.focusOnInit()}},{key:"onRowEditCancel",value:function(e){this.props.onRowEditCancel({originalEvent:e,data:this.props.rowData,newData:this.getEditingRowData(),field:this.field,index:this.props.rowIndex}),this.focusOnInit()}},{key:"bindDocumentEditListener",value:function(){var e=this;this.documentEditListener||(this.documentEditListener=function(t){!e.selfClick&&e.isOutsideClicked(t.target)&&e.switchCellToViewMode(t,!0),e.selfClick=!1},document.addEventListener("click",this.documentEditListener,!0))}},{key:"unbindDocumentEditListener",value:function(){this.documentEditListener&&(document.removeEventListener("click",this.documentEditListener,!0),this.documentEditListener=null,this.selfClick=!1)}},{key:"componentDidMount",value:function(){this.getColumnProp("frozen")&&this.updateStickyPosition()}},{key:"componentDidUpdate",value:function(e,t){if(this.getColumnProp("frozen")&&this.updateStickyPosition(),("cell"===this.props.editMode||"row"===this.props.editMode)&&(this.focusOnElement(),e.editingMeta!==this.props.editingMeta&&this.setState({editingRowData:this.getEditingRowData()}),t.editing!==this.state.editing)){var o=J(J({},this.getCellCallbackParams()),{},{editing:this.state.editing});this.props.onEditingMetaChange(o)}}},{key:"componentWillUnmount",value:function(){this.unbindDocumentEditListener(),this.overlayEventListener&&(f.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null)}},{key:"renderLoading",value:function(){var t=this.getVirtualScrollerOption("getLoaderOptions")(this.props.rowIndex,{cellIndex:this.props.index,cellFirst:0===this.props.index,cellLast:this.props.index===this.getVirtualScrollerOption("columns").length-1,cellEven:this.props.index%2==0,cellOdd:this.props.index%2!=0,column:this.props.column,field:this.field}),o=r.getJSXElement(this.getVirtualScrollerOption("loadingTemplate"),t);return e.createElement("td",null,o)}},{key:"renderElement",value:function(){var t,o,i=this,s=this.props.allowCellSelection&&this.isSelected(),l="row"===this.props.editMode,a=this.getTabIndex(s),p=this.getColumnProp("selectionMode"),u=this.getColumnProp("rowReorder"),c=this.getColumnProp("expander"),h=this.getColumnProp("rowEditor"),d=this.getColumnProp("header"),f=this.getColumnProp("body"),m=this.getColumnProp("editor"),v=this.getColumnProp("frozen"),y=this.getColumnProp("align"),b=this.resolveFieldData(),w=r.getPropValue(this.props.cellClassName,b,{props:this.props.tableProps,rowData:this.props.rowData,column:this.props.column}),C=n(this.getColumnProp("bodyClassName"),this.getColumnProp("className"),w,K({"p-selection-column":null!==p,"p-editable-column":m,"p-cell-editing":m&&this.state.editing,"p-frozen-column":v,"p-selectable-cell":this.props.allowCellSelection&&this.props.isSelectable({data:this.getCellParams(),index:this.props.rowIndex}),"p-highlight":s},"p-align-".concat(y),!!y)),S=this.getStyle(),k="stack"===this.props.responsiveLayout&&e.createElement("span",{className:"p-column-title"},r.getJSXElement(d,{props:this.props.tableProps}));if(p)t=(!this.props.showSelectionElement||this.props.showSelectionElement(this.props.rowData,{rowIndex:this.props.rowIndex,props:this.props.tableProps}))&&e.createElement(e.Fragment,null,"single"===p&&e.createElement(W,{checked:this.props.selected,onChange:this.onRadioChange,tabIndex:this.props.tabIndex,tableSelector:this.props.tableSelector}),"multiple"===p&&e.createElement(X,{checked:this.props.selected,onChange:this.onCheckboxChange,tabIndex:this.props.tabIndex}));else if(u){t=(!this.props.showRowReorderElement||this.props.showRowReorderElement(this.props.rowData,{rowIndex:this.props.rowIndex,props:this.props.tableProps}))&&e.createElement("i",{className:n("p-datatable-reorderablerow-handle",this.getColumnProp("rowReorderIcon"))})}else if(c){var R=n("p-row-toggler-icon",this.props.expanded?this.props.expandedRowIcon:this.props.collapsedRowIcon),E="".concat(this.props.tableSelector,"_content_").concat(this.props.rowIndex,"_expanded"),x={onClick:this.onRowToggle,className:"p-row-toggler p-link",iconClassName:R};t=e.createElement("button",{className:x.className,onClick:x.onClick,type:"button","aria-expanded":this.props.expanded,"aria-controls":E,tabIndex:this.props.tabIndex},e.createElement("span",{className:x.iconClassName}),e.createElement(g,null)),f&&(x.element=t,t=r.getJSXElement(f,this.props.rowData,{column:this.props.column,field:this.field,rowIndex:this.props.rowIndex,frozenRow:this.props.frozenRow,props:this.props.tableProps,expander:x}))}else if(l&&h){var D={};t=this.state.editing?e.createElement(e.Fragment,null,e.createElement("button",{type:"button",onClick:(D={editing:!0,onSaveClick:this.onRowEditSave,saveClassName:"p-row-editor-save p-link",saveIconClassName:"p-row-editor-save-icon pi pi-fw pi-check",onCancelClick:this.onRowEditCancel,cancelClassName:"p-row-editor-cancel p-link",cancelIconClassName:"p-row-editor-cancel-icon pi pi-fw pi-times"}).onSaveClick,className:D.saveClassName,tabIndex:this.props.tabIndex},e.createElement("span",{className:D.saveIconClassName}),e.createElement(g,null)),e.createElement("button",{type:"button",onClick:D.onCancelClick,className:D.cancelClassName,tabIndex:this.props.tabIndex},e.createElement("span",{className:D.cancelIconClassName}),e.createElement(g,null))):e.createElement("button",{type:"button",onClick:(D={editing:!1,onInitClick:this.onRowEditInit,initClassName:"p-row-editor-init p-link",initIconClassName:"p-row-editor-init-icon pi pi-fw pi-pencil"}).onInitClick,className:D.initClassName,tabIndex:this.props.tabIndex},e.createElement("span",{className:D.initIconClassName}),e.createElement(g,null)),f&&(D.element=t,t=r.getJSXElement(f,this.props.rowData,{column:this.props.column,field:this.field,rowIndex:this.props.rowIndex,frozenRow:this.props.frozenRow,props:this.props.tableProps,rowEditor:D}))}else t=f&&!this.state.editing?f?r.getJSXElement(f,this.props.rowData,{column:this.props.column,field:this.field,rowIndex:this.props.rowIndex,frozenRow:this.props.frozenRow,props:this.props.tableProps}):b:m&&this.state.editing?r.getJSXElement(m,{rowData:this.state.editingRowData,value:this.resolveFieldData(this.state.editingRowData),column:this.props.column,field:this.field,rowIndex:this.props.rowIndex,frozenRow:this.props.frozenRow,props:this.props.tableProps,editorCallback:this.editorCallback}):b;return!l&&m&&(o=e.createElement("a",{tabIndex:"0",ref:function(e){return i.keyHelper=e},className:"p-cell-editor-key-helper p-hidden-accessible",onFocus:this.onEditorFocus},e.createElement("span",null))),e.createElement("td",{ref:function(e){return i.el=e},style:S,className:C,rowSpan:this.props.rowSpan,tabIndex:a,role:"cell",onClick:this.onClick,onKeyDown:this.onKeyDown,onBlur:this.onBlur,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},o,k,t)}},{key:"render",value:function(){return this.getVirtualScrollerOption("loading")?this.renderLoading():this.renderElement()}}],[{key:"getDerivedStateFromProps",value:function(e,t){return"row"===e.editMode&&e.editing!==t.editing?{editing:e.editing}:null}}]),p}();function $(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function Q(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?$(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):$(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function ee(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var te=function(o){j(p,t);var s,l,a=(s=p,l=ee(),function(){var e,t=A(s);if(l){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function p(e){var t;return F(this,p),(t=a.call(this,e)).props.onRowEditChange||(t.state={editing:!1}),t.onClick=t.onClick.bind(L(t)),t.onDoubleClick=t.onDoubleClick.bind(L(t)),t.onRightClick=t.onRightClick.bind(L(t)),t.onTouchEnd=t.onTouchEnd.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t.onMouseDown=t.onMouseDown.bind(L(t)),t.onMouseUp=t.onMouseUp.bind(L(t)),t.onDragStart=t.onDragStart.bind(L(t)),t.onDragEnd=t.onDragEnd.bind(L(t)),t.onDragOver=t.onDragOver.bind(L(t)),t.onDragLeave=t.onDragLeave.bind(L(t)),t.onDrop=t.onDrop.bind(L(t)),t.onEditInit=t.onEditInit.bind(L(t)),t.onEditSave=t.onEditSave.bind(L(t)),t.onEditCancel=t.onEditCancel.bind(L(t)),t}return T(p,[{key:"isFocusable",value:function(){return this.props.selectionMode&&"single"!==this.props.selectionModeInColumn&&"multiple"!==this.props.selectionModeInColumn}},{key:"isGrouped",value:function(e){return!(!this.props.groupRowsBy||!this.getColumnProp(e,"field"))&&(Array.isArray(this.props.groupRowsBy)?this.props.groupRowsBy.indexOf(e.props.field)>-1:this.props.groupRowsBy===e.props.field)}},{key:"equals",value:function(e,t){return"equals"===this.props.compareSelectionBy?e===t:r.equals(e,t,this.props.dataKey)}},{key:"getColumnProp",value:function(e,t){return e?e.props[t]:null}},{key:"getEditing",value:function(){return this.props.onRowEditChange?this.props.editing:this.state.editing}},{key:"getTabIndex",value:function(){return this.isFocusable()&&!this.props.allowCellSelection?0===this.props.index?this.props.tabIndex:-1:null}},{key:"findIndex",value:function(e,t){var o=this;return(e||[]).findIndex((function(e){return o.equals(t,e)}))}},{key:"changeTabIndex",value:function(e,t){e&&t&&(e.tabIndex=-1,t.tabIndex=this.props.tabIndex)}},{key:"findNextSelectableRow",value:function(e){var t=e.nextElementSibling;return t?i.hasClass(t,"p-selectable-row")?t:this.findNextSelectableRow(t):null}},{key:"findPrevSelectableRow",value:function(e){var t=e.previousElementSibling;return t?i.hasClass(t,"p-selectable-row")?t:this.findPrevSelectableRow(t):null}},{key:"shouldRenderBodyCell",value:function(e,t,o){if(this.getColumnProp(t,"hidden"))return!1;if(this.props.rowGroupMode&&"rowspan"===this.props.rowGroupMode&&this.isGrouped(t)){var n=e[o-1];if(n)return r.resolveFieldData(e[o],this.getColumnProp(t,"field"))!==r.resolveFieldData(n,this.getColumnProp(t,"field"))}return!0}},{key:"calculateRowGroupSize",value:function(e,t,o){if(this.isGrouped(t)){for(var n=r.resolveFieldData(e[o],this.getColumnProp(t,"field")),i=n,s=0;n===i;){s++;var l=e[++o];if(!l)break;i=r.resolveFieldData(l,this.getColumnProp(t,"field"))}return 1===s?null:s}return null}},{key:"onClick",value:function(e){this.props.onRowClick({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDoubleClick",value:function(e){this.props.onRowDoubleClick({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onRightClick",value:function(e){this.props.onRowRightClick({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onTouchEnd",value:function(e){this.props.onRowTouchEnd(e)}},{key:"onKeyDown",value:function(e){if(this.isFocusable()&&!this.props.allowCellSelection){var t=e.target,o=e.currentTarget;switch(e.which){case 40:var n=this.findNextSelectableRow(o);n&&(this.changeTabIndex(o,n),n.focus()),e.preventDefault();break;case 38:var r=this.findPrevSelectableRow(o);r&&(this.changeTabIndex(o,r),r.focus()),e.preventDefault();break;case 13:i.isClickable(t)||(this.onClick(e),e.preventDefault());break;case 32:i.isClickable(t)||t.readOnly||(this.onClick(e),e.preventDefault())}}}},{key:"onMouseDown",value:function(e){this.props.onRowMouseDown({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onMouseUp",value:function(e){this.props.onRowMouseUp({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDragStart",value:function(e){this.props.onRowDragStart({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDragOver",value:function(e){this.props.onRowDragOver({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDragLeave",value:function(e){this.props.onRowDragLeave({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDragEnd",value:function(e){this.props.onRowDragEnd({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onDrop",value:function(e){this.props.onRowDrop({originalEvent:e,data:this.props.rowData,index:this.props.index})}},{key:"onEditChange",value:function(e,t){if(this.props.onRowEditChange){var o,n=this.props.dataKey,i=e.originalEvent,s=e.data,l=e.index;if(n){var a=String(r.resolveFieldData(s,n));null!=(o=this.props.editingRows?Q({},this.props.editingRows):{})[a]?delete o[a]:o[a]=!0}else{var p=this.findIndex(this.props.editingRows,s);o=this.props.editingRows?I(this.props.editingRows):[],-1!==p?o=o.filter((function(e,t){return t!==p})):o.push(s)}this.props.onRowEditChange({originalEvent:i,data:o,index:l})}else this.setState({editing:t})}},{key:"onEditInit",value:function(e){var t=e.originalEvent;this.props.onRowEditInit&&this.props.onRowEditInit({originalEvent:t,data:this.props.rowData,index:this.props.index}),this.onEditChange(e,!0),t.preventDefault()}},{key:"onEditSave",value:function(e){var t=e.originalEvent,o=!this.props.rowEditValidator||this.props.rowEditValidator(this.props.rowData,{props:this.props.tableProps});this.props.onRowEditSave&&this.props.onRowEditSave({originalEvent:t,data:this.props.rowData,index:this.props.index,valid:o}),o&&(this.props.onRowEditComplete&&this.props.onRowEditComplete(e),this.onEditChange(e,!1)),t.preventDefault()}},{key:"onEditCancel",value:function(e){var t=e.originalEvent;this.props.onRowEditCancel&&this.props.onRowEditCancel({originalEvent:t,data:this.props.rowData,index:this.props.index}),this.onEditChange(e,!1),t.preventDefault()}},{key:"renderContent",value:function(){var t=this;return this.props.columns.map((function(o,n){if(t.shouldRenderBodyCell(t.props.value,o,t.props.index)){var r="".concat(t.getColumnProp(o,"columnKey")||t.getColumnProp(o,"field"),"_").concat(n),i="rowspan"===t.props.rowGroupMode?t.calculateRowGroupSize(t.props.value,o,t.props.index):null,s=t.getEditing();return e.createElement(Z,{key:r,value:t.props.value,tableProps:t.props.tableProps,tableSelector:t.props.tableSelector,column:o,rowData:t.props.rowData,rowIndex:t.props.index,index:n,rowSpan:i,dataKey:t.props.dataKey,editing:s,editingMeta:t.props.editingMeta,editMode:t.props.editMode,onRowEditInit:t.onEditInit,onRowEditSave:t.onEditSave,onRowEditCancel:t.onEditCancel,onEditingMetaChange:t.props.onEditingMetaChange,onRowToggle:t.props.onRowToggle,selection:t.props.selection,allowCellSelection:t.props.allowCellSelection,compareSelectionBy:t.props.compareSelectionBy,selectOnEdit:t.props.selectOnEdit,selected:t.props.selected,onClick:t.props.onCellClick,onMouseDown:t.props.onCellMouseDown,onMouseUp:t.props.onCellMouseUp,tabIndex:t.props.tabIndex,cellClassName:t.props.cellClassName,responsiveLayout:t.props.responsiveLayout,frozenRow:t.props.frozenRow,isSelectable:t.props.isSelectable,showSelectionElement:t.props.showSelectionElement,showRowReorderElement:t.props.showRowReorderElement,onRadioChange:t.props.onRadioChange,onCheckboxChange:t.props.onCheckboxChange,expanded:t.props.expanded,expandedRowIcon:t.props.expandedRowIcon,collapsedRowIcon:t.props.collapsedRowIcon,virtualScrollerOptions:t.props.virtualScrollerOptions})}return null}))}},{key:"render",value:function(){var t=this,o=r.getPropValue(this.props.rowClassName,this.props.rowData,{props:this.props.tableProps}),i=n(o,{"p-highlight":!this.props.allowCellSelection&&this.props.selected,"p-highlight-contextmenu":this.props.contextMenuSelected,"p-selectable-row":this.props.allowRowSelection&&this.props.isSelectable({data:this.props.rowData,index:this.props.index}),"p-row-odd":this.props.index%2!=0}),s=this.renderContent(),l=this.getTabIndex();return e.createElement("tr",{ref:function(e){return t.el=e},role:"row",tabIndex:l,className:i,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onClick:this.onClick,onDoubleClick:this.onDoubleClick,onContextMenu:this.onRightClick,onTouchEnd:this.onTouchEnd,onKeyDown:this.onKeyDown,onDragStart:this.onDragStart,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDragEnd:this.onDragEnd,onDrop:this.onDrop},s)}}]),p}();function oe(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var ne=function(o){j(l,t);var r,i,s=(r=l,i=oe(),function(){var e,t=A(r);if(i){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function l(e){var t;return F(this,l),(t=s.call(this,e)).onClick=t.onClick.bind(L(t)),t}return T(l,[{key:"onClick",value:function(e){this.props.onClick({originalEvent:e,data:this.props.rowData})}},{key:"render",value:function(){var t=n("p-row-toggler-icon",this.props.expanded?this.props.expandedRowIcon:this.props.collapsedRowIcon);return e.createElement("button",{type:"button",onClick:this.onClick,className:"p-row-toggler p-link",tabIndex:this.props.tabIndex},e.createElement("span",{className:t}),e.createElement(g,null))}}]),l}(),re=["originalEvent"];function ie(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function se(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ie(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function le(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var ae=function(o){j(p,t);var s,l,a=(s=p,l=le(),function(){var e,t=A(s);if(l){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function p(e){var t;return F(this,p),(t=a.call(this,e)).state={rowGroupHeaderStyleObject:{}},t.onRowClick=t.onRowClick.bind(L(t)),t.onRowDoubleClick=t.onRowDoubleClick.bind(L(t)),t.onRowRightClick=t.onRowRightClick.bind(L(t)),t.onRowTouchEnd=t.onRowTouchEnd.bind(L(t)),t.onRowMouseDown=t.onRowMouseDown.bind(L(t)),t.onRowMouseUp=t.onRowMouseUp.bind(L(t)),t.onRowToggle=t.onRowToggle.bind(L(t)),t.onRowDragStart=t.onRowDragStart.bind(L(t)),t.onRowDragOver=t.onRowDragOver.bind(L(t)),t.onRowDragLeave=t.onRowDragLeave.bind(L(t)),t.onRowDragEnd=t.onRowDragEnd.bind(L(t)),t.onRowDrop=t.onRowDrop.bind(L(t)),t.onRadioChange=t.onRadioChange.bind(L(t)),t.onCheckboxChange=t.onCheckboxChange.bind(L(t)),t.onDragSelectionMouseMove=t.onDragSelectionMouseMove.bind(L(t)),t.onDragSelectionMouseUp=t.onDragSelectionMouseUp.bind(L(t)),t.isSelectable=t.isSelectable.bind(L(t)),t.onCellClick=t.onCellClick.bind(L(t)),t.onCellMouseDown=t.onCellMouseDown.bind(L(t)),t.onCellMouseUp=t.onCellMouseUp.bind(L(t)),t.ref=t.ref.bind(L(t)),t}return T(p,[{key:"ref",value:function(e){this.el=e,this.props.virtualScrollerContentRef&&this.props.virtualScrollerContentRef(e)}},{key:"equals",value:function(e,t){return this.allowCellSelection()?!(e.rowIndex!==t.rowIndex&&e.rowData!==t.rowData||e.field!==t.field&&e.cellIndex!==t.cellIndex):"equals"===this.props.compareSelectionBy?e===t:r.equals(e,t,this.props.dataKey)}},{key:"isSubheaderGrouping",value:function(){return this.props.rowGroupMode&&"subheader"===this.props.rowGroupMode}},{key:"isSelectionEnabled",value:function(){return this.props.selectionMode||null!==this.props.selectionModeInColumn||this.props.columns&&this.props.columns.some((function(e){return e&&!!e.props.selectionMode}))}},{key:"isRadioSelectionMode",value:function(){return"radiobutton"===this.props.selectionMode}},{key:"isCheckboxSelectionMode",value:function(){return"checkbox"===this.props.selectionMode}},{key:"isRadioSelectionModeInColumn",value:function(){return"single"===this.props.selectionModeInColumn}},{key:"isCheckboxSelectionModeInColumn",value:function(){return"multiple"===this.props.selectionModeInColumn}},{key:"isSingleSelection",value:function(){return"single"===this.props.selectionMode&&!this.isCheckboxSelectionModeInColumn()||!this.isRadioSelectionMode()&&this.isRadioSelectionModeInColumn()}},{key:"isMultipleSelection",value:function(){return"multiple"===this.props.selectionMode&&!this.isRadioSelectionModeInColumn()||this.isCheckboxSelectionModeInColumn()}},{key:"isRadioOnlySelection",value:function(){return this.isRadioSelectionMode()&&this.isRadioSelectionModeInColumn()}},{key:"isCheckboxOnlySelection",value:function(){return this.isCheckboxSelectionMode()&&this.isCheckboxSelectionModeInColumn()}},{key:"isSelected",value:function(e){return!(!e||!this.props.selection)&&(this.props.selection instanceof Array?this.findIndex(this.props.selection,e)>-1:this.equals(e,this.props.selection))}},{key:"isContextMenuSelected",value:function(e){return!(!e||!this.props.contextMenuSelection)&&this.equals(e,this.props.contextMenuSelection)}},{key:"isSelectable",value:function(e){return!this.props.isDataSelectable||this.props.isDataSelectable(e)}},{key:"isRowExpanded",value:function(e){return!(!e||!this.props.expandedRows)&&(this.isSubheaderGrouping()&&this.props.expandableRowGroups?this.isRowGroupExpanded(e):this.props.dataKey?!!this.props.expandedRows&&void 0!==this.props.expandedRows[r.resolveFieldData(e,this.props.dataKey)]:-1!==this.findIndex(this.props.expandedRows,e))}},{key:"isRowGroupExpanded",value:function(e){var t=this;return this.props.dataKey===this.props.groupRowsBy?Object.keys(this.props.expandedRows).some((function(o){return r.equals(o,r.resolveFieldData(e,t.props.dataKey))})):this.props.expandedRows.some((function(o){return r.equals(o,e,t.props.groupRowsBy)}))}},{key:"isRowEditing",value:function(e){return!("row"!==this.props.editMode||!e||!this.props.editingRows)&&(this.props.dataKey?!!this.props.editingRows&&void 0!==this.props.editingRows[r.resolveFieldData(e,this.props.dataKey)]:-1!==this.findIndex(this.props.editingRows,e))}},{key:"allowDrag",value:function(e){return this.props.dragSelection&&this.isMultipleSelection()&&!e.originalEvent.shiftKey}},{key:"allowRowDrag",value:function(e){return!this.allowCellSelection()&&this.allowDrag(e)}},{key:"allowCellDrag",value:function(e){return this.allowCellSelection()&&this.allowDrag(e)}},{key:"allowSelection",value:function(e){return!i.isClickable(e.originalEvent.target)}},{key:"allowMetaKeySelection",value:function(e){return!this.rowTouched&&(!this.props.metaKeySelection||this.props.metaKeySelection&&(e.originalEvent.metaKey||e.originalEvent.ctrlKey))}},{key:"allowRangeSelection",value:function(e){return this.isMultipleSelection()&&e.originalEvent.shiftKey&&null!==this.anchorRowIndex}},{key:"allowRowSelection",value:function(){return(this.props.selectionMode||this.props.selectionModeInColumn)&&!this.isRadioOnlySelection()&&!this.isCheckboxOnlySelection()}},{key:"allowCellSelection",value:function(){return this.props.cellSelection&&!this.isRadioSelectionModeInColumn()&&!this.isCheckboxSelectionModeInColumn()}},{key:"getColumnsLength",value:function(){return this.props.columns?this.props.columns.length:0}},{key:"getVirtualScrollerOption",value:function(e,t){return(t=t||this.props.virtualScrollerOptions)?t[e]:null}},{key:"findIndex",value:function(e,t){var o=this;return(e||[]).findIndex((function(e){return o.equals(t,e)}))}},{key:"rowGroupHeaderStyle",value:function(){return this.props.scrollable?{top:this.state.rowGroupHeaderStyleObject.top}:null}},{key:"getRowKey",value:function(e,t){return this.props.dataKey?r.resolveFieldData(e,this.props.dataKey)+"_"+t:t}},{key:"shouldRenderRowGroupHeader",value:function(e,t,o){var n=r.resolveFieldData(t,this.props.groupRowsBy),i=e[o-1];return!i||n!==r.resolveFieldData(i,this.props.groupRowsBy)}},{key:"shouldRenderRowGroupFooter",value:function(e,t,o,n){if(this.props.expandableRowGroups&&!n)return!1;var i=r.resolveFieldData(t,this.props.groupRowsBy),s=e[o+1];return!s||i!==r.resolveFieldData(s,this.props.groupRowsBy)}},{key:"updateFrozenRowStickyPosition",value:function(){this.el.style.top=i.getOuterHeight(this.el.previousElementSibling)+"px"}},{key:"updateFrozenRowGroupHeaderStickyPosition",value:function(){var e=i.getOuterHeight(this.el.previousElementSibling)+"px";this.state.rowGroupHeaderStyleObject&&this.state.rowGroupHeaderStyleObject.top!==e&&this.setState({rowGroupHeaderStyleObject:{top:e}})}},{key:"updateVirtualScrollerPosition",value:function(){var e=i.getOuterHeight(this.el.previousElementSibling);this.el.style.top=(this.el.style.top||0)+e+"px"}},{key:"onSingleSelection",value:function(e){var t=e.originalEvent,o=e.data,n=e.toggleable,r=e.type;if(this.isSelectable({data:o,index:e.index})){var i=this.isSelected(o),s=this.props.selection;i?n&&(s=null,this.onUnselect({originalEvent:t,data:o,type:r})):(s=o,this.onSelect({originalEvent:t,data:o,type:r})),this.focusOnElement(t,!0),this.props.onSelectionChange&&s!==this.props.selection&&this.props.onSelectionChange({originalEvent:t,value:s,type:r})}}},{key:"onMultipleSelection",value:function(e){var t=this,o=e.originalEvent,n=e.data,r=e.toggleable,i=e.type;if(this.isSelectable({data:n,index:e.index})){var s=this.isSelected(n),l=this.props.selection||[];if(s)if(r){var a=this.findIndex(l,n);l=this.props.selection.filter((function(e,t){return t!==a})),this.onUnselect({originalEvent:o,data:n,type:i})}else l.length&&(this.props.selection.forEach((function(e){return t.onUnselect({originalEvent:o,data:e,type:i})})),l=[n],this.onSelect({originalEvent:o,data:n,type:i}));else l=r&&this.isMultipleSelection()?[].concat(I(l),[n]):[n],this.onSelect({originalEvent:o,data:n,type:i});this.focusOnElement(o,!0),this.props.onSelectionChange&&l!==this.props.selection&&this.props.onSelectionChange({originalEvent:o,value:l,type:i})}}},{key:"onRangeSelection",value:function(e,t){i.clearSelection(),this.rangeRowIndex=this.allowCellSelection()?e.rowIndex:e.index;var o=this.selectRange(e),n=this.isMultipleSelection()?I(new Set([].concat(I(this.props.selection||[]),I(o)))):o;this.props.onSelectionChange&&n!==this.props.selection&&this.props.onSelectionChange({originalEvent:e.originalEvent,value:n,type:t}),this.anchorRowIndex=this.rangeRowIndex,this.anchorCellIndex=e.cellIndex,this.focusOnElement(e.originalEvent,!1)}},{key:"selectRange",value:function(e){var t,o,n=this.props.lazy&&this.props.paginator;return n&&(this.anchorRowIndex+=this.anchorRowFirst,this.rangeRowIndex+=this.props.first),this.rangeRowIndex>this.anchorRowIndex?(t=this.anchorRowIndex,o=this.rangeRowIndex):this.rangeRowIndex<this.anchorRowIndex?(t=this.rangeRowIndex,o=this.anchorRowIndex):t=o=this.rangeRowIndex,n&&(t=Math.max(t-this.props.first,0),o-=this.props.first),this.allowCellSelection()?this.selectRangeOnCell(e,t,o):this.selectRangeOnRow(e,t,o)}},{key:"selectRangeOnRow",value:function(e,t,o){for(var n=this.props.value,r=[],i=t;i<=o;i++){var s=n[i];this.isSelectable({data:s,index:i})&&(r.push(s),this.onSelect({originalEvent:e.originalEvent,data:s,type:"row"}))}return r}},{key:"selectRangeOnCell",value:function(e,t,o){var n,i,s=e.cellIndex;s>this.anchorCellIndex?(n=this.anchorCellIndex,i=s):s<this.anchorCellIndex?(n=s,i=this.anchorCellIndex):n=i=s;for(var l=this.props.value,a=[],p=t;p<=o;p++)for(var u=l[p],c=this.props.columns,h=n;h<=i;h++){var d=c[h].props.field,f={value:r.resolveFieldData(u,d),field:d,rowData:u,rowIndex:p,cellIndex:h,selected:!0};this.isSelectable({data:f,index:p})&&(a.push(f),this.onSelect({originalEvent:e.originalEvent,data:f,type:"cell"}))}return a}},{key:"onSelect",value:function(e){this.allowCellSelection()?this.props.onCellSelect&&this.props.onCellSelect(se(se({originalEvent:e.originalEvent},e.data),{},{type:e.type})):this.props.onRowSelect&&this.props.onRowSelect(e)}},{key:"onUnselect",value:function(e){this.allowCellSelection()?this.props.onCellUnselect&&this.props.onCellUnselect(se(se({originalEvent:e.originalEvent},e.data),{},{type:e.type})):this.props.onRowUnselect&&this.props.onRowUnselect(e)}},{key:"enableDragSelection",value:function(e){this.props.dragSelection&&!this.dragSelectionHelper&&(this.dragSelectionHelper=document.createElement("div"),i.addClass(this.dragSelectionHelper,"p-datatable-drag-selection-helper"),this.initialDragPosition={x:e.clientX,y:e.clientY},this.dragSelectionHelper.style.top="".concat(e.pageY,"px"),this.dragSelectionHelper.style.left="".concat(e.pageX,"px"),this.bindDragSelectionEvents())}},{key:"focusOnElement",value:function(e,t){var o=e.currentTarget;if(!this.allowCellSelection()&&this.props.selectionAutoFocus)if(this.isCheckboxSelectionModeInColumn()){var n=i.findSingle(o,"td.p-selection-column .p-checkbox-box");n&&n.focus()}else if(this.isRadioSelectionModeInColumn()){var r=i.findSingle(o,'td.p-selection-column input[type="radio"]');r&&r.focus()}!t&&o&&o.focus()}},{key:"changeTabIndex",value:function(e,t){var o=e.currentTarget;if(i.hasClass(o,"cell"===t?"p-selectable-cell":"p-selectable-row")){var n=i.findSingle(this.el,"".concat("cell"===t?"tr > td":"tr",'[tabindex="').concat(this.props.tabIndex,'"]'));n&&o&&(n.tabIndex=-1,o.tabIndex=this.props.tabIndex)}}},{key:"onRowClick",value:function(e){if(!this.allowCellSelection()&&this.allowSelection(e)){if(this.props.onRowClick&&this.props.onRowClick(e),this.allowRowSelection()){if(this.allowRangeSelection(e))this.onRangeSelection(e,"row");else{var t=this.isRadioSelectionModeInColumn()||this.isCheckboxSelectionModeInColumn()||this.allowMetaKeySelection(e);this.anchorRowIndex=e.index,this.rangeRowIndex=e.index,this.anchorRowFirst=this.props.first,this.isSingleSelection()?this.onSingleSelection(se(se({},e),{},{toggleable:t,type:"row"})):this.onMultipleSelection(se(se({},e),{},{toggleable:t,type:"row"}))}this.changeTabIndex(e.originalEvent,"row")}else this.focusOnElement(e.originalEvent);this.rowTouched=!1}}},{key:"onRowDoubleClick",value:function(e){i.isClickable(e.originalEvent.target)||this.props.onRowDoubleClick&&this.props.onRowDoubleClick(e)}},{key:"onRowRightClick",value:function(e){(this.props.onContextMenu||this.props.onContextMenuSelectionChange)&&(i.clearSelection(),this.props.onContextMenuSelectionChange&&this.props.onContextMenuSelectionChange({originalEvent:e.originalEvent,value:e.data}),this.props.onContextMenu&&this.props.onContextMenu({originalEvent:e.originalEvent,data:e.data}),e.originalEvent.preventDefault())}},{key:"onRowTouchEnd",value:function(){this.rowTouched=!0}},{key:"onRowMouseDown",value:function(e){i.clearSelection();var t=e.originalEvent;t.currentTarget.draggable=!!i.hasClass(t.target,"p-datatable-reorderablerow-handle"),this.allowRowDrag(e)&&(this.enableDragSelection(t,"row"),this.anchorRowIndex=e.index,this.rangeRowIndex=e.index,this.anchorRowFirst=this.props.first)}},{key:"onRowMouseUp",value:function(e){var t=e.index===this.anchorRowIndex;this.allowRowDrag(e)&&!t&&this.onRangeSelection(e,"row")}},{key:"onRowToggle",value:function(e){var t,o=this.props.dataKey;if(this.props.groupRowsBy?o===this.props.groupRowsBy:!!o){var n=String(r.resolveFieldData(e.data,o));null!=(t=this.props.expandedRows?se({},this.props.expandedRows):{})[n]?(delete t[n],this.props.onRowCollapse&&this.props.onRowCollapse({originalEvent:e,data:e.data})):(t[n]=!0,this.props.onRowExpand&&this.props.onRowExpand({originalEvent:e,data:e.data}))}else{var i=this.findIndex(this.props.expandedRows,e.data);t=this.props.expandedRows?I(this.props.expandedRows):[],-1!==i?(t=t.filter((function(e,t){return t!==i})),this.props.onRowCollapse&&this.props.onRowCollapse({originalEvent:e,data:e.data})):(t.push(e.data),this.props.onRowExpand&&this.props.onRowExpand({originalEvent:e,data:e.data}))}this.props.onRowToggle&&this.props.onRowToggle({data:t})}},{key:"onRowDragStart",value:function(e){var t=e.originalEvent,o=e.index;this.rowDragging=!0,this.draggedRowIndex=o,t.dataTransfer.setData("text","b")}},{key:"onRowDragOver",value:function(e){var t=e.originalEvent,o=e.index;if(this.rowDragging&&this.draggedRowIndex!==o){var n=t.currentTarget,r=i.getOffset(n).top+i.getWindowScrollTop(),s=t.pageY,l=r+i.getOuterHeight(n)/2,a=n.previousElementSibling;s<l?(i.removeClass(n,"p-datatable-dragpoint-bottom"),this.droppedRowIndex=o,a?i.addClass(a,"p-datatable-dragpoint-bottom"):i.addClass(n,"p-datatable-dragpoint-top")):(a?i.removeClass(a,"p-datatable-dragpoint-bottom"):i.addClass(n,"p-datatable-dragpoint-top"),this.droppedRowIndex=o+1,i.addClass(n,"p-datatable-dragpoint-bottom"))}t.preventDefault()}},{key:"onRowDragLeave",value:function(e){var t=e.originalEvent.currentTarget,o=t.previousElementSibling;o&&i.removeClass(o,"p-datatable-dragpoint-bottom"),i.removeClass(t,"p-datatable-dragpoint-bottom"),i.removeClass(t,"p-datatable-dragpoint-top")}},{key:"onRowDragEnd",value:function(e){var t=e.originalEvent;this.rowDragging=!1,this.draggedRowIndex=null,this.droppedRowIndex=null,t.currentTarget.draggable=!1}},{key:"onRowDrop",value:function(e){var t=e.originalEvent;if(null!=this.droppedRowIndex){var o=this.draggedRowIndex>this.droppedRowIndex?this.droppedRowIndex:0===this.droppedRowIndex?0:this.droppedRowIndex-1,n=I(this.props.value);r.reorderArray(n,this.draggedRowIndex,o),this.props.onRowReorder&&this.props.onRowReorder({originalEvent:t,value:n,dragIndex:this.draggedRowIndex,dropIndex:this.droppedRowIndex})}this.onRowDragLeave(e),this.onRowDragEnd(e),t.preventDefault()}},{key:"onRadioChange",value:function(e){this.onSingleSelection(se(se({},e),{},{toggleable:!0,type:"radio"}))}},{key:"onCheckboxChange",value:function(e){this.onMultipleSelection(se(se({},e),{},{toggleable:!0,type:"checkbox"}))}},{key:"onDragSelectionMouseMove",value:function(e){var t=this.initialDragPosition,o=e.clientX-t.x,n=e.clientY-t.y;n<0&&(this.dragSelectionHelper.style.top="".concat(e.pageY+5,"px")),o<0&&(this.dragSelectionHelper.style.left="".concat(e.pageX+5,"px")),this.dragSelectionHelper.style.height="".concat(Math.abs(n),"px"),this.dragSelectionHelper.style.width="".concat(Math.abs(o),"px"),e.preventDefault()}},{key:"onDragSelectionMouseUp",value:function(){this.dragSelectionHelper&&(this.dragSelectionHelper.remove(),this.dragSelectionHelper=null),document.removeEventListener("mousemove",this.onDragSelectionMouseMove),document.removeEventListener("mouseup",this.onDragSelectionMouseUp)}},{key:"onCellClick",value:function(e){if(this.allowSelection(e)){if(this.props.onCellClick&&this.props.onCellClick(e),this.allowCellSelection()){if(this.allowRangeSelection(e))this.onRangeSelection(e,"cell");else{var t=this.allowMetaKeySelection(e),o=e.originalEvent,n=U(e,re);this.anchorRowIndex=e.rowIndex,this.rangeRowIndex=e.rowIndex,this.anchorRowFirst=this.props.first,this.anchorCellIndex=e.cellIndex,this.isSingleSelection()?this.onSingleSelection({originalEvent:o,data:n,index:e.rowIndex,toggleable:t,type:"cell"}):this.onMultipleSelection({originalEvent:o,data:n,index:e.rowIndex,toggleable:t,type:"cell"})}this.changeTabIndex(e.originalEvent,"cell")}this.rowTouched=!1}}},{key:"onCellMouseDown",value:function(e){this.allowCellDrag(e)&&(this.enableDragSelection(e.originalEvent),this.anchorRowIndex=e.rowIndex,this.rangeRowIndex=e.rowIndex,this.anchorRowFirst=this.props.first,this.anchorCellIndex=e.cellIndex)}},{key:"onCellMouseUp",value:function(e){var t=e.rowIndex===this.anchorRowIndex&&e.cellIndex===this.anchorCellIndex;this.allowCellDrag(e)&&!t&&this.onRangeSelection(e,"cell")}},{key:"bindDragSelectionEvents",value:function(){document.addEventListener("mousemove",this.onDragSelectionMouseMove),document.addEventListener("mouseup",this.onDragSelectionMouseUp),document.body.appendChild(this.dragSelectionHelper)}},{key:"unbindDragSelectionEvents",value:function(){this.onDragSelectionMouseUp()}},{key:"componentDidMount",value:function(){this.props.frozenRow&&this.updateFrozenRowStickyPosition(),this.props.scrollable&&"subheader"===this.props.rowGroupMode&&this.updateFrozenRowGroupHeaderStickyPosition(),!this.props.isVirtualScrollerDisabled&&this.getVirtualScrollerOption("vertical")&&this.updateVirtualScrollerPosition()}},{key:"componentDidUpdate",value:function(e,t){this.props.frozenRow&&this.updateFrozenRowStickyPosition(),this.props.scrollable&&"subheader"===this.props.rowGroupMode&&this.updateFrozenRowGroupHeaderStickyPosition(),!this.props.isVirtualScrollerDisabled&&this.getVirtualScrollerOption("vertical")&&this.getVirtualScrollerOption("itemSize",e.virtualScrollerOptions)!==this.getVirtualScrollerOption("itemSize")&&this.updateVirtualScrollerPosition()}},{key:"componentWillUnmount",value:function(){this.props.dragSelection&&this.unbindDragSelectionEvents()}},{key:"renderEmptyContent",value:function(){if(!this.props.loading){var t=this.getColumnsLength(),o=r.getJSXElement(this.props.emptyMessage,{props:this.props,frozen:this.props.frozenRow})||u("emptyMessage");return e.createElement("tr",{className:"p-datatable-emptymessage",role:"row"},e.createElement("td",{colSpan:t,role:"cell"},o))}return null}},{key:"renderGroupHeader",value:function(t,o,n,i,s){if(i&&this.shouldRenderRowGroupHeader(this.props.value,t,o-this.props.first)){var l=this.rowGroupHeaderStyle(),a=this.props.expandableRowGroups&&e.createElement(ne,{onClick:this.onRowToggle,rowData:t,expanded:n,expandedRowIcon:this.props.expandedRowIcon,collapsedRowIcon:this.props.collapsedRowIcon}),p=r.getJSXElement(this.props.rowGroupHeaderTemplate,t,{index:o,props:this.props.tableProps});return e.createElement("tr",{className:"p-rowgroup-header",style:l,role:"row"},e.createElement("td",{colSpan:s},a,e.createElement("span",{className:"p-rowgroup-header-name"},p)))}return null}},{key:"renderRow",value:function(t,o,n){if(!this.props.expandableRowGroups||n){var r=!!this.isSelectionEnabled()&&this.isSelected(t),i=this.isContextMenuSelected(t),s=this.allowRowSelection(),l=this.allowCellSelection(),a=this.isRowEditing(t);return e.createElement(te,{tableProps:this.props.tableProps,tableSelector:this.props.tableSelector,value:this.props.value,columns:this.props.columns,rowData:t,index:o,selected:r,contextMenuSelected:i,onRowClick:this.onRowClick,onRowDoubleClick:this.onRowDoubleClick,onRowRightClick:this.onRowRightClick,tabIndex:this.props.tabIndex,isSelectable:this.isSelectable,onRowTouchEnd:this.onRowTouchEnd,onRowMouseDown:this.onRowMouseDown,onRowMouseUp:this.onRowMouseUp,onRowToggle:this.onRowToggle,onRowDragStart:this.onRowDragStart,onRowDragOver:this.onRowDragOver,onRowDragLeave:this.onRowDragLeave,onRowDragEnd:this.onRowDragEnd,onRowDrop:this.onRowDrop,onRadioChange:this.onRadioChange,onCheckboxChange:this.onCheckboxChange,onCellClick:this.onCellClick,onCellMouseDown:this.onCellMouseDown,onCellMouseUp:this.onCellMouseUp,editing:a,editingRows:this.props.editingRows,editingMeta:this.props.editingMeta,editMode:this.props.editMode,onRowEditChange:this.props.onRowEditChange,onEditingMetaChange:this.props.onEditingMetaChange,groupRowsBy:this.props.groupRowsBy,compareSelectionBy:this.props.compareSelectionBy,dataKey:this.props.dataKey,rowGroupMode:this.props.rowGroupMode,onRowEditInit:this.props.onRowEditInit,rowEditValidator:this.props.rowEditValidator,onRowEditSave:this.props.onRowEditSave,onRowEditComplete:this.props.onRowEditComplete,onRowEditCancel:this.props.onRowEditCancel,selection:this.props.selection,allowRowSelection:s,allowCellSelection:l,selectOnEdit:this.props.selectOnEdit,selectionMode:this.props.selectionMode,selectionModeInColumn:this.props.selectionModeInColumn,cellClassName:this.props.cellClassName,responsiveLayout:this.props.responsiveLayout,frozenRow:this.props.frozenRow,showSelectionElement:this.props.showSelectionElement,showRowReorderElement:this.props.showRowReorderElement,expanded:n,expandedRowIcon:this.props.expandedRowIcon,collapsedRowIcon:this.props.collapsedRowIcon,rowClassName:this.props.rowClassName,virtualScrollerOptions:this.props.virtualScrollerOptions})}}},{key:"renderExpansion",value:function(t,o,n,i,s){if(n&&(!i||!this.props.expandableRowGroups)){var l=r.getJSXElement(this.props.rowExpansionTemplate,t,{index:o}),a="".concat(this.props.tableSelector,"_content_").concat(o,"_expanded");return e.createElement("tr",{id:a,className:"p-datatable-row-expansion",role:"row"},e.createElement("td",{role:"cell",colSpan:s},l))}return null}},{key:"renderGroupFooter",value:function(t,o,n,i,s){if(i&&this.shouldRenderRowGroupFooter(this.props.value,t,o-this.props.first,n)){var l=r.getJSXElement(this.props.rowGroupFooterTemplate,t,{index:o,colSpan:s,props:this.props.tableProps});return e.createElement("tr",{className:"p-rowgroup-footer",role:"row"},l)}return null}},{key:"renderContent",value:function(){var t=this;return this.props.value.map((function(o,n){var r=t.getVirtualScrollerOption("getItemOptions")?t.getVirtualScrollerOption("getItemOptions")(n).index:t.props.first+n,i=t.getRowKey(o,r),s=t.isRowExpanded(o),l=t.isSubheaderGrouping(),a=t.getColumnsLength(),p=t.renderGroupHeader(o,r,s,l,a),u=t.renderRow(o,r,s),c=t.renderExpansion(o,r,s,l,a),h=t.renderGroupFooter(o,r,s,l,a);return e.createElement(e.Fragment,{key:i},p,u,c,h)}))}},{key:"render",value:function(){var t=n("p-datatable-tbody",this.props.className),o=this.props.empty?this.renderEmptyContent():this.renderContent();return e.createElement("tbody",{ref:this.ref,className:t},o)}}]),p}();function pe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function ue(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):pe(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function ce(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var he=function(o){j(p,t);var s,l,a=(s=p,l=ce(),function(){var e,t=A(s);if(l){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function p(e){var t;return F(this,p),(t=a.call(this,e)).state={styleObject:{}},t}return T(p,[{key:"getColumnProp",value:function(e){return this.props.column.props[e]}},{key:"getStyle",value:function(){var e=this.getColumnProp("footerStyle"),t=this.getColumnProp("style");return this.getColumnProp("frozen")?Object.assign({},t,e,this.state.styleObject):Object.assign({},t,e)}},{key:"updateStickyPosition",value:function(){if(this.getColumnProp("frozen")){var e=ue({},this.state.styleObject);if("right"===this.getColumnProp("alignFrozen")){var t=0,o=this.el.nextElementSibling;o&&(t=i.getOuterWidth(o)+parseFloat(o.style.right||0)),e.right=t+"px"}else{var n=0,r=this.el.previousElementSibling;r&&(n=i.getOuterWidth(r)+parseFloat(r.style.left||0)),e.left=n+"px"}this.setState({styleObject:e})}}},{key:"componentDidMount",value:function(){this.getColumnProp("frozen")&&this.updateStickyPosition()}},{key:"componentDidUpdate",value:function(e,t){this.getColumnProp("frozen")&&this.updateStickyPosition()}},{key:"render",value:function(){var t=this,o=this.getStyle(),i=this.getColumnProp("align"),s=n(this.getColumnProp("footerClassName"),this.getColumnProp("className"),K({"p-frozen-column":this.getColumnProp("frozen")},"p-align-".concat(i),!!i)),l=this.getColumnProp("colSpan"),a=this.getColumnProp("rowSpan"),p=r.getJSXElement(this.getColumnProp("footer"),{props:this.props.tableProps});return e.createElement("td",{ref:function(e){return t.el=e},style:o,className:s,role:"cell",colSpan:l,rowSpan:a},p)}}]),p}();function de(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var fe=function(o){j(s,t);var n,r,i=(n=s,r=de(),function(){var e,t=A(n);if(r){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function s(){return F(this,s),i.apply(this,arguments)}return T(s,[{key:"hasFooter",value:function(){return!!this.props.footerColumnGroup||!!this.props.columns&&this.props.columns.some((function(e){return e&&e.props.footer}))}},{key:"renderGroupFooterCells",value:function(t){var o=e.Children.toArray(t.props.children);return this.renderFooterCells(o)}},{key:"renderFooterCells",value:function(t){var o=this;return e.Children.map(t,(function(t,n){return(!t||!t.props.hidden)&&e.createElement(he,{key:t&&(t.props.columnKey||t.props.field)||n,tableProps:o.props.tableProps,column:t})}))}},{key:"renderContent",value:function(){var t=this;return this.props.footerColumnGroup?e.Children.toArray(this.props.footerColumnGroup.props.children).map((function(o,n){return e.createElement("tr",{key:n,role:"row"},t.renderGroupFooterCells(o))})):e.createElement("tr",{role:"row"},this.renderFooterCells(this.props.columns))}},{key:"render",value:function(){if(this.hasFooter()){var t=this.renderContent();return e.createElement("tfoot",{className:"p-datatable-tfoot"},t)}return null}}]),s}();function ge(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var me=function(o){j(l,t);var r,i,s=(r=l,i=ge(),function(){var e,t=A(r);if(i){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function l(e){var t;return F(this,l),(t=s.call(this,e)).state={focused:!1},t.onFocus=t.onFocus.bind(L(t)),t.onBlur=t.onBlur.bind(L(t)),t.onClick=t.onClick.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t}return T(l,[{key:"onFocus",value:function(){this.setState({focused:!0})}},{key:"onBlur",value:function(){this.setState({focused:!1})}},{key:"onClick",value:function(e){this.props.disabled||(this.setState({focused:!0}),this.props.onChange({originalEvent:e,checked:!this.props.checked}))}},{key:"onKeyDown",value:function(e){"Space"===e.code&&(this.onClick(e),e.preventDefault())}},{key:"render",value:function(){var t=n("p-checkbox-box p-component",{"p-highlight":this.props.checked,"p-disabled":this.props.disabled,"p-focus":this.state.focused}),o=n("p-checkbox-icon",{"pi pi-check":this.props.checked});return e.createElement("div",{className:"p-checkbox p-component",onClick:this.onClick},e.createElement("div",{className:t,role:"checkbox","aria-checked":this.props.checked,tabIndex:this.props.disabled?null:0,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown},e.createElement("span",{className:o})))}}]),l}();function ve(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function ye(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ve(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function be(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var we=function(o){j(C,t);var a,d,g=(a=C,d=be(),function(){var e,t=A(a);if(d){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function C(t){var o;return F(this,C),(o=g.call(this,t)).state={overlayVisible:!1},o.overlayRef=e.createRef(),o.filterCallback=o.filterCallback.bind(L(o)),o.filterApplyCallback=o.filterApplyCallback.bind(L(o)),o.onOperatorChange=o.onOperatorChange.bind(L(o)),o.addConstraint=o.addConstraint.bind(L(o)),o.clearFilter=o.clearFilter.bind(L(o)),o.applyFilter=o.applyFilter.bind(L(o)),o.onInputChange=o.onInputChange.bind(L(o)),o.toggleMenu=o.toggleMenu.bind(L(o)),o.onOverlayEnter=o.onOverlayEnter.bind(L(o)),o.onOverlayExit=o.onOverlayExit.bind(L(o)),o.onOverlayExited=o.onOverlayExited.bind(L(o)),o.onContentKeyDown=o.onContentKeyDown.bind(L(o)),o.onContentClick=o.onContentClick.bind(L(o)),o.onContentMouseDown=o.onContentMouseDown.bind(L(o)),o}return T(C,[{key:"field",get:function(){return this.getColumnProp("filterField")||this.getColumnProp("field")}},{key:"overlay",get:function(){return this.overlayRef?this.overlayRef.current:null}},{key:"filterModel",get:function(){return this.props.filters[this.field]}},{key:"filterStoreModel",get:function(){return this.props.filtersStore[this.field]}},{key:"hasFilter",value:function(){if(this.props.filtersStore){var e=this.props.filtersStore[this.field];return e&&(e.operator?!this.isFilterBlank(e.constraints[0].value):!this.isFilterBlank(e.value))}return!1}},{key:"hasRowFilter",value:function(){return this.filterModel&&!this.isFilterBlank(this.filterModel.value)}},{key:"isFilterBlank",value:function(e){return r.isEmpty(e)}},{key:"isRowMatchModeSelected",value:function(e){return this.filterModel&&this.filterModel.matchMode===e}},{key:"showMenuButton",value:function(){return this.getColumnProp("showFilterMenu")&&("row"!==this.props.display||"boolean"!==this.getColumnProp("dataType"))}},{key:"matchModes",value:function(){return this.getColumnProp("filterMatchModeOptions")||p.filterMatchModeOptions[this.findDataType()].map((function(e){return{label:u(e),value:e}}))}},{key:"isShowMatchModes",value:function(){return"boolean"!==this.getColumnProp("dataType")&&this.getColumnProp("showFilterMatchModes")&&this.matchModes()&&this.getColumnProp("showFilterMenuOptions")}},{key:"isShowOperator",value:function(){return this.getColumnProp("showFilterOperator")&&this.filterModel&&this.filterModel.operator&&this.getColumnProp("showFilterMenuOptions")}},{key:"showRemoveIcon",value:function(){return this.fieldConstraints().length>1}},{key:"isShowAddConstraint",value:function(){return this.getColumnProp("showAddButton")&&this.filterModel&&this.filterModel.operator&&this.fieldConstraints()&&this.fieldConstraints().length<this.getColumnProp("maxConstraints")&&this.getColumnProp("showFilterMenuOptions")}},{key:"isOutsideClicked",value:function(e){return!this.isTargetClicked(e)&&this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"isTargetClicked",value:function(e){return this.icon&&(this.icon.isSameNode(e)||this.icon.contains(e))}},{key:"getColumnProp",value:function(e){return this.props.column.props[e]}},{key:"getDefaultConstraint",value:function(){if(this.props.filtersStore&&this.filterStoreModel)return this.filterStoreModel.operator?{matchMode:this.filterStoreModel.constraints[0].matchMode,operator:this.filterStoreModel.operator}:{matchMode:this.filterStoreModel.matchMode}}},{key:"findDataType",value:function(){var e=this.getColumnProp("dataType"),t=this.getColumnProp("filterMatchMode"),o=function(e){return p.filterMatchModeOptions[e].some((function(e){return e===t}))};return"custom"!==t||o(e)?t&&Object.keys(p.filterMatchModeOptions).find((function(e){return o(e)}))||e:(p.filterMatchModeOptions[e].push(c.CUSTOM),e)}},{key:"clearFilter",value:function(){var e=this.field,t=this.getColumnProp("onFilterClear"),o=this.getDefaultConstraint(),n=ye({},this.props.filters);n[e].operator?(n[e].constraints.splice(1),n[e].operator=o.operator,n[e].constraints[0]={value:null,matchMode:o.matchMode}):(n[e].value=null,n[e].matchMode=o.matchMode),t&&t(),this.props.onFilterChange(n),this.props.onFilterApply(),this.hide()}},{key:"applyFilter",value:function(){var e=this.getColumnProp("onFilterApplyClick");e&&e({field:this.field,constraints:this.filterModel}),this.props.onFilterApply(),this.hide()}},{key:"toggleMenu",value:function(){this.setState((function(e){return{overlayVisible:!e.overlayVisible}}))}},{key:"onToggleButtonKeyDown",value:function(e){switch(e.key){case"Escape":case"Tab":this.hide();break;case"ArrowDown":if(this.state.overlayVisible){var t=i.getFirstFocusableElement(this.overlay);t&&t.focus(),e.preventDefault()}else e.altKey&&(this.setState({overlayVisible:!0}),e.preventDefault())}}},{key:"onContentKeyDown",value:function(e){"Escape"===e.key&&(this.hide(),this.icon&&this.icon.focus())}},{key:"onInputChange",value:function(e,t){var o=ye({},this.props.filters),n=e.target.value;"menu"===this.props.display?o[this.field].constraints[t].value=n:o[this.field].value=n,this.props.onFilterChange(o),this.getColumnProp("showApplyButton")&&"row"!==this.props.display||this.props.onFilterApply()}},{key:"onRowMatchModeChange",value:function(e){var t=this.getColumnProp("onFilterMatchModeChange"),o=ye({},this.props.filters);o[this.field].matchMode=e,t&&t({field:this.field,matchMode:e}),this.props.onFilterChange(o),this.props.onFilterApply(),this.hide()}},{key:"onRowMatchModeKeyDown",value:function(e,t,o){var n=e.target;switch(e.key){case"ArrowDown":var r=this.findNextItem(n);r&&(n.removeAttribute("tabindex"),r.tabIndex=0,r.focus()),e.preventDefault();break;case"ArrowUp":var i=this.findPrevItem(n);i&&(n.removeAttribute("tabindex"),i.tabIndex=0,i.focus()),e.preventDefault();break;case"Enter":o?this.clearFilter():this.onRowMatchModeChange(t.value),e.preventDefault()}}},{key:"onOperatorChange",value:function(e){var t=this.getColumnProp("onFilterOperatorChange"),o=e.value,n=ye({},this.props.filters);n[this.field].operator=o,this.props.onFilterChange(n),t&&t({field:this.field,operator:o}),this.getColumnProp("showApplyButton")||this.props.onFilterApply()}},{key:"onMenuMatchModeChange",value:function(e,t){var o=this.getColumnProp("onFilterMatchModeChange"),n=ye({},this.props.filters);n[this.field].constraints[t].matchMode=e,this.props.onFilterChange(n),o&&o({field:this.field,matchMode:e,index:t}),this.getColumnProp("showApplyButton")||this.props.onFilterApply()}},{key:"addConstraint",value:function(){var e=this.getColumnProp("onFilterConstraintAdd"),t=this.getDefaultConstraint(),o=ye({},this.props.filters),n={value:null,matchMode:t.matchMode};o[this.field].constraints.push(n),e&&e({field:this.field,constraint:n}),this.props.onFilterChange(o),this.getColumnProp("showApplyButton")||this.props.onFilterApply()}},{key:"removeConstraint",value:function(e){var t=this.getColumnProp("onFilterConstraintRemove"),o=ye({},this.props.filters),n=o[this.field].constraints.splice(e,1);t&&t({field:this.field,constraint:n}),this.props.onFilterChange(o),this.getColumnProp("showApplyButton")||this.props.onFilterApply()}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?i.hasClass(t,"p-column-filter-separator")?this.findNextItem(t):t:e.parentElement.firstElementChild}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?i.hasClass(t,"p-column-filter-separator")?this.findPrevItem(t):t:e.parentElement.lastElementChild}},{key:"hide",value:function(){this.setState({overlayVisible:!1})}},{key:"onContentClick",value:function(e){this.selfClick=!0,f.emit("overlay-click",{originalEvent:e,target:this.overlay})}},{key:"onContentMouseDown",value:function(){this.selfClick=!0}},{key:"onOverlayEnter",value:function(){var e=this;s.set("overlay",this.overlay,p.autoZIndex,p.zIndex.overlay),i.alignOverlay(this.overlay,this.icon,p.appendTo,!1),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.overlayEventListener=function(t){e.isOutsideClicked(t.target)||(e.selfClick=!0)},f.on("overlay-click",this.overlayEventListener)}},{key:"onOverlayExit",value:function(){this.onOverlayHide()}},{key:"onOverlayExited",value:function(){s.clear(this.overlay)}},{key:"onOverlayHide",value:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),f.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null}},{key:"bindOutsideClickListener",value:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){!e.selfClick&&e.isOutsideClicked(t.target)&&e.hide(),e.selfClick=!1},document.addEventListener("click",this.outsideClickListener))}},{key:"unbindOutsideClickListener",value:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null,this.selfClick=!1)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new l(this.icon,(function(){e.state.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.overlayVisible&&!i.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"fieldConstraints",value:function(){return this.filterModel?this.filterModel.constraints||[this.filterModel]:[]}},{key:"operator",value:function(){return this.filterModel.operator}},{key:"operatorOptions",value:function(){return[{label:u("matchAll"),value:h.AND},{label:u("matchAny"),value:h.OR}]}},{key:"noFilterLabel",value:function(){return u("noFilter")}},{key:"removeRuleButtonLabel",value:function(){return u("removeRule")}},{key:"addRuleButtonLabel",value:function(){return u("addRule")}},{key:"clearButtonLabel",value:function(){return u("clear")}},{key:"applyButtonLabel",value:function(){return u("apply")}},{key:"filterCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=ye({},this.props.filters),n=o[this.field];"menu"===this.props.display&&n&&n.operator?o[this.field].constraints[t].value=e:o[this.field].value=e,this.props.onFilterChange(o)}},{key:"filterApplyCallback",value:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t&&this.filterCallback(t[0],t[1]),this.props.onFilterApply()}},{key:"componentDidUpdate",value:function(e,t){"menu"===this.props.display&&this.state.overlayVisible&&i.alignOverlay(this.overlay,this.icon,p.appendTo,!1)}},{key:"componentWillUnmount",value:function(){this.overlayEventListener&&(f.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),this.overlay&&(s.clear(this.overlay),this.onOverlayHide())}},{key:"renderFilterElement",value:function(t,o){var n=this,i=t?t.value:null;return this.getColumnProp("filterElement")?r.getJSXElement(this.getColumnProp("filterElement"),{field:this.field,index:o,filterModel:t,value:i,filterApplyCallback:this.filterApplyCallback,filterCallback:this.filterCallback}):e.createElement(y,{type:this.getColumnProp("filterType"),value:i||"",onChange:function(e){return n.onInputChange(e,o)},className:"p-column-filter",placeholder:this.getColumnProp("filterPlaceholder"),maxLength:this.getColumnProp("filterMaxLength")})}},{key:"renderRowFilterElement",value:function(){if("row"===this.props.display){var t=this.renderFilterElement(this.filterModel,0);return e.createElement("div",{className:"p-fluid p-column-filter-element"},t)}return null}},{key:"renderMenuFilterElement",value:function(e,t){return"menu"===this.props.display?this.renderFilterElement(e,t):null}},{key:"renderMenuButton",value:function(){var t=this;if(this.showMenuButton()){var o=n("p-column-filter-menu-button p-link",{"p-column-filter-menu-button-open":this.state.overlayVisible,"p-column-filter-menu-button-active":this.hasFilter()});return e.createElement("button",{ref:function(e){return t.icon=e},type:"button",className:o,"aria-haspopup":!0,"aria-expanded":this.state.overlayVisible,onClick:this.toggleMenu,onKeyDown:this.onToggleButtonKeyDown},e.createElement("span",{className:"pi pi-filter-icon pi-filter"}))}return null}},{key:"renderClearButton",value:function(){if(this.getColumnProp("showClearButton")&&"row"===this.props.display){var t=n("p-column-filter-clear-button p-link",{"p-hidden-space":!this.hasRowFilter()});return e.createElement("button",{className:t,type:"button",onClick:this.clearFilter},e.createElement("span",{className:"pi pi-filter-slash"}))}return null}},{key:"renderRowItems",value:function(){var t=this;if(this.isShowMatchModes()){var o=this.matchModes(),r=this.noFilterLabel();return e.createElement("ul",{className:"p-column-filter-row-items"},o.map((function(o,r){var i=o.value,s=o.label,l=n("p-column-filter-row-item",{"p-highlight":t.isRowMatchModeSelected(i)});return e.createElement("li",{className:l,key:s,onClick:function(){return t.onRowMatchModeChange(i)},onKeyDown:function(e){return t.onRowMatchModeKeyDown(e,o)},tabIndex:0===r?0:null},s)})),e.createElement("li",{className:"p-column-filter-separator"}),e.createElement("li",{className:"p-column-filter-row-item",onClick:this.clearFilter,onKeyDown:function(e){return t.onRowMatchModeKeyDown(e,null,!0)}},r))}return null}},{key:"renderOperator",value:function(){if(this.isShowOperator()){var t=this.operatorOptions(),o=this.operator();return e.createElement("div",{className:"p-column-filter-operator"},e.createElement(b,{options:t,value:o,onChange:this.onOperatorChange,className:"p-column-filter-operator-dropdown"}))}return null}},{key:"renderMatchModeDropdown",value:function(t,o){var n=this;if(this.isShowMatchModes()){var r=this.matchModes();return e.createElement(b,{options:r,value:t.matchMode,onChange:function(e){return n.onMenuMatchModeChange(e.value,o)},className:"p-column-filter-matchmode-dropdown"})}return null}},{key:"renderRemoveButton",value:function(t){var o=this;if(this.showRemoveIcon()){var n=this.removeRuleButtonLabel();return e.createElement(w,{type:"button",icon:"pi pi-trash",className:"p-column-filter-remove-button p-button-text p-button-danger p-button-sm",onClick:function(){return o.removeConstraint(t)},label:n})}return null}},{key:"renderConstraints",value:function(){var t=this,o=this.fieldConstraints();return e.createElement("div",{className:"p-column-filter-constraints"},o.map((function(o,n){var r=t.renderMatchModeDropdown(o,n),i=t.renderMenuFilterElement(o,n),s=t.renderRemoveButton(n);return e.createElement("div",{key:n,className:"p-column-filter-constraint"},r,i,e.createElement("div",null,s))})))}},{key:"renderAddRule",value:function(){if(this.isShowAddConstraint()){var t=this.addRuleButtonLabel();return e.createElement("div",{className:"p-column-filter-add-rule"},e.createElement(w,{type:"button",label:t,icon:"pi pi-plus",className:"p-column-filter-add-button p-button-text p-button-sm",onClick:this.addConstraint}))}return null}},{key:"renderFilterClearButton",value:function(){if(this.getColumnProp("showClearButton")){if(!this.getColumnProp("filterClear")){var t=this.clearButtonLabel();return e.createElement(w,{type:"button",className:"p-button-outlined p-button-sm",onClick:this.clearFilter,label:t})}return r.getJSXElement(this.getColumnProp("filterClear"),{field:this.field,filterModel:this.filterModel,filterClearCallback:this.clearFilter})}return null}},{key:"renderFilterApplyButton",value:function(){if(this.getColumnProp("showApplyButton")){if(!this.getColumnProp("filterApply")){var t=this.applyButtonLabel();return e.createElement(w,{type:"button",className:"p-button-sm",onClick:this.applyFilter,label:t})}return r.getJSXElement(this.getColumnProp("filterApply"),{field:this.field,filterModel:this.filterModel,filterApplyCallback:this.applyFilter})}return null}},{key:"renderButtonBar",value:function(){var t=this.renderFilterClearButton(),o=this.renderFilterApplyButton();return e.createElement("div",{className:"p-column-filter-buttonbar"},t,o)}},{key:"renderItems",value:function(){var t=this.renderOperator(),o=this.renderConstraints(),n=this.renderAddRule(),r=this.renderButtonBar();return e.createElement(e.Fragment,null,t,o,n,r)}},{key:"renderOverlay",value:function(){var t=this.getColumnProp("filterMenuStyle"),o=n("p-column-filter-overlay p-component p-fluid",this.getColumnProp("filterMenuClassName"),{"p-column-filter-overlay-menu":"menu"===this.props.display,"p-input-filled":"filled"===p.inputStyle,"p-ripple-disabled":!1===p.ripple}),i=r.getJSXElement(this.getColumnProp("filterHeader"),{field:this.field,filterModel:this.filterModel,filterApplyCallback:this.filterApplyCallback}),s=r.getJSXElement(this.getColumnProp("filterFooter"),{field:this.field,filterModel:this.filterModel,filterApplyCallback:this.filterApplyCallback}),l="row"===this.props.display?this.renderRowItems():this.renderItems();return e.createElement(v,null,e.createElement(m,{nodeRef:this.overlayRef,classNames:"p-connected-overlay",in:this.state.overlayVisible,timeout:{enter:120,exit:100},unmountOnExit:!0,onEnter:this.onOverlayEnter,onExit:this.onOverlayExit,onExited:this.onOverlayExited},e.createElement("div",{ref:this.overlayRef,style:t,className:o,onKeyDown:this.onContentKeyDown,onClick:this.onContentClick,onMouseDown:this.onContentMouseDown},i,l,s)))}},{key:"render",value:function(){var t=n("p-column-filter p-fluid",{"p-column-filter-row":"row"===this.props.display,"p-column-filter-menu":"menu"===this.props.display}),o=this.renderRowFilterElement(),r=this.renderMenuButton(),i=this.renderClearButton(),s=this.renderOverlay();return e.createElement("div",{className:t},o,r,i,s)}}]),C}();function Ce(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function Se(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ce(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function ke(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var Re=function(o){j(p,t);var s,l,a=(s=p,l=ke(),function(){var e,t=A(s);if(l){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function p(e){var t;return F(this,p),(t=a.call(this,e)).state={styleObject:{}},t.onClick=t.onClick.bind(L(t)),t.onMouseDown=t.onMouseDown.bind(L(t)),t.onKeyDown=t.onKeyDown.bind(L(t)),t.onDragStart=t.onDragStart.bind(L(t)),t.onDragOver=t.onDragOver.bind(L(t)),t.onDragLeave=t.onDragLeave.bind(L(t)),t.onDrop=t.onDrop.bind(L(t)),t.onResizerMouseDown=t.onResizerMouseDown.bind(L(t)),t.onResizerClick=t.onResizerClick.bind(L(t)),t.onResizerDoubleClick=t.onResizerDoubleClick.bind(L(t)),t}return T(p,[{key:"isBadgeVisible",value:function(){return this.props.multiSortMeta&&this.props.multiSortMeta.length>1}},{key:"isSortableDisabled",value:function(){return!this.getColumnProp("sortable")||this.getColumnProp("sortable")&&(this.props.allSortableDisabled||this.getColumnProp("sortableDisabled"))}},{key:"getColumnProp",value:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.props.column?"string"==typeof t[0]?this.props.column.props[t[0]]:(t[0]||this.props.column).props[t[1]]:null}},{key:"getStyle",value:function(){var e=this.getColumnProp("headerStyle"),t=this.getColumnProp("style");return this.getColumnProp("frozen")?Object.assign({},t,e,this.state.styleObject):Object.assign({},t,e)}},{key:"getMultiSortMetaIndex",value:function(){var e=this;return this.props.multiSortMeta.findIndex((function(t){return t.field===e.getColumnProp("field")||t.field===e.getColumnProp("sortField")}))}},{key:"getSortMeta",value:function(){var e=!1,t=0,o=-1;return"single"===this.props.sortMode?t=(e=this.props.sortField&&(this.props.sortField===this.getColumnProp("field")||this.props.sortField===this.getColumnProp("sortField")))?this.props.sortOrder:0:"multiple"===this.props.sortMode&&(o=this.getMultiSortMetaIndex())>-1&&(e=!0,t=this.props.multiSortMeta[o].order),{sorted:e,sortOrder:t,metaIndex:o}}},{key:"getAriaSort",value:function(e){var t=e.sorted,o=e.sortOrder;if(this.getColumnProp("sortable")){var n=t?o<0?"pi-sort-amount-down":"pi-sort-amount-up-alt":"pi-sort-alt";return"pi-sort-amount-down"===n?"descending":"pi-sort-amount-up-alt"===n?"ascending":"none"}return null}},{key:"updateStickyPosition",value:function(){if(this.getColumnProp("frozen")){var e=Se({},this.state.styleObject);if("right"===this.getColumnProp("alignFrozen")){var t=0,o=this.el.nextElementSibling;o&&(t=i.getOuterWidth(o)+parseFloat(o.style.right||0)),e.right=t+"px"}else{var n=0,r=this.el.previousElementSibling;r&&(n=i.getOuterWidth(r)+parseFloat(r.style.left||0)),e.left=n+"px"}var s=this.el.parentElement.nextElementSibling;if(s){var l=i.index(this.el);s.children[l].style.left=e.left,s.children[l].style.right=e.right}!(this.state.styleObject.left===e.left&&this.state.styleObject.right===e.right)&&this.setState({styleObject:e})}}},{key:"updateSortableDisabled",value:function(e){this.getColumnProp(e,"sortableDisabled")===this.getColumnProp("sortableDisabled")&&this.getColumnProp(e,"sortable")===this.getColumnProp("sortable")||this.props.onSortableChange()}},{key:"onClick",value:function(e){if(!this.isSortableDisabled()){var t=e.target;(i.hasClass(t,"p-sortable-column")||i.hasClass(t,"p-column-title")||i.hasClass(t,"p-column-header-content")||i.hasClass(t,"p-sortable-column-icon")||i.hasClass(t.parentElement,"p-sortable-column-icon"))&&(i.clearSelection(),this.props.onSortChange({originalEvent:e,column:this.props.column,sortableDisabledFields:this.props.sortableDisabledFields}))}}},{key:"onMouseDown",value:function(e){this.props.onColumnMouseDown({originalEvent:e,column:this.props.column})}},{key:"onKeyDown",value:function(e){"Enter"===e.key&&e.currentTarget===this.el&&i.hasClass(e.currentTarget,"p-sortable-column")&&(this.onClick(e),e.preventDefault())}},{key:"onDragStart",value:function(e){this.props.onColumnDragStart({originalEvent:e,column:this.props.column})}},{key:"onDragOver",value:function(e){this.props.onColumnDragOver({originalEvent:e,column:this.props.column})}},{key:"onDragLeave",value:function(e){this.props.onColumnDragLeave({originalEvent:e,column:this.props.column})}},{key:"onDrop",value:function(e){this.props.onColumnDrop({originalEvent:e,column:this.props.column})}},{key:"onResizerMouseDown",value:function(e){this.props.onColumnResizeStart({originalEvent:e,column:this.props.column})}},{key:"onResizerClick",value:function(e){this.props.onColumnResizerClick&&(this.props.onColumnResizerClick({originalEvent:e,element:e.currentTarget.parentElement,column:this.props.column}),e.preventDefault())}},{key:"onResizerDoubleClick",value:function(e){this.props.onColumnResizerDoubleClick&&(this.props.onColumnResizerDoubleClick({originalEvent:e,element:e.currentTarget.parentElement,column:this.props.column}),e.preventDefault())}},{key:"componentDidMount",value:function(){this.getColumnProp("frozen")&&this.updateStickyPosition()}},{key:"componentDidUpdate",value:function(e){this.getColumnProp("frozen")&&this.updateStickyPosition(),this.updateSortableDisabled(e.column)}},{key:"renderResizer",value:function(){return this.props.resizableColumns&&!this.getColumnProp("frozen")?e.createElement("span",{className:"p-column-resizer",onMouseDown:this.onResizerMouseDown,onClick:this.onResizerClick,onDoubleClick:this.onResizerDoubleClick}):null}},{key:"renderTitle",value:function(){var t=r.getJSXElement(this.getColumnProp("header"),{props:this.props.tableProps});return e.createElement("span",{className:"p-column-title"},t)}},{key:"renderSortIcon",value:function(t){var o=t.sorted,r=t.sortOrder;if(this.getColumnProp("sortable")){var i=n("p-sortable-column-icon pi pi-fw",o?r<0?"pi-sort-amount-down":"pi-sort-amount-up-alt":"pi-sort-alt");return e.createElement("span",{className:i})}return null}},{key:"renderBadge",value:function(t){var o=t.metaIndex;return-1!==o&&this.isBadgeVisible()?e.createElement("span",{className:"p-sortable-column-badge"},this.props.groupRowsBy&&this.props.groupRowsBy===this.props.groupRowSortField?o:o+1):null}},{key:"renderCheckbox",value:function(){if(this.props.showSelectAll&&"multiple"===this.getColumnProp("selectionMode")&&"row"!==this.props.filterDisplay){var t=this.props.allRowsSelected(this.props.value);return e.createElement(me,{checked:t,onChange:this.props.onColumnCheckboxChange,disabled:this.props.empty})}return null}},{key:"renderFilter",value:function(){return"menu"===this.props.filterDisplay&&this.getColumnProp("filter")?e.createElement(we,{display:"menu",column:this.props.column,filters:this.props.filters,onFilterChange:this.props.onFilterChange,onFilterApply:this.props.onFilterApply,filtersStore:this.props.filtersStore}):null}},{key:"renderHeader",value:function(t){var o=this.renderTitle(),n=this.renderSortIcon(t),r=this.renderBadge(t),i=this.renderCheckbox(),s=this.renderFilter();return e.createElement("div",{className:"p-column-header-content"},o,n,r,i,s)}},{key:"renderElement",value:function(){var t=this,o=this.isSortableDisabled(),r=this.getSortMeta(),i=this.getStyle(),s=this.getColumnProp("alignHeader")||this.getColumnProp("align"),l=n(this.getColumnProp("headerClassName"),this.getColumnProp("className"),K({"p-sortable-column":this.getColumnProp("sortable"),"p-resizable-column":this.props.resizableColumns,"p-highlight":r.sorted,"p-frozen-column":this.getColumnProp("frozen"),"p-selection-column":this.getColumnProp("selectionMode"),"p-sortable-disabled":this.getColumnProp("sortable")&&o,"p-reorderable-column":this.props.reorderableColumns&&this.getColumnProp("reorderable")},"p-align-".concat(s),!!s)),a=this.getColumnProp("sortable")&&!o?this.props.tabIndex:null,p=this.getColumnProp("colSpan"),u=this.getColumnProp("rowSpan"),c=this.getAriaSort(r),h=this.renderResizer(),d=this.renderHeader(r);return e.createElement("th",{ref:function(e){return t.el=e},style:i,className:l,tabIndex:a,role:"columnheader",onClick:this.onClick,onKeyDown:this.onKeyDown,onMouseDown:this.onMouseDown,onDragStart:this.onDragStart,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop,colSpan:p,rowSpan:u,"aria-sort":c},h,d)}},{key:"render",value:function(){return this.renderElement()}}]),p}();function Ee(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function xe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ee(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function De(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var Me=function(o){j(l,t);var r,i,s=(r=l,i=De(),function(){var e,t=A(r);if(i){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function l(e){var t;return F(this,l),(t=s.call(this,e)).state={sortableDisabledFields:[],allSortableDisabled:!1,styleObject:{}},t.onSortableChange=t.onSortableChange.bind(L(t)),t.onCheckboxChange=t.onCheckboxChange.bind(L(t)),t}return T(l,[{key:"isSingleSort",value:function(){return"single"===this.props.sortMode}},{key:"isMultipleSort",value:function(){return"multiple"===this.props.sortMode}},{key:"isAllSortableDisabled",value:function(){return this.isSingleSort()&&this.state.allSortableDisabled}},{key:"isColumnSorted",value:function(e){return null!==this.props.sortField&&(e.props.field===this.props.sortField||e.props.sortField===this.props.sortField)}},{key:"updateSortableDisabled",value:function(){var e=this;if(this.isSingleSort()||this.isMultipleSort()&&this.props.onSortChange){var t=[],o=!1;this.props.columns.forEach((function(n){n.props.sortableDisabled&&(t.push(n.props.sortField||n.props.field),!o&&e.isColumnSorted(n)&&(o=!0))})),this.setState({sortableDisabledFields:t,allSortableDisabled:o})}}},{key:"onSortableChange",value:function(){this.updateSortableDisabled()}},{key:"onCheckboxChange",value:function(e){this.props.onColumnCheckboxChange(e,this.props.value)}},{key:"componentDidMount",value:function(){this.updateSortableDisabled()}},{key:"renderGroupHeaderCells",value:function(t){var o=e.Children.toArray(t.props.children);return this.renderHeaderCells(o)}},{key:"renderHeaderCells",value:function(t){var o=this;return e.Children.map(t,(function(t,n){return(!t||!t.props.hidden)&&e.createElement(Re,{key:t&&(t.props.columnKey||t.props.field)||n,value:o.props.value,tableProps:o.props.tableProps,column:t,tabIndex:o.props.tabIndex,empty:o.props.empty,resizableColumns:o.props.resizableColumns,groupRowsBy:o.props.groupRowsBy,groupRowSortField:o.props.groupRowSortField,sortMode:o.props.sortMode,sortField:o.props.sortField,sortOrder:o.props.sortOrder,multiSortMeta:o.props.multiSortMeta,allSortableDisabled:o.isAllSortableDisabled(),onSortableChange:o.onSortableChange,sortableDisabledFields:o.state.sortableDisabledFields,filterDisplay:o.props.filterDisplay,filters:o.props.filters,filtersStore:o.props.filtersStore,onFilterChange:o.props.onFilterChange,onFilterApply:o.props.onFilterApply,onColumnMouseDown:o.props.onColumnMouseDown,onColumnDragStart:o.props.onColumnDragStart,onColumnDragOver:o.props.onColumnDragOver,onColumnDragLeave:o.props.onColumnDragLeave,onColumnDrop:o.props.onColumnDrop,onColumnResizeStart:o.props.onColumnResizeStart,onColumnResizerClick:o.props.onColumnResizerClick,onColumnResizerDoubleClick:o.props.onColumnResizerDoubleClick,showSelectAll:o.props.showSelectAll,allRowsSelected:o.props.allRowsSelected,onColumnCheckboxChange:o.onCheckboxChange,reorderableColumns:o.props.reorderableColumns,onSortChange:o.props.onSortChange})}))}},{key:"renderCheckbox",value:function(t){if(this.props.showSelectAll&&"multiple"===t){var o=this.props.allRowsSelected(this.props.value);return e.createElement(me,{checked:o,onChange:this.onCheckboxChange,disabled:this.props.empty})}return null}},{key:"renderFilter",value:function(t,o){return o?e.createElement(we,{display:"row",column:t,filters:this.props.filters,filtersStore:this.props.filtersStore,onFilterChange:this.props.onFilterChange,onFilterApply:this.props.onFilterApply}):null}},{key:"renderFilterCells",value:function(){var t=this;return e.Children.map(this.props.columns,(function(o,r){if(!o.props.hidden){var i=o.props,s=i.style,l=i.filterHeaderClassName,a=i.className,p=i.frozen,u=i.columnKey,c=i.field,h=i.selectionMode,d=i.filter,f=xe(xe({},i.filterHeaderStyle||{}),s||{}),g=n("p-filter-column",l,a,{"p-frozen-column":p}),m=u||c||r,v=t.renderCheckbox(h),y=t.renderFilter(o,d);return e.createElement("th",{key:m,style:f,className:g},v,y)}return null}))}},{key:"renderContent",value:function(){var t=this;if(this.props.headerColumnGroup)return e.Children.toArray(this.props.headerColumnGroup.props.children).map((function(o,n){return e.createElement("tr",{key:n,role:"row"},t.renderGroupHeaderCells(o))}));var o=e.createElement("tr",{role:"row"},this.renderHeaderCells(this.props.columns)),n="row"===this.props.filterDisplay&&e.createElement("tr",{role:"row"},this.renderFilterCells());return e.createElement(e.Fragment,null,o,n)}},{key:"render",value:function(){var t=this.renderContent();return e.createElement("thead",{className:"p-datatable-thead"},t)}}]),l}();function Oe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function Pe(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(o),!0).forEach((function(t){K(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Oe(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function Ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var Fe=function(s){j(g,t);var l,u,f=(l=g,u=Ie(),function(){var e,t=A(l);if(u){var o=A(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return H(this,e)});function g(e){var t;return F(this,g),(t=f.call(this,e)).state={d_rows:e.rows,columnOrder:[],groupRowsSortMeta:null,editingMeta:{},attributeSelector:null},t.props.onPage||(t.state.first=e.first,t.state.rows=e.rows),t.props.onSort||(t.state.sortField=e.sortField,t.state.sortOrder=e.sortOrder,t.state.multiSortMeta=e.multiSortMeta),t.state.d_filters=t.cloneFilters(e.filters),t.props.onFilter||(t.state.filters=e.filters),t.onSortChange=t.onSortChange.bind(L(t)),t.onFilterChange=t.onFilterChange.bind(L(t)),t.onFilterApply=t.onFilterApply.bind(L(t)),t.onColumnHeaderMouseDown=t.onColumnHeaderMouseDown.bind(L(t)),t.onColumnHeaderDragStart=t.onColumnHeaderDragStart.bind(L(t)),t.onColumnHeaderDragOver=t.onColumnHeaderDragOver.bind(L(t)),t.onColumnHeaderDragLeave=t.onColumnHeaderDragLeave.bind(L(t)),t.onColumnHeaderDrop=t.onColumnHeaderDrop.bind(L(t)),t.onColumnResizeStart=t.onColumnResizeStart.bind(L(t)),t.onColumnHeaderCheckboxChange=t.onColumnHeaderCheckboxChange.bind(L(t)),t.allRowsSelected=t.allRowsSelected.bind(L(t)),t.onEditingMetaChange=t.onEditingMetaChange.bind(L(t)),t.onPageChange=t.onPageChange.bind(L(t)),t}return T(g,[{key:"isCustomStateStorage",value:function(){return"custom"===this.props.stateStorage}},{key:"isStateful",value:function(){return null!=this.props.stateKey||this.isCustomStateStorage()}},{key:"isVirtualScrollerDisabled",value:function(){return r.isEmpty(this.props.virtualScrollerOptions)||!this.props.scrollable}},{key:"isEquals",value:function(e,t){return"equals"===this.props.compareSelectionBy?e===t:r.equals(e,t,this.props.dataKey)}},{key:"hasFilter",value:function(){return r.isNotEmpty(this.getFilters())||this.props.globalFilter}},{key:"getFirst",value:function(){return this.props.onPage?this.props.first:this.state.first}},{key:"getRows",value:function(){return this.props.onPage?this.props.rows:this.state.rows}},{key:"getSortField",value:function(){return this.props.onSort?this.props.sortField:this.state.sortField}},{key:"getSortOrder",value:function(){return this.props.onSort?this.props.sortOrder:this.state.sortOrder}},{key:"getMultiSortMeta",value:function(){return(this.props.onSort?this.props.multiSortMeta:this.state.multiSortMeta)||[]}},{key:"getFilters",value:function(){return this.props.onFilter?this.props.filters:this.state.filters}},{key:"getColumnProp",value:function(e,t){return e.props[t]}},{key:"getColumns",value:function(t){var o=this,n=e.Children.toArray(this.props.children);if(!n)return null;if(!t&&this.props.reorderableColumns&&this.state.columnOrder){var r=this.state.columnOrder.reduce((function(e,t){var r=o.findColumnByKey(n,t);return r&&e.push(r),e}),[]);return[].concat(I(r),I(n.filter((function(e){return r.indexOf(e)<0}))))}return n}},{key:"getStorage",value:function(){switch(this.props.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;case"custom":return null;default:throw new Error(this.props.stateStorage+' is not a valid value for the state storage, supported values are "local", "session" and "custom".')}}},{key:"saveState",value:function(){var e={};this.props.paginator&&(e.first=this.getFirst(),e.rows=this.getRows());var t=this.getSortField();t&&(e.sortField=t,e.sortOrder=this.getSortOrder());var o=this.getMultiSortMeta();if(o&&(e.multiSortMeta=o),this.hasFilter()&&(e.filters=this.getFilters()),this.props.resizableColumns&&this.saveColumnWidths(e),this.props.reorderableColumns&&(e.columnOrder=this.state.columnOrder),this.props.expandedRows&&(e.expandedRows=this.props.expandedRows),this.props.selection&&this.props.onSelectionChange&&(e.selection=this.props.selection),this.isCustomStateStorage())this.props.customSaveState&&this.props.customSaveState(e);else{var n=this.getStorage();r.isNotEmpty(e)&&n.setItem(this.props.stateKey,JSON.stringify(e))}this.props.onStateSave&&this.props.onStateSave(e)}},{key:"clearState",value:function(){var e=this.getStorage();e&&this.props.stateKey&&e.removeItem(this.props.stateKey)}},{key:"restoreState",value:function(e){var t={};if(this.isCustomStateStorage())this.props.customRestoreState&&(t=this.props.customRestoreState());else{var o=this.getStorage().getItem(this.props.stateKey),n=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;o&&(t=JSON.parse(o,(function(e,t){return"string"==typeof t&&n.test(t)?new Date(t):t})))}this._restoreState(t,e)}},{key:"restoreTableState",value:function(e){var t=this._restoreState(e);r.isNotEmpty(t)&&this.setState(t)}},{key:"_restoreState",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.isNotEmpty(e)){if(this.props.paginator)if(this.props.onPage){var n=function(e,o){var n=t.getTotalRecords(t.processedData()),r=Math.ceil(n/o)||1;return{first:e,rows:o,page:Math.floor(e/o),pageCount:r}};this.props.onPage(this.createEvent(n(e.first,e.rows)))}else o.first=e.first,o.rows=e.rows;e.sortField&&(this.props.onSort?this.props.onSort(this.createEvent({sortField:e.sortField,sortOrder:e.sortOrder})):(o.sortField=e.sortField,o.sortOrder=e.sortOrder)),e.multiSortMeta&&(this.props.onSort?this.props.onSort(this.createEvent({multiSortMeta:e.multiSortMeta})):o.multiSortMeta=e.multiSortMeta),e.filters&&(o.d_filters=this.cloneFilters(e.filters),this.props.onFilter?this.props.onFilter(this.createEvent({filters:e.filters})):o.filters=this.cloneFilters(e.filters)),this.props.resizableColumns&&(this.columnWidthsState=e.columnWidths,this.tableWidthState=e.tableWidth),this.props.reorderableColumns&&(o.columnOrder=e.columnOrder),e.expandedRows&&this.props.onRowToggle&&this.props.onRowToggle({data:e.expandedRows}),e.selection&&this.props.onSelectionChange&&this.props.onSelectionChange({value:e.selection}),this.props.onStateRestore&&this.props.onStateRestore(e)}return o}},{key:"saveColumnWidths",value:function(e){var t=[];i.find(this.el,".p-datatable-thead > tr > th").forEach((function(e){return t.push(i.getOuterWidth(e))})),e.columnWidths=t.join(","),"expand"===this.props.columnResizeMode&&(e.tableWidth=i.getOuterWidth(this.table)+"px")}},{key:"restoreColumnWidths",value:function(){var e=this;if(this.columnWidthsState){var t=this.columnWidthsState.split(",");if("expand"===this.props.columnResizeMode&&this.tableWidthState&&(this.table.style.width=this.tableWidthState,this.table.style.minWidth=this.tableWidthState,this.el.style.width=this.tableWidthState),r.isNotEmpty(t)){this.createStyleElement();var o="";t.forEach((function(t,n){var r=e.props.scrollable?"flex: 1 1 ".concat(t,"px !important"):"width: ".concat(t,"px !important");o+="\n .p-datatable[".concat(e.state.attributeSelector,"] .p-datatable-thead > tr > th:nth-child(").concat(n+1,"),\n .p-datatable[").concat(e.state.attributeSelector,"] .p-datatable-tbody > tr > td:nth-child(").concat(n+1,"),\n .p-datatable[").concat(e.state.attributeSelector,"] .p-datatable-tfoot > tr > td:nth-child(").concat(n+1,") {\n ").concat(r,"\n }\n ")})),this.styleElement.innerHTML=o}}}},{key:"findParentHeader",value:function(e){if("TH"===e.nodeName)return e;for(var t=e.parentElement;"TH"!==t.nodeName&&(t=t.parentElement););return t}},{key:"getGroupRowSortField",value:function(){return"single"===this.props.sortMode?this.props.sortField:this.state.groupRowsSortMeta?this.state.groupRowsSortMeta.field:null}},{key:"getSelectableData",value:function(e){var t=this;return this.props.showSelectionElement||this.props.isDataSelectable?e.filter((function(e,o){var n=!0;return t.props.showSelectionElement&&(n=t.props.showSelectionElement({rowIndex:o,props:t.props})),t.props.isDataSelectable&&n&&(n=t.props.isDataSelectable({data:e,index:o})),n})):e}},{key:"allRowsSelected",value:function(e){var t=this;if(this.props.onSelectAllChange)return this.props.selectAll;var o=this.props.selectionPageOnly?this.dataToRender(e):e,n=this.props.frozenValue?[].concat(I(this.props.frozenValue),I(o)):o,r=this.getSelectableData(n);return r&&this.props.selection&&r.every((function(e){return t.props.selection.some((function(o){return t.isEquals(o,e)}))}))}},{key:"getSelectionModeInColumn",value:function(e){if(e){var t=e.find((function(e){return!!e.props.selectionMode}));return t?t.props.selectionMode:null}return null}},{key:"findColumnByKey",value:function(e,t){return r.isNotEmpty(e)?e.find((function(e){return e.props.columnKey===t||e.props.field===t})):null}},{key:"getTotalRecords",value:function(e){return this.props.lazy?this.props.totalRecords:e?e.length:0}},{key:"onEditingMetaChange",value:function(e){var t=e.rowData,o=e.field,n=e.rowIndex,r=e.editing,i=Pe({},this.state.editingMeta),s=i[n];if(r)!s&&(s=i[n]={data:Pe({},t),fields:[]}),s.fields.push(o);else if(s){var l=s.fields.filter((function(e){return e!==o}));l.length?s.fields=l:delete i[n]}this.setState({editingMeta:i})}},{key:"clearEditingMetaData",value:function(){this.props.editMode&&r.isNotEmpty(this.state.editingMeta)&&this.setState({editingMeta:{}})}},{key:"onColumnResizeStart",value:function(e){var t=e.originalEvent,o=e.column,n=i.getOffset(this.el).left;this.resizeColumn=o,this.resizeColumnElement=t.currentTarget.parentElement,this.columnResizing=!0,this.lastResizeHelperX=t.pageX-n+this.el.scrollLeft,this.bindColumnResizeEvents()}},{key:"onColumnResize",value:function(e){var t=i.getOffset(this.el).left;i.addClass(this.el,"p-unselectable-text"),this.resizeHelper.style.height=this.el.offsetHeight+"px",this.resizeHelper.style.top="0px",this.resizeHelper.style.left=e.pageX-t+this.el.scrollLeft+"px",this.resizeHelper.style.display="block"}},{key:"onColumnResizeEnd",value:function(){var e=this.resizeHelper.offsetLeft-this.lastResizeHelperX,t=this.resizeColumnElement.offsetWidth,o=t+e;if(t+e>parseInt(this.resizeColumnElement.style.minWidth||15,10)){if("fit"===this.props.columnResizeMode){var n=this.resizeColumnElement.nextElementSibling.offsetWidth-e;o>15&&n>15&&this.resizeTableCells(o,n)}else if("expand"===this.props.columnResizeMode){var r=this.table.offsetWidth+e+"px";this.table.style.width=r,this.table.style.minWidth=r,this.resizeTableCells(o)}this.props.onColumnResizeEnd&&this.props.onColumnResizeEnd({element:this.resizeColumnElement,column:this.resizeColumn,delta:e}),this.isStateful()&&this.saveState()}this.resizeHelper.style.display="none",this.resizeColumn=null,this.resizeColumnElement=null,i.removeClass(this.el,"p-unselectable-text"),this.unbindColumnResizeEvents()}},{key:"resizeTableCells",value:function(e,t){var o=this,n=[],r=i.index(this.resizeColumnElement);i.find(this.table,".p-datatable-thead > tr > th").forEach((function(e){return n.push(i.getOuterWidth(e))})),this.destroyStyleElement(),this.createStyleElement();var s="";n.forEach((function(n,i){var l=i===r?e:t&&i===r+1?t:n,a=o.props.scrollable?"flex: 1 1 ".concat(l,"px !important"):"width: ".concat(l,"px !important");s+="\n .p-datatable[".concat(o.state.attributeSelector,"] .p-datatable-thead > tr > th:nth-child(").concat(i+1,"),\n .p-datatable[").concat(o.state.attributeSelector,"] .p-datatable-tbody > tr > td:nth-child(").concat(i+1,"),\n .p-datatable[").concat(o.state.attributeSelector,"] .p-datatable-tfoot > tr > td:nth-child(").concat(i+1,") {\n ").concat(a,"\n }\n ")})),this.styleElement.innerHTML=s}},{key:"bindColumnResizeEvents",value:function(){var e=this;this.documentColumnResizeListener||(this.documentColumnResizeListener=document.addEventListener("mousemove",(function(t){e.columnResizing&&e.onColumnResize(t)}))),this.documentColumnResizeEndListener||(this.documentColumnResizeEndListener=document.addEventListener("mouseup",(function(){e.columnResizing&&(e.columnResizing=!1,e.onColumnResizeEnd())})))}},{key:"unbindColumnResizeEvents",value:function(){this.documentColumnResizeListener&&(document.removeEventListener("document",this.documentColumnResizeListener),this.documentColumnResizeListener=null),this.documentColumnResizeEndListener&&(document.removeEventListener("document",this.documentColumnResizeEndListener),this.documentColumnResizeEndListener=null)}},{key:"onColumnHeaderMouseDown",value:function(e){i.clearSelection();var t=e.originalEvent;this.props.reorderableColumns&&!1!==this.getColumnProp(e.column,"reorderable")&&(t.currentTarget.draggable="INPUT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName&&!i.hasClass(t.target,"p-column-resizer"))}},{key:"onColumnHeaderCheckboxChange",value:function(e,t){var o=this;if(this.props.onSelectAllChange)this.props.onSelectAllChange(e);else{var n=e.originalEvent,r=e.checked,i=this.props.selectionPageOnly?this.dataToRender(t):t,s=this.props.selectionPageOnly&&this.props.selection?this.props.selection.filter((function(e){return!i.some((function(t){return o.isEquals(e,t)}))})):[];r?(s=this.props.frozenValue?[].concat(I(s),I(this.props.frozenValue),I(i)):[].concat(I(s),I(i)),s=this.getSelectableData(s),this.props.onAllRowsSelect&&this.props.onAllRowsSelect({originalEvent:n,data:s,type:"all"})):this.props.onAllRowsUnselect&&this.props.onAllRowsUnselect({originalEvent:n,data:s,type:"all"}),this.props.onSelectionChange&&this.props.onSelectionChange({originalEvent:n,value:s,type:"all"})}}},{key:"onColumnHeaderDragStart",value:function(e){var t=e.originalEvent,o=e.column;this.columnResizing?t.preventDefault():(this.colReorderIconWidth=i.getHiddenElementOuterWidth(this.reorderIndicatorUp),this.colReorderIconHeight=i.getHiddenElementOuterHeight(this.reorderIndicatorUp),this.draggedColumn=o,this.draggedColumnElement=this.findParentHeader(t.currentTarget),t.dataTransfer.setData("text","b"))}},{key:"onColumnHeaderDragOver",value:function(e){var t=e.originalEvent,o=this.findParentHeader(t.currentTarget);if(this.props.reorderableColumns&&this.draggedColumnElement&&o&&(t.preventDefault(),this.draggedColumnElement!==o)){var n=i.getOffset(this.el),r=i.getOffset(o),s=r.left-n.left,l=r.left+o.offsetWidth/2;this.reorderIndicatorUp.style.top=r.top-n.top-(this.colReorderIconHeight-1)+"px",this.reorderIndicatorDown.style.top=r.top-n.top+o.offsetHeight+"px",t.pageX>l?(this.reorderIndicatorUp.style.left=s+o.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.reorderIndicatorDown.style.left=s+o.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=1):(this.reorderIndicatorUp.style.left=s-Math.ceil(this.colReorderIconWidth/2)+"px",this.reorderIndicatorDown.style.left=s-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=-1),this.reorderIndicatorUp.style.display="block",this.reorderIndicatorDown.style.display="block"}}},{key:"onColumnHeaderDragLeave",value:function(e){this.props.reorderableColumns&&this.draggedColumnElement&&(e.originalEvent.preventDefault(),this.reorderIndicatorUp.style.display="none",this.reorderIndicatorDown.style.display="none")}},{key:"onColumnHeaderDrop",value:function(e){var t=this,o=e.originalEvent,n=e.column;if(o.preventDefault(),this.draggedColumnElement){var s=i.index(this.draggedColumnElement),l=i.index(this.findParentHeader(o.currentTarget)),a=s!==l;if(a&&(l-s==1&&-1===this.dropPosition||s-l==1&&1===this.dropPosition)&&(a=!1),a){var p=this.getColumns(),u=function(e,t){return r.equals(e.props,t.props,e.props.columnKey||t.props.columnKey?"columnKey":"field")},c=p.findIndex((function(e){return u(e,t.draggedColumn)})),h=p.findIndex((function(e){return u(e,n)}));h<c&&1===this.dropPosition&&h++,h>c&&-1===this.dropPosition&&h--,r.reorderArray(p,c,h);var d=p.reduce((function(e,t){return e.push(t.props.columnKey||t.props.field),e}),[]);this.setState({columnOrder:d}),this.props.onColReorder&&this.props.onColReorder({originalEvent:o,dragIndex:c,dropIndex:h,columns:p})}this.reorderIndicatorUp.style.display="none",this.reorderIndicatorDown.style.display="none",this.draggedColumnElement.draggable=!1,this.draggedColumnElement=null,this.draggedColumn=null,this.dropPosition=null}}},{key:"createStyleElement",value:function(){this.styleElement=i.createInlineStyle(p.nonce)}},{key:"createResponsiveStyle",value:function(){if(!this.responsiveStyleElement){this.responsiveStyleElement=i.createInlineStyle(p.nonce);var e="\n@media screen and (max-width: ".concat(this.props.breakpoint,") {\n .p-datatable[").concat(this.state.attributeSelector,"] .p-datatable-thead > tr > th,\n .p-datatable[").concat(this.state.attributeSelector,"] .p-datatable-tfoot > tr > td {\n display: none !important;\n }\n\n .p-datatable[").concat(this.state.attributeSelector,"] .p-datatable-tbody > tr > td {\n display: flex;\n width: 100% !important;\n align-items: center;\n justify-content: space-between;\n }\n\n .p-datatable[").concat(this.state.attributeSelector,"] .p-datatable-tbody > tr > td:not(:last-child) {\n border: 0 none;\n }\n\n .p-datatable[").concat(this.state.attributeSelector,"].p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {\n border-top: 0;\n border-right: 0;\n border-left: 0;\n }\n\n .p-datatable[").concat(this.state.attributeSelector,"] .p-datatable-tbody > tr > td > .p-column-title {\n display: block;\n }\n}\n");this.responsiveStyleElement.innerHTML=e}}},{key:"destroyResponsiveStyle",value:function(){this.responsiveStyleElement=i.removeInlineStyle(this.responsiveStyleElement)}},{key:"destroyStyleElement",value:function(){this.styleElement=i.removeInlineStyle(this.styleElement)}},{key:"onPageChange",value:function(e){this.clearEditingMetaData(),this.props.onPage?this.props.onPage(this.createEvent(e)):this.setState({first:e.first,rows:e.rows}),this.props.onValueChange&&this.props.onValueChange(this.processedData())}},{key:"onSortChange",value:function(e){this.clearEditingMetaData();var t,o,n=e.originalEvent,r=e.column,i=e.sortableDisabledFields,s=r.props.sortField||r.props.field,l=this.props.defaultSortOrder;if(this.columnSortable=r.props.sortable,this.columnSortFunction=r.props.sortFunction,this.columnField=r.props.sortField,"multiple"===this.props.sortMode){var a=n.metaKey||n.ctrlKey,p=(t=I(this.getMultiSortMeta())).find((function(e){return e.field===s}));l=p?this.getCalculatedSortOrder(p.order):l;var u={field:s,order:l};l?(t=a?t:t.filter((function(e){return i.some((function(t){return t===e.field}))})),this.addSortMeta(u,t)):this.props.removableSort&&this.removeSortMeta(u,t),o={multiSortMeta:t}}else l=this.getSortField()===s?this.getCalculatedSortOrder(this.getSortOrder()):l,this.props.removableSort&&(s=l?s:null),o={sortField:s,sortOrder:l};this.props.onSort?this.props.onSort(this.createEvent(o)):(o.first=0,this.setState(o)),this.props.onValueChange&&this.props.onValueChange(this.processedData({sortField:s,sortOrder:l,multiSortMeta:t}))}},{key:"getCalculatedSortOrder",value:function(e){return this.props.removableSort?this.props.defaultSortOrder===e?-1*e:0:-1*e}},{key:"compareValuesOnSort",value:function(e,t){return null==e&&null!=t?-1:null!=e&&null==t?1:null==e&&null==t?0:"string"==typeof e&&"string"==typeof t?e.localeCompare(t,void 0,{numeric:!0}):e<t?-1:e>t?1:0}},{key:"addSortMeta",value:function(e,t){var o=t.findIndex((function(t){return t.field===e.field}));o>=0?t[o]=e:t.push(e)}},{key:"removeSortMeta",value:function(e,t){var o=t.findIndex((function(t){return t.field===e.field}));o>=0&&t.splice(o,1),t=t.length>0?t:null}},{key:"sortSingle",value:function(e,t,o){var n=this;if(this.props.groupRowsBy&&this.props.groupRowsBy===this.props.sortField){var i=[{field:this.props.sortField,order:this.props.sortOrder||this.props.defaultSortOrder}];return this.props.sortField!==t&&i.push({field:t,order:o}),this.sortMultiple(e,i)}var s=I(e);return this.columnSortable&&this.columnSortFunction?s=this.columnSortFunction({field:t,order:o}):s.sort((function(e,i){var s=r.resolveFieldData(e,t),l=r.resolveFieldData(i,t),a=n.compareValuesOnSort(s,l);return o*a})),s}},{key:"sortMultiple",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.props.groupRowsBy&&(this.groupRowsSortMeta||o.length&&this.props.groupRowsBy===o[0].field)){var n=o[0];!this.groupRowsSortMeta&&(this.groupRowsSortMeta=n),n.field!==this.groupRowsSortMeta.field&&(o=[this.groupRowsSortMeta].concat(I(o)))}var r=I(e);if(this.columnSortable&&this.columnSortFunction){var i=o.find((function(e){return e.field===t.columnField})),s=this.columnField,l=i?i.order:this.defaultSortOrder;r=this.columnSortFunction({field:s,order:l})}else r.sort((function(e,n){return t.multisortField(e,n,o,0)}));return r}},{key:"multisortField",value:function(e,t,o,n){var i=r.resolveFieldData(e,o[n].field),s=r.resolveFieldData(t,o[n].field);if(i===s)return o.length-1>n?this.multisortField(e,t,o,n+1):0;var l=this.compareValuesOnSort(i,s);return o[n].order*l}},{key:"onFilterChange",value:function(e){this.clearEditingMetaData(),this.setState({d_filters:e})}},{key:"onFilterApply",value:function(){var e=this;clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((function(){var t=e.cloneFilters(e.state.d_filters);e.props.onFilter?e.props.onFilter(e.createEvent({filters:t})):e.setState({first:0,filters:t}),e.props.onValueChange&&e.props.onValueChange(e.processedData({filters:t}))}),this.props.filterDelay)}},{key:"filterLocal",value:function(e,t){if(e){t=t||{};var o,n=this.getColumns(),i=[],s=t.global||this.props.globalFilter;s&&(o=this.props.globalFilterFields||n.filter((function(e){return!e.props.excludeGlobalFilter})).map((function(e){return e.props.filterField||e.props.field})));for(var l=0;l<e.length;l++){var a=!0,p=!1,u=!1;for(var f in t)if(Object.prototype.hasOwnProperty.call(t,f)&&"global"!==f){u=!0;var g=f,m=t[g];if(m.operator)for(var v=0;v<m.constraints.length;v++){if(a=this.executeLocalFilter(g,e[l],m.constraints[v],v),m.operator===h.OR&&a||m.operator===h.AND&&!a)break}else a=this.executeLocalFilter(g,e[l],m,0);if(!a)break}if(s&&!p&&o)for(var y=0;y<o.length;y++){var b=t.global?t.global.value:this.props.globalFilter;if(p=d.filters[t.global?t.global.matchMode:c.CONTAINS](r.resolveFieldData(e[l],o[y]),b,this.props.filterLocale))break}(s?u?u&&a&&p:p:u&&a)&&i.push(e[l])}return i.length===this.props.value.length&&(i=e),i}}},{key:"executeLocalFilter",value:function(e,t,o,n){var i=o.value,s="custom"===o.matchMode?"custom_".concat(e):o.matchMode||c.STARTS_WITH,l=r.resolveFieldData(t,e);return(0,d.filters[s])(l,i,this.props.filterLocale,n)}},{key:"cloneFilters",value:function(e){var t=this,o={};if(e=e||this.props.filters)Object.entries(e).forEach((function(e){var t,n,r=(n=2,k(t=e)||R(t,n)||x(t,n)||D()),i=r[1];o[r[0]]=i.operator?{operator:i.operator,constraints:i.constraints.map((function(e){return Pe({},e)}))}:Pe({},i)}));else{var n=this.getColumns();o=n.reduce((function(e,o){var n=o.props.filterField||o.props.field,r=o.props.filterFunction,i=o.props.dataType,s={value:null,matchMode:o.props.filterMatchMode||(p.filterMatchModeOptions[i]?p.filterMatchModeOptions[i][0]:c.STARTS_WITH)};return r&&d.register("custom_".concat(n),(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.apply(void 0,t.concat([{column:o}]))})),e[n]="menu"===t.props.filterDisplay?{operator:h.AND,constraints:[s]}:s,e}),{})}return o}},{key:"filter",value:function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=Pe({},this.state.d_filters),i=r[t],s=i&&i.operator?i.constraints[n]:i;s=i?{value:e,matchMode:o||s.matchMode}:{value:e,matchMode:o},"menu"===this.props.filterDisplay&&i&&i.operator?r[t].constraints[n]=s:r[t]=s,this.setState({d_filters:r},this.onFilterApply)}},{key:"reset",value:function(){var e={d_rows:this.props.rows,d_filters:this.cloneFilters(this.props.filters),groupRowsSortMeta:null,editingMeta:{}};this.props.onPage||(e.first=this.props.first,e.rows=this.props.rows),this.props.onSort||(e.sortField=this.props.sortField,e.sortOrder=this.props.sortOrder,e.multiSortMeta=this.props.multiSortMeta),this.props.onFilter||(e.filters=this.props.filters),this.resetColumnOrder(),this.setState(e)}},{key:"resetColumnOrder",value:function(){var e=this.getColumns(!0),t=[];e&&(t=e.reduce((function(e,t){return e.push(t.props.columnKey||t.props.field),e}),[])),this.setState({columnOrder:t})}},{key:"exportCSV",value:function(e){var t,o=this,n="\ufeff",s=this.getColumns();t=e&&e.selectionOnly?this.props.selection||[]:[].concat(I(this.props.frozenValue||[]),I(this.processedData()||[])),s.forEach((function(e,t){var r=e.props,i=r.field;r.exportable&&i&&(n+='"'+(r.header||i)+'"',t<s.length-1&&(n+=o.props.csvSeparator))})),t.forEach((function(e){n+="\n",s.forEach((function(t,i){var l=t.props,a=l.exportField||l.field;if(l.exportable&&a){var p=r.resolveFieldData(e,a);p=null!=p?o.props.exportFunction?o.props.exportFunction({data:p,field:a,rowData:e,column:t}):String(p).replace(/"/g,'""'):"",n+='"'+p+'"',i<s.length-1&&(n+=o.props.csvSeparator)}}))})),i.exportCSV(n,this.props.exportFilename)}},{key:"closeEditingCell",value:function(){"row"!==this.props.editMode&&document.body.click()}},{key:"createEvent",value:function(e){return Pe({first:this.getFirst(),rows:this.getRows(),sortField:this.getSortField(),sortOrder:this.getSortOrder(),multiSortMeta:this.getMultiSortMeta(),filters:this.getFilters()},e)}},{key:"processedData",value:function(e){var t=this.props.value||[];if(!this.props.lazy&&t&&t.length){var o=e&&e.filters||this.getFilters(),n=e&&e.sortField||this.getSortField(),i=e&&e.sortOrder||this.getSortOrder(),s=e&&e.multiSortMeta||this.getMultiSortMeta();(r.isNotEmpty(o)||this.props.globalFilter)&&(t=this.filterLocal(t,o)),(n||r.isNotEmpty(s))&&("single"===this.props.sortMode?t=this.sortSingle(t,n,i):"multiple"===this.props.sortMode&&(t=this.sortMultiple(t,s)))}return t}},{key:"dataToRender",value:function(e){if(e&&this.props.paginator){var t=this.props.lazy?0:this.getFirst();return e.slice(t,t+this.getRows())}return e}},{key:"componentDidMount",value:function(){var e=this;this.setState({attributeSelector:a()},(function(){e.el.setAttribute(e.state.attributeSelector,"")})),"stack"!==this.props.responsiveLayout||this.props.scrollable||this.createResponsiveStyle(),this.isStateful()&&(this.setState(this.restoreState(this.state)),this.props.resizableColumns&&this.restoreColumnWidths())}},{key:"componentDidUpdate",value:function(e,t){this.isStateful()&&this.saveState(),e.responsiveLayout!==this.props.responsiveLayout&&(this.destroyResponsiveStyle(),"stack"!==this.props.responsiveLayout||this.props.scrollable||this.createResponsiveStyle()),e.filters!==this.props.filters&&this.setState({filters:this.cloneFilters(this.props.filters),d_filters:this.cloneFilters(this.props.filters)}),e.globalFilter!==this.props.globalFilter&&this.filter(this.props.globalFilter,"global","contains")}},{key:"componentWillUnmount",value:function(){this.unbindColumnResizeEvents(),this.destroyStyleElement(),this.destroyResponsiveStyle()}},{key:"renderLoader",value:function(){if(this.props.loading){var t=n("p-datatable-loading-icon pi-spin",this.props.loadingIcon);return e.createElement("div",{className:"p-datatable-loading-overlay p-component-overlay"},e.createElement("i",{className:t}))}return null}},{key:"renderHeader",value:function(){if(this.props.header){var t=r.getJSXElement(this.props.header,{props:this.props});return e.createElement("div",{className:"p-datatable-header"},t)}return null}},{key:"renderTableHeader",value:function(t,o){var n=this.getSortField(),r=this.getSortOrder(),i=I(this.getMultiSortMeta()),s=this.getGroupRowSortField(),l=this.state.d_filters,a=this.getFilters();return e.createElement(Me,{value:t.items,tableProps:this.props,columns:t.columns,tabIndex:this.props.tabIndex,empty:o,headerColumnGroup:this.props.headerColumnGroup,resizableColumns:this.props.resizableColumns,onColumnResizeStart:this.onColumnResizeStart,onColumnResizerClick:this.props.onColumnResizerClick,onColumnResizerDoubleClick:this.props.onColumnResizerDoubleClick,sortMode:this.props.sortMode,sortField:n,sortOrder:r,multiSortMeta:i,groupRowsBy:this.props.groupRowsBy,groupRowSortField:s,onSortChange:this.onSortChange,filterDisplay:this.props.filterDisplay,filters:l,filtersStore:a,onFilterChange:this.onFilterChange,onFilterApply:this.onFilterApply,showSelectAll:this.props.showSelectAll,allRowsSelected:this.allRowsSelected,onColumnCheckboxChange:this.onColumnHeaderCheckboxChange,onColumnMouseDown:this.onColumnHeaderMouseDown,onColumnDragStart:this.onColumnHeaderDragStart,onColumnDragOver:this.onColumnHeaderDragOver,onColumnDragLeave:this.onColumnHeaderDragLeave,onColumnDrop:this.onColumnHeaderDrop,rowGroupMode:this.props.rowGroupMode,reorderableColumns:this.props.reorderableColumns})}},{key:"renderTableBody",value:function(t,o,n,r){var i=this.state.attributeSelector,s=this.getFirst(),l=this.state.editingMeta,a=t.rows,p=t.columns,u=t.contentRef,c=t.className,h=this.props.frozenValue&&e.createElement(ae,{value:this.props.frozenValue,className:"p-datatable-frozen-tbody",frozenRow:!0,tableProps:this.props,tableSelector:i,columns:p,selectionModeInColumn:o,first:s,editingMeta:l,onEditingMetaChange:this.onEditingMetaChange,tabIndex:this.props.tabIndex,onRowClick:this.props.onRowClick,onRowDoubleClick:this.props.onRowDoubleClick,onCellClick:this.props.onCellClick,selection:this.props.selection,onSelectionChange:this.props.onSelectionChange,lazy:this.props.lazy,paginator:this.props.paginator,onCellSelect:this.props.onCellSelect,onCellUnselect:this.props.onCellUnselect,onRowSelect:this.props.onRowSelect,onRowUnselect:this.props.onRowUnselect,dragSelection:this.props.dragSelection,onContextMenu:this.props.onContextMenu,onContextMenuSelectionChange:this.props.onContextMenuSelectionChange,metaKeySelection:this.props.metaKeySelection,selectionMode:this.props.selectionMode,cellSelection:this.props.cellSelection,contextMenuSelection:this.props.contextMenuSelection,dataKey:this.props.dataKey,expandedRows:this.props.expandedRows,onRowCollapse:this.props.onRowCollapse,onRowExpand:this.props.onRowExpand,onRowToggle:this.props.onRowToggle,editMode:this.props.editMode,editingRows:this.props.editingRows,onRowReorder:this.props.onRowReorder,scrollable:this.props.scrollable,rowGroupMode:this.props.rowGroupMode,groupRowsBy:this.props.groupRowsBy,expandableRowGroups:this.props.expandableRowGroups,loading:this.props.loading,emptyMessage:this.props.emptyMessage,rowGroupHeaderTemplate:this.props.rowGroupHeaderTemplate,rowExpansionTemplate:this.props.rowExpansionTemplate,rowGroupFooterTemplate:this.props.rowGroupFooterTemplate,onRowEditChange:this.props.onRowEditChange,compareSelectionBy:this.props.compareSelectionBy,selectOnEdit:this.props.selectOnEdit,onRowEditInit:this.props.onRowEditInit,rowEditValidator:this.props.rowEditValidator,onRowEditSave:this.props.onRowEditSave,onRowEditComplete:this.props.onRowEditComplete,onRowEditCancel:this.props.onRowEditCancel,cellClassName:this.props.cellClassName,responsiveLayout:this.props.responsiveLayout,selectionAutoFocus:this.props.selectionAutoFocus,isDataSelectable:this.props.isDataSelectable,showSelectionElement:this.props.showSelectionElement,showRowReorderElement:this.props.showRowReorderElement,expandedRowIcon:this.props.expandedRowIcon,collapsedRowIcon:this.props.collapsedRowIcon,rowClassName:this.props.rowClassName,isVirtualScrollerDisabled:!0}),d=e.createElement(ae,{value:this.dataToRender(a),className:c,empty:n,frozenRow:!1,tableProps:this.props,tableSelector:i,columns:p,selectionModeInColumn:o,first:s,editingMeta:l,onEditingMetaChange:this.onEditingMetaChange,tabIndex:this.props.tabIndex,onRowClick:this.props.onRowClick,onRowDoubleClick:this.props.onRowDoubleClick,onCellClick:this.props.onCellClick,selection:this.props.selection,onSelectionChange:this.props.onSelectionChange,lazy:this.props.lazy,paginator:this.props.paginator,onCellSelect:this.props.onCellSelect,onCellUnselect:this.props.onCellUnselect,onRowSelect:this.props.onRowSelect,onRowUnselect:this.props.onRowUnselect,dragSelection:this.props.dragSelection,onContextMenu:this.props.onContextMenu,onContextMenuSelectionChange:this.props.onContextMenuSelectionChange,metaKeySelection:this.props.metaKeySelection,selectionMode:this.props.selectionMode,cellSelection:this.props.cellSelection,contextMenuSelection:this.props.contextMenuSelection,dataKey:this.props.dataKey,expandedRows:this.props.expandedRows,onRowCollapse:this.props.onRowCollapse,onRowExpand:this.props.onRowExpand,onRowToggle:this.props.onRowToggle,editMode:this.props.editMode,editingRows:this.props.editingRows,onRowReorder:this.props.onRowReorder,scrollable:this.props.scrollable,rowGroupMode:this.props.rowGroupMode,groupRowsBy:this.props.groupRowsBy,expandableRowGroups:this.props.expandableRowGroups,loading:this.props.loading,emptyMessage:this.props.emptyMessage,rowGroupHeaderTemplate:this.props.rowGroupHeaderTemplate,rowExpansionTemplate:this.props.rowExpansionTemplate,rowGroupFooterTemplate:this.props.rowGroupFooterTemplate,onRowEditChange:this.props.onRowEditChange,compareSelectionBy:this.props.compareSelectionBy,selectOnEdit:this.props.selectOnEdit,onRowEditInit:this.props.onRowEditInit,rowEditValidator:this.props.rowEditValidator,onRowEditSave:this.props.onRowEditSave,onRowEditComplete:this.props.onRowEditComplete,onRowEditCancel:this.props.onRowEditCancel,cellClassName:this.props.cellClassName,responsiveLayout:this.props.responsiveLayout,selectionAutoFocus:this.props.selectionAutoFocus,isDataSelectable:this.props.isDataSelectable,showSelectionElement:this.props.showSelectionElement,showRowReorderElement:this.props.showRowReorderElement,expandedRowIcon:this.props.expandedRowIcon,collapsedRowIcon:this.props.collapsedRowIcon,rowClassName:this.props.rowClassName,virtualScrollerContentRef:u,virtualScrollerOptions:t,isVirtualScrollerDisabled:r});return e.createElement(e.Fragment,null,h,d)}},{key:"renderTableFooter",value:function(t){return e.createElement(fe,{tableProps:this.props,columns:t.columns,footerColumnGroup:this.props.footerColumnGroup})}},{key:"renderContent",value:function(t,o,r,i){var s=this;if(o){var l=this.isVirtualScrollerDisabled();return e.createElement("div",{className:"p-datatable-wrapper",style:{maxHeight:l?this.props.scrollHeight:null}},e.createElement(C,S({},this.props.virtualScrollerOptions||{},{items:t,columns:o,scrollHeight:this.props.scrollHeight,disabled:l,loaderDisabled:!0,showSpacer:!1,contentTemplate:function(t){var o=n("p-datatable-table",s.props.tableClassName),a=s.renderTableHeader(t,i),p=s.renderTableBody(t,r,i,l),u=s.renderTableFooter(t);return e.createElement("table",{ref:function(e){s.table=e,t.spacerRef&&t.spacerRef(e)},style:s.props.tableStyle,className:o,role:"table"},a,p,u)}})))}}},{key:"renderFooter",value:function(){if(this.props.footer){var t=r.getJSXElement(this.props.footer,{props:this.props});return e.createElement("div",{className:"p-datatable-footer"},t)}return null}},{key:"renderPaginator",value:function(t,r){var i=n("p-paginator-"+t,this.props.paginatorClassName);return e.createElement(o,{first:this.getFirst(),rows:this.getRows(),pageLinkSize:this.props.pageLinkSize,className:i,onPageChange:this.onPageChange,template:this.props.paginatorTemplate,totalRecords:r,rowsPerPageOptions:this.props.rowsPerPageOptions,currentPageReportTemplate:this.props.currentPageReportTemplate,leftContent:this.props.paginatorLeft,rightContent:this.props.paginatorRight,alwaysShow:this.props.alwaysShowPaginator,dropdownAppendTo:this.props.paginatorDropdownAppendTo})}},{key:"renderPaginatorTop",value:function(e){return this.props.paginator&&"bottom"!==this.props.paginatorPosition?this.renderPaginator("top",e):null}},{key:"renderPaginatorBottom",value:function(e){return this.props.paginator&&"top"!==this.props.paginatorPosition?this.renderPaginator("bottom",e):null}},{key:"renderResizeHelper",value:function(){var t=this;return this.props.resizableColumns?e.createElement("div",{ref:function(e){return t.resizeHelper=e},className:"p-column-resizer-helper",style:{display:"none"}}):null}},{key:"renderReorderIndicators",value:function(){var t=this;if(this.props.reorderableColumns){var o={position:"absolute",display:"none"};return e.createElement(e.Fragment,null,e.createElement("span",{ref:function(e){return t.reorderIndicatorUp=e},className:"pi pi-arrow-down p-datatable-reorder-indicator-up",style:o}),e.createElement("span",{ref:function(e){return t.reorderIndicatorDown=e},className:"pi pi-arrow-up p-datatable-reorder-indicator-down",style:o}))}return null}},{key:"render",value:function(){var t=this,o=this.processedData(),i=this.getColumns(),s=this.getTotalRecords(o),l=r.isEmpty(o),a=this.getSelectionModeInColumn(i),p=this.props.selectionMode||a,u=n("p-datatable p-component",{"p-datatable-hoverable-rows":this.props.rowHover,"p-datatable-selectable":p&&!this.props.cellSelection,"p-datatable-selectable-cell":p&&this.props.cellSelection,"p-datatable-auto-layout":this.props.autoLayout,"p-datatable-resizable":this.props.resizableColumns,"p-datatable-resizable-fit":this.props.resizableColumns&&"fit"===this.props.columnResizeMode,"p-datatable-scrollable":this.props.scrollable,"p-datatable-scrollable-vertical":this.props.scrollable&&"vertical"===this.props.scrollDirection,"p-datatable-scrollable-horizontal":this.props.scrollable&&"horizontal"===this.props.scrollDirection,"p-datatable-scrollable-both":this.props.scrollable&&"both"===this.props.scrollDirection,"p-datatable-flex-scrollable":this.props.scrollable&&"flex"===this.props.scrollHeight,"p-datatable-responsive-stack":"stack"===this.props.responsiveLayout,"p-datatable-responsive-scroll":"scroll"===this.props.responsiveLayout,"p-datatable-striped":this.props.stripedRows,"p-datatable-gridlines":this.props.showGridlines,"p-datatable-grouped-header":null!=this.props.headerColumnGroup,"p-datatable-grouped-footer":null!=this.props.footerColumnGroup,"p-datatable-sm":"small"===this.props.size,"p-datatable-lg":"large"===this.props.size},this.props.className),c=this.renderLoader(),h=this.renderHeader(),d=this.renderPaginatorTop(s),f=this.renderContent(o,i,a,l),g=this.renderPaginatorBottom(s),m=this.renderFooter(),v=this.renderResizeHelper(),y=this.renderReorderIndicators();return e.createElement("div",{ref:function(e){return t.el=e},id:this.props.id,className:u,style:this.props.style,"data-scrollselectors":".p-datatable-wrapper"},c,h,d,f,g,m,v,y)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.rows===t.d_rows||e.onPage?null:{rows:e.rows,d_rows:e.rows}}}]),g}();K(Fe,"defaultProps",{id:null,value:null,header:null,footer:null,style:null,className:null,tableStyle:null,tableClassName:null,paginator:!1,paginatorPosition:"bottom",alwaysShowPaginator:!0,paginatorClassName:null,paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown",paginatorLeft:null,paginatorRight:null,paginatorDropdownAppendTo:null,pageLinkSize:5,rowsPerPageOptions:null,currentPageReportTemplate:"({currentPage} of {totalPages})",first:0,rows:null,totalRecords:null,lazy:!1,sortField:null,sortOrder:null,multiSortMeta:null,sortMode:"single",defaultSortOrder:1,removableSort:!1,emptyMessage:null,selectionMode:null,dragSelection:!1,cellSelection:!1,selection:null,onSelectionChange:null,contextMenuSelection:null,onContextMenuSelectionChange:null,compareSelectionBy:"deepEquals",dataKey:null,metaKeySelection:!0,selectOnEdit:!0,selectionPageOnly:!1,selectionAutoFocus:!0,showSelectAll:!0,selectAll:!1,onSelectAllChange:null,headerColumnGroup:null,footerColumnGroup:null,rowExpansionTemplate:null,expandedRows:null,onRowToggle:null,resizableColumns:!1,columnResizeMode:"fit",reorderableColumns:!1,filters:null,globalFilter:null,filterDelay:300,filterLocale:void 0,scrollable:!1,scrollHeight:null,scrollDirection:"vertical",virtualScrollerOptions:null,frozenWidth:null,frozenValue:null,csvSeparator:",",exportFilename:"download",rowGroupMode:null,autoLayout:!1,rowClassName:null,cellClassName:null,rowGroupHeaderTemplate:null,rowGroupFooterTemplate:null,loading:!1,loadingIcon:"pi pi-spinner",tabIndex:0,stateKey:null,stateStorage:"session",groupRowsBy:null,editMode:"cell",editingRows:null,expandableRowGroups:!1,rowHover:!1,showGridlines:!1,stripedRows:!1,size:"normal",responsiveLayout:"stack",breakpoint:"960px",filterDisplay:"menu",expandedRowIcon:"pi pi-chevron-down",collapsedRowIcon:"pi pi-chevron-right",onRowEditComplete:null,globalFilterFields:null,showSelectionElement:null,showRowReorderElement:null,isDataSelectable:null,onColumnResizeEnd:null,onColumnResizerClick:null,onColumnResizerDoubleClick:null,onSort:null,onPage:null,onFilter:null,onAllRowsSelect:null,onAllRowsUnselect:null,onRowClick:null,onRowDoubleClick:null,onRowSelect:null,onRowUnselect:null,onRowExpand:null,onRowCollapse:null,onContextMenu:null,onColReorder:null,onCellClick:null,onCellSelect:null,onCellUnselect:null,onRowReorder:null,onValueChange:null,rowEditValidator:null,onRowEditInit:null,onRowEditSave:null,onRowEditCancel:null,onRowEditChange:null,exportFunction:null,customSaveState:null,customRestoreState:null,onStateSave:null,onStateRestore:null});export{Fe as DataTable};
|