mctable-react 1.0.14 → 1.0.16

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
@@ -54,6 +54,17 @@ You can also pass `settings`, `license`, or `onReady` if you need deeper access
54
54
 
55
55
  ## Changelog
56
56
 
57
+ ```
58
+ v1.0.16
59
+ - Upgrade to `mctable` core library `v1.5.1`
60
+ - Minor fixes
61
+ ```
62
+
63
+ ```
64
+ v1.0.15
65
+ - Upgrade to `mctable` core library `v1.5.0`
66
+ ```
67
+
57
68
  ```
58
69
  v1.0.14
59
70
  - Upgrade to `mctable` core library `v1.4.6`
package/dist/index.cjs CHANGED
@@ -195,7 +195,6 @@ var McTableReact = React.forwardRef(
195
195
  records: records ?? [],
196
196
  columns: columns ?? []
197
197
  });
198
- const [readyTick, setReadyTick] = React.useState(0);
199
198
  const effectiveSettings = React.useMemo(() => {
200
199
  const hasAnyResizeCallback = onColumnResizeStart !== void 0 || onColumnResizing !== void 0 || onColumnResizeEnd !== void 0 || onRowResizeStart !== void 0 || onRowResizing !== void 0 || onRowResizeEnd !== void 0;
201
200
  if (!settings && !hasAnyResizeCallback) return void 0;
@@ -203,6 +202,7 @@ var McTableReact = React.forwardRef(
203
202
  const nextEvents = {
204
203
  ...settings?.events ?? {}
205
204
  };
205
+ const originalOnValidationUpdate = nextEvents.onValidationUpdate;
206
206
  if (onColumnResizeStart !== void 0) nextEvents.onColumnResizeStart = onColumnResizeStart;
207
207
  if (onColumnResizing !== void 0) nextEvents.onColumnResizing = onColumnResizing;
208
208
  if (onColumnResizeEnd !== void 0) nextEvents.onColumnResizeEnd = onColumnResizeEnd;
@@ -225,10 +225,14 @@ var McTableReact = React.forwardRef(
225
225
  React.useImperativeHandle(
226
226
  ref,
227
227
  () => ({
228
- table: tableRef.current,
229
- api: tableRef.current?.api ?? null
228
+ get table() {
229
+ return tableRef.current;
230
+ },
231
+ get api() {
232
+ return tableRef.current?.api ?? null;
233
+ }
230
234
  }),
231
- [readyTick]
235
+ []
232
236
  );
233
237
  useIsomorphicLayoutEffect(() => {
234
238
  if (typeof window === "undefined") return;
@@ -251,14 +255,12 @@ var McTableReact = React.forwardRef(
251
255
  license
252
256
  });
253
257
  tableRef.current = instance;
254
- setReadyTick((x) => x + 1);
255
258
  onReady?.(instance);
256
259
  return () => {
257
260
  const current = tableRef.current;
258
261
  const currentInstanceId = instanceIdRef.current;
259
262
  tableRef.current = null;
260
263
  instanceIdRef.current = null;
261
- setReadyTick((x) => x + 1);
262
264
  try {
263
265
  const anyTable = current;
264
266
  if (typeof anyTable?.destroy === "function") anyTable.destroy();
package/dist/index.js CHANGED
@@ -158,7 +158,6 @@ var McTableReact = React.forwardRef(
158
158
  records: records ?? [],
159
159
  columns: columns ?? []
160
160
  });
161
- const [readyTick, setReadyTick] = React.useState(0);
162
161
  const effectiveSettings = React.useMemo(() => {
163
162
  const hasAnyResizeCallback = onColumnResizeStart !== void 0 || onColumnResizing !== void 0 || onColumnResizeEnd !== void 0 || onRowResizeStart !== void 0 || onRowResizing !== void 0 || onRowResizeEnd !== void 0;
164
163
  if (!settings && !hasAnyResizeCallback) return void 0;
@@ -166,6 +165,7 @@ var McTableReact = React.forwardRef(
166
165
  const nextEvents = {
167
166
  ...settings?.events ?? {}
168
167
  };
168
+ const originalOnValidationUpdate = nextEvents.onValidationUpdate;
169
169
  if (onColumnResizeStart !== void 0) nextEvents.onColumnResizeStart = onColumnResizeStart;
170
170
  if (onColumnResizing !== void 0) nextEvents.onColumnResizing = onColumnResizing;
171
171
  if (onColumnResizeEnd !== void 0) nextEvents.onColumnResizeEnd = onColumnResizeEnd;
@@ -188,10 +188,14 @@ var McTableReact = React.forwardRef(
188
188
  React.useImperativeHandle(
189
189
  ref,
190
190
  () => ({
191
- table: tableRef.current,
192
- api: tableRef.current?.api ?? null
191
+ get table() {
192
+ return tableRef.current;
193
+ },
194
+ get api() {
195
+ return tableRef.current?.api ?? null;
196
+ }
193
197
  }),
194
- [readyTick]
198
+ []
195
199
  );
196
200
  useIsomorphicLayoutEffect(() => {
197
201
  if (typeof window === "undefined") return;
@@ -214,14 +218,12 @@ var McTableReact = React.forwardRef(
214
218
  license
215
219
  });
216
220
  tableRef.current = instance;
217
- setReadyTick((x) => x + 1);
218
221
  onReady?.(instance);
219
222
  return () => {
220
223
  const current = tableRef.current;
221
224
  const currentInstanceId = instanceIdRef.current;
222
225
  tableRef.current = null;
223
226
  instanceIdRef.current = null;
224
- setReadyTick((x) => x + 1);
225
227
  try {
226
228
  const anyTable = current;
227
229
  if (typeof anyTable?.destroy === "function") anyTable.destroy();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mctable-react",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -67,6 +67,6 @@
67
67
  "vite": "^5.4.12"
68
68
  },
69
69
  "dependencies": {
70
- "mctable": "^1.4.6"
70
+ "mctable": "^1.5.1"
71
71
  }
72
72
  }