realgrid-react 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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(),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;
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){if(this._mountCBs){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
@@ -99,14 +99,14 @@ declare interface IRealGridBaseProps<G> extends Omit<IComponentBase, '$grid'> {
99
99
  onEditRowChanged?: (grid: GridType<G>, itemIndex: number, row: number, field: number, oldValue: any, newValue: any) => void;
100
100
  onEditRowPasted?: (grid: GridType<G>, itemIndex: number, row: number, fields: number[], oldValues: any[], newValues: any[]) => void;
101
101
  onRowsPasted?: (grid: GridType<G>, items: number[]) => void;
102
- onCellPasting?: (grid: GridType<G>, index: RealGrid.CellIndex, value: any) => boolean;
102
+ onCellPasting?: (grid: GridType<G>, index: RealGrid.CellIndex, value: any, editResult: RealGrid.EditResult) => boolean;
103
103
  onItemChecked?: (grid: GridType<G>, itemIndex: number, checked: boolean) => void;
104
104
  onItemAllChecked?: (grid: GridType<G>, checked: boolean) => void;
105
105
  onErrorClicked?: (grid: GridType<G>, error: string) => void;
106
106
  onSorting?: (grid: GridType<G>, fields: number[], directions: string[]) => boolean;
107
107
  onSortingChanged?: (grid: GridType<G>) => void;
108
108
  onFiltering?: (grid: GridType<G>) => boolean;
109
- onFilteringChanged?: (grid: GridType<G>, column: RealGrid.GridColumn, filter: RealGrid.ColumnFilter) => void;
109
+ onFilteringChanged?: (grid: GridType<G>, column: RealGrid.GridColumn, filter: RealGrid.ColumnFilter, reset: boolean) => void;
110
110
  onWheel?: (grid: GridType<G>, event: WheelEvent) => boolean;
111
111
  onKeyDown?: (grid: GridType<G>, event: KeyboardEvent) => boolean;
112
112
  onKeyPress?: (grid: GridType<G>, event: KeyboardEvent) => void;
package/dist/index.es.js CHANGED
@@ -77,8 +77,10 @@ class w extends p.Component {
77
77
  }, 20);
78
78
  }
79
79
  removeCallback(t) {
80
- const s = this._mountCBs.indexOf(t);
81
- s >= 0 && this._mountCBs.splice(s, 1);
80
+ if (this._mountCBs) {
81
+ const s = this._mountCBs.indexOf(t);
82
+ s >= 0 && this._mountCBs.splice(s, 1);
83
+ }
82
84
  }
83
85
  componentDidMount() {
84
86
  const { grid: t, dataProvider: s, props: e } = this.createObject();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "realgrid-react",
3
3
  "private": false,
4
- "version": "0.9.3",
4
+ "version": "0.9.4",
5
5
  "description": "RealGrid2 wrapping Component for React",
6
6
  "author": {
7
7
  "name": "WooriTech",