-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from bombastictranz/main
Stock-control-supervisors-KRAKEN-PRO-
- Loading branch information
Showing
5 changed files
with
5 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2992],{74007:function(e,t,a){"use strict";a.d(t,{u:function(){return l}});var s=a(85893);a(67294);var i=a(94184),r=a.n(i),o=a(68477),n=a.n(o);function l(e){let{id:t,className:a}=e;return(0,s.jsx)("div",{id:t,className:r()(n().loadingPlaceholder,"dib",a)})}},34123:function(e,t,a){"use strict";a.d(t,{t:function(){return f}});var s=a(85893),i=a(67294),r=a(94184),o=a.n(r),n=a(59112),l=a(45651),d=a(8793),h=a(66711),p=a(74007),c=a(24325);let g=i.forwardRef((e,t)=>{let{color:a,...i}=e;return(0,s.jsxs)("svg",{...(0,c.ti)(i),ref:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M11.4853 20.4853L3 12L11.4853 3.51471L12.8995 4.92892L5.82843 12L12.8995 19.0711L11.4853 20.4853Z",fill:a}),(0,s.jsx)("path",{d:"M17.4853 20.4853L9 12L17.4853 3.51471L18.8995 4.92892L11.8284 12L18.8995 19.0711L17.4853 20.4853Z",fill:a})]})});g.displayName="ChevronLeftDouble";let u=i.forwardRef((e,t)=>{let{color:a,...i}=e;return(0,s.jsxs)("svg",{...(0,c.ti)(i),ref:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M12.5147 3.51473L21 12L12.5147 20.4853L11.1005 19.0711L18.1716 12L11.1005 4.92894L12.5147 3.51473Z",fill:a}),(0,s.jsx)("path",{d:"M6.51472 3.51473L15 12L6.51472 20.4853L5.1005 19.0711L12.1716 12L5.1005 4.92894L6.51472 3.51473Z",fill:a})]})});u.displayName="ChevronRightDouble";var m=a(54587),x=a.n(m);let f=e=>{let{handleFirstPage:t,handleLastPage:a,handleNextPage:i,handlePreviousPage:r,nextPageAriaLabel:c,firstPageAriaLabel:m,lastPageAriaLabel:f,page:v,arrowsClassName:P,disabled:w,pageSize:L,previousPageAriaLabel:S,showIndexes:b=!0,showTotal:j=!0,simple:C,total:N,currentPageSize:_=0,unknownTotal:y,loading:A=!1,lastPageDataTestId:D}=e,R=Math.round(Math.max(v*L,0)),k=y&&!w?v*L+_:Math.round(Math.min((v+1)*L,N)),H=_==L,I=y?H||w:k<N,M=!y&&k<N,z=y&&!H&&!w;return(0,s.jsxs)("div",{className:o()("table-pagination flex items-center",{[x().simple]:C}),children:[!b&&!C&&(0,s.jsx)("span",{className:"caption-mono-2 hide-small",children:"".concat(v+1," of ").concat(Math.ceil(N/L))}),b&&!C&&(0,s.jsxs)("span",{className:"caption-mono-2 hide-small",children:["".concat(R+1," - ").concat(k).concat(j?" of ":""),j&&(z?k:y?(0,s.jsx)(n.x,{langKey:"general:ManyItems"}):N),A&&(0,s.jsx)("div",{className:o()(x().loading),children:(0,s.jsx)(p.u,{className:"w-100"})})]}),(0,s.jsxs)("div",{className:o()("flex ml2",{[x().simpleArrowLeft]:C}),children:[t&&(0,s.jsx)(l.h,{className:o()(x().doubleArrow,"text-P500",{"o-50 cursor-default":0===v},P),icon:g,"aria-label":m,onClick:()=>v>0&&!w&&t&&t()}),(0,s.jsx)(l.h,{icon:d.X,"aria-label":S,className:o()("text-P500",{"o-50 cursor-default":0===v},P),disabled:0===v,onClick:()=>v>0&&!w&&r&&r(),dataTestId:"previous-page-arrow"})]}),b&&C&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("span",{className:o()("caption-mono-2",{[x().simpleIndexes]:C}),children:["".concat(R+1," - ").concat(k).concat(j?" of ":""),j&&(z?k:y?(0,s.jsx)(n.x,{langKey:"general:ManyItems"}):N),A&&(0,s.jsx)("div",{className:o()(x().loading),children:(0,s.jsx)(p.u,{className:"w-100"})})]})}),(0,s.jsxs)("div",{className:o()("flex ml2",{[x().simpleArrowRight]:C}),children:[(0,s.jsx)(l.h,{icon:h.o,"aria-label":c,className:o()("text-P500",{"o-50 cursor-default":!I},P),disabled:k>=N,onClick:()=>I&&!w&&i&&i(),dataTestId:"next-page-arrow"}),a&&(0,s.jsx)(l.h,{className:o()(x().doubleArrow,"text-P500",{"o-50 cursor-default":!I},P),icon:u,"aria-label":f,"data-test-id":D,onClick:()=>M&&!w&&a&&a()})]})]})}},42992:function(e,t,a){"use strict";a.d(t,{i:function(){return M}});var s=a(85893),i=a(67294),r=a(72790),o=a(9850),n=a(83175),l=a(94184),d=a.n(l),h=a(34123),p=a(30381),c=a.n(p);class g extends i.PureComponent{render(){let{className:e="",cellData:t,column:a}=this.props,i=t;return t instanceof c()&&(i=t.format(a.dateFormat)),(0,s.jsxs)("div",{ref:this.root,onMouseEnter:this.handleHover,role:"gridcell",className:d()("caption-2",{"caption-mono-2":a.mono},e),children:[!this.state.truncated&&i,this.state.truncated&&(0,s.jsx)("span",{className:"db truncate pointer",children:i})]})}constructor(...e){super(...e),this.root=i.createRef(),this.state={truncated:!1},this.handleHover=e=>{e.preventDefault(),this.state.truncated||this.setState({truncated:this.isTruncated()})},this.componentDidUpdate=e=>{this.props.cellData!==e.cellData&&this.setState({truncated:!1})},this.isTruncated=()=>!!this.root.current&&"string"==typeof this.props.cellData&&this.root.current.scrollWidth>this.root.current.clientWidth}}let u=e=>{let{sortable:t,sortOrder:a,className:i}=e;return(0,s.jsxs)("svg",{className:d()("sort-indicator",{sortable:t},i),width:"8",height:"12",viewBox:"0 0 8 12",xmlns:"http://www.w3.org/2000/svg",children:[t&&a!==r.As.DESC&&(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.25045 5.00003C0.830856 5.00003 0.597876 4.51437 0.860478 4.18711L3.83029 0.486028C4.03044 0.236591 4.41008 0.236591 4.61023 0.486029L7.58004 4.18711C7.84264 4.51437 7.60966 5.00003 7.19007 5.00003H1.25045"}),t&&a!==r.As.ASC&&(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.25045 7.00003C0.830856 7.00003 0.597876 7.48569 0.860478 7.81295L3.83029 11.514C4.03044 11.7635 4.41008 11.7635 4.61023 11.514L7.58004 7.81295C7.84264 7.48569 7.60966 7.00003 7.19007 7.00003H1.25045Z"})]})},m=e=>{let t,{className:a,column:i,children:r,container:o}=e,{sortState:n,sortBy:l}=o.props,{key:h,sortable:p}=i;if(p&&n){let e=n[i.key];t=p?e:void 0}else p&&(null==l?void 0:l.key)===h&&(t=null==l?void 0:l.order);return(0,s.jsxs)("div",{className:d()("caption-3 flex items-center",a),onClick:p?o._handleColumnSort:void 0,children:[(0,s.jsx)("div",{className:d()({"text-N600":t}),children:i.title}),p&&(0,s.jsx)(u,{className:d()({"text-N600":t}),sortable:!!p,sortOrder:t}),r]})};var x=a(12487);let f=["xs","sm","md","lg","xl"],v=(e,t)=>{let a=0,s=f.findIndex(e=>!!t[e]);return f.slice(0,s+1).forEach(t=>{let s=e[t];s>=0&&(a=s)}),a},P=e=>{let{column:t,style:a,...i}=e,{width:r}=t;return"string"==typeof r||"number"==typeof r?(0,s.jsx)("div",{style:a,...i}):(0,s.jsx)(x.Z,{queries:{xs:"(max-width: 480px)",sm:"(min-width: 481px) and (max-width: 767px)",md:"(min-width: 768px) and (max-width: 992px)",lg:"(min-width: 993px) and (max-width: 1199px)",xl:"(min-width: 1200px)"},children:e=>{let t=v(r,e);return t?(0,s.jsx)("div",{style:Object.assign({},a,{width:t}),...i}):null}})},w={SortIndicator:()=>null,TableCell:g,TableHeaderCell:m},L=e=>{let{tableHeight:t,dataLength:a,headerHeight:s,rowHeight:i}=e;if("auto"!==t)return void 0===t?0===a?300:i*a+(Array.isArray(s)?s.reduce((e,t)=>e+t,0):s):t};class S extends i.PureComponent{render(){let{container:e,className:t,title:a,bar:i,children:o,pageSize:n=0,width:l,height:p,rowHeight:c,headerHeight:g,columns:u,loading:m,total:x,showIndexes:f,footerClassnames:v,showTotal:S,paginationLoading:b,useSmallHeaders:j,...C}=this.props,{page:N,sortState:_,emptyRenderer:y}=this.props,A=m?[,,,,,]:this.props.data,D=A&&A.length>0&&!!n&&!!x,R=L({tableHeight:p,headerHeight:g,rowHeight:c,dataLength:A.length});return(0,s.jsxs)("div",{className:d()("sb-table w-100",{"h-100":void 0===R},t,{"table-container":e},{"responsive-container":j}),"data-testid":this.props["data-testid"],children:[a&&(0,s.jsx)("div",{className:"body-3 table-title flex items-center",children:a}),i&&(0,s.jsx)("div",{className:"table-bar bb bt",children:i}),(0,s.jsx)("div",{style:R?{minHeight:R}:{height:"100%"},children:(0,s.jsx)(r.wh,{width:l,height:R,children:e=>{let{width:t,height:a}=e;return(0,s.jsx)(r.ZP,{classPrefix:"KrakenTable",columns:this.getColumnsProp(u),height:a,rowHeight:c,headerHeight:g,emptyRenderer:y,onColumnSort:this.props.handleColumnSort,components:w,...C,width:t,sortState:_,data:A,cellProps:e=>{let{column:t}=e;return{tagName:P,column:t}},headerCellProps:e=>{let{column:t}=e;return{tagName:P,column:t}}})}})}),(D||o)&&(0,s.jsxs)("div",{className:d()("table-footer flex items-center",v||(D?"justify-between":"justify-end")),children:[(0,s.jsx)("div",{className:"table-children",children:o}),D&&(0,s.jsx)(h.t,{page:N,handlePreviousPage:this.props.onPreviousPage,handleNextPage:this.props.onNextPage,handleFirstPage:this.props.handleFirstPage,handleLastPage:this.props.handleLastPage,arrowsClassName:this.props.paginationArrowsClassName,total:x,pageSize:n,showIndexes:f,nextPageAriaLabel:this.props.nextPageAriaLabel,previousPageAriaLabel:this.props.previousPageAriaLabel,showTotal:S,loading:b})]})]})}constructor(...e){super(...e),this.getColumnsProp=(0,o.Z)(e=>e.map(e=>({...e,sortable:!!e.sortable})))}}S.defaultProps={container:!0,columns:[],headerHeight:40,rowHeight:48,page:0,sortState:{},nextPageAriaLabel:"Next Page",previousPageAriaLabel:"Previous Page",paginationLoading:!1,useSmallHeaders:!1};var b=a(74007),j=a(15555),C=a.n(j);let N=i.forwardRef((e,t)=>{let{children:a}=e;return(0,s.jsx)("div",{ref:t,className:d()(C().actionList,"ba br2 bc z-1"),children:i.Children.map(a,e=>e?(0,s.jsx)("div",{className:d()(C().actionListItem,"tc pointer"),children:e},e.key?e.key:void 0):null)})});N.displayName="ActionList";var _=a(13012),y=a(84791),A=a(10825);let D=(e,t)=>e===t?0:e instanceof _.Z?e.gt(t)?1:e.lt(t)?-1:0:c().isMoment(e)?e.isBefore(t)?1:e.isAfter(t)?-1:0:(0,y.Z)(e,t)?1:(0,A.Z)(e,t)?-1:0,R=(e,t,a)=>{let s=-1,i=e.criteria,r=t.criteria,o=i.length,n=a.length;for(;++s<o;){let e=D(i[s],r[s]);if(e){if(s>=n)return e;let t=a[s];return e*("desc"===t?-1:1)}}return e.index-t.index};var k=a(52295),H=a.n(k);let I=()=>(0,s.jsx)("div",{className:d()(H().loadingRow,"flex items-center"),children:(0,s.jsx)(b.u,{className:"w-100"})});class M extends i.PureComponent{componentDidMount(){(this.props.sortState||this.props.pageSize)&&this.sortData()}componentDidUpdate(e,t){let{loading:a,sortState:s,data:i,pageSize:r,pageOverride:o}=this.props,{page:n}=this.state;a||e.sortState===s&&e.data===i&&e.pageSize===r&&t.page===n||this.sortData(),void 0!==o&&e.pageOverride!==o&&o!==n&&(this.setState({page:o},()=>this.props.onPageChange(this.state.page)),this.sortData()),e.pageSize!==r&&this.setState({page:0},()=>this.props.onPageChange(this.state.page))}render(){let{container:e,className:t,title:a,bar:i,children:r,pageSize:o=0,width:n,height:l,rowHeight:d,loading:h,loadingRowCount:p=5,columns:c,paginationArrowsClassName:g,isLazyDataFetch:u,paginationLoading:m,useSmallHeaders:x,...f}=this.props,{page:v}=this.state,P=this.props.sortState||this.state.sortState,w=h?[...Array(p)].map((e,t)=>({[f.rowKey]:o*v+t})):this.state.data,L=h?c.map(e=>({...e,cellRenderer:void 0})):c,b=this.props.showFirstAndLastControls&&this.props.totalResults;return(0,s.jsx)(S,{container:e,className:t,title:a,bar:i,onPreviousPage:this.handlePreviousPage,onNextPage:this.handleNextPage,handleFirstPage:b?this.handleFirstPage:void 0,handleLastPage:b?this.handleLastPage:void 0,pageSize:h&&!u?0:o,height:l,rowHeight:d,handleColumnSort:this.handleColumnSort,paginationArrowsClassName:g,total:this.props.data.length,columns:L,width:n,"data-testid":this.props["data-testid"],rowRenderer:h?()=>(0,s.jsx)(I,{}):void 0,paginationLoading:m,...f,data:w,page:v,sortState:P,useSmallHeaders:x,children:r})}constructor(...e){var t,a;super(...e),t=this,this.state={data:this.props.data,page:0,sortState:null!==(a=this.props.defaultSortState)&&void 0!==a?a:{}},this.getColumnsProp=(0,o.Z)(e=>e.map(e=>({...e,sortable:!!e.sortable}))),this.handleColumnSort=e=>{let{key:t}=e,{sortState:a}=this.state,s={};a[t]?a[t]===r.As.DESC&&(s={[t]:r.As.ASC}):s={[t]:r.As.DESC},this.props.multiColumnSortable&&(s=(0,n.Z)({},a,s)),a[t]===r.As.ASC&&delete s[t],this.props.externalSort?(this.props.externalSort(s),this.setState({sortState:s})):this.sortData(s)},this.handleNextPage=()=>{!this.props.isLazyDataFetch&&this.props.pageSize&&(1+this.state.page)*this.props.pageSize>this.props.data.length-1||this.props.isLazyDataFetch&&this.props.loading||this.setState({page:this.state.page+1},()=>this.props.onPageChange(this.state.page))},this.handlePreviousPage=()=>{this.state.page<=0||this.setState({page:this.state.page-1},()=>this.props.onPageChange(this.state.page))},this.handleFirstPage=()=>{if(this.props.isLazyDataFetch&&this.props.loading)return;let e=this.props.zeroBasedPageIndex?0:1;this.setState({page:e},()=>this.props.onPageChange(e))},this.handleLastPage=()=>{var e,t;if(this.props.isLazyDataFetch&&this.props.loading)return;let a=Math.ceil((null!==(e=this.props.totalResults)&&void 0!==e?e:0)/(null!==(t=this.props.pageSize)&&void 0!==t?t:0))-(this.props.zeroBasedPageIndex?1:0);this.setState({page:a},()=>this.props.onPageChange(a))},this.sliceData=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.props.data,{pageSize:a}=t.props,{page:s}=t.state;return a?e.slice(s*a,(1+s)*a):e},this.sortData=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.props.sortState||t.state.sortState,{columns:a}=t.props;if(t.props.externalSort){t.setState({data:t.props.data,sortState:e});return}let{keys:s,directions:i}=Object.entries(e).reduce((e,s)=>{var i,o;let[n,l]=s,d=null===(i=t.props.columns)||void 0===i?void 0:i.find(e=>e.key===n),h=null===(o=t.props.columns)||void 0===o?void 0:o.findIndex(e=>e.key===n);return!t.props.externalSort&&d&&l&&("function"==typeof d.sortable?e.keys.push((e,t)=>d.sortable({columns:a,column:d,columnIndex:h,rowData:e,rowIndex:t})):"dataKey"in d?e.keys.push(d.dataKey):e.keys.push((e,t)=>d.dataGetter({columns:a,column:d,columnIndex:h,rowData:e,rowIndex:t})),e.directions.push(l===r.As.ASC?"asc":"desc")),e},{keys:[],directions:[]});if(!s.length){t.setState({sortState:e,data:t.sliceData()});return}t.setState({data:t.sliceData(function(e,t,a){let s=-1,i=e.map((e,a)=>{let i=t.map(t=>"function"==typeof t?t(e,a):e[t]);return{criteria:i,index:++s,value:e}});return i.sort((e,t)=>R(e,t,a)).map(e=>e.value)}(t.props.data,s,i)),sortState:e})}}}M.defaultProps={container:!0,columns:[],headerHeight:40,rowHeight:48,multiColumnSortable:!1,onPageChange:()=>{},isLazyDataFetch:!1}},68477:function(e){e.exports={"react-root":"LoadingPlaceholder_react-root__aa4XA",loadingPlaceholder:"LoadingPlaceholder_loadingPlaceholder__Fh21b",placeHolderShimmer:"LoadingPlaceholder_placeHolderShimmer__wCD9m"}},15555:function(e){e.exports={actionList:"ActionList_actionList__h4WOA",actionItem:"ActionList_actionItem__73lLR",actionText:"ActionList_actionText__yW_S2"}},54587:function(e){e.exports={indexesWrapper:"Pagination_indexesWrapper__EEsTF",loading:"Pagination_loading__XaTl2",simple:"Pagination_simple__pxxwh",simpleIndexes:"Pagination_simpleIndexes__KfHIj",simpleArrowLeft:"Pagination_simpleArrowLeft__H4Up8",simpleArrowRight:"Pagination_simpleArrowRight__yhY5a",doubleArrow:"Pagination_doubleArrow__BM4ND"}},52295:function(e){e.exports={loadingRow:"LoadingRow_loadingRow__fVmIW"}}}]); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.