PageSourceSearch

https://www.puratos.hu/etc.clientlibs/settings/wcm/designs/puratos…/js/myPuratos-documents.3b3e072a.chunk.js

js puratos.hu collected 2026-09-26 16:25:28 UTC 17,830 bytes, 3 lines download raw bytes

1/*! For license information please see myPuratos-documents.3b3e072a.chunk.js.LICENSE.txt */
2(self.webpackChunkpuratos_react=self.webpackChunkpuratos_react||[]).push([[2646],{6010(e,t,l){"use strict";l.d(t,{S:()=>r,z:()=>s});l(96540);var n=l(74848);const a={display:"initial"},s={sm:"-13",md:"",lg:"-15"},r=e=>{let{id:t,className:l,label:r="",selected:i,onChange:o,size:c=s.md,centered:d,list:u=!1,hideMobile:p=!1,hideDesktop:m=!1,disabled:h=!1}=e;return(0,n.jsxs)("div",{className:"p-checkbox"+c+(d?" center":"")+(u?" list":"")+(p?" important-hide-mobile":"")+(m?" important-hide-desktop":"")+(h?" disabled":""),children:[(0,n.jsx)("input",{id:t,type:"checkbox",className:l,checked:i,onChange:o,disabled:h}),(0,n.jsx)("label",{htmlFor:t,className:"p-cursor-pointer",style:a,children:r})]})}},46148(e,t,l){"use strict";l.d(t,{A:()=>i});l(96540);var n=l(5556),a=l.n(n),s=l(74848);const r=e=>{let{link:t,text:l,target:n}=e;return t?(0,s.jsxs)("a",{href:t,target:n,className:"btn-download",children:[(0,s.jsx)("span",{className:"svg-download"}),l&&(0,s.jsx)("span",{className:"btn-download__text",children:l})]}):(0,s.jsxs)("div",{className:"btn-download disabled",children:[(0,s.jsx)("span",{className:"svg-download"}),l&&(0,s.jsx)("span",{className:"btn-download__text",children:l})]})};r.propTypes={link:a().string,text:a().string,target:a().string},r.defaultProps={target:"_blank"};const i=r},36173(e,t,l){"use strict";l.d(t,{A:()=>o});l(96540);var n=l(5556),a=l.n(n),s=l(67849),r=l(74848);const i=e=>{let{amount:t,label:l,pluralLabel:n}=e;const a=(0,s.GO)()(1!==t?n:l).replace("{0}","<span>"+t+"</span>");return(0,r.jsx)("h3",{className:"p-section-result-counter p-margin-none",dangerouslySetInnerHTML:{__html:a}})};i.propTypes={amount:a().number,label:a().string,pluralLabel:a().string},i.defaultProps={pluralLabel:"{0} items",label:"{0} item",amount:0};const o=i},54170(e,t,l){"use strict";l.d(t,{A:()=>i});var n=l(96540),a=l(67849),s=l(28208),r=l(74848);const i=(0,s.G)((0,a.lI)(function(e){let{label:t,initialValue:l,onChange:a,translate:s,placeholder:i,reset:o}=e;const[c,d]=n.useState(""),[u,p]=n.useState("");return n.useEffect(()=>d(l),[l]),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"form-label",children:t&&s(t)}),(0,r.jsxs)("form",{onSubmit:e=>((e,t,l)=>{e&&e.preventDefault&&e.preventDefault(),l(t)})(e,c,a),className:"p-margin-none dropdown",children:[(0,r.jsx)("input",{type:"text",className:"form-control form-icon round",ref:e=>p(e),placeholder:i&&s(i),onInput:e=>((e,t)=>{e.persist(),t(e&&e.target&&e.target.value||"")})(e,d)}),(0,r.jsxs)("button",{type:"submit",className:"p-filter-form__btn",children:[(0,r.jsx)("span",{className:"sr-only",children:s("Search")}),(0,r.jsx)("span",{className:"svg-search-black-circle"})]})]}),(0,r.jsx)("a",{className:"p-filter-toolbar__reset",onClick:()=>((e,t,l)=>{t&&(t.value=""),e&&e(""),l()})(d,u,o),children:(0,r.jsx)("span",{children:s("Reset search")})})]})}))},68797(e,t,l){"use strict";l.d(t,{W:()=>p});var n=l(96540),a=l(5556),s=l(19115),r=l(82960),i=l(67849),o=l(88481),c=l(73354),d=l(74848);function u(e){let{children:t,translate:l}=e;const[a,s]=n.useState(!1);return(0,d.jsx)("div",{className:"row",children:(0,d.jsxs)("div",{className:"col-sm-12",children:[(0,d.jsx)("div",{className:"collapse p-filter-toolbar"+(a?" in":""),children:t}),(0,d.jsx)("div",{className:"p-filter-toggle p-margin-bottom-md",children:(0,d.jsxs)("div",{className:"p-flex p-flex-align-center",onClick:()=>s(!a),children:[(0,d.jsx)("span",{className:"p-filter-toggle__icon svg-reset-red-circle"}),(0,d.jsx)("span",{className:"p-filter-toggle__text",children:l("filtersText")})]})})]})})}u.propTypes={hasFiltering:a.bool,translate:a.func.isRequired,filters:a.object};const p=(0,r.Zz)(i.lI,(0,s.connect)((e,t)=>({hasFiltering:(0,c.RI)((0,o.vD)(e,t.filterId))})))(u);p.FilterSection=e=>{let{children:t}=e;return(0,d.jsx)("div",{className:"p-filter-toolbar__items",children:t})},p.SearchSection=e=>{let{children:t}=e;return(0,d.jsx)("div",{className:"p-filter-toolbar__search",children:t})}},39501(e,t,l){"use strict";l.d(t,{A:()=>S});var n=l(96540),a=l(5556),s=l.n(a),r=l(90249),i=l(84193),o=l(74848);const c=e=>{let{activePage:t,pageClickHandler:l,amountOfPages:n,amountToShow:a}=e;return(0,o.jsxs)("ul",{className:"pagination pagination-sm",children:[(0,o.jsx)("li",{className:1===t?"disabled":"",children:(0,o.jsx)("a",{href:"#","aria-label":"Previous",onClick:()=>1!==t&&l(t-1),children:(0,o.jsx)("span",{"aria-hidden":"true"})})}),(0,o.jsx)("li",{className:1===t?"active":"",children:(0,o.jsx)("a",{href:"#",onClick:()=>l(1),children:"1"})}),(0,o.jsx)("li",{className:t-(a-1)/2>2?"":"hide",children:(0,o.jsx)("a",{href:"#",onClick:()=>l(t-3),children:"..."})}),Array(Math.ceil(n-2<0?0:n-2)).fill().map((e,n)=>(0,o.jsx)("li",{className:(t===n+2?"active":"")+(t-(a-1)/2>n+2||t+(a-1)/2<n+2?"hide":""),children:(0,o.jsx)("a",{href:"#",onClick:()=>l(n+2),children:n+2})},n+1)),(0,o.jsx)("li",{className:n-t-(a-1)/2>=2?"":"hide",children:(0,o.jsx)("a",{href:"#",onClick:()=>l(t+3),children:"..."})}),(0,o.jsx)("li",{className:(t===Math.ceil(n)?"active ":"")+(n<=1?"hide":""),children:(0,o.jsx)("a",{href:"#",onClick:()=>l(Math.ceil(n)),children:Math.ceil(n)})}),(0,o.jsx)("li",{className:n<=t?"disabled":"",children:(0,o.jsx)("a",{href:"#","aria-label":"Next",onClick:()=>!(n<=t)&&l(t+1),children:(0,o.jsx)("span",{"aria-hidden":"true"})})})]})};c.propTypes={activePage:s().number,amountOfPages:s().number,pageClickHandler:s().func,amountToShow:s().number},c.defaultProps={activePage:1,amountOfPages:1,amountToShow:5};const d=(0,i.X)(c);var u=l(36173),p=l(37961),m=l(19115),h=l(746),f=l(24518),g=l(68797),v=l(9496),x=l(29521),b=l(88481),j=l(99507),y=l(93390),N=l(67849),T=l(13956),C=l(17477),P=l(6010);const w=e=>{let{total:t,payInvoices:l,disabled:n,blockButton:a,mobileSticky:s,selectAll:r,isAllSelected:i}=e;const c=(0,N.GO)(),d=(0,C.a)("1000px");return(0,o.jsxs)("div",{className:"p-flex p-flex-align-center p-filtered-list ".concat(s&&d?"mobile-section sticky p-flex-justify-content-space-between p-flex-wrap":"p-flex-justify-content-end"," ").concat(d&&a?"top-section":""),style:s&&d?{display:"none"}:null,children:[(0,o.jsx)("div",{className:"p-flex p-filtered-list-amount ".concat(s&&d?"p-margin-top-xs p-margin-bottom-xs":""),children:(0,o.jsx)("p",{className:"p-filtered-list-total",children:c("Total selected: {0}",t)})}),(0,o.jsx)(T.$,{color:"primary",onClick:l,disabled:n,block:d&&!s,children:c(d?"Pay invoices":"Pay")}),d&&a&&(0,o.jsx)("div",{className:"p-flex p-filtered-list-amount p-margin-top-sm ".concat(s?"p-margin-bottom-xs":""),children:(0,o.jsx)(P.S,{id:"selectAllMobile",selected:i,onChange:r,label:c("Select all"),centered:!0},"selectAllMobile")}
2)]})};var k=l(32809);function _(e,t,l){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class D extends n.Component{constructor(){super(...arguments),_(this,"handlePageClick",e=>this.props.updateActivePage({context:this.props.context,value:e}))}shouldRenderPagination(e,t){return!(!e||0===e||!t||0===t)}render(){const{i18n:e,aemResource:t,totalAmount:l,activePage:a,children:s,loading:i,total:c,allowedRoles:m,itemsPerPage:h,notAllowedRoles:v,eCommerceRequired:b,activeFilters:j,className:N,context:T,listHeader:C,listFooter:P,invoicesAmount:_,payButtonDisabled:D,payInvoices:O,onlinePaymentEnabled:S=!1,selectAll:A,isAllSelected:I,skeletonType:R=k.N.PRODUCTS}=this.props,F="invoices"===T||"orders"===T;return(0,o.jsxs)(x.E.Provider,{value:T,children:[(0,o.jsx)("div",{className:"row",children:(0,o.jsx)(p.d,{roles:m,eCommerceRequired:b,children:(0,o.jsx)("div",{className:"col-xs-12",children:n.Children.map(s,e=>e.type===g.W?e:null)})})}),(0,o.jsx)(f.E,{loading:i,messages:t,total:c,allowedRoles:m,activeFilters:j,notAllowedRoles:v,eCommerceRequired:b,children:(0,o.jsxs)("div",{className:"row "+N,children:[(0,o.jsxs)("div",{className:"col-xs-12 p-flex p-justify-space-between p-flex-align-end ".concat(F?"invoice-filter":""),children:[(0,o.jsx)(u.A,{amount:c}),F&&S?(0,o.jsx)(w,{total:l,payInvoices:O,disabled:D,blockButton:!0,selectAll:A,isAllSelected:I}):null]}),(0,o.jsxs)("div",{className:"col-xs-12",children:[(0,o.jsx)(y.XI,{children:(0,o.jsx)(r.x,{listModel:t,i18n:e,loading:i,activePage:a,amountOfItems:h,resultsHeader:C,listFooter:P,skeletonType:R,children:n.Children.map(s,(e,t)=>e.type!==g.W?e:null)})}),F&&S?(0,o.jsx)(w,{total:l,payInvoices:O,disabled:D,mobileSticky:!0}):null,(0,o.jsx)("div",{className:"row",children:(0,o.jsx)("div",{className:"col-sm-12",children:(0,o.jsx)("nav",{"aria-label":"Page navigation",className:"p-flex p-justify-space-around",children:this.shouldRenderPagination(h,c)&&(0,o.jsx)(d,{activePage:a,amountOfPages:Math.ceil(c/h),pageClickHandler:this.handlePageClick})})})})]})]})})]})}}D.propTypes={loading:s().bool,itemsPerPage:s().number,context:s().string,activePage:s().number.isRequired,activeFilters:s().object.isRequired,className:s().string},D.defaultProps={loading:!0,allowedRoles:[h.ai.puratosCustomerValidated,h.ai.puratosCustomerNoAuth],notAllowedRoles:[h.ai.puratosNoCustomer,h.ai.puratosCustomerUnvalidated],activeFilters:{},itemsPerPage:v.GL,className:""};const O={updateActivePage:j.fl},S=(0,m.connect)((e,t)=>({i18n:e.myPuratos_i18n.i18n,activePage:(0,b.WE)(e,t.context),activeFilters:(0,b.vD)(e,t.context)}),O)(D)},34795(e,t,l){"use strict";l.r(t),l.d(t,{default:()=>M});var n=l(96540),a=l(19115),s=l(39501),r=l(9496),i=l(47091),o=l(54950),c=l(46148),d=l(62975),u=l(65760),p=l(93390),m=l(99918),h=l(63173),f=l(17477),g=l(74848);const v=(e,t)=>{return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{className:"p-sans p-heavy p-cursor-pointer",onClick:t?()=>window.open(t,"_blank"):null,onKeyDown:t?e=>"Enter"===e.key&&window.open(t,"_blank"):null,role:t?"button":void 0,tabIndex:t?0:void 0,children:e.productName?e.productName:e.title}),(0,g.jsx)("span",{className:"small",children:(l=e.fileSize,n=e.fileType,l&&n?" (".concat(l,", ").concat(n,")"):l||n?" (".concat(l||n,")"):"")})]});var l,n},x=e=>{let{data:t,i18n:l,hidden:n}=e;const a=t.downloadLink?t.downloadLink:(0,u.r)(t.linkId),s=(0,f.a)();return n?null:(0,g.jsxs)(p.XI.Row,{children:[(0,g.jsx)(m.Vm,{valign:"center",align:"left",size:m.Dq._equal,isMobile:s,label:(0,o.T)(l,"Name"),value:v(t,a),badgeValue:t.newDocument?(0,o.T)(l,"New"):null,badgeSize:h.GS.medium,badgeType:"info",mobileFullWidth:!0}),(0,g.jsx)(m.IQ,{valign:"center",align:"left",size:m.Dq._equal,isMobile:s,label:(0,o.T)(l,"Type"),value:t.documentType}),(0,g.jsx)(m.IQ,{valign:"center",align:"left",size:m.Dq._equal,isMobile:s,label:(0,o.T)(l,"Date"),value:t.date?(0,d.Yq)(t.date):(0,o.T)(l,"No date available")}),(0,g.jsx)(p.XI.Cell,{valign:"center",align:"center",size:m.Dq._200,children:(0,g.jsx)(c.A,{link:t.downloadLink?t.downloadLink:(0,u.r)(t.linkId),text:(0,o.T)(l,"Download")})})]})};x.propTypes={},x.defaultProps={};const b=x;var j=l(79337),y=l(74802),N=l.n(y),T=l(746),C=l(68797),P=l(50536),w=l(88481),k=l(99507),_=l(30673),D=l(54170);const O=e=>{let{i18n:t}=e;return(0,g.jsxs)(p.XI.Header,{children:[(0,g.jsx)(p.XI.Cell,{valign:"center",align:"left",size:m.Dq._equal,children:(0,o.T)(t,"Name")}),(0,g.jsx)(p.XI.Cell,{valign:"center",align:"left",size:m.Dq._equal,children:(0,o.T)(t,"Type")}),(0,g.jsx)(p.XI.Cell,{valign:"center",align:"left",size:m.Dq._equal,children:(0,o.T)(t,"Date")}),(0,g.jsx)(p.XI.Cell,{size:m.Dq._200}
2)]})};var S=l(21978),A=l(32809);function I(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,n)}return l}function R(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?I(Object(l),!0).forEach(function(t){F(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):I(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function F(e,t,l){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class E extends n.Component{componentDidMount(){const{mapping:e,filter:t}=this.props;this.props.resetFilters(E.FILTER_CONTEXT),this.props.fetchDocumentsModel(e),this.props.fetchDocuments({sorting:(0,j.i3)(E.FILTER_CONTEXT,"sorting"),search:t.searchTerm}),this.props.setLoading(!1),(0,S.c)("documents")}componentDidUpdate(e){const{filter:t,mapping:l}=this.props,n=e.filter&&(e.filter.sorting!==t.sorting||e.filter.type!==t.type||e.filter.searchTerm!==t.searchTerm);e.mapping!==l&&(this.props.fetchDocumentsModel(l),this.props.fetchDocuments({sorting:(0,j.i3)(E.FILTER_CONTEXT,"sorting"),search:t.searchTerm})),n&&this.props.fetchDocuments({sorting:t.sorting,type:t.type,search:t.searchTerm})}render(){const{documentsModel:e,i18n:t,loading:l,setActive:n,documents:a,filter:i,resetFilters:c,filterOptions:d,setFilterOptions:u}=this.props,p=d&&d.length>0?d:(()=>{const e=a.data.length?a.data.reduce((e,l)=>{const n={label:(0,o.T)(t,l.documentType),value:l.documentType};return e.find(e=>e.value===n.value)?e:[...e,n]},[]).filter(e=>""!==e.label):[];return e.length&&u(e),e})();return(0,g.jsx)(_.A,{title:e.title,description:e.text,allowedRoles:[T.ai.puratosCustomerValidated,T.ai.puratosCustomerNoAuth,T.ai.puratosNoCustomer,T.ai.puratosCustomerUnvalidated],children:(0,g.jsxs)(s.A,{aemResource:e,total:a.data.length,allowedRoles:[T.ai.puratosCustomerValidated,T.ai.puratosCustomerNoAuth,T.ai.puratosNoCustomer,T.ai.puratosCustomerUnvalidated],notAllowedRoles:[],loading:l,skeletonType:A.N.DOCUMENTS,context:E.FILTER_CONTEXT,listHeader:(0,g.jsx)(O,{i18n:t}),children:[(0,g.jsxs)(C.W,{children:[(0,g.jsxs)(C.W.FilterSection,{children:[(0,g.jsx)(P.A,{label:"Sort",id:"sorting",options:r.NP,type:"sorting",filter:i}),(0,g.jsx)(P.A,{label:"Filter",id:"type",type:"category",filter:i,options:e.typeOfDocuments&&a.data?p:"ALL"!==e.typeOfDocuments?r.VC.filter(t=>t.value===e.typeOfDocuments):r.VC})]}),(0,g.jsx)(C.W.SearchSection,{children:(0,g.jsx)(D.A,{placeholder:"Search",id:"searchTerm",reset:()=>c(E.FILTER_CONTEXT)})})]},"filter-header"),a.data.map((e,l)=>(0,g.jsx)(b,{data:e,i18n:t,setActive:n},N()(R(R({},e),{},{index:l}))))]})})}}F(E,"FILTER_CONTEXT","documents");const L={fetchDocumentsModel:i.g9,fetchDocuments:i.P_,setLoading:i.r1,resetFilters:k.dr,setFilterOptions:i.Dh},M=(0,a.connect)(e=>({documentsModel:e.myPuratos_documents.aemResource,documents:e.myPuratos_documents.documents,i18n:e.myPuratos_i18n.i18n,filter:(0,w.vD)(e,E.FILTER_CONTEXT),loading:e.myPuratos_documents.loading,activeItem:e.myPuratos_documents.activeDocument,mapping:e.myPuratos_dashboard.mapping,filterOptions:e.myPuratos_documents.filterOptions}),L)(E)},62975(e,t,l){"use strict";l.d(t,{KH:()=>o,Xd:()=>r,Yq:()=>s,oh:()=>i});var n=l(23941),a=l.n(n);function s(e){return c(e)?s(a()(e).toDate()):e instanceof Date?"".concat(e.getDate(),"/").concat(e.getMonth()+1,"/").concat(e.getFullYear()):e}function r(e,t){var l;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!e)return"";let s=t,r=[];return t&&(s=t.replace("_","-").toLowerCase(),r=s.split("-"),2===r.length&&(s="".concat(r[0],"-").concat(r[1].toUpperCase()))),null!==(l=a().locales())&&void 0!==l&&l.includes(s)?a().locale(s):r.length?a().locale(r[0]):a().locale("en"),a()(e).format(n.toUpperCase()||"L")}function i(e,t){var l;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!e)return"";let s=t,r=[];return t&&(s=t.replace("_","-").toLowerCase(),r=s.split("-"),2===r.length&&(s="".concat(r[0],"-").concat(r[1].toUpperCase()))),null!==(l=a().locales())&&void 0!==l&&l.includes(s)?a().locale(s):r.length?a().locale(r[0]):a().locale("en"),a()(e).format(n.toUpperCase()||"L LT")}function o(e){return e instanceof Date?"".concat(e.getFullYear(),"-").concat((e.getMonth()+1).toString().length>1?e.getMonth()+1:"0"+(e.getMonth()+1),"-").concat(e.getDate().toString().length>1?e.getDate():"0"+e.getDate()):e}function c(e){return!isNaN(parseFloat(e)&&isFinite(e))}},21978(e,t,l){"use strict";l.d(t,{c:()=>r});var n=l(74692),a=l.n(n);const s="href",r=e=>{var t;const l=a()(".p-navbar--lang-dropdown")[0];l&&(null===(t=a()(l).children())||void 0===t||t.each(function(){const t=a()(this).attr(s),l=new RegExp("/mypuratos/?(.*)");l.test(t)&&null!==t&&void 0!==t&&t.endsWith(!!t.match(l)&&t.match(l)[0])&&a()(this).attr(s,t.replace(t.match(l)[0],"".concat("/mypuratos","/").concat(e)))}))}},46942(e,t){var l;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var l=arguments[t];l&&(e=r(e,s(l)))}return e}function s(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var l in e)n.call(e,l)&&e[l]&&(t=r(t,l));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(l=function(){return a}
2.apply(t,[]))||(e.exports=l)}()}}]);
3//# sourceMappingURL=myPuratos-documents.3b3e072a.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.