realgrid-react 0.9.7 → 0.9.9

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/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var $=(n,r,t)=>r in n?y(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t;var o=(n,r,t)=>($(n,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),_=require("realgrid");function R(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const u=R(_),m=(n,...r)=>(r.forEach(t=>{for(const i in t){if(i==="children")continue;const e=t[i];e===null?n[i]=null:e===void 0?delete n[i]:Array.isArray(e)?n[i]=[...e]:typeof e=="object"?e instanceof Date?n[i]=new Date(e):n[i]=m(n[i]==null?{}:n[i],e):n[i]=e}}),n),h=(n,r={},t={})=>{n=n||{};const i=["children","rows","$grid"];for(const[e,s]of Object.entries(r))if(!i.includes(e))if(!t.hasOwnProperty(e))n[e]=null;else if(Array.isArray(s))(!t[e]||JSON.stringify(s)!=JSON.stringify(t[e]))&&(n[e]=t[e]);else if(s instanceof Object&&!(s instanceof Date||Array.isArray(s)||typeof s=="function"))if(!(t[e]instanceof Object))n[e]=t[e];else{const d=h({},s,t[e]);Object.keys(d).length&&(n[e]=d)}else typeof s=="function"?s.toString()!==t[e].toString()&&(n[e]=t[e]):s!==t[e]&&(n[e]=t[e]);for(const[e,s]of Object.entries(t))i.includes(e)||r.hasOwnProperty(e)||(n[e]=s);return n};class w extends l.Component{constructor(t){super(t);o(this,"_gridView",null);o(this,"_dataProvider",null);o(this,"_mountCBs",[]);o(this,"_mountTimer");o(this,"_columnsChanged");o(this,"gridContainer");this.gridContainer=l.createRef()}getProps(t){return t||{}}$_connectEvents(t,i,e){for(let s in e)s&&typeof s=="string"&&s.startsWith("on")&&(t.hasOwnProperty(s)&&(t[s]=e[s]),i.hasOwnProperty(s)&&(i[s]=e[s]),s==="onDataRowInserting"&&(i.onRowInserting=e[s]))}$_executeCallback(){var t;if(this.gridView&&(clearTimeout(this._mountTimer),!(!this._mountCBs||!this._mountCBs.length))){this.gridView.beginUpdate();try{this.dataProvider.beginUpdate();try{for(;this._mountCBs&&this._mountCBs.length;){const i=this._mountCBs.shift();i==null||i.call(this)}}finally{this.dataProvider.endUpdate()}}finally{this._columnsChanged&&this.props.onRGDataColumnsChanged&&((t=this.props)==null||t.onRGDataColumnsChanged(this.gridView),this._columnsChanged=!1),this.gridView.endUpdate(!0),this._mountTimer=null,this._mountCBs=[]}}}addCallback(t,i){this._mountCBs.push(t),clearTimeout(this._mountTimer),this._columnsChanged=i==="column",this._mountTimer=setTimeout(()=>{this.$_executeCallback()},20)}removeCallback(t){if(this._mountCBs){const i=this._mountCBs.indexOf(t);i>=0&&this._mountCBs.splice(i,1)}}componentDidMount(){const{grid:t,dataProvider:i,props:e}=this.createObject();if(this._gridView=t,this._dataProvider=i,this.$_executeCallback(),this.$_connectEvents(t,i,e),t.setOptions(e.gridProps||{}),i.setOptions(e.dataProps||{}),e.rowStyleCallback&&t.setRowStyleCallback(e.rowStyleCallback),e.cellStyleCallback&&t.setCellStyleCallback(e.cellStyleCallback),e.layout&&t.setColumnLayout(e.layout),e.onInitialized){const s=e.onInitialized.constructor.name;s==="Function"?e.onInitialized(t):s==="AsyncFunction"&&Promise.resolve(e.onInitialized(t))}}componentWillUnmount(){this.beforeDestroy(),this._gridView=this._gridView&&this._gridView.destroy(),this._dataProvider=this._dataProvider&&this._dataProvider.destroy()}componentDidUpdate(t,i,e){this.$_executeCallback();const s=this.getProps(this.props)||{},d=this.gridView,c=this.dataProvider;this.$_connectEvents(d,c,s);let p=h({},t.dataProps,s.dataProps);c.setOptions(p),p=h({},t.gridProps,s.gridProps),d.setOptions(p),p=h([],t.layout||[],s.layout||[]),p&&p.length>0&&d.setColumnLayout(s.layout)}render(){const t={};t.$grid=this;let i=0;const e=l.Children.map(this.props.children,s=>(s&&s.type.CType==="$$RGColumn$$"?t.displayIndex=s.props.displayIndex??i++:delete t.displayIndex,s&&l.cloneElement(s,t)));return l.createElement("div",{style:{width:"100%",height:"100%"},ref:s=>this.gridContainer=s},e)}}class B extends w{constructor(){super(...arguments);o(this,"createObject",()=>{var s;const t=m({},this.getProps(this.props)),i=new u.GridView(this.gridContainer,t.accessibility,t.waiOptions),e=new u.LocalDataProvider((s=t.dataProps)==null?void 0:s.undoable);return i.setDataSource(e),{grid:i,dataProvider:e,props:t}});o(this,"beforeDestroy",()=>{const t=m({},this.getProps(this.props));return t.onDestroy&&t.onDestroy.call(this,this.gridView),{props:t}})}get gridView(){return this._gridView}get dataProvider(){return this._dataProvider}componentDidMount(){var i;super.componentDidMount();const t=this.props.rows;t&&Array.isArray(t)&&t.length>0&&((i=this.dataProvider)==null||i.setRows(t))}componentDidUpdate(t,i,e){super.componentDidUpdate(t,i,e),t.rows!=this.props.rows&&this.dataProvider.setRows(this.props.rows)}}class P extends w{constructor(){super(...arguments);o(this,"createObject",()=>{var s;const t=m({},this.getProps(this.props)),i=new u.TreeView(this.gridContainer),e=new u.LocalTreeDataProvider((s=t.dataProps)==null?void 0:s.undoable);return i.setTreeOptions(t.treeOptions||{}),i.setDataSource(e),{grid:i,dataProvider:e,props:t}});o(this,"beforeDestroy",()=>{const t=m({},this.getProps(this.props));return t.onDestroy&&t.onDestroy.call(this,this.gridView),{props:t}})}get gridView(){return this._gridView}get dataProvider(){return this._dataProvider}componentDidMount(){var i,e;super.componentDidMount();const t=this.props.rows;Array.isArray(t)?(i=this.dataProvider)==null||i.setRows(t,this.props.treeField,this.props.needSorting,this.props.childrenField,this.props.iconField):(e=this.dataProvider)==null||e.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)}componentDidUpdate(t,i,e){var d,c;const s=this.props.rows;(this.props.treeField||this.props.rowsProp)&&t.rows!==s&&(Array.isArray(s)?(d=this.dataProvider)==null||d.setRows(s,this.props.treeField,this.props.needSorting,this.props.childrenField,this.props.iconField):(c=this.dataProvider)==null||c.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)),super.componentDidUpdate(t,i,e)}}class a extends l.Component{constructor(t){super(t);o(this,"$parent");o(this,"$model");o(this,"_type");this.$parent=t.$grid}_doUpdate(){}componentDidMount(){const t=this.$parent;t&&t.addCallback(this.mountCB,this._type)}componentWillUnmount(){const t=this.$parent;t&&(t.removeCallback(this.mountCB),this.unMountCB()),this.$model=null}componentDidUpdate(t,i,e){let s=h({},this.props,t);!(Object.keys(s).length===0)&&this.$model&&this.$model.assignFrom&&this.$model.assignFrom(s),this._doUpdate()}render(){return l.createElement(l.Fragment)}}class f extends a{constructor(){super(...arguments);o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"series"},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;this._column&&t&&!t._view.disposing&&t.removeColumn(this._column.name)})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(f,"CType","$$RGColumn$$");class D extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({...this.props}),this.$model=this.$parent.gridView.stateBar});o(this,"unMountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({})})}}class V extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setRowIndicator({...this.props}),this.$model=this.$parent.gridView.rowIndicator});o(this,"unMountCB",()=>{})}}class b extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummaries({...this.props}),this.$model=this.$parent.gridView.headerSummaries});o(this,"unMountCB",()=>{})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}}class G extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummary({...this.props}),this.$model=this.$parent.gridView.headerSummary});o(this,"unMountCB",()=>{})}}class v extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeader({...this.props}),this.$model=this.$parent.gridView.header});o(this,"unMountCB",()=>{})}}class S extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;this.$parent.gridView instanceof u.GridView&&((t=this.$parent.gridView)==null||t.setGroupPanel({visible:!0,...this.props}),this.$model=this.$parent.gridView.groupPanel)});o(this,"unMountCB",()=>{})}}class x extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooter({...this.props}),this.$model=this.$parent.gridView.footer});o(this,"unMountCB",()=>{})}}class F extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooters({...this.props}),this.$model=this.$parent.gridView.footers});o(this,"unMountCB",()=>{})}}class M extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFilterPanel({...this.props}),this.$model=this.$parent.gridView.filterPanel});o(this,"unMountCB",()=>{})}}class O extends a{constructor(){super(...arguments);o(this,"_field");o(this,"mountCB",()=>{const t=this.$parent.gridView,i=t==null?void 0:t.getDataSource();i&&!i.fieldByName(this.props.fieldName)&&(this._field=i.addField(this.props))});o(this,"unMountCB",()=>{if(this._field){const t=this.$parent.gridView,i=t==null?void 0:t.getDataSource();i&&i.removeField(this._field.fieldName)}})}}class g extends a{constructor(){super(...arguments);o(this,"fieldName");o(this,"mounted");o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView,i=this.$parent.props.autoGenerateField,e=t==null?void 0:t.getDataSource();let s=this.props.fieldName;i&&(!s&&this.props.field&&(s=this.props.field.fieldName),e&&!e.fieldByName(s)&&e.addField(this.props.field||s)),t&&(this._column=this.$model=t.addColumn({...this.props,fieldName:s},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;if(this._column&&t&&!t._view.disposing){let i=this._column.fieldName;t.removeColumn(this._column.name);const e=this.$parent.props.autoGenerateField,s=t==null?void 0:t.getDataSource();e&&i&&s&&(t.columnByField(i)||s.removeField(i))}})}componentDidMount(){this._type="column",super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(g,"CType","$$RGColumn$$");class U extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setCheckBar({...this.props}),this.$model=this.$parent.gridView.checkBar});o(this,"unMountCB",()=>{})}}class C extends a{constructor(){super(...arguments);o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"literal"},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;this._column&&t&&!t._view.disposing&&t.removeColumn(this._column.name)})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(C,"CType","$$RGColumn$$");exports.RGCheckBar=U;exports.RGDataColumn=g;exports.RGDataField=O;exports.RGFilterPanel=M;exports.RGFooter=x;exports.RGFooters=F;exports.RGGroupPanel=S;exports.RGHeader=v;exports.RGHeaderSummaries=b;exports.RGHeaderSummary=G;exports.RGLiteralColumn=C;exports.RGRowIndicator=V;exports.RGSeriesColumn=f;exports.RGStateBar=D;exports.RealGridReact=B;exports.RealTreeReact=P;
1
+ "use strict";var y=Object.defineProperty;var $=(n,r,t)=>r in n?y(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t;var o=(n,r,t)=>($(n,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),_=require("realgrid");function R(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const u=R(_),m=(n,...r)=>(r.forEach(t=>{for(const i in t){if(i==="children")continue;const e=t[i];e===null?n[i]=null:e===void 0?delete n[i]:Array.isArray(e)?n[i]=[...e]:typeof e=="object"?e instanceof Date?n[i]=new Date(e):n[i]=m(n[i]==null?{}:n[i],e):n[i]=e}}),n),c=(n,r={},t={})=>{n=n||{};const i=["children","rows","$grid"];for(const[e,s]of Object.entries(r))if(!i.includes(e))if(!t.hasOwnProperty(e))n[e]=null;else if(Array.isArray(s))(!t[e]||JSON.stringify(s)!=JSON.stringify(t[e]))&&(n[e]=t[e]);else if(s instanceof Object&&!(s instanceof Date||Array.isArray(s)||typeof s=="function"))if(!(t[e]instanceof Object))n[e]=t[e];else{const d=c({},s,t[e]);Object.keys(d).length&&(n[e]=d)}else typeof s=="function"?s.toString()!==t[e].toString()&&(n[e]=t[e]):s!==t[e]&&(n[e]=t[e]);for(const[e,s]of Object.entries(t))i.includes(e)||r.hasOwnProperty(e)||(n[e]=s);return n};class w extends p.Component{constructor(t){super(t);o(this,"_gridView",null);o(this,"_dataProvider",null);o(this,"_mountCBs",[]);o(this,"_mountTimer");o(this,"_columnsChanged");o(this,"gridContainer");this.gridContainer=p.createRef()}getProps(t){return t||{}}$_connectEvents(t,i,e){for(let s in e)s&&typeof s=="string"&&s.startsWith("on")&&(t.hasOwnProperty(s)&&(t[s]=e[s]),i.hasOwnProperty(s)&&(i[s]=e[s]),s==="onDataRowInserting"&&(i.onRowInserting=e[s]))}$_executeCallback(){var t;if(this.gridView&&(clearTimeout(this._mountTimer),!(!this._mountCBs||!this._mountCBs.length))){this.gridView.beginUpdate();try{this.dataProvider.beginUpdate();try{for(;this._mountCBs&&this._mountCBs.length;){const i=this._mountCBs.shift();i==null||i.call(this)}}finally{this.dataProvider.endUpdate()}}finally{this._columnsChanged&&this.props.onRGDataColumnsChanged&&((t=this.props)==null||t.onRGDataColumnsChanged(this.gridView),this._columnsChanged=!1),this.gridView.endUpdate(!0),this._mountTimer=null,this._mountCBs=[]}}}addCallback(t,i){this._mountCBs.push(t),clearTimeout(this._mountTimer),this._columnsChanged=i==="column",this._mountTimer=setTimeout(()=>{this.$_executeCallback()},20)}removeCallback(t){if(this._mountCBs){const i=this._mountCBs.indexOf(t);i>=0&&this._mountCBs.splice(i,1)}}componentDidMount(){const{grid:t,dataProvider:i,props:e}=this.createObject();this._gridView=t,this._dataProvider=i,this.$_executeCallback(),this.$_connectEvents(t,i,e),t.setOptions(e.gridProps||{}),i.setOptions(e.dataProps||{}),e.rowStyleCallback&&t.setRowStyleCallback(e.rowStyleCallback),e.cellStyleCallback&&t.setCellStyleCallback(e.cellStyleCallback),e.layout&&t.setColumnLayout(e.layout)}componentWillUnmount(){this.beforeDestroy(),this._gridView=this._gridView&&this._gridView.destroy(),this._dataProvider=this._dataProvider&&this._dataProvider.destroy()}componentDidUpdate(t,i,e){this.$_executeCallback();const s=this.getProps(this.props)||{},d=this.gridView,h=this.dataProvider;this.$_connectEvents(d,h,s);let l=c({},t.dataProps,s.dataProps);h.setOptions(l),l=c({},t.gridProps,s.gridProps),d.setOptions(l),l=c([],t.layout||[],s.layout||[]),l&&l.length>0&&d.setColumnLayout(s.layout)}render(){const t={};t.$grid=this;let i=0;const e=p.Children.map(this.props.children,s=>(s&&s.type.CType==="$$RGColumn$$"?t.displayIndex=s.props.displayIndex??i++:delete t.displayIndex,s&&p.cloneElement(s,t)));return p.createElement("div",{style:{width:"100%",height:"100%"},ref:s=>this.gridContainer=s},e)}}class B extends w{constructor(){super(...arguments);o(this,"createObject",()=>{var s;const t=m({},this.getProps(this.props)),i=new u.GridView(this.gridContainer,t.accessibility,t.waiOptions),e=new u.LocalDataProvider((s=t.dataProps)==null?void 0:s.undoable);return i.setDataSource(e),{grid:i,dataProvider:e,props:t}});o(this,"beforeDestroy",()=>{const t=m({},this.getProps(this.props));return t.onDestroy&&t.onDestroy.call(this,this.gridView),{props:t}})}get gridView(){return this._gridView}get dataProvider(){return this._dataProvider}componentDidMount(){var i;super.componentDidMount();const t=this.props.rows;t&&Array.isArray(t)&&t.length>0&&((i=this.dataProvider)==null||i.setRows(t))}componentDidUpdate(t,i,e){super.componentDidUpdate(t,i,e),t.rows!=this.props.rows&&this.dataProvider.setRows(this.props.rows)}}class D extends w{constructor(){super(...arguments);o(this,"createObject",()=>{var s;const t=m({},this.getProps(this.props)),i=new u.TreeView(this.gridContainer),e=new u.LocalTreeDataProvider((s=t.dataProps)==null?void 0:s.undoable);return i.setTreeOptions(t.treeOptions||{}),i.setDataSource(e),{grid:i,dataProvider:e,props:t}});o(this,"beforeDestroy",()=>{const t=m({},this.getProps(this.props));return t.onDestroy&&t.onDestroy.call(this,this.gridView),{props:t}})}get gridView(){return this._gridView}get dataProvider(){return this._dataProvider}componentDidMount(){var i,e;super.componentDidMount();const t=this.props.rows;Array.isArray(t)?(i=this.dataProvider)==null||i.setRows(t,this.props.treeField,this.props.needSorting,this.props.childrenField,this.props.iconField):(e=this.dataProvider)==null||e.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)}componentDidUpdate(t,i,e){var d,h;const s=this.props.rows;(this.props.treeField||this.props.rowsProp)&&t.rows!==s&&(Array.isArray(s)?(d=this.dataProvider)==null||d.setRows(s,this.props.treeField,this.props.needSorting,this.props.childrenField,this.props.iconField):(h=this.dataProvider)==null||h.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)),super.componentDidUpdate(t,i,e)}}class a extends p.Component{constructor(t){super(t);o(this,"$parent");o(this,"$model");o(this,"_type");this.$parent=t.$grid}_doUpdate(){}componentDidMount(){const t=this.$parent;t&&t.addCallback(this.mountCB,this._type)}componentWillUnmount(){const t=this.$parent;t&&(t.removeCallback(this.mountCB),this.unMountCB()),this.$model=null}componentDidUpdate(t,i,e){let s=c({},this.props,t);!(Object.keys(s).length===0)&&this.$model&&this.$model.assignFrom&&this.$model.assignFrom(s),this._doUpdate()}render(){return p.createElement(p.Fragment)}}class f extends a{constructor(){super(...arguments);o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"series"},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;this._column&&t&&!t._view.disposing&&t.removeColumn(this._column.name)})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(f,"CType","$$RGColumn$$");class P extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({...this.props}),this.$model=this.$parent.gridView.stateBar});o(this,"unMountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({})})}}class V extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setRowIndicator({...this.props}),this.$model=this.$parent.gridView.rowIndicator});o(this,"unMountCB",()=>{})}}class b extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummaries({...this.props}),this.$model=this.$parent.gridView.headerSummaries});o(this,"unMountCB",()=>{})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}}class G extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummary({...this.props}),this.$model=this.$parent.gridView.headerSummary});o(this,"unMountCB",()=>{})}}class v extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeader({...this.props}),this.$model=this.$parent.gridView.header});o(this,"unMountCB",()=>{})}}class S extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;this.$parent.gridView instanceof u.GridView&&((t=this.$parent.gridView)==null||t.setGroupPanel({visible:!0,...this.props}),this.$model=this.$parent.gridView.groupPanel)});o(this,"unMountCB",()=>{})}}class x extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooter({...this.props}),this.$model=this.$parent.gridView.footer});o(this,"unMountCB",()=>{})}}class M extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooters({...this.props}),this.$model=this.$parent.gridView.footers});o(this,"unMountCB",()=>{})}}class O extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFilterPanel({...this.props}),this.$model=this.$parent.gridView.filterPanel});o(this,"unMountCB",()=>{})}}class F extends a{constructor(){super(...arguments);o(this,"_field");o(this,"mountCB",()=>{const t=this.$parent.gridView,i=t==null?void 0:t.getDataSource();i&&!i.fieldByName(this.props.fieldName)&&(this._field=i.addField(this.props))});o(this,"unMountCB",()=>{if(this._field){const t=this.$parent.gridView,i=t==null?void 0:t.getDataSource();i&&i.removeField(this._field.fieldName)}})}}class g extends a{constructor(){super(...arguments);o(this,"fieldName");o(this,"mounted");o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView,i=this.$parent.props.autoGenerateField,e=t==null?void 0:t.getDataSource();let s=this.props.fieldName;i&&(!s&&this.props.field&&(s=this.props.field.fieldName),e&&!e.fieldByName(s)&&e.addField(this.props.field||s)),t&&(this._column=this.$model=t.addColumn({...this.props,fieldName:s},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;if(this._column&&t&&!t._view.disposing){let i=this._column.fieldName;t.removeColumn(this._column.name);const e=this.$parent.props.autoGenerateField,s=t==null?void 0:t.getDataSource();e&&i&&s&&(t.columnByField(i)||s.removeField(i))}})}componentDidMount(){this._type="column",super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(g,"CType","$$RGColumn$$");class U extends a{constructor(){super(...arguments);o(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setCheckBar({...this.props}),this.$model=this.$parent.gridView.checkBar});o(this,"unMountCB",()=>{})}}class C extends a{constructor(){super(...arguments);o(this,"_column");o(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"literal"},this.props.displayIndex??-1))});o(this,"unMountCB",()=>{const t=this.$parent.gridView;this._column&&t&&!t._view.disposing&&t.removeColumn(this._column.name)})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,i,e){if(super.componentDidUpdate(t,i,e),t.width!==this.props.width){const s=this.$model.layout;s&&(s.cellWidth=this.props.width)}}}o(C,"CType","$$RGColumn$$");exports.RGCheckBar=U;exports.RGDataColumn=g;exports.RGDataField=F;exports.RGFilterPanel=O;exports.RGFooter=x;exports.RGFooters=M;exports.RGGroupPanel=S;exports.RGHeader=v;exports.RGHeaderSummaries=b;exports.RGHeaderSummary=G;exports.RGLiteralColumn=C;exports.RGRowIndicator=V;exports.RGSeriesColumn=f;exports.RGStateBar=P;exports.RealGridReact=B;exports.RealTreeReact=D;
package/dist/index.d.ts CHANGED
@@ -116,8 +116,9 @@ declare interface IRealGridBaseProps<G> extends Omit<IComponentBase, '$grid'> {
116
116
  onKeyDown?: (grid: GridType<G>, event: KeyboardEvent) => boolean;
117
117
  onKeyPress?: (grid: GridType<G>, event: KeyboardEvent) => void;
118
118
  onKeyUp?: (grid: GridType<G>, event: KeyboardEvent) => void;
119
- onShowTooltip?: (grid: GridType<G>, index: RealGrid.CellIndex, value: any, isEllipsis: boolean) => boolean | string;
120
- onShowHeaderTooltip?: (grid: GridType<G>, column: RealGrid.GridColumn, value: any, layout: RealGrid.CellLayoutItem, isEllipsis: boolean) => string;
119
+ onShowTooltip?: (grid: GridType<G>, index: RealGrid.CellIndex, value: any, isEllipsis: boolean) => boolean | string | RealGrid.TooltipOptions;
120
+ onShowRowBarTooltip?: (grid: GridType<G>, cellType: RealGrid.GridCellType, itemIndex: number, dataRow: number) => string | RealGrid.TooltipOptions;
121
+ onShowHeaderTooltip?: (grid: GridType<G>, column: RealGrid.GridColumn, value: any, layout: RealGrid.CellLayoutItem, isEllipsis: boolean) => boolean | string | RealGrid.TooltipOptions;
121
122
  onColumnPropertyChanged?: (grid: GridType<G>, column: RealGrid.GridColumn, property: string, newValue: any, oldValue: any) => void;
122
123
  onLayoutPropertyChanged?: (grid: GridType<G>, layout: RealGrid.CellLayoutItem, property: string, newValue: any, oldValue: any) => void;
123
124
  onGridActivated?: (grid: GridType<G>) => void;
package/dist/index.es.js CHANGED
@@ -1,35 +1,35 @@
1
- var f = Object.defineProperty;
2
- var C = (n, r, t) => r in n ? f(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
- var o = (n, r, t) => (C(n, typeof r != "symbol" ? r + "" : r, t), t);
1
+ var C = Object.defineProperty;
2
+ var g = (n, r, t) => r in n ? C(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
+ var o = (n, r, t) => (g(n, typeof r != "symbol" ? r + "" : r, t), t);
4
4
  import p from "react";
5
5
  import * as u from "realgrid";
6
6
  const m = (n, ...r) => (r.forEach((t) => {
7
- for (const s in t) {
8
- if (s === "children")
7
+ for (const i in t) {
8
+ if (i === "children")
9
9
  continue;
10
- const e = t[s];
11
- e === null ? n[s] = null : e === void 0 ? delete n[s] : Array.isArray(e) ? n[s] = [...e] : typeof e == "object" ? e instanceof Date ? n[s] = new Date(e) : n[s] = m(n[s] == null ? {} : n[s], e) : n[s] = e;
10
+ const e = t[i];
11
+ e === null ? n[i] = null : e === void 0 ? delete n[i] : Array.isArray(e) ? n[i] = [...e] : typeof e == "object" ? e instanceof Date ? n[i] = new Date(e) : n[i] = m(n[i] == null ? {} : n[i], e) : n[i] = e;
12
12
  }
13
13
  }), n), c = (n, r = {}, t = {}) => {
14
14
  n = n || {};
15
- const s = ["children", "rows", "$grid"];
16
- for (const [e, i] of Object.entries(r))
17
- if (!s.includes(e))
15
+ const i = ["children", "rows", "$grid"];
16
+ for (const [e, s] of Object.entries(r))
17
+ if (!i.includes(e))
18
18
  if (!t.hasOwnProperty(e))
19
19
  n[e] = null;
20
- else if (Array.isArray(i))
21
- (!t[e] || JSON.stringify(i) != JSON.stringify(t[e])) && (n[e] = t[e]);
22
- else if (i instanceof Object && !(i instanceof Date || Array.isArray(i) || typeof i == "function"))
20
+ else if (Array.isArray(s))
21
+ (!t[e] || JSON.stringify(s) != JSON.stringify(t[e])) && (n[e] = t[e]);
22
+ else if (s instanceof Object && !(s instanceof Date || Array.isArray(s) || typeof s == "function"))
23
23
  if (!(t[e] instanceof Object))
24
24
  n[e] = t[e];
25
25
  else {
26
- const d = c({}, i, t[e]);
26
+ const d = c({}, s, t[e]);
27
27
  Object.keys(d).length && (n[e] = d);
28
28
  }
29
29
  else
30
- typeof i == "function" ? i.toString() !== t[e].toString() && (n[e] = t[e]) : i !== t[e] && (n[e] = t[e]);
31
- for (const [e, i] of Object.entries(t))
32
- s.includes(e) || r.hasOwnProperty(e) || (n[e] = i);
30
+ typeof s == "function" ? s.toString() !== t[e].toString() && (n[e] = t[e]) : s !== t[e] && (n[e] = t[e]);
31
+ for (const [e, s] of Object.entries(t))
32
+ i.includes(e) || r.hasOwnProperty(e) || (n[e] = s);
33
33
  return n;
34
34
  };
35
35
  class w extends p.Component {
@@ -49,9 +49,9 @@ class w extends p.Component {
49
49
  return t || {};
50
50
  }
51
51
  // private methods
52
- $_connectEvents(t, s, e) {
53
- for (let i in e)
54
- i && typeof i == "string" && i.startsWith("on") && (t.hasOwnProperty(i) && (t[i] = e[i]), s.hasOwnProperty(i) && (s[i] = e[i]), i === "onDataRowInserting" && (s.onRowInserting = e[i]));
52
+ $_connectEvents(t, i, e) {
53
+ for (let s in e)
54
+ s && typeof s == "string" && s.startsWith("on") && (t.hasOwnProperty(s) && (t[s] = e[s]), i.hasOwnProperty(s) && (i[s] = e[s]), s === "onDataRowInserting" && (i.onRowInserting = e[s]));
55
55
  }
56
56
  $_executeCallback() {
57
57
  var t;
@@ -61,8 +61,8 @@ class w extends p.Component {
61
61
  this.dataProvider.beginUpdate();
62
62
  try {
63
63
  for (; this._mountCBs && this._mountCBs.length; ) {
64
- const s = this._mountCBs.shift();
65
- s == null || s.call(this);
64
+ const i = this._mountCBs.shift();
65
+ i == null || i.call(this);
66
66
  }
67
67
  } finally {
68
68
  this.dataProvider.endUpdate();
@@ -73,50 +73,47 @@ class w extends p.Component {
73
73
  }
74
74
  }
75
75
  // public Method
76
- addCallback(t, s) {
77
- this._mountCBs.push(t), clearTimeout(this._mountTimer), this._columnsChanged = s === "column", this._mountTimer = setTimeout(() => {
76
+ addCallback(t, i) {
77
+ this._mountCBs.push(t), clearTimeout(this._mountTimer), this._columnsChanged = i === "column", this._mountTimer = setTimeout(() => {
78
78
  this.$_executeCallback();
79
79
  }, 20);
80
80
  }
81
81
  removeCallback(t) {
82
82
  if (this._mountCBs) {
83
- const s = this._mountCBs.indexOf(t);
84
- s >= 0 && this._mountCBs.splice(s, 1);
83
+ const i = this._mountCBs.indexOf(t);
84
+ i >= 0 && this._mountCBs.splice(i, 1);
85
85
  }
86
86
  }
87
87
  componentDidMount() {
88
- const { grid: t, dataProvider: s, props: e } = this.createObject();
89
- if (this._gridView = t, this._dataProvider = s, this.$_executeCallback(), this.$_connectEvents(t, s, e), t.setOptions(e.gridProps || {}), s.setOptions(e.dataProps || {}), e.rowStyleCallback && t.setRowStyleCallback(e.rowStyleCallback), e.cellStyleCallback && t.setCellStyleCallback(e.cellStyleCallback), e.layout && t.setColumnLayout(e.layout), e.onInitialized) {
90
- const i = e.onInitialized.constructor.name;
91
- i === "Function" ? e.onInitialized(t) : i === "AsyncFunction" && Promise.resolve(e.onInitialized(t));
92
- }
88
+ const { grid: t, dataProvider: i, props: e } = this.createObject();
89
+ this._gridView = t, this._dataProvider = i, this.$_executeCallback(), this.$_connectEvents(t, i, e), t.setOptions(e.gridProps || {}), i.setOptions(e.dataProps || {}), e.rowStyleCallback && t.setRowStyleCallback(e.rowStyleCallback), e.cellStyleCallback && t.setCellStyleCallback(e.cellStyleCallback), e.layout && t.setColumnLayout(e.layout);
93
90
  }
94
91
  componentWillUnmount() {
95
92
  this.beforeDestroy(), this._gridView = this._gridView && this._gridView.destroy(), this._dataProvider = this._dataProvider && this._dataProvider.destroy();
96
93
  }
97
- componentDidUpdate(t, s, e) {
94
+ componentDidUpdate(t, i, e) {
98
95
  this.$_executeCallback();
99
- const i = this.getProps(this.props) || {}, d = this.gridView, h = this.dataProvider;
100
- this.$_connectEvents(d, h, i);
101
- let l = c({}, t.dataProps, i.dataProps);
102
- h.setOptions(l), l = c({}, t.gridProps, i.gridProps), d.setOptions(l), l = c([], t.layout || [], i.layout || []), l && l.length > 0 && d.setColumnLayout(i.layout);
96
+ const s = this.getProps(this.props) || {}, d = this.gridView, h = this.dataProvider;
97
+ this.$_connectEvents(d, h, s);
98
+ let l = c({}, t.dataProps, s.dataProps);
99
+ h.setOptions(l), l = c({}, t.gridProps, s.gridProps), d.setOptions(l), l = c([], t.layout || [], s.layout || []), l && l.length > 0 && d.setColumnLayout(s.layout);
103
100
  }
104
101
  render() {
105
102
  const t = {};
106
103
  t.$grid = this;
107
- let s = 0;
108
- const e = p.Children.map(this.props.children, (i) => (i && i.type.CType === "$$RGColumn$$" ? t.displayIndex = i.props.displayIndex ?? s++ : delete t.displayIndex, i && p.cloneElement(i, t)));
109
- return p.createElement("div", { style: { width: "100%", height: "100%" }, ref: (i) => this.gridContainer = i }, e);
104
+ let i = 0;
105
+ const e = p.Children.map(this.props.children, (s) => (s && s.type.CType === "$$RGColumn$$" ? t.displayIndex = s.props.displayIndex ?? i++ : delete t.displayIndex, s && p.cloneElement(s, t)));
106
+ return p.createElement("div", { style: { width: "100%", height: "100%" }, ref: (s) => this.gridContainer = s }, e);
110
107
  }
111
108
  }
112
109
  class D extends w {
113
110
  constructor() {
114
111
  super(...arguments);
115
112
  o(this, "createObject", () => {
116
- var i;
117
- const t = m({}, this.getProps(this.props)), s = new u.GridView(this.gridContainer, t.accessibility, t.waiOptions), e = new u.LocalDataProvider((i = t.dataProps) == null ? void 0 : i.undoable);
118
- return s.setDataSource(e), {
119
- grid: s,
113
+ var s;
114
+ const t = m({}, this.getProps(this.props)), i = new u.GridView(this.gridContainer, t.accessibility, t.waiOptions), e = new u.LocalDataProvider((s = t.dataProps) == null ? void 0 : s.undoable);
115
+ return i.setDataSource(e), {
116
+ grid: i,
120
117
  dataProvider: e,
121
118
  props: t
122
119
  };
@@ -133,23 +130,23 @@ class D extends w {
133
130
  return this._dataProvider;
134
131
  }
135
132
  componentDidMount() {
136
- var s;
133
+ var i;
137
134
  super.componentDidMount();
138
135
  const t = this.props.rows;
139
- t && Array.isArray(t) && t.length > 0 && ((s = this.dataProvider) == null || s.setRows(t));
136
+ t && Array.isArray(t) && t.length > 0 && ((i = this.dataProvider) == null || i.setRows(t));
140
137
  }
141
- componentDidUpdate(t, s, e) {
142
- super.componentDidUpdate(t, s, e), t.rows != this.props.rows && this.dataProvider.setRows(this.props.rows);
138
+ componentDidUpdate(t, i, e) {
139
+ super.componentDidUpdate(t, i, e), t.rows != this.props.rows && this.dataProvider.setRows(this.props.rows);
143
140
  }
144
141
  }
145
- class P extends w {
142
+ class V extends w {
146
143
  constructor() {
147
144
  super(...arguments);
148
145
  o(this, "createObject", () => {
149
- var i;
150
- const t = m({}, this.getProps(this.props)), s = new u.TreeView(this.gridContainer), e = new u.LocalTreeDataProvider((i = t.dataProps) == null ? void 0 : i.undoable);
151
- return s.setTreeOptions(t.treeOptions || {}), s.setDataSource(e), {
152
- grid: s,
146
+ var s;
147
+ const t = m({}, this.getProps(this.props)), i = new u.TreeView(this.gridContainer), e = new u.LocalTreeDataProvider((s = t.dataProps) == null ? void 0 : s.undoable);
148
+ return i.setTreeOptions(t.treeOptions || {}), i.setDataSource(e), {
149
+ grid: i,
153
150
  dataProvider: e,
154
151
  props: t
155
152
  };
@@ -166,15 +163,15 @@ class P extends w {
166
163
  return this._dataProvider;
167
164
  }
168
165
  componentDidMount() {
169
- var s, e;
166
+ var i, e;
170
167
  super.componentDidMount();
171
168
  const t = this.props.rows;
172
- Array.isArray(t) ? (s = this.dataProvider) == null || s.setRows(t, this.props.treeField, this.props.needSorting, this.props.childrenField, this.props.iconField) : (e = this.dataProvider) == null || e.setObjectRows(this.props.json, this.props.rowsProp, this.props.childrenProp, this.props.iconProp);
169
+ Array.isArray(t) ? (i = this.dataProvider) == null || i.setRows(t, this.props.treeField, this.props.needSorting, this.props.childrenField, this.props.iconField) : (e = this.dataProvider) == null || e.setObjectRows(this.props.json, this.props.rowsProp, this.props.childrenProp, this.props.iconProp);
173
170
  }
174
- componentDidUpdate(t, s, e) {
171
+ componentDidUpdate(t, i, e) {
175
172
  var d, h;
176
- const i = this.props.rows;
177
- (this.props.treeField || this.props.rowsProp) && t.rows !== i && (Array.isArray(i) ? (d = this.dataProvider) == null || d.setRows(i, this.props.treeField, this.props.needSorting, this.props.childrenField, this.props.iconField) : (h = this.dataProvider) == null || h.setObjectRows(this.props.json, this.props.rowsProp, this.props.childrenProp, this.props.iconProp)), super.componentDidUpdate(t, s, e);
173
+ const s = this.props.rows;
174
+ (this.props.treeField || this.props.rowsProp) && t.rows !== s && (Array.isArray(s) ? (d = this.dataProvider) == null || d.setRows(s, this.props.treeField, this.props.needSorting, this.props.childrenField, this.props.iconField) : (h = this.dataProvider) == null || h.setObjectRows(this.props.json, this.props.rowsProp, this.props.childrenProp, this.props.iconProp)), super.componentDidUpdate(t, i, e);
178
175
  }
179
176
  }
180
177
  class a extends p.Component {
@@ -196,15 +193,15 @@ class a extends p.Component {
196
193
  const t = this.$parent;
197
194
  t && (t.removeCallback(this.mountCB), this.unMountCB()), this.$model = null;
198
195
  }
199
- componentDidUpdate(t, s, e) {
200
- let i = c({}, this.props, t);
201
- !(Object.keys(i).length === 0) && this.$model && this.$model.assignFrom && this.$model.assignFrom(i), this._doUpdate();
196
+ componentDidUpdate(t, i, e) {
197
+ let s = c({}, this.props, t);
198
+ !(Object.keys(s).length === 0) && this.$model && this.$model.assignFrom && this.$model.assignFrom(s), this._doUpdate();
202
199
  }
203
200
  render() {
204
201
  return p.createElement(p.Fragment);
205
202
  }
206
203
  }
207
- class g extends a {
204
+ class f extends a {
208
205
  constructor() {
209
206
  super(...arguments);
210
207
  o(this, "_column");
@@ -223,15 +220,15 @@ class g extends a {
223
220
  componentWillUnmount() {
224
221
  super.componentWillUnmount();
225
222
  }
226
- componentDidUpdate(t, s, e) {
227
- if (super.componentDidUpdate(t, s, e), t.width !== this.props.width) {
228
- const i = this.$model.layout;
229
- i && (i.cellWidth = this.props.width);
223
+ componentDidUpdate(t, i, e) {
224
+ if (super.componentDidUpdate(t, i, e), t.width !== this.props.width) {
225
+ const s = this.$model.layout;
226
+ s && (s.cellWidth = this.props.width);
230
227
  }
231
228
  }
232
229
  }
233
- o(g, "CType", "$$RGColumn$$");
234
- class V extends a {
230
+ o(f, "CType", "$$RGColumn$$");
231
+ class P extends a {
235
232
  constructor() {
236
233
  super(...arguments);
237
234
  o(this, "mountCB", () => {
@@ -244,7 +241,7 @@ class V extends a {
244
241
  });
245
242
  }
246
243
  }
247
- class v extends a {
244
+ class R extends a {
248
245
  constructor() {
249
246
  super(...arguments);
250
247
  o(this, "mountCB", () => {
@@ -255,7 +252,7 @@ class v extends a {
255
252
  });
256
253
  }
257
254
  }
258
- class R extends a {
255
+ class b extends a {
259
256
  constructor() {
260
257
  super(...arguments);
261
258
  o(this, "mountCB", () => {
@@ -272,7 +269,7 @@ class R extends a {
272
269
  super.componentWillUnmount();
273
270
  }
274
271
  }
275
- class b extends a {
272
+ class v extends a {
276
273
  constructor() {
277
274
  super(...arguments);
278
275
  o(this, "mountCB", () => {
@@ -316,7 +313,7 @@ class S extends a {
316
313
  });
317
314
  }
318
315
  }
319
- class F extends a {
316
+ class U extends a {
320
317
  constructor() {
321
318
  super(...arguments);
322
319
  o(this, "mountCB", () => {
@@ -327,7 +324,7 @@ class F extends a {
327
324
  });
328
325
  }
329
326
  }
330
- class U extends a {
327
+ class F extends a {
331
328
  constructor() {
332
329
  super(...arguments);
333
330
  o(this, "mountCB", () => {
@@ -343,13 +340,13 @@ class G extends a {
343
340
  super(...arguments);
344
341
  o(this, "_field");
345
342
  o(this, "mountCB", () => {
346
- const t = this.$parent.gridView, s = t == null ? void 0 : t.getDataSource();
347
- s && !s.fieldByName(this.props.fieldName) && (this._field = s.addField(this.props));
343
+ const t = this.$parent.gridView, i = t == null ? void 0 : t.getDataSource();
344
+ i && !i.fieldByName(this.props.fieldName) && (this._field = i.addField(this.props));
348
345
  });
349
346
  o(this, "unMountCB", () => {
350
347
  if (this._field) {
351
- const t = this.$parent.gridView, s = t == null ? void 0 : t.getDataSource();
352
- s && s.removeField(this._field.fieldName);
348
+ const t = this.$parent.gridView, i = t == null ? void 0 : t.getDataSource();
349
+ i && i.removeField(this._field.fieldName);
353
350
  }
354
351
  });
355
352
  }
@@ -361,17 +358,17 @@ class y extends a {
361
358
  o(this, "mounted");
362
359
  o(this, "_column");
363
360
  o(this, "mountCB", () => {
364
- const t = this.$parent.gridView, s = this.$parent.props.autoGenerateField, e = t == null ? void 0 : t.getDataSource();
365
- let i = this.props.fieldName;
366
- s && (!i && this.props.field && (i = this.props.field.fieldName), e && !e.fieldByName(i) && e.addField(this.props.field || i)), t && (this._column = this.$model = t.addColumn({ ...this.props, fieldName: i }, this.props.displayIndex ?? -1));
361
+ const t = this.$parent.gridView, i = this.$parent.props.autoGenerateField, e = t == null ? void 0 : t.getDataSource();
362
+ let s = this.props.fieldName;
363
+ i && (!s && this.props.field && (s = this.props.field.fieldName), e && !e.fieldByName(s) && e.addField(this.props.field || s)), t && (this._column = this.$model = t.addColumn({ ...this.props, fieldName: s }, this.props.displayIndex ?? -1));
367
364
  });
368
365
  o(this, "unMountCB", () => {
369
366
  const t = this.$parent.gridView;
370
367
  if (this._column && t && !t._view.disposing) {
371
- let s = this._column.fieldName;
368
+ let i = this._column.fieldName;
372
369
  t.removeColumn(this._column.name);
373
- const e = this.$parent.props.autoGenerateField, i = t == null ? void 0 : t.getDataSource();
374
- e && s && i && (t.columnByField(s) || i.removeField(s));
370
+ const e = this.$parent.props.autoGenerateField, s = t == null ? void 0 : t.getDataSource();
371
+ e && i && s && (t.columnByField(i) || s.removeField(i));
375
372
  }
376
373
  });
377
374
  }
@@ -381,10 +378,10 @@ class y extends a {
381
378
  componentWillUnmount() {
382
379
  super.componentWillUnmount();
383
380
  }
384
- componentDidUpdate(t, s, e) {
385
- if (super.componentDidUpdate(t, s, e), t.width !== this.props.width) {
386
- const i = this.$model.layout;
387
- i && (i.cellWidth = this.props.width);
381
+ componentDidUpdate(t, i, e) {
382
+ if (super.componentDidUpdate(t, i, e), t.width !== this.props.width) {
383
+ const s = this.$model.layout;
384
+ s && (s.cellWidth = this.props.width);
388
385
  }
389
386
  }
390
387
  }
@@ -419,10 +416,10 @@ class $ extends a {
419
416
  componentWillUnmount() {
420
417
  super.componentWillUnmount();
421
418
  }
422
- componentDidUpdate(t, s, e) {
423
- if (super.componentDidUpdate(t, s, e), t.width !== this.props.width) {
424
- const i = this.$model.layout;
425
- i && (i.cellWidth = this.props.width);
419
+ componentDidUpdate(t, i, e) {
420
+ if (super.componentDidUpdate(t, i, e), t.width !== this.props.width) {
421
+ const s = this.$model.layout;
422
+ s && (s.cellWidth = this.props.width);
426
423
  }
427
424
  }
428
425
  }
@@ -431,17 +428,17 @@ export {
431
428
  O as RGCheckBar,
432
429
  y as RGDataColumn,
433
430
  G as RGDataField,
434
- U as RGFilterPanel,
431
+ F as RGFilterPanel,
435
432
  S as RGFooter,
436
- F as RGFooters,
433
+ U as RGFooters,
437
434
  M as RGGroupPanel,
438
435
  x as RGHeader,
439
- R as RGHeaderSummaries,
440
- b as RGHeaderSummary,
436
+ b as RGHeaderSummaries,
437
+ v as RGHeaderSummary,
441
438
  $ as RGLiteralColumn,
442
- v as RGRowIndicator,
443
- g as RGSeriesColumn,
444
- V as RGStateBar,
439
+ R as RGRowIndicator,
440
+ f as RGSeriesColumn,
441
+ P as RGStateBar,
445
442
  D as RealGridReact,
446
- P as RealTreeReact
443
+ V as RealTreeReact
447
444
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "realgrid-react",
3
3
  "private": false,
4
- "version": "0.9.7",
4
+ "version": "0.9.9",
5
5
  "description": "RealGrid2 wrapping Component for React",
6
6
  "author": {
7
7
  "name": "WooriTech",