@simple-table/react 3.0.0 → 3.0.3

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/README.md CHANGED
@@ -33,4 +33,4 @@ npm install @simple-table/react
33
33
 
34
34
  ## License
35
35
 
36
- Dual licensed — MIT for individuals & startups, proprietary Pro tier for revenue-generating companies. See [LICENSE](LICENSE) and [EULA.txt](../../EULA.txt) for details.
36
+ Dual licensed — MIT for zero-revenue individuals and startups; Pro and Enterprise (commercial EULA) for revenue-generating companies. See [LICENSE](LICENSE), [EULA.txt](../../EULA.txt), and [pricing](https://www.simple-table.com/pricing).
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("simple-table-core"),n=require("react-dom"),o=require("react-dom/client"),c=require("react-dom/server");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}function a({node:t}){const n=r.useRef(null);return r.useLayoutEffect(()=>{const e=n.current;if(e)return e.appendChild(t),()=>{t.parentNode===e&&e.removeChild(t)}},[t]),e.jsx("span",{ref:n,style:{display:"contents"}})}function u(r){if(null!=r)return"string"==typeof r?r:r instanceof Node?e.jsx(a,{node:r}):void 0}function d(r){return t=>{const c=document.createElement("div"),s=o.createRoot(c);return n.flushSync(()=>{s.render(e.jsx(r,Object.assign({},t)))}),c}}function l(r){return t=>{const c=document.createElement("div"),s=o.createRoot(c),i=Object.assign(Object.assign({},t),{searchSection:t.searchSection?u(t.searchSection):null,listSection:u(t.listSection),resetSection:t.resetSection?u(t.resetSection):null});return n.flushSync(()=>{s.render(e.jsx(r,Object.assign({},i)))}),c}}function f(r){const t=document.createElement("div");return t.innerHTML=c.renderToStaticMarkup(e.jsx(e.Fragment,{children:r})),function(e){const r=Array.from(e.childNodes).filter(e=>e.nodeType!==Node.TEXT_NODE||null!=e.textContent&&""!==e.textContent.trim());return 1===r.length&&r[0]instanceof HTMLElement?(e.removeChild(r[0]),r[0]):e}(t)}function p(r){return c.renderToStaticMarkup(e.jsx(e.Fragment,{children:r}))}function m(e){return"function"==typeof e}function b(r){const{cellRenderer:t,headerRenderer:c,children:s,nestedTable:a}=r,u=i(r,["cellRenderer","headerRenderer","children","nestedTable"]),l=Object.assign({},u);var f;if(t&&(l.cellRenderer=(f=t,r=>{const t=document.createElement("div");t.style.display="contents";const c=o.createRoot(t);return n.flushSync(()=>{c.render(e.jsx(f,Object.assign({},r)))}),t})),c&&(l.headerRenderer=d(c)),s&&(l.children=s.map(b)),a){const e=Object.assign(Object.assign({},a),{rows:[]});l.nestedTable=R(e)}return l}function R(r){const{defaultHeaders:t,rows:c,footerRenderer:s,emptyStateRenderer:a,errorStateRenderer:R,loadingStateRenderer:y,tableEmptyStateRenderer:S,headerDropdown:g,columnEditorConfig:j,icons:O}=r,v=i(r,["defaultHeaders","rows","footerRenderer","emptyStateRenderer","errorStateRenderer","loadingStateRenderer","tableEmptyStateRenderer","headerDropdown","columnEditorConfig","icons"]),h=Object.assign(Object.assign({},v),{rows:c,defaultHeaders:t.map(b)});if(void 0!==s&&(h.footerRenderer=d(s)),void 0!==a)if(m(a))h.emptyStateRenderer=d(a);else{const e=a;h.emptyStateRenderer=()=>f(e)}if(void 0!==R)if(m(R))h.errorStateRenderer=d(R);else{const e=R;h.errorStateRenderer=()=>f(e)}if(void 0!==y)if(m(y))h.loadingStateRenderer=d(y);else{const e=y;h.loadingStateRenderer=()=>f(e)}return void 0!==S&&(h.tableEmptyStateRenderer=null===S?null:f(S)),void 0!==g&&(h.headerDropdown=d(g)),void 0!==j&&(h.columnEditorConfig=function(r){const{rowRenderer:t,customRenderer:c}=r,s=i(r,["rowRenderer","customRenderer"]);return Object.assign(Object.assign(Object.assign({},s),t?{rowRenderer:(a=t,r=>{const t=document.createElement("div"),c=o.createRoot(t),s=Object.assign(Object.assign({},r),{components:(i=r.components,{expandIcon:u(i.expandIcon),checkbox:u(i.checkbox),dragIcon:u(i.dragIcon),labelContent:u(i.labelContent),pinIcon:u(i.pinIcon)})});var i;return n.flushSync(()=>{c.render(e.jsx(a,Object.assign({},s)))}),t})}:{}),c?{customRenderer:l(c)}:{});var a}(j)),void 0!==O&&(h.icons=function(e){const r={};for(const[t,n]of Object.entries(e))null!=n&&(r[t]="string"==typeof n||n instanceof HTMLElement||n instanceof SVGElement?n:p(n));return r}(O)),h}"function"==typeof SuppressedError&&SuppressedError;const y=s(r).default.forwardRef(function(n,o){const c=r.useRef(null),s=r.useRef(null),a=r.useRef(void 0),u=n;return r.useLayoutEffect(()=>{if(!c.current)return;let e=!1;return queueMicrotask(()=>{if(e||!c.current)return;const r=new t.SimpleTableVanilla(c.current,R(u));if(r.mount(),s.current=r,o){const e=r.getAPI();"function"==typeof o?o(e):o.current=e}}),()=>{e=!0;const r=s.current;r&&(r.destroy(),s.current=null,a.current=void 0,o&&"function"!=typeof o&&(o.current=null))}},[]),r.useLayoutEffect(()=>{const e=s.current;if(!e)return;const r=R(u);queueMicrotask(()=>{if(s.current!==e)return;if(a.current!==u.defaultHeaders)return a.current=u.defaultHeaders,void e.update(r);const t=i(r,["defaultHeaders"]);e.update(t)})}),e.jsx("div",{ref:c})});y.displayName="SimpleTable",Object.defineProperty(exports,"asRows",{enumerable:!0,get:function(){return t.asRows}}),exports.SimpleTable=y,exports.defaultHeaderFromCore=function(e){return e},exports.defaultHeadersFromCore=function(e){return e},exports.mapToReactHeaderObjects=function(e){return e};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("simple-table-core"),n=require("react-dom"),o=require("react-dom/client"),c=require("react-dom/server");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i({node:r}){const n=t.useRef(null);return t.useLayoutEffect(()=>{const e=n.current;if(e)return e.appendChild(r),()=>{r.parentNode===e&&e.removeChild(r)}},[r]),e.jsx("span",{ref:n,style:{display:"contents"}})}function a(t){if(null!=t)return"string"==typeof t?t:t instanceof Node?e.jsx(i,{node:t}):void 0}function d(e,t){queueMicrotask(()=>{n.flushSync(()=>{e.render(t)})})}function l(t){return r=>{const n=document.createElement("div");return d(o.createRoot(n),e.jsx(t,Object.assign({},r))),n}}function f(t){return r=>{const n=document.createElement("div"),c=o.createRoot(n),s=Object.assign(Object.assign({},r),{searchSection:r.searchSection?a(r.searchSection):null,listSection:a(r.listSection),resetSection:r.resetSection?a(r.resetSection):null});return d(c,e.jsx(t,Object.assign({},s))),n}}function p(t){const r=document.createElement("div");return r.innerHTML=c.renderToStaticMarkup(e.jsx(e.Fragment,{children:t})),function(e){const t=Array.from(e.childNodes).filter(e=>e.nodeType!==Node.TEXT_NODE||null!=e.textContent&&""!==e.textContent.trim());return 1===t.length&&t[0]instanceof HTMLElement?(e.removeChild(t[0]),t[0]):e}(r)}function m(t){return c.renderToStaticMarkup(e.jsx(e.Fragment,{children:t}))}function b(e){return"function"==typeof e}function R(t){const{cellRenderer:r,headerRenderer:n,children:c,nestedTable:s}=t,i=u(t,["cellRenderer","headerRenderer","children","nestedTable"]),a=Object.assign({},i);var f;if(r&&(a.cellRenderer=(f=r,t=>{const r=document.createElement("div");return r.style.display="contents",d(o.createRoot(r),e.jsx(f,Object.assign({},t))),r})),n&&(a.headerRenderer=l(n)),c&&(a.children=c.map(R)),s){const e=Object.assign(Object.assign({},s),{rows:[]});a.nestedTable=y(e)}return a}function y(t){const{defaultHeaders:r,rows:n,footerRenderer:c,emptyStateRenderer:s,errorStateRenderer:i,loadingStateRenderer:y,tableEmptyStateRenderer:j,headerDropdown:g,columnEditorConfig:S,icons:O}=t,v=u(t,["defaultHeaders","rows","footerRenderer","emptyStateRenderer","errorStateRenderer","loadingStateRenderer","tableEmptyStateRenderer","headerDropdown","columnEditorConfig","icons"]),h=Object.assign(Object.assign({},v),{rows:n,defaultHeaders:r.map(R)});if(void 0!==c&&(h.footerRenderer=l(c)),void 0!==s)if(b(s))h.emptyStateRenderer=l(s);else{const e=s;h.emptyStateRenderer=()=>p(e)}if(void 0!==i)if(b(i))h.errorStateRenderer=l(i);else{const e=i;h.errorStateRenderer=()=>p(e)}if(void 0!==y)if(b(y))h.loadingStateRenderer=l(y);else{const e=y;h.loadingStateRenderer=()=>p(e)}return void 0!==j&&(h.tableEmptyStateRenderer=null===j?null:p(j)),void 0!==g&&(h.headerDropdown=l(g)),void 0!==S&&(h.columnEditorConfig=function(t){const{rowRenderer:r,customRenderer:n}=t,c=u(t,["rowRenderer","customRenderer"]);return Object.assign(Object.assign(Object.assign({},c),r?{rowRenderer:(s=r,t=>{const r=document.createElement("div"),n=o.createRoot(r),c=Object.assign(Object.assign({},t),{components:(u=t.components,{expandIcon:a(u.expandIcon),checkbox:a(u.checkbox),dragIcon:a(u.dragIcon),labelContent:a(u.labelContent),pinIcon:a(u.pinIcon)})});var u;return d(n,e.jsx(s,Object.assign({},c))),r})}:{}),n?{customRenderer:f(n)}:{});var s}(S)),void 0!==O&&(h.icons=function(e){const t={};for(const[r,n]of Object.entries(e))null!=n&&(t[r]="string"==typeof n||n instanceof HTMLElement||n instanceof SVGElement?n:m(n));return t}(O)),h}"function"==typeof SuppressedError&&SuppressedError;const j=s(t).default.forwardRef(function(n,o){const c=t.useRef(null),s=t.useRef(null),i=t.useRef(void 0),a=t.useRef(null),d=n;return t.useLayoutEffect(()=>{if(!c.current)return;let e=!1;return queueMicrotask(()=>{if(e||!c.current)return;const t=new r.SimpleTableVanilla(c.current,y(d));if(t.mount(),s.current=t,o){const e=t.getAPI();"function"==typeof o?o(e):o.current=e}}),()=>{e=!0;const t=s.current;t&&(t.destroy(),s.current=null,i.current=void 0,a.current=null,o&&"function"!=typeof o&&(o.current=null))}},[]),t.useLayoutEffect(()=>{const e=s.current;if(!e)return;if(null!==a.current&&!function(e,t){const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of r)if(e[n]!==t[n])return!0;return!1}(a.current,d))return;a.current=d;const t=y(d);queueMicrotask(()=>{if(s.current!==e)return;if(i.current!==d.defaultHeaders)return i.current=d.defaultHeaders,void e.update(t);const r=u(t,["defaultHeaders"]);e.update(r)})},[d]),e.jsx("div",{ref:c})});j.displayName="SimpleTable",Object.defineProperty(exports,"asRows",{enumerable:!0,get:function(){return r.asRows}}),exports.SimpleTable=j,exports.defaultHeaderFromCore=function(e){return e},exports.defaultHeadersFromCore=function(e){return e},exports.mapToReactHeaderObjects=function(e){return e};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,Fragment as r}from"react/jsx-runtime";import n,{useRef as t,useLayoutEffect as o}from"react";import{SimpleTableVanilla as c}from"simple-table-core";export{asRows}from"simple-table-core";import{flushSync as i}from"react-dom";import{createRoot as d}from"react-dom/client";import{renderToStaticMarkup as s}from"react-dom/server";function a(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}function u({node:r}){const n=t(null);return o(()=>{const e=n.current;if(e)return e.appendChild(r),()=>{r.parentNode===e&&e.removeChild(r)}},[r]),e("span",{ref:n,style:{display:"contents"}})}function l(r){if(null!=r)return"string"==typeof r?r:r instanceof Node?e(u,{node:r}):void 0}function f(r){return n=>{const t=document.createElement("div"),o=d(t);return i(()=>{o.render(e(r,Object.assign({},n)))}),t}}function m(r){return n=>{const t=document.createElement("div"),o=d(t),c=Object.assign(Object.assign({},n),{searchSection:n.searchSection?l(n.searchSection):null,listSection:l(n.listSection),resetSection:n.resetSection?l(n.resetSection):null});return i(()=>{o.render(e(r,Object.assign({},c)))}),t}}function p(n){const t=document.createElement("div");return t.innerHTML=s(e(r,{children:n})),function(e){const r=Array.from(e.childNodes).filter(e=>e.nodeType!==Node.TEXT_NODE||null!=e.textContent&&""!==e.textContent.trim());return 1===r.length&&r[0]instanceof HTMLElement?(e.removeChild(r[0]),r[0]):e}(t)}function b(n){return s(e(r,{children:n}))}function g(e){return"function"==typeof e}function R(r){const{cellRenderer:n,headerRenderer:t,children:o,nestedTable:c}=r,s=a(r,["cellRenderer","headerRenderer","children","nestedTable"]),u=Object.assign({},s);var l;if(n&&(u.cellRenderer=(l=n,r=>{const n=document.createElement("div");n.style.display="contents";const t=d(n);return i(()=>{t.render(e(l,Object.assign({},r)))}),n})),t&&(u.headerRenderer=f(t)),o&&(u.children=o.map(R)),c){const e=Object.assign(Object.assign({},c),{rows:[]});u.nestedTable=y(e)}return u}function y(r){const{defaultHeaders:n,rows:t,footerRenderer:o,emptyStateRenderer:c,errorStateRenderer:s,loadingStateRenderer:u,tableEmptyStateRenderer:y,headerDropdown:S,columnEditorConfig:v,icons:O}=r,h=a(r,["defaultHeaders","rows","footerRenderer","emptyStateRenderer","errorStateRenderer","loadingStateRenderer","tableEmptyStateRenderer","headerDropdown","columnEditorConfig","icons"]),j=Object.assign(Object.assign({},h),{rows:t,defaultHeaders:n.map(R)});if(void 0!==o&&(j.footerRenderer=f(o)),void 0!==c)if(g(c))j.emptyStateRenderer=f(c);else{const e=c;j.emptyStateRenderer=()=>p(e)}if(void 0!==s)if(g(s))j.errorStateRenderer=f(s);else{const e=s;j.errorStateRenderer=()=>p(e)}if(void 0!==u)if(g(u))j.loadingStateRenderer=f(u);else{const e=u;j.loadingStateRenderer=()=>p(e)}return void 0!==y&&(j.tableEmptyStateRenderer=null===y?null:p(y)),void 0!==S&&(j.headerDropdown=f(S)),void 0!==v&&(j.columnEditorConfig=function(r){const{rowRenderer:n,customRenderer:t}=r,o=a(r,["rowRenderer","customRenderer"]);return Object.assign(Object.assign(Object.assign({},o),n?{rowRenderer:(c=n,r=>{const n=document.createElement("div"),t=d(n),o=Object.assign(Object.assign({},r),{components:(s=r.components,{expandIcon:l(s.expandIcon),checkbox:l(s.checkbox),dragIcon:l(s.dragIcon),labelContent:l(s.labelContent),pinIcon:l(s.pinIcon)})});var s;return i(()=>{t.render(e(c,Object.assign({},o)))}),n})}:{}),t?{customRenderer:m(t)}:{});var c}(v)),void 0!==O&&(j.icons=function(e){const r={};for(const[n,t]of Object.entries(e))null!=t&&(r[n]="string"==typeof t||t instanceof HTMLElement||t instanceof SVGElement?t:b(t));return r}(O)),j}"function"==typeof SuppressedError&&SuppressedError;const S=n.forwardRef(function(r,n){const i=t(null),d=t(null),s=t(void 0),u=r;return o(()=>{if(!i.current)return;let e=!1;return queueMicrotask(()=>{if(e||!i.current)return;const r=new c(i.current,y(u));if(r.mount(),d.current=r,n){const e=r.getAPI();"function"==typeof n?n(e):n.current=e}}),()=>{e=!0;const r=d.current;r&&(r.destroy(),d.current=null,s.current=void 0,n&&"function"!=typeof n&&(n.current=null))}},[]),o(()=>{const e=d.current;if(!e)return;const r=y(u);queueMicrotask(()=>{if(d.current!==e)return;if(s.current!==u.defaultHeaders)return s.current=u.defaultHeaders,void e.update(r);const n=a(r,["defaultHeaders"]);e.update(n)})}),e("div",{ref:i})});function v(e){return e}function O(e){return e}function h(e){return e}S.displayName="SimpleTable";export{S as SimpleTable,v as defaultHeaderFromCore,O as defaultHeadersFromCore,h as mapToReactHeaderObjects};
1
+ import{jsx as e,Fragment as r}from"react/jsx-runtime";import n,{useRef as t,useLayoutEffect as o}from"react";import{SimpleTableVanilla as c}from"simple-table-core";export{asRows}from"simple-table-core";import{flushSync as i}from"react-dom";import{createRoot as s}from"react-dom/client";import{renderToStaticMarkup as d}from"react-dom/server";function u(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}function a({node:r}){const n=t(null);return o(()=>{const e=n.current;if(e)return e.appendChild(r),()=>{r.parentNode===e&&e.removeChild(r)}},[r]),e("span",{ref:n,style:{display:"contents"}})}function l(r){if(null!=r)return"string"==typeof r?r:r instanceof Node?e(a,{node:r}):void 0}function f(e,r){queueMicrotask(()=>{i(()=>{e.render(r)})})}function m(r){return n=>{const t=document.createElement("div");return f(s(t),e(r,Object.assign({},n))),t}}function p(r){return n=>{const t=document.createElement("div"),o=s(t),c=Object.assign(Object.assign({},n),{searchSection:n.searchSection?l(n.searchSection):null,listSection:l(n.listSection),resetSection:n.resetSection?l(n.resetSection):null});return f(o,e(r,Object.assign({},c))),t}}function b(n){const t=document.createElement("div");return t.innerHTML=d(e(r,{children:n})),function(e){const r=Array.from(e.childNodes).filter(e=>e.nodeType!==Node.TEXT_NODE||null!=e.textContent&&""!==e.textContent.trim());return 1===r.length&&r[0]instanceof HTMLElement?(e.removeChild(r[0]),r[0]):e}(t)}function g(n){return d(e(r,{children:n}))}function y(e){return"function"==typeof e}function R(r){const{cellRenderer:n,headerRenderer:t,children:o,nestedTable:c}=r,i=u(r,["cellRenderer","headerRenderer","children","nestedTable"]),d=Object.assign({},i);var a;if(n&&(d.cellRenderer=(a=n,r=>{const n=document.createElement("div");return n.style.display="contents",f(s(n),e(a,Object.assign({},r))),n})),t&&(d.headerRenderer=m(t)),o&&(d.children=o.map(R)),c){const e=Object.assign(Object.assign({},c),{rows:[]});d.nestedTable=S(e)}return d}function S(r){const{defaultHeaders:n,rows:t,footerRenderer:o,emptyStateRenderer:c,errorStateRenderer:i,loadingStateRenderer:d,tableEmptyStateRenderer:a,headerDropdown:S,columnEditorConfig:O,icons:v}=r,j=u(r,["defaultHeaders","rows","footerRenderer","emptyStateRenderer","errorStateRenderer","loadingStateRenderer","tableEmptyStateRenderer","headerDropdown","columnEditorConfig","icons"]),h=Object.assign(Object.assign({},j),{rows:t,defaultHeaders:n.map(R)});if(void 0!==o&&(h.footerRenderer=m(o)),void 0!==c)if(y(c))h.emptyStateRenderer=m(c);else{const e=c;h.emptyStateRenderer=()=>b(e)}if(void 0!==i)if(y(i))h.errorStateRenderer=m(i);else{const e=i;h.errorStateRenderer=()=>b(e)}if(void 0!==d)if(y(d))h.loadingStateRenderer=m(d);else{const e=d;h.loadingStateRenderer=()=>b(e)}return void 0!==a&&(h.tableEmptyStateRenderer=null===a?null:b(a)),void 0!==S&&(h.headerDropdown=m(S)),void 0!==O&&(h.columnEditorConfig=function(r){const{rowRenderer:n,customRenderer:t}=r,o=u(r,["rowRenderer","customRenderer"]);return Object.assign(Object.assign(Object.assign({},o),n?{rowRenderer:(c=n,r=>{const n=document.createElement("div"),t=s(n),o=Object.assign(Object.assign({},r),{components:(i=r.components,{expandIcon:l(i.expandIcon),checkbox:l(i.checkbox),dragIcon:l(i.dragIcon),labelContent:l(i.labelContent),pinIcon:l(i.pinIcon)})});var i;return f(t,e(c,Object.assign({},o))),n})}:{}),t?{customRenderer:p(t)}:{});var c}(O)),void 0!==v&&(h.icons=function(e){const r={};for(const[n,t]of Object.entries(e))null!=t&&(r[n]="string"==typeof t||t instanceof HTMLElement||t instanceof SVGElement?t:g(t));return r}(v)),h}"function"==typeof SuppressedError&&SuppressedError;const O=n.forwardRef(function(r,n){const i=t(null),s=t(null),d=t(void 0),a=t(null),l=r;return o(()=>{if(!i.current)return;let e=!1;return queueMicrotask(()=>{if(e||!i.current)return;const r=new c(i.current,S(l));if(r.mount(),s.current=r,n){const e=r.getAPI();"function"==typeof n?n(e):n.current=e}}),()=>{e=!0;const r=s.current;r&&(r.destroy(),s.current=null,d.current=void 0,a.current=null,n&&"function"!=typeof n&&(n.current=null))}},[]),o(()=>{const e=s.current;if(!e)return;if(null!==a.current&&!function(e,r){const n=new Set([...Object.keys(e),...Object.keys(r)]);for(const t of n)if(e[t]!==r[t])return!0;return!1}(a.current,l))return;a.current=l;const r=S(l);queueMicrotask(()=>{if(s.current!==e)return;if(d.current!==l.defaultHeaders)return d.current=l.defaultHeaders,void e.update(r);const n=u(r,["defaultHeaders"]);e.update(n)})},[l]),e("div",{ref:i})});function v(e){return e}function j(e){return e}function h(e){return e}O.displayName="SimpleTable";export{O as SimpleTable,v as defaultHeaderFromCore,j as defaultHeadersFromCore,h as mapToReactHeaderObjects};
2
2
  //# sourceMappingURL=index.es.js.map
@@ -97,6 +97,12 @@ export declare class RenderOrchestrator {
97
97
  getLastProcessedResult(): ProcessRowsResult | null;
98
98
  invalidateCache(type?: "body" | "header" | "context" | "all"): void;
99
99
  computeEffectiveHeaders(headers: HeaderObject[], config: SimpleTableConfig, customTheme: CustomTheme, containerWidth?: number): HeaderObject[];
100
+ /**
101
+ * Warms flattened/processed row caches so imperative APIs (e.g. getVisibleRows) are
102
+ * correct before the first ResizeObserver-driven render, without mutating the DOM.
103
+ */
104
+ primeLastProcessedResult(context: RenderContext, state: RenderState): void;
105
+ private buildRowModelSnapshot;
100
106
  render(elements: {
101
107
  bodyContainer: HTMLElement;
102
108
  content: HTMLElement;
@@ -11,4 +11,9 @@ export interface HorizontalScrollbarProps {
11
11
  sectionScrollController?: SectionScrollController | null;
12
12
  }
13
13
  export declare const createHorizontalScrollbar: (props: HorizontalScrollbarProps) => HTMLElement | null;
14
+ /**
15
+ * Apply width props to an existing scrollbar from {@link createHorizontalScrollbar}.
16
+ * Used when layout is recreated without tearing down the DOM node (e.g. pinned resize).
17
+ */
18
+ export declare const syncHorizontalScrollbarLayout: (container: HTMLElement, props: HorizontalScrollbarProps) => void;
14
19
  export declare const cleanupHorizontalScrollbar: (container: HTMLElement, sectionScrollController?: SectionScrollController | null) => void;
@@ -21,9 +21,7 @@ export declare function wrapReactColumnEditorCustomRenderer(Component: React.Com
21
21
  /**
22
22
  * Like wrapReactRenderer but uses `display: contents` so layout is unchanged
23
23
  * when core appends this node (no extra box vs a plain div).
24
- * flushSync ensures the tree is committed before the host is returned — required
25
- * when vanilla renders cells from a React effect, where a deferred nested root
26
- * would otherwise yield an empty container.
24
+ * Commit scheduling matches {@link wrapReactRenderer} (microtask + flushSync).
27
25
  */
28
26
  export declare function wrapReactRendererIntoFragment<P extends object>(Component: React.ComponentType<P>): (props: P) => HTMLElement;
29
27
  /**
@@ -35,8 +33,8 @@ export declare function wrapReactNode(node: React.ReactNode): HTMLElement;
35
33
  * Converts a ReactNode to an HTML string using server-side static rendering.
36
34
  * Used for icon props where the vanilla table expects a string | HTMLElement | SVGSVGElement.
37
35
  * Uses renderToStaticMarkup so it works synchronously from any context — including
38
- * inside a useEffect — unlike createRoot + flushSync which silently produces empty
39
- * output when called during React 18's passive effects phase.
36
+ * inside a useEffect — unlike createRoot alone without a follow-up commit, which
37
+ * can yield empty output when React defers the nested root.
40
38
  */
41
39
  export declare function reactNodeToHtmlString(node: React.ReactNode): string;
42
40
  /** Returns true if the value is a React component (function or class). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-table/react",
3
- "version": "3.0.0",
3
+ "version": "3.0.3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/types/react/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "react-dom": ">=18.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "simple-table-core": "3.0.0"
32
+ "simple-table-core": "3.0.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@rollup/plugin-alias": "^4.0.4",