@inandu-solutions/grid-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/components/InanduGrid.d.ts +97 -0
  4. package/dist/core/aggregate.d.ts +5 -0
  5. package/dist/core/columns.d.ts +11 -0
  6. package/dist/core/constants.d.ts +14 -0
  7. package/dist/core/export/csv.d.ts +2 -0
  8. package/dist/core/export/download.d.ts +2 -0
  9. package/dist/core/export/markup.d.ts +2 -0
  10. package/dist/core/export/pdf.d.ts +3 -0
  11. package/dist/core/filter.d.ts +26 -0
  12. package/dist/core/format.d.ts +24 -0
  13. package/dist/core/i18n/en.d.ts +46 -0
  14. package/dist/core/i18n/es.d.ts +46 -0
  15. package/dist/core/i18n/fr.d.ts +46 -0
  16. package/dist/core/i18n/index.d.ts +8 -0
  17. package/dist/core/i18n/it.d.ts +46 -0
  18. package/dist/core/i18n/zh.d.ts +46 -0
  19. package/dist/core/index.d.ts +16 -0
  20. package/dist/core/parse.d.ts +14 -0
  21. package/dist/core/sort.d.ts +1 -0
  22. package/dist/core/tree.d.ts +28 -0
  23. package/dist/core/types.d.ts +46 -0
  24. package/dist/hooks/useInanduGrid.d.ts +187 -0
  25. package/dist/html2canvas-BE2ZQbtv.js +4021 -0
  26. package/dist/html2canvas-o9-HsXBE.cjs +5 -0
  27. package/dist/inandu-grid-react.cjs +2 -0
  28. package/dist/inandu-grid-react.js +1656 -0
  29. package/dist/index.d.ts +11 -0
  30. package/dist/index.es-BqzICVsf.cjs +5 -0
  31. package/dist/index.es-CPZG9pTc.js +5752 -0
  32. package/dist/jspdf.es.min-D_8zJvYC.cjs +78 -0
  33. package/dist/jspdf.es.min-DiTFVZBc.js +18250 -0
  34. package/dist/purify.es-3_UFdOhH.js +805 -0
  35. package/dist/purify.es-DXMFKXT6.cjs +3 -0
  36. package/dist/utils/exporters.d.ts +29 -0
  37. package/dist/utils/measureColumn.d.ts +15 -0
  38. package/dist/utils/translate.d.ts +10 -0
  39. package/package.json +89 -0
@@ -0,0 +1,3 @@
1
+ function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,i){return t(e)||n(e,i)||a(e,i)||r()}function a(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var o=Object.entries,s=Object.setPrototypeOf,c=Object.isFrozen,l=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,f=Object.seal,p=Object.create,m=typeof Reflect<`u`&&Reflect,h=m.apply,ee=m.construct;d||=function(e){return e},f||=function(e){return e},h||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},ee||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var g=w(Array.prototype.forEach),te=w(Array.prototype.lastIndexOf),ne=w(Array.prototype.pop),re=w(Array.prototype.push),ie=w(Array.prototype.splice),_=Array.isArray,ae=w(String.prototype.toLowerCase),oe=w(String.prototype.toString),se=w(String.prototype.match),v=w(String.prototype.replace),ce=w(String.prototype.indexOf),le=w(String.prototype.trim),ue=w(Number.prototype.toString),de=w(Boolean.prototype.toString),fe=typeof BigInt>`u`?null:w(BigInt.prototype.toString),y=typeof Symbol>`u`?null:w(Symbol.prototype.toString),b=w(Object.prototype.hasOwnProperty),x=w(Object.prototype.toString),S=w(RegExp.prototype.test),C=pe(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return h(e,t,r)}}function pe(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ee(e,n)}}function T(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ae;if(s&&s(e,null),!_(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(c(t)||(t[r]=e),i=e)}e[i]=!0}return e}function E(e){for(let t=0;t<e.length;t++)b(e,t)||(e[t]=null);return e}function D(e){let t=p(null);for(let r of o(e)){var n=i(r,2);let a=n[0],o=n[1];b(e,a)&&(t[a]=_(o)?E(o):o&&typeof o==`object`&&o.constructor===Object?D(o):o)}return t}function me(e){switch(typeof e){case`string`:return e;case`number`:return ue(e);case`boolean`:return de(e);case`bigint`:return fe?fe(e):`0`;case`symbol`:return y?y(e):`Symbol()`;case`undefined`:return x(e);case`function`:case`object`:{if(e===null)return x(e);let t=e,n=O(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:x(e)}return x(e)}default:return x(e)}}function O(e,t){for(;e!==null;){let n=u(e,t);if(n){if(n.get)return w(n.get);if(typeof n.value==`function`)return w(n.value)}e=l(e)}function n(){return null}return n}function he(e){try{return S(e,``),!0}catch{return!1}}var ge=d(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),_e=d(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ve=d([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ye=d([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),be=d(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),xe=d([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Se=d([`#text`]),Ce=d(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),we=d(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Te=d(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ee=d([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),De=f(/{{[\w\W]*|^[\w\W]*}}/g),Oe=f(/<%[\w\W]*|^[\w\W]*%>/g),ke=f(/\${[\w\W]*/g),Ae=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),je=f(/^aria-[\-\w]+$/),Me=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ne=f(/^(?:\w+script|data):/i),Pe=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fe=f(/^html$/i),Ie=f(/^[a-z][.\w]*(-[.\w]+)+$/i),Le=f(/<[/\w!]/g),Re=f(/<[/\w]/g),ze=f(/<\/no(script|embed|frames)/i),Be=f(/\/>/i),k={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},A=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Ve=d(T({},A)),He=function(){let e={};return g(A,t=>{e[t]=f(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),d(e)}(),Ue=function(){return typeof window>`u`?null:window},We=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ge=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return b(e,t)&&_(e[t])?T(r.base?D(r.base):{},e[t],r.transform):n},Ke=function(e,t,n){let r=b(e,t)?e[t]:void 0;return r&&typeof r==`object`?D(r):n()};function qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ue(),t=e=>qe(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==k.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,s=e.Node,c=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,m=e.trustedTypes,h=c.prototype,ee=O(h,`cloneNode`),ue=O(h,`remove`),de=O(h,`removeAttributeNode`),fe=O(h,`nextSibling`),y=O(h,`childNodes`),x=O(h,`parentNode`),w=O(h,`shadowRoot`),pe=O(h,`attributes`),E=s&&s.prototype?O(s.prototype,`nodeType`):null,A=s&&s.prototype?O(s.prototype,`nodeName`):null,Je=s&&s.prototype?O(s.prototype,`ownerDocument`):null,Ye=function(e){return E?E(e):e.nodeType},Xe=function(e){return A?A(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let M,N=``,Ze,Qe=!1,$e=0,et=function(){if($e>0)throw C(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},P=function(e){et(),$e++;try{return M.createHTML(e)}finally{$e--}},tt=function(e){et(),$e++;try{return M.createScriptURL(e)}finally{$e--}},nt=function(){return Qe||=(Ze=We(m,i),!0),Ze},rt=n,it=rt.implementation,at=rt.createNodeIterator,ot=rt.createDocumentFragment,st=rt.getElementsByTagName,ct=r.importNode,F=Ge();t.isSupported=typeof o==`function`&&typeof x==`function`&&it&&it.createHTMLDocument!==void 0;let lt=De,ut=Oe,dt=ke,ft=Ae,pt=je,mt=Ne,ht=Pe,gt=Ie,_t=Me,I=null,vt=T({},[...ge,..._e,...ve,...be,...Se]),L=null,yt=T({},[...Ce,...we,...Te,...Ee]),R=Object.seal(p(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bt=null,xt=null,z=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),St=!0,Ct=!0,wt=!1,Tt=!0,B=!1,V=!0,H=!1,Et=!1,Dt=null,Ot=null,kt=!1,U=!1,At=!1,jt=!1,Mt=!0,Nt=!1,Pt=`user-content-`,Ft=!0,It=!1,W={},G=null,Lt=T({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Rt=null,zt=T({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Bt=null,Vt=T({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ht=`http://www.w3.org/1998/Math/MathML`,Ut=`http://www.w3.org/2000/svg`,K=`http://www.w3.org/1999/xhtml`,q=K,Wt=!1,Gt=null,Kt=T({},[Ht,Ut,K],oe),qt=d([`mi`,`mo`,`mn`,`ms`,`mtext`]),Jt=T({},qt),Yt=d([`annotation-xml`]),Xt=T({},Yt),Zt=T({},[`title`,`style`,`font`,`a`,`script`]),Qt=null,$t=[`application/xhtml+xml`,`text/html`],J=null,Y=null,en=n.createElement(`form`),tn=function(e){return e instanceof RegExp||e instanceof Function},nn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Y&&Y===e)return;(!e||typeof e!=`object`)&&(e={}),e=D(e),Qt=$t.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Qt===`application/xhtml+xml`?oe:ae,I=j(e,`ALLOWED_TAGS`,vt,{transform:J}),L=j(e,`ALLOWED_ATTR`,yt,{transform:J}),Gt=j(e,`ALLOWED_NAMESPACES`,Kt,{transform:oe}),Bt=j(e,`ADD_URI_SAFE_ATTR`,Vt,{transform:J,base:Vt}),Rt=j(e,`ADD_DATA_URI_TAGS`,zt,{transform:J,base:zt}),G=j(e,`FORBID_CONTENTS`,Lt,{transform:J}),bt=j(e,`FORBID_TAGS`,D({}),{transform:J}),xt=j(e,`FORBID_ATTR`,D({}),{transform:J}),W=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?D(e.USE_PROFILES):e.USE_PROFILES:!1,St=e.ALLOW_ARIA_ATTR!==!1,Ct=e.ALLOW_DATA_ATTR!==!1,wt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Tt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,V=e.SAFE_FOR_XML!==!1,H=e.WHOLE_DOCUMENT||!1,U=e.RETURN_DOM||!1,At=e.RETURN_DOM_FRAGMENT||!1,jt=e.RETURN_TRUSTED_TYPE||!1,kt=e.FORCE_BODY||!1,Mt=e.SANITIZE_DOM!==!1,Nt=e.SANITIZE_NAMED_PROPS||!1,Ft=e.KEEP_CONTENT!==!1,It=e.IN_PLACE||!1,_t=he(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Me,q=typeof e.NAMESPACE==`string`?e.NAMESPACE:K,Jt=Ke(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>T({},qt)),Xt=Ke(e,`HTML_INTEGRATION_POINTS`,()=>T({},Yt));let t=Ke(e,`CUSTOM_ELEMENT_HANDLING`,()=>p(null));if(R=p(null),b(t,`tagNameCheck`)&&tn(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&tn(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),f(R),B&&(Ct=!1),At&&(U=!0),W&&(I=T({},Se),L=p(null),W.html===!0&&(T(I,ge),T(L,Ce)),W.svg===!0&&(T(I,_e),T(L,we),T(L,Ee)),W.svgFilters===!0&&(T(I,ve),T(L,we),T(L,Ee)),W.mathMl===!0&&(T(I,be),T(L,Te),T(L,Ee))),z.tagCheck=null,z.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:_(e.ADD_TAGS)&&(I===vt&&(I=D(I)),T(I,e.ADD_TAGS,J))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:_(e.ADD_ATTR)&&(L===yt&&(L=D(L)),T(L,e.ADD_ATTR,J))),b(e,`ADD_FORBID_CONTENTS`)&&_(e.ADD_FORBID_CONTENTS)&&(G===Lt&&(G=D(G)),T(G,e.ADD_FORBID_CONTENTS,J)),Ft&&(I[`#text`]=!0),H&&T(I,[`html`,`head`,`body`]),I.table&&(T(I,[`tbody`]),delete bt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=M;M=e.TRUSTED_TYPES_POLICY;try{N=P(``)}catch(e){throw M=t,e}}else e.TRUSTED_TYPES_POLICY===null?(M=void 0,N=``):(M===void 0&&(M=nt()),M&&typeof N==`string`&&(N=P(``)));d&&d(e),Y=e},rn=T({},[..._e,...ve,...ye]),an=T({},[...be,...xe]),on=function(e,t,n){return t.namespaceURI===K?e===`svg`:t.namespaceURI===Ht?e===`svg`&&(n===`annotation-xml`||Jt[n]):!!rn[e]},sn=function(e,t,n){return t.namespaceURI===K?e===`math`:t.namespaceURI===Ut?e===`math`&&Xt[n]:!!an[e]},cn=function(e,t,n){return t.namespaceURI===Ut&&!Xt[n]||t.namespaceURI===Ht&&!Jt[n]?!1:!an[e]&&(Zt[e]||!rn[e])},ln=function(e){let t=x(e);(!t||!t.tagName)&&(t={namespaceURI:q,tagName:`template`});let n=ae(e.tagName),r=ae(t.tagName);return Gt[e.namespaceURI]?e.namespaceURI===Ut?on(n,t,r):e.namespaceURI===Ht?sn(n,t,r):e.namespaceURI===K?cn(n,t,r):!!(Qt===`application/xhtml+xml`&&Gt[e.namespaceURI]):!1},X=function(e){re(t.removed,{element:e});try{x(e).removeChild(e)}catch{if(ue(e),!x(e))throw C(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},un=function(e,t,n){try{de(e,t)}catch{try{e.removeAttribute(n)}catch{}}},dn=function(e){pn(e);let t=y(e);if(t){let e=[];g(t,t=>{re(e,t)}),g(e,e=>{try{ue(e)}catch{}})}let n=pe(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&un(e,r,i)}},Z=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}re(t.removed,{attribute:r||null,from:n});try{r?de(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(U||At)try{X(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},fn=function(e){let t=pe(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||L[J(i)]||un(e,r,i)}},pn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();Ye(e)===k.element&&fn(e);let n=y(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},mn=function(e,t){return V?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},hn=function(e){if(!V)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=Ye(e);if(n===k.processingInstruction||n===k.comment&&S(Re,e.data)){try{ue(e)}catch{}continue}if(n===k.element){let t=e,n=J(Xe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&mn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=y(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},gn=function(e){let t=null,r=null;if(kt)e=`<remove></remove>`+e;else{let t=se(e,/^[\r\n\t ]+/);r=t&&t[0]}Qt===`application/xhtml+xml`&&q===K&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=M?P(e):e;if(q===K)try{t=new u().parseFromString(i,Qt)}catch{}if(!t||!t.documentElement){t=it.createDocument(q,`template`,null);try{t.documentElement.innerHTML=Wt?N:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),q===K?st.call(t,H?`html`:`body`)[0]:H?t.documentElement:a},_n=function(e){let t=Je?Je(e):e.ownerDocument;return at.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},vn=function(e){return e=v(e,lt,` `),e=v(e,ut,` `),e=v(e,dt,` `),e},yn=function(e){e.normalize();let t=Je?Je(e):e.ownerDocument,n=at.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=vn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&g(i,e=>{Q(e.content)&&yn(e.content)})},bn=function(e){let t=A?A(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==pe(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==E(e)||e.childNodes!==y(e)},Q=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return E(e)===k.documentFragment}catch{return!1}},xn=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return typeof E(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&g(e,e=>{e.call(t,n,r,Y)})}let Sn=function(e,t){return!!(V&&e.hasChildNodes()&&!xn(e.firstElementChild)&&S(Le,e.textContent)&&S(Le,e.innerHTML)||V&&e.namespaceURI===K&&Ve[t]&&(xn(e.firstElementChild)||typeof e.textContent==`string`&&S(He[t],e.textContent))||e.nodeType===k.processingInstruction||V&&e.nodeType===k.comment&&S(Re,e.data))},Cn=function(e,t){if(e instanceof RegExp)return S(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},wn=function(e,t,n){if(!bt[t]&&An(t)&&Cn(R.tagNameCheck,t))return!1;if(Ft&&!G[t]){let t=x(e),r=y(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,fe(e))}}}return X(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?D(t):t},En=function(e,t){return e===t||x(e)!==null?!1:(It&&pn(e),!0)},Dn=function(e,n){if($(F.beforeSanitizeElements,e,null),En(e,n))return!0;if(bn(e))return X(e),!0;let r=J(Xe(e));if(I=Tn(F.uponSanitizeElement,I,vt,Dt),$(F.uponSanitizeElement,e,{tagName:r,allowedTags:I}),En(e,n))return!0;if(Sn(e,r))return X(e),!0;if(bt[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!I[r]){let t=wn(e,r,n);return t===!1&&$(F.afterSanitizeElements,e,null),t}if(Ye(e)===k.element&&!ln(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&S(ze,e.innerHTML))return X(e),!0;if(B&&e.nodeType===k.text){let n=vn(e.textContent);e.textContent!==n&&(re(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(F.afterSanitizeElements,e,null),!1},On=function(e,t,r){if(xt[t]||mn(t,e)||Mt&&(t===`id`||t===`name`)&&(r in n||r in en))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);return Ct&&S(ft,t)||St&&S(pt,t)?!0:i?Bt[t]||S(_t,v(r,ht,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ce(r,`data:`)===0&&Rt[e]||wt&&!S(mt,v(r,ht,``))?!0:!r:An(e)&&Cn(R.tagNameCheck,e)&&Cn(R.attributeNameCheck,t,e)||t===`is`&&R.allowCustomizedBuiltInElements&&Cn(R.tagNameCheck,r)},kn=T({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[ae(e)]&&S(gt,e)},jn=function(e,t,n,r){if(M&&typeof m==`object`&&typeof m.getAttributeType==`function`&&!n)switch(m.getAttributeType(e,t)){case`TrustedHTML`:return P(r);case`TrustedScriptURL`:return tt(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!bn(e)||(X(e),!1)}catch{return Z(t,e),!1}},Nn=function(e){$(F.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||bn(e))return;L=Tn(F.uponSanitizeAttribute,L,yt,Ot);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},i=n.length,a=J(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=J(s),d=l,f=s===`value`?d:le(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,r),f=r.attrValue,Nt&&(u===`id`||u===`name`)&&ce(f,Pt)!==0&&(Z(s,e,o),f=Pt+f,p=!0),V&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Z(s,e,o);continue}if(u===`attributename`&&se(f,`href`)){Z(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){Z(s,e,o);continue}if(!Tt&&S(Be,f)){Z(s,e,o);continue}if(B&&(f=vn(f)),!On(a,u,f)){Z(s,e,o);continue}f=jn(a,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&ne(t.removed)}}$(F.afterSanitizeAttributes,e,null)},Pn=function(e){let t=null,n=_n(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t),Q(t.content)&&Pn(t.content),Ye(t)===k.element){let e=w(t);Q(e)&&(Fn(e),Pn(e))}$(F.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=Ye(n)===k.element,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=A?A(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;Q(e)&&t.push({node:e,shadow:null})}}if(r){let e=w(n);Q(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Wt=!e,Wt&&(e=`<!-->`),typeof e!=`string`&&!xn(e)&&(e=me(e),typeof e!=`string`))throw C(`dirty is not a string, aborting`);if(!t.isSupported)return e;Et?(I=Dt,L=Ot):nn(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(I=D(I)),F.uponSanitizeAttribute.length>0&&(L=D(L)),t.removed=[];let c=It&&typeof e!=`string`&&xn(e);if(c){hn(e);let t=Xe(e);if(typeof t==`string`){let n=J(t);if(!I[n]||bt[n])throw dn(e),C(`root node is forbidden and cannot be sanitized in-place`)}if(bn(e))throw dn(e),C(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw dn(e),t}}else if(xn(e))i=gn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===k.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!U&&!B&&!H&&e.indexOf(`<`)===-1)return M&&jt?P(e):e;if(i=gn(e),!i)return U?null:jt?N:``}i&&kt&&X(i.firstChild);let l=c?e:i;try{let e=_n(l);for(;o=e.nextNode();)Dn(o,l),Nn(o),Q(o.content)&&Pn(o.content)}catch(n){throw c&&(dn(e),g(t.removed,e=>{e.element&&pn(e.element)})),n}if(c)return g(t.removed,e=>{e.element&&pn(e.element)}),B&&yn(e),e;if(U){if(B&&yn(i),At)for(s=ot.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=ct.call(r,s,!0)),s}let u=H?i.outerHTML:i.innerHTML;return H&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(Fe,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+u),B&&(u=vn(u)),M&&jt?P(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nn(e),Et=!0,Dt=I,Ot=L},t.clearConfig=function(){Y=null,Et=!1,Dt=null,Ot=null,M=Ze,N=``},t.isValidAttribute=function(e,t,n){Y||nn({});let r=J(e),i=J(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&b(F,e)&&re(F[e],t)},t.removeHook=function(e,t){if(b(F,e)){if(t!==void 0){let n=te(F[e],t);return n===-1?void 0:ie(F[e],n,1)[0]}return ne(F[e])}},t.removeHooks=function(e){b(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=Ge()},t}var Je=qe();exports.default=Je;
@@ -0,0 +1,29 @@
1
+ import { InanduGridRow } from '../core';
2
+ import { InanduGridColumn } from '../hooks/useInanduGrid';
3
+ /**
4
+ * Ported from grid-angular's `exportCsv()` — same column/row source, same formatted-value rule,
5
+ * same UTF-8 BOM (so Excel opens accented text as UTF-8 instead of Latin-1).
6
+ */
7
+ export declare function buildCsv(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string): string;
8
+ export declare function exportCsv(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): void;
9
+ /**
10
+ * Ported from grid-angular's `exportExcel()` — dependency-free SpreadsheetML XML that Excel 2003+,
11
+ * LibreOffice and Google Sheets all open natively. A numeric column stays genuinely numeric-typed
12
+ * in the sheet; everything else is a formatted string. A real binary `.xlsx` is a grid-pro feature.
13
+ */
14
+ export declare function buildExcelXml(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string): string;
15
+ export declare function exportExcel(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): void;
16
+ /**
17
+ * Ported from grid-angular's `exportPdf()` — one simple table drawn with jsPDF's low-level
18
+ * text/line primitives (not the `autotable` plugin), single-line cells truncated with an ellipsis,
19
+ * header redrawn on every new page. Columns split the page width evenly (grid-angular instead
20
+ * weights by each column's live pixel width — not meaningful yet here, no column-resize feature).
21
+ * `jspdf` is dynamically imported so a grid that never exports to PDF never pays to load it.
22
+ */
23
+ /**
24
+ * Ported from grid-angular's `printTable()` — opens a new tab with a plain, print-styled `<table>`
25
+ * of `rows` and triggers the browser's print dialog on it, rather than printing the live page
26
+ * (which would include the toolbar, pager, and any surrounding app chrome).
27
+ */
28
+ export declare function printTable(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, title?: string): void;
29
+ export declare function exportPdf(rows: InanduGridRow[], columns: InanduGridColumn[], locale: string, filenameBase?: string): Promise<void>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Widest rendered value in a column (its header and every currently-rendered data cell), measured
3
+ * against that column's own computed font, plus the cell's horizontal padding. Reads only what's
4
+ * in the DOM right now — one page, or the virtual window — so it's O(visible rows). Returns `0` if
5
+ * the column has no rendered cell to measure. Ported verbatim from grid-angular's
6
+ * `measureColumnContentWidth()` (`onResizeHandleDblClick`'s autosize).
7
+ *
8
+ * Genuinely needs a real layout engine to return anything meaningful — `offsetWidth`/
9
+ * `getComputedStyle` are always `0`/defaults in jsdom, so this can't be *end-to-end* verified in a
10
+ * unit test the way the rest of the port is. What test coverage there is stubs `offsetWidth`
11
+ * itself and checks the surrounding logic (which cells get measured, the padding/reserved-space
12
+ * math, the `0` "nothing to measure" case) — the measurement call itself is trusted to work in a
13
+ * real browser, same as any other `getBoundingClientRect()`-dependent code would be.
14
+ */
15
+ export declare function measureColumnContentWidth(host: HTMLElement, field: string, headerText: string): number;
@@ -0,0 +1,10 @@
1
+ import { en } from '../core';
2
+ export type InanduGridMessageKey = keyof typeof en;
3
+ /** Replaces `{{name}}` tokens in `template` with `params[name]`, same mini-syntax the built-in dictionaries use (ngx-translate's, on the Angular side). Leaves an unmatched token as-is. */
4
+ export declare function interpolate(template: string, params?: Record<string, string | number>): string;
5
+ /**
6
+ * Resolves `lang` (a full BCP-47 tag like `'en-US'` or just `'en'`) to one of the built-in
7
+ * dictionaries by primary subtag, falling back to English for an unrecognized one — same fallback
8
+ * behavior `INANDU_GRID_TRANSLATIONS` documents for the Angular side.
9
+ */
10
+ export declare function createTranslator(lang: string): (key: InanduGridMessageKey, params?: Record<string, string | number>) => string;
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@inandu-solutions/grid-react",
3
+ "version": "0.1.0",
4
+ "description": "Standalone React data grid: sorting, free-text and per-column filtering, grouping, pagination, CSV/Excel/PDF export and print, i18n (5 languages) and theming, with a deliberately small dependency footprint. The React port of @inandu-solutions/grid-angular.",
5
+ "keywords": [
6
+ "react",
7
+ "react-grid",
8
+ "react-datagrid",
9
+ "react-table",
10
+ "react-component",
11
+ "data-grid",
12
+ "datagrid",
13
+ "grid",
14
+ "table",
15
+ "data-table",
16
+ "virtual-scroll",
17
+ "pagination",
18
+ "grouping",
19
+ "inline-editing",
20
+ "csv-export",
21
+ "excel-export",
22
+ "i18n",
23
+ "hooks",
24
+ "headless"
25
+ ],
26
+ "license": "MIT",
27
+ "author": {
28
+ "name": "Inandu SAS",
29
+ "url": "https://inandu.com"
30
+ },
31
+ "homepage": "https://github.com/inandusolutions/inandu-grid-react#readme",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/inandusolutions/inandu-grid-react.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/inandusolutions/inandu-grid-react/issues"
38
+ },
39
+ "type": "module",
40
+ "main": "./dist/inandu-grid-react.cjs",
41
+ "module": "./dist/inandu-grid-react.js",
42
+ "types": "./dist/index.d.ts",
43
+ "exports": {
44
+ ".": {
45
+ "types": "./dist/index.d.ts",
46
+ "import": "./dist/inandu-grid-react.js",
47
+ "require": "./dist/inandu-grid-react.cjs"
48
+ }
49
+ },
50
+ "files": [
51
+ "dist"
52
+ ],
53
+ "sideEffects": false,
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "engines": {
58
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
59
+ "npm": ">=10.0.0"
60
+ },
61
+ "scripts": {
62
+ "dev": "vite",
63
+ "build": "vite build",
64
+ "typecheck": "tsc --noEmit",
65
+ "test": "vitest run",
66
+ "test:watch": "vitest"
67
+ },
68
+ "peerDependencies": {
69
+ "react": "^18.0.0 || ^19.0.0",
70
+ "react-dom": "^18.0.0 || ^19.0.0"
71
+ },
72
+ "dependencies": {
73
+ "jspdf": "^4.2.1"
74
+ },
75
+ "devDependencies": {
76
+ "@testing-library/jest-dom": "^7.0.1",
77
+ "@testing-library/react": "^16.3.3",
78
+ "@types/react": "^19.0.0",
79
+ "@types/react-dom": "^19.0.0",
80
+ "@vitejs/plugin-react": "^6.1.1",
81
+ "jsdom": "^30.1.0",
82
+ "react": "^19.0.0",
83
+ "react-dom": "^19.0.0",
84
+ "typescript": "~5.9.3",
85
+ "vite": "^8.3.0",
86
+ "vite-plugin-dts": "^5.1.1",
87
+ "vitest": "^5.0.1"
88
+ }
89
+ }