@extable/react 0.1.0

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 ADDED
@@ -0,0 +1,27 @@
1
+ # @extable/react
2
+
3
+ React wrapper for Extable - an Excel-like HTML table component with a fixed column schema and built-in multi-user editing support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @extable/core @extable/react
9
+ ```
10
+
11
+ ## Documentation
12
+
13
+ For comprehensive guides and examples, visit the [Extable Documentation](https://shibukawa.github.io/extable/).
14
+
15
+ ### Key Topics
16
+
17
+ - [Integration Guide](https://shibukawa.github.io/extable/guides/integration) - React-specific setup
18
+ - [Core API Reference](https://shibukawa.github.io/extable/reference/core) - Complete API documentation
19
+ - [Demos](https://shibukawa.github.io/extable/demos/) - Interactive examples
20
+
21
+ ## Repository
22
+
23
+ GitHub: https://github.com/shibukawa/extable
24
+
25
+ ## License
26
+
27
+ Apache License 2.0 - See LICENSE for details.
@@ -0,0 +1,34 @@
1
+ import type { CSSProperties, HTMLAttributes } from "react";
2
+ import type { CoreOptions, EditMode, LockMode, NullableData, Schema, SelectionChangeReason, SelectionSnapshot, TableState, View } from "@extable/core";
3
+ import { ExtableCore } from "@extable/core";
4
+ type CoreApi<T extends object, R extends object = T> = Pick<ExtableCore<T, R>, "setData" | "setView" | "showSearchPanel" | "hideSearchPanel" | "toggleSearchPanel" | "openFindReplaceDialog" | "closeFindReplaceDialog" | "getData" | "getRawData" | "getSchema" | "getView" | "getCell" | "getDisplayValue" | "getCellPending" | "getRow" | "getTableData" | "getColumnData" | "getPending" | "getPendingRowIds" | "hasPendingChanges" | "getPendingCellCount" | "getRowIndex" | "getColumnIndex" | "getAllRows" | "listRows" | "setCellValue" | "setValueToSelection" | "insertRow" | "deleteRow" | "undo" | "redo" | "getUndoRedoHistory" | "commit" | "subscribeTableState" | "subscribeSelection" | "getSelectionSnapshot">;
5
+ export type ExtableHandle<T extends object = Record<string, unknown>, R extends object = T> = CoreApi<T, R> & {
6
+ destroy(): void;
7
+ };
8
+ export type ExtableProps<T extends Record<string, unknown> = Record<string, unknown>> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
9
+ schema: Schema<any>;
10
+ defaultData: NullableData<T>;
11
+ defaultView: View;
12
+ options?: CoreOptions;
13
+ onTableState?: (next: TableState, prev: TableState | null) => void;
14
+ onCellEvent?: (next: SelectionSnapshot, prev: SelectionSnapshot | null, reason: SelectionChangeReason) => void;
15
+ className?: string;
16
+ style?: CSSProperties;
17
+ };
18
+ /**
19
+ * Uncontrolled-only wrapper.
20
+ * - `schema/defaultData/defaultView/options` are initial values.
21
+ * - For updates after mount, use imperative methods via ref.
22
+ * - `defaultData` supports `null -> data` transition for loading flows.
23
+ */
24
+ export declare const Extable: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
25
+ schema: Schema<any>;
26
+ defaultData: NullableData<Record<string, unknown>>;
27
+ defaultView: View;
28
+ options?: CoreOptions;
29
+ onTableState?: (next: TableState, prev: TableState | null) => void;
30
+ onCellEvent?: (next: SelectionSnapshot, prev: SelectionSnapshot | null, reason: SelectionChangeReason) => void;
31
+ className?: string;
32
+ style?: CSSProperties;
33
+ } & import("react").RefAttributes<ExtableHandle<Record<string, unknown>, Record<string, unknown>>>>;
34
+ export type { CoreOptions, EditMode, LockMode, NullableData, Schema, SelectionChangeReason, SelectionSnapshot, TableState, View, };
package/dist/index.js ADDED
@@ -0,0 +1,352 @@
1
+ import re, { forwardRef as te, useRef as R, useEffect as D, useImperativeHandle as ne } from "react";
2
+ import { ExtableCore as ae } from "@extable/core";
3
+ var N = { exports: {} }, x = {};
4
+ var H;
5
+ function oe() {
6
+ if (H) return x;
7
+ H = 1;
8
+ var d = /* @__PURE__ */ Symbol.for("react.transitional.element"), v = /* @__PURE__ */ Symbol.for("react.fragment");
9
+ function g(m, u, c) {
10
+ var b = null;
11
+ if (c !== void 0 && (b = "" + c), u.key !== void 0 && (b = "" + u.key), "key" in u) {
12
+ c = {};
13
+ for (var f in u)
14
+ f !== "key" && (c[f] = u[f]);
15
+ } else c = u;
16
+ return u = c.ref, {
17
+ $$typeof: d,
18
+ type: m,
19
+ key: b,
20
+ ref: u !== void 0 ? u : null,
21
+ props: c
22
+ };
23
+ }
24
+ return x.Fragment = v, x.jsx = g, x.jsxs = g, x;
25
+ }
26
+ var k = {};
27
+ var X;
28
+ function le() {
29
+ return X || (X = 1, process.env.NODE_ENV !== "production" && (function() {
30
+ function d(e) {
31
+ if (e == null) return null;
32
+ if (typeof e == "function")
33
+ return e.$$typeof === Q ? null : e.displayName || e.name || null;
34
+ if (typeof e == "string") return e;
35
+ switch (e) {
36
+ case P:
37
+ return "Fragment";
38
+ case V:
39
+ return "Profiler";
40
+ case I:
41
+ return "StrictMode";
42
+ case s:
43
+ return "Suspense";
44
+ case E:
45
+ return "SuspenseList";
46
+ case Z:
47
+ return "Activity";
48
+ }
49
+ if (typeof e == "object")
50
+ switch (typeof e.tag == "number" && console.error(
51
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
+ ), e.$$typeof) {
53
+ case O:
54
+ return "Portal";
55
+ case i:
56
+ return e.displayName || "Context";
57
+ case Y:
58
+ return (e._context.displayName || "Context") + ".Consumer";
59
+ case t:
60
+ var n = e.render;
61
+ return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
+ case h:
63
+ return n = e.displayName || null, n !== null ? n : d(e.type) || "Memo";
64
+ case y:
65
+ n = e._payload, e = e._init;
66
+ try {
67
+ return d(e(n));
68
+ } catch {
69
+ }
70
+ }
71
+ return null;
72
+ }
73
+ function v(e) {
74
+ return "" + e;
75
+ }
76
+ function g(e) {
77
+ try {
78
+ v(e);
79
+ var n = !1;
80
+ } catch {
81
+ n = !0;
82
+ }
83
+ if (n) {
84
+ n = console;
85
+ var a = n.error, o = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
+ return a.call(
87
+ n,
88
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
+ o
90
+ ), v(e);
91
+ }
92
+ }
93
+ function m(e) {
94
+ if (e === P) return "<>";
95
+ if (typeof e == "object" && e !== null && e.$$typeof === y)
96
+ return "<...>";
97
+ try {
98
+ var n = d(e);
99
+ return n ? "<" + n + ">" : "<...>";
100
+ } catch {
101
+ return "<...>";
102
+ }
103
+ }
104
+ function u() {
105
+ var e = F.A;
106
+ return e === null ? null : e.getOwner();
107
+ }
108
+ function c() {
109
+ return Error("react-stack-top-frame");
110
+ }
111
+ function b(e) {
112
+ if (U.call(e, "key")) {
113
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
114
+ if (n && n.isReactWarning) return !1;
115
+ }
116
+ return e.key !== void 0;
117
+ }
118
+ function f(e, n) {
119
+ function a() {
120
+ W || (W = !0, console.error(
121
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
122
+ n
123
+ ));
124
+ }
125
+ a.isReactWarning = !0, Object.defineProperty(e, "key", {
126
+ get: a,
127
+ configurable: !0
128
+ });
129
+ }
130
+ function w() {
131
+ var e = d(this.type);
132
+ return q[e] || (q[e] = !0, console.error(
133
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
134
+ )), e = this.props.ref, e !== void 0 ? e : null;
135
+ }
136
+ function C(e, n, a, o, j, L) {
137
+ var l = a.ref;
138
+ return e = {
139
+ $$typeof: S,
140
+ type: e,
141
+ key: n,
142
+ props: a,
143
+ _owner: o
144
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
145
+ enumerable: !1,
146
+ get: w
147
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
148
+ configurable: !1,
149
+ enumerable: !1,
150
+ writable: !0,
151
+ value: 0
152
+ }), Object.defineProperty(e, "_debugInfo", {
153
+ configurable: !1,
154
+ enumerable: !1,
155
+ writable: !0,
156
+ value: null
157
+ }), Object.defineProperty(e, "_debugStack", {
158
+ configurable: !1,
159
+ enumerable: !1,
160
+ writable: !0,
161
+ value: j
162
+ }), Object.defineProperty(e, "_debugTask", {
163
+ configurable: !1,
164
+ enumerable: !1,
165
+ writable: !0,
166
+ value: L
167
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
168
+ }
169
+ function _(e, n, a, o, j, L) {
170
+ var l = n.children;
171
+ if (l !== void 0)
172
+ if (o)
173
+ if (K(l)) {
174
+ for (o = 0; o < l.length; o++)
175
+ r(l[o]);
176
+ Object.freeze && Object.freeze(l);
177
+ } else
178
+ console.error(
179
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
+ );
181
+ else r(l);
182
+ if (U.call(n, "key")) {
183
+ l = d(e);
184
+ var T = Object.keys(n).filter(function(ee) {
185
+ return ee !== "key";
186
+ });
187
+ o = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", G[l + o] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ `A props object containing a "key" prop is being spread into JSX:
189
+ let props = %s;
190
+ <%s {...props} />
191
+ React keys must be passed directly to JSX without using spread:
192
+ let props = %s;
193
+ <%s key={someKey} {...props} />`,
194
+ o,
195
+ l,
196
+ T,
197
+ l
198
+ ), G[l + o] = !0);
199
+ }
200
+ if (l = null, a !== void 0 && (g(a), l = "" + a), b(n) && (g(n.key), l = "" + n.key), "key" in n) {
201
+ a = {};
202
+ for (var M in n)
203
+ M !== "key" && (a[M] = n[M]);
204
+ } else a = n;
205
+ return l && f(
206
+ a,
207
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
208
+ ), C(
209
+ e,
210
+ l,
211
+ a,
212
+ u(),
213
+ j,
214
+ L
215
+ );
216
+ }
217
+ function r(e) {
218
+ A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === y && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
219
+ }
220
+ function A(e) {
221
+ return typeof e == "object" && e !== null && e.$$typeof === S;
222
+ }
223
+ var p = re, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), O = /* @__PURE__ */ Symbol.for("react.portal"), P = /* @__PURE__ */ Symbol.for("react.fragment"), I = /* @__PURE__ */ Symbol.for("react.strict_mode"), V = /* @__PURE__ */ Symbol.for("react.profiler"), Y = /* @__PURE__ */ Symbol.for("react.consumer"), i = /* @__PURE__ */ Symbol.for("react.context"), t = /* @__PURE__ */ Symbol.for("react.forward_ref"), s = /* @__PURE__ */ Symbol.for("react.suspense"), E = /* @__PURE__ */ Symbol.for("react.suspense_list"), h = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), F = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, K = Array.isArray, $ = console.createTask ? console.createTask : function() {
224
+ return null;
225
+ };
226
+ p = {
227
+ react_stack_bottom_frame: function(e) {
228
+ return e();
229
+ }
230
+ };
231
+ var W, q = {}, J = p.react_stack_bottom_frame.bind(
232
+ p,
233
+ c
234
+ )(), z = $(m(c)), G = {};
235
+ k.Fragment = P, k.jsx = function(e, n, a) {
236
+ var o = 1e4 > F.recentlyCreatedOwnerStacks++;
237
+ return _(
238
+ e,
239
+ n,
240
+ a,
241
+ !1,
242
+ o ? Error("react-stack-top-frame") : J,
243
+ o ? $(m(e)) : z
244
+ );
245
+ }, k.jsxs = function(e, n, a) {
246
+ var o = 1e4 > F.recentlyCreatedOwnerStacks++;
247
+ return _(
248
+ e,
249
+ n,
250
+ a,
251
+ !0,
252
+ o ? Error("react-stack-top-frame") : J,
253
+ o ? $(m(e)) : z
254
+ );
255
+ };
256
+ })()), k;
257
+ }
258
+ var B;
259
+ function ue() {
260
+ return B || (B = 1, process.env.NODE_ENV === "production" ? N.exports = oe() : N.exports = le()), N.exports;
261
+ }
262
+ var ce = ue();
263
+ const fe = te(function(v, g) {
264
+ const { schema: m, defaultData: u, defaultView: c, options: b, onTableState: f, onCellEvent: w, ...C } = v, _ = R(null), r = R(null), A = R(u === null), p = R(!1), S = R(f), O = R(w), P = R(m), I = R(c), V = {
265
+ ranges: [],
266
+ activeRowIndex: null,
267
+ activeRowKey: null,
268
+ activeColumnIndex: null,
269
+ activeColumnKey: null,
270
+ activeValueRaw: void 0,
271
+ activeValueDisplay: "",
272
+ activeValueType: null,
273
+ diagnostic: null,
274
+ styles: { columnStyle: {}, cellStyle: {}, resolved: {} }
275
+ };
276
+ D(() => {
277
+ S.current = f;
278
+ }, [f]), D(() => {
279
+ O.current = w;
280
+ }, [w]), D(() => {
281
+ if (!_.current) return;
282
+ const i = new ae({
283
+ root: _.current,
284
+ schema: m,
285
+ defaultData: u,
286
+ defaultView: c,
287
+ options: b
288
+ });
289
+ r.current = i;
290
+ const t = i.subscribeTableState(
291
+ (E, h) => S.current?.(E, h)
292
+ ), s = i.subscribeSelection(
293
+ (E, h, y) => O.current?.(E, h, y)
294
+ );
295
+ return () => {
296
+ s(), t(), i.destroy(), r.current = null;
297
+ };
298
+ }, []), D(() => {
299
+ const i = r.current;
300
+ i && A.current && (p.current || u !== null && (i.setData(u), p.current = !0));
301
+ }, [u]), ne(
302
+ g,
303
+ () => ({
304
+ destroy: () => {
305
+ r.current?.destroy(), r.current = null;
306
+ },
307
+ setData: (t) => r.current?.setData(t),
308
+ setView: (t) => r.current?.setView(t),
309
+ showSearchPanel: (t) => r.current?.showSearchPanel(t),
310
+ hideSearchPanel: () => r.current?.hideSearchPanel(),
311
+ toggleSearchPanel: (t) => r.current?.toggleSearchPanel(t),
312
+ openFindReplaceDialog: (t) => r.current?.openFindReplaceDialog(t),
313
+ closeFindReplaceDialog: () => r.current?.closeFindReplaceDialog(),
314
+ getData: () => r.current?.getData() ?? [],
315
+ getRawData: () => r.current?.getRawData() ?? [],
316
+ getSchema: () => r.current?.getSchema() ?? P.current,
317
+ getView: () => r.current?.getView() ?? I.current,
318
+ getCell: (t, s) => r.current?.getCell(t, s),
319
+ getDisplayValue: (t, s) => r.current?.getDisplayValue(t, s) ?? "",
320
+ getCellPending: (t, s) => r.current?.getCellPending(t, s) ?? !1,
321
+ getRow: (t) => r.current?.getRow(t) ?? null,
322
+ getTableData: () => r.current?.getTableData() ?? [],
323
+ getColumnData: (t) => r.current?.getColumnData(t) ?? [],
324
+ getPending: () => r.current?.getPending() ?? /* @__PURE__ */ new Map(),
325
+ getPendingRowIds: () => r.current?.getPendingRowIds() ?? [],
326
+ hasPendingChanges: () => r.current?.hasPendingChanges() ?? !1,
327
+ getPendingCellCount: () => r.current?.getPendingCellCount() ?? 0,
328
+ getRowIndex: (t) => r.current?.getRowIndex(t) ?? -1,
329
+ getColumnIndex: (t) => r.current?.getColumnIndex(t) ?? -1,
330
+ getAllRows: () => r.current?.getAllRows() ?? [],
331
+ listRows: () => r.current?.listRows() ?? [],
332
+ setCellValue: (t, s, E) => r.current?.setCellValue(t, s, E),
333
+ setValueToSelection: (t) => r.current?.setValueToSelection(t),
334
+ insertRow: (t, s) => r.current?.insertRow(t, s) ?? null,
335
+ deleteRow: (t) => r.current?.deleteRow(t) ?? !1,
336
+ undo: () => r.current?.undo(),
337
+ redo: () => r.current?.redo(),
338
+ getUndoRedoHistory: () => r.current?.getUndoRedoHistory() ?? { undo: [], redo: [] },
339
+ commit: () => r.current?.commit() ?? Promise.resolve([]),
340
+ subscribeTableState: (t) => r.current?.subscribeTableState(t) ?? (() => !1),
341
+ subscribeSelection: (t) => r.current?.subscribeSelection(t) ?? (() => !1),
342
+ getSelectionSnapshot: () => r.current?.getSelectionSnapshot() ?? V
343
+ }),
344
+ []
345
+ );
346
+ const Y = ["extable-root", C.className].filter(Boolean).join(" ");
347
+ return /* @__PURE__ */ ce.jsx("div", { "data-extable-wrapper": !0, ref: _, ...C, className: Y });
348
+ });
349
+ export {
350
+ fe as Extable
351
+ };
352
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef, type ForwardedRef } from \"react\";\nimport type {\n CoreOptions,\n EditMode,\n LockMode,\n NullableData,\n Schema,\n SelectionChangeReason,\n SelectionSnapshot,\n TableState,\n View,\n FindReplaceMode,\n} from \"@extable/core\";\nimport { ExtableCore } from \"@extable/core\";\n\ntype CoreApi<T extends object, R extends object = T> = Pick<\n ExtableCore<T, R>,\n | \"setData\"\n | \"setView\"\n | \"showSearchPanel\"\n | \"hideSearchPanel\"\n | \"toggleSearchPanel\"\n | \"openFindReplaceDialog\"\n | \"closeFindReplaceDialog\"\n | \"getData\"\n | \"getRawData\"\n | \"getSchema\"\n | \"getView\"\n | \"getCell\"\n | \"getDisplayValue\"\n | \"getCellPending\"\n | \"getRow\"\n | \"getTableData\"\n | \"getColumnData\"\n | \"getPending\"\n | \"getPendingRowIds\"\n | \"hasPendingChanges\"\n | \"getPendingCellCount\"\n | \"getRowIndex\"\n | \"getColumnIndex\"\n | \"getAllRows\"\n | \"listRows\"\n | \"setCellValue\"\n | \"setValueToSelection\"\n | \"insertRow\"\n | \"deleteRow\"\n | \"undo\"\n | \"redo\"\n | \"getUndoRedoHistory\"\n | \"commit\"\n | \"subscribeTableState\"\n | \"subscribeSelection\"\n | \"getSelectionSnapshot\"\n>;\n\nexport type ExtableHandle<T extends object = Record<string, unknown>, R extends object = T> =\n CoreApi<T, R> & {\n destroy(): void;\n };\n\nexport type ExtableProps<T extends Record<string, unknown> = Record<string, unknown>> = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\"\n> & {\n schema: Schema<any>;\n defaultData: NullableData<T>;\n defaultView: View;\n options?: CoreOptions;\n\n onTableState?: (next: TableState, prev: TableState | null) => void;\n onCellEvent?: (\n next: SelectionSnapshot,\n prev: SelectionSnapshot | null,\n reason: SelectionChangeReason,\n ) => void;\n\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * Uncontrolled-only wrapper.\n * - `schema/defaultData/defaultView/options` are initial values.\n * - For updates after mount, use imperative methods via ref.\n * - `defaultData` supports `null -> data` transition for loading flows.\n */\nexport const Extable = forwardRef(function ExtableInner<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(props: ExtableProps<T>, ref: ForwardedRef<ExtableHandle<T>>) {\n const { schema, defaultData, defaultView, options, onTableState, onCellEvent, ...divProps } =\n props;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const coreRef = useRef<ExtableCore<T> | null>(null);\n const initialDefaultDataWasNullRef = useRef(defaultData === null);\n const consumedDefaultDataLoadRef = useRef(false);\n const onTableStateRef = useRef<typeof onTableState>(onTableState);\n const onCellEventRef = useRef<typeof onCellEvent>(onCellEvent);\n const initialSchemaRef = useRef(schema);\n const initialViewRef = useRef(defaultView);\n\n const emptySelectionSnapshot: SelectionSnapshot = {\n ranges: [],\n activeRowIndex: null,\n activeRowKey: null,\n activeColumnIndex: null,\n activeColumnKey: null,\n activeValueRaw: undefined,\n activeValueDisplay: \"\",\n activeValueType: null,\n diagnostic: null,\n styles: { columnStyle: {}, cellStyle: {}, resolved: {} },\n };\n\n useEffect(() => {\n onTableStateRef.current = onTableState;\n }, [onTableState]);\n useEffect(() => {\n onCellEventRef.current = onCellEvent;\n }, [onCellEvent]);\n\n useEffect(() => {\n if (!containerRef.current) return;\n const core = new ExtableCore<T>({\n root: containerRef.current,\n schema,\n defaultData,\n defaultView,\n options,\n });\n coreRef.current = core;\n const unsubTable = core.subscribeTableState((next, prev) =>\n onTableStateRef.current?.(next, prev),\n );\n const unsubSel = core.subscribeSelection((next, prev, reason) =>\n onCellEventRef.current?.(next, prev, reason),\n );\n return () => {\n unsubSel();\n unsubTable();\n core.destroy();\n coreRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const core = coreRef.current;\n if (!core) return;\n if (!initialDefaultDataWasNullRef.current) return;\n if (consumedDefaultDataLoadRef.current) return;\n if (defaultData !== null) {\n core.setData(defaultData);\n consumedDefaultDataLoadRef.current = true;\n }\n }, [defaultData]);\n\n useImperativeHandle(\n ref,\n () => {\n const proxy: ExtableHandle<T> = {\n destroy: () => {\n coreRef.current?.destroy();\n coreRef.current = null;\n },\n setData: (data) => coreRef.current?.setData(data),\n setView: (view) => coreRef.current?.setView(view),\n showSearchPanel: (mode?: FindReplaceMode) => coreRef.current?.showSearchPanel(mode),\n hideSearchPanel: () => coreRef.current?.hideSearchPanel(),\n toggleSearchPanel: (mode?: FindReplaceMode) => coreRef.current?.toggleSearchPanel(mode),\n openFindReplaceDialog: (mode?: FindReplaceMode) =>\n coreRef.current?.openFindReplaceDialog(mode),\n closeFindReplaceDialog: () => coreRef.current?.closeFindReplaceDialog(),\n getData: () => coreRef.current?.getData() ?? [],\n getRawData: () => coreRef.current?.getRawData() ?? [],\n getSchema: () => coreRef.current?.getSchema() ?? initialSchemaRef.current,\n getView: () => coreRef.current?.getView() ?? initialViewRef.current,\n getCell: (rowId: string, colKey: any) => coreRef.current?.getCell(rowId, colKey),\n getDisplayValue: (row: any, colKey: any) =>\n coreRef.current?.getDisplayValue(row, colKey) ?? \"\",\n getCellPending: (row: any, colKey: any) => coreRef.current?.getCellPending(row, colKey) ?? false,\n getRow: (row: any) => coreRef.current?.getRow(row) ?? null,\n getTableData: () => coreRef.current?.getTableData() ?? [],\n getColumnData: (colKey: any) => coreRef.current?.getColumnData(colKey) ?? [],\n getPending: () => coreRef.current?.getPending() ?? new Map(),\n getPendingRowIds: () => coreRef.current?.getPendingRowIds() ?? [],\n hasPendingChanges: () => coreRef.current?.hasPendingChanges() ?? false,\n getPendingCellCount: () => coreRef.current?.getPendingCellCount() ?? 0,\n getRowIndex: (rowId: string) => coreRef.current?.getRowIndex(rowId) ?? -1,\n getColumnIndex: (colKey: string) => coreRef.current?.getColumnIndex(colKey) ?? -1,\n getAllRows: () => coreRef.current?.getAllRows() ?? [],\n listRows: () => coreRef.current?.listRows() ?? [],\n setCellValue: (row: any, colKey: any, next: any) =>\n coreRef.current?.setCellValue(row as never, colKey as never, next as never),\n setValueToSelection: (next: any) => coreRef.current?.setValueToSelection(next),\n insertRow: (rowData: any, pos?: any) => coreRef.current?.insertRow(rowData, pos) ?? null,\n deleteRow: (row: any) => coreRef.current?.deleteRow(row) ?? false,\n undo: () => coreRef.current?.undo(),\n redo: () => coreRef.current?.redo(),\n getUndoRedoHistory: () => coreRef.current?.getUndoRedoHistory() ?? { undo: [], redo: [] },\n commit: () => coreRef.current?.commit() ?? Promise.resolve([]),\n subscribeTableState: (listener: any) =>\n coreRef.current?.subscribeTableState(listener) ?? (() => false),\n subscribeSelection: (listener: any) =>\n coreRef.current?.subscribeSelection(listener) ?? (() => false),\n getSelectionSnapshot: () => coreRef.current?.getSelectionSnapshot() ?? emptySelectionSnapshot,\n };\n return proxy;\n },\n [],\n );\n\n const className = [\"extable-root\", divProps.className].filter(Boolean).join(\" \");\n return <div data-extable-wrapper ref={containerRef} {...divProps} className={className} />;\n});\n\nexport type {\n CoreOptions,\n EditMode,\n LockMode,\n NullableData,\n Schema,\n SelectionChangeReason,\n SelectionSnapshot,\n TableState,\n View,\n};\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","Extable","forwardRef","ref","schema","defaultData","defaultView","options","onTableState","onCellEvent","divProps","containerRef","useRef","coreRef","initialDefaultDataWasNullRef","consumedDefaultDataLoadRef","onTableStateRef","onCellEventRef","initialSchemaRef","initialViewRef","emptySelectionSnapshot","useEffect","core","ExtableCore","unsubTable","next","prev","unsubSel","reason","useImperativeHandle","data","view","mode","rowId","colKey","row","rowData","pos","listener","className","jsx"],"mappings":";;;;;;;AAWA,MAAIA,IAAqB,uBAAO,IAAI,4BAA4B,GAC9DC,IAAsB,uBAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgBF,MAAX,SAAoBA,IAAS;AAAA,MAClC,OAAOC;AAAA;EAEX;AACA,SAAAG,EAAA,WAAmBP,GACnBO,EAAA,MAAcN,GACdM,EAAA,OAAeN;;;;;sBCtBE,QAAQ,IAAI,aAA7B,iBACG,WAAY;AACX,aAASO,EAAyBN,GAAM;AACtC,UAAYA,KAAR,KAAc,QAAO;AACzB,UAAmB,OAAOA,KAAtB;AACF,eAAOA,EAAK,aAAaO,IACrB,OACAP,EAAK,eAAeA,EAAK,QAAQ;AACvC,UAAiB,OAAOA,KAApB,SAA0B,QAAOA;AACrC,cAAQA,GAAI;AAAA,QACV,KAAKF;AACH,iBAAO;AAAA,QACT,KAAKU;AACH,iBAAO;AAAA,QACT,KAAKC;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GAAe,GAAGD,GAAU,WAAA6B,GAAsB;AAC1F,CAAC;","x_google_ignoreList":[0,1,2]}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@extable/react",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -p tsconfig.build.json --emitDeclarationOnly && vite build",
23
+ "test": "vitest run",
24
+ "lint": "biome lint .",
25
+ "format": "biome format --write .",
26
+ "dev": "vite dev"
27
+ },
28
+ "dependencies": {
29
+ "@extable/core": "0.1.0",
30
+ "react": "^19.2.3",
31
+ "react-dom": "^19.2.3"
32
+ },
33
+ "peerDependencies": {
34
+ "react": ">=18",
35
+ "react-dom": ">=18"
36
+ },
37
+ "devDependencies": {
38
+ "@testing-library/react": "^16.3.1",
39
+ "@types/react": "^19.2.7",
40
+ "@types/react-dom": "^19.2.3",
41
+ "@vitejs/plugin-react": "^5.1.2",
42
+ "typescript": "^5.6.3"
43
+ },
44
+ "engines": {
45
+ "node": ">=22"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/shibukawa/extable.git"
50
+ },
51
+ "author": "Yoshiki Shibukawa",
52
+ "license": "Apache-2.0"
53
+ }