@revolist/revogrid-react 4.19.3 → 4.20.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/README.md CHANGED
@@ -41,6 +41,8 @@ Support Millions of cells and thousands of columns easy and efficiently for fast
41
41
 
42
42
  - **[Accessibility](https://rv-grid.com/guide/wcag)**: Follows WAI-ARIA best practices.
43
43
 
44
+ - **[RTL Support](https://rv-grid.com/guide/rtl)**: Comprehensive Right-to-Left language support for Arabic, Hebrew, Persian, and other RTL languages. Features automatic column reordering, proper text alignment, and layout adjustments for RTL interfaces.
45
+
44
46
  - **[Keyboard Support](https://rv-grid.com/guide/defs#Keyboard)**:
45
47
  - Excel-like focus for efficient navigation and editing.
46
48
  - Seamless copy/paste from Excel, Google Sheets, or any other sheet format.
@@ -171,27 +171,22 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
171
171
  };
172
172
  return createForwardRef(ReactComponent, displayName);
173
173
  };
174
- function TemplateConstructor(el, ReactComponent, initialProps, lastEl = null) {
175
- var _a;
176
- if (!el) {
177
- (_a = lastEl == null ? void 0 : lastEl.destroy) == null ? void 0 : _a.call(lastEl);
178
- return null;
179
- }
174
+ function TemplateConstructor(el, ReactComponent, initialProps, key) {
180
175
  if (!el._root) {
181
176
  el._root = createRoot(el);
182
177
  }
183
178
  const renderComponent = (props) => {
184
- var _a2;
185
- const vNode = createElement(ReactComponent, props);
186
- (_a2 = el._root) == null ? void 0 : _a2.render(vNode);
179
+ var _a;
180
+ const vNode = createElement(ReactComponent, { ...props, key });
181
+ (_a = el._root) == null ? void 0 : _a.render(vNode);
187
182
  };
188
183
  renderComponent(initialProps);
189
184
  const update = (newProps) => {
190
185
  renderComponent(newProps);
191
186
  };
192
187
  const destroy = () => {
193
- var _a2;
194
- (_a2 = el._root) == null ? void 0 : _a2.unmount();
188
+ var _a;
189
+ (_a = el._root) == null ? void 0 : _a.unmount();
195
190
  el._root = void 0;
196
191
  };
197
192
  return { update, destroy };
@@ -200,11 +195,16 @@ const Template = (ReactComponent, customProps) => {
200
195
  return (h, p, addition) => {
201
196
  const props = customProps ? { ...customProps, ...p } : p;
202
197
  props.addition = addition;
198
+ const key = `${p.prop}-${p.rowIndex || 0}`;
203
199
  let lastEl = null;
204
200
  return h("span", {
205
- key: `${p.prop}-${p.rowIndex || 0}`,
206
201
  ref: (el) => {
207
- lastEl = TemplateConstructor(el, ReactComponent, props, lastEl);
202
+ var _a;
203
+ if (!el) {
204
+ (_a = lastEl == null ? void 0 : lastEl.destroy) == null ? void 0 : _a.call(lastEl);
205
+ } else {
206
+ lastEl = TemplateConstructor(el, ReactComponent, props, key);
207
+ }
208
208
  }
209
209
  });
210
210
  };
@@ -232,17 +232,26 @@ class EditorAdapter {
232
232
  var _a;
233
233
  return h("span", {
234
234
  key: `${this.column.prop}-${((_a = this.editCell) == null ? void 0 : _a.rowIndex) || 0}`,
235
- ref: (el) => this.renderedComponent = TemplateConstructor(
236
- el,
237
- this.EditorComponent,
238
- {
239
- ...this.editCell,
240
- column: this.column,
241
- save: this.save,
242
- close: this.close
243
- },
244
- this.renderedComponent
245
- )
235
+ ref: (el) => {
236
+ var _a2, _b;
237
+ const key = `${this.column.prop}-${((_a2 = this.editCell) == null ? void 0 : _a2.rowIndex) || 0}`;
238
+ if (!el) {
239
+ (_b = this.renderedComponent) == null ? void 0 : _b.destroy();
240
+ this.renderedComponent = null;
241
+ } else {
242
+ this.renderedComponent = TemplateConstructor(
243
+ el,
244
+ this.EditorComponent,
245
+ {
246
+ ...this.editCell,
247
+ column: this.column,
248
+ save: this.save,
249
+ close: this.close
250
+ },
251
+ key
252
+ );
253
+ }
254
+ }
246
255
  });
247
256
  }
248
257
  }
@@ -169,27 +169,22 @@ var __publicField = (obj, key, value) => {
169
169
  };
170
170
  return createForwardRef(ReactComponent, displayName);
171
171
  };
172
- function TemplateConstructor(el, ReactComponent, initialProps, lastEl = null) {
173
- var _a;
174
- if (!el) {
175
- (_a = lastEl == null ? void 0 : lastEl.destroy) == null ? void 0 : _a.call(lastEl);
176
- return null;
177
- }
172
+ function TemplateConstructor(el, ReactComponent, initialProps, key) {
178
173
  if (!el._root) {
179
174
  el._root = client.createRoot(el);
180
175
  }
181
176
  const renderComponent = (props) => {
182
- var _a2;
183
- const vNode = React.createElement(ReactComponent, props);
184
- (_a2 = el._root) == null ? void 0 : _a2.render(vNode);
177
+ var _a;
178
+ const vNode = React.createElement(ReactComponent, { ...props, key });
179
+ (_a = el._root) == null ? void 0 : _a.render(vNode);
185
180
  };
186
181
  renderComponent(initialProps);
187
182
  const update = (newProps) => {
188
183
  renderComponent(newProps);
189
184
  };
190
185
  const destroy = () => {
191
- var _a2;
192
- (_a2 = el._root) == null ? void 0 : _a2.unmount();
186
+ var _a;
187
+ (_a = el._root) == null ? void 0 : _a.unmount();
193
188
  el._root = void 0;
194
189
  };
195
190
  return { update, destroy };
@@ -198,11 +193,16 @@ var __publicField = (obj, key, value) => {
198
193
  return (h, p, addition) => {
199
194
  const props = customProps ? { ...customProps, ...p } : p;
200
195
  props.addition = addition;
196
+ const key = `${p.prop}-${p.rowIndex || 0}`;
201
197
  let lastEl = null;
202
198
  return h("span", {
203
- key: `${p.prop}-${p.rowIndex || 0}`,
204
199
  ref: (el) => {
205
- lastEl = TemplateConstructor(el, ReactComponent, props, lastEl);
200
+ var _a;
201
+ if (!el) {
202
+ (_a = lastEl == null ? void 0 : lastEl.destroy) == null ? void 0 : _a.call(lastEl);
203
+ } else {
204
+ lastEl = TemplateConstructor(el, ReactComponent, props, key);
205
+ }
206
206
  }
207
207
  });
208
208
  };
@@ -230,17 +230,26 @@ var __publicField = (obj, key, value) => {
230
230
  var _a;
231
231
  return h("span", {
232
232
  key: `${this.column.prop}-${((_a = this.editCell) == null ? void 0 : _a.rowIndex) || 0}`,
233
- ref: (el) => this.renderedComponent = TemplateConstructor(
234
- el,
235
- this.EditorComponent,
236
- {
237
- ...this.editCell,
238
- column: this.column,
239
- save: this.save,
240
- close: this.close
241
- },
242
- this.renderedComponent
243
- )
233
+ ref: (el) => {
234
+ var _a2, _b;
235
+ const key = `${this.column.prop}-${((_a2 = this.editCell) == null ? void 0 : _a2.rowIndex) || 0}`;
236
+ if (!el) {
237
+ (_b = this.renderedComponent) == null ? void 0 : _b.destroy();
238
+ this.renderedComponent = null;
239
+ } else {
240
+ this.renderedComponent = TemplateConstructor(
241
+ el,
242
+ this.EditorComponent,
243
+ {
244
+ ...this.editCell,
245
+ column: this.column,
246
+ save: this.save,
247
+ close: this.close
248
+ },
249
+ key
250
+ );
251
+ }
252
+ }
244
253
  });
245
254
  }
246
255
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revolist/revogrid-react",
3
3
  "sideEffects": false,
4
- "version": "4.19.3",
4
+ "version": "4.20.2",
5
5
  "description": "React DataGrid Spreadsheet component with native cell render support",
6
6
  "main": "./dist/react-datagrid.umd.cjs",
7
7
  "module": "./dist/react-datagrid.js",
@@ -64,16 +64,17 @@
64
64
  "homepage": "https://github.com/revolist/revogrid#readme",
65
65
  "license": "MIT",
66
66
  "dependencies": {
67
- "@revolist/revogrid": "4.19.3"
67
+ "@revolist/revogrid": "4.20.2"
68
68
  },
69
69
  "devDependencies": {
70
+ "@stencil/core": "^4.17.1",
71
+ "@types/node": "^25.0.3",
70
72
  "@types/react": "^18.3.2",
71
73
  "@types/react-dom": "^18.3.0",
72
74
  "@vitejs/plugin-react": "^4.2.1",
73
- "typescript": "^5.2.2",
74
75
  "react": "^18.3.1",
75
76
  "react-dom": "^18.3.1",
76
- "@stencil/core": "^4.17.1",
77
+ "typescript": "^5.2.2",
77
78
  "vite": "^5.2.11",
78
79
  "vite-plugin-dts": "^3.9.1"
79
80
  }