@inandu-solutions/grid-react 0.1.2 → 0.1.4
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.
- package/dist/components/InanduGrid.d.ts +99 -0
- package/dist/core/aggregate.d.ts +5 -0
- package/dist/core/columns.d.ts +11 -0
- package/dist/core/constants.d.ts +14 -0
- package/dist/core/dom.d.ts +8 -0
- package/dist/core/export/csv.d.ts +2 -0
- package/dist/core/export/download.d.ts +2 -0
- package/dist/core/export/markup.d.ts +2 -0
- package/dist/core/export/pdf.d.ts +3 -0
- package/dist/core/filter.d.ts +26 -0
- package/dist/core/format.d.ts +24 -0
- package/dist/core/i18n/en.d.ts +46 -0
- package/dist/core/i18n/es.d.ts +46 -0
- package/dist/core/i18n/fr.d.ts +46 -0
- package/dist/core/i18n/index.d.ts +8 -0
- package/dist/core/i18n/it.d.ts +46 -0
- package/dist/core/i18n/zh.d.ts +46 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/parse.d.ts +14 -0
- package/dist/core/sort.d.ts +1 -0
- package/dist/core/tree.d.ts +28 -0
- package/dist/core/types.d.ts +46 -0
- package/dist/hooks/useInanduGrid.d.ts +197 -0
- package/dist/html2canvas-BE2ZQbtv.js +4021 -0
- package/dist/html2canvas-o9-HsXBE.cjs +5 -0
- package/dist/inandu-grid-react.cjs +2 -0
- package/dist/inandu-grid-react.js +1684 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.es-BqzICVsf.cjs +5 -0
- package/dist/index.es-CPZG9pTc.js +5752 -0
- package/dist/jspdf.es.min-D_8zJvYC.cjs +78 -0
- package/dist/jspdf.es.min-DiTFVZBc.js +18250 -0
- package/dist/purify.es-3_UFdOhH.js +805 -0
- package/dist/purify.es-DXMFKXT6.cjs +3 -0
- package/dist/style.css +350 -0
- package/dist/utils/exporters.d.ts +29 -0
- package/dist/utils/measureColumn.d.ts +15 -0
- package/dist/utils/translate.d.ts +10 -0
- package/package.json +4 -2
|
@@ -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;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional default styling for <InanduGrid>. Every selector below targets a className the
|
|
3
|
+
* component already renders (see InanduGrid.tsx) — nothing here is required for the grid to
|
|
4
|
+
* function; skip this file entirely and bring your own CSS if you'd rather start from a blank
|
|
5
|
+
* table. Import once, anywhere in your app:
|
|
6
|
+
*
|
|
7
|
+
* import '@inandu-solutions/grid-react/style.css';
|
|
8
|
+
*
|
|
9
|
+
* Colors/spacing are CSS custom properties on .inandu-grid-react, so overriding the look is just
|
|
10
|
+
* redeclaring them on your own selector — no !important, no rebuilding the package.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.inandu-grid-react {
|
|
14
|
+
--ig-accent: #1a8fae;
|
|
15
|
+
--ig-accent-ink: #ffffff;
|
|
16
|
+
--ig-ink: #1b1f24;
|
|
17
|
+
--ig-muted: #5c6470;
|
|
18
|
+
--ig-border: #e2e5e9;
|
|
19
|
+
--ig-header-bg: #f6f7f8;
|
|
20
|
+
--ig-row-bg: #ffffff;
|
|
21
|
+
--ig-row-alt-bg: #fafbfc;
|
|
22
|
+
--ig-row-hover-bg: #eef6f8;
|
|
23
|
+
--ig-row-selected-bg: #e3f2f6;
|
|
24
|
+
--ig-focus-ring: #1a8fae;
|
|
25
|
+
--ig-danger: #c0392b;
|
|
26
|
+
--ig-radius: 6px;
|
|
27
|
+
--ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
28
|
+
|
|
29
|
+
font-family: var(--ig-font);
|
|
30
|
+
color: var(--ig-ink);
|
|
31
|
+
font-size: 0.92rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.inandu-grid-react * {
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.inandu-grid-react button {
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
font-size: 0.85rem;
|
|
41
|
+
color: var(--ig-ink);
|
|
42
|
+
background: #fff;
|
|
43
|
+
border: 1px solid var(--ig-border);
|
|
44
|
+
border-radius: var(--ig-radius);
|
|
45
|
+
padding: 0.35rem 0.7rem;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.inandu-grid-react button:hover:not(:disabled) {
|
|
50
|
+
border-color: var(--ig-accent);
|
|
51
|
+
color: var(--ig-accent);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.inandu-grid-react button:disabled {
|
|
55
|
+
color: var(--ig-muted);
|
|
56
|
+
cursor: default;
|
|
57
|
+
opacity: 0.6;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.inandu-grid-react input[type='text'],
|
|
61
|
+
.inandu-grid-react input[type='number'],
|
|
62
|
+
.inandu-grid-react input[type='date'],
|
|
63
|
+
.inandu-grid-react select {
|
|
64
|
+
font-family: inherit;
|
|
65
|
+
font-size: 0.85rem;
|
|
66
|
+
color: var(--ig-ink);
|
|
67
|
+
background: #fff;
|
|
68
|
+
border: 1px solid var(--ig-border);
|
|
69
|
+
border-radius: var(--ig-radius);
|
|
70
|
+
padding: 0.3rem 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.inandu-grid-react input:focus-visible,
|
|
74
|
+
.inandu-grid-react select:focus-visible,
|
|
75
|
+
.inandu-grid-react button:focus-visible {
|
|
76
|
+
outline: 2px solid var(--ig-focus-ring);
|
|
77
|
+
outline-offset: 1px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ── search + toolbar ────────────────────────────────────────────────── */
|
|
81
|
+
|
|
82
|
+
.inandu-grid-search {
|
|
83
|
+
margin-bottom: 0.6rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.inandu-grid-search input {
|
|
87
|
+
width: 100%;
|
|
88
|
+
max-width: 320px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.inandu-grid-toolbar {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-wrap: wrap;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 0.5rem;
|
|
96
|
+
margin-bottom: 0.6rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.inandu-grid-column-toggle {
|
|
100
|
+
position: relative;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.inandu-grid-column-toggle summary {
|
|
104
|
+
list-style: none;
|
|
105
|
+
font-size: 0.85rem;
|
|
106
|
+
color: var(--ig-ink);
|
|
107
|
+
background: #fff;
|
|
108
|
+
border: 1px solid var(--ig-border);
|
|
109
|
+
border-radius: var(--ig-radius);
|
|
110
|
+
padding: 0.35rem 0.7rem;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.inandu-grid-column-toggle summary::-webkit-details-marker {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.inandu-grid-column-toggle[open] summary {
|
|
119
|
+
border-color: var(--ig-accent);
|
|
120
|
+
color: var(--ig-accent);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.inandu-grid-column-toggle ul {
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 20;
|
|
126
|
+
list-style: none;
|
|
127
|
+
margin: 0.25rem 0 0;
|
|
128
|
+
padding: 0.4rem;
|
|
129
|
+
min-width: 12rem;
|
|
130
|
+
background: #fff;
|
|
131
|
+
border: 1px solid var(--ig-border);
|
|
132
|
+
border-radius: var(--ig-radius);
|
|
133
|
+
box-shadow: 0 8px 24px -12px rgba(27, 31, 36, 0.3);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.inandu-grid-column-toggle li {
|
|
137
|
+
padding: 0.2rem 0.3rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.inandu-grid-column-toggle label {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
gap: 0.4rem;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.inandu-grid-group-by {
|
|
148
|
+
margin-bottom: 0.6rem;
|
|
149
|
+
color: var(--ig-muted);
|
|
150
|
+
font-size: 0.85rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ── the table itself ────────────────────────────────────────────────── */
|
|
154
|
+
|
|
155
|
+
.inandu-grid-viewport {
|
|
156
|
+
border: 1px solid var(--ig-border);
|
|
157
|
+
border-radius: var(--ig-radius);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.inandu-grid {
|
|
161
|
+
width: 100%;
|
|
162
|
+
border-collapse: collapse;
|
|
163
|
+
border: 1px solid var(--ig-border);
|
|
164
|
+
border-radius: var(--ig-radius);
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.inandu-grid th,
|
|
169
|
+
.inandu-grid td {
|
|
170
|
+
padding: 0.5rem 0.65rem;
|
|
171
|
+
border-bottom: 1px solid var(--ig-border);
|
|
172
|
+
text-align: left;
|
|
173
|
+
vertical-align: middle;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.inandu-grid thead th {
|
|
177
|
+
background: var(--ig-header-bg);
|
|
178
|
+
font-weight: 600;
|
|
179
|
+
position: relative;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
user-select: none;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.inandu-grid thead th.inandu-drag-over {
|
|
186
|
+
background: var(--ig-row-selected-bg);
|
|
187
|
+
box-shadow: inset 2px 0 0 var(--ig-accent);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.inandu-grid-sort-priority {
|
|
191
|
+
margin-inline-start: 0.15rem;
|
|
192
|
+
font-size: 0.65rem;
|
|
193
|
+
color: var(--ig-accent);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.inandu-grid-resize-handle {
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 0;
|
|
199
|
+
right: 0;
|
|
200
|
+
bottom: 0;
|
|
201
|
+
width: 6px;
|
|
202
|
+
cursor: col-resize;
|
|
203
|
+
touch-action: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.inandu-grid-resize-handle:hover {
|
|
207
|
+
background: var(--ig-accent);
|
|
208
|
+
opacity: 0.35;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.inandu-grid-filter-row th {
|
|
212
|
+
background: var(--ig-row-alt-bg);
|
|
213
|
+
padding: 0.35rem 0.5rem;
|
|
214
|
+
cursor: default;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.inandu-grid-filter-row input,
|
|
218
|
+
.inandu-grid-filter-row select {
|
|
219
|
+
width: 100%;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.inandu-grid-filter-range {
|
|
223
|
+
display: flex;
|
|
224
|
+
gap: 0.25rem;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.inandu-grid-filter-range input {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.inandu-grid tbody tr {
|
|
232
|
+
background: var(--ig-row-bg);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.inandu-grid tbody tr:nth-child(even) {
|
|
236
|
+
background: var(--ig-row-alt-bg);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.inandu-grid tbody tr:hover {
|
|
240
|
+
background: var(--ig-row-hover-bg);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.inandu-grid tbody tr[aria-selected='true'] {
|
|
244
|
+
background: var(--ig-row-selected-bg);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.inandu-grid-totals-row td {
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
border-top: 2px solid var(--ig-border);
|
|
250
|
+
background: var(--ig-header-bg);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* ── row actions / drag / detail ─────────────────────────────────────── */
|
|
254
|
+
|
|
255
|
+
.inandu-grid-row-actions {
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
text-align: right;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.inandu-grid-row-actions button {
|
|
261
|
+
margin-inline-start: 0.3rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.inandu-grid-row-drag-handle,
|
|
265
|
+
.inandu-grid-detail-toggle {
|
|
266
|
+
background: none;
|
|
267
|
+
border: none;
|
|
268
|
+
padding: 0.1rem 0.3rem;
|
|
269
|
+
cursor: grab;
|
|
270
|
+
color: var(--ig-muted);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.inandu-grid-detail-toggle {
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.inandu-grid-detail-row td {
|
|
278
|
+
background: var(--ig-row-alt-bg);
|
|
279
|
+
padding: 0.75rem 1rem;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.inandu-grid-new-row td {
|
|
283
|
+
background: var(--ig-row-selected-bg);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* ── grouping ────────────────────────────────────────────────────────── */
|
|
287
|
+
|
|
288
|
+
.inandu-grid-group-row td {
|
|
289
|
+
background: var(--ig-header-bg);
|
|
290
|
+
font-weight: 600;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.inandu-grid-group-aggregates {
|
|
294
|
+
margin-inline-start: 0.6rem;
|
|
295
|
+
font-weight: 400;
|
|
296
|
+
color: var(--ig-muted);
|
|
297
|
+
font-size: 0.85rem;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* ── tree data ───────────────────────────────────────────────────────── */
|
|
301
|
+
|
|
302
|
+
.inandu-grid-tree-cell {
|
|
303
|
+
display: flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
gap: 0.3rem;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.inandu-grid-tree-toggle {
|
|
309
|
+
background: none;
|
|
310
|
+
border: none;
|
|
311
|
+
padding: 0;
|
|
312
|
+
width: 1.1rem;
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
color: var(--ig-muted);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.inandu-grid-tree-toggle-spacer {
|
|
318
|
+
display: inline-block;
|
|
319
|
+
width: 1.1rem;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* ── inline editing ──────────────────────────────────────────────────── */
|
|
323
|
+
|
|
324
|
+
.inandu-grid-edit-cell {
|
|
325
|
+
display: flex;
|
|
326
|
+
flex-direction: column;
|
|
327
|
+
gap: 0.15rem;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.inandu-grid-edit-cell input,
|
|
331
|
+
.inandu-grid-edit-cell select {
|
|
332
|
+
width: 100%;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.inandu-grid-field-error {
|
|
336
|
+
font-size: 0.75rem;
|
|
337
|
+
color: var(--ig-danger);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ── pagination ──────────────────────────────────────────────────────── */
|
|
341
|
+
|
|
342
|
+
.inandu-grid-pagination {
|
|
343
|
+
display: flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
justify-content: center;
|
|
346
|
+
gap: 0.75rem;
|
|
347
|
+
margin-top: 0.6rem;
|
|
348
|
+
color: var(--ig-muted);
|
|
349
|
+
font-size: 0.85rem;
|
|
350
|
+
}
|
|
@@ -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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inandu-solutions/grid-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
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
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,7 +46,9 @@
|
|
|
46
46
|
"import": "./dist/inandu-grid-react.js",
|
|
47
47
|
"require": "./dist/inandu-grid-react.cjs"
|
|
48
48
|
},
|
|
49
|
-
"./style.css":
|
|
49
|
+
"./style.css": {
|
|
50
|
+
"default": "./dist/style.css"
|
|
51
|
+
}
|
|
50
52
|
},
|
|
51
53
|
"files": [
|
|
52
54
|
"dist"
|