juxscript 1.1.215 → 1.1.217
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/lib/components/dataframe.d.ts.map +1 -1
- package/lib/components/dataframe.js +7 -1
- package/lib/components/dataframe.ts +8 -1
- package/lib/components/table.d.ts.map +1 -1
- package/lib/components/table.js +56 -101
- package/lib/components/table.ts +91 -133
- package/lib/components/tabs.d.ts +2 -3
- package/lib/components/tabs.d.ts.map +1 -1
- package/lib/components/tabs.js +6 -9
- package/lib/components/tabs.ts +7 -11
- package/package.json +1 -1
package/lib/components/tabs.js
CHANGED
|
@@ -111,6 +111,7 @@ export class Tabs extends BaseComponent {
|
|
|
111
111
|
tabPanel.innerHTML = tab.content;
|
|
112
112
|
}
|
|
113
113
|
else if (tab.content instanceof BaseComponent) {
|
|
114
|
+
// Now panel exists in DOM, so render() can find it
|
|
114
115
|
tab.content.render(`#${tabPanel.id}`);
|
|
115
116
|
}
|
|
116
117
|
});
|
|
@@ -164,8 +165,7 @@ export class Tabs extends BaseComponent {
|
|
|
164
165
|
return this;
|
|
165
166
|
}
|
|
166
167
|
/**
|
|
167
|
-
*
|
|
168
|
-
* Accepts single item or array of strings/BaseComponents
|
|
168
|
+
* Add content to a specific tab panel
|
|
169
169
|
*/
|
|
170
170
|
addTabContent(tabId, content) {
|
|
171
171
|
const panel = document.getElementById(`${this._id}-${tabId}-panel`);
|
|
@@ -173,20 +173,17 @@ export class Tabs extends BaseComponent {
|
|
|
173
173
|
console.warn(`[Tabs] Panel not found for tab: ${tabId}`);
|
|
174
174
|
return this;
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
const items = Array.isArray(content) ? content : [content];
|
|
178
|
-
items.forEach(item => {
|
|
176
|
+
content.forEach(item => {
|
|
179
177
|
if (typeof item === 'string') {
|
|
180
|
-
// Append HTML string
|
|
181
178
|
const tempDiv = document.createElement('div');
|
|
182
179
|
tempDiv.innerHTML = item;
|
|
183
180
|
while (tempDiv.firstChild) {
|
|
184
181
|
panel.appendChild(tempDiv.firstChild);
|
|
185
182
|
}
|
|
186
183
|
}
|
|
187
|
-
else if (item
|
|
188
|
-
// Render component into panel
|
|
189
|
-
item.render(
|
|
184
|
+
else if (item && typeof item.render === 'function') {
|
|
185
|
+
// ✅ Render the component into the panel
|
|
186
|
+
item.render(panel);
|
|
190
187
|
}
|
|
191
188
|
});
|
|
192
189
|
return this;
|
package/lib/components/tabs.ts
CHANGED
|
@@ -154,6 +154,7 @@ export class Tabs extends BaseComponent<TabsState> {
|
|
|
154
154
|
if (typeof tab.content === 'string') {
|
|
155
155
|
tabPanel.innerHTML = tab.content;
|
|
156
156
|
} else if (tab.content instanceof BaseComponent) {
|
|
157
|
+
// Now panel exists in DOM, so render() can find it
|
|
157
158
|
tab.content.render(`#${tabPanel.id}`);
|
|
158
159
|
}
|
|
159
160
|
});
|
|
@@ -219,30 +220,25 @@ export class Tabs extends BaseComponent<TabsState> {
|
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
/**
|
|
222
|
-
*
|
|
223
|
-
* Accepts single item or array of strings/BaseComponents
|
|
223
|
+
* Add content to a specific tab panel
|
|
224
224
|
*/
|
|
225
|
-
addTabContent(tabId: string, content: string | BaseComponent<any>
|
|
225
|
+
addTabContent(tabId: string, content: (string | BaseComponent<any>)[]): this {
|
|
226
226
|
const panel = document.getElementById(`${this._id}-${tabId}-panel`);
|
|
227
227
|
if (!panel) {
|
|
228
228
|
console.warn(`[Tabs] Panel not found for tab: ${tabId}`);
|
|
229
229
|
return this;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
const items = Array.isArray(content) ? content : [content];
|
|
234
|
-
|
|
235
|
-
items.forEach(item => {
|
|
232
|
+
content.forEach(item => {
|
|
236
233
|
if (typeof item === 'string') {
|
|
237
|
-
// Append HTML string
|
|
238
234
|
const tempDiv = document.createElement('div');
|
|
239
235
|
tempDiv.innerHTML = item;
|
|
240
236
|
while (tempDiv.firstChild) {
|
|
241
237
|
panel.appendChild(tempDiv.firstChild);
|
|
242
238
|
}
|
|
243
|
-
} else if (item
|
|
244
|
-
// Render component into panel
|
|
245
|
-
item.render(
|
|
239
|
+
} else if (item && typeof item.render === 'function') {
|
|
240
|
+
// ✅ Render the component into the panel
|
|
241
|
+
item.render(panel);
|
|
246
242
|
}
|
|
247
243
|
});
|
|
248
244
|
|