juxscript 1.1.37 → 1.1.39
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/tabs.d.ts.map +1 -1
- package/lib/components/tabs.js +11 -13
- package/lib/components/tabs.ts +15 -17
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMnE,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,SAAS,GAAG,SAAS,GAAG;IAC3B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,IAAK,SAAQ,aAAa,CAAC,SAAS,CAAC;IAChD,OAAO,CAAC,YAAY,CAA4B;gBAEpC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;IAUjD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAQhD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IA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KtB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW9B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9B,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,IAAI;IAKvD;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAqB3E;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS;IAItC;;OAEG;IACH,aAAa,IAAI,GAAG,GAAG,SAAS;IAQhC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;CA+EnE;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CAEhE"}
|
package/lib/components/tabs.js
CHANGED
|
@@ -104,17 +104,15 @@ export class Tabs extends BaseComponent {
|
|
|
104
104
|
else {
|
|
105
105
|
tabPanel.style.display = 'none';
|
|
106
106
|
}
|
|
107
|
-
// ✅
|
|
107
|
+
// ✅ Append panel to DOM FIRST
|
|
108
|
+
tabPanels.appendChild(tabPanel);
|
|
109
|
+
// THEN render content into it
|
|
108
110
|
if (typeof tab.content === 'string') {
|
|
109
111
|
tabPanel.innerHTML = tab.content;
|
|
110
112
|
}
|
|
111
113
|
else if (tab.content instanceof BaseComponent) {
|
|
112
|
-
// Component needs to be appended after panel is in DOM
|
|
113
|
-
tabPanels.appendChild(tabPanel);
|
|
114
114
|
tab.content.render(`#${tabPanel.id}`);
|
|
115
|
-
return; // Skip the second appendChild below
|
|
116
115
|
}
|
|
117
|
-
tabPanels.appendChild(tabPanel);
|
|
118
116
|
});
|
|
119
117
|
}
|
|
120
118
|
/* ═════════════════════════════════════════════════════════════════
|
|
@@ -194,6 +192,10 @@ export class Tabs extends BaseComponent {
|
|
|
194
192
|
tabList.className = 'jux-tabs-list';
|
|
195
193
|
const tabPanels = document.createElement('div');
|
|
196
194
|
tabPanels.className = 'jux-tabs-panels';
|
|
195
|
+
// ✅ Append structure to DOM FIRST, then render content
|
|
196
|
+
wrapper.appendChild(tabList);
|
|
197
|
+
wrapper.appendChild(tabPanels);
|
|
198
|
+
container.appendChild(wrapper);
|
|
197
199
|
tabs.forEach(tab => {
|
|
198
200
|
// Tab button with unique ID
|
|
199
201
|
const tabButton = document.createElement('button');
|
|
@@ -226,23 +228,19 @@ export class Tabs extends BaseComponent {
|
|
|
226
228
|
else {
|
|
227
229
|
tabPanel.style.display = 'none';
|
|
228
230
|
}
|
|
229
|
-
// ✅
|
|
231
|
+
// ✅ Append panel to DOM FIRST
|
|
232
|
+
tabPanels.appendChild(tabPanel);
|
|
233
|
+
// ✅ THEN render content into it (panel is now in DOM)
|
|
230
234
|
if (typeof tab.content === 'string') {
|
|
231
235
|
tabPanel.innerHTML = tab.content;
|
|
232
236
|
}
|
|
233
237
|
else if (tab.content instanceof BaseComponent) {
|
|
234
|
-
//
|
|
235
|
-
tabPanels.appendChild(tabPanel);
|
|
238
|
+
// Now panel exists in DOM, so render() can find it
|
|
236
239
|
tab.content.render(`#${tabPanel.id}`);
|
|
237
|
-
return; // Skip the second appendChild below
|
|
238
240
|
}
|
|
239
|
-
tabPanels.appendChild(tabPanel);
|
|
240
241
|
});
|
|
241
|
-
wrapper.appendChild(tabList);
|
|
242
|
-
wrapper.appendChild(tabPanels);
|
|
243
242
|
this._wireStandardEvents(wrapper);
|
|
244
243
|
this._wireAllSyncs();
|
|
245
|
-
container.appendChild(wrapper);
|
|
246
244
|
this._tabsWrapper = wrapper;
|
|
247
245
|
return this;
|
|
248
246
|
}
|
package/lib/components/tabs.ts
CHANGED
|
@@ -7,7 +7,7 @@ const CALLBACK_EVENTS = ['tabChange'] as const;
|
|
|
7
7
|
export interface Tab {
|
|
8
8
|
id: string;
|
|
9
9
|
label: string;
|
|
10
|
-
content: string | BaseComponent<any>;
|
|
10
|
+
content: string | BaseComponent<any>;
|
|
11
11
|
icon?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -147,17 +147,15 @@ export class Tabs extends BaseComponent<TabsState> {
|
|
|
147
147
|
tabPanel.style.display = 'none';
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
// ✅
|
|
150
|
+
// ✅ Append panel to DOM FIRST
|
|
151
|
+
tabPanels.appendChild(tabPanel);
|
|
152
|
+
|
|
153
|
+
// THEN render content into it
|
|
151
154
|
if (typeof tab.content === 'string') {
|
|
152
155
|
tabPanel.innerHTML = tab.content;
|
|
153
156
|
} else if (tab.content instanceof BaseComponent) {
|
|
154
|
-
// Component needs to be appended after panel is in DOM
|
|
155
|
-
tabPanels.appendChild(tabPanel);
|
|
156
157
|
tab.content.render(`#${tabPanel.id}`);
|
|
157
|
-
return; // Skip the second appendChild below
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
tabPanels.appendChild(tabPanel);
|
|
161
159
|
});
|
|
162
160
|
}
|
|
163
161
|
|
|
@@ -254,6 +252,11 @@ export class Tabs extends BaseComponent<TabsState> {
|
|
|
254
252
|
const tabPanels = document.createElement('div');
|
|
255
253
|
tabPanels.className = 'jux-tabs-panels';
|
|
256
254
|
|
|
255
|
+
// ✅ Append structure to DOM FIRST, then render content
|
|
256
|
+
wrapper.appendChild(tabList);
|
|
257
|
+
wrapper.appendChild(tabPanels);
|
|
258
|
+
container.appendChild(wrapper);
|
|
259
|
+
|
|
257
260
|
tabs.forEach(tab => {
|
|
258
261
|
// Tab button with unique ID
|
|
259
262
|
const tabButton = document.createElement('button');
|
|
@@ -293,26 +296,21 @@ export class Tabs extends BaseComponent<TabsState> {
|
|
|
293
296
|
tabPanel.style.display = 'none';
|
|
294
297
|
}
|
|
295
298
|
|
|
296
|
-
// ✅
|
|
299
|
+
// ✅ Append panel to DOM FIRST
|
|
300
|
+
tabPanels.appendChild(tabPanel);
|
|
301
|
+
|
|
302
|
+
// ✅ THEN render content into it (panel is now in DOM)
|
|
297
303
|
if (typeof tab.content === 'string') {
|
|
298
304
|
tabPanel.innerHTML = tab.content;
|
|
299
305
|
} else if (tab.content instanceof BaseComponent) {
|
|
300
|
-
//
|
|
301
|
-
tabPanels.appendChild(tabPanel);
|
|
306
|
+
// Now panel exists in DOM, so render() can find it
|
|
302
307
|
tab.content.render(`#${tabPanel.id}`);
|
|
303
|
-
return; // Skip the second appendChild below
|
|
304
308
|
}
|
|
305
|
-
|
|
306
|
-
tabPanels.appendChild(tabPanel);
|
|
307
309
|
});
|
|
308
310
|
|
|
309
|
-
wrapper.appendChild(tabList);
|
|
310
|
-
wrapper.appendChild(tabPanels);
|
|
311
|
-
|
|
312
311
|
this._wireStandardEvents(wrapper);
|
|
313
312
|
this._wireAllSyncs();
|
|
314
313
|
|
|
315
|
-
container.appendChild(wrapper);
|
|
316
314
|
this._tabsWrapper = wrapper;
|
|
317
315
|
|
|
318
316
|
return this;
|