UNPKG

184 kBSource Map (JSON)View Raw
1{"version":3,"file":"gridjs.mjs","sources":["../src/types.ts","../node_modules/preact/dist/preact.module.js","../src/pipeline/processor.ts","../src/util/id.ts","../src/base.ts","../src/view/htmlElement.tsx","../src/util/html.ts","../src/cell.ts","../src/row.ts","../src/tabular.ts","../src/util/array.ts","../src/util/eventEmitter.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/util/log.ts","../src/plugin.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/view/plugin/resize/resize.tsx","../src/util/throttle.ts","../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","// 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';\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<T, P> {\n propsUpdated: (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<T, P>> {\n public readonly id: ID;\n private readonly _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 Object.assign(this._props, props);\n this.emit('propsUpdated', this);\n return this;\n }\n\n get props(): P {\n return this._props;\n }\n}\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","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","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 config.pipeline.register(processor);\n\n return () => config.pipeline.unregister(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 value={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 } else {\n processor.current = new PaginationLimit({\n limit: limit,\n page: currentPage,\n });\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 config.pipeline.register(processor.current);\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(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 };\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","/**\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 { 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","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<T> {\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: (processor: PipelineProcessor<any, any>) => 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: T) => 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: (prev: T) => void;\n}\n\nclass Pipeline<T, P = unknown> extends EventEmitter<PipelineEvents<T>> {\n // available steps for this pipeline\n private readonly _steps: Map<ProcessorType, PipelineProcessor<T, P>[]> =\n new Map<ProcessorType, PipelineProcessor<T, P>[]>();\n // used to cache the results of processors using their id field\n private cache: Map<string, any> = new Map<string, any>();\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<any, any>[]) {\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, any>();\n this.lastProcessorIndexUpdated = -1;\n }\n\n /**\n * Registers a new processor\n *\n * @param processor\n * @param priority\n */\n register(\n processor: PipelineProcessor<any, any>,\n priority: number = null,\n ): void {\n if (!processor) return;\n\n if (processor.type === null) {\n throw Error('Processor type is not 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\n /**\n * Removes a processor from the list\n *\n * @param processor\n */\n unregister(processor: PipelineProcessor<any, any>): void {\n if (!processor) 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(\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<T, P>[] {\n let steps: PipelineProcessor<T, P>[] = [];\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<T, P>[] {\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?: T): Promise<T> {\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);\n this.cache.set(processor.id, prev);\n } else {\n // cached results already exist\n prev = this.cache.get(processor.id);\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(processor: PipelineProcessor<T, P>): 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 Promise<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: 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 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 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 ? [...state.sort.columns] : [];\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 } else {\n return {\n ...state,\n ...SortColumn(\n index,\n column.direction === 1 ? -1 : 1,\n multi,\n compare,\n )(state),\n };\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 { 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}\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 _ = useTranslator();\n const [direction, setDirection] = useState(0);\n const [processor, setProcessor] = useState<NativeSort | ServerSort>(\n undefined,\n );\n const state = useSelector((state) => state.sort);\n const { dispatch } = useStore();\n const sortConfig = config.sort as GenericSortConfig;\n\n useEffect(() => {\n const processor = getOrCreateSortProcessor();\n if (processor) setProcessor(processor);\n }, []);\n\n useEffect(() => {\n config.pipeline.register(processor);\n\n return () => config.pipeline.unregister(processor);\n }, [config, processor]);\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 setDirection(currentColumn.direction);\n }\n }, [state]);\n\n useEffect(() => {\n if (!processor) return;\n if (!state) return;\n\n processor.setProps({\n columns: state.columns,\n });\n }, [state]);\n\n const getOrCreateSortProcessor = (): NativeSort | null => {\n let processorType = ProcessorType.Sort;\n\n if (sortConfig && typeof sortConfig.server === 'object') {\n processorType = ProcessorType.ServerSort;\n }\n\n const processors = config.pipeline.getStepsByType(processorType);\n\n if (processors.length === 0) {\n // my assumption is that we only have ONE sorting processor in the\n // entire pipeline and that's why I'm displaying a warning here\n let processor;\n\n if (processorType === ProcessorType.ServerSort) {\n processor = new ServerSort({\n columns: state ? state.columns : [],\n ...sortConfig.server,\n });\n } else {\n processor = new NativeSort({\n columns: state ? state.columns : [],\n });\n }\n return processor;\n }\n\n return null;\n };\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) => {\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","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","export const throttle = (fn: (...args) => void, wait = 100) => {\n let inThrottle: boolean;\n let lastFn: ReturnType<typeof setTimeout>;\n let lastTime: number;\n\n return (...args) => {\n if (!inThrottle) {\n fn(...args);\n lastTime = Date.now();\n inThrottle = true;\n } else {\n clearTimeout(lastFn);\n lastFn = setTimeout(() => {\n if (Date.now() - lastTime >= wait) {\n fn(...args);\n lastTime = Date.now();\n }\n }, Math.max(wait - (Date.now() - lastTime), 0));\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 '../../src/hooks/useSelector';\nimport { useConfig } from '../../src/hooks/useConfig';\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 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 const processPipeline = 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 };\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","ProcessorType","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","HTMLElement","parentElement","content","html","Cell","super","update","cast","outerHTML","Row","cells","_cells","cell","index","toArray","map","static","Tabular","rows","_rows","_length","len","row","fromCells","oneDtoTwoD","callbacks","init","listeners","on","listener","off","eventName","filter","emit","args","PipelineProcessor","EventEmitter","_props","setProps","process","validateProps","Function","result","_process","Object","assign","GlobalSearchFilter","Filter","keyword","String","trim","columns","ignoreHiddenColumns","tabular","selector","rowIndex","cellIndex","hidden","element","className","reduce","prev","cur","classNames","ServerGlobalSearchFilter","ServerFilter","options","updates","url","body","__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","useTranslator","config","useConfig","translator","SearchKeyword","payload","_extends","store","useSelector","useStore","setCurrent","useState","getState","useEffect","subscribe","updated","_config$className","processor","setProcessor","undefined","dispatch","server","header","actions","pipeline","register","unregister","debouncedOnInput","useCallback","func","waitFor","timeout","resolve","target","HTMLInputElement","debounce","debounceTimeout","classJoin","onInput","PaginationLimit","isNaN","Number","limit","Error","Limit","ServerPaginationLimit","ServerLimit","Pagination","summary","nextButton","prevButton","buttonsCount","resetPageOnUpdate","useRef","currentPage","setCurrentPage","total","setTotal","onUpdate","updatedProcessor","ceil","setPage","Fragment","role","paginationSummary","title","min","tabIndex","disabled","onClick","paginationButton","paginationButtonPrev","maxCount","pagePivot","floor","from","keys","paginationButtonCurrent","renderPages","paginationButtonNext","width","containerWidth","parseInt","px","ShadowTable","shadowTable","tableRef","cloneNode","position","zIndex","visibility","nodeElement","camelCase","str","words","word","charAt","toUpperCase","PluginPosition","log","format","throwException","msg","console","warn","info","plugins","get","find","add","plugin","remove","splice","list","order","PluginRenderer","pluginId","component","_columns","visibleColumns","adjustWidth","tempRef","container","autoWidth","clientWidth","widths","tableElement","querySelector","tableClassName","tableStyle","tableLayout","padding","margin","border","outline","obj","querySelectorAll","getAttribute","minWidth","getShadowTableWidths","column","Header","tabularFormat","concat","setSort","sortConfig","cols","setResizable","resizable","setID","logger","populatePlugins","pluginManager","isValidElement","typedColumn","fromColumns","fromHTMLTable","ths","th","nextRow","col","leafColumns","Storage","MemoryStorage","set","async","ServerStorage","handler","response","handle","ok","json","status","statusText","opts","fetch","then","bind","res","StorageUtils","storage","tableElementToArray","display","arr","parsedRow","Node","TEXT_NODE","DOMParser","parseFromString","documentElement","textContent","decode","Pipeline","steps","_steps","Map","cache","lastProcessorIndexUpdated","step","clearCache","priority","processorPropsUpdated","addProcessorByPriority","afterRegistered","subSteps","proc","newSubStep","first","second","getSortedProcessorTypes","getStepsByType","findProcessorIndexByID","processorID","findIndex","setLastProcessorIndex","processorIndex","StorageExtractor","Extractor","Transformer","arrayResponse","fromArray","ServerInitiator","Initiator","entries","serverStorageOptions","acc","StorageResponseToArrayTransformer","castData","pad","storageResponse","PipelineUtils","ArrayToTabularTransformer","Store","initialState","isDispatching","getListeners","reducer","prevState","lis","Consumer","Provider","createContext","Config","defaultConfig","partialConfig","fromPartialConfig","Init","PluginManager","height","multiColumn","createFromConfig","Search","Footer","TD","colSpan","td","messageCell","eventEmitter","formatter","tr","messageRow","getColumn","MessageRow","TR","TBody","tbody","Loading","headerLength","Rendered","notfound","NativeSort","condition","direction","Sort","compare","cellA","cellB","compareWrapper","cmp","sortedRows","sorted","SortColumn","multi","count","reset","SortToggle","ServerSort","setDirection","getOrCreateSortProcessor","currentColumn","processorType","getSortClassName","preventDefault","stopPropagation","shiftKey","Resize","moveFn","getPageX","MouseEvent","pageX","changedTouches","start","offsetStart","thRef","fn","wait","inThrottle","lastFn","Date","now","lastTime","max","throttle","move","end","thElement","onMouseDown","onTouchStart","TH","setStyle","fixedHeader","offsetTop","top","isSortable","SortActions","onKeyDown","which","rowSpan","getCustomAttributes","THead","thead","totalRows","columnIndex","calculateRowColSpans","depth","maximumDepth","remainingRows","renderColumn","renderRow","renderRows","SetStatusToRendered","SetHeader","Table","table","HeaderContainer","isActive","setIsActive","headerRef","FooterContainer","footerRef","footer","processPipeline","Loaded","Grid","instance","updateConfig","Container","forceRender","destroy"],"mappings":"wOAiECA,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,ECKJC,EDLMC,EAAE,CAAE,EAACC,EAAE,GAAGC,EAAE,oEAAoE,SAASC,EAAEX,EAAEC,GAAG,IAAI,IAAIC,KAAKD,EAAED,EAAEE,GAAGD,EAAEC,GAAG,OAAOF,CAAC,CAAC,SAASY,EAAEZ,GAAG,IAAIC,EAAED,EAAEa,WAAWZ,GAAGA,EAAEa,YAAYd,EAAE,CAAC,SAASe,EAAEd,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAEE,EAAE,CAAE,EAAC,IAAIF,KAAKJ,EAAE,OAAOI,EAAEF,EAAEF,EAAEI,GAAG,OAAOA,EAAED,EAAEH,EAAEI,GAAGE,EAAEF,GAAGJ,EAAEI,GAAG,GAAGU,UAAUC,OAAO,IAAIT,EAAEU,SAASF,UAAUC,OAAO,EAAEjB,EAAEmB,KAAKH,UAAU,GAAGb,GAAG,mBAAmBF,GAAG,MAAMA,EAAEmB,aAAa,IAAId,KAAKL,EAAEmB,kBAAa,IAASZ,EAAEF,KAAKE,EAAEF,GAAGL,EAAEmB,aAAad,IAAI,OAAOe,EAAEpB,EAAEO,EAAEJ,EAAEC,EAAE,KAAK,CAAC,SAASgB,EAAErB,EAAEG,EAAEC,EAAEC,EAAEC,GAAG,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