@everygrid/grid 0.4.7
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.
Potentially problematic release.
This version of @everygrid/grid might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +680 -0
- package/dist/Everygrid.css +3 -0
- package/dist/everygrid-config.json +7 -0
- package/dist/everygrid.standalone.js +401 -0
- package/dist/i18n/en.json.d.ts +86 -0
- package/dist/i18n/ko.json.d.ts +86 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +24227 -0
- package/dist/src/components/ColumnSelectorComponent.d.ts +8 -0
- package/dist/src/components/DiffPopupComponent.d.ts +14 -0
- package/dist/src/components/EmptyGridPlaceholderComponent.d.ts +15 -0
- package/dist/src/components/EverygridComponent.d.ts +5 -0
- package/dist/src/components/ExcelViewComponent.d.ts +20 -0
- package/dist/src/components/GridTableComponent.d.ts +28 -0
- package/dist/src/components/GridToolbarComponent.d.ts +49 -0
- package/dist/src/components/HiddenColumnSelectorComponent.d.ts +7 -0
- package/dist/src/components/InsertedRowsComponent.d.ts +21 -0
- package/dist/src/components/MobileColumnSelectorComponent.d.ts +8 -0
- package/dist/src/components/NestedTableComponent.d.ts +10 -0
- package/dist/src/components/PaginationComponent.d.ts +21 -0
- package/dist/src/components/PinnedTableComponent.d.ts +26 -0
- package/dist/src/components/PopupComponent.d.ts +29 -0
- package/dist/src/components/RowCountComponent.d.ts +18 -0
- package/dist/src/components/RowDetailComponent.d.ts +8 -0
- package/dist/src/components/TableCellComponent.d.ts +18 -0
- package/dist/src/components/TextEditorPopupComponent.d.ts +6 -0
- package/dist/src/core/Everygrid.d.ts +568 -0
- package/dist/src/core/ExcelView.d.ts +28 -0
- package/dist/src/core/GridHandle.d.ts +214 -0
- package/dist/src/core/GridHandle.test.d.ts +1 -0
- package/dist/src/core/ResizeUtils.d.ts +3 -0
- package/dist/src/core/highlightUtils.d.ts +4 -0
- package/dist/src/core/normalizeOptions.d.ts +13 -0
- package/dist/src/core/normalizeOptions.test.d.ts +1 -0
- package/dist/src/core/types.d.ts +361 -0
- package/dist/src/core/useVirtualWindow.d.ts +89 -0
- package/dist/src/core/useVirtualWindow.test.d.ts +1 -0
- package/dist/src/core/utils.d.ts +19 -0
- package/dist/src/i18n/I18n.d.ts +16 -0
- package/dist/src/icons/ChevronDownIcon.d.ts +2 -0
- package/dist/src/icons/ColumnWidthIcon.d.ts +3 -0
- package/dist/src/icons/ColumnsIcon.d.ts +3 -0
- package/dist/src/icons/CommaIcon.d.ts +1 -0
- package/dist/src/icons/ConfigIcon.d.ts +4 -0
- package/dist/src/icons/DiffIcon.d.ts +4 -0
- package/dist/src/icons/DownloadIcon.d.ts +3 -0
- package/dist/src/icons/EditIcon.d.ts +1 -0
- package/dist/src/icons/ExcelIcon.d.ts +3 -0
- package/dist/src/icons/GlobeIcon.d.ts +2 -0
- package/dist/src/icons/HideIcon.d.ts +1 -0
- package/dist/src/icons/InfoIcon.d.ts +2 -0
- package/dist/src/icons/InsertRowIcon.d.ts +4 -0
- package/dist/src/icons/MobileColumnsIcon.d.ts +3 -0
- package/dist/src/icons/PinEmptyIcon.d.ts +1 -0
- package/dist/src/icons/PinFilledIcon.d.ts +1 -0
- package/dist/src/icons/ReloadIcon.d.ts +3 -0
- package/dist/src/icons/RowDetailIcon.d.ts +3 -0
- package/dist/src/icons/SearchIcon.d.ts +3 -0
- package/dist/src/icons/SortDownIcon.d.ts +1 -0
- package/dist/src/icons/SortResetIcon.d.ts +3 -0
- package/dist/src/icons/SortUpIcon.d.ts +1 -0
- package/dist/src/icons/TrashIcon.d.ts +3 -0
- package/dist/src/icons/UndoIcon.d.ts +3 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/react/index.d.ts +20 -0
- package/dist/src/standalone-entry.d.ts +2 -0
- package/dist/src/wasm/ExcelExportClient.d.ts +14 -0
- package/dist/src/wasm/ExportWorker.d.ts +1 -0
- package/dist/src/wasm/GridEngineWasm.d.ts +70 -0
- package/dist/src/wasm/GridEngineWorker.d.ts +102 -0
- package/dist/wasm/everygrid_wasm.js +422 -0
- package/dist/wasm/everygrid_wasm_bg.wasm +0 -0
- package/package.json +61 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/* @ts-self-types="./everygrid_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class GridEngine {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
GridEngineFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_gridengine_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
clear() {
|
|
15
|
+
wasm.gridengine_clear(this.__wbg_ptr);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @param {Uint8Array} bytes
|
|
19
|
+
*/
|
|
20
|
+
feed_chunk_bytes(bytes) {
|
|
21
|
+
const ret = wasm.gridengine_feed_chunk_bytes(this.__wbg_ptr, bytes);
|
|
22
|
+
if (ret[1]) {
|
|
23
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} text
|
|
28
|
+
* @param {string} col
|
|
29
|
+
* @param {boolean} asc
|
|
30
|
+
* @param {number} page
|
|
31
|
+
* @param {number} page_size
|
|
32
|
+
* @returns {any}
|
|
33
|
+
*/
|
|
34
|
+
filter_sort_and_get_page(text, col, asc, page, page_size) {
|
|
35
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
36
|
+
const len0 = WASM_VECTOR_LEN;
|
|
37
|
+
const ptr1 = passStringToWasm0(col, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
38
|
+
const len1 = WASM_VECTOR_LEN;
|
|
39
|
+
const ret = wasm.gridengine_filter_sort_and_get_page(this.__wbg_ptr, ptr0, len0, ptr1, len1, asc, page, page_size);
|
|
40
|
+
if (ret[2]) {
|
|
41
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
42
|
+
}
|
|
43
|
+
return takeFromExternrefTable0(ret[0]);
|
|
44
|
+
}
|
|
45
|
+
finalize() {
|
|
46
|
+
wasm.gridengine_finalize(this.__wbg_ptr);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @param {number} page
|
|
50
|
+
* @param {number} page_size
|
|
51
|
+
* @returns {any}
|
|
52
|
+
*/
|
|
53
|
+
get_page(page, page_size) {
|
|
54
|
+
const ret = wasm.gridengine_get_page(this.__wbg_ptr, page, page_size);
|
|
55
|
+
if (ret[2]) {
|
|
56
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
57
|
+
}
|
|
58
|
+
return takeFromExternrefTable0(ret[0]);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @returns {number}
|
|
62
|
+
*/
|
|
63
|
+
get_raw_count() {
|
|
64
|
+
const ret = wasm.gridengine_get_raw_count(this.__wbg_ptr);
|
|
65
|
+
return ret >>> 0;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A page of the raw (unfiltered, unsorted) dataset, ignoring any active filter/sort.
|
|
69
|
+
* Used by "export all" so a filtered view can still download the complete data.
|
|
70
|
+
* Serialized as a JSON array string, same shape as get_page.
|
|
71
|
+
* @param {number} page
|
|
72
|
+
* @param {number} page_size
|
|
73
|
+
* @returns {any}
|
|
74
|
+
*/
|
|
75
|
+
get_raw_page(page, page_size) {
|
|
76
|
+
const ret = wasm.gridengine_get_raw_page(this.__wbg_ptr, page, page_size);
|
|
77
|
+
if (ret[2]) {
|
|
78
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
79
|
+
}
|
|
80
|
+
return takeFromExternrefTable0(ret[0]);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @returns {number}
|
|
84
|
+
*/
|
|
85
|
+
get_total_count() {
|
|
86
|
+
const ret = wasm.gridengine_get_total_count(this.__wbg_ptr);
|
|
87
|
+
return ret >>> 0;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Replaces rows in place. `indices` are raw (unfiltered, unsorted) row positions —
|
|
91
|
+
* the order `get_raw_page` returns, which is the order JS holds its data in — and
|
|
92
|
+
* `rows_json` is a JSON array of replacement objects, positionally matched to them.
|
|
93
|
+
*
|
|
94
|
+
* This exists so a cell edit does not have to go through `set_data`, which re-uploads
|
|
95
|
+
* and re-parses the whole dataset (and drives the indexing progress UI) to change one
|
|
96
|
+
* value. Out-of-range indices are skipped rather than failing the batch, so a stale
|
|
97
|
+
* index from a concurrent reload cannot break an otherwise valid edit.
|
|
98
|
+
* Inserts rows at `index` (clamped to the end), in the order given — the row-add path.
|
|
99
|
+
* @param {number} index
|
|
100
|
+
* @param {string} rows_json
|
|
101
|
+
*/
|
|
102
|
+
insert_rows(index, rows_json) {
|
|
103
|
+
const ptr0 = passStringToWasm0(rows_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
104
|
+
const len0 = WASM_VECTOR_LEN;
|
|
105
|
+
const ret = wasm.gridengine_insert_rows(this.__wbg_ptr, index, ptr0, len0);
|
|
106
|
+
if (ret[1]) {
|
|
107
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
constructor() {
|
|
111
|
+
const ret = wasm.gridengine_new();
|
|
112
|
+
this.__wbg_ptr = ret;
|
|
113
|
+
GridEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Removes the rows at `indices` (raw positions; duplicates and out-of-range are ignored).
|
|
118
|
+
* @param {Uint32Array} indices
|
|
119
|
+
*/
|
|
120
|
+
remove_rows(indices) {
|
|
121
|
+
const ptr0 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
123
|
+
wasm.gridengine_remove_rows(this.__wbg_ptr, ptr0, len0);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @param {Uint32Array} indices
|
|
127
|
+
* @param {string} rows_json
|
|
128
|
+
*/
|
|
129
|
+
update_rows(indices, rows_json) {
|
|
130
|
+
const ptr0 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
131
|
+
const len0 = WASM_VECTOR_LEN;
|
|
132
|
+
const ptr1 = passStringToWasm0(rows_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
133
|
+
const len1 = WASM_VECTOR_LEN;
|
|
134
|
+
const ret = wasm.gridengine_update_rows(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
135
|
+
if (ret[1]) {
|
|
136
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (Symbol.dispose) GridEngine.prototype[Symbol.dispose] = GridEngine.prototype.free;
|
|
141
|
+
function __wbg_get_imports() {
|
|
142
|
+
const import0 = {
|
|
143
|
+
__proto__: null,
|
|
144
|
+
__wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
|
|
145
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
146
|
+
return ret;
|
|
147
|
+
},
|
|
148
|
+
__wbg___wbindgen_string_get_71bb4348194e31f0: function(arg0, arg1) {
|
|
149
|
+
const obj = arg1;
|
|
150
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
151
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
152
|
+
var len1 = WASM_VECTOR_LEN;
|
|
153
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
154
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
155
|
+
},
|
|
156
|
+
__wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
|
|
157
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
158
|
+
},
|
|
159
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
160
|
+
let deferred0_0;
|
|
161
|
+
let deferred0_1;
|
|
162
|
+
try {
|
|
163
|
+
deferred0_0 = arg0;
|
|
164
|
+
deferred0_1 = arg1;
|
|
165
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
166
|
+
} finally {
|
|
167
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
__wbg_length_589238bdcf171f0e: function(arg0) {
|
|
171
|
+
const ret = arg0.length;
|
|
172
|
+
return ret;
|
|
173
|
+
},
|
|
174
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
175
|
+
const ret = new Error();
|
|
176
|
+
return ret;
|
|
177
|
+
},
|
|
178
|
+
__wbg_prototypesetcall_d721637c7ca66eb8: function(arg0, arg1, arg2) {
|
|
179
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
180
|
+
},
|
|
181
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
182
|
+
const ret = arg1.stack;
|
|
183
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
184
|
+
const len1 = WASM_VECTOR_LEN;
|
|
185
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
186
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
187
|
+
},
|
|
188
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
189
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
190
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
191
|
+
return ret;
|
|
192
|
+
},
|
|
193
|
+
__wbindgen_init_externref_table: function() {
|
|
194
|
+
const table = wasm.__wbindgen_externrefs;
|
|
195
|
+
const offset = table.grow(4);
|
|
196
|
+
table.set(0, undefined);
|
|
197
|
+
table.set(offset + 0, undefined);
|
|
198
|
+
table.set(offset + 1, null);
|
|
199
|
+
table.set(offset + 2, true);
|
|
200
|
+
table.set(offset + 3, false);
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
return {
|
|
204
|
+
__proto__: null,
|
|
205
|
+
"./everygrid_wasm_bg.js": import0,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const GridEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
210
|
+
? { register: () => {}, unregister: () => {} }
|
|
211
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gridengine_free(ptr, 1));
|
|
212
|
+
|
|
213
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
214
|
+
ptr = ptr >>> 0;
|
|
215
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
let cachedDataViewMemory0 = null;
|
|
219
|
+
function getDataViewMemory0() {
|
|
220
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
221
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
222
|
+
}
|
|
223
|
+
return cachedDataViewMemory0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function getStringFromWasm0(ptr, len) {
|
|
227
|
+
return decodeText(ptr >>> 0, len);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
let cachedUint32ArrayMemory0 = null;
|
|
231
|
+
function getUint32ArrayMemory0() {
|
|
232
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
233
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
234
|
+
}
|
|
235
|
+
return cachedUint32ArrayMemory0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
let cachedUint8ArrayMemory0 = null;
|
|
239
|
+
function getUint8ArrayMemory0() {
|
|
240
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
241
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
242
|
+
}
|
|
243
|
+
return cachedUint8ArrayMemory0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function isLikeNone(x) {
|
|
247
|
+
return x === undefined || x === null;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
251
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
252
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
253
|
+
WASM_VECTOR_LEN = arg.length;
|
|
254
|
+
return ptr;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
258
|
+
if (realloc === undefined) {
|
|
259
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
260
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
261
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
262
|
+
WASM_VECTOR_LEN = buf.length;
|
|
263
|
+
return ptr;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
let len = arg.length;
|
|
267
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
268
|
+
|
|
269
|
+
const mem = getUint8ArrayMemory0();
|
|
270
|
+
|
|
271
|
+
let offset = 0;
|
|
272
|
+
|
|
273
|
+
for (; offset < len; offset++) {
|
|
274
|
+
const code = arg.charCodeAt(offset);
|
|
275
|
+
if (code > 0x7F) break;
|
|
276
|
+
mem[ptr + offset] = code;
|
|
277
|
+
}
|
|
278
|
+
if (offset !== len) {
|
|
279
|
+
if (offset !== 0) {
|
|
280
|
+
arg = arg.slice(offset);
|
|
281
|
+
}
|
|
282
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
283
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
284
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
285
|
+
|
|
286
|
+
offset += ret.written;
|
|
287
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
WASM_VECTOR_LEN = offset;
|
|
291
|
+
return ptr;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function takeFromExternrefTable0(idx) {
|
|
295
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
296
|
+
wasm.__externref_table_dealloc(idx);
|
|
297
|
+
return value;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
301
|
+
cachedTextDecoder.decode();
|
|
302
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
303
|
+
let numBytesDecoded = 0;
|
|
304
|
+
function decodeText(ptr, len) {
|
|
305
|
+
numBytesDecoded += len;
|
|
306
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
307
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
308
|
+
cachedTextDecoder.decode();
|
|
309
|
+
numBytesDecoded = len;
|
|
310
|
+
}
|
|
311
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const cachedTextEncoder = new TextEncoder();
|
|
315
|
+
|
|
316
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
317
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
318
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
319
|
+
view.set(buf);
|
|
320
|
+
return {
|
|
321
|
+
read: arg.length,
|
|
322
|
+
written: buf.length
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
let WASM_VECTOR_LEN = 0;
|
|
328
|
+
|
|
329
|
+
let wasmModule, wasmInstance, wasm;
|
|
330
|
+
function __wbg_finalize_init(instance, module) {
|
|
331
|
+
wasmInstance = instance;
|
|
332
|
+
wasm = instance.exports;
|
|
333
|
+
wasmModule = module;
|
|
334
|
+
cachedDataViewMemory0 = null;
|
|
335
|
+
cachedUint32ArrayMemory0 = null;
|
|
336
|
+
cachedUint8ArrayMemory0 = null;
|
|
337
|
+
wasm.__wbindgen_start();
|
|
338
|
+
return wasm;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
async function __wbg_load(module, imports) {
|
|
342
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
343
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
344
|
+
try {
|
|
345
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
346
|
+
} catch (e) {
|
|
347
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
348
|
+
|
|
349
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
350
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
351
|
+
|
|
352
|
+
} else { throw e; }
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const bytes = await module.arrayBuffer();
|
|
357
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
358
|
+
} else {
|
|
359
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
360
|
+
|
|
361
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
362
|
+
return { instance, module };
|
|
363
|
+
} else {
|
|
364
|
+
return instance;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function expectedResponseType(type) {
|
|
369
|
+
switch (type) {
|
|
370
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function initSync(module) {
|
|
377
|
+
if (wasm !== undefined) return wasm;
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
if (module !== undefined) {
|
|
381
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
382
|
+
({module} = module)
|
|
383
|
+
} else {
|
|
384
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const imports = __wbg_get_imports();
|
|
389
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
390
|
+
module = new WebAssembly.Module(module);
|
|
391
|
+
}
|
|
392
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
393
|
+
return __wbg_finalize_init(instance, module);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async function __wbg_init(module_or_path) {
|
|
397
|
+
if (wasm !== undefined) return wasm;
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
if (module_or_path !== undefined) {
|
|
401
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
402
|
+
({module_or_path} = module_or_path)
|
|
403
|
+
} else {
|
|
404
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (module_or_path === undefined) {
|
|
409
|
+
module_or_path = new URL('everygrid_wasm_bg.wasm', import.meta.url);
|
|
410
|
+
}
|
|
411
|
+
const imports = __wbg_get_imports();
|
|
412
|
+
|
|
413
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
414
|
+
module_or_path = fetch(module_or_path);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
418
|
+
|
|
419
|
+
return __wbg_finalize_init(instance, module);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everygrid/grid",
|
|
3
|
+
"version": "0.4.7",
|
|
4
|
+
"description": "Config-driven React data grid with a Rust/WASM engine in a Web Worker — filter, sort and paginate millions of rows without blocking the UI.",
|
|
5
|
+
"author": "Ilsan Software <support@ilsansoftware.com> (https://ilsansoftware.com)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://ilsansoftware.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/leeey/everygrid.git",
|
|
11
|
+
"directory": "packages/everygrid"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"email": "support@ilsansoftware.com"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"datagrid",
|
|
18
|
+
"data-grid",
|
|
19
|
+
"table",
|
|
20
|
+
"react",
|
|
21
|
+
"wasm",
|
|
22
|
+
"webassembly",
|
|
23
|
+
"web-worker"
|
|
24
|
+
],
|
|
25
|
+
"private": false,
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"module": "./dist/index.js",
|
|
29
|
+
"types": "./dist/src/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/src/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./react": {
|
|
36
|
+
"types": "./dist/src/react/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./css": "./dist/Everygrid.css",
|
|
40
|
+
"./standalone": "./dist/everygrid.standalone.js"
|
|
41
|
+
},
|
|
42
|
+
"unpkg": "./dist/everygrid.standalone.js",
|
|
43
|
+
"jsdelivr": "./dist/everygrid.standalone.js",
|
|
44
|
+
"files": [
|
|
45
|
+
"dist"
|
|
46
|
+
],
|
|
47
|
+
"sideEffects": [
|
|
48
|
+
"*.css"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "rm -rf dist && tsc -b && vite build",
|
|
52
|
+
"build:standalone": "BUILD_FORMAT=standalone vite build",
|
|
53
|
+
"dev": "vite build --watch",
|
|
54
|
+
"dev:vanilla": "BUILD_FORMAT=standalone vite build --watch"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18",
|
|
58
|
+
"react-dom": ">=18"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {}
|
|
61
|
+
}
|