realgrid-react 0.9.0 → 0.9.2

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 C=Object.defineProperty;var $=(o,r,t)=>r in o?C(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t;var n=(o,r,t)=>($(o,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),_=require("realgrid");function B(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>o[t]})}}return r.default=o,Object.freeze(r)}const u=B(_),m=(o,...r)=>(r.forEach(t=>{for(const s in t){if(s==="children")continue;const e=t[s];e===null?o[s]=null:e===void 0?delete o[s]:Array.isArray(e)?o[s]=[...e]:typeof e=="object"?e instanceof Date?o[s]=new Date(e):o[s]=m(o[s]==null?{}:o[s],e):o[s]=e}}),o),h=(o,r={},t={})=>{o=o||{};const s=["children","rows","$grid"];for(const[e,i]of Object.entries(r))if(!s.includes(e))if(!t.hasOwnProperty(e))o[e]=null;else if(Array.isArray(i))(!t[e]||JSON.stringify(i)!=JSON.stringify(t[e]))&&(o[e]=t[e]);else if(i instanceof Object&&!(i instanceof Date||Array.isArray(i)||typeof i=="function"))if(!(t[e]instanceof Object))o[e]=t[e];else{const d=h({},i,t[e]);Object.keys(d).length&&(o[e]=d)}else typeof i=="function"?i.toString()!==t[e].toString()&&(o[e]=t[e]):i!==t[e]&&(o[e]=t[e]);for(const[e,i]of Object.entries(t))s.includes(e)||r.hasOwnProperty(e)||(o[e]=i);return o};class w extends l.Component{constructor(t){super(t);n(this,"_gridView",null);n(this,"_dataProvider",null);n(this,"_mountCBs",[]);n(this,"_mountTimer");n(this,"gridContainer");this.gridContainer=l.createRef()}getProps(t){return t||{}}$_connectEvents(t,s,e){for(let i in e)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]))}$_executeCallback(){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 t=this._mountCBs.shift();t==null||t.call(this)}}finally{this.dataProvider.endUpdate()}}finally{this.gridView.endUpdate(!0),this._mountTimer=null,this._mountCBs=[]}}}addCallback(t){this._mountCBs.push(t),clearTimeout(this._mountTimer),this._mountTimer=setTimeout(()=>{this.$_executeCallback()},20)}removeCallback(t){const s=this._mountCBs.indexOf(t);s>=0&&this._mountCBs.splice(s,1)}componentDidMount(){const{grid:t,dataProvider:s,props:e}=this.createObject();if(this._gridView=t,this._dataProvider=s,this.$_executeCallback(),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){const i=e.onInitialized.constructor.name;i==="Function"?e.onInitialized(t):i==="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,s,e){this.$_executeCallback();const i=this.getProps(this.props)||{},d=this.gridView,c=this.dataProvider;this.$_connectEvents(d,c,i);let p=h({},t.dataProps,i.dataProps);c.setOptions(p),p=h({},t.gridProps,i.gridProps),d.setOptions(p),p=h([],t.layout||[],i.layout||[]),p&&p.length>0&&d.setColumnLayout(i.layout)}render(){const t={};t.$grid=this;let s=0;const e=l.Children.map(this.props.children,i=>(i&&i.type.CType==="$$RGColumn$$"?t.displayIndex=s++:delete t.displayIndex,i&&l.cloneElement(i,t)));return l.createElement("div",{style:{width:"100%",height:"100%"},ref:i=>this.gridContainer=i},e)}}class R extends w{constructor(){super(...arguments);n(this,"createObject",()=>{var i;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);return s.setDataSource(e),{grid:s,dataProvider:e,props:t}});n(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 s;super.componentDidMount();const t=this.props.rows;t&&Array.isArray(t)&&t.length>0&&((s=this.dataProvider)==null||s.setRows(t))}componentDidUpdate(t,s,e){super.componentDidUpdate(t,s,e),t.rows!=this.props.rows&&this.dataProvider.setRows(this.props.rows)}}class P extends w{constructor(){super(...arguments);n(this,"createObject",()=>{var i;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);return s.setTreeOptions(t.treeOptions||{}),s.setDataSource(e),{grid:s,dataProvider:e,props:t}});n(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 s,e;super.componentDidMount();const t=this.props.rows;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)}componentDidUpdate(t,s,e){var d,c;const i=this.props.rows;(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):(c=this.dataProvider)==null||c.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)),super.componentDidUpdate(t,s,e)}}class a extends l.Component{constructor(t){super(t);n(this,"$parent");n(this,"$model");this.$parent=t.$grid}_doUpdate(){}componentDidMount(){const t=this.$parent;t&&t.addCallback(this.mountCB)}componentWillUnmount(){const t=this.$parent;t&&(t.removeCallback(this.mountCB),this.unMountCB()),this.$model=null}componentDidUpdate(t,s,e){let i=h({},this.props,t);this.$model&&this.$model.assignFrom&&this.$model.assignFrom(i),this._doUpdate()}render(){return l.createElement(l.Fragment)}}class f extends a{constructor(){super(...arguments);n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"series"},this.props.displayIndex??-1))});n(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,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(f,"CType","$$RGColumn$$");class D extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({...this.props}),this.$model=this.$parent.gridView.stateBar});n(this,"unMountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({})})}}class V extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setRowIndicator({...this.props}),this.$model=this.$parent.gridView.rowIndicator});n(this,"unMountCB",()=>{})}}class b extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummaries({...this.props}),this.$model=this.$parent.gridView.headerSummaries});n(this,"unMountCB",()=>{})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}}class G extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummary({...this.props}),this.$model=this.$parent.gridView.headerSummary});n(this,"unMountCB",()=>{})}}class v extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeader({...this.props}),this.$model=this.$parent.gridView.header});n(this,"unMountCB",()=>{})}}class S extends a{constructor(){super(...arguments);n(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)});n(this,"unMountCB",()=>{})}}class F extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooter({...this.props}),this.$model=this.$parent.gridView.footer});n(this,"unMountCB",()=>{})}}class M extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooters({...this.props}),this.$model=this.$parent.gridView.footers});n(this,"unMountCB",()=>{})}}class x extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFilterPanel({...this.props}),this.$model=this.$parent.gridView.filterPanel});n(this,"unMountCB",()=>{})}}class O extends a{constructor(){super(...arguments);n(this,"_field");n(this,"mountCB",()=>{const t=this.$parent.gridView,s=t==null?void 0:t.getDataSource();s&&!s.fieldByName(this.props.fieldName)&&(this._field=s.addField(this.props))});n(this,"unMountCB",()=>{if(this._field){const t=this.$parent.gridView,s=t==null?void 0:t.getDataSource();s&&s.removeField(this._field.fieldName)}})}}class g extends a{constructor(){super(...arguments);n(this,"fieldName");n(this,"mounted");n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView,s=this.$parent.props.autoGenerateField,e=t==null?void 0:t.getDataSource();let i=this.props.fieldName;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))});n(this,"unMountCB",()=>{const t=this.$parent.gridView;if(this._column&&t&&!t._view.disposing){let s=this._column.fieldName;t.removeColumn(this._column.name);const e=this.$parent.props.autoGenerateField,i=t==null?void 0:t.getDataSource();e&&s&&i&&(t.columnByField(s)||i.removeField(s))}})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(g,"CType","$$RGColumn$$");class U extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setCheckBar({...this.props}),this.$model=this.$parent.gridView.checkBar});n(this,"unMountCB",()=>{})}}class y extends a{constructor(){super(...arguments);n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"literal"},this.props.displayIndex??-1))});n(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,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(y,"CType","$$RGColumn$$");exports.RGCheckBar=U;exports.RGDataColumn=g;exports.RGDataField=O;exports.RGFilterPanel=x;exports.RGFooter=F;exports.RGFooters=M;exports.RGGroupPanel=S;exports.RGHeader=v;exports.RGHeaderSummaries=b;exports.RGHeaderSummary=G;exports.RGLiteralColumn=y;exports.RGRowIndicator=V;exports.RGSeriesColumn=f;exports.RGStateBar=D;exports.RealGridReact=R;exports.RealTreeReact=P;
1
+ "use strict";var C=Object.defineProperty;var $=(o,r,t)=>r in o?C(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t;var n=(o,r,t)=>($(o,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),_=require("realgrid");function B(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>o[t]})}}return r.default=o,Object.freeze(r)}const u=B(_),m=(o,...r)=>(r.forEach(t=>{for(const s in t){if(s==="children")continue;const e=t[s];e===null?o[s]=null:e===void 0?delete o[s]:Array.isArray(e)?o[s]=[...e]:typeof e=="object"?e instanceof Date?o[s]=new Date(e):o[s]=m(o[s]==null?{}:o[s],e):o[s]=e}}),o),h=(o,r={},t={})=>{o=o||{};const s=["children","rows","$grid"];for(const[e,i]of Object.entries(r))if(!s.includes(e))if(!t.hasOwnProperty(e))o[e]=null;else if(Array.isArray(i))(!t[e]||JSON.stringify(i)!=JSON.stringify(t[e]))&&(o[e]=t[e]);else if(i instanceof Object&&!(i instanceof Date||Array.isArray(i)||typeof i=="function"))if(!(t[e]instanceof Object))o[e]=t[e];else{const d=h({},i,t[e]);Object.keys(d).length&&(o[e]=d)}else typeof i=="function"?i.toString()!==t[e].toString()&&(o[e]=t[e]):i!==t[e]&&(o[e]=t[e]);for(const[e,i]of Object.entries(t))s.includes(e)||r.hasOwnProperty(e)||(o[e]=i);return o};class w extends l.Component{constructor(t){super(t);n(this,"_gridView",null);n(this,"_dataProvider",null);n(this,"_mountCBs",[]);n(this,"_mountTimer");n(this,"gridContainer");this.gridContainer=l.createRef()}getProps(t){return t||{}}$_connectEvents(t,s,e){for(let i in e)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]))}$_executeCallback(){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 t=this._mountCBs.shift();t==null||t.call(this)}}finally{this.dataProvider.endUpdate()}}finally{this.gridView.endUpdate(!0),this._mountTimer=null,this._mountCBs=[]}}}addCallback(t){this._mountCBs.push(t),clearTimeout(this._mountTimer),this._mountTimer=setTimeout(()=>{this.$_executeCallback()},20)}removeCallback(t){const s=this._mountCBs.indexOf(t);s>=0&&this._mountCBs.splice(s,1)}componentDidMount(){const{grid:t,dataProvider:s,props:e}=this.createObject();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){const i=e.onInitialized.constructor.name;i==="Function"?e.onInitialized(t):i==="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,s,e){this.$_executeCallback();const i=this.getProps(this.props)||{},d=this.gridView,c=this.dataProvider;this.$_connectEvents(d,c,i);let p=h({},t.dataProps,i.dataProps);c.setOptions(p),p=h({},t.gridProps,i.gridProps),d.setOptions(p),p=h([],t.layout||[],i.layout||[]),p&&p.length>0&&d.setColumnLayout(i.layout)}render(){const t={};t.$grid=this;let s=0;const e=l.Children.map(this.props.children,i=>(i&&i.type.CType==="$$RGColumn$$"?t.displayIndex=s++:delete t.displayIndex,i&&l.cloneElement(i,t)));return l.createElement("div",{style:{width:"100%",height:"100%"},ref:i=>this.gridContainer=i},e)}}class R extends w{constructor(){super(...arguments);n(this,"createObject",()=>{var i;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);return s.setDataSource(e),{grid:s,dataProvider:e,props:t}});n(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 s;super.componentDidMount();const t=this.props.rows;t&&Array.isArray(t)&&t.length>0&&((s=this.dataProvider)==null||s.setRows(t))}componentDidUpdate(t,s,e){super.componentDidUpdate(t,s,e),t.rows!=this.props.rows&&this.dataProvider.setRows(this.props.rows)}}class P extends w{constructor(){super(...arguments);n(this,"createObject",()=>{var i;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);return s.setTreeOptions(t.treeOptions||{}),s.setDataSource(e),{grid:s,dataProvider:e,props:t}});n(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 s,e;super.componentDidMount();const t=this.props.rows;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)}componentDidUpdate(t,s,e){var d,c;const i=this.props.rows;(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):(c=this.dataProvider)==null||c.setObjectRows(this.props.json,this.props.rowsProp,this.props.childrenProp,this.props.iconProp)),super.componentDidUpdate(t,s,e)}}class a extends l.Component{constructor(t){super(t);n(this,"$parent");n(this,"$model");this.$parent=t.$grid}_doUpdate(){}componentDidMount(){const t=this.$parent;t&&t.addCallback(this.mountCB)}componentWillUnmount(){const t=this.$parent;t&&(t.removeCallback(this.mountCB),this.unMountCB()),this.$model=null}componentDidUpdate(t,s,e){let i=h({},this.props,t);this.$model&&this.$model.assignFrom&&this.$model.assignFrom(i),this._doUpdate()}render(){return l.createElement(l.Fragment)}}class f extends a{constructor(){super(...arguments);n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"series"},this.props.displayIndex??-1))});n(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,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(f,"CType","$$RGColumn$$");class D extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({...this.props}),this.$model=this.$parent.gridView.stateBar});n(this,"unMountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setStateBar({})})}}class V extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setRowIndicator({...this.props}),this.$model=this.$parent.gridView.rowIndicator});n(this,"unMountCB",()=>{})}}class b extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummaries({...this.props}),this.$model=this.$parent.gridView.headerSummaries});n(this,"unMountCB",()=>{})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}}class G extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeaderSummary({...this.props}),this.$model=this.$parent.gridView.headerSummary});n(this,"unMountCB",()=>{})}}class v extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setHeader({...this.props}),this.$model=this.$parent.gridView.header});n(this,"unMountCB",()=>{})}}class S extends a{constructor(){super(...arguments);n(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)});n(this,"unMountCB",()=>{})}}class F extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooter({...this.props}),this.$model=this.$parent.gridView.footer});n(this,"unMountCB",()=>{})}}class M extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFooters({...this.props}),this.$model=this.$parent.gridView.footers});n(this,"unMountCB",()=>{})}}class x extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setFilterPanel({...this.props}),this.$model=this.$parent.gridView.filterPanel});n(this,"unMountCB",()=>{})}}class O extends a{constructor(){super(...arguments);n(this,"_field");n(this,"mountCB",()=>{const t=this.$parent.gridView,s=t==null?void 0:t.getDataSource();s&&!s.fieldByName(this.props.fieldName)&&(this._field=s.addField(this.props))});n(this,"unMountCB",()=>{if(this._field){const t=this.$parent.gridView,s=t==null?void 0:t.getDataSource();s&&s.removeField(this._field.fieldName)}})}}class g extends a{constructor(){super(...arguments);n(this,"fieldName");n(this,"mounted");n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView,s=this.$parent.props.autoGenerateField,e=t==null?void 0:t.getDataSource();let i=this.props.fieldName;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))});n(this,"unMountCB",()=>{const t=this.$parent.gridView;if(this._column&&t&&!t._view.disposing){let s=this._column.fieldName;t.removeColumn(this._column.name);const e=this.$parent.props.autoGenerateField,i=t==null?void 0:t.getDataSource();e&&s&&i&&(t.columnByField(s)||i.removeField(s))}})}componentDidMount(){super.componentDidMount()}componentWillUnmount(){super.componentWillUnmount()}componentDidUpdate(t,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(g,"CType","$$RGColumn$$");class U extends a{constructor(){super(...arguments);n(this,"mountCB",()=>{var t;(t=this.$parent.gridView)==null||t.setCheckBar({...this.props}),this.$model=this.$parent.gridView.checkBar});n(this,"unMountCB",()=>{})}}class y extends a{constructor(){super(...arguments);n(this,"_column");n(this,"mountCB",()=>{const t=this.$parent.gridView;t&&(this._column=this.$model=t.addColumn({...this.props,type:"literal"},this.props.displayIndex??-1))});n(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,s,e){if(super.componentDidUpdate(t,s,e),t.width!==this.props.width){const i=this.$model.layout;i&&(i.cellWidth=this.props.width)}}}n(y,"CType","$$RGColumn$$");exports.RGCheckBar=U;exports.RGDataColumn=g;exports.RGDataField=O;exports.RGFilterPanel=x;exports.RGFooter=F;exports.RGFooters=M;exports.RGGroupPanel=S;exports.RGHeader=v;exports.RGHeaderSummaries=b;exports.RGHeaderSummary=G;exports.RGLiteralColumn=y;exports.RGRowIndicator=V;exports.RGSeriesColumn=f;exports.RGStateBar=D;exports.RealGridReact=R;exports.RealTreeReact=P;
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ declare interface IRealGridBaseProps<G> extends Omit<IComponentBase, '$grid'> {
88
88
  onShowEditCommand?: (grid: GridType<G>, index: RealGrid.CellIndex) => boolean;
89
89
  onHideEditor?: (grid: GridType<G>, index: RealGrid.CellIndex) => void;
90
90
  onEditChange?: (grid: GridType<G>, index: RealGrid.CellIndex, value: any) => void;
91
- onGetEditValue?: (grid: GridType<G>, index: RealGrid.CellIndex, editResult: Object) => void;
91
+ onGetEditValue?: (grid: GridType<G>, index: RealGrid.CellIndex, editResult: Object) => void | boolean;
92
92
  onEditCommit?: (grid: GridType<G>, index: RealGrid.CellIndex, oldValue: any, newValue: any) => boolean;
93
93
  onEditCanceled?: (grid: GridType<G>, index: RealGrid.CellIndex) => void;
94
94
  onItemEditCanceled?: (grid: GridType<G>, itemIndex: number, state: string) => void;
@@ -198,7 +198,7 @@ declare interface IRealGridTreeProps extends IRealGridBaseProps<RealGrid.TreeVie
198
198
  onRowDeleting?: (provider: RealGrid.LocalTreeDataProvider, row: number) => boolean;
199
199
  onRowDeleted?: (provider: RealGrid.LocalTreeDataProvider, row: number) => void;
200
200
  onRowsDeleted?: (provider: RealGrid.LocalTreeDataProvider, rows: number[]) => void;
201
- onRowUpdating?: (provider: RealGrid.LocalTreeDataProvider, row: number) => boolean;
201
+ onRowUpdating?: (provider: RealGrid.LocalTreeDataProvider, row: number, oldValues: RealGrid.RowValues, newValues: RealGrid.RowValues) => boolean;
202
202
  onRowUpdated?: (provider: RealGrid.LocalTreeDataProvider, row: number) => void;
203
203
  onRowsUpdating?: (provider: RealGrid.LocalTreeDataProvider, rows: number[]) => boolean;
204
204
  onRowsUpdated?: (provider: RealGrid.LocalTreeDataProvider, rows: number[]) => void;
@@ -228,7 +228,7 @@ declare interface IRealGridViewProps extends IRealGridBaseProps<RealGrid.GridVie
228
228
  onCollapsing?: (grid: RealGrid.GridView, itemIndex: number) => boolean;
229
229
  onCollapsed?: (grid: RealGrid.GridView, itemIndex: number) => void;
230
230
  onRowCountChanged?: (provider: RealGrid.LocalDataProvider, newCount: number) => void;
231
- onRowUpdating?: (provider: RealGrid.LocalDataProvider, row: number) => boolean;
231
+ onRowUpdating?: (provider: RealGrid.LocalDataProvider, row: number, oldValues: RealGrid.RowValues, newValues: RealGrid.RowValues) => boolean;
232
232
  onRowUpdated?: (provider: RealGrid.LocalDataProvider, row: number) => void;
233
233
  onRowsUpdated?: (provider: RealGrid.LocalDataProvider, row: number, count: number) => void;
234
234
  onRowListUpdated?: (provider: RealGrid.LocalDataProvider, rows: number[]) => void;
package/dist/index.es.js CHANGED
@@ -82,7 +82,7 @@ class w extends p.Component {
82
82
  }
83
83
  componentDidMount() {
84
84
  const { grid: t, dataProvider: s, props: e } = this.createObject();
85
- if (this._gridView = t, this._dataProvider = s, this.$_executeCallback(), 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) {
85
+ 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) {
86
86
  const i = e.onInitialized.constructor.name;
87
87
  i === "Function" ? e.onInitialized(t) : i === "AsyncFunction" && Promise.resolve(e.onInitialized(t));
88
88
  }
@@ -199,7 +199,7 @@ class a extends p.Component {
199
199
  return p.createElement(p.Fragment);
200
200
  }
201
201
  }
202
- class g extends a {
202
+ class $ extends a {
203
203
  constructor() {
204
204
  super(...arguments);
205
205
  o(this, "_column");
@@ -225,7 +225,7 @@ class g extends a {
225
225
  }
226
226
  }
227
227
  }
228
- o(g, "CType", "$$RGColumn$$");
228
+ o($, "CType", "$$RGColumn$$");
229
229
  class D extends a {
230
230
  constructor() {
231
231
  super(...arguments);
@@ -349,7 +349,7 @@ class O extends a {
349
349
  });
350
350
  }
351
351
  }
352
- class y extends a {
352
+ class g extends a {
353
353
  constructor() {
354
354
  super(...arguments);
355
355
  o(this, "fieldName");
@@ -383,7 +383,7 @@ class y extends a {
383
383
  }
384
384
  }
385
385
  }
386
- o(y, "CType", "$$RGColumn$$");
386
+ o(g, "CType", "$$RGColumn$$");
387
387
  class G extends a {
388
388
  constructor() {
389
389
  super(...arguments);
@@ -395,7 +395,7 @@ class G extends a {
395
395
  });
396
396
  }
397
397
  }
398
- class $ extends a {
398
+ class y extends a {
399
399
  constructor() {
400
400
  super(...arguments);
401
401
  o(this, "_column");
@@ -421,10 +421,10 @@ class $ extends a {
421
421
  }
422
422
  }
423
423
  }
424
- o($, "CType", "$$RGColumn$$");
424
+ o(y, "CType", "$$RGColumn$$");
425
425
  export {
426
426
  G as RGCheckBar,
427
- y as RGDataColumn,
427
+ g as RGDataColumn,
428
428
  O as RGDataField,
429
429
  U as RGFilterPanel,
430
430
  S as RGFooter,
@@ -433,9 +433,9 @@ export {
433
433
  x as RGHeader,
434
434
  b as RGHeaderSummaries,
435
435
  R as RGHeaderSummary,
436
- $ as RGLiteralColumn,
436
+ y as RGLiteralColumn,
437
437
  v as RGRowIndicator,
438
- g as RGSeriesColumn,
438
+ $ as RGSeriesColumn,
439
439
  D as RGStateBar,
440
440
  P as RealGridReact,
441
441
  V as RealTreeReact
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "realgrid-react",
3
3
  "private": false,
4
- "version": "0.9.0",
4
+ "version": "0.9.2",
5
5
  "description": "RealGrid2 wrapping Component for React",
6
6
  "author": {
7
7
  "name": "WooriTech",
@@ -24,10 +24,10 @@
24
24
  "module": "./dist/index.es.js",
25
25
  "types": "./dist/index.d.ts",
26
26
  "peerDependencies": {
27
- "react": "^16.2.0 || ^17.0.0 || ^18.0.0",
28
- "react-dom": "^16.2.0 || ^17.0.0 || ^18.0.0"
27
+ "react": ">= 16.2.0",
28
+ "react-dom": ">= 16.2.0"
29
29
  },
30
30
  "dependencies": {
31
- "realgrid": "^2.8.3"
31
+ "realgrid": "*"
32
32
  }
33
33
  }