1 | {"version":3,"file":"gridjs.module.js","sources":["../src/types.ts","../node_modules/preact/dist/preact.module.js","../src/util/id.ts","../src/base.ts","../src/view/htmlElement.tsx","../src/util/html.ts","../src/cell.ts","../src/pipeline/processor.ts","../src/row.ts","../src/tabular.ts","../src/util/array.ts","../src/util/eventEmitter.ts","../src/util/deepEqual.ts","../src/pipeline/filter/globalSearch.ts","../src/operator/search.ts","../src/util/className.ts","../src/pipeline/filter/serverGlobalSearch.ts","../node_modules/preact/hooks/dist/hooks.module.js","../src/hooks/useConfig.ts","../src/i18n/en_US.ts","../src/i18n/language.ts","../src/view/plugin/search/actions.ts","../src/hooks/useStore.ts","../src/hooks/useSelector.ts","../src/view/plugin/search/search.tsx","../src/util/debounce.ts","../src/pipeline/limit/pagination.ts","../src/pipeline/limit/serverPagination.ts","../src/view/plugin/pagination.tsx","../src/util/width.ts","../src/view/table/shadow.tsx","../src/util/string.ts","../src/plugin.ts","../src/util/log.ts","../src/header.ts","../src/storage/storage.ts","../src/storage/memory.ts","../src/storage/server.ts","../src/storage/storageUtils.ts","../src/pipeline/pipeline.ts","../src/pipeline/extractor/storage.ts","../src/pipeline/transformer/arrayToTabular.ts","../src/pipeline/initiator/server.ts","../src/pipeline/transformer/storageResponseToArray.ts","../src/pipeline/pipelineUtils.ts","../src/state/store.ts","../src/config.ts","../src/view/table/td.tsx","../src/view/table/tr.tsx","../src/view/table/messageRow.tsx","../src/view/table/tbody.tsx","../src/pipeline/sort/native.ts","../src/view/plugin/sort/actions.ts","../src/pipeline/sort/server.ts","../src/view/plugin/sort/sort.tsx","../src/util/throttle.ts","../src/view/plugin/resize/resize.tsx","../src/view/table/th.tsx","../src/view/table/thead.tsx","../src/util/table.ts","../src/view/actions.ts","../src/view/table/table.tsx","../src/view/headerContainer.tsx","../src/view/footerContainer.tsx","../src/view/container.tsx","../src/grid.ts"],"sourcesContent":["import { ComponentChild } from 'preact';\nimport Row from './row';\nimport { SortConfig } from './view/plugin/sort/sort';\nimport { JSXInternal } from 'preact/src/jsx';\nimport { Plugin } from './plugin';\n\nexport type OneDArray<T> = T[];\nexport type TwoDArray<T> = T[][];\n\n/**\n * Table cell types\n */\nexport type TCell = number | string | boolean | ComponentChild | HTMLElement;\n// Array of Arrays\nexport type TDataArrayRow = OneDArray<TCell>;\nexport type TDataArray = OneDArray<TDataArrayRow>;\n// Array of Objects\nexport type TDataObjectRow = { [key: string]: TCell };\nexport type TDataObject = OneDArray<TDataObjectRow>;\n// (Array of Arrays) and (Array of Objects)\nexport type TData = TDataArray | TDataObject;\n\n// Table header cell type\nexport interface TColumn {\n id?: string;\n // default data for all columns\n data?: ((row: TDataArrayRow | TDataObjectRow) => TCell) | TCell;\n // column label\n name?: string | ComponentChild;\n plugin?: Plugin<any>;\n // column width\n width?: string;\n minWidth?: string;\n sort?: SortConfig;\n columns?: OneDArray<TColumn>;\n resizable?: boolean;\n hidden?: boolean;\n formatter?: (cell: TCell, row: Row, column: TColumn) => ComponentChild;\n // HTML attributes to be added to all cells and header of this column\n attributes?:\n | ((\n // this is null when `attributes` is called for a th\n cell: TCell | null,\n row: Row | null,\n column: TColumn,\n ) => JSXInternal.HTMLAttributes<HTMLTableCellElement>)\n | JSXInternal.HTMLAttributes<HTMLTableCellElement>;\n}\n\n// Comparator function for the sorting plugin\nexport type Comparator<T> = (a: T, b: T) => number;\n\nexport interface TColumnSort {\n index: number;\n // 1 ascending, -1 descending\n direction?: 1 | -1;\n}\n\n// container status\nexport enum Status {\n Init,\n Loading,\n Loaded,\n Rendered,\n Error,\n}\n\nexport type CSSDeclaration = {\n [key: string]: string | number;\n};\n","var n,l,u,i,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n)}function h(l,u,i){var t,o,r,f={};for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v(l,f,t,o,null)}function v(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function y(){return{current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?_(n):null}function k(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k(n)}}function b(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||setTimeout)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_(t):o,t.__h),z(u,t),t.__e!=o&&k(t)))})}function w(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||\"boolean\"==typeof k?null:\"string\"==typeof k||\"number\"==typeof k||\"bigint\"==typeof k?v(null,k,null,null,k):Array.isArray(k)?v(p,{children:k},null,null,null):k.__b>0?v(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null}j(n,k,d=d||f,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),\"function\"==typeof k.type&&k.__k===d.__k?k.__d=s=m(k,s,n):s=A(n,k,d,x,b,s),\"function\"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_(d))}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h])}function m(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l=\"function\"==typeof i.type?m(i,l,u):A(u,i,i,t,i.__e,l));return l}function x(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(Array.isArray(n)?n.some(function(n){x(n,l)}):l.push(n)),l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)\"children\"===o||\"key\"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&\"function\"!=typeof l[o]||\"children\"===o||\"key\"===o||\"value\"===o||\"checked\"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){\"-\"===l[0]?n.setProperty(l,u):n[l]=null==u?\"\":\"number\"!=typeof u||c.test(l)?u:u+\"px\"}function H(n,l,u,i,t){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof i&&(n.style.cssText=i=\"\"),i)for(l in i)u&&l in u||$(n.style,l,\"\");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/Capture$/,\"\")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if(\"dangerouslySetInnerHTML\"!==l){if(t)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"href\"!==l&&\"list\"!==l&&\"form\"!==l&&\"tabIndex\"!==l&&\"download\"!==l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&-1==l.indexOf(\"-\")?n.removeAttribute(l):n.setAttribute(l,u))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);try{n:if(\"function\"==typeof T){if(g=u.props,m=(a=T.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:(\"prototype\"in T&&T.prototype.render?u.__c=h=new T(g,x):(u.__c=h=new d(g,x),h.constructor=T,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,T.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==T.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){for(h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k)})}if(h.context=x,h.props=g,h.__v=u,h.__P=n,C=l.__r,$=0,\"prototype\"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),I=null!=a&&a.type===p&&null==a.key?a.props.children:a,w(n,Array.isArray(I)?I:[I],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l.diffed)&&a(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if(\"svg\"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&\"setAttribute\"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS(\"http://www.w3.org/2000/svg\",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),h=(y=i.props||f).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||\"\"))}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w(l,Array.isArray(k)?k:[k],u,i,t,o&&\"foreignObject\"!==d,r,e,r?r[0]:i.__k&&_(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a(r[k]);c||(\"value\"in p&&void 0!==(k=p.value)&&(k!==l.value||\"progress\"===d&&!k||\"option\"===d&&k!==y.value)&&H(l,\"value\",k,y.value,!1),\"checked\"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,\"checked\",k,y.checked,!1))}return l}function M(n,u,i){try{\"function\"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null,n.__c=void 0}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,i||\"function\"!=typeof n.type);i||null==n.__e||a(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l.__&&l.__(u,i),r=(o=\"function\"==typeof t)?null:t&&t.__k||i.__k,e=[],j(i,u=(!o&&t||i).__k=h(p,null,[u]),r||f,f,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z(e,u)}function S(n,l){P(n,l,S)}function q(l,u,i){var t,o,r,f=s({},l.props);for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),v(l.type,f,t||l.key,o||l.ref,null)}function B(n,l){var u={__c:l=\"__cC\"+r++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),\"function\"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b(this))},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b(this))},d.prototype.render=p,t=[],g.__r=0,r=0;export{d as Component,p as Fragment,q as cloneElement,B as createContext,h as createElement,y as createRef,h,S as hydrate,i as isValidElement,l as options,P as render,x as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","export type ID = string;\n\nexport function generateUUID(): ID {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n","import { generateUUID, ID } from './util/id';\n\nclass Base {\n private readonly _id: ID;\n\n constructor(id?: ID) {\n this._id = id || generateUUID();\n }\n\n get id(): ID {\n return this._id;\n }\n}\n\nexport default Base;\n","import { h } from 'preact';\n\nexport interface HTMLContentProps {\n content: string;\n parentElement?: string;\n}\n\nexport function HTMLElement(props: HTMLContentProps) {\n return h(props.parentElement || 'span', {\n dangerouslySetInnerHTML: { __html: props.content },\n });\n}\n","import { h, VNode } from 'preact';\nimport { HTMLElement } from '../view/htmlElement';\n\nexport function decode(content: string): string {\n const value = new DOMParser().parseFromString(content, 'text/html');\n return value.documentElement.textContent;\n}\n\nexport function html(content: string, parentElement?: string): VNode {\n return h(HTMLElement, { content: content, parentElement: parentElement });\n}\n","import Base from './base';\nimport { TCell } from './types';\nimport { html } from './util/html';\nimport { ComponentChild } from 'preact';\n\nclass Cell extends Base {\n // because a Cell is a subset of TCell type\n public data: number | string | boolean | ComponentChild;\n\n constructor(data: TCell) {\n super();\n\n this.update(data);\n }\n\n private cast(data: TCell): number | string | boolean | ComponentChild {\n if (data instanceof HTMLElement) {\n return html(data.outerHTML);\n }\n\n return data;\n }\n\n /**\n * Updates the Cell's data\n *\n * @param data\n */\n public update(data: TCell): Cell {\n this.data = this.cast(data);\n return this;\n }\n}\n\nexport default Cell;\n","// The order of enum items define the processing order of the processor type\n// e.g. Extractor = 0 will be processed before Transformer = 1\nimport { generateUUID, ID } from '../util/id';\nimport { EventEmitter } from '../util/eventEmitter';\nimport { deepEqual } from '../util/deepEqual';\n\nexport enum ProcessorType {\n Initiator,\n ServerFilter,\n ServerSort,\n ServerLimit,\n Extractor,\n Transformer,\n Filter,\n Sort,\n Limit,\n}\n\ninterface PipelineProcessorEvents {\n propsUpdated: <T, P>(processor: PipelineProcessor<T, P>) => void;\n beforeProcess: (...args) => void;\n afterProcess: (...args) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PipelineProcessorProps {}\n\nexport abstract class PipelineProcessor<\n T,\n P extends Partial<PipelineProcessorProps>,\n> extends EventEmitter<PipelineProcessorEvents> {\n public readonly id: ID;\n private _props: P;\n\n abstract get type(): ProcessorType;\n protected abstract _process(...args): T | Promise<T>;\n protected validateProps?(...args): void;\n\n constructor(props?: Partial<P>) {\n super();\n\n this._props = {} as P;\n this.id = generateUUID();\n\n if (props) this.setProps(props);\n }\n\n /**\n * process is used to call beforeProcess and afterProcess callbacks\n * This function is just a wrapper that calls _process()\n *\n * @param args\n */\n process(...args): T | Promise<T> {\n if (this.validateProps instanceof Function) {\n this.validateProps(...args);\n }\n\n this.emit('beforeProcess', ...args);\n const result = this._process(...args);\n this.emit('afterProcess', ...args);\n return result;\n }\n\n setProps(props: Partial<P>): this {\n const updatedProps = {\n ...this._props,\n ...props,\n };\n\n if (!deepEqual(updatedProps, this._props)) {\n this._props = updatedProps;\n this.emit('propsUpdated', this);\n }\n\n return this;\n }\n\n get props(): P {\n return this._props;\n }\n}\n","import Cell from './cell';\nimport Base from './base';\nimport { TCell } from './types';\n\nclass Row extends Base {\n private _cells: Cell[];\n\n constructor(cells?: Cell[]) {\n super();\n\n this.cells = cells || [];\n }\n\n public cell(index: number): Cell {\n return this._cells[index];\n }\n\n public get cells(): Cell[] {\n return this._cells;\n }\n\n public set cells(cells: Cell[]) {\n this._cells = cells;\n }\n\n public toArray(): TCell[] {\n return this.cells.map((cell) => cell.data);\n }\n\n /**\n * Creates a new Row from an array of Cell(s)\n * This method generates a new ID for the Row and all nested elements\n *\n * @param cells\n * @returns Row\n */\n static fromCells(cells: Cell[]): Row {\n return new Row(cells.map((cell) => new Cell(cell.data)));\n }\n\n get length(): number {\n return this.cells.length;\n }\n}\n\nexport default Row;\n","import Base from './base';\nimport Row from './row';\nimport Cell from './cell';\nimport { OneDArray, TCell, TwoDArray } from './types';\nimport { oneDtoTwoD } from './util/array';\n\nclass Tabular extends Base {\n private _rows: Row[];\n private _length: number;\n\n constructor(rows?: Row[] | Row) {\n super();\n\n if (rows instanceof Array) {\n this.rows = rows;\n } else if (rows instanceof Row) {\n this.rows = [rows];\n } else {\n this.rows = [];\n }\n }\n\n get rows(): Row[] {\n return this._rows;\n }\n\n set rows(rows: Row[]) {\n this._rows = rows;\n }\n\n get length(): number {\n return this._length || this.rows.length;\n }\n\n // we want to sent the length when storage is ServerStorage\n set length(len: number) {\n this._length = len;\n }\n\n public toArray(): TCell[][] {\n return this.rows.map((row) => row.toArray());\n }\n\n /**\n * Creates a new Tabular from an array of Row(s)\n * This method generates a new ID for the Tabular and all nested elements\n *\n * @param rows\n * @returns Tabular\n */\n static fromRows(rows: Row[]): Tabular {\n return new Tabular(rows.map((row) => Row.fromCells(row.cells)));\n }\n\n /**\n * Creates a new Tabular from a 2D array\n * This method generates a new ID for the Tabular and all nested elements\n *\n * @param data\n * @returns Tabular\n */\n static fromArray<T extends TCell>(\n data: OneDArray<T> | TwoDArray<T>,\n ): Tabular {\n data = oneDtoTwoD(data);\n\n return new Tabular(\n data.map((row) => new Row(row.map((cell) => new Cell(cell)))),\n );\n }\n}\n\nexport default Tabular;\n","import { OneDArray, TwoDArray } from '../types';\n\nexport function oneDtoTwoD<T>(data: OneDArray<T> | TwoDArray<T>): TwoDArray<T> {\n if (data[0] && !(data[0] instanceof Array)) {\n return [data] as TwoDArray<T>;\n }\n\n return data as TwoDArray<T>;\n}\n\nexport function flatten<T>(arrays: TwoDArray<T>): OneDArray<T> {\n return arrays.reduce((prev, x) => prev.concat(x), []);\n}\n","type EventArgs<T> = [T] extends [(...args: infer U) => any]\n ? U\n : [T] extends [void]\n ? []\n : [T];\n\n/**\n * Example:\n *\n * export interface BaseEvents<P, S> {\n * SET_STATE: (component: BaseComponent<P, S>, state: S) => void;\n * }\n */\n\nexport interface EventEmitter<EventTypes> {\n addListener<EventName extends keyof EventTypes>(\n event: EventName,\n listener: (...args: EventArgs<EventTypes[EventName]>) => void,\n ): EventEmitter<EventTypes>;\n\n on<EventName extends keyof EventTypes>(\n event: EventName,\n listener: (...args: EventArgs<EventTypes[EventName]>) => void,\n ): EventEmitter<EventTypes>;\n\n off<EventName extends keyof EventTypes>(\n event: EventName,\n listener: (...args: EventArgs<EventTypes[EventName]>) => void,\n ): EventEmitter<EventTypes>;\n\n emit<EventName extends keyof EventTypes>(\n event: EventName,\n ...args: EventArgs<EventTypes[EventName]>\n ): boolean;\n}\n\nexport class EventEmitter<EventTypes> {\n private callbacks: { [event: string]: ((...args) => void)[] };\n\n // because we are using EventEmitter as a mixin and the\n // constructor won't be called by the applyMixins function\n // see src/base.ts and src/util/applyMixin.ts\n private init(event?: string): void {\n if (!this.callbacks) {\n this.callbacks = {};\n }\n\n if (event && !this.callbacks[event]) {\n this.callbacks[event] = [];\n }\n }\n\n listeners(): { [event: string]: ((...args) => void)[] } {\n return this.callbacks;\n }\n\n on<EventName extends keyof EventTypes>(\n event: EventName,\n listener: (...args: EventArgs<EventTypes[EventName]>) => void,\n ): EventEmitter<EventTypes> {\n this.init(event as string);\n this.callbacks[event as string].push(listener);\n return this;\n }\n\n off<EventName extends keyof EventTypes>(\n event: EventName,\n listener: (...args: EventArgs<EventTypes[EventName]>) => void,\n ): EventEmitter<EventTypes> {\n const eventName = event as string;\n\n this.init();\n\n if (!this.callbacks[eventName] || this.callbacks[eventName].length === 0) {\n // there is no callbacks with this key\n return this;\n }\n\n this.callbacks[eventName] = this.callbacks[eventName].filter(\n (value) => value != listener,\n );\n\n return this;\n }\n\n emit<EventName extends keyof EventTypes>(\n event: EventName,\n ...args: EventArgs<EventTypes[EventName]>\n ): boolean {\n const eventName = event as string;\n\n this.init(eventName);\n\n if (this.callbacks[eventName].length > 0) {\n this.callbacks[eventName].forEach((value) => value(...args));\n return true;\n }\n\n return false;\n }\n}\n","/**\n * Returns true if both objects are equal\n * @param a left object\n * @param b right object\n * @returns\n */\nexport function deepEqual<A, B>(obj1: A, obj2: B) {\n // If objects are not the same type, return false\n if (typeof obj1 !== typeof obj2) {\n return false;\n }\n // If objects are both null or undefined, return true\n if (obj1 === null && obj2 === null) {\n return true;\n }\n // If objects are both primitive types, compare them directly\n if (typeof obj1 !== 'object') {\n // eslint-disable-next-line\n // @ts-ignore\n return obj1 === obj2;\n }\n // If objects are arrays, compare their elements recursively\n if (Array.isArray(obj1) && Array.isArray(obj2)) {\n if (obj1.length !== obj2.length) {\n return false;\n }\n for (let i = 0; i < obj1.length; i++) {\n if (!deepEqual(obj1[i], obj2[i])) {\n return false;\n }\n }\n return true;\n }\n // If objects are VNodes, compare their props only\n if (\n // eslint-disable-next-line no-prototype-builtins\n obj1.hasOwnProperty('constructor') &&\n // eslint-disable-next-line no-prototype-builtins\n obj2.hasOwnProperty('constructor') &&\n // eslint-disable-next-line no-prototype-builtins\n obj1.hasOwnProperty('props') &&\n // eslint-disable-next-line no-prototype-builtins\n obj2.hasOwnProperty('props') &&\n // eslint-disable-next-line no-prototype-builtins\n obj1.hasOwnProperty('key') &&\n // eslint-disable-next-line no-prototype-builtins\n obj2.hasOwnProperty('key') &&\n // eslint-disable-next-line no-prototype-builtins\n obj1.hasOwnProperty('ref') &&\n // eslint-disable-next-line no-prototype-builtins\n obj2.hasOwnProperty('ref') &&\n // eslint-disable-next-line no-prototype-builtins\n obj1.hasOwnProperty('type') &&\n // eslint-disable-next-line no-prototype-builtins\n obj2.hasOwnProperty('type')\n ) {\n return deepEqual(obj1['props'], obj2['props']);\n }\n // If objects are both objects, compare their properties recursively\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n // eslint-disable-next-line no-prototype-builtins\n if (!obj2.hasOwnProperty(key) || !deepEqual(obj1[key], obj2[key])) {\n return false;\n }\n }\n return true;\n}\n","import search from '../../operator/search';\nimport Tabular from '../../tabular';\nimport {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { OneDArray, TCell, TColumn } from '../../types';\n\ninterface GlobalSearchFilterProps extends PipelineProcessorProps {\n keyword: string;\n columns: OneDArray<TColumn>;\n ignoreHiddenColumns: boolean;\n selector?: (cell: TCell, rowIndex: number, cellIndex: number) => string;\n}\n\nclass GlobalSearchFilter extends PipelineProcessor<\n Tabular,\n GlobalSearchFilterProps\n> {\n get type(): ProcessorType {\n return ProcessorType.Filter;\n }\n\n _process(data: Tabular): Tabular {\n if (this.props.keyword) {\n return search(\n String(this.props.keyword).trim(),\n this.props.columns,\n this.props.ignoreHiddenColumns,\n data,\n this.props.selector,\n );\n }\n\n return data;\n }\n}\n\nexport default GlobalSearchFilter;\n","import Tabular from '../tabular';\nimport { VNode } from 'preact';\nimport { HTMLContentProps } from '../view/htmlElement';\nimport { OneDArray, TCell, TColumn } from '../types';\n\nexport default function (\n keyword: string,\n columns: OneDArray<TColumn>,\n ignoreHiddenColumns: boolean,\n tabular: Tabular,\n selector?: (cell: TCell, rowIndex: number, cellIndex: number) => string,\n): Tabular {\n // escape special regex chars\n keyword = keyword.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n\n return new Tabular(\n tabular.rows.filter((row, rowIndex) =>\n row.cells.some((cell, cellIndex) => {\n if (!cell) {\n return false;\n }\n\n if (ignoreHiddenColumns) {\n if (\n columns &&\n columns[cellIndex] &&\n typeof columns[cellIndex] === 'object'\n ) {\n const typedColumn = columns[cellIndex] as TColumn;\n if (typedColumn.hidden) {\n return false;\n }\n }\n }\n\n let data = '';\n\n if (typeof selector === 'function') {\n data = selector(cell.data, rowIndex, cellIndex);\n } else if (typeof cell.data === 'object') {\n // HTMLContent element\n const element = cell.data as VNode<HTMLContentProps>;\n if (element && element.props && element.props.content) {\n // TODO: we should only search in the content of the element. props.content is the entire HTML element\n data = element.props.content;\n }\n } else {\n // primitive types\n data = String(cell.data);\n }\n\n return new RegExp(keyword, 'gi').test(data);\n }),\n ),\n );\n}\n","import { JSXInternal } from 'preact/src/jsx';\n\nexport function className(...args: string[]): string {\n const prefix = 'gridjs';\n\n return `${prefix}${args.reduce(\n (prev: string, cur: string) => `${prev}-${cur}`,\n '',\n )}`;\n}\n\nexport function classJoin(\n ...classNames: (undefined | string | JSXInternal.SignalLike<string>)[]\n): string {\n return classNames\n .map((x) => (x ? x.toString() : ''))\n .filter((x) => x)\n .reduce((className, prev) => `${className || ''} ${prev}`, '')\n .trim();\n}\n","import {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { ServerStorageOptions } from '../../storage/server';\n\ninterface ServerGlobalSearchFilterProps extends PipelineProcessorProps {\n keyword?: string;\n url?: (prevUrl: string, keyword: string) => string;\n body?: (prevBody: BodyInit, keyword: string) => BodyInit;\n}\n\nclass ServerGlobalSearchFilter extends PipelineProcessor<\n ServerStorageOptions,\n ServerGlobalSearchFilterProps\n> {\n get type(): ProcessorType {\n return ProcessorType.ServerFilter;\n }\n\n _process(options?: ServerStorageOptions): ServerStorageOptions {\n if (!this.props.keyword) return options;\n\n const updates = {};\n\n if (this.props.url) {\n updates['url'] = this.props.url(options.url, this.props.keyword);\n }\n\n if (this.props.body) {\n updates['body'] = this.props.body(options.body, this.props.keyword);\n }\n\n return {\n ...options,\n ...updates,\n };\n }\n}\n\nexport default ServerGlobalSearchFilter;\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=[],e=n.__b,a=n.__r,v=n.diffed,l=n.__c,m=n.unmount;function d(t,u){n.__h&&n.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function p(n){return o=1,y(B,n)}function y(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){r.u=!0;var f=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return!n.__N}))return!f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))}}return o.__N||o.__}function h(u,i){var o=d(t++,3);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o))}function s(u,i){var o=d(t++,4);!n.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__h.push(o))}function _(n){return o=5,F(function(){return{current:n}},[])}function A(n,t,r){o=6,s(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function x(t,r){n.useDebugValue&&n.useDebugValue(r?r(t):t)}function P(n){var u=d(t++,10),i=p();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function V(){var n=d(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[]}catch(r){t.__H.__h=[],n.__e(r,t.__v)}}n.__b=function(n){r=null,e&&e(n)},n.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r},n.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===n.requestAnimationFrame||((i=n.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c})),u=r=null},n.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return!n.__||w(n)})}catch(u){r.some(function(n){n.__h&&(n.__h=[])}),r=[],n.__e(u,t.__v)}}),l&&l(t,r)},n.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n)}catch(n){r=n}}),u.__H=void 0,r&&n.__e(r,u.__v))};var g=\"function\"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r))}function k(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function w(n){var t=r;n.__c=n.__(),r=t}function z(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B(n,t){return\"function\"==typeof t?t(n):t}export{T as useCallback,q as useContext,x as useDebugValue,h as useEffect,P as useErrorBoundary,V as useId,A as useImperativeHandle,s as useLayoutEffect,F as useMemo,y as useReducer,_ as useRef,p as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import { useContext } from 'preact/hooks';\nimport { Config, ConfigContext } from '../config';\n\nexport function useConfig(): Config {\n return useContext(ConfigContext);\n}\n","export default {\n search: {\n placeholder: 'Type a keyword...',\n },\n sort: {\n sortAsc: 'Sort column ascending',\n sortDesc: 'Sort column descending',\n },\n pagination: {\n previous: 'Previous',\n next: 'Next',\n navigate: (page, pages) => `Page ${page} of ${pages}`,\n page: (page) => `Page ${page}`,\n showing: 'Showing',\n of: 'of',\n to: 'to',\n results: 'results',\n },\n loading: 'Loading...',\n noRecordsFound: 'No matching records found',\n error: 'An error happened while fetching the data',\n};\n","import { useConfig } from '../hooks/useConfig';\nimport enUS from './en_US';\ntype MessageFormat = (...args) => string;\ntype Message = string | MessageFormat;\nexport type Language = { [key: string]: Message | Language };\n\nexport class Translator {\n private readonly _language: Language;\n private readonly _defaultLanguage: Language;\n\n constructor(language?: Language) {\n this._language = language;\n this._defaultLanguage = enUS;\n }\n\n /**\n * Tries to split the message with \".\" and find\n * the key in the given language\n *\n * @param message\n * @param lang\n */\n getString(message: string, lang: Language): MessageFormat {\n if (!lang || !message) return null;\n\n const splitted = message.split('.');\n const key = splitted[0];\n\n if (lang[key]) {\n const val = lang[key];\n\n if (typeof val === 'string') {\n return (): string => val;\n } else if (typeof val === 'function') {\n return val;\n } else {\n return this.getString(splitted.slice(1).join('.'), val);\n }\n }\n\n return null;\n }\n\n translate(message: string, ...args): string {\n const translated = this.getString(message, this._language);\n let messageFormat;\n\n if (translated) {\n messageFormat = translated;\n } else {\n messageFormat = this.getString(message, this._defaultLanguage);\n }\n\n if (messageFormat) {\n return messageFormat(...args);\n }\n\n return message;\n }\n}\n\nexport function useTranslator() {\n const config = useConfig();\n\n return function (message: string, ...args): string {\n return config.translator.translate(message, ...args);\n };\n}\n","export const SearchKeyword = (payload) => (state) => {\n return {\n ...state,\n search: {\n keyword: payload,\n },\n };\n};\n","import { useConfig } from './useConfig';\n\nexport function useStore() {\n const config = useConfig();\n return config.store;\n}\n","import { useEffect, useState } from 'preact/hooks';\nimport { useStore } from './useStore';\n\nexport default function useSelector<T>(selector: (state) => T) {\n const store = useStore();\n const [current, setCurrent] = useState(selector(store.getState()));\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() => {\n const updated = selector(store.getState());\n\n if (current !== updated) {\n setCurrent(updated);\n }\n });\n\n return unsubscribe;\n }, []);\n\n return current;\n}\n","import { h, JSX } from 'preact';\nimport GlobalSearchFilter from '../../../pipeline/filter/globalSearch';\nimport { classJoin, className } from '../../../util/className';\nimport ServerGlobalSearchFilter from '../../../pipeline/filter/serverGlobalSearch';\nimport { TCell } from '../../../types';\nimport { useConfig } from '../../../hooks/useConfig';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport { useTranslator } from '../../../i18n/language';\nimport * as actions from './actions';\nimport { useStore } from '../../../hooks/useStore';\nimport useSelector from '../../../hooks/useSelector';\nimport { debounce } from '../../../util/debounce';\n\nexport interface SearchConfig {\n keyword?: string;\n ignoreHiddenColumns?: boolean;\n debounceTimeout?: number;\n selector?: (cell: TCell, rowIndex: number, cellIndex: number) => string;\n server?: {\n url?: (prevUrl: string, keyword: string) => string;\n body?: (prevBody: BodyInit, keyword: string) => BodyInit;\n };\n}\n\nexport function Search() {\n const [processor, setProcessor] = useState<\n GlobalSearchFilter | ServerGlobalSearchFilter\n >(undefined);\n const config = useConfig();\n const props = config.search as SearchConfig;\n const _ = useTranslator();\n const { dispatch } = useStore();\n const state = useSelector((state) => state.search);\n\n useEffect(() => {\n if (!processor) return;\n\n processor.setProps({\n keyword: state?.keyword,\n });\n }, [state, processor]);\n\n useEffect(() => {\n if (props.server) {\n setProcessor(\n new ServerGlobalSearchFilter({\n keyword: props.keyword,\n url: props.server.url,\n body: props.server.body,\n }),\n );\n } else {\n setProcessor(\n new GlobalSearchFilter({\n keyword: props.keyword,\n columns: config.header && config.header.columns,\n ignoreHiddenColumns:\n props.ignoreHiddenColumns ||\n props.ignoreHiddenColumns === undefined,\n selector: props.selector,\n }),\n );\n }\n\n // initial search\n if (props.keyword) dispatch(actions.SearchKeyword(props.keyword));\n }, [props]);\n\n useEffect(() => {\n if (!processor) return undefined;\n\n config.pipeline.register<object, object>(processor);\n\n return () => config.pipeline.unregister<object, object>(processor);\n }, [config, processor]);\n\n const debouncedOnInput = useCallback(\n debounce(\n (event: JSX.TargetedEvent<HTMLInputElement>) => {\n if (event.target instanceof HTMLInputElement) {\n dispatch(actions.SearchKeyword(event.target.value));\n }\n },\n processor instanceof ServerGlobalSearchFilter\n ? props.debounceTimeout || 250\n : 0,\n ),\n [props, processor],\n );\n\n return (\n <div className={className(classJoin('search', config.className?.search))}>\n <input\n type=\"search\"\n placeholder={_('search.placeholder')}\n aria-label={_('search.placeholder')}\n onInput={debouncedOnInput}\n className={classJoin(className('input'), className('search', 'input'))}\n defaultValue={state?.keyword || ''}\n />\n </div>\n );\n}\n","export const debounce = <F extends (...args: any[]) => any>(\n func: F,\n waitFor: number,\n) => {\n let timeout;\n\n return (...args: Parameters<F>): Promise<ReturnType<F>> =>\n new Promise((resolve) => {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n timeout = setTimeout(() => resolve(func(...args)), waitFor);\n });\n};\n","import Tabular from '../../tabular';\nimport {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\n\ninterface PaginationLimitProps extends PipelineProcessorProps {\n page: number;\n limit: number;\n}\n\nclass PaginationLimit extends PipelineProcessor<Tabular, PaginationLimitProps> {\n protected validateProps(): void {\n if (isNaN(Number(this.props.limit)) || isNaN(Number(this.props.page))) {\n throw Error('Invalid parameters passed');\n }\n }\n\n get type(): ProcessorType {\n return ProcessorType.Limit;\n }\n\n protected _process(data: Tabular): Tabular {\n const page = this.props.page;\n const start = page * this.props.limit;\n const end = (page + 1) * this.props.limit;\n\n return new Tabular(data.rows.slice(start, end));\n }\n}\n\nexport default PaginationLimit;\n","import {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { ServerStorageOptions } from '../../storage/server';\n\ninterface ServerPaginationLimitProps extends PipelineProcessorProps {\n page: number;\n limit: number;\n url?: (prevUrl: string, page: number, limit: number) => string;\n body?: (prevBody: BodyInit, page: number, limit: number) => BodyInit;\n}\n\nclass ServerPaginationLimit extends PipelineProcessor<\n ServerStorageOptions,\n ServerPaginationLimitProps\n> {\n get type(): ProcessorType {\n return ProcessorType.ServerLimit;\n }\n\n _process(options?: ServerStorageOptions): ServerStorageOptions {\n const updates = {};\n\n if (this.props.url) {\n updates['url'] = this.props.url(\n options.url,\n this.props.page,\n this.props.limit,\n );\n }\n\n if (this.props.body) {\n updates['body'] = this.props.body(\n options.body,\n this.props.page,\n this.props.limit,\n );\n }\n\n return {\n ...options,\n ...updates,\n };\n }\n}\n\nexport default ServerPaginationLimit;\n","import { h, Fragment } from 'preact';\nimport PaginationLimit from '../../pipeline/limit/pagination';\nimport { classJoin, className } from '../../util/className';\nimport ServerPaginationLimit from '../../pipeline/limit/serverPagination';\nimport { useConfig } from '../../hooks/useConfig';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useTranslator } from '../../i18n/language';\n\nexport interface PaginationConfig {\n limit?: number;\n page?: number;\n summary?: boolean;\n nextButton?: boolean;\n prevButton?: boolean;\n buttonsCount?: number;\n resetPageOnUpdate?: boolean;\n server?: {\n url?: (prevUrl: string, page: number, limit: number) => string;\n body?: (prevBody: BodyInit, page: number, limit: number) => BodyInit;\n };\n}\n\nexport function Pagination() {\n const config = useConfig();\n const {\n server,\n summary = true,\n nextButton = true,\n prevButton = true,\n buttonsCount = 3,\n limit = 10,\n page = 0,\n resetPageOnUpdate = true,\n } = config.pagination as PaginationConfig;\n\n const processor = useRef<PaginationLimit | ServerPaginationLimit>(null);\n const [currentPage, setCurrentPage] = useState(page);\n const [total, setTotal] = useState(0);\n const _ = useTranslator();\n\n useEffect(() => {\n if (server) {\n processor.current = new ServerPaginationLimit({\n limit: limit,\n page: currentPage,\n url: server.url,\n body: server.body,\n });\n\n config.pipeline.register(processor.current);\n } else {\n processor.current = new PaginationLimit({\n limit: limit,\n page: currentPage,\n });\n\n config.pipeline.register(processor.current);\n }\n\n if (processor.current instanceof ServerPaginationLimit) {\n config.pipeline.on('afterProcess', (tabular) => setTotal(tabular.length));\n } else if (processor.current instanceof PaginationLimit) {\n // Pagination (all Limit processors) is the last step in the pipeline\n // and we assume that at this stage, we have the rows that we care about.\n // Let's grab the rows before processing Pagination and set total number of rows\n processor.current.on('beforeProcess', (tabular) =>\n setTotal(tabular.length),\n );\n }\n\n config.pipeline.on('updated', onUpdate);\n\n // we need to make sure that the state is set\n // to the default props when an error happens\n config.pipeline.on('error', () => {\n setTotal(0);\n setCurrentPage(0);\n });\n\n return () => {\n config.pipeline.unregister<object, object>(processor.current);\n config.pipeline.off('updated', onUpdate);\n };\n }, []);\n\n const onUpdate = (updatedProcessor) => {\n // this is to ensure that the current page is set to 0\n // when a processor is updated for some reason\n if (resetPageOnUpdate && updatedProcessor !== processor.current) {\n setCurrentPage(0);\n\n if (processor.current.props.page !== 0) {\n processor.current.setProps({\n page: 0,\n });\n }\n }\n };\n\n const pages = () => Math.ceil(total / limit);\n\n const setPage = (page: number) => {\n if (page >= pages() || page < 0 || page === currentPage) {\n return null;\n }\n\n setCurrentPage(page);\n\n processor.current.setProps({\n page: page,\n });\n };\n\n const renderPages = () => {\n if (buttonsCount <= 0) {\n return null;\n }\n\n // how many pagination buttons to render?\n const maxCount: number = Math.min(pages(), buttonsCount);\n\n let pagePivot = Math.min(currentPage, Math.floor(maxCount / 2));\n if (currentPage + Math.floor(maxCount / 2) >= pages()) {\n pagePivot = maxCount - (pages() - currentPage);\n }\n\n return (\n <Fragment>\n {pages() > maxCount && currentPage - pagePivot > 0 && (\n <Fragment>\n <button\n tabIndex={0}\n role=\"button\"\n onClick={() => setPage(0)}\n title={_('pagination.firstPage')}\n aria-label={_('pagination.firstPage')}\n className={config.className.paginationButton}\n >\n {_('1')}\n </button>\n <button\n tabIndex={-1}\n className={classJoin(\n className('spread'),\n config.className.paginationButton,\n )}\n >\n ...\n </button>\n </Fragment>\n )}\n\n {Array.from(Array(maxCount).keys())\n .map((i) => currentPage + (i - pagePivot))\n .map((i) => (\n <button\n tabIndex={0}\n role=\"button\"\n onClick={() => setPage(i)}\n className={classJoin(\n currentPage === i\n ? classJoin(\n className('currentPage'),\n config.className.paginationButtonCurrent,\n )\n : null,\n config.className.paginationButton,\n )}\n title={_('pagination.page', i + 1)}\n aria-label={_('pagination.page', i + 1)}\n >\n {_(`${i + 1}`)}\n </button>\n ))}\n\n {pages() > maxCount && pages() > currentPage + pagePivot + 1 && (\n <Fragment>\n <button\n tabIndex={-1}\n className={classJoin(\n className('spread'),\n config.className.paginationButton,\n )}\n >\n ...\n </button>\n <button\n tabIndex={0}\n role=\"button\"\n onClick={() => setPage(pages() - 1)}\n title={_('pagination.page', pages())}\n aria-label={_('pagination.page', pages())}\n className={config.className.paginationButton}\n >\n {_(`${pages()}`)}\n </button>\n </Fragment>\n )}\n </Fragment>\n );\n };\n\n const renderSummary = () => {\n return (\n <Fragment>\n {summary && total > 0 && (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={classJoin(\n className('summary'),\n config.className.paginationSummary,\n )}\n title={_('pagination.navigate', currentPage + 1, pages())}\n >\n {_('pagination.showing')} <b>{_(`${currentPage * limit + 1}`)}</b>{' '}\n {_('pagination.to')}{' '}\n <b>{_(`${Math.min((currentPage + 1) * limit, total)}`)}</b>{' '}\n {_('pagination.of')} <b>{_(`${total}`)}</b>{' '}\n {_('pagination.results')}\n </div>\n )}\n </Fragment>\n );\n };\n\n return (\n <div\n className={classJoin(\n className('pagination'),\n config.className.pagination,\n )}\n >\n {renderSummary()}\n\n <div className={className('pages')}>\n {prevButton && (\n <button\n tabIndex={0}\n role=\"button\"\n disabled={currentPage === 0}\n onClick={() => setPage(currentPage - 1)}\n title={_('pagination.previous')}\n aria-label={_('pagination.previous')}\n className={classJoin(\n config.className.paginationButton,\n config.className.paginationButtonPrev,\n )}\n >\n {_('pagination.previous')}\n </button>\n )}\n\n {renderPages()}\n\n {nextButton && (\n <button\n tabIndex={0}\n role=\"button\"\n disabled={pages() === currentPage + 1 || pages() === 0}\n onClick={() => setPage(currentPage + 1)}\n title={_('pagination.next')}\n aria-label={_('pagination.next')}\n className={classJoin(\n config.className.paginationButton,\n config.className.paginationButtonNext,\n )}\n >\n {_('pagination.next')}\n </button>\n )}\n </div>\n </div>\n );\n}\n","export function width(width: string | number, containerWidth?: number): number {\n if (typeof width == 'string') {\n if (width.indexOf('%') > -1) {\n return (containerWidth / 100) * parseInt(width, 10);\n } else {\n return parseInt(width, 10);\n }\n }\n\n return width;\n}\n\nexport function px(width: number): string {\n if (!width) return '';\n return `${Math.floor(width)}px`;\n}\n","import { h } from 'preact';\nimport { className } from '../../util/className';\n\n/**\n * ShadowTable renders a hidden table and is used to calculate the column's width\n * when autoWidth option is enabled\n */\nexport function ShadowTable(props: { tableRef: HTMLTableElement }) {\n const shadowTable = props.tableRef.cloneNode(true) as HTMLTableElement;\n\n shadowTable.style.position = 'absolute';\n shadowTable.style.width = '100%';\n shadowTable.style.zIndex = '-2147483640';\n shadowTable.style.visibility = 'hidden';\n\n return (\n <div\n ref={(nodeElement) => {\n nodeElement && nodeElement.appendChild(shadowTable);\n }}\n />\n );\n}\n\nexport function getShadowTableWidths(tempRef: HTMLDivElement): {\n [columnId: string]: { minWidth: number; width: number };\n} {\n const tableElement: HTMLTableElement = tempRef.querySelector(\n 'table',\n ) as HTMLTableElement;\n\n if (!tableElement) {\n return {};\n }\n\n const tableClassName = tableElement.className;\n const tableStyle = tableElement.style.cssText;\n tableElement.className = `${tableClassName} ${className('shadowTable')}`;\n\n tableElement.style.tableLayout = 'auto';\n tableElement.style.width = 'auto';\n tableElement.style.padding = '0';\n tableElement.style.margin = '0';\n tableElement.style.border = 'none';\n tableElement.style.outline = 'none';\n\n let obj = Array.from(\n tableElement.parentNode.querySelectorAll<HTMLElement>('thead th'),\n ).reduce((prev, current) => {\n current.style.width = `${current.clientWidth}px`;\n\n return {\n [current.getAttribute('data-column-id')]: {\n minWidth: current.clientWidth,\n },\n ...prev,\n };\n }, {});\n\n tableElement.className = tableClassName;\n tableElement.style.cssText = tableStyle;\n tableElement.style.tableLayout = 'auto';\n\n obj = Array.from(\n tableElement.parentNode.querySelectorAll<HTMLElement>('thead th'),\n ).reduce((prev, current) => {\n prev[current.getAttribute('data-column-id')]['width'] = current.clientWidth;\n\n return prev;\n }, obj);\n\n return obj;\n}\n","export function camelCase(str: string): string {\n if (!str) return '';\n\n const words = str.split(' ');\n\n // do not convert strings that are already in camelCase format\n if (words.length === 1 && /([a-z][A-Z])+/g.test(str)) {\n return str;\n }\n\n return words\n .map(function (word, index) {\n // if it is the first word, lowercase all the chars\n if (index == 0) {\n return word.toLowerCase();\n }\n\n // if it is not the first word only upper case the first char and lowercase the rest\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n","import { Fragment, FunctionComponent, h } from 'preact';\nimport { useConfig } from './hooks/useConfig';\nimport log from './util/log';\n\nexport enum PluginPosition {\n Header,\n Footer,\n Cell,\n}\n\nexport interface Plugin<T extends FunctionComponent> {\n id: string;\n position: PluginPosition;\n component: T;\n order?: number;\n}\n\nexport class PluginManager {\n private readonly plugins: Plugin<any>[];\n\n constructor() {\n this.plugins = [];\n }\n\n get<T extends FunctionComponent>(id: string): Plugin<T> | undefined {\n return this.plugins.find((p) => p.id === id);\n }\n\n add<T extends FunctionComponent<any>>(plugin: Plugin<T>): this {\n if (!plugin.id) {\n log.error('Plugin ID cannot be empty');\n return this;\n }\n\n if (this.get(plugin.id)) {\n log.error(`Duplicate plugin ID: ${plugin.id}`);\n return this;\n }\n\n this.plugins.push(plugin);\n return this;\n }\n\n remove(id: string): this {\n const plugin = this.get(id);\n\n if (plugin) {\n this.plugins.splice(this.plugins.indexOf(plugin), 1);\n }\n\n return this;\n }\n\n list<T extends FunctionComponent>(position?: PluginPosition): Plugin<T>[] {\n let plugins: Plugin<T>[];\n\n if (position != null || position != undefined) {\n plugins = this.plugins.filter((p) => p.position === position);\n } else {\n plugins = this.plugins;\n }\n\n return plugins.sort((a, b) => (a.order && b.order ? a.order - b.order : 1));\n }\n}\n\nexport function PluginRenderer(props: {\n props?: any;\n // to render a single plugin\n pluginId?: string;\n // to render all plugins in this PluginPosition\n position?: PluginPosition;\n}) {\n const config = useConfig();\n\n if (props.pluginId) {\n // render a single plugin\n const plugin = config.plugin.get(props.pluginId);\n\n if (!plugin) return null;\n\n return h(\n Fragment,\n {},\n h(plugin.component, {\n plugin: plugin,\n ...props.props,\n }),\n );\n } else if (props.position !== undefined) {\n // render using a specific plugin position\n return h(\n Fragment,\n {},\n config.plugin.list(props.position).map((p) => {\n return h(p.component, { plugin: p, ...this.props.props });\n }),\n );\n }\n\n return null;\n}\n","/**\n * Centralized logging lib\n *\n * This class needs some improvements but so far it has been used to have a coherent way to log\n */\nclass Logger {\n private format(message: string, type: string): string {\n return `[Grid.js] [${type.toUpperCase()}]: ${message}`;\n }\n\n error(message: string, throwException = false): void {\n const msg = this.format(message, 'error');\n\n if (throwException) {\n throw Error(msg);\n } else {\n console.error(msg);\n }\n }\n\n warn(message: string): void {\n console.warn(this.format(message, 'warn'));\n }\n\n info(message: string): void {\n console.info(this.format(message, 'info'));\n }\n}\n\nexport default new Logger();\n","import { OneDArray, TColumn, TwoDArray } from './types';\nimport Base from './base';\nimport { Config } from './config';\nimport { px, width } from './util/width';\nimport { getShadowTableWidths, ShadowTable } from './view/table/shadow';\nimport { ComponentChild, h, isValidElement, RefObject, render } from 'preact';\nimport { camelCase } from './util/string';\nimport { flatten } from './util/array';\nimport logger from './util/log';\nimport { PluginManager, PluginPosition } from './plugin';\nimport { GenericSortConfig } from './view/plugin/sort/sort';\n\nclass Header extends Base {\n private _columns: OneDArray<TColumn>;\n\n constructor() {\n super();\n\n this._columns = [];\n }\n\n get columns(): OneDArray<TColumn> {\n return this._columns;\n }\n\n set columns(columns) {\n this._columns = columns;\n }\n\n get visibleColumns(): OneDArray<TColumn> {\n return this._columns.filter((c) => !c.hidden);\n }\n\n /**\n * Tries to automatically adjust the width of columns based on:\n * - Header cell content\n * - Cell content of the first row\n * - Cell content of the last row\n *\n * @param config\n */\n adjustWidth(\n config: Config,\n tableRef: RefObject<HTMLTableElement>,\n tempRef: RefObject<HTMLDivElement>,\n ): this {\n const container: Element = config.container;\n const autoWidth = config.autoWidth;\n\n if (!container) {\n // we can't calculate the width because the container\n // is unknown at this stage\n return this;\n }\n\n // pixels\n const containerWidth = container.clientWidth;\n\n let widths = {};\n\n if (tableRef.current && autoWidth) {\n // let's create a shadow table with the first 10 rows of the data\n // and let the browser to render the table with table-layout: auto\n // no padding, margin or border to get the minimum space required\n // to render columns. Once the table is rendered and widths are known,\n // we unmount the shadow table from the DOM and set the correct width\n render(\n h(ShadowTable, {\n tableRef: tableRef.current,\n }),\n tempRef.current,\n );\n\n widths = getShadowTableWidths(tempRef.current);\n }\n\n for (const column of flatten(Header.tabularFormat(this.columns))) {\n // because we don't want to set the width of parent THs\n if (column.columns && column.columns.length > 0) {\n continue;\n }\n\n if (!column.width && autoWidth) {\n // tries to find the corresponding cell\n // from the ShadowTable and set the correct width\n\n if (column.id in widths) {\n // because a column can be hidden, too\n column.width = px(widths[column.id]['width']);\n column.minWidth = px(widths[column.id]['minWidth']);\n }\n } else {\n // column width is already defined\n // sets the column with based on the width of its container\n column.width = px(width(column.width, containerWidth));\n }\n }\n\n if (tableRef.current && autoWidth) {\n // unmount the shadow table from temp\n render(null, tempRef.current);\n }\n\n return this;\n }\n\n private setSort(\n sortConfig: GenericSortConfig | boolean,\n columns?: OneDArray<TColumn>,\n ): void {\n const cols = columns || this.columns || [];\n\n for (const column of cols) {\n // sorting can only be enabled for columns without any children\n if (column.columns && column.columns.length > 0) {\n column.sort = undefined;\n } else if (column.sort === undefined && sortConfig) {\n column.sort = {};\n } else if (!column.sort) {\n // false, null, etc.\n column.sort = undefined;\n } else if (typeof column.sort === 'object') {\n column.sort = {\n ...column.sort,\n };\n }\n\n if (column.columns) {\n this.setSort(sortConfig, column.columns);\n }\n }\n }\n\n private setResizable(resizable: boolean, columns?: OneDArray<TColumn>): void {\n const cols = columns || this.columns || [];\n\n for (const column of cols) {\n if (column.resizable === undefined) {\n column.resizable = resizable;\n }\n\n if (column.columns) {\n this.setResizable(resizable, column.columns);\n }\n }\n }\n\n private setID(columns?: OneDArray<TColumn>): void {\n const cols = columns || this.columns || [];\n\n for (const column of cols) {\n if (!column.id && typeof column.name === 'string') {\n // let's guess the column ID if it's undefined\n column.id = camelCase(column.name);\n }\n\n if (!column.id) {\n logger.error(\n `Could not find a valid ID for one of the columns. Make sure a valid \"id\" is set for all columns.`,\n );\n }\n\n // nested columns\n if (column.columns) {\n this.setID(column.columns);\n }\n }\n }\n\n private populatePlugins(\n pluginManager: PluginManager,\n columns: OneDArray<TColumn>,\n ): void {\n // populate the cell columns\n for (const column of columns) {\n if (column.plugin !== undefined) {\n pluginManager.add({\n id: column.id,\n ...column.plugin,\n position: PluginPosition.Cell,\n });\n }\n }\n }\n\n static fromColumns(\n columns: OneDArray<TColumn | string | ComponentChild>,\n ): Header {\n const header = new Header();\n\n for (const column of columns) {\n if (typeof column === 'string' || isValidElement(column)) {\n header.columns.push({\n name: column,\n });\n } else if (typeof column === 'object') {\n const typedColumn = column as TColumn;\n\n if (typedColumn.columns) {\n typedColumn.columns = Header.fromColumns(typedColumn.columns).columns;\n }\n\n // because the data for that cell is null\n // if we are trying to render a plugin\n if (typeof typedColumn.plugin === 'object') {\n if (typedColumn.data === undefined) {\n typedColumn.data = null;\n }\n }\n\n // TColumn type\n header.columns.push(column as TColumn);\n }\n }\n\n return header;\n }\n\n static createFromConfig(config: Partial<Config>): Header | null {\n const header = new Header();\n\n // TODO: this part needs some refactoring\n if (config.from) {\n header.columns = Header.fromHTMLTable(config.from).columns;\n } else if (config.columns) {\n header.columns = Header.fromColumns(config.columns).columns;\n } else if (\n config.data &&\n typeof config.data[0] === 'object' &&\n !(config.data[0] instanceof Array)\n ) {\n // if data[0] is an object but not an Array\n // used for when a JSON payload is provided\n header.columns = Object.keys(config.data[0]).map((name) => {\n return { name: name };\n });\n }\n\n if (header.columns.length) {\n header.setID();\n header.setSort(config.sort);\n header.setResizable(config.resizable);\n header.populatePlugins(config.plugin, header.columns);\n return header;\n }\n\n return null;\n }\n\n static fromHTMLTable(element: HTMLElement): Header {\n const header = new Header();\n const thead = element.querySelector('thead');\n const ths = thead.querySelectorAll('th');\n\n for (const th of ths as any) {\n header.columns.push({\n name: th.innerHTML,\n width: th.width,\n });\n }\n\n return header;\n }\n\n /**\n * Converts the tree-like format of Header to a tabular format\n *\n * Example:\n *\n * H1\n * H1-H1\n * H1-H2\n * H2\n * H2-H1\n *\n * becomes:\n * [\n * [H1, H2],\n * [H1-H1, H1-H2, H2-H1]\n * ]\n *\n * @param columns\n */\n static tabularFormat(columns: OneDArray<TColumn>): TwoDArray<TColumn> {\n let result: TwoDArray<TColumn> = [];\n const cols = columns || [];\n let nextRow = [];\n\n if (cols && cols.length) {\n result.push(cols);\n\n for (const col of cols) {\n if (col.columns && col.columns.length) {\n nextRow = nextRow.concat(col.columns);\n }\n }\n\n if (nextRow.length) {\n result = result.concat(this.tabularFormat(nextRow));\n }\n }\n\n return result;\n }\n\n /**\n * Returns an array of leaf columns (last columns in the tree)\n *\n * @param columns\n */\n static leafColumns(columns: OneDArray<TColumn>): OneDArray<TColumn> {\n let result: OneDArray<TColumn> = [];\n const cols = columns || [];\n\n if (cols && cols.length) {\n for (const col of cols) {\n if (!col.columns || col.columns.length === 0) {\n result.push(col);\n }\n\n if (col.columns) {\n result = result.concat(this.leafColumns(col.columns));\n }\n }\n }\n\n return result;\n }\n\n /**\n * Returns the maximum depth of a column tree\n * @param column\n */\n static maximumDepth(column: TColumn): number {\n return this.tabularFormat([column]).length - 1;\n }\n}\n\nexport default Header;\n","/**\n * Base Storage class. All storage implementation must inherit this class\n */\nimport { TData } from '../types';\n\nabstract class Storage<I> {\n /**\n * Returns all rows based on ...args\n * @param args\n */\n abstract get(...args): Promise<StorageResponse>;\n\n /**\n * To set all rows\n *\n * @param data\n */\n set?(data: I | ((...args) => void)): this;\n}\n\nexport interface StorageResponse {\n data: TData;\n total: number;\n}\n\nexport default Storage;\n","import Storage, { StorageResponse } from './storage';\nimport { TData } from '../types';\n\nclass MemoryStorage extends Storage<TData> {\n private data: (() => TData) | (() => Promise<TData>);\n\n constructor(data: TData | (() => TData) | (() => Promise<TData>)) {\n super();\n this.set(data);\n }\n\n public async get(): Promise<StorageResponse> {\n const data = await this.data();\n\n return {\n data: data,\n total: data.length,\n };\n }\n\n public set(data: TData | (() => TData) | (() => Promise<TData>)): this {\n if (data instanceof Array) {\n this.data = (): TData => data;\n } else if (data instanceof Function) {\n this.data = data;\n }\n\n return this;\n }\n}\n\nexport default MemoryStorage;\n","import Storage, { StorageResponse } from './storage';\nimport log from '../util/log';\n\nexport interface ServerStorageOptions extends RequestInit {\n url: string;\n // to format the data and columns\n then?: (data: any) => any[][];\n // to handle the response from the server. `handle` will\n // be called first and then `then` callback will be invoked\n // The purpose of this function is to handle the behaviour\n // of server and either reject and resolve the initial response\n // before calling the `then` function\n handle?: (response: Response) => Promise<any>;\n total?: (data: any) => number;\n // to bypass the current implementation of ServerStorage and process the\n // request manually (e.g. when user wants to connect their own SDK/HTTP Client)\n data?: (opts: ServerStorageOptions) => Promise<StorageResponse>;\n}\n\nclass ServerStorage extends Storage<ServerStorageOptions> {\n private readonly options: ServerStorageOptions;\n\n constructor(options: ServerStorageOptions) {\n super();\n this.options = options;\n }\n\n private handler(response: Response): Promise<any> {\n if (typeof this.options.handle === 'function') {\n return this.options.handle(response);\n }\n\n if (response.ok) {\n return response.json();\n } else {\n log.error(\n `Could not fetch data: ${response.status} - ${response.statusText}`,\n true,\n );\n return null;\n }\n }\n\n public get(options?: ServerStorageOptions): Promise<StorageResponse> {\n // this.options is the initial config object\n // options is the runtime config passed by the pipeline (e.g. search component)\n const opts = {\n ...this.options,\n ...options,\n };\n\n // if `options.data` is provided, the current ServerStorage\n // implementation will be ignored and we let options.data to\n // handle the request. Useful when HTTP client needs to be\n // replaced with something else\n if (typeof opts.data === 'function') {\n return opts.data(opts);\n }\n\n return fetch(opts.url, opts)\n .then(this.handler.bind(this))\n .then((res) => {\n return {\n data: opts.then(res),\n total: typeof opts.total === 'function' ? opts.total(res) : undefined,\n };\n });\n }\n}\n\nexport default ServerStorage;\n","import { Config } from '../config';\nimport MemoryStorage from './memory';\nimport Storage from './storage';\nimport ServerStorage from './server';\nimport log from '../util/log';\nimport { decode, html } from '../util/html';\n\nclass StorageUtils {\n /**\n * Accepts a Config object and tries to guess and return a Storage type\n *\n * @param config\n */\n public static createFromConfig(config: Config): Storage<any> {\n let storage = null;\n // `data` array is provided\n if (config.data) {\n storage = new MemoryStorage(config.data);\n }\n\n if (config.from) {\n storage = new MemoryStorage(this.tableElementToArray(config.from));\n // remove the source table element from the DOM\n config.from.style.display = 'none';\n }\n\n if (config.server) {\n storage = new ServerStorage(config.server);\n }\n\n if (!storage) {\n log.error('Could not determine the storage type', true);\n }\n\n return storage;\n }\n\n /**\n * Accepts a HTML table element and converts it into a 2D array of data\n *\n * TODO: This function can be a step in the pipeline: Convert Table -> Load into a memory storage -> ...\n *\n * @param element\n */\n static tableElementToArray(element: HTMLElement): any[][] {\n const arr = [];\n const tbody = element.querySelector('tbody');\n const rows = tbody.querySelectorAll('tr');\n\n for (const row of rows as any) {\n const cells: HTMLElement[] = row.querySelectorAll('td');\n const parsedRow = [];\n\n for (const cell of cells) {\n // try to capture a TD with single text element first\n if (\n cell.childNodes.length === 1 &&\n cell.childNodes[0].nodeType === Node.TEXT_NODE\n ) {\n parsedRow.push(decode(cell.innerHTML));\n } else {\n parsedRow.push(html(cell.innerHTML));\n }\n }\n\n arr.push(parsedRow);\n }\n\n return arr;\n }\n}\n\nexport default StorageUtils;\n","import { PipelineProcessor, ProcessorType } from './processor';\nimport { ID } from '../util/id';\nimport log from '../util/log';\nimport { EventEmitter } from '../util/eventEmitter';\n\ninterface PipelineEvents<R> {\n /**\n * Generic updated event. Triggers the callback function when the pipeline\n * is updated, including when a new processor is registered, a processor's props\n * get updated, etc.\n */\n updated: <T, P>(processor: PipelineProcessor<T, P>) => void;\n /**\n * Triggers the callback function when a new\n * processor is registered successfully\n */\n afterRegister: () => void;\n /**\n * Triggers the callback when a registered\n * processor's property is updated\n */\n propsUpdated: () => void;\n /**\n * Triggers the callback function when the pipeline\n * is fully processed, before returning the results\n *\n * afterProcess will not be called if there is an\n * error in the pipeline (i.e a step throw an Error)\n */\n afterProcess: (prev: R) => void;\n /**\n * Triggers the callback function when the pipeline\n * fails to process all steps or at least one step\n * throws an Error\n */\n error: <T>(prev: T) => void;\n}\n\nclass Pipeline<R> extends EventEmitter<PipelineEvents<R>> {\n // available steps for this pipeline\n private readonly _steps: Map<\n ProcessorType,\n PipelineProcessor<unknown, unknown>[]\n > = new Map<ProcessorType, PipelineProcessor<unknown, unknown>[]>();\n // used to cache the results of processors using their id field\n private cache: Map<string, unknown> = new Map<string, unknown>();\n // keeps the index of the last updated processor in the registered\n // processors list and will be used to invalidate the cache\n // -1 means all new processors should be processed\n private lastProcessorIndexUpdated = -1;\n\n constructor(steps?: PipelineProcessor<unknown, unknown>[]) {\n super();\n\n if (steps) {\n steps.forEach((step) => this.register(step));\n }\n }\n\n /**\n * Clears the `cache` array\n */\n clearCache(): void {\n this.cache = new Map<string, object>();\n this.lastProcessorIndexUpdated = -1;\n }\n\n /**\n * Registers a new processor\n *\n * @param processor\n * @param priority\n */\n register<T, P>(\n processor: PipelineProcessor<T, P>,\n priority: number = null,\n ): PipelineProcessor<T, P> {\n if (!processor) {\n throw Error('Processor is not defined');\n }\n\n if (processor.type === null) {\n throw Error('Processor type is not defined');\n }\n\n if (this.findProcessorIndexByID(processor.id) > -1) {\n throw Error(`Processor ID ${processor.id} is already defined`);\n }\n\n // binding the propsUpdated callback to the Pipeline\n processor.on('propsUpdated', this.processorPropsUpdated.bind(this));\n\n this.addProcessorByPriority(processor, priority);\n this.afterRegistered(processor);\n\n return processor;\n }\n\n /**\n * Tries to register a new processor\n * @param processor\n * @param priority\n */\n tryRegister<T, P>(\n processor: PipelineProcessor<T, P>,\n priority: number = null,\n ): PipelineProcessor<T, P> | undefined {\n try {\n return this.register(processor, priority);\n } catch (_) {\n // noop\n }\n\n return undefined;\n }\n\n /**\n * Removes a processor from the list\n *\n * @param processor\n */\n unregister<T, P>(processor: PipelineProcessor<T, P>): void {\n if (!processor) return;\n if (this.findProcessorIndexByID(processor.id) === -1) return;\n\n const subSteps = this._steps.get(processor.type);\n\n if (subSteps && subSteps.length) {\n this._steps.set(\n processor.type,\n subSteps.filter((proc) => proc != processor),\n );\n this.emit('updated', processor);\n }\n }\n\n /**\n * Registers a new processor\n *\n * @param processor\n * @param priority\n */\n private addProcessorByPriority<T, P>(\n processor: PipelineProcessor<T, P>,\n priority: number,\n ): void {\n let subSteps = this._steps.get(processor.type);\n\n if (!subSteps) {\n const newSubStep = [];\n this._steps.set(processor.type, newSubStep);\n subSteps = newSubStep;\n }\n\n if (priority === null || priority < 0) {\n subSteps.push(processor);\n } else {\n if (!subSteps[priority]) {\n // slot is empty\n subSteps[priority] = processor;\n } else {\n // slot is NOT empty\n const first = subSteps.slice(0, priority - 1);\n const second = subSteps.slice(priority + 1);\n\n this._steps.set(processor.type, first.concat(processor).concat(second));\n }\n }\n }\n\n /**\n * Flattens the _steps Map and returns a list of steps with their correct priorities\n */\n get steps(): PipelineProcessor<unknown, unknown>[] {\n let steps: PipelineProcessor<unknown, unknown>[] = [];\n\n for (const type of this.getSortedProcessorTypes()) {\n const subSteps = this._steps.get(type);\n\n if (subSteps && subSteps.length) {\n steps = steps.concat(subSteps);\n }\n }\n\n // to remove any undefined elements\n return steps.filter((s) => s);\n }\n\n /**\n * Accepts ProcessType and returns an array of the registered processes\n * with the give type\n *\n * @param type\n */\n getStepsByType(type: ProcessorType): PipelineProcessor<unknown, unknown>[] {\n return this.steps.filter((process) => process.type === type);\n }\n\n /**\n * Returns a list of ProcessorType according to their priority\n */\n private getSortedProcessorTypes(): ProcessorType[] {\n return Object.keys(ProcessorType)\n .filter((key) => !isNaN(Number(key)))\n .map((key) => Number(key));\n }\n\n /**\n * Runs all registered processors based on their correct priority\n * and returns the final output after running all steps\n *\n * @param data\n */\n async process(data?: R): Promise<R> {\n const lastProcessorIndexUpdated = this.lastProcessorIndexUpdated;\n const steps = this.steps;\n\n let prev = data;\n\n try {\n for (const processor of steps) {\n const processorIndex = this.findProcessorIndexByID(processor.id);\n\n if (processorIndex >= lastProcessorIndexUpdated) {\n // we should execute process() here since the last\n // updated processor was before \"processor\".\n // This is to ensure that we always have correct and up to date\n // data from processors and also to skip them when necessary\n prev = (await processor.process(prev)) as R;\n this.cache.set(processor.id, prev);\n } else {\n // cached results already exist\n prev = this.cache.get(processor.id) as R;\n }\n }\n } catch (e) {\n log.error(e);\n // trigger the onError callback\n this.emit('error', prev);\n\n // rethrow\n throw e;\n }\n\n // means the pipeline is up to date\n this.lastProcessorIndexUpdated = steps.length;\n\n // triggers the afterProcess callbacks with the results\n this.emit('afterProcess', prev);\n\n return prev;\n }\n\n /**\n * Returns the registered processor's index in _steps array\n *\n * @param processorID\n */\n private findProcessorIndexByID(processorID: ID): number {\n return this.steps.findIndex((p) => p.id == processorID);\n }\n\n /**\n * Sets the last updates processors index locally\n * This is used to invalid or skip a processor in\n * the process() method\n */\n private setLastProcessorIndex<T, P>(\n processor: PipelineProcessor<T, P>,\n ): void {\n const processorIndex = this.findProcessorIndexByID(processor.id);\n\n if (this.lastProcessorIndexUpdated > processorIndex) {\n this.lastProcessorIndexUpdated = processorIndex;\n }\n }\n\n private processorPropsUpdated(processor): void {\n this.setLastProcessorIndex(processor);\n this.emit('propsUpdated');\n this.emit('updated', processor);\n }\n\n private afterRegistered(processor): void {\n this.setLastProcessorIndex(processor);\n this.emit('afterRegister');\n this.emit('updated', processor);\n }\n}\n\nexport default Pipeline;\n","import Storage, { StorageResponse } from '../../storage/storage';\nimport {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\n\ninterface StorageExtractorProps extends PipelineProcessorProps {\n storage: Storage<any>;\n}\n\nclass StorageExtractor extends PipelineProcessor<\n StorageResponse,\n StorageExtractorProps\n> {\n get type(): ProcessorType {\n return ProcessorType.Extractor;\n }\n\n async _process(opts: any): Promise<StorageResponse> {\n return await this.props.storage.get(opts);\n }\n}\n\nexport default StorageExtractor;\n","import { PipelineProcessor, ProcessorType } from '../processor';\nimport Tabular from '../../tabular';\nimport { ArrayResponse } from './storageResponseToArray';\n\nclass ArrayToTabularTransformer extends PipelineProcessor<\n Tabular,\n Record<string, any>\n> {\n get type(): ProcessorType {\n return ProcessorType.Transformer;\n }\n\n _process(arrayResponse: ArrayResponse): Tabular {\n const tabular = Tabular.fromArray(arrayResponse.data);\n\n // for server-side storage\n tabular.length = arrayResponse.total;\n\n return tabular;\n }\n}\n\nexport default ArrayToTabularTransformer;\n","import {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { ServerStorageOptions } from '../../storage/server';\n\ninterface ServerInitiatorProps extends PipelineProcessorProps {\n serverStorageOptions: ServerStorageOptions;\n}\n\nclass ServerInitiator extends PipelineProcessor<\n ServerStorageOptions,\n ServerInitiatorProps\n> {\n get type(): ProcessorType {\n return ProcessorType.Initiator;\n }\n\n _process(): ServerStorageOptions {\n return Object.entries(this.props.serverStorageOptions)\n .filter(([_, val]) => typeof val !== 'function')\n .reduce(\n (acc, [k, v]) => ({ ...acc, [k]: v }),\n {},\n ) as ServerStorageOptions;\n }\n}\n\nexport default ServerInitiator;\n","import {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { StorageResponse } from '../../storage/storage';\nimport { TCell, TData, TDataArray, TDataObject, TwoDArray } from '../../types';\nimport Header from '../../header';\nimport logger from '../../util/log';\n\nexport interface ArrayResponse {\n data: TwoDArray<TCell>;\n total: number;\n}\n\ninterface StorageResponseToArrayTransformerProps\n extends PipelineProcessorProps {\n header: Header;\n}\n\nclass StorageResponseToArrayTransformer extends PipelineProcessor<\n ArrayResponse,\n StorageResponseToArrayTransformerProps\n> {\n get type(): ProcessorType {\n return ProcessorType.Transformer;\n }\n\n private castData(data: TData): TwoDArray<TCell> {\n if (!data || !data.length) {\n return [];\n }\n\n if (!this.props.header || !this.props.header.columns) {\n return data as TwoDArray<TCell>;\n }\n\n const columns = Header.leafColumns(this.props.header.columns);\n\n // if it's a 2d array already\n if (data[0] instanceof Array) {\n return (data as TDataArray).map((row) => {\n let pad = 0;\n\n return columns.map((column, i) => {\n // default `data` is provided for this column\n if (column.data !== undefined) {\n pad++;\n\n if (typeof column.data === 'function') {\n return column.data(row);\n } else {\n return column.data;\n }\n }\n\n return row[i - pad];\n });\n });\n }\n\n // if it's an array of objects (but not array of arrays, i.e JSON payload)\n if (typeof data[0] === 'object' && !(data[0] instanceof Array)) {\n return (data as TDataObject).map((row) =>\n columns.map((column, i) => {\n if (column.data !== undefined) {\n if (typeof column.data === 'function') {\n return column.data(row);\n } else {\n return column.data;\n }\n } else if (column.id) {\n return row[column.id];\n } else {\n logger.error(`Could not find the correct cell for column at position ${i}.\n Make sure either 'id' or 'selector' is defined for all columns.`);\n return null;\n }\n }),\n );\n }\n\n return [];\n }\n\n _process(storageResponse: StorageResponse): ArrayResponse {\n return {\n data: this.castData(storageResponse.data),\n total: storageResponse.total,\n };\n }\n}\n\nexport default StorageResponseToArrayTransformer;\n","import { Config } from '../config';\nimport Pipeline from './pipeline';\nimport Tabular from '../tabular';\nimport StorageExtractor from './extractor/storage';\nimport ArrayToTabularTransformer from './transformer/arrayToTabular';\nimport ServerStorage from '../storage/server';\nimport ServerInitiator from './initiator/server';\nimport StorageResponseToArrayTransformer from './transformer/storageResponseToArray';\n\nclass PipelineUtils {\n static createFromConfig(config: Config): Pipeline<Tabular> {\n const pipeline = new Pipeline<Tabular>();\n\n if (config.storage instanceof ServerStorage) {\n pipeline.register(\n new ServerInitiator({\n serverStorageOptions: config.server,\n }),\n );\n }\n\n pipeline.register(new StorageExtractor({ storage: config.storage }));\n pipeline.register(\n new StorageResponseToArrayTransformer({ header: config.header }),\n );\n pipeline.register(new ArrayToTabularTransformer());\n\n return pipeline;\n }\n}\n\nexport default PipelineUtils;\n","export class Store<S = Record<string, unknown>> {\n private state: S;\n private listeners: ((current?: S, prev?: S) => void)[] = [];\n private isDispatching = false;\n\n constructor(initialState: S) {\n this.state = initialState;\n }\n\n getState = () => this.state;\n getListeners = () => this.listeners;\n\n dispatch = (reducer: (state: S) => S) => {\n if (typeof reducer !== 'function')\n throw new Error('Reducer is not a function');\n if (this.isDispatching)\n throw new Error('Reducers may not dispatch actions');\n\n this.isDispatching = true;\n\n const prevState = this.state;\n try {\n this.state = reducer(this.state);\n } finally {\n this.isDispatching = false;\n }\n\n for (const listener of this.listeners) {\n listener(this.state, prevState);\n }\n\n return this.state;\n };\n\n subscribe = (listener: (current?: S, prev?: S) => void): (() => void) => {\n if (typeof listener !== 'function')\n throw new Error('Listener is not a function');\n\n this.listeners = [...this.listeners, listener];\n return () =>\n (this.listeners = this.listeners.filter((lis) => lis !== listener));\n };\n}\n","import { CSSDeclaration, OneDArray, Status, TColumn, TData } from './types';\nimport Storage from './storage/storage';\nimport Pipeline from './pipeline/pipeline';\nimport Tabular from './tabular';\nimport { Search, SearchConfig } from './view/plugin/search/search';\nimport { Pagination, PaginationConfig } from './view/plugin/pagination';\nimport Header from './header';\nimport { ServerStorageOptions } from './storage/server';\nimport { GenericSortConfig } from './view/plugin/sort/sort';\nimport { Language, Translator } from './i18n/language';\nimport { ComponentChild, createContext, createRef, RefObject } from 'preact';\nimport StorageUtils from './storage/storageUtils';\nimport PipelineUtils from './pipeline/pipelineUtils';\nimport { EventEmitter } from './util/eventEmitter';\nimport { GridEvents } from './events';\nimport { PluginManager, PluginPosition, Plugin } from './plugin';\nimport Grid from './grid';\nimport { Store } from './state/store';\n\nexport const ConfigContext = createContext(null);\n\nexport interface Config {\n // a reference to the current Grid.js instance\n instance: Grid;\n store: Store;\n eventEmitter: EventEmitter<GridEvents>;\n plugin: PluginManager;\n /** container element that is used to mount the Grid.js to */\n // TODO: change this to an element reference\n container?: Element;\n /** pointer to the main table element */\n tableRef?: RefObject<HTMLTableElement>;\n data?: TData | (() => TData) | (() => Promise<TData>);\n server?: ServerStorageOptions;\n header?: Header;\n /** to parse a HTML table and load the data */\n from: HTMLElement;\n storage: Storage<any>;\n /** Pipeline process throttle timeout in milliseconds */\n processingThrottleMs: number;\n pipeline: Pipeline<Tabular>;\n /** to automatically calculate the columns width */\n autoWidth: boolean;\n /** sets the width of the container and table */\n width: string;\n /** sets the height of the table */\n height: string;\n pagination: PaginationConfig | boolean;\n sort: GenericSortConfig | boolean;\n translator: Translator;\n /** fixes the table header to the top of the table */\n fixedHeader: boolean;\n /** Resizable columns? */\n resizable: boolean;\n columns: OneDArray<TColumn | string | ComponentChild>;\n search: SearchConfig | boolean;\n language: Language;\n plugins?: Plugin<any>[];\n style?: Partial<{\n table: CSSDeclaration;\n td: CSSDeclaration;\n th: CSSDeclaration;\n container: CSSDeclaration;\n header: CSSDeclaration;\n footer: CSSDeclaration;\n }>;\n className?: Partial<{\n table: string;\n th: string;\n thead: string;\n tbody: string;\n tr: string;\n td: string;\n container: string;\n footer: string;\n header: string;\n search: string;\n sort: string;\n pagination: string;\n paginationSummary: string;\n paginationButton: string;\n paginationButtonNext: string;\n paginationButtonCurrent: string;\n paginationButtonPrev: string;\n loading: string;\n notfound: string;\n error: string;\n }>;\n}\n\nexport class Config {\n public constructor() {\n Object.assign(this, Config.defaultConfig());\n }\n /**\n * Assigns `updatedConfig` keys to the current config file\n *\n * @param partialConfig\n */\n assign(partialConfig: Partial<Config>): Config {\n return Object.assign(this, partialConfig);\n }\n\n /**\n * Updates the config from a partial Config\n *\n * @param partialConfig\n */\n update(partialConfig: Partial<Config>): Config {\n if (!partialConfig) return this;\n\n this.assign(\n Config.fromPartialConfig({\n ...this,\n ...partialConfig,\n }),\n );\n\n return this;\n }\n\n static defaultConfig(): Partial<Config> {\n return {\n store: new Store({\n status: Status.Init,\n header: undefined,\n data: null,\n }),\n plugin: new PluginManager(),\n tableRef: createRef(),\n width: '100%',\n height: 'auto',\n processingThrottleMs: 100,\n autoWidth: true,\n style: {},\n className: {},\n };\n }\n\n static fromPartialConfig(partialConfig: Partial<Config>): Partial<Config> {\n const config = new Config().assign(partialConfig);\n\n // Sort\n if (typeof partialConfig.sort === 'boolean' && partialConfig.sort) {\n config.assign({\n sort: {\n multiColumn: true,\n },\n });\n }\n\n // Header\n config.assign({\n header: Header.createFromConfig(config),\n });\n\n config.assign({\n storage: StorageUtils.createFromConfig(config),\n });\n\n config.assign({\n pipeline: PipelineUtils.createFromConfig(config),\n });\n\n // Translator\n config.assign({\n translator: new Translator(config.language),\n });\n\n // clear existing plugins list to prevent duplicate errors\n config.plugin = new PluginManager();\n\n if (config.search) {\n // Search\n config.plugin.add({\n id: 'search',\n position: PluginPosition.Header,\n component: Search,\n });\n }\n\n if (config.pagination) {\n // Pagination\n config.plugin.add({\n id: 'pagination',\n position: PluginPosition.Footer,\n component: Pagination,\n });\n }\n\n // Additional plugins\n if (config.plugins) {\n config.plugins.forEach((p) => config.plugin.add(p));\n }\n\n return config;\n }\n}\n","import { h, ComponentChild, JSX } from 'preact';\n\nimport Cell from '../../cell';\nimport { classJoin, className } from '../../util/className';\nimport { CSSDeclaration, TColumn } from '../../types';\nimport Row from '../../row';\nimport { JSXInternal } from 'preact/src/jsx';\nimport { PluginRenderer } from '../../plugin';\nimport { useConfig } from '../../hooks/useConfig';\n\nexport function TD(\n props: {\n cell: Cell;\n row?: Row;\n column?: TColumn;\n style?: CSSDeclaration;\n messageCell?: boolean;\n } & Omit<JSX.HTMLAttributes<HTMLTableCellElement>, 'style'>,\n) {\n const config = useConfig();\n\n const content = (): ComponentChild => {\n if (props.column && typeof props.column.formatter === 'function') {\n return props.column.formatter(props.cell.data, props.row, props.column);\n }\n\n if (props.column && props.column.plugin) {\n return (\n <PluginRenderer\n pluginId={props.column.id}\n props={{\n column: props.column,\n cell: props.cell,\n row: props.row,\n }}\n />\n );\n }\n\n return props.cell.data;\n };\n\n const handleClick = (\n e: JSX.TargetedMouseEvent<HTMLTableCellElement>,\n ): void => {\n if (props.messageCell) return;\n\n config.eventEmitter.emit(\n 'cellClick',\n e,\n props.cell,\n props.column,\n props.row,\n );\n };\n\n const getCustomAttributes = (\n column: TColumn | null,\n ): JSXInternal.HTMLAttributes<HTMLTableCellElement> => {\n if (!column) return {};\n\n if (typeof column.attributes === 'function') {\n return column.attributes(props.cell.data, props.row, props.column);\n } else {\n return column.attributes;\n }\n };\n\n return (\n <td\n role={props.role}\n colSpan={props.colSpan}\n data-column-id={props.column && props.column.id}\n className={classJoin(\n className('td'),\n props.className,\n config.className.td,\n )}\n style={{\n ...props.style,\n ...config.style.td,\n }}\n onClick={handleClick}\n {...getCustomAttributes(props.column)}\n >\n {content()}\n </td>\n );\n}\n","import { h, JSX, ComponentChildren } from 'preact';\n\nimport Row from '../../row';\nimport Cell from '../../cell';\nimport { classJoin, className } from '../../util/className';\nimport { TColumn } from '../../types';\nimport { TD } from './td';\nimport Header from '../../header';\nimport { useConfig } from '../../hooks/useConfig';\nimport useSelector from '../../hooks/useSelector';\n\nexport function TR(props: {\n row?: Row;\n messageRow?: boolean;\n children?: ComponentChildren;\n}) {\n const config = useConfig();\n const header = useSelector((state) => state.header);\n\n const getColumn = (cellIndex: number): TColumn => {\n if (header) {\n const cols = Header.leafColumns(header.columns);\n\n if (cols) {\n return cols[cellIndex];\n }\n }\n\n return null;\n };\n\n const handleClick = (\n e: JSX.TargetedMouseEvent<HTMLTableRowElement>,\n ): void => {\n if (props.messageRow) return;\n config.eventEmitter.emit('rowClick', e, props.row);\n };\n\n const getChildren = (): ComponentChildren => {\n if (props.children) {\n return props.children;\n }\n\n return props.row.cells.map((cell: Cell, i) => {\n const column = getColumn(i);\n\n if (column && column.hidden) return null;\n\n return <TD key={cell.id} cell={cell} row={props.row} column={column} />;\n });\n };\n\n return (\n <tr\n className={classJoin(className('tr'), config.className.tr)}\n onClick={handleClick}\n >\n {getChildren()}\n </tr>\n );\n}\n","import { h } from 'preact';\nimport Cell from '../../cell';\nimport { classJoin, className } from '../../util/className';\nimport { TR } from './tr';\nimport { TD } from './td';\n\nexport function MessageRow(props: {\n message: string;\n colSpan?: number;\n className?: string;\n}) {\n return (\n <TR messageRow={true}>\n <TD\n role=\"alert\"\n colSpan={props.colSpan}\n messageCell={true}\n cell={new Cell(props.message)}\n className={classJoin(\n className('message'),\n props.className ? props.className : null,\n )}\n />\n </TR>\n );\n}\n","import { h } from 'preact';\nimport Row from '../../row';\nimport { TR } from './tr';\nimport { classJoin, className } from '../../util/className';\nimport { Status } from '../../types';\nimport { MessageRow } from './messageRow';\nimport { useConfig } from '../../hooks/useConfig';\nimport { useTranslator } from '../../i18n/language';\nimport useSelector from '../../hooks/useSelector';\n\nexport function TBody() {\n const config = useConfig();\n const data = useSelector((state) => state.data);\n const status = useSelector((state) => state.status);\n const header = useSelector((state) => state.header);\n const _ = useTranslator();\n\n const headerLength = () => {\n if (header) {\n return header.visibleColumns.length;\n }\n return 0;\n };\n\n return (\n <tbody className={classJoin(className('tbody'), config.className.tbody)}>\n {data &&\n data.rows.map((row: Row) => {\n return <TR key={row.id} row={row} />;\n })}\n\n {status === Status.Loading && (!data || data.length === 0) && (\n <MessageRow\n message={_('loading')}\n colSpan={headerLength()}\n className={classJoin(className('loading'), config.className.loading)}\n />\n )}\n\n {status === Status.Rendered && data && data.length === 0 && (\n <MessageRow\n message={_('noRecordsFound')}\n colSpan={headerLength()}\n className={classJoin(\n className('notfound'),\n config.className.notfound,\n )}\n />\n )}\n\n {status === Status.Error && (\n <MessageRow\n message={_('error')}\n colSpan={headerLength()}\n className={classJoin(className('error'), config.className.error)}\n />\n )}\n </tbody>\n );\n}\n","import { Comparator, TCell } from '../../types';\nimport Tabular from '../../tabular';\nimport {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport Row from '../../row';\nimport log from '../../util/log';\n\ninterface NativeSortProps extends PipelineProcessorProps {\n columns: {\n index: number;\n // 1 ascending, -1 descending\n direction?: 1 | -1;\n compare?: Comparator<TCell>;\n }[];\n}\n\nclass NativeSort extends PipelineProcessor<Tabular, NativeSortProps> {\n protected validateProps(): void {\n for (const condition of this.props.columns) {\n if (condition.direction === undefined) {\n condition.direction = 1;\n }\n\n if (condition.direction !== 1 && condition.direction !== -1) {\n log.error(`Invalid sort direction ${condition.direction}`);\n }\n }\n }\n\n get type(): ProcessorType {\n return ProcessorType.Sort;\n }\n\n private compare(cellA: TCell, cellB: TCell): number {\n if (cellA > cellB) {\n return 1;\n } else if (cellA < cellB) {\n return -1;\n }\n\n return 0;\n }\n\n private compareWrapper(a: Row, b: Row): number {\n let cmp = 0;\n\n for (const column of this.props.columns) {\n if (cmp === 0) {\n const cellA = a.cells[column.index].data;\n const cellB = b.cells[column.index].data;\n\n if (typeof column.compare === 'function') {\n cmp |= column.compare(cellA, cellB) * column.direction;\n } else {\n cmp |= this.compare(cellA, cellB) * column.direction;\n }\n } else {\n break;\n }\n }\n\n return cmp;\n }\n\n protected _process(data: Tabular): Tabular {\n const sortedRows = [...data.rows];\n sortedRows.sort(this.compareWrapper.bind(this));\n\n const sorted = new Tabular(sortedRows);\n // we have to set the tabular length manually\n // because of the server-side storage\n sorted.length = data.length;\n\n return sorted;\n }\n}\n\nexport default NativeSort;\n","import { Comparator, TCell } from '../../../types';\n\nexport const SortColumn =\n (\n index: number,\n direction: 1 | -1,\n multi?: boolean,\n compare?: Comparator<TCell>,\n ) =>\n (state) => {\n let columns = state.sort?.columns\n ? state.sort.columns.map((x) => {\n return { ...x };\n })\n : [];\n const count = columns.length;\n const column = columns.find((x) => x.index === index);\n const exists = column !== undefined;\n\n let add = false;\n let reset = false;\n let remove = false;\n let update = false;\n\n if (!exists) {\n // the column has not been sorted\n if (count === 0) {\n // the first column to be sorted\n add = true;\n } else if (count > 0 && !multi) {\n // remove the previously sorted column\n // and sort the current column\n add = true;\n reset = true;\n } else if (count > 0 && multi) {\n // multi-sorting\n // sort this column as well\n add = true;\n }\n } else {\n // the column has been sorted before\n if (!multi) {\n // single column sorting\n if (count === 1) {\n update = true;\n } else if (count > 1) {\n // this situation happens when we have already entered\n // multi-sorting mode but then user tries to sort a single column\n reset = true;\n add = true;\n }\n } else {\n // multi sorting\n if (column.direction === -1) {\n // remove the current column from the\n // sorted columns array\n remove = true;\n } else {\n update = true;\n }\n }\n }\n\n if (reset) {\n // resetting the sorted columns\n columns = [];\n }\n\n if (add) {\n columns.push({\n index: index,\n direction: direction,\n compare: compare,\n });\n } else if (update) {\n const index = columns.indexOf(column);\n columns[index].direction = direction;\n } else if (remove) {\n const index = columns.indexOf(column);\n columns.splice(index, 1);\n }\n\n return {\n ...state,\n sort: {\n columns: columns,\n },\n };\n };\n\nexport const SortToggle =\n (index: number, multi: boolean, compare?: Comparator<TCell>) => (state) => {\n const columns = state.sort ? [...state.sort.columns] : [];\n const column = columns.find((x) => x.index === index);\n\n if (!column) {\n return {\n ...state,\n ...SortColumn(index, 1, multi, compare)(state),\n };\n }\n\n return {\n ...state,\n ...SortColumn(\n index,\n column.direction === 1 ? -1 : 1,\n multi,\n compare,\n )(state),\n };\n };\n","import {\n PipelineProcessor,\n PipelineProcessorProps,\n ProcessorType,\n} from '../processor';\nimport { ServerStorageOptions } from '../../storage/server';\nimport { TColumnSort } from '../../types';\n\ninterface ServerSortProps extends PipelineProcessorProps {\n columns: TColumnSort[];\n url?: (prevUrl: string, columns: TColumnSort[]) => string;\n body?: (prevBody: BodyInit, columns: TColumnSort[]) => BodyInit;\n}\n\nclass ServerSort extends PipelineProcessor<\n ServerStorageOptions,\n ServerSortProps\n> {\n get type(): ProcessorType {\n return ProcessorType.ServerSort;\n }\n\n _process(options?: ServerStorageOptions): ServerStorageOptions {\n const updates = {};\n\n if (this.props.url) {\n updates['url'] = this.props.url(options.url, this.props.columns);\n }\n\n if (this.props.body) {\n updates['body'] = this.props.body(options.body, this.props.columns);\n }\n\n return {\n ...options,\n ...updates,\n };\n }\n}\n\nexport default ServerSort;\n","import { h, JSX } from 'preact';\n\nimport { classJoin, className } from '../../../util/className';\nimport { PipelineProcessor, ProcessorType } from '../../../pipeline/processor';\nimport NativeSort from '../../../pipeline/sort/native';\nimport { Comparator, TCell, TColumnSort } from '../../../types';\nimport * as actions from './actions';\nimport ServerSort from '../../../pipeline/sort/server';\nimport { useEffect, useState } from 'preact/hooks';\nimport { useConfig } from '../../../hooks/useConfig';\nimport { useTranslator } from '../../../i18n/language';\nimport useSelector from '../../../hooks/useSelector';\nimport { useStore } from '../../../hooks/useStore';\n\n// column specific config\nexport interface SortConfig {\n compare?: Comparator<TCell>;\n // 1 ascending, -1 descending\n direction?: 1 | -1;\n}\n\n// generic sort config:\n//\n// Config {\n// sort: GenericSortConfig\n// }\n//\nexport interface GenericSortConfig {\n multiColumn?: boolean;\n server?: {\n url?: (prevUrl: string, columns: TColumnSort[]) => string;\n body?: (prevBody: BodyInit, columns: TColumnSort[]) => BodyInit;\n };\n}\n\nexport function Sort(\n props: {\n // column index\n index: number;\n } & SortConfig,\n) {\n const config = useConfig();\n const { dispatch } = useStore();\n const _ = useTranslator();\n const [direction, setDirection] = useState(0);\n const sortConfig = config.sort as GenericSortConfig;\n const state = useSelector((state) => state.sort);\n const processorType =\n typeof sortConfig?.server === 'object'\n ? ProcessorType.ServerSort\n : ProcessorType.Sort;\n\n const getSortProcessor = () => {\n const processors = config.pipeline.getStepsByType(processorType);\n if (processors.length) {\n return processors[0];\n }\n return undefined;\n };\n\n const createSortProcessor = () => {\n if (processorType === ProcessorType.ServerSort) {\n return new ServerSort({\n columns: state ? state.columns : [],\n ...sortConfig.server,\n });\n }\n\n return new NativeSort({\n columns: state ? state.columns : [],\n });\n };\n\n const getOrCreateSortProcessor = (): PipelineProcessor<any, any> => {\n const existingSortProcessor = getSortProcessor();\n if (existingSortProcessor) {\n return existingSortProcessor;\n }\n\n return createSortProcessor();\n };\n\n useEffect(() => {\n const processor = getOrCreateSortProcessor();\n config.pipeline.tryRegister(processor);\n\n return () => config.pipeline.unregister(processor);\n }, [config]);\n\n /**\n * Sets the internal state of component\n */\n useEffect(() => {\n if (!state) return;\n\n const currentColumn = state.columns.find((x) => x.index === props.index);\n\n if (!currentColumn) {\n setDirection(0);\n } else {\n // if the direction is not set, initialize the selected\n // column direction with the passed prop (default to ascending)\n if (direction === 0) {\n currentColumn.direction = props.direction ?? 1;\n }\n setDirection(currentColumn.direction);\n }\n }, [state]);\n\n useEffect(() => {\n const processor = getSortProcessor();\n\n if (!processor) return;\n if (!state) return;\n\n processor.setProps({\n columns: state.columns,\n });\n }, [state]);\n\n const changeDirection = (e: JSX.TargetedMouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n // to sort two or more columns at the same time\n dispatch(\n actions.SortToggle(\n props.index,\n e.shiftKey === true && sortConfig.multiColumn,\n props.compare,\n ),\n );\n };\n\n const getSortClassName = (direction: number) => {\n if (direction === 1) {\n return 'asc';\n } else if (direction === -1) {\n return 'desc';\n }\n\n return 'neutral';\n };\n\n return (\n <button\n // because the corresponding <th> has tabIndex=0\n tabIndex={-1}\n aria-label={_(`sort.sort${direction === 1 ? 'Desc' : 'Asc'}`)}\n title={_(`sort.sort${direction === 1 ? 'Desc' : 'Asc'}`)}\n className={classJoin(\n className('sort'),\n className('sort', getSortClassName(direction)),\n config.className.sort,\n )}\n onClick={changeDirection}\n />\n );\n}\n","/**\n * Throttle a given function\n * @param fn Function to be called\n * @param wait Throttle timeout in milliseconds\n * @returns Throttled function\n */\nexport const throttle = (fn: (...args) => void, wait = 100) => {\n let timeoutId: ReturnType<typeof setTimeout>;\n let lastTime = Date.now();\n\n const execute = (...args) => {\n lastTime = Date.now();\n fn(...args);\n };\n\n return (...args) => {\n const currentTime = Date.now();\n const elapsed = currentTime - lastTime;\n\n if (elapsed >= wait) {\n // If enough time has passed since the last call, execute the function immediately\n execute(...args);\n } else {\n // If not enough time has passed, schedule the function call after the remaining delay\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n timeoutId = setTimeout(() => {\n execute(...args);\n timeoutId = null;\n }, wait - elapsed);\n }\n };\n};\n","import { h, RefObject } from 'preact';\nimport { classJoin, className } from '../../../util/className';\nimport { TColumn } from '../../../types';\nimport { throttle } from '../../../util/throttle';\n\nexport function Resize(props: {\n column: TColumn;\n thRef: RefObject<HTMLTableCellElement>;\n}) {\n let moveFn: (e) => void;\n\n const getPageX = (e: MouseEvent | TouchEvent) => {\n if (e instanceof MouseEvent) {\n return Math.floor(e.pageX);\n } else {\n return Math.floor(e.changedTouches[0].pageX);\n }\n };\n\n const start = (e: MouseEvent | TouchEvent) => {\n e.stopPropagation();\n\n const thElement = props.thRef.current;\n\n const offsetStart = parseInt(thElement.style.width, 10) - getPageX(e);\n\n moveFn = throttle((e) => move(e, offsetStart), 10);\n\n document.addEventListener('mouseup', end);\n document.addEventListener('touchend', end);\n document.addEventListener('mousemove', moveFn);\n document.addEventListener('touchmove', moveFn);\n };\n\n const move = (e: MouseEvent | TouchEvent, offsetStart: number) => {\n e.stopPropagation();\n\n const thElement = props.thRef.current;\n\n if (offsetStart + getPageX(e) >= parseInt(thElement.style.minWidth, 10)) {\n thElement.style.width = `${offsetStart + getPageX(e)}px`;\n }\n };\n\n const end = (e: MouseEvent | TouchEvent) => {\n e.stopPropagation();\n\n document.removeEventListener('mouseup', end);\n document.removeEventListener('mousemove', moveFn);\n document.removeEventListener('touchmove', moveFn);\n document.removeEventListener('touchend', end);\n };\n\n return (\n <div\n className={classJoin(className('th'), className('resizable'))}\n onMouseDown={start}\n onTouchStart={start}\n onClick={(e) => e.stopPropagation()}\n />\n );\n}\n","import { h, ComponentChild, JSX } from 'preact';\n\nimport { classJoin, className } from '../../util/className';\nimport { CSSDeclaration, TColumn } from '../../types';\nimport { GenericSortConfig, Sort } from '../plugin/sort/sort';\nimport { PluginRenderer } from '../../plugin';\nimport { Resize } from '../plugin/resize/resize';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useConfig } from '../../hooks/useConfig';\nimport * as SortActions from '../plugin/sort/actions';\nimport { useStore } from '../../hooks/useStore';\n\nexport function TH(\n props: {\n index: number;\n column: TColumn;\n style?: CSSDeclaration;\n } & Omit<JSX.HTMLAttributes<HTMLTableCellElement>, 'style'>,\n) {\n const config = useConfig();\n const thRef = useRef(null);\n const [style, setStyle] = useState({});\n const { dispatch } = useStore();\n\n useEffect(() => {\n // sets the `top` style if the current TH is fixed\n if (config.fixedHeader && thRef.current) {\n const offsetTop = thRef.current.offsetTop;\n\n if (typeof offsetTop === 'number') {\n setStyle({\n top: offsetTop,\n });\n }\n }\n }, [thRef]);\n\n const isSortable = (): boolean => props.column.sort != undefined;\n const isResizable = (): boolean => props.column.resizable;\n const onClick = (\n e:\n | JSX.TargetedMouseEvent<HTMLTableCellElement>\n | JSX.TargetedKeyboardEvent<HTMLTableCellElement>,\n ) => {\n e.stopPropagation();\n\n if (isSortable()) {\n const sortConfig = config.sort as GenericSortConfig;\n\n dispatch(\n SortActions.SortToggle(\n props.index,\n e.shiftKey === true && sortConfig.multiColumn,\n props.column.sort.compare,\n ),\n );\n }\n };\n\n const keyDown = (e: JSX.TargetedKeyboardEvent<HTMLTableCellElement>) => {\n // Enter key\n if (isSortable() && e.which === 13) {\n onClick(e);\n }\n };\n\n const content = (): ComponentChild => {\n if (props.column.name !== undefined) {\n return props.column.name;\n }\n\n if (props.column.plugin !== undefined) {\n return (\n <PluginRenderer\n pluginId={props.column.plugin.id}\n props={{\n column: props.column,\n }}\n />\n );\n }\n\n return null;\n };\n\n const getCustomAttributes = () => {\n const column = props.column;\n\n if (!column) return {};\n\n if (typeof column.attributes === 'function') {\n return column.attributes(null, null, props.column);\n } else {\n return column.attributes;\n }\n };\n\n return (\n <th\n ref={thRef}\n data-column-id={props.column && props.column.id}\n className={classJoin(\n className('th'),\n isSortable() ? className('th', 'sort') : null,\n config.fixedHeader ? className('th', 'fixed') : null,\n config.className.th,\n )}\n onClick={onClick}\n style={{\n ...config.style.th,\n ...{\n minWidth: props.column.minWidth,\n width: props.column.width,\n },\n ...style,\n ...props.style,\n }}\n onKeyDown={keyDown}\n rowSpan={props.rowSpan > 1 ? props.rowSpan : undefined}\n colSpan={props.colSpan > 1 ? props.colSpan : undefined}\n {...getCustomAttributes()}\n {...(isSortable() ? { tabIndex: 0 } : {})}\n >\n <div className={className('th', 'content')}>{content()}</div>\n {isSortable() && <Sort index={props.index} {...props.column.sort} />}\n {isResizable() &&\n props.index < config.header.visibleColumns.length - 1 && (\n <Resize column={props.column} thRef={thRef} />\n )}\n </th>\n );\n}\n","import { h } from 'preact';\nimport { TR } from './tr';\nimport { TH } from './th';\nimport { classJoin, className } from '../../util/className';\nimport Header from '../../header';\nimport { TColumn } from '../../types';\nimport { calculateRowColSpans } from '../../util/table';\nimport { useConfig } from '../../hooks/useConfig';\nimport useSelector from '../../hooks/useSelector';\n\nexport function THead() {\n const config = useConfig();\n const header = useSelector((state) => state.header);\n\n const renderColumn = (\n column: TColumn,\n rowIndex: number,\n columnIndex: number,\n totalRows: number,\n ) => {\n const { rowSpan, colSpan } = calculateRowColSpans(\n column,\n rowIndex,\n totalRows,\n );\n\n return (\n <TH\n column={column}\n index={columnIndex}\n colSpan={colSpan}\n rowSpan={rowSpan}\n />\n );\n };\n\n const renderRow = (row: TColumn[], rowIndex: number, totalRows: number) => {\n // because the only sortable columns are leaf columns (not parents)\n const leafColumns = Header.leafColumns(header.columns);\n\n return (\n <TR>\n {row.map((col) => {\n if (col.hidden) return null;\n\n return renderColumn(\n col,\n rowIndex,\n leafColumns.indexOf(col),\n totalRows,\n );\n })}\n </TR>\n );\n };\n\n const renderRows = () => {\n const rows = Header.tabularFormat(header.columns);\n\n return rows.map((row, rowIndex) => renderRow(row, rowIndex, rows.length));\n };\n\n if (header) {\n return (\n <thead\n key={header.id}\n className={classJoin(className('thead'), config.className.thead)}\n >\n {renderRows()}\n </thead>\n );\n }\n\n return null;\n}\n","import { TColumn } from '../types';\nimport Header from '../header';\n\nexport function calculateRowColSpans(\n column: TColumn,\n rowIndex: number,\n totalRows: number,\n): { rowSpan: number; colSpan: number } {\n const depth = Header.maximumDepth(column);\n const remainingRows = totalRows - rowIndex;\n const rowSpan = Math.floor(remainingRows - depth - depth / remainingRows);\n const colSpan = (column.columns && column.columns.length) || 1;\n\n return {\n rowSpan: rowSpan,\n colSpan: colSpan,\n };\n}\n","import Header from 'src/header';\nimport Tabular from '../tabular';\nimport { Status } from '../types';\n\nexport const SetStatusToRendered = () => (state) => {\n if (state.status === Status.Loaded) {\n return {\n ...state,\n status: Status.Rendered,\n };\n }\n\n return state;\n};\n\nexport const SetLoadingData = () => (state) => {\n return {\n ...state,\n status: Status.Loading,\n };\n};\n\nexport const SetData = (data: Tabular) => (state) => {\n if (!data) return state;\n\n return {\n ...state,\n data: data,\n status: Status.Loaded,\n };\n};\n\nexport const SetDataErrored = () => (state) => {\n return {\n ...state,\n data: null,\n status: Status.Error,\n };\n};\n\nexport const SetHeader = (header: Header) => (state) => {\n return {\n ...state,\n header: header,\n };\n};\n\nexport const SetTableRef = (tableRef) => (state) => {\n return {\n ...state,\n tableRef: tableRef,\n };\n};\n","import { h } from 'preact';\nimport { TBody } from './tbody';\nimport { THead } from './thead';\nimport { classJoin, className } from '../../util/className';\nimport { useConfig } from '../../hooks/useConfig';\nimport { useEffect, useRef } from 'preact/hooks';\nimport * as actions from '../actions';\nimport { useStore } from '../../hooks/useStore';\n\nexport function Table() {\n const config = useConfig();\n const tableRef = useRef(null);\n const { dispatch } = useStore();\n\n useEffect(() => {\n if (tableRef) dispatch(actions.SetTableRef(tableRef));\n }, [tableRef]);\n\n return (\n <table\n ref={tableRef}\n role=\"grid\"\n className={classJoin(className('table'), config.className.table)}\n style={{\n ...config.style.table,\n ...{\n height: config.height,\n },\n }}\n >\n <THead />\n <TBody />\n </table>\n );\n}\n","import { classJoin, className } from '../util/className';\nimport { h } from 'preact';\nimport { PluginPosition, PluginRenderer } from '../plugin';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useConfig } from '../hooks/useConfig';\n\nexport function HeaderContainer() {\n const [isActive, setIsActive] = useState(true);\n const headerRef = useRef(null);\n const config = useConfig();\n\n useEffect(() => {\n if (headerRef.current.children.length === 0) {\n setIsActive(false);\n }\n }, [headerRef]);\n\n if (isActive) {\n return (\n <div\n ref={headerRef}\n className={classJoin(className('head'), config.className.header)}\n style={{ ...config.style.header }}\n >\n <PluginRenderer position={PluginPosition.Header} />\n </div>\n );\n }\n\n return null;\n}\n","import { h } from 'preact';\nimport { classJoin, className } from '../util/className';\nimport { PluginPosition, PluginRenderer } from '../plugin';\nimport { useEffect, useRef, useState } from 'preact/hooks';\nimport { useConfig } from '../hooks/useConfig';\n\nexport function FooterContainer() {\n const footerRef = useRef(null);\n const [isActive, setIsActive] = useState(true);\n const config = useConfig();\n\n useEffect(() => {\n if (footerRef.current.children.length === 0) {\n setIsActive(false);\n }\n }, [footerRef]);\n\n if (isActive) {\n return (\n <div\n ref={footerRef}\n className={classJoin(className('footer'), config.className.footer)}\n style={{ ...config.style.footer }}\n >\n <PluginRenderer position={PluginPosition.Footer} />\n </div>\n );\n }\n\n return null;\n}\n","import { createRef, h } from 'preact';\nimport { classJoin, className } from '../util/className';\nimport { Status } from '../types';\nimport { Table } from './table/table';\nimport { HeaderContainer } from './headerContainer';\nimport { FooterContainer } from './footerContainer';\nimport log from '../util/log';\nimport { useEffect } from 'preact/hooks';\nimport * as actions from './actions';\nimport { useStore } from '../hooks/useStore';\nimport useSelector from '../hooks/useSelector';\nimport { useConfig } from '../hooks/useConfig';\nimport { throttle } from '../util/throttle';\n\nexport function Container() {\n const config = useConfig();\n const { dispatch } = useStore();\n const status = useSelector((state) => state.status);\n const data = useSelector((state) => state.data);\n const tableRef = useSelector((state) => state.tableRef);\n const tempRef = createRef();\n\n const processPipeline = throttle(async () => {\n dispatch(actions.SetLoadingData());\n\n try {\n const data = await config.pipeline.process();\n dispatch(actions.SetData(data));\n\n // TODO: do we need this setTimemout?\n setTimeout(() => {\n dispatch(actions.SetStatusToRendered());\n }, 0);\n } catch (e) {\n log.error(e);\n dispatch(actions.SetDataErrored());\n }\n }, config.processingThrottleMs);\n\n useEffect(() => {\n // set the initial header object\n // we update the header width later when \"data\"\n // is available in the state\n dispatch(actions.SetHeader(config.header));\n\n processPipeline();\n config.pipeline.on('updated', processPipeline);\n\n return () => config.pipeline.off('updated', processPipeline);\n }, []);\n\n useEffect(() => {\n if (config.header && status === Status.Loaded && data?.length) {\n // now that we have the data, let's adjust columns width\n // NOTE: that we only calculate the columns width once\n dispatch(\n actions.SetHeader(config.header.adjustWidth(config, tableRef, tempRef)),\n );\n }\n }, [data, config, tempRef]);\n\n return (\n <div\n role=\"complementary\"\n className={classJoin(\n 'gridjs',\n className('container'),\n status === Status.Loading ? className('loading') : null,\n config.className.container,\n )}\n style={{\n ...config.style.container,\n ...{\n width: config.width,\n },\n }}\n >\n {status === Status.Loading && (\n <div className={className('loading-bar')} />\n )}\n\n <HeaderContainer />\n\n <div className={className('wrapper')} style={{ height: config.height }}>\n <Table />\n </div>\n\n <FooterContainer />\n\n <div ref={tempRef} id=\"gridjs-temp\" className={className('temp')} />\n </div>\n );\n}\n","import { Config } from './config';\nimport { h, render, VNode } from 'preact';\nimport { Container } from './view/container';\nimport log from './util/log';\nimport { EventEmitter } from './util/eventEmitter';\nimport { GridEvents } from './events';\nimport { PluginManager } from './plugin';\nimport { ConfigContext } from './config';\n\nclass Grid extends EventEmitter<GridEvents> {\n public config: Config;\n public plugin: PluginManager;\n\n constructor(config?: Partial<Config>) {\n super();\n this.config = new Config()\n .assign({ instance: this, eventEmitter: this })\n .update(config);\n this.plugin = this.config.plugin;\n }\n\n public updateConfig(config: Partial<Config>): this {\n this.config.update(config);\n return this;\n }\n\n createElement(): VNode {\n return h(ConfigContext.Provider, {\n value: this.config,\n children: h(Container, {}),\n });\n }\n\n /**\n * Uses the existing container and tries to clear the cache\n * and re-render the existing Grid.js instance again. This is\n * useful when a new config is set/updated.\n *\n */\n forceRender(): this {\n if (!this.config || !this.config.container) {\n log.error(\n 'Container is empty. Make sure you call render() before forceRender()',\n true,\n );\n }\n\n this.destroy();\n\n // recreate the Grid instance\n render(this.createElement(), this.config.container);\n\n return this;\n }\n\n /**\n * Deletes the Grid.js instance\n */\n destroy(): void {\n this.config.pipeline.clearCache();\n // TODO: not sure if it's a good idea to render a null element but I couldn't find a better way\n render(null, this.config.container);\n }\n\n /**\n * Mounts the Grid.js instance to the container\n * and renders the instance\n *\n * @param container\n */\n render(container: Element): this {\n if (!container) {\n log.error('Container element cannot be null', true);\n }\n\n if (container.childNodes.length > 0) {\n log.error(\n `The container element ${container} is not empty. Make sure the container is empty and call render() again`,\n );\n return this;\n }\n\n this.config.container = container;\n render(this.createElement(), container);\n\n return this;\n }\n}\n\nexport default Grid;\n"],"names":["Status","n","l","u","i","t","o","r","f","e","c","s","a","parentNode","removeChild","h","arguments","length","children","call","defaultProps","v","type","props","key","ref","__k","__","__b","__e","__d","__c","__h","constructor","__v","vnode","y","current","p","d","this","context","_","indexOf","k","base","b","push","g","__r","debounceRendering","setTimeout","sort","some","__P","j","__n","ownerSVGElement","z","w","x","C","Array","isArray","m","A","N","M","appendChild","nextSibling","insertBefore","$","setProperty","test","H","style","cssText","replace","toLowerCase","slice","addEventListener","T","I","removeEventListener","removeAttribute","setAttribute","event","contextType","value","__E","prototype","render","O","sub","state","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","L","diffed","localName","nodeType","document","createTextNode","createElementNS","createElement","is","data","childNodes","dangerouslySetInnerHTML","attributes","name","__html","innerHTML","checked","unmount","componentWillUnmount","P","firstChild","Math","random","toString","getDerivedStateFromError","setState","componentDidCatch","forceUpdate","Base","id","_id","generateUUID","_createClass","HTMLElement","parentElement","content","html","Cell","ProcessorType","_Base","_this","update","_inheritsLoose","_proto","cast","outerHTML","Row","cells","_cells","cell","index","toArray","map","fromCells","get","set","Tabular","rows","_rows","_length","row","fromRows","fromArray","oneDtoTwoD","len","EventEmitter","callbacks","init","listeners","on","listener","off","eventName","filter","emit","_arguments","apply","deepEqual","obj1","obj2","hasOwnProperty","keys1","Object","keys","keys2","_i","_keys","PipelineProcessor","_EventEmitter","_props","setProps","process","args","validateProps","_process","concat","updatedProps","_extends","GlobalSearchFilter","keyword","String","trim","columns","ignoreHiddenColumns","tabular","selector","rowIndex","cellIndex","hidden","element","Filter","className","prefix","reduce","prev","cur","ServerGlobalSearchFilter","options","updates","url","body","ServerFilter","__H","__V","B","__N","every","F","shift","requestAnimationFrame","clearTimeout","cancelAnimationFrame","useContext","ConfigContext","enUS","search","placeholder","sortAsc","sortDesc","pagination","previous","next","navigate","page","pages","showing","of","to","results","loading","noRecordsFound","error","Translator","language","_language","_defaultLanguage","getString","message","lang","splitted","split","val","join","translate","messageFormat","translated","useTranslator","config","useConfig","_config$translator","translator","payload","store","useSelector","useStore","_useState","useState","getState","setCurrent","useEffect","subscribe","updated","Search","_config$className","undefined","processor","setProcessor","dispatch","server","header","actions","pipeline","register","unregister","func","waitFor","timeout","debouncedOnInput","useCallback","target","HTMLInputElement","debounceTimeout","resolve","classJoin","onInput","defaultValue","PaginationLimit","isNaN","Number","limit","Error","Limit","ServerPaginationLimit","ServerLimit","Pagination","_config$pagination","summary","_config$pagination$su","_config$pagination$ne","nextButton","_config$pagination$pr","prevButton","_config$pagination$bu","buttonsCount","_config$pagination$li","_config$pagination$pa","_config$pagination$re","resetPageOnUpdate","useRef","currentPage","setCurrentPage","total","setTotal","_useState2","onUpdate","updatedProcessor","ceil","setPage","Fragment","role","paginationSummary","title","min","tabIndex","disabled","onClick","paginationButton","paginationButtonPrev","maxCount","pagePivot","floor","from","paginationButtonCurrent","renderPages","paginationButtonNext","width","containerWidth","parseInt","px","ShadowTable","shadowTable","tableRef","cloneNode","position","zIndex","visibility","nodeElement","camelCase","str","words","word","charAt","toUpperCase","PluginPosition","log","Logger","format","throwException","msg","console","warn","info","PluginManager","plugins","find","add","plugin","remove","splice","list","order","PluginRenderer","pluginId","component","Header","_columns","adjustWidth","tempRef","container","autoWidth","clientWidth","widths","getShadowTableWidths","querySelector","tableElement","tableClassName","tableStyle","tableLayout","padding","margin","border","outline","querySelectorAll","getAttribute","minWidth","obj","_step","_iterator","_createForOfIteratorHelperLoose","tabularFormat","done","column","setSort","sortConfig","cols","_step2","setResizable","resizable","_step3","_iterator3","setID","_step4","_iterator4","logger","populatePlugins","pluginManager","_step5","_iterator5","fromColumns","_step6","_iterator6","isValidElement","typedColumn","createFromConfig","fromHTMLTable","_step7","_iterator7","th","result","_step8","_iterator8","col","nextRow","leafColumns","_step9","_iterator9","maximumDepth","Storage","MemoryStorage","_Storage","Promise","reject","ServerStorage","handler","response","handle","ok","json","status","statusText","opts","fetch","then","bind","res","StorageUtils","storage","tableElementToArray","display","arr","parsedRow","_iterator2","Node","TEXT_NODE","DOMParser","parseFromString","documentElement","textContent","pact","_settle","observer","_Pact","onFulfilled","onRejected","callback","_isSettledPact","thenable","Pipeline","steps","_steps","cache","Map","lastProcessorIndexUpdated","step","clearCache","priority","findProcessorIndexByID","processorPropsUpdated","addProcessorByPriority","afterRegistered","tryRegister","subSteps","proc","newSubStep","second","first","getStepsByType","getSortedProcessorTypes","_temp3","_result","_this2","_temp2","array","check","_cycle","processorIndex","_processor$process","_catch","processorID","findIndex","setLastProcessorIndex","StorageExtractor","Extractor","arrayResponse","ArrayToTabularTransformer","Transformer","ServerInitiator","_PipelineProcessor","entries","serverStorageOptions","_ref","acc","_extends2","Initiator","StorageResponseToArrayTransformer","castData","pad","storageResponse","PipelineUtils","initialState","isDispatching","getListeners","reducer","prevState","lis","Consumer","Provider","createContext","Config","assign","defaultConfig","partialConfig","fromPartialConfig","Store","Init","height","processingThrottleMs","multiColumn","Footer","TD","colSpan","td","messageCell","eventEmitter","formatter","TR","tr","messageRow","getColumn","MessageRow","TBody","headerLength","visibleColumns","tbody","Loading","Rendered","notfound","NativeSort","condition","direction","compare","cellA","cellB","compareWrapper","cmp","sortedRows","sorted","Sort","multi","_state$sort","reset","count","_index2","SortToggle","SortColumn","ServerSort","setDirection","processorType","getSortProcessor","processors","currentColumn","_props$direction","getSortClassName","preventDefault","stopPropagation","shiftKey","throttle","fn","wait","timeoutId","lastTime","Date","now","execute","currentTime","elapsed","Resize","getPageX","MouseEvent","pageX","changedTouches","start","offsetStart","thRef","moveFn","move","end","thElement","onMouseDown","onTouchStart","TH","setStyle","fixedHeader","offsetTop","top","isSortable","SortActions","onKeyDown","which","rowSpan","THead","thead","renderRow","totalRows","columnIndex","calculateRowColSpans","depth","remainingRows","_calculateRowColSpans","renderColumn","SetHeader","Table","table","HeaderContainer","isActive","setIsActive","headerRef","FooterContainer","footerRef","footer","Container","processPipeline","Loaded","_temp","Grid","instance","_assertThisInitialized","updateConfig","forceRender","destroy"],"mappings":"k5DAiECA,GAND,SAAYA,GACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,QAAA,GAAA,UACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,MAAA,GAAA,OACD,CAND,CAAYA,IAAAA,EAMX,CAAA,ICjED,IAAIC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,CAAE,EAACC,EAAE,GAAGC,EAAE,oEAAoE,SAASC,EAAEV,EAAEC,GAAG,IAAI,IAAIC,KAAKD,EAAED,EAAEE,GAAGD,EAAEC,GAAG,OAAOF,CAAC,CAAC,SAASW,EAAEX,GAAG,IAAIC,EAAED,EAAEY,WAAWX,GAAGA,EAAEY,YAAYb,EAAE,CAAC,SAASc,EAAEb,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAEC,EAAE,CAAE,EAAC,IAAID,KAAKJ,EAAE,OAAOI,EAAEF,EAAEF,EAAEI,GAAG,OAAOA,EAAED,EAAEH,EAAEI,GAAGC,EAAED,GAAGJ,EAAEI,GAAG,GAAGS,UAAUC,OAAO,IAAIT,EAAEU,SAASF,UAAUC,OAAO,EAAEhB,EAAEkB,KAAK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