juxscript 1.1.90 → 1.1.92
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/dom-structure-map.json +1 -1
- package/lib/components/stack/BaseStack.d.ts +5 -35
- package/lib/components/stack/BaseStack.d.ts.map +1 -1
- package/lib/components/stack/BaseStack.js +60 -184
- package/lib/components/stack/BaseStack.ts +62 -222
- package/lib/components/stack/HStack.d.ts +0 -8
- package/lib/components/stack/HStack.d.ts.map +1 -1
- package/lib/components/stack/HStack.js +0 -8
- package/lib/components/stack/HStack.ts +0 -8
- package/lib/components/stack/VStack.d.ts +0 -5
- package/lib/components/stack/VStack.d.ts.map +1 -1
- package/lib/components/stack/VStack.js +1 -7
- package/lib/components/stack/VStack.ts +1 -7
- package/lib/components/stack/ZStack.d.ts +0 -8
- package/lib/components/stack/ZStack.d.ts.map +1 -1
- package/lib/components/stack/ZStack.js +0 -8
- package/lib/components/stack/ZStack.ts +0 -8
- package/machinery/compiler3.js +282 -113
- package/package.json +1 -1
package/dom-structure-map.json
CHANGED
|
@@ -22,7 +22,6 @@ interface StackState extends BaseState {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* BaseStack - Foundation for all stack layout components
|
|
25
|
-
* Provides common styling, child management, and progressive effects
|
|
26
25
|
*/
|
|
27
26
|
export declare abstract class BaseStack extends BaseComponent<StackState> {
|
|
28
27
|
protected abstract baseClassName: string;
|
|
@@ -35,13 +34,7 @@ export declare abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
35
34
|
justify(value: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'): this;
|
|
36
35
|
divider(value?: boolean): this;
|
|
37
36
|
responsive(value?: boolean): this;
|
|
38
|
-
/**
|
|
39
|
-
* Internal helper to add individual CSS properties
|
|
40
|
-
*/
|
|
41
37
|
private _addStyle;
|
|
42
|
-
/**
|
|
43
|
-
* Build and apply the complete style attribute
|
|
44
|
-
*/
|
|
45
38
|
private _updateStyleAttribute;
|
|
46
39
|
padding(value: string): this;
|
|
47
40
|
margin(value: string): this;
|
|
@@ -57,53 +50,30 @@ export declare abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
57
50
|
backgroundColor(value: string): this;
|
|
58
51
|
boxShadow(value: string): this;
|
|
59
52
|
opacity(value: string | number): this;
|
|
60
|
-
position(value:
|
|
53
|
+
position(value: string): this;
|
|
61
54
|
top(value: string): this;
|
|
62
55
|
right(value: string): this;
|
|
63
56
|
bottom(value: string): this;
|
|
64
57
|
left(value: string): this;
|
|
65
58
|
zIndex(value: string | number): this;
|
|
66
|
-
overflow(value:
|
|
67
|
-
overflowX(value:
|
|
68
|
-
overflowY(value:
|
|
59
|
+
overflow(value: string): this;
|
|
60
|
+
overflowX(value: string): this;
|
|
61
|
+
overflowY(value: string): this;
|
|
69
62
|
display(value: string): this;
|
|
70
63
|
cursor(value: string): this;
|
|
71
64
|
transform(value: string): this;
|
|
72
65
|
transformOrigin(value: string): this;
|
|
73
66
|
transition(value: string): this;
|
|
74
67
|
animation(value: string): this;
|
|
75
|
-
/**
|
|
76
|
-
* Apply custom styles to each child progressively
|
|
77
|
-
*/
|
|
78
68
|
childStyle(stylesOrFunction: string[] | ChildStyleFunction): this;
|
|
79
|
-
/**
|
|
80
|
-
* Cascade effect - offset children progressively
|
|
81
|
-
*/
|
|
82
69
|
cascade(baseOffset?: number, axis?: 'x' | 'y' | 'both' | 'horizontal' | 'vertical' | 'xy'): this;
|
|
83
|
-
/**
|
|
84
|
-
* Fan effect - rotate children progressively
|
|
85
|
-
*/
|
|
86
70
|
fan(angle?: number, origin?: string): this;
|
|
87
|
-
/**
|
|
88
|
-
* Scale progression - shrink/grow children
|
|
89
|
-
*/
|
|
90
71
|
scaleProgressive(startScale?: number, step?: number, origin?: string): this;
|
|
91
|
-
/**
|
|
92
|
-
* Fade effect - progressive opacity
|
|
93
|
-
*/
|
|
94
72
|
fade(startOpacity?: number, step?: number): this;
|
|
95
|
-
/**
|
|
96
|
-
* Blur effect - progressive blur
|
|
97
|
-
*/
|
|
98
73
|
blur(startBlur?: number, step?: number): this;
|
|
99
|
-
/**
|
|
100
|
-
* Stagger animation delays
|
|
101
|
-
*/
|
|
102
74
|
stagger(baseDelay?: number): this;
|
|
103
75
|
protected buildClasses(): string;
|
|
104
|
-
protected renderChild(child: any, index: number):
|
|
105
|
-
private wrapChildWithStyle;
|
|
106
|
-
private injectChildStyle;
|
|
76
|
+
protected renderChild(child: any, index: number): HTMLElement;
|
|
107
77
|
private getChildStyle;
|
|
108
78
|
render(targetId?: string | HTMLElement | BaseComponent<any>): this;
|
|
109
79
|
update(prop: string, value: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStack.d.ts","sourceRoot":"","sources":["BaseStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAMpE,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACjD,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAC/B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,UAAW,SAAQ,SAAS;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;I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GAAE,MAAa,EAAE,MAAM,GAAE,MAAiB,GAAG,IAAI;IAQ9F,IAAI,CAAC,YAAY,GAAE,MAAU,EAAE,IAAI,GAAE,MAAa,GAAG,IAAI;IAQzD,IAAI,CAAC,SAAS,GAAE,MAAU,EAAE,IAAI,GAAE,MAAU,GAAG,IAAI;IAQnD,OAAO,CAAC,SAAS,GAAE,MAAY,GAAG,IAAI;IAYtC,SAAS,CAAC,YAAY,IAAI,MAAM;IAgChC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW;IAkC7D,OAAO,CAAC,aAAa;IAoBrB,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAuBlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGzC"}
|
|
@@ -4,11 +4,9 @@ const TRIGGER_EVENTS = [];
|
|
|
4
4
|
const CALLBACK_EVENTS = [];
|
|
5
5
|
/**
|
|
6
6
|
* BaseStack - Foundation for all stack layout components
|
|
7
|
-
* Provides common styling, child management, and progressive effects
|
|
8
7
|
*/
|
|
9
8
|
export class BaseStack extends BaseComponent {
|
|
10
9
|
constructor(id, children, options = {}) {
|
|
11
|
-
// Convert children object to array, preserving order
|
|
12
10
|
const childArray = Array.isArray(children)
|
|
13
11
|
? children
|
|
14
12
|
: Object.values(children);
|
|
@@ -27,7 +25,7 @@ export class BaseStack extends BaseComponent {
|
|
|
27
25
|
children: childArray,
|
|
28
26
|
childStyles: undefined
|
|
29
27
|
});
|
|
30
|
-
this._inlineStyles = new Map();
|
|
28
|
+
this._inlineStyles = new Map();
|
|
31
29
|
}
|
|
32
30
|
getTriggerEvents() {
|
|
33
31
|
return TRIGGER_EVENTS;
|
|
@@ -59,134 +57,55 @@ export class BaseStack extends BaseComponent {
|
|
|
59
57
|
return this;
|
|
60
58
|
}
|
|
61
59
|
/* ═════════════════════════════════════════════════════════════════
|
|
62
|
-
* FLUENT STYLE API
|
|
60
|
+
* FLUENT STYLE API
|
|
63
61
|
* ═════════════════════════════════════════════════════════════════ */
|
|
64
|
-
/**
|
|
65
|
-
* Internal helper to add individual CSS properties
|
|
66
|
-
*/
|
|
67
62
|
_addStyle(property, value) {
|
|
68
|
-
this._inlineStyles.set(property, value);
|
|
69
|
-
this._updateStyleAttribute();
|
|
63
|
+
this._inlineStyles.set(property, value);
|
|
64
|
+
this._updateStyleAttribute();
|
|
70
65
|
return this;
|
|
71
66
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Build and apply the complete style attribute
|
|
74
|
-
*/
|
|
75
67
|
_updateStyleAttribute() {
|
|
76
|
-
const styleString = Array.from(this._inlineStyles.entries())
|
|
77
|
-
.map(([prop, val]) => `${prop}: ${val}`)
|
|
78
|
-
.join('; ');
|
|
68
|
+
const styleString = Array.from(this._inlineStyles.entries())
|
|
69
|
+
.map(([prop, val]) => `${prop}: ${val}`)
|
|
70
|
+
.join('; ');
|
|
79
71
|
this.state.style = styleString;
|
|
80
72
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
maxHeight(value) {
|
|
111
|
-
return this._addStyle('max-height', value);
|
|
112
|
-
}
|
|
113
|
-
// Visual
|
|
114
|
-
background(value) {
|
|
115
|
-
return this._addStyle('background', value);
|
|
116
|
-
}
|
|
117
|
-
backgroundColor(value) {
|
|
118
|
-
return this._addStyle('background-color', value);
|
|
119
|
-
}
|
|
120
|
-
boxShadow(value) {
|
|
121
|
-
return this._addStyle('box-shadow', value);
|
|
122
|
-
}
|
|
123
|
-
opacity(value) {
|
|
124
|
-
return this._addStyle('opacity', String(value));
|
|
125
|
-
}
|
|
126
|
-
// Positioning
|
|
127
|
-
position(value) {
|
|
128
|
-
return this._addStyle('position', value);
|
|
129
|
-
}
|
|
130
|
-
top(value) {
|
|
131
|
-
return this._addStyle('top', value);
|
|
132
|
-
}
|
|
133
|
-
right(value) {
|
|
134
|
-
return this._addStyle('right', value);
|
|
135
|
-
}
|
|
136
|
-
bottom(value) {
|
|
137
|
-
return this._addStyle('bottom', value);
|
|
138
|
-
}
|
|
139
|
-
left(value) {
|
|
140
|
-
return this._addStyle('left', value);
|
|
141
|
-
}
|
|
142
|
-
zIndex(value) {
|
|
143
|
-
return this._addStyle('z-index', String(value));
|
|
144
|
-
}
|
|
145
|
-
// Overflow
|
|
146
|
-
overflow(value) {
|
|
147
|
-
return this._addStyle('overflow', value);
|
|
148
|
-
}
|
|
149
|
-
overflowX(value) {
|
|
150
|
-
return this._addStyle('overflow-x', value);
|
|
151
|
-
}
|
|
152
|
-
overflowY(value) {
|
|
153
|
-
return this._addStyle('overflow-y', value);
|
|
154
|
-
}
|
|
155
|
-
// Display
|
|
156
|
-
display(value) {
|
|
157
|
-
return this._addStyle('display', value);
|
|
158
|
-
}
|
|
159
|
-
// Cursor
|
|
160
|
-
cursor(value) {
|
|
161
|
-
return this._addStyle('cursor', value);
|
|
162
|
-
}
|
|
163
|
-
// Transform
|
|
164
|
-
transform(value) {
|
|
165
|
-
return this._addStyle('transform', value);
|
|
166
|
-
}
|
|
167
|
-
transformOrigin(value) {
|
|
168
|
-
return this._addStyle('transform-origin', value);
|
|
169
|
-
}
|
|
170
|
-
// Transition & Animation
|
|
171
|
-
transition(value) {
|
|
172
|
-
return this._addStyle('transition', value);
|
|
173
|
-
}
|
|
174
|
-
animation(value) {
|
|
175
|
-
return this._addStyle('animation', value);
|
|
176
|
-
}
|
|
73
|
+
padding(value) { return this._addStyle('padding', value); }
|
|
74
|
+
margin(value) { return this._addStyle('margin', value); }
|
|
75
|
+
border(value) { return this._addStyle('border', value); }
|
|
76
|
+
borderRadius(value) { return this._addStyle('border-radius', value); }
|
|
77
|
+
width(value) { return this._addStyle('width', value); }
|
|
78
|
+
height(value) { return this._addStyle('height', value); }
|
|
79
|
+
minWidth(value) { return this._addStyle('min-width', value); }
|
|
80
|
+
maxWidth(value) { return this._addStyle('max-width', value); }
|
|
81
|
+
minHeight(value) { return this._addStyle('min-height', value); }
|
|
82
|
+
maxHeight(value) { return this._addStyle('max-height', value); }
|
|
83
|
+
background(value) { return this._addStyle('background', value); }
|
|
84
|
+
backgroundColor(value) { return this._addStyle('background-color', value); }
|
|
85
|
+
boxShadow(value) { return this._addStyle('box-shadow', value); }
|
|
86
|
+
opacity(value) { return this._addStyle('opacity', String(value)); }
|
|
87
|
+
position(value) { return this._addStyle('position', value); }
|
|
88
|
+
top(value) { return this._addStyle('top', value); }
|
|
89
|
+
right(value) { return this._addStyle('right', value); }
|
|
90
|
+
bottom(value) { return this._addStyle('bottom', value); }
|
|
91
|
+
left(value) { return this._addStyle('left', value); }
|
|
92
|
+
zIndex(value) { return this._addStyle('z-index', String(value)); }
|
|
93
|
+
overflow(value) { return this._addStyle('overflow', value); }
|
|
94
|
+
overflowX(value) { return this._addStyle('overflow-x', value); }
|
|
95
|
+
overflowY(value) { return this._addStyle('overflow-y', value); }
|
|
96
|
+
display(value) { return this._addStyle('display', value); }
|
|
97
|
+
cursor(value) { return this._addStyle('cursor', value); }
|
|
98
|
+
transform(value) { return this._addStyle('transform', value); }
|
|
99
|
+
transformOrigin(value) { return this._addStyle('transform-origin', value); }
|
|
100
|
+
transition(value) { return this._addStyle('transition', value); }
|
|
101
|
+
animation(value) { return this._addStyle('animation', value); }
|
|
177
102
|
/* ═════════════════════════════════════════════════════════════════
|
|
178
103
|
* PROGRESSIVE CHILD STYLING
|
|
179
104
|
* ═════════════════════════════════════════════════════════════════ */
|
|
180
|
-
/**
|
|
181
|
-
* Apply custom styles to each child progressively
|
|
182
|
-
*/
|
|
183
105
|
childStyle(stylesOrFunction) {
|
|
184
106
|
this.state.childStyles = stylesOrFunction;
|
|
185
107
|
return this;
|
|
186
108
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Cascade effect - offset children progressively
|
|
189
|
-
*/
|
|
190
109
|
cascade(baseOffset = 20, axis = 'both') {
|
|
191
110
|
this.state.childStyles = (index) => {
|
|
192
111
|
const offset = baseOffset * index;
|
|
@@ -202,9 +121,6 @@ export class BaseStack extends BaseComponent {
|
|
|
202
121
|
};
|
|
203
122
|
return this;
|
|
204
123
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Fan effect - rotate children progressively
|
|
207
|
-
*/
|
|
208
124
|
fan(angle = 5, origin = 'bottom center') {
|
|
209
125
|
this.state.childStyles = (index) => {
|
|
210
126
|
const rotation = angle * index;
|
|
@@ -212,9 +128,6 @@ export class BaseStack extends BaseComponent {
|
|
|
212
128
|
};
|
|
213
129
|
return this;
|
|
214
130
|
}
|
|
215
|
-
/**
|
|
216
|
-
* Scale progression - shrink/grow children
|
|
217
|
-
*/
|
|
218
131
|
scaleProgressive(startScale = 1, step = 0.05, origin = 'center') {
|
|
219
132
|
this.state.childStyles = (index) => {
|
|
220
133
|
const scale = startScale - (step * index);
|
|
@@ -222,9 +135,6 @@ export class BaseStack extends BaseComponent {
|
|
|
222
135
|
};
|
|
223
136
|
return this;
|
|
224
137
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Fade effect - progressive opacity
|
|
227
|
-
*/
|
|
228
138
|
fade(startOpacity = 1, step = 0.15) {
|
|
229
139
|
this.state.childStyles = (index) => {
|
|
230
140
|
const opacity = Math.max(0.1, startOpacity - (step * index));
|
|
@@ -232,9 +142,6 @@ export class BaseStack extends BaseComponent {
|
|
|
232
142
|
};
|
|
233
143
|
return this;
|
|
234
144
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Blur effect - progressive blur
|
|
237
|
-
*/
|
|
238
145
|
blur(startBlur = 0, step = 2) {
|
|
239
146
|
this.state.childStyles = (index) => {
|
|
240
147
|
const blur = startBlur + (step * index);
|
|
@@ -242,9 +149,6 @@ export class BaseStack extends BaseComponent {
|
|
|
242
149
|
};
|
|
243
150
|
return this;
|
|
244
151
|
}
|
|
245
|
-
/**
|
|
246
|
-
* Stagger animation delays
|
|
247
|
-
*/
|
|
248
152
|
stagger(baseDelay = 100) {
|
|
249
153
|
this.state.childStyles = (index) => {
|
|
250
154
|
const delay = baseDelay * index;
|
|
@@ -258,78 +162,55 @@ export class BaseStack extends BaseComponent {
|
|
|
258
162
|
buildClasses() {
|
|
259
163
|
const { spacing, align, justify, divider, responsive } = this.state;
|
|
260
164
|
const classes = [this.baseClassName];
|
|
261
|
-
// Spacing modifier
|
|
262
165
|
if (spacing !== 'default') {
|
|
263
166
|
classes.push(`${this.baseClassName}-${spacing}`);
|
|
264
167
|
}
|
|
265
|
-
// Alignment
|
|
266
168
|
if (align) {
|
|
267
169
|
classes.push(`jux-stack-${align}`);
|
|
268
170
|
}
|
|
269
|
-
// Justification
|
|
270
171
|
if (justify) {
|
|
271
172
|
classes.push(`jux-stack-justify-${justify}`);
|
|
272
173
|
}
|
|
273
|
-
// Divider
|
|
274
174
|
if (divider) {
|
|
275
175
|
classes.push(`${this.baseClassName}-divider`);
|
|
276
176
|
}
|
|
277
|
-
// Responsive
|
|
278
177
|
if (responsive) {
|
|
279
178
|
classes.push(`${this.baseClassName}-responsive`);
|
|
280
179
|
}
|
|
281
|
-
// Custom classes
|
|
282
180
|
if (this.state.class) {
|
|
283
181
|
classes.push(this.state.class);
|
|
284
182
|
}
|
|
285
183
|
return classes.join(' ');
|
|
286
184
|
}
|
|
287
185
|
renderChild(child, index) {
|
|
288
|
-
|
|
186
|
+
let childElement;
|
|
187
|
+
// String - wrap in div
|
|
289
188
|
if (typeof child === 'string') {
|
|
290
|
-
|
|
189
|
+
childElement = document.createElement('div');
|
|
190
|
+
childElement.textContent = child;
|
|
291
191
|
}
|
|
292
|
-
// JUX
|
|
293
|
-
if (child && typeof child.render === 'function') {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
child.
|
|
297
|
-
if (child.container) {
|
|
298
|
-
let html = child.container.outerHTML;
|
|
299
|
-
child.container = null; // Reset for reuse
|
|
300
|
-
return this.injectChildStyle(html, index);
|
|
301
|
-
}
|
|
192
|
+
// JUX Component - render it
|
|
193
|
+
else if (child && typeof child.render === 'function' && 'container' in child) {
|
|
194
|
+
const tempContainer = document.createElement('div');
|
|
195
|
+
child.render(tempContainer);
|
|
196
|
+
childElement = child.container || tempContainer.firstElementChild;
|
|
302
197
|
}
|
|
303
|
-
// DOM
|
|
304
|
-
if (child
|
|
305
|
-
|
|
198
|
+
// DOM Element - use directly
|
|
199
|
+
else if (child instanceof HTMLElement) {
|
|
200
|
+
childElement = child;
|
|
306
201
|
}
|
|
307
|
-
//
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return this.wrapChildWithStyle(rendered, index);
|
|
312
|
-
}
|
|
313
|
-
if (rendered && rendered.outerHTML) {
|
|
314
|
-
return this.injectChildStyle(rendered.outerHTML, index);
|
|
315
|
-
}
|
|
202
|
+
// Fallback
|
|
203
|
+
else {
|
|
204
|
+
childElement = document.createElement('div');
|
|
205
|
+
childElement.textContent = String(child);
|
|
316
206
|
}
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (style) {
|
|
323
|
-
return `<div style="${style}">${html}</div>`;
|
|
324
|
-
}
|
|
325
|
-
return html;
|
|
326
|
-
}
|
|
327
|
-
injectChildStyle(html, index) {
|
|
328
|
-
const style = this.getChildStyle(index);
|
|
329
|
-
if (style) {
|
|
330
|
-
return html.replace(/^<(\w+)/, `<$1 style="${style}"`);
|
|
207
|
+
// Apply child styles
|
|
208
|
+
const styleStr = this.getChildStyle(index);
|
|
209
|
+
if (styleStr) {
|
|
210
|
+
const existingStyle = childElement.getAttribute('style') || '';
|
|
211
|
+
childElement.setAttribute('style', existingStyle + '; ' + styleStr);
|
|
331
212
|
}
|
|
332
|
-
return
|
|
213
|
+
return childElement;
|
|
333
214
|
}
|
|
334
215
|
getChildStyle(index) {
|
|
335
216
|
const { childStyles } = this.state;
|
|
@@ -351,18 +232,13 @@ export class BaseStack extends BaseComponent {
|
|
|
351
232
|
const wrapper = document.createElement('div');
|
|
352
233
|
wrapper.className = this.buildClasses();
|
|
353
234
|
wrapper.id = this._id;
|
|
354
|
-
// ✅ Apply the built style string
|
|
355
235
|
if (this.state.style) {
|
|
356
236
|
wrapper.setAttribute('style', this.state.style);
|
|
357
237
|
}
|
|
358
238
|
// Render all children
|
|
359
239
|
this.state.children.forEach((child, index) => {
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
tempDiv.innerHTML = childHtml;
|
|
363
|
-
if (tempDiv.firstChild) {
|
|
364
|
-
wrapper.appendChild(tempDiv.firstChild);
|
|
365
|
-
}
|
|
240
|
+
const childEl = this.renderChild(child, index);
|
|
241
|
+
wrapper.appendChild(childEl);
|
|
366
242
|
});
|
|
367
243
|
this._wireStandardEvents(wrapper);
|
|
368
244
|
container.appendChild(wrapper);
|