juxscript 1.1.219 → 1.1.221
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.
|
@@ -135,6 +135,38 @@ export declare class DataFrameComponent extends BaseComponent<DataFrameState> {
|
|
|
135
135
|
maxSheetSize(v: number): this;
|
|
136
136
|
sheetChunkSize(v: number): this;
|
|
137
137
|
maxFileSize(mb: number): this;
|
|
138
|
+
/**
|
|
139
|
+
* Enable/disable collapsible mode
|
|
140
|
+
*/
|
|
141
|
+
collapsible(enabled: boolean): this;
|
|
142
|
+
/**
|
|
143
|
+
* Set initial collapsed state (true = collapsed, false = expanded)
|
|
144
|
+
*/
|
|
145
|
+
collapsed(value: boolean): this;
|
|
146
|
+
/**
|
|
147
|
+
* Expand the details (show table)
|
|
148
|
+
*/
|
|
149
|
+
expand(): this;
|
|
150
|
+
/**
|
|
151
|
+
* Collapse the details (hide table)
|
|
152
|
+
*/
|
|
153
|
+
collapse(): this;
|
|
154
|
+
/**
|
|
155
|
+
* Check if collapsible mode is enabled
|
|
156
|
+
*/
|
|
157
|
+
isCollapsible(): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Toggle collapsed state
|
|
160
|
+
*/
|
|
161
|
+
toggle(): this;
|
|
162
|
+
/**
|
|
163
|
+
* Set custom summary template
|
|
164
|
+
*/
|
|
165
|
+
summaryTemplate(fn: (df: DataFrame) => string): this;
|
|
166
|
+
/**
|
|
167
|
+
* Get current collapsed state
|
|
168
|
+
*/
|
|
169
|
+
isCollapsed(): boolean;
|
|
138
170
|
private _handleFile;
|
|
139
171
|
private _renderMultiSheet;
|
|
140
172
|
private _updateStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataframe.d.ts","sourceRoot":"","sources":["dataframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,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AQd;;OAEG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI;IAKpD;;OAEG;IACH,WAAW,IAAI,OAAO;YAQR,WAAW;IAuEzB,OAAO,CAAC,iBAAiB;IA+FzB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,aAAa;IA2ErB;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB,OAAO,CAAC,oBAAoB;IAiC5B,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,WAAW;IAMnB;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;YA2DpB,sBAAsB;IA4IpC,OAAO,CAAC,oBAAoB;IA6K5B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAExC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CAgIrE;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,kBAAkB,CAExF"}
|
|
@@ -39,17 +39,15 @@ export class DataFrameComponent extends BaseComponent {
|
|
|
39
39
|
this._rawFileData = null;
|
|
40
40
|
this._reshapeModal = null;
|
|
41
41
|
this._reshapeModalRendered = false;
|
|
42
|
-
// ✅ NEW: Storage configuration
|
|
43
42
|
this._persistToIndexedDB = false;
|
|
44
43
|
this._clearStorageOnFileRemove = true;
|
|
45
|
-
// ✅ NEW: Upload button styling
|
|
46
44
|
this._uploadButtonLabel = 'Upload File';
|
|
47
45
|
this._uploadButtonIcon = 'upload';
|
|
48
46
|
this._uploadButtonVariant = 'outline';
|
|
49
47
|
this._uploadAccept = '.csv,.tsv,.txt,.xlsx,.xls';
|
|
50
48
|
this._uploadDescription = '';
|
|
51
49
|
this._showUploadIcon = true;
|
|
52
|
-
// ✅
|
|
50
|
+
// ✅ Collapsible state
|
|
53
51
|
this._collapsible = false;
|
|
54
52
|
this._collapsed = false;
|
|
55
53
|
this._summaryTemplate = null;
|
|
@@ -69,10 +67,9 @@ export class DataFrameComponent extends BaseComponent {
|
|
|
69
67
|
this._sheetChunkSize = options.sheetChunkSize ?? 10000;
|
|
70
68
|
this._maxFileSize = options.maxFileSize ?? 50;
|
|
71
69
|
this._showReshapeWarning = options.showReshapeWarning ?? true;
|
|
72
|
-
// ✅ NEW: Storage options
|
|
73
70
|
this._persistToIndexedDB = options.persistToIndexedDB ?? false;
|
|
74
71
|
this._clearStorageOnFileRemove = options.clearStorageOnFileRemove ?? true;
|
|
75
|
-
// ✅
|
|
72
|
+
// ✅ Collapsible options
|
|
76
73
|
this._collapsible = options.collapsible ?? false;
|
|
77
74
|
this._collapsed = options.collapsed ?? false;
|
|
78
75
|
this._summaryTemplate = options.summaryTemplate ?? null;
|
|
@@ -326,6 +323,75 @@ export class DataFrameComponent extends BaseComponent {
|
|
|
326
323
|
maxSheetSize(v) { this._maxSheetSize = v; return this; }
|
|
327
324
|
sheetChunkSize(v) { this._sheetChunkSize = v; return this; }
|
|
328
325
|
maxFileSize(mb) { this._maxFileSize = mb; return this; }
|
|
326
|
+
/* ═══════════════════════════════════════════════════
|
|
327
|
+
* COLLAPSIBLE OPTIONS (fluent API)
|
|
328
|
+
* ═══════════════════════════════════════════════════ */
|
|
329
|
+
/**
|
|
330
|
+
* Enable/disable collapsible mode
|
|
331
|
+
*/
|
|
332
|
+
collapsible(enabled) {
|
|
333
|
+
this._collapsible = enabled;
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Set initial collapsed state (true = collapsed, false = expanded)
|
|
338
|
+
*/
|
|
339
|
+
collapsed(value) {
|
|
340
|
+
this._collapsed = value;
|
|
341
|
+
if (this._detailsElement) {
|
|
342
|
+
this._detailsElement.open = !value;
|
|
343
|
+
}
|
|
344
|
+
return this;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Expand the details (show table)
|
|
348
|
+
*/
|
|
349
|
+
expand() {
|
|
350
|
+
this._collapsed = false;
|
|
351
|
+
if (this._detailsElement) {
|
|
352
|
+
this._detailsElement.open = true;
|
|
353
|
+
}
|
|
354
|
+
return this;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Collapse the details (hide table)
|
|
358
|
+
*/
|
|
359
|
+
collapse() {
|
|
360
|
+
this._collapsed = true;
|
|
361
|
+
if (this._detailsElement) {
|
|
362
|
+
this._detailsElement.open = false;
|
|
363
|
+
}
|
|
364
|
+
return this;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Check if collapsible mode is enabled
|
|
368
|
+
*/
|
|
369
|
+
isCollapsible() {
|
|
370
|
+
return this._collapsible;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Toggle collapsed state
|
|
374
|
+
*/
|
|
375
|
+
toggle() {
|
|
376
|
+
this._collapsed = !this._collapsed;
|
|
377
|
+
if (this._detailsElement) {
|
|
378
|
+
this._detailsElement.open = !this._collapsed;
|
|
379
|
+
}
|
|
380
|
+
return this;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Set custom summary template
|
|
384
|
+
*/
|
|
385
|
+
summaryTemplate(fn) {
|
|
386
|
+
this._summaryTemplate = fn;
|
|
387
|
+
return this;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Get current collapsed state
|
|
391
|
+
*/
|
|
392
|
+
isCollapsed() {
|
|
393
|
+
return this._collapsed;
|
|
394
|
+
}
|
|
329
395
|
/* ═══════════════════════════════════════════════════
|
|
330
396
|
* FILE HANDLING (modified to use storage options)
|
|
331
397
|
* ═══════════════════════════════════════════════════ */
|
|
@@ -30,10 +30,10 @@ export interface DataFrameOptions {
|
|
|
30
30
|
class?: string;
|
|
31
31
|
persistToIndexedDB?: boolean;
|
|
32
32
|
clearStorageOnFileRemove?: boolean;
|
|
33
|
-
// ✅
|
|
34
|
-
collapsible?: boolean;
|
|
35
|
-
collapsed?: boolean;
|
|
36
|
-
summaryTemplate?: (df: DataFrame) => string;
|
|
33
|
+
// ✅ Collapsible options
|
|
34
|
+
collapsible?: boolean;
|
|
35
|
+
collapsed?: boolean;
|
|
36
|
+
summaryTemplate?: (df: DataFrame) => string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
type DataFrameState = BaseState & {
|
|
@@ -70,17 +70,15 @@ export class DataFrameComponent extends BaseComponent<DataFrameState> {
|
|
|
70
70
|
private _rawFileData: { file: File; text?: string; isExcel?: boolean } | null = null;
|
|
71
71
|
private _reshapeModal: Modal | null = null;
|
|
72
72
|
private _reshapeModalRendered: boolean = false;
|
|
73
|
-
// ✅ NEW: Storage configuration
|
|
74
73
|
private _persistToIndexedDB: boolean = false;
|
|
75
74
|
private _clearStorageOnFileRemove: boolean = true;
|
|
76
|
-
// ✅ NEW: Upload button styling
|
|
77
75
|
private _uploadButtonLabel: string = 'Upload File';
|
|
78
76
|
private _uploadButtonIcon: string = 'upload';
|
|
79
77
|
private _uploadButtonVariant: string = 'outline';
|
|
80
78
|
private _uploadAccept: string = '.csv,.tsv,.txt,.xlsx,.xls';
|
|
81
79
|
private _uploadDescription: string = '';
|
|
82
80
|
private _showUploadIcon: boolean = true;
|
|
83
|
-
// ✅
|
|
81
|
+
// ✅ Collapsible state
|
|
84
82
|
private _collapsible: boolean = false;
|
|
85
83
|
private _collapsed: boolean = false;
|
|
86
84
|
private _summaryTemplate: ((df: DataFrame) => string) | null = null;
|
|
@@ -119,10 +117,9 @@ export class DataFrameComponent extends BaseComponent<DataFrameState> {
|
|
|
119
117
|
this._sheetChunkSize = options.sheetChunkSize ?? 10000;
|
|
120
118
|
this._maxFileSize = options.maxFileSize ?? 50;
|
|
121
119
|
this._showReshapeWarning = options.showReshapeWarning ?? true;
|
|
122
|
-
// ✅ NEW: Storage options
|
|
123
120
|
this._persistToIndexedDB = options.persistToIndexedDB ?? false;
|
|
124
121
|
this._clearStorageOnFileRemove = options.clearStorageOnFileRemove ?? true;
|
|
125
|
-
// ✅
|
|
122
|
+
// ✅ Collapsible options
|
|
126
123
|
this._collapsible = options.collapsible ?? false;
|
|
127
124
|
this._collapsed = options.collapsed ?? false;
|
|
128
125
|
this._summaryTemplate = options.summaryTemplate ?? null;
|
|
@@ -399,6 +396,84 @@ export class DataFrameComponent extends BaseComponent<DataFrameState> {
|
|
|
399
396
|
sheetChunkSize(v: number): this { this._sheetChunkSize = v; return this; }
|
|
400
397
|
maxFileSize(mb: number): this { this._maxFileSize = mb; return this; }
|
|
401
398
|
|
|
399
|
+
/* ═══════════════════════════════════════════════════
|
|
400
|
+
* COLLAPSIBLE OPTIONS (fluent API)
|
|
401
|
+
* ═══════════════════════════════════════════════════ */
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Enable/disable collapsible mode
|
|
405
|
+
*/
|
|
406
|
+
collapsible(enabled: boolean): this {
|
|
407
|
+
this._collapsible = enabled;
|
|
408
|
+
return this;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Set initial collapsed state (true = collapsed, false = expanded)
|
|
413
|
+
*/
|
|
414
|
+
collapsed(value: boolean): this {
|
|
415
|
+
this._collapsed = value;
|
|
416
|
+
if (this._detailsElement) {
|
|
417
|
+
this._detailsElement.open = !value;
|
|
418
|
+
}
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Expand the details (show table)
|
|
424
|
+
*/
|
|
425
|
+
expand(): this {
|
|
426
|
+
this._collapsed = false;
|
|
427
|
+
if (this._detailsElement) {
|
|
428
|
+
this._detailsElement.open = true;
|
|
429
|
+
}
|
|
430
|
+
return this;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Collapse the details (hide table)
|
|
435
|
+
*/
|
|
436
|
+
collapse(): this {
|
|
437
|
+
this._collapsed = true;
|
|
438
|
+
if (this._detailsElement) {
|
|
439
|
+
this._detailsElement.open = false;
|
|
440
|
+
}
|
|
441
|
+
return this;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Check if collapsible mode is enabled
|
|
446
|
+
*/
|
|
447
|
+
isCollapsible(): boolean {
|
|
448
|
+
return this._collapsible;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Toggle collapsed state
|
|
453
|
+
*/
|
|
454
|
+
toggle(): this {
|
|
455
|
+
this._collapsed = !this._collapsed;
|
|
456
|
+
if (this._detailsElement) {
|
|
457
|
+
this._detailsElement.open = !this._collapsed;
|
|
458
|
+
}
|
|
459
|
+
return this;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Set custom summary template
|
|
464
|
+
*/
|
|
465
|
+
summaryTemplate(fn: (df: DataFrame) => string): this {
|
|
466
|
+
this._summaryTemplate = fn;
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Get current collapsed state
|
|
472
|
+
*/
|
|
473
|
+
isCollapsed(): boolean {
|
|
474
|
+
return this._collapsed;
|
|
475
|
+
}
|
|
476
|
+
|
|
402
477
|
/* ═══════════════════════════════════════════════════
|
|
403
478
|
* FILE HANDLING (modified to use storage options)
|
|
404
479
|
* ═══════════════════════════════════════════════════ */
|