juxscript 1.1.239 → 1.1.243
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/index.js +7 -137
- package/lib/components/dataframe.ts +0 -569
- package/lib/components/tag.ts +68 -0
- package/lib/styles/shadcn.css +20 -7
- package/lib/utils/idgen.ts +6 -0
- package/package.json +5 -6
- package/index.d.ts +0 -239
- package/index.d.ts.map +0 -1
- package/lib/components/alert.d.ts +0 -36
- package/lib/components/alert.d.ts.map +0 -1
- package/lib/components/alert.js +0 -172
- package/lib/components/alert.ts +0 -219
- package/lib/components/app.d.ts +0 -89
- package/lib/components/app.d.ts.map +0 -1
- package/lib/components/app.js +0 -175
- package/lib/components/app.ts +0 -247
- package/lib/components/badge.d.ts +0 -26
- package/lib/components/badge.d.ts.map +0 -1
- package/lib/components/badge.js +0 -91
- package/lib/components/badge.ts +0 -118
- package/lib/components/base/Animations.d.ts +0 -36
- package/lib/components/base/Animations.d.ts.map +0 -1
- package/lib/components/base/Animations.js +0 -70
- package/lib/components/base/Animations.ts +0 -112
- package/lib/components/base/BaseComponent.d.ts +0 -294
- package/lib/components/base/BaseComponent.d.ts.map +0 -1
- package/lib/components/base/BaseComponent.js +0 -735
- package/lib/components/base/BaseComponent.ts +0 -884
- package/lib/components/base/FormInput.d.ts +0 -77
- package/lib/components/base/FormInput.d.ts.map +0 -1
- package/lib/components/base/FormInput.js +0 -171
- package/lib/components/base/FormInput.ts +0 -237
- package/lib/components/blueprint.d.ts +0 -40
- package/lib/components/blueprint.d.ts.map +0 -1
- package/lib/components/blueprint.js +0 -327
- package/lib/components/button.d.ts +0 -70
- package/lib/components/button.d.ts.map +0 -1
- package/lib/components/button.js +0 -177
- package/lib/components/button.ts +0 -237
- package/lib/components/card.d.ts +0 -35
- package/lib/components/card.d.ts.map +0 -1
- package/lib/components/card.js +0 -130
- package/lib/components/card.ts +0 -177
- package/lib/components/chart.d.ts +0 -49
- package/lib/components/chart.d.ts.map +0 -1
- package/lib/components/chart.js +0 -205
- package/lib/components/chart.ts +0 -254
- package/lib/components/checkbox.d.ts +0 -33
- package/lib/components/checkbox.d.ts.map +0 -1
- package/lib/components/checkbox.js +0 -202
- package/lib/components/checkbox.ts +0 -260
- package/lib/components/code.d.ts +0 -52
- package/lib/components/code.d.ts.map +0 -1
- package/lib/components/code.js +0 -201
- package/lib/components/code.ts +0 -260
- package/lib/components/container.d.ts +0 -60
- package/lib/components/container.d.ts.map +0 -1
- package/lib/components/container.js +0 -195
- package/lib/components/container.ts +0 -259
- package/lib/components/data.d.ts +0 -36
- package/lib/components/data.d.ts.map +0 -1
- package/lib/components/data.js +0 -110
- package/lib/components/data.ts +0 -135
- package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
- package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
- package/lib/components/dataframe/DataFrameSource.js +0 -421
- package/lib/components/dataframe/DataFrameSource.ts +0 -532
- package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
- package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
- package/lib/components/dataframe/ImportSettingsModal.js +0 -442
- package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
- package/lib/components/dataframe.d.ts +0 -110
- package/lib/components/dataframe.d.ts.map +0 -1
- package/lib/components/dataframe.js +0 -470
- package/lib/components/datepicker.d.ts +0 -40
- package/lib/components/datepicker.d.ts.map +0 -1
- package/lib/components/datepicker.js +0 -193
- package/lib/components/datepicker.ts +0 -251
- package/lib/components/dialog.d.ts +0 -39
- package/lib/components/dialog.d.ts.map +0 -1
- package/lib/components/dialog.js +0 -131
- package/lib/components/dialog.ts +0 -178
- package/lib/components/divider.d.ts +0 -31
- package/lib/components/divider.d.ts.map +0 -1
- package/lib/components/divider.js +0 -72
- package/lib/components/divider.ts +0 -104
- package/lib/components/dropdown-menu.d.ts +0 -42
- package/lib/components/dropdown-menu.d.ts.map +0 -1
- package/lib/components/dropdown-menu.js +0 -177
- package/lib/components/dropdown-menu.ts +0 -214
- package/lib/components/dropdown.d.ts +0 -41
- package/lib/components/dropdown.d.ts.map +0 -1
- package/lib/components/dropdown.js +0 -136
- package/lib/components/dropdown.ts +0 -188
- package/lib/components/element.d.ts +0 -51
- package/lib/components/element.d.ts.map +0 -1
- package/lib/components/element.js +0 -209
- package/lib/components/element.ts +0 -271
- package/lib/components/event-chain.d.ts +0 -9
- package/lib/components/event-chain.d.ts.map +0 -1
- package/lib/components/event-chain.js +0 -33
- package/lib/components/fileupload.d.ts +0 -98
- package/lib/components/fileupload.d.ts.map +0 -1
- package/lib/components/fileupload.js +0 -351
- package/lib/components/fileupload.ts +0 -449
- package/lib/components/grid.d.ts +0 -88
- package/lib/components/grid.d.ts.map +0 -1
- package/lib/components/grid.js +0 -208
- package/lib/components/grid.ts +0 -295
- package/lib/components/heading.d.ts +0 -25
- package/lib/components/heading.d.ts.map +0 -1
- package/lib/components/heading.js +0 -83
- package/lib/components/heading.ts +0 -113
- package/lib/components/helpers.d.ts +0 -9
- package/lib/components/helpers.d.ts.map +0 -1
- package/lib/components/helpers.js +0 -30
- package/lib/components/helpers.ts +0 -41
- package/lib/components/hero.d.ts +0 -60
- package/lib/components/hero.d.ts.map +0 -1
- package/lib/components/hero.js +0 -239
- package/lib/components/hero.ts +0 -302
- package/lib/components/history/StateHistory.d.ts +0 -91
- package/lib/components/history/StateHistory.d.ts.map +0 -1
- package/lib/components/history/StateHistory.js +0 -154
- package/lib/components/history/StateHistory.ts +0 -200
- package/lib/components/icon.d.ts +0 -36
- package/lib/components/icon.d.ts.map +0 -1
- package/lib/components/icon.js +0 -135
- package/lib/components/icon.ts +0 -182
- package/lib/components/icons.d.ts +0 -25
- package/lib/components/icons.d.ts.map +0 -1
- package/lib/components/icons.js +0 -440
- package/lib/components/icons.ts +0 -464
- package/lib/components/image.d.ts +0 -42
- package/lib/components/image.d.ts.map +0 -1
- package/lib/components/image.js +0 -204
- package/lib/components/image.ts +0 -260
- package/lib/components/include.d.ts +0 -86
- package/lib/components/include.d.ts.map +0 -1
- package/lib/components/include.js +0 -238
- package/lib/components/include.ts +0 -281
- package/lib/components/input.d.ts +0 -85
- package/lib/components/input.d.ts.map +0 -1
- package/lib/components/input.js +0 -362
- package/lib/components/input.ts +0 -473
- package/lib/components/layer.d.ts +0 -72
- package/lib/components/layer.d.ts.map +0 -1
- package/lib/components/layer.js +0 -219
- package/lib/components/layer.ts +0 -304
- package/lib/components/link.d.ts +0 -41
- package/lib/components/link.d.ts.map +0 -1
- package/lib/components/link.js +0 -216
- package/lib/components/link.ts +0 -268
- package/lib/components/list.d.ts +0 -83
- package/lib/components/list.d.ts.map +0 -1
- package/lib/components/list.js +0 -314
- package/lib/components/list.ts +0 -423
- package/lib/components/loading.d.ts +0 -25
- package/lib/components/loading.d.ts.map +0 -1
- package/lib/components/loading.js +0 -76
- package/lib/components/loading.ts +0 -104
- package/lib/components/menu.d.ts +0 -38
- package/lib/components/menu.d.ts.map +0 -1
- package/lib/components/menu.js +0 -205
- package/lib/components/menu.ts +0 -279
- package/lib/components/modal.d.ts +0 -97
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js +0 -463
- package/lib/components/modal.ts +0 -576
- package/lib/components/nav.d.ts +0 -46
- package/lib/components/nav.d.ts.map +0 -1
- package/lib/components/nav.js +0 -193
- package/lib/components/nav.ts +0 -261
- package/lib/components/paragraph.d.ts +0 -30
- package/lib/components/paragraph.d.ts.map +0 -1
- package/lib/components/paragraph.js +0 -93
- package/lib/components/paragraph.ts +0 -123
- package/lib/components/pen.d.ts +0 -125
- package/lib/components/pen.d.ts.map +0 -1
- package/lib/components/pen.js +0 -443
- package/lib/components/pen.ts +0 -567
- package/lib/components/progress.d.ts +0 -40
- package/lib/components/progress.d.ts.map +0 -1
- package/lib/components/progress.js +0 -116
- package/lib/components/progress.ts +0 -163
- package/lib/components/radio.d.ts +0 -43
- package/lib/components/radio.d.ts.map +0 -1
- package/lib/components/radio.js +0 -226
- package/lib/components/radio.ts +0 -303
- package/lib/components/registry.d.ts +0 -34
- package/lib/components/registry.d.ts.map +0 -1
- package/lib/components/registry.js +0 -163
- package/lib/components/registry.ts +0 -193
- package/lib/components/req.d.ts +0 -155
- package/lib/components/req.d.ts.map +0 -1
- package/lib/components/req.js +0 -253
- package/lib/components/req.ts +0 -303
- package/lib/components/script.d.ts +0 -14
- package/lib/components/script.d.ts.map +0 -1
- package/lib/components/script.js +0 -33
- package/lib/components/script.ts +0 -41
- package/lib/components/select.d.ts +0 -42
- package/lib/components/select.d.ts.map +0 -1
- package/lib/components/select.js +0 -209
- package/lib/components/select.ts +0 -281
- package/lib/components/sidebar.d.ts +0 -59
- package/lib/components/sidebar.d.ts.map +0 -1
- package/lib/components/sidebar.js +0 -298
- package/lib/components/sidebar.ts +0 -395
- package/lib/components/stack/BaseStack.d.ts +0 -65
- package/lib/components/stack/BaseStack.d.ts.map +0 -1
- package/lib/components/stack/BaseStack.js +0 -274
- package/lib/components/stack/BaseStack.ts +0 -328
- package/lib/components/stack/HStack.d.ts +0 -18
- package/lib/components/stack/HStack.d.ts.map +0 -1
- package/lib/components/stack/HStack.js +0 -22
- package/lib/components/stack/HStack.ts +0 -25
- package/lib/components/stack/VStack.d.ts +0 -19
- package/lib/components/stack/VStack.d.ts.map +0 -1
- package/lib/components/stack/VStack.js +0 -23
- package/lib/components/stack/VStack.ts +0 -26
- package/lib/components/stack/ZStack.d.ts +0 -18
- package/lib/components/stack/ZStack.d.ts.map +0 -1
- package/lib/components/stack/ZStack.js +0 -22
- package/lib/components/stack/ZStack.ts +0 -25
- package/lib/components/style.d.ts +0 -14
- package/lib/components/style.d.ts.map +0 -1
- package/lib/components/style.js +0 -33
- package/lib/components/style.ts +0 -41
- package/lib/components/switch.d.ts +0 -34
- package/lib/components/switch.d.ts.map +0 -1
- package/lib/components/switch.js +0 -209
- package/lib/components/switch.ts +0 -272
- package/lib/components/table.d.ts +0 -137
- package/lib/components/table.d.ts.map +0 -1
- package/lib/components/table.js +0 -1019
- package/lib/components/table.ts +0 -1225
- package/lib/components/tabs.d.ts +0 -53
- package/lib/components/tabs.d.ts.map +0 -1
- package/lib/components/tabs.js +0 -275
- package/lib/components/tabs.ts +0 -349
- package/lib/components/theme-toggle.d.ts +0 -45
- package/lib/components/theme-toggle.d.ts.map +0 -1
- package/lib/components/theme-toggle.js +0 -218
- package/lib/components/theme-toggle.ts +0 -297
- package/lib/components/tooltip.d.ts +0 -31
- package/lib/components/tooltip.d.ts.map +0 -1
- package/lib/components/tooltip.js +0 -112
- package/lib/components/tooltip.ts +0 -148
- package/lib/components/watcher.d.ts +0 -195
- package/lib/components/watcher.d.ts.map +0 -1
- package/lib/components/watcher.js +0 -241
- package/lib/components/watcher.ts +0 -261
- package/lib/components/write.d.ts +0 -107
- package/lib/components/write.d.ts.map +0 -1
- package/lib/components/write.js +0 -222
- package/lib/components/write.ts +0 -272
- package/lib/data/DataPipeline.d.ts +0 -113
- package/lib/data/DataPipeline.d.ts.map +0 -1
- package/lib/data/DataPipeline.js +0 -359
- package/lib/data/DataPipeline.ts +0 -452
- package/lib/facades/dataframe.jux +0 -0
- package/lib/globals.d.ts +0 -21
- package/lib/reactivity/state.d.ts +0 -36
- package/lib/reactivity/state.d.ts.map +0 -1
- package/lib/reactivity/state.js +0 -67
- package/lib/reactivity/state.ts +0 -78
- package/lib/storage/DataFrame.d.ts +0 -284
- package/lib/storage/DataFrame.d.ts.map +0 -1
- package/lib/storage/DataFrame.js +0 -1022
- package/lib/storage/DataFrame.ts +0 -1195
- package/lib/storage/DataFrameSource.d.ts +0 -158
- package/lib/storage/DataFrameSource.d.ts.map +0 -1
- package/lib/storage/DataFrameSource.js +0 -409
- package/lib/storage/DataFrameSource.ts +0 -556
- package/lib/storage/FileStorage.d.ts +0 -53
- package/lib/storage/FileStorage.d.ts.map +0 -1
- package/lib/storage/FileStorage.js +0 -80
- package/lib/storage/FileStorage.ts +0 -95
- package/lib/storage/IndexedDBDriver.d.ts +0 -75
- package/lib/storage/IndexedDBDriver.d.ts.map +0 -1
- package/lib/storage/IndexedDBDriver.js +0 -177
- package/lib/storage/IndexedDBDriver.ts +0 -226
- package/lib/storage/TabularDriver.d.ts +0 -118
- package/lib/storage/TabularDriver.d.ts.map +0 -1
- package/lib/storage/TabularDriver.js +0 -731
- package/lib/storage/TabularDriver.ts +0 -874
- package/lib/utils/codeparser.d.ts +0 -29
- package/lib/utils/codeparser.d.ts.map +0 -1
- package/lib/utils/codeparser.js +0 -409
- package/lib/utils/fetch.d.ts +0 -176
- package/lib/utils/fetch.d.ts.map +0 -1
- package/lib/utils/fetch.js +0 -427
- package/lib/utils/formatId.d.ts +0 -16
- package/lib/utils/formatId.d.ts.map +0 -1
- package/lib/utils/formatId.js +0 -27
- package/lib/utils/path-resolver.js +0 -23
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
import { Modal } from '../modal.js';
|
|
2
|
-
import { TabularDriver } from '../../storage/TabularDriver.js';
|
|
3
|
-
import { DataFrame } from '../../storage/DataFrame.js';
|
|
4
|
-
|
|
5
|
-
export interface ImportSettingsCallbacks {
|
|
6
|
-
onReimport: (df: DataFrame | Record<string, DataFrame>, sourceName: string) => void;
|
|
7
|
-
onError: (message: string) => void;
|
|
8
|
-
onStatusUpdate: (text: string, type: 'loading' | 'success' | 'error') => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface SettingsModalCallbacks {
|
|
12
|
-
onClear: () => Promise<void>;
|
|
13
|
-
onAdjustImport: () => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface SettingsModalData {
|
|
17
|
-
fileName: string;
|
|
18
|
-
fileSize?: number;
|
|
19
|
-
rowCount: number;
|
|
20
|
-
colCount: number;
|
|
21
|
-
isMalformed: boolean;
|
|
22
|
-
hasRawFileData: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface RawFileData {
|
|
26
|
-
file: File;
|
|
27
|
-
text?: string;
|
|
28
|
-
isExcel?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class ImportSettingsModal {
|
|
32
|
-
private _id: string;
|
|
33
|
-
private _driver: TabularDriver;
|
|
34
|
-
private _reshapeModal: Modal | null = null;
|
|
35
|
-
private _reshapeModalRendered: boolean = false;
|
|
36
|
-
private _settingsModal: Modal | null = null;
|
|
37
|
-
private _modal: Modal | null = null;
|
|
38
|
-
private _modalRendered: boolean = false;
|
|
39
|
-
private _maxSheetSize: number;
|
|
40
|
-
private _sheetChunkSize: number;
|
|
41
|
-
|
|
42
|
-
constructor(
|
|
43
|
-
id: string,
|
|
44
|
-
driver: TabularDriver,
|
|
45
|
-
options: { maxSheetSize?: number; sheetChunkSize?: number } = {}
|
|
46
|
-
) {
|
|
47
|
-
this._id = id;
|
|
48
|
-
this._driver = driver;
|
|
49
|
-
this._maxSheetSize = options.maxSheetSize ?? 100000;
|
|
50
|
-
this._sheetChunkSize = options.sheetChunkSize ?? 10000;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* ═══════════════════════════════════════════════════
|
|
54
|
-
* SETTINGS MODAL (Overview)
|
|
55
|
-
* ═══════════════════════════════════════════════════ */
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Show the data settings modal with file info and options
|
|
59
|
-
*/
|
|
60
|
-
showSettings(data: SettingsModalData, callbacks: SettingsModalCallbacks): void {
|
|
61
|
-
this.cleanup();
|
|
62
|
-
|
|
63
|
-
this._settingsModal = new Modal(`${this._id}-settings-modal`, {
|
|
64
|
-
title: 'Data Settings',
|
|
65
|
-
size: 'medium',
|
|
66
|
-
close: true,
|
|
67
|
-
backdropClose: true
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const fileSizeKB = data.fileSize ? (data.fileSize / 1024).toFixed(1) : '0';
|
|
71
|
-
|
|
72
|
-
let contentHTML = `
|
|
73
|
-
<div class="jux-dataframe-settings-content">
|
|
74
|
-
<div class="jux-dataframe-settings-section">
|
|
75
|
-
<div class="jux-dataframe-settings-label">Source</div>
|
|
76
|
-
<div class="jux-dataframe-settings-value">
|
|
77
|
-
<strong>${this._escapeHtml(data.fileName)}</strong>
|
|
78
|
-
${data.fileSize ? `<span class="jux-muted" style="margin-left: 8px;">${fileSizeKB} KB</span>` : ''}
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="jux-dataframe-settings-section">
|
|
82
|
-
<div class="jux-dataframe-settings-label">Data</div>
|
|
83
|
-
<div class="jux-dataframe-settings-value">
|
|
84
|
-
${data.rowCount > 0 ? `${data.rowCount} rows × ${data.colCount} columns` : 'No data loaded'}
|
|
85
|
-
${data.isMalformed ? '<span style="color: hsl(var(--warning)); margin-left: 8px;">⚠️ May need reformatting</span>' : ''}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
if (data.hasRawFileData) {
|
|
91
|
-
contentHTML += `
|
|
92
|
-
<div class="jux-dataframe-settings-section">
|
|
93
|
-
<div class="jux-dataframe-settings-label">Import</div>
|
|
94
|
-
<div class="jux-dataframe-settings-value">
|
|
95
|
-
<button id="${this._id}-adjust-import" class="jux-button jux-button-outline jux-button-sm">
|
|
96
|
-
⚙️ Adjust Header Row / Delimiter
|
|
97
|
-
</button>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
`;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
contentHTML += `</div>`;
|
|
104
|
-
|
|
105
|
-
this._settingsModal
|
|
106
|
-
.content(contentHTML)
|
|
107
|
-
.actions([
|
|
108
|
-
{
|
|
109
|
-
label: 'Remove Data',
|
|
110
|
-
variant: 'secondary',
|
|
111
|
-
click: async () => {
|
|
112
|
-
await callbacks.onClear();
|
|
113
|
-
this._settingsModal!.closeModal();
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: 'Done',
|
|
118
|
-
variant: 'primary',
|
|
119
|
-
click: () => this._settingsModal!.closeModal()
|
|
120
|
-
}
|
|
121
|
-
]);
|
|
122
|
-
|
|
123
|
-
this._settingsModal.render(document.body);
|
|
124
|
-
this._settingsModal.open();
|
|
125
|
-
|
|
126
|
-
requestAnimationFrame(() => {
|
|
127
|
-
const adjustBtn = document.getElementById(`${this._id}-adjust-import`);
|
|
128
|
-
if (adjustBtn) {
|
|
129
|
-
adjustBtn.addEventListener('click', () => {
|
|
130
|
-
this._settingsModal!.closeModal();
|
|
131
|
-
callbacks.onAdjustImport();
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Close the settings modal if open
|
|
139
|
-
*/
|
|
140
|
-
closeSettings(): void {
|
|
141
|
-
if (this._settingsModal) {
|
|
142
|
-
this._settingsModal.closeModal();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* ═══════════════════════════════════════════════════
|
|
147
|
-
* IMPORT/RESHAPE MODAL
|
|
148
|
-
* ═══════════════════════════════════════════════════ */
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Show the appropriate reshape modal based on file type
|
|
152
|
-
*/
|
|
153
|
-
async showImportSettings(rawFileData: RawFileData, callbacks: ImportSettingsCallbacks): Promise<void> {
|
|
154
|
-
if (!rawFileData) return;
|
|
155
|
-
|
|
156
|
-
if (rawFileData.isExcel) {
|
|
157
|
-
await this._showExcelModal(rawFileData, callbacks);
|
|
158
|
-
} else {
|
|
159
|
-
this._showCSVModal(rawFileData, callbacks);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Cleanup any existing modals
|
|
165
|
-
*/
|
|
166
|
-
cleanup(): void {
|
|
167
|
-
if (this._reshapeModal && this._reshapeModalRendered) {
|
|
168
|
-
const oldEl = document.getElementById(`${this._id}-reshape-modal`);
|
|
169
|
-
if (oldEl) oldEl.remove();
|
|
170
|
-
this._reshapeModal = null;
|
|
171
|
-
this._reshapeModalRendered = false;
|
|
172
|
-
}
|
|
173
|
-
// Note: Don't close settings modal here - let it close itself
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
private _escapeHtml(text: string): string {
|
|
177
|
-
const div = document.createElement('div');
|
|
178
|
-
div.textContent = text;
|
|
179
|
-
return div.innerHTML;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
private _buildClickablePreviewHTML(
|
|
183
|
-
rawRows: { sheetRow: number; values: any[] }[],
|
|
184
|
-
selectedSheetRow: number
|
|
185
|
-
): string {
|
|
186
|
-
let html = '<table style="width: 100%; border-collapse: collapse; font-size: 12px;">';
|
|
187
|
-
|
|
188
|
-
for (const { sheetRow, values } of rawRows) {
|
|
189
|
-
const isHeader = (sheetRow === selectedSheetRow);
|
|
190
|
-
const isSkipped = (sheetRow < selectedSheetRow);
|
|
191
|
-
|
|
192
|
-
let rowStyle = 'border-bottom: 1px solid hsl(var(--border)); cursor: pointer; transition: background 0.1s;';
|
|
193
|
-
|
|
194
|
-
if (isHeader) {
|
|
195
|
-
rowStyle += 'background: hsl(142 71% 45% / 0.15); font-weight: 600;';
|
|
196
|
-
} else if (isSkipped) {
|
|
197
|
-
rowStyle += 'background: hsl(var(--muted) / 0.4); color: hsl(var(--muted-foreground)); font-style: italic; opacity: 0.7;';
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
html += `<tr data-sheet-row="${sheetRow}" style="${rowStyle}" onmouseover="this.style.outline='2px solid hsl(142 71% 45% / 0.5)'" onmouseout="this.style.outline=''">`;
|
|
201
|
-
|
|
202
|
-
html += `<td style="padding: 8px 12px; width: 60px; font-weight: 600; color: hsl(var(--muted-foreground)); border-right: 1px solid hsl(var(--border)); text-align: center; user-select: none;">`;
|
|
203
|
-
if (isHeader) {
|
|
204
|
-
html += `<span style="color: hsl(142 71% 45%);">▶ ${sheetRow}</span>`;
|
|
205
|
-
} else {
|
|
206
|
-
html += `${sheetRow}`;
|
|
207
|
-
}
|
|
208
|
-
html += '</td>';
|
|
209
|
-
|
|
210
|
-
const displayCols = values.slice(0, 6);
|
|
211
|
-
displayCols.forEach(val => {
|
|
212
|
-
const displayVal = val != null ? String(val).substring(0, 20) : '';
|
|
213
|
-
const cellStyle = isHeader
|
|
214
|
-
? 'padding: 8px 12px; font-weight: 600; color: hsl(var(--foreground));'
|
|
215
|
-
: 'padding: 8px 12px;';
|
|
216
|
-
html += `<td style="${cellStyle}">${this._escapeHtml(displayVal)}</td>`;
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
if (values.length > 6) {
|
|
220
|
-
html += `<td style="padding: 8px 12px; color: hsl(var(--muted-foreground));">…</td>`;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
html += `<td style="padding: 8px 12px; text-align: right; white-space: nowrap; user-select: none;">`;
|
|
224
|
-
if (isHeader) {
|
|
225
|
-
html += '<span style="background: hsl(142 71% 45%); color: white; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;">HEADER</span>';
|
|
226
|
-
} else if (isSkipped) {
|
|
227
|
-
html += '<span style="color: hsl(var(--muted-foreground)); font-size: 10px;">skipped</span>';
|
|
228
|
-
} else {
|
|
229
|
-
html += '<span style="color: hsl(var(--muted-foreground)); font-size: 10px;">data</span>';
|
|
230
|
-
}
|
|
231
|
-
html += '</td></tr>';
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
html += '</table>';
|
|
235
|
-
return html;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
private async _showExcelModal(rawFileData: RawFileData, callbacks: ImportSettingsCallbacks): Promise<void> {
|
|
239
|
-
if (!rawFileData.file) return;
|
|
240
|
-
|
|
241
|
-
this.cleanup();
|
|
242
|
-
|
|
243
|
-
const rawRows = await this._driver.readRawExcelRows(rawFileData.file, 15);
|
|
244
|
-
|
|
245
|
-
if (rawRows.length === 0) return;
|
|
246
|
-
|
|
247
|
-
// Auto-detect best header row
|
|
248
|
-
let selectedSheetRow = rawRows[0].sheetRow;
|
|
249
|
-
for (const { sheetRow, values } of rawRows) {
|
|
250
|
-
const nonEmpty = values.filter(v => v !== null && v !== undefined && String(v).trim() !== '');
|
|
251
|
-
if (nonEmpty.length < values.length * 0.5) continue;
|
|
252
|
-
const nonNumeric = nonEmpty.filter(v => {
|
|
253
|
-
const str = String(v).trim();
|
|
254
|
-
return isNaN(Number(str)) && str !== '';
|
|
255
|
-
}).length;
|
|
256
|
-
if (nonNumeric >= nonEmpty.length * 0.7) {
|
|
257
|
-
selectedSheetRow = sheetRow;
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
this._modal = new Modal(`${this._id}-reshape-modal`, {
|
|
263
|
-
title: 'Excel Import Settings',
|
|
264
|
-
size: 'large',
|
|
265
|
-
close: true,
|
|
266
|
-
backdropClose: false
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
const modalContentHTML = `
|
|
270
|
-
<div style="margin-bottom: 1rem;">
|
|
271
|
-
<div id="${this._id}-reshape-hint" style="padding: 0.75rem; background: hsl(var(--muted) / 0.5); border-radius: var(--radius); font-size: 0.875rem;"></div>
|
|
272
|
-
<input type="hidden" id="${this._id}-header-row" value="${selectedSheetRow}" />
|
|
273
|
-
</div>
|
|
274
|
-
<div>
|
|
275
|
-
<div style="font-weight: 600; margin-bottom: 0.5rem; color: hsl(var(--foreground));">Click a row to select it as the header:</div>
|
|
276
|
-
<div id="${this._id}-preview" style="font-family: ui-monospace, monospace; font-size: 12px; background: hsl(var(--muted) / 0.3); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 0; overflow: hidden; max-height: 400px; overflow-y: auto;"></div>
|
|
277
|
-
</div>
|
|
278
|
-
`;
|
|
279
|
-
|
|
280
|
-
this._modal
|
|
281
|
-
.content(modalContentHTML)
|
|
282
|
-
.actions([
|
|
283
|
-
{
|
|
284
|
-
label: 'Cancel',
|
|
285
|
-
variant: 'secondary',
|
|
286
|
-
click: () => this._modal!.closeModal()
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
label: 'Apply & Re-import',
|
|
290
|
-
variant: 'primary',
|
|
291
|
-
click: async () => {
|
|
292
|
-
const input = document.getElementById(`${this._id}-header-row`) as HTMLInputElement;
|
|
293
|
-
const headerRow = parseInt(input.value) || 0;
|
|
294
|
-
|
|
295
|
-
callbacks.onStatusUpdate('Re-parsing with new settings...', 'loading');
|
|
296
|
-
|
|
297
|
-
try {
|
|
298
|
-
const sheets = await this._driver.streamFileMultiSheet(rawFileData.file, {
|
|
299
|
-
headerRow,
|
|
300
|
-
maxSheetSize: this._maxSheetSize,
|
|
301
|
-
sheetChunkSize: this._sheetChunkSize
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
const sheetNames = Object.keys(sheets);
|
|
305
|
-
|
|
306
|
-
if (sheetNames.length === 0) {
|
|
307
|
-
callbacks.onError(`No data found with header at row ${headerRow}. Try a different row.`);
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
await this._driver.store(rawFileData.file.name, sheets[sheetNames[0]], { source: rawFileData.file.name });
|
|
312
|
-
|
|
313
|
-
if (sheetNames.length > 1) {
|
|
314
|
-
callbacks.onReimport(sheets, rawFileData.file.name);
|
|
315
|
-
} else {
|
|
316
|
-
callbacks.onReimport(sheets[sheetNames[0]], rawFileData.file.name);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
this._modal!.closeModal();
|
|
320
|
-
} catch (err: any) {
|
|
321
|
-
callbacks.onError(`Error: ${err.message}`);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
]);
|
|
326
|
-
|
|
327
|
-
this._modal.render(document.body);
|
|
328
|
-
this._modalRendered = true;
|
|
329
|
-
|
|
330
|
-
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
331
|
-
|
|
332
|
-
const previewDiv = document.getElementById(`${this._id}-preview`)!;
|
|
333
|
-
const hintDiv = document.getElementById(`${this._id}-reshape-hint`)!;
|
|
334
|
-
const hiddenInput = document.getElementById(`${this._id}-header-row`) as HTMLInputElement;
|
|
335
|
-
|
|
336
|
-
const updateHint = (row: number) => {
|
|
337
|
-
if (!hintDiv) return;
|
|
338
|
-
const vals = rawRows.find(r => r.sheetRow === row)?.values ?? [];
|
|
339
|
-
const headerNames = vals.filter((v: any) => v != null && String(v).trim() !== '').map((v: any) => String(v).trim());
|
|
340
|
-
const preview = headerNames.slice(0, 4).join(', ') + (headerNames.length > 4 ? '…' : '');
|
|
341
|
-
if (row > rawRows[0].sheetRow) {
|
|
342
|
-
hintDiv.innerHTML = `Sheet row <strong>${row}</strong> selected as header. Columns: <code>${this._escapeHtml(preview)}</code>. Rows before it will be skipped.`;
|
|
343
|
-
} else {
|
|
344
|
-
hintDiv.innerHTML = `Sheet row <strong>${row}</strong> (first row) selected as header. Columns: <code>${this._escapeHtml(preview)}</code>`;
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
const renderPreview = (selected: number) => {
|
|
349
|
-
if (!previewDiv) return;
|
|
350
|
-
previewDiv.innerHTML = this._buildClickablePreviewHTML(rawRows, selected);
|
|
351
|
-
|
|
352
|
-
previewDiv.querySelectorAll('tr[data-sheet-row]').forEach(tr => {
|
|
353
|
-
tr.addEventListener('click', () => {
|
|
354
|
-
const rowIdx = parseInt((tr as HTMLElement).dataset.sheetRow!);
|
|
355
|
-
hiddenInput.value = String(rowIdx);
|
|
356
|
-
updateHint(rowIdx);
|
|
357
|
-
renderPreview(rowIdx);
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
updateHint(selectedSheetRow);
|
|
363
|
-
renderPreview(selectedSheetRow);
|
|
364
|
-
this._modal.open();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
private _showCSVModal(rawFileData: RawFileData, callbacks: ImportSettingsCallbacks): void {
|
|
368
|
-
if (!rawFileData.text) return;
|
|
369
|
-
|
|
370
|
-
this.cleanup();
|
|
371
|
-
|
|
372
|
-
const text = rawFileData.text;
|
|
373
|
-
const detected = (this._driver as any)._detectDelimiter(text);
|
|
374
|
-
|
|
375
|
-
const lines = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
|
|
376
|
-
const rawRows: { sheetRow: number; values: any[] }[] = [];
|
|
377
|
-
const maxPreviewRows = Math.min(lines.length, 15);
|
|
378
|
-
|
|
379
|
-
for (let i = 0; i < maxPreviewRows; i++) {
|
|
380
|
-
if (!lines[i]) {
|
|
381
|
-
rawRows.push({ sheetRow: i, values: [''] });
|
|
382
|
-
continue;
|
|
383
|
-
}
|
|
384
|
-
const values = (this._driver as any)._parseLine(lines[i], detected);
|
|
385
|
-
rawRows.push({ sheetRow: i, values });
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// Auto-detect header row
|
|
389
|
-
let selectedRow = 0;
|
|
390
|
-
for (const { sheetRow, values } of rawRows) {
|
|
391
|
-
const nonEmpty = values.filter((v: string) => v.trim() !== '');
|
|
392
|
-
if (nonEmpty.length < values.length * 0.5) continue;
|
|
393
|
-
const nonNumeric = nonEmpty.filter((v: string) => {
|
|
394
|
-
const trimmed = v.trim();
|
|
395
|
-
return isNaN(Number(trimmed)) && trimmed !== '';
|
|
396
|
-
}).length;
|
|
397
|
-
if (nonNumeric >= nonEmpty.length * 0.7) {
|
|
398
|
-
selectedRow = sheetRow;
|
|
399
|
-
break;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
this._modal = new Modal(`${this._id}-reshape-modal`, {
|
|
404
|
-
title: 'CSV Import Settings',
|
|
405
|
-
size: 'large',
|
|
406
|
-
close: true,
|
|
407
|
-
backdropClose: false
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
const modalContentHTML = `
|
|
411
|
-
<div style="margin-bottom: 1rem;">
|
|
412
|
-
<label style="display: block; font-weight: 600; margin-bottom: 0.5rem;">Delimiter</label>
|
|
413
|
-
<select id="${this._id}-delimiter" class="jux-input-element" style="width: 100%;">
|
|
414
|
-
<option value=",">Comma (,)</option>
|
|
415
|
-
<option value="|">Pipe (|)</option>
|
|
416
|
-
<option value="	">Tab (\\t)</option>
|
|
417
|
-
<option value=";">Semicolon (;)</option>
|
|
418
|
-
</select>
|
|
419
|
-
</div>
|
|
420
|
-
<div style="margin-bottom: 1rem;">
|
|
421
|
-
<div id="${this._id}-reshape-hint" style="padding: 0.75rem; background: hsl(var(--muted) / 0.5); border-radius: var(--radius); font-size: 0.875rem;"></div>
|
|
422
|
-
<input type="hidden" id="${this._id}-header-row" value="${selectedRow}" />
|
|
423
|
-
</div>
|
|
424
|
-
<div>
|
|
425
|
-
<div style="font-weight: 600; margin-bottom: 0.5rem; color: hsl(var(--foreground));">Click a row to select it as the header:</div>
|
|
426
|
-
<div id="${this._id}-preview" style="font-family: monospace; font-size: 12px; background: hsl(var(--muted) / 0.3); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 0; overflow: hidden; max-height: 400px; overflow-y: auto;"></div>
|
|
427
|
-
</div>
|
|
428
|
-
`;
|
|
429
|
-
|
|
430
|
-
this._modal
|
|
431
|
-
.content(modalContentHTML)
|
|
432
|
-
.actions([
|
|
433
|
-
{
|
|
434
|
-
label: 'Cancel',
|
|
435
|
-
variant: 'secondary',
|
|
436
|
-
click: () => this._modal!.closeModal()
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
label: 'Apply & Re-import',
|
|
440
|
-
variant: 'primary',
|
|
441
|
-
click: async () => {
|
|
442
|
-
const delimiterSelect = document.getElementById(`${this._id}-delimiter`) as HTMLSelectElement;
|
|
443
|
-
const hiddenInput = document.getElementById(`${this._id}-header-row`) as HTMLInputElement;
|
|
444
|
-
|
|
445
|
-
const delim = delimiterSelect.value;
|
|
446
|
-
const headerRow = parseInt(hiddenInput.value) || 0;
|
|
447
|
-
|
|
448
|
-
callbacks.onStatusUpdate('Re-parsing with new settings...', 'loading');
|
|
449
|
-
|
|
450
|
-
try {
|
|
451
|
-
const df = this._driver.parseCSV(rawFileData.text!, {
|
|
452
|
-
delimiter: delim,
|
|
453
|
-
headerRow,
|
|
454
|
-
hasHeader: true
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
await this._driver.store(rawFileData.file.name, df, { source: rawFileData.file.name });
|
|
458
|
-
callbacks.onReimport(df, rawFileData.file.name);
|
|
459
|
-
this._modal!.closeModal();
|
|
460
|
-
} catch (err: any) {
|
|
461
|
-
callbacks.onError(`Error: ${err.message}`);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
]);
|
|
466
|
-
|
|
467
|
-
this._modal.render(document.body);
|
|
468
|
-
this._modalRendered = true;
|
|
469
|
-
|
|
470
|
-
requestAnimationFrame(() => {
|
|
471
|
-
const delimiterSelect = document.getElementById(`${this._id}-delimiter`) as HTMLSelectElement;
|
|
472
|
-
const previewDiv = document.getElementById(`${this._id}-preview`)!;
|
|
473
|
-
const hintDiv = document.getElementById(`${this._id}-reshape-hint`)!;
|
|
474
|
-
const hiddenInput = document.getElementById(`${this._id}-header-row`) as HTMLInputElement;
|
|
475
|
-
|
|
476
|
-
if (delimiterSelect) delimiterSelect.value = detected;
|
|
477
|
-
|
|
478
|
-
const updateHint = (row: number) => {
|
|
479
|
-
if (!hintDiv) return;
|
|
480
|
-
const vals = rawRows.find(r => r.sheetRow === row)?.values ?? [];
|
|
481
|
-
const headerNames = vals.filter((v: any) => v != null && String(v).trim() !== '').map((v: any) => String(v).trim());
|
|
482
|
-
const preview = headerNames.slice(0, 4).join(', ') + (headerNames.length > 4 ? '…' : '');
|
|
483
|
-
if (row > rawRows[0].sheetRow) {
|
|
484
|
-
hintDiv.innerHTML = `Sheet row <strong>${row}</strong> selected as header. Columns: <code>${this._escapeHtml(preview)}</code>. Rows before it will be skipped.`;
|
|
485
|
-
} else {
|
|
486
|
-
hintDiv.innerHTML = `Sheet row <strong>${row}</strong> (first row) selected as header. Columns: <code>${this._escapeHtml(preview)}</code>`;
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
const reparse = () => {
|
|
491
|
-
const delim = delimiterSelect?.value || ',';
|
|
492
|
-
rawRows.length = 0;
|
|
493
|
-
for (let i = 0; i < maxPreviewRows; i++) {
|
|
494
|
-
if (!lines[i]) {
|
|
495
|
-
rawRows.push({ sheetRow: i, values: [''] });
|
|
496
|
-
continue;
|
|
497
|
-
}
|
|
498
|
-
const values = (this._driver as any)._parseLine(lines[i], delim);
|
|
499
|
-
rawRows.push({ sheetRow: i, values });
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
const renderPreview = (selected: number) => {
|
|
504
|
-
if (!previewDiv) return;
|
|
505
|
-
previewDiv.innerHTML = this._buildClickablePreviewHTML(rawRows, selected);
|
|
506
|
-
|
|
507
|
-
previewDiv.querySelectorAll('tr[data-sheet-row]').forEach(tr => {
|
|
508
|
-
tr.addEventListener('click', () => {
|
|
509
|
-
const rowIdx = parseInt((tr as HTMLElement).dataset.sheetRow!);
|
|
510
|
-
hiddenInput.value = String(rowIdx);
|
|
511
|
-
updateHint(rowIdx);
|
|
512
|
-
renderPreview(rowIdx);
|
|
513
|
-
});
|
|
514
|
-
});
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
if (delimiterSelect) {
|
|
518
|
-
delimiterSelect.addEventListener('change', () => {
|
|
519
|
-
reparse();
|
|
520
|
-
const current = parseInt(hiddenInput.value) || 0;
|
|
521
|
-
updateHint(current);
|
|
522
|
-
renderPreview(current);
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
updateHint(selectedRow);
|
|
527
|
-
renderPreview(selectedRow);
|
|
528
|
-
this._modal!.open();
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { BaseComponent, BaseState } from './base/BaseComponent.js';
|
|
2
|
-
import { DataFrame } from '../storage/DataFrame.js';
|
|
3
|
-
import { FileUpload } from './fileupload.js';
|
|
4
|
-
import { Table } from './table.js';
|
|
5
|
-
import { DataFrameSource } from './dataframe/DataFrameSource.js';
|
|
6
|
-
export interface DataFrameOptions {
|
|
7
|
-
maxFileSize?: number;
|
|
8
|
-
maxSheetSize?: number;
|
|
9
|
-
sheetChunkSize?: number;
|
|
10
|
-
persistToIndexedDB?: boolean;
|
|
11
|
-
dbName?: string;
|
|
12
|
-
storeName?: string;
|
|
13
|
-
striped?: boolean;
|
|
14
|
-
hoverable?: boolean;
|
|
15
|
-
sortable?: boolean;
|
|
16
|
-
filterable?: boolean;
|
|
17
|
-
paginated?: boolean;
|
|
18
|
-
rowsPerPage?: number;
|
|
19
|
-
style?: string;
|
|
20
|
-
class?: string;
|
|
21
|
-
}
|
|
22
|
-
type DataFrameState = BaseState & {
|
|
23
|
-
loaded: boolean;
|
|
24
|
-
sourceName: string;
|
|
25
|
-
rowCount: number;
|
|
26
|
-
colCount: number;
|
|
27
|
-
};
|
|
28
|
-
export declare class DataFrameComponent extends BaseComponent<DataFrameState> {
|
|
29
|
-
private _source;
|
|
30
|
-
private _table;
|
|
31
|
-
private _tabs;
|
|
32
|
-
private _uploadRef;
|
|
33
|
-
private _importModal;
|
|
34
|
-
private _tableOptions;
|
|
35
|
-
private _inlineUpload;
|
|
36
|
-
private _uploadButtonLabel;
|
|
37
|
-
private _uploadButtonIcon;
|
|
38
|
-
private _uploadButtonVariant;
|
|
39
|
-
private _uploadAccept;
|
|
40
|
-
private _uploadDescription;
|
|
41
|
-
private _showUploadIcon;
|
|
42
|
-
private _pendingSource;
|
|
43
|
-
constructor(id: string, options?: DataFrameOptions);
|
|
44
|
-
protected getTriggerEvents(): readonly string[];
|
|
45
|
-
protected getCallbackEvents(): readonly string[];
|
|
46
|
-
/**
|
|
47
|
-
* Load from IndexedDB storage
|
|
48
|
-
*/
|
|
49
|
-
fromStorage(key: string): this;
|
|
50
|
-
/**
|
|
51
|
-
* Load from a FileUpload component
|
|
52
|
-
*/
|
|
53
|
-
fromUpload(upload: FileUpload): this;
|
|
54
|
-
/**
|
|
55
|
-
* Load from inline data
|
|
56
|
-
*/
|
|
57
|
-
fromData(data: Record<string, any>[] | Record<string, any[]>): this;
|
|
58
|
-
/**
|
|
59
|
-
* Load from a URL
|
|
60
|
-
*/
|
|
61
|
-
fromUrl(url: string): this;
|
|
62
|
-
/**
|
|
63
|
-
* Enable inline file upload UI
|
|
64
|
-
*/
|
|
65
|
-
withUpload(label?: string, accept?: string, icon?: string): this;
|
|
66
|
-
uploadLabel(label: string): this;
|
|
67
|
-
uploadIcon(icon: string): this;
|
|
68
|
-
uploadVariant(variant: string): this;
|
|
69
|
-
uploadAccept(accept: string): this;
|
|
70
|
-
uploadDescription(description: string): this;
|
|
71
|
-
showUploadIcon(show: boolean): this;
|
|
72
|
-
striped(v: boolean): this;
|
|
73
|
-
hoverable(v: boolean): this;
|
|
74
|
-
sortable(v: boolean): this;
|
|
75
|
-
filterable(v: boolean): this;
|
|
76
|
-
paginated(v: boolean): this;
|
|
77
|
-
rowsPerPage(v: number): this;
|
|
78
|
-
get df(): DataFrame | null;
|
|
79
|
-
get source(): DataFrameSource;
|
|
80
|
-
get table(): Table | null;
|
|
81
|
-
get shape(): [number, number];
|
|
82
|
-
get columns(): string[];
|
|
83
|
-
toRows(): Record<string, any>[];
|
|
84
|
-
toCSV(delimiter?: string): string;
|
|
85
|
-
describe(): Record<string, any> | null;
|
|
86
|
-
save(key?: string): Promise<string | null>;
|
|
87
|
-
apply(fn: (df: DataFrame) => DataFrame): this;
|
|
88
|
-
filter(predicate: (row: Record<string, any>, index: number) => boolean): this;
|
|
89
|
-
select(...cols: string[]): this;
|
|
90
|
-
sort(col: string, descending?: boolean): this;
|
|
91
|
-
head(n?: number): this;
|
|
92
|
-
tail(n?: number): this;
|
|
93
|
-
clear(): Promise<this>;
|
|
94
|
-
private _handleLoadResult;
|
|
95
|
-
private _handleError;
|
|
96
|
-
private _handleProgress;
|
|
97
|
-
private _renderSingleSheet;
|
|
98
|
-
private _renderMultiSheet;
|
|
99
|
-
private _updateStatus;
|
|
100
|
-
private _showDataView;
|
|
101
|
-
private _hideDataView;
|
|
102
|
-
private _updateSettingsGear;
|
|
103
|
-
private _showSettingsModal;
|
|
104
|
-
private _showImportSettings;
|
|
105
|
-
update(_prop: string, _value: any): void;
|
|
106
|
-
render(targetId?: string | HTMLElement | BaseComponent<any>): this;
|
|
107
|
-
}
|
|
108
|
-
export declare function dataframe(id: string, options?: DataFrameOptions): DataFrameComponent;
|
|
109
|
-
export {};
|
|
110
|
-
//# sourceMappingURL=dataframe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,eAAe,EAA+B,MAAM,gCAAgC,CAAC;AAM9F,MAAM,WAAW,gBAAgB;IAE7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC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