nodality 1.0.0-beta.1

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.
Files changed (179) hide show
  1. package/dist/animator.cjs.js +1 -0
  2. package/dist/animator.esm.js +1 -0
  3. package/dist/audionew.cjs.js +1 -0
  4. package/dist/audionew.esm.js +1 -0
  5. package/dist/base.cjs.js +1 -0
  6. package/dist/base.esm.js +1 -0
  7. package/dist/betaDesktopBar.esm.js +1 -0
  8. package/dist/betaMobileBar.esm.js +1 -0
  9. package/dist/bundle.umd.js +1 -0
  10. package/dist/button.cjs.js +1 -0
  11. package/dist/button.esm.js +1 -0
  12. package/dist/cardGetter.cjs.js +1 -0
  13. package/dist/cardGetter.esm.js +1 -0
  14. package/dist/center.cjs.js +1 -0
  15. package/dist/center.esm.js +1 -0
  16. package/dist/checkbox.cjs.js +1 -0
  17. package/dist/checkbox.esm.js +1 -0
  18. package/dist/code.cjs.js +1 -0
  19. package/dist/code.esm.js +1 -0
  20. package/dist/container.cjs.js +1 -0
  21. package/dist/container.esm.js +1 -0
  22. package/dist/datalist.cjs.js +1 -0
  23. package/dist/datalist.esm.js +1 -0
  24. package/dist/designer.cjs.js +1 -0
  25. package/dist/designer.esm.js +1 -0
  26. package/dist/dropdown.cjs.js +1 -0
  27. package/dist/dropdown.esm.js +1 -0
  28. package/dist/elementMapper.cjs.js +1 -0
  29. package/dist/elementMapper.esm.js +1 -0
  30. package/dist/finalresult.esm.js +1 -0
  31. package/dist/flexCard.cjs.js +1 -0
  32. package/dist/flexCard.esm.js +1 -0
  33. package/dist/flexGrid.cjs.js +1 -0
  34. package/dist/flexGrid.esm.js +1 -0
  35. package/dist/flexRow.cjs.js +1 -0
  36. package/dist/flexRow.esm.js +1 -0
  37. package/dist/floatingInput.cjs.js +1 -0
  38. package/dist/floatingInput.esm.js +1 -0
  39. package/dist/free.cjs.js +1 -0
  40. package/dist/free.esm.js +1 -0
  41. package/dist/horizontalScroller.esm.js +1 -0
  42. package/dist/image.cjs.js +1 -0
  43. package/dist/image.esm.js +1 -0
  44. package/dist/imagePicker.cjs.js +1 -0
  45. package/dist/imagePicker.esm.js +1 -0
  46. package/dist/index.cjs.js +1 -0
  47. package/dist/index.esm.js +1 -0
  48. package/dist/link.cjs.js +1 -0
  49. package/dist/link.esm.js +1 -0
  50. package/dist/linkGetter.cjs.js +1 -0
  51. package/dist/linkGetter.esm.js +1 -0
  52. package/dist/metaAdder.cjs.js +1 -0
  53. package/dist/metaAdder.esm.js +1 -0
  54. package/dist/modal2025.cjs.js +1 -0
  55. package/dist/modal2025.esm.js +1 -0
  56. package/dist/multiswitchers.esm.js +1 -0
  57. package/dist/newNavBar.cjs.js +1 -0
  58. package/dist/newNavBar.esm.js +1 -0
  59. package/dist/picker.cjs.js +1 -0
  60. package/dist/picker.esm.js +1 -0
  61. package/dist/progress.cjs.js +1 -0
  62. package/dist/progress.esm.js +1 -0
  63. package/dist/radio.cjs.js +1 -0
  64. package/dist/radio.esm.js +1 -0
  65. package/dist/range.cjs.js +1 -0
  66. package/dist/range.esm.js +1 -0
  67. package/dist/sideBar.cjs.js +1 -0
  68. package/dist/sideBar.esm.js +1 -0
  69. package/dist/sideNavBar.cjs.js +1 -0
  70. package/dist/sideNavBar.esm.js +1 -0
  71. package/dist/simpleBar.cjs.js +1 -0
  72. package/dist/simpleBar.esm.js +1 -0
  73. package/dist/stack.cjs.js +1 -0
  74. package/dist/stack.esm.js +1 -0
  75. package/dist/table.cjs.js +1 -0
  76. package/dist/table.esm.js +1 -0
  77. package/dist/text.cjs.js +1 -0
  78. package/dist/text.esm.js +1 -0
  79. package/dist/textField.cjs.js +1 -0
  80. package/dist/textField.esm.js +1 -0
  81. package/dist/wrap.cjs.js +1 -0
  82. package/dist/wrap.esm.js +1 -0
  83. package/dist/zoomCard.cjs.js +1 -0
  84. package/dist/zoomCard.esm.js +1 -0
  85. package/layout/<head> +59 -0
  86. package/layout/DEADJOE +49 -0
  87. package/layout/DEPRECATED-PARAGRAPH.js +103 -0
  88. package/layout/animator.js +1915 -0
  89. package/layout/audio.js +145 -0
  90. package/layout/audionew.js +70 -0
  91. package/layout/base-2.js +92 -0
  92. package/layout/base.js +161 -0
  93. package/layout/betaDesktopBar.js +126 -0
  94. package/layout/betaMobileBar.js +293 -0
  95. package/layout/box.js +29 -0
  96. package/layout/button.js +516 -0
  97. package/layout/cards.js +136 -0
  98. package/layout/center.js +143 -0
  99. package/layout/checkbox.js +183 -0
  100. package/layout/cleanRow.js +775 -0
  101. package/layout/code.js +60 -0
  102. package/layout/container.js +1005 -0
  103. package/layout/custom.js +289 -0
  104. package/layout/divImage.js +209 -0
  105. package/layout/dropdown.js +154 -0
  106. package/layout/dropdown2025.js +152 -0
  107. package/layout/edit.sh +39 -0
  108. package/layout/emptyElement.js +21 -0
  109. package/layout/externalStylesheet.js +19 -0
  110. package/layout/flexCard.js +220 -0
  111. package/layout/flexGrid.js +192 -0
  112. package/layout/flexrow.js +866 -0
  113. package/layout/footer.js +83 -0
  114. package/layout/formComponents/custom.js +0 -0
  115. package/layout/formComponents/dataList.js +183 -0
  116. package/layout/formComponents/edit.sh +39 -0
  117. package/layout/formComponents/floatingInput.js +163 -0
  118. package/layout/formComponents/form-all.js +161 -0
  119. package/layout/formComponents/form.js +76 -0
  120. package/layout/formComponents/imagePicker.js +266 -0
  121. package/layout/formComponents/picker.js +208 -0
  122. package/layout/formComponents/radio.js +231 -0
  123. package/layout/formComponents/radiogroup.js +231 -0
  124. package/layout/formComponents/range.js +158 -0
  125. package/layout/free.js +232 -0
  126. package/layout/grid-new.js +299 -0
  127. package/layout/grid.js +190 -0
  128. package/layout/gridSwitcher.js +188 -0
  129. package/layout/group.js +163 -0
  130. package/layout/header.js +175 -0
  131. package/layout/hello.html +126 -0
  132. package/layout/horizontalScroller.js +222 -0
  133. package/layout/image-old.js +487 -0
  134. package/layout/image.js +1039 -0
  135. package/layout/index.js +183 -0
  136. package/layout/label.js +50 -0
  137. package/layout/link.js +1085 -0
  138. package/layout/list-OLD.js +0 -0
  139. package/layout/list.js +127 -0
  140. package/layout/metaAdder.js +17 -0
  141. package/layout/modal2025.js +142 -0
  142. package/layout/modernwrap.js +92 -0
  143. package/layout/multiswitcher.js +224 -0
  144. package/layout/multiswitcherBeta.js +63 -0
  145. package/layout/navBar-OLD.js +261 -0
  146. package/layout/navBar.js +371 -0
  147. package/layout/navFactor/customDiv.js +60 -0
  148. package/layout/navFactor/edit.sh +39 -0
  149. package/layout/newFlatAdder.js +41 -0
  150. package/layout/newNavBar copy 2.js +915 -0
  151. package/layout/newNavBar copy.js +774 -0
  152. package/layout/newNavBar.js +925 -0
  153. package/layout/offsetContainer.js +395 -0
  154. package/layout/progress.js +111 -0
  155. package/layout/remWin.sh +20 -0
  156. package/layout/row.js +208 -0
  157. package/layout/savedNewNavBar.js +437 -0
  158. package/layout/scrollvideo.js +120 -0
  159. package/layout/sideBar.js +183 -0
  160. package/layout/sideNavBar.js +313 -0
  161. package/layout/simpleBar.js +25 -0
  162. package/layout/slider2025.js +198 -0
  163. package/layout/spacer.js +44 -0
  164. package/layout/stack.js +76 -0
  165. package/layout/styler.js +113 -0
  166. package/layout/switcher.js +102 -0
  167. package/layout/table.js +155 -0
  168. package/layout/text.js +1685 -0
  169. package/layout/textField.js +282 -0
  170. package/layout/ulist.js +147 -0
  171. package/layout/video.js +70 -0
  172. package/layout/withoutNew.js +60 -0
  173. package/layout/wrap.js +140 -0
  174. package/layout/zoomCard.js +219 -0
  175. package/lib/cardGetter.js +80 -0
  176. package/lib/designer.js +875 -0
  177. package/lib/elementMapper.js +1428 -0
  178. package/lib/linkGetter.js +202 -0
  179. package/package.json +33 -0
@@ -0,0 +1,866 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+
4
+
5
+ class FlexRow extends Animator {
6
+ constructor(frs, saveEl) {
7
+ super();
8
+ this.code = []; // 191455
9
+ this.saveEl = saveEl;
10
+ this.frs = frs;
11
+ this.res = null;
12
+ this.setup();
13
+ this.responsive();
14
+ this.code.push(" new FlexRow()");
15
+ }
16
+
17
+ getType(){
18
+ return "FlexRowLayoutElement";
19
+ }
20
+
21
+
22
+
23
+ set(options){
24
+ //alert("OJ")
25
+ this.options = options;
26
+ // console.log("OPTIONS ARE");
27
+ // console.log(options);
28
+
29
+ var obj = options;
30
+ //------
31
+
32
+
33
+ obj.id = "#ABC";
34
+
35
+
36
+ if (obj.gradient){
37
+ // console.log("STAFF");
38
+ // console.log(obj.id);
39
+ }
40
+ //alert(obj.mar);
41
+ //// console.log("MARA");
42
+ //// console.log(obj.mar);
43
+ obj.pad && this.pad(obj.pad);
44
+ obj.mar && this.mar(obj.mar);
45
+
46
+
47
+ // console.log("WITH BOP");
48
+ // console.log(obj);
49
+ if (obj && obj.id && obj.stroke || obj && obj.id && obj.gradient || obj && obj.id && obj.span || obj && obj.id && obj.backgroundOp){
50
+ //alert("P")
51
+ if (obj.gradient){
52
+ this.globalGradient = obj.gradient.op.gradient;
53
+
54
+ } // OK
55
+
56
+ if (obj.stroke){
57
+ super.setAny({globalBlast: `${obj.stroke.op.width} ${obj.stroke.op.color}`});
58
+ }
59
+
60
+ // Filter just the elements with layout element
61
+ let ft = [obj.stroke, obj.gradient, obj.animation, obj.span, obj.backgroundOp]//obj.gradient.filter(el => el.op.name !== "layout");
62
+ ft = ft.filter(el => el != undefined);
63
+
64
+ let arr = [];
65
+
66
+ for (var i = 0; i < ft.length; i++){
67
+ arr.push({
68
+ range: ft[i].range,
69
+ log: ft[i].op.name,
70
+ target: ft[i].target
71
+ });
72
+ }
73
+
74
+ // console.log("-----RDAAA----");
75
+ // console.log(arr);
76
+ // console.log(obj.id);
77
+ this.res.setAttribute("id", obj.id);
78
+ this.betaReact(arr, obj.id);
79
+ // this.protoReact(arr, obj.id);
80
+ } // 17:06:00 17/03/2024 Yes!!!
81
+
82
+ //----------------
83
+
84
+
85
+
86
+ options.id && this.res.setAttribute("id", options.id);
87
+ this.code.push(`\n .set({`);
88
+ if (options.padding){
89
+ this.padding(options.padding);
90
+ }
91
+
92
+ //alert(options.opacity);
93
+ //(options.opacity === 0) && (this.res.style.opacity = 0 /*options.opacity*/);
94
+
95
+
96
+ if (options.background){
97
+ this.res.style.backgroundColor = "#ecf0f1";
98
+ this.res.style.cornerRadius = "#3rem";
99
+ }
100
+
101
+ if (options.alignTo){
102
+ //alert("J")
103
+ this.res.style.justifyContent = options.alignTo;
104
+ // let stringified = JSON.stringify(options.alignTo);
105
+ //this.code.push(`\n alignTo: "${stringified}",`);
106
+ }
107
+
108
+
109
+
110
+
111
+
112
+
113
+ if (options.background){
114
+ this.res.style.backgroundColor = options.background;
115
+ this.code.push(`\n background: "${options.background}",`);
116
+ }
117
+
118
+ if (options.justify){
119
+ this.res.style.justifyContent = options.justify;
120
+ this.code.push(`\n justify: "${options.justify}",`);
121
+ }
122
+
123
+ if (options.border) {
124
+
125
+ if (options.border[0] === "top") {
126
+ this.res.style.borderTop = `${options.border[1]} solid white`;
127
+ // border: ["top", "1px"],
128
+ }
129
+
130
+ if (options.border[0] === "all") {
131
+ this.res.style.border = `${options.border[1]} solid orange`;
132
+ // border: ["top", "1px"],
133
+ }
134
+
135
+
136
+
137
+ this.code.push(`\n border: ["${options.border[0]}", "${options.border[1]}"],`);
138
+ }
139
+
140
+
141
+ // Give this to animator
142
+ if (options.borderObj){
143
+
144
+ /* let type = options.borderObj.type ?? "solid";
145
+
146
+
147
+ this.res.style.border = `${options.borderObj.width} ${type} ${options.borderObj.color}`
148
+ this.res.style.borderRadius = options.borderObj.radius;
149
+
150
+ let stringified = JSON.stringify(options.borderObj);
151
+ this.code.push(`\n borderObj: ${stringified},`);
152
+ */
153
+
154
+ this.borderObj(options.borderObj);
155
+ let stringified = JSON.stringify(options.borderObj);
156
+ this.code.push(`\n borderObj: ${stringified},`);
157
+ /*borderObj: {
158
+ side: "all",
159
+ width: "3px",
160
+ color: "rgba(236, 227, 215, 0.5)"
161
+ },*/
162
+ }
163
+
164
+ options.width && (this.res.style.width = options.width);
165
+ options.width && this.code.push(`\n width: "${options.width}",`);
166
+
167
+ options.height && (this.res.style.height = options.height);
168
+ options.height && this.code.push(`\n height: "${options.height}",`);
169
+
170
+
171
+ if (options.align){
172
+ let stringified = JSON.stringify(options.align);
173
+ this.res.style.alignItems = "flex-start";
174
+ this.code.push(`\n alignIts: "flex-start",`);
175
+ this.res.style.alignItems = "flex-start";
176
+ }
177
+
178
+ // options.align && alert("K")
179
+
180
+ options.wrap && this.wrap();
181
+ options.wrap && this.code.push(`\n wrap: true,`)
182
+
183
+ if (options.alignIts){
184
+ let stringified = JSON.stringify(options.alignIts);
185
+ this.res.style.alignItems = "flex-start";
186
+ this.code.push(`\n alignIts: ${stringified},`);
187
+
188
+ }
189
+ // options.alignIts && alert("J");
190
+ //alignIts: "flex-start",
191
+
192
+ options.owrap && this.onlyWrap();
193
+ options.owrap && this.code.push(`\n owrap: true,`)
194
+
195
+ if (options.owrap != undefined){
196
+
197
+
198
+ if (options.owrap === false){ // DANGEROUS
199
+ // alert("FIRES AFTER OJ");
200
+ this.res.style.flexWrap = "nowrap";
201
+ this.res.style.background = "yellow";
202
+ }
203
+ }
204
+
205
+ // // console.warn(options);
206
+
207
+ // options.columnAlways && (this.columnAlways = true);
208
+ options.columnAlways && alert("JIJ" + options.columnAlways);
209
+
210
+ options.toColumn && this.toColumn(options.toColumn); // OK
211
+
212
+
213
+ options.column && this.makeCol(); // OK
214
+
215
+
216
+
217
+ if (options.colat){
218
+
219
+ options.colat && this.toColumnAt(options.colat);
220
+ this.code.push(`\n colat: "${options.colat}",`);
221
+ }
222
+
223
+
224
+ //alert(options.arrpad);
225
+ options.arrayPadding && this.arrayPadding(options.arrayPadding.sides, options.arrayPadding.value);
226
+
227
+
228
+ options.arrayMargin && this.arrayMargin(options.arrayMargin.sides, options.arrayMargin.value);
229
+ this.arrayMarginValue = options.arrayMargin;
230
+ options.arrayMargin && this.code.push(`\n arrayMargin: {sides: [${options.arrayMargin.sides.map(m => `"${m}"`).join(", ")}], value: "${options.arrayMargin.value}"},`); // 2345 06/03
231
+
232
+ // alert(options.multipad);
233
+
234
+ options.multipad && this.makeMultiPad(options.multipad);
235
+
236
+ if (options.align){
237
+ //alert("K")
238
+
239
+ this.makeJustify(options.justify);
240
+ // this.setAlign(options.align);
241
+ }
242
+
243
+ if (options.justify){
244
+
245
+ this.makeAlign(options.justify);
246
+ // this.setAlign(options.align);
247
+ }
248
+ //this.res.style.justifyContent = "flex-start";
249
+ //alert(this.res.style.justifyContent);
250
+ if (options.justifo === "flex-start"){
251
+
252
+ this.res.style.justifyContent = "flex-start";
253
+ } else {
254
+ //alert(options.justify);
255
+ }
256
+
257
+ options.radius && (this.res.style.borderRadius = "1rem");
258
+
259
+ //const obj = options;
260
+ options.aligns && this.aligns(options.aligns);
261
+
262
+
263
+ /*if (obj && obj.stroke || obj && obj.gradient || obj && obj.span){
264
+
265
+
266
+ if (obj.gradient) {
267
+ this.globalGradient = obj.gradient.op.gradient;
268
+ // console.log(obj.gradient);
269
+ }
270
+
271
+
272
+ if (obj.stroke){
273
+ // console.warn("OAP");
274
+ // console.log(obj.stroke.op.color);
275
+
276
+ super.setAny({globalBlast: `${obj.stroke.op.width} ${obj.stroke.op.color}`});
277
+
278
+ // console.warn("GBL");
279
+ // console.warn(super.globalBlast);
280
+ }
281
+
282
+ // Filter just the elements with layout element
283
+ let ft = [obj.stroke, obj.gradient, obj.animation, obj.span]//obj.gradient.filter(el => el.op.name !== "layout");
284
+ // console.log(ft);
285
+
286
+ ft = ft.filter(el => el != undefined);
287
+
288
+ let arr = [];
289
+
290
+ for (var i = 0; i < ft.length; i++){
291
+ // console.log("Hello");
292
+ arr.push({
293
+ range: ft[i].range,
294
+ log: ft[i].op.name,
295
+ target: ft[i].target
296
+ });
297
+ }
298
+
299
+ // console.log(arr);
300
+ this.protoReact(arr, options.id);
301
+ }*/
302
+
303
+ this.code.push(`\n })`);
304
+ return this;
305
+ }
306
+
307
+
308
+
309
+
310
+ setArea(area){
311
+ this.res.style.gridArea = area;
312
+ return this;
313
+ }
314
+
315
+ toColumnAt(at){ // THIS IS THE ONE!!!
316
+
317
+
318
+ if (!this.columnAlways){
319
+ // alert(this.columnAlways);
320
+
321
+
322
+ const toCol = () => {
323
+
324
+ let media = window.matchMedia(`(max-width: ${at})`);
325
+ let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
326
+
327
+ if (media.matches || mobileMedia.matches){
328
+
329
+ this.res.style.flexDirection = "column";
330
+ } else {
331
+ this.res.style.flexDirection = "row";
332
+
333
+ }
334
+ }
335
+
336
+ toCol();
337
+ window.addEventListener("resize", toCol);
338
+ }
339
+
340
+
341
+
342
+
343
+
344
+ return this;
345
+ }
346
+
347
+ // 1:32:56, 1:33:24 talk 17/08
348
+
349
+
350
+ onlyWrap(){
351
+ // alert("oj")
352
+ this.res.style.flexWrap = "wrap";
353
+ this.res.style.backgroundColor = "green";
354
+ return this;
355
+ }
356
+
357
+ wrap(){
358
+ this.res.style.flexWrap = "wrap";
359
+ this.res.style.justifyContent = "space-between";
360
+ return this;
361
+ }
362
+
363
+
364
+ aligns(st){
365
+
366
+ if (st === "start"){
367
+ this.res.style.alignItems = "flex-start";
368
+ }
369
+
370
+
371
+ if (st === "end"){
372
+ this.res.style.alignItems = "flex-end";
373
+ }
374
+
375
+ if (st === "center"){
376
+ this.res.style.alignItems = "center";
377
+ }
378
+
379
+
380
+ // alert(st);
381
+
382
+ return this;
383
+ }
384
+
385
+
386
+ toColumn(at){
387
+ alert("ON")
388
+
389
+ const toCol = () => {
390
+ let media = window.matchMedia(`(max-width: ${at})`);
391
+ let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
392
+ // alert(media);
393
+
394
+ //// console.log(mobileMedia);
395
+
396
+ if (media.matches || mobileMedia.matches){
397
+ this.res.style.flexDirection = "column";
398
+ } else {
399
+ this.res.style.flexDirection = "row";
400
+
401
+ }
402
+ }
403
+
404
+ toCol();
405
+ window.addEventListener("resize", toCol);
406
+
407
+
408
+
409
+
410
+
411
+ return this;
412
+ }
413
+
414
+
415
+ toCode(){
416
+ const objString = JSON
417
+ .stringify(this.options, null, 4)
418
+ .replace(/"([^"]+)":/g, '$1:');
419
+
420
+ const itemsCode = this.items.map(item => item.toCode()).join(",\n ");
421
+
422
+ return [
423
+ `new FlexRow().set(${objString}).items([`,
424
+ ` ${itemsCode}`,
425
+ `])`
426
+ ].join("\n");
427
+ //return this.code; // 21:40:09
428
+ }
429
+
430
+ arrayPadding(arr, value) {
431
+ if (arr.includes("left")){
432
+ this.res.style.paddingLeft = value;
433
+ }
434
+
435
+ if (arr.includes("right")){
436
+ //alert("P")
437
+ this.res.style.paddingRight = value;
438
+ }
439
+
440
+ if (arr.includes("top")){
441
+ this.res.style.paddingTop = value;
442
+ }
443
+
444
+ if (arr.includes("bottom")){
445
+ this.res.style.paddingBottom = value;
446
+ }
447
+
448
+
449
+ return this;
450
+ }
451
+
452
+ borderAround(data){
453
+ this.res.style.border = data;
454
+ return this;
455
+ }
456
+
457
+
458
+
459
+ cornerRadius(el){
460
+ this.res.style.borderRadius = el;
461
+ return this;
462
+ }
463
+
464
+
465
+
466
+
467
+ makeJustify(opt){
468
+ //alert("KJ");
469
+ if (opt === "start"){
470
+
471
+ // alert("HJ");
472
+ this.res.style.justifyContent = "flex-start";
473
+ }
474
+
475
+ return this;
476
+ }
477
+
478
+
479
+ makeAlign(opt){
480
+ //alert("KJ");
481
+ if (opt === "center"){
482
+
483
+ // alert("HJ");
484
+ this.res.style.alignItems = "center";
485
+ } else {
486
+
487
+
488
+
489
+
490
+
491
+ //alert(opt)
492
+ this.res.style.justifyContent = opt;
493
+ // let stringified = JSON.stringify(options.alignTo);
494
+ //this.code.push(`\n alignTo: "${stringified}",`);
495
+ }
496
+
497
+ return this;
498
+ }
499
+
500
+
501
+ makeCol(){
502
+ this.res.style.flexDirection = "column";
503
+ return this;
504
+ }
505
+
506
+
507
+ makeMultiPad(obj){
508
+
509
+ for (var i = 0; i < obj.length; i++){
510
+ if (obj[i].side === "left"){
511
+
512
+ this.res.style.paddingLeft = obj[i].value;
513
+ }
514
+
515
+ if (obj[i].side === "right"){
516
+ this.res.style.paddingRight = obj[i].value;
517
+ }
518
+ }
519
+
520
+ return this;
521
+ }
522
+
523
+
524
+
525
+ padding(vals){
526
+ this.res.style.padding = vals;
527
+ return this;
528
+ }
529
+
530
+ center() {
531
+ // this.res.style.justifyItems = "center";
532
+ return this;
533
+ }
534
+
535
+ toColumn(){
536
+ this.res.style.flexDirection = "column";
537
+ return this;
538
+ }
539
+
540
+
541
+
542
+ setClass(classa){
543
+ this.res.setAttribute("class", classa);
544
+ return this;
545
+ }
546
+
547
+ toCenter(classa) {
548
+ this.res.style.marginLeft = "auto";
549
+ this.res.style.marginRight = "auto";
550
+ this.res.setAttribute("class", classa);
551
+ return this;
552
+ }
553
+
554
+ setup() {
555
+ let flex = document.createElement("div");
556
+ flex.style.display = "flex";
557
+ flex.style.justifyContent = "space-around";
558
+ flex.style.alignItems = "center";
559
+ flex.style.margin = 0;
560
+ // flex.style.width = "100%";
561
+ this.res = flex;
562
+
563
+
564
+ //// console.log("FREDERICK!");
565
+ //// console.log(this);
566
+
567
+
568
+
569
+ return this;
570
+
571
+ // 19:36:06 Houdini Roger kilimanjaro 06/03 audiovisual
572
+ }
573
+
574
+
575
+ noSpaceAround(){
576
+ this.res.style.justifyContent = "";
577
+ return this;
578
+ }
579
+
580
+
581
+
582
+
583
+ itemAlignCenter(){
584
+ this.res.style.justifyContent = "center";
585
+ this.res.style.alignItems = "center";
586
+ return this;
587
+ }
588
+
589
+
590
+ /*
591
+ {
592
+ if
593
+ }
594
+
595
+ */
596
+
597
+ arrayMargin(arr, value) {
598
+
599
+ //alert(arr);
600
+ //alert(value);
601
+
602
+ // alert(window.matchMedia("(max-device-width: 415px)").matches)
603
+ //alert("K")
604
+ if (!value){ // LTRB
605
+ this.res.style.marginLeft = `${arr[0]}px`;
606
+ this.res.style.marginTop = `${arr[1]}px`;
607
+ this.res.style.marginRight = `${arr[2]}px`;
608
+ this.res.style.marginBottom = `${arr[3]}px`;
609
+ }
610
+
611
+
612
+ // alert("ROW.js 452"); //003337
613
+ //alert(value);
614
+ if (arr.includes("left")){
615
+ this.res.style.marginLeft = `${value}px`;
616
+ }
617
+
618
+ if (arr.includes("right")){
619
+ this.res.style.marginRight = `${value}px`;
620
+ } // 161357 Surovikin line
621
+
622
+ if (arr.includes("top")){
623
+ // alert(value)
624
+ this.res.style.marginTop = `${value}px`;
625
+ }
626
+
627
+ if (arr.includes("bottom")){
628
+ this.res.style.marginBottom = `${value}px`;
629
+ }
630
+ return this;
631
+ }
632
+
633
+
634
+
635
+ frame(obj){
636
+ this.res.style.width = obj.width;
637
+ this.res.style.height = obj.height;
638
+
639
+
640
+ let media = window.matchMedia("(max-device-width: 415px)");
641
+
642
+ if (media.matches && obj.mobile){
643
+ this.res.style.width = obj.mobile
644
+ }
645
+
646
+ return this;
647
+ }
648
+
649
+ background(color){
650
+ this.res.style.background = color;
651
+ return this;
652
+ }
653
+
654
+ radius(val){
655
+ this.res.style.borderRadius = `${val}px`;
656
+ return this;
657
+ }
658
+
659
+ shadow(x, y, radius){
660
+ this.res.style.boxShadow = "0px 1px 10px 0px rgb(145 145 145)"; //`${x}px ${y}px ${radius}px #000`;
661
+ return this;
662
+ }
663
+
664
+ onTap(e){
665
+ this.res.addEventListener("click", e);
666
+ return this;
667
+ }
668
+
669
+
670
+ items(arr) {
671
+ //// console.log("2 images enter flex row")
672
+ //// console.warn(arr); // 2 images enter flexRow or there is problem in FlexRow code gen
673
+
674
+ //// console.warn(this.res);
675
+
676
+ this.els = arr;
677
+ this.items = arr;
678
+ this.code.push(".items([");
679
+
680
+ /*
681
+ // console.log("FL ITEM---");
682
+ // console.log(arr);
683
+ // console.log("/FL ITEM---");*/
684
+
685
+ for (var i = 0; i < arr.length; i++) {
686
+
687
+
688
+
689
+
690
+ // // console.error(arr[i].render);
691
+
692
+ if (arr[i] != undefined){
693
+ if (arr[i].render instanceof Function){ // 170736
694
+ let r = arr[i].render();
695
+ // r.style.width = "100%";
696
+ //r.style.flex = 1;
697
+ this.res.appendChild(r);
698
+ } else {
699
+ this.res.appendChild(arr[i]);
700
+ }
701
+ }
702
+
703
+
704
+
705
+ //this.code.push("L");
706
+
707
+
708
+ /* if (arr[i].toCode instanceof Array){
709
+ // // console.warn(arr[i].toCode().flatMap(x => x));
710
+ this.code.push(arr[i].toCode().flatMap(x => x));
711
+ } else {
712
+ if (arr[i].toCode){
713
+ this.code.push(arr[i].toCode());
714
+
715
+
716
+
717
+
718
+ }
719
+ }*/
720
+
721
+
722
+ if (arr[i] != undefined){
723
+
724
+
725
+
726
+
727
+ if (arr[i].render instanceof Function){
728
+ let item = arr[i].render();//.render();
729
+ this.res.appendChild(item);
730
+
731
+
732
+ if (arr[i].toCode !== undefined){
733
+ // // console.log("arr[i]");
734
+ // // console.log(arr[i]);
735
+ this.code.push(arr[i].toCode().flatMap(l=>l)); // 20:10:00 Nice!
736
+ // 12:25:10 Wow!!!
737
+
738
+
739
+ // Image codegen problem
740
+ }
741
+ }
742
+ }
743
+
744
+
745
+
746
+
747
+ //// console.log("FREDERICK!");
748
+ //// console.log(this.code);
749
+
750
+ //this.code = this.code.flatMap(x => x).flatMap(x => x);
751
+ }
752
+
753
+
754
+ this.code.push("])");
755
+
756
+
757
+ // this.code = this.code.flatMap(x => x);
758
+ // // console.log(this.code);
759
+
760
+
761
+
762
+ return this;
763
+ }
764
+
765
+
766
+
767
+ /*
768
+
769
+ this.code.push(".add([ \n");
770
+ for (var i = 0; i < els.length; i++){
771
+ let item = els[i].render();//.render();
772
+ this.res.appendChild(item);
773
+
774
+
775
+ if (els[i].toCode !== undefined){
776
+
777
+ this.code.push(els[i].toCode().flatMap(l=>l)); // 20:10:00 Nice!
778
+ // 12:25:10 Wow!!!
779
+
780
+
781
+ }
782
+ }
783
+
784
+ //122616 06/03 Houdini M2 chip
785
+ this.code.push("])");
786
+
787
+
788
+ return this;
789
+ */
790
+
791
+
792
+
793
+
794
+ adjustRatiosForLayout(){
795
+
796
+ if (this.els[1].getWidth == undefined){
797
+ return this;
798
+ }
799
+
800
+ if (this.els[1].getHeight == undefined){
801
+ return this; // 171653 fix
802
+ } // 171354
803
+
804
+ window.addEventListener("resize", () => {
805
+ this.resizeValues();
806
+ });
807
+
808
+
809
+ this.resizeValues();
810
+
811
+
812
+
813
+
814
+ // 18:29:04
815
+
816
+ return this;
817
+ }
818
+
819
+
820
+ resizeValues(){
821
+ let newWidth = window.innerWidth * 0.7;
822
+ let aspect = (this.els[1].getHeight() / this.els[1].getWidth());
823
+ let goal = newWidth * aspect;
824
+
825
+ this.res.children[0].style.height = `${goal}px`;
826
+ this.res.children[0].style.width = `30%`;
827
+ this.res.children[1].style.width = `70%`;
828
+ }
829
+
830
+ responsive(h){
831
+ let media = window.matchMedia(`(max-device-width: 415px)`);
832
+
833
+ const adjust = () => {
834
+ if (window.innerWidth < h || media.matches){
835
+ this.res.style.gridTemplateColumns = "1fr";
836
+ } else {
837
+ this.res.style.gridTemplateColumns = "1fr 1fr";
838
+ }
839
+ }
840
+
841
+
842
+ if (window.innerWidth < h || media.matches){
843
+ this.res.style.gridTemplateColumns = "1fr";
844
+ } else {
845
+ this.res.style.gridTemplateColumns = "1fr 1fr";
846
+ }
847
+
848
+
849
+ window.addEventListener("resize", adjust);
850
+
851
+
852
+ return this; // :D
853
+ return this;
854
+ }
855
+
856
+
857
+ render(el) {
858
+ // // console.log("BORDER:" + this.res.style.border);
859
+ if (el){
860
+ document.querySelector(el).appendChild(this.res);
861
+ } else {
862
+ return this.res;
863
+ }
864
+ }
865
+ }
866
+ export { FlexRow };