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,266 @@
1
+ import {Animator} from "../animator.js";
2
+
3
+ class FilePickera extends Animator {
4
+ constructor(){
5
+ super();
6
+ this.el = null;
7
+ this.file = null;
8
+ }
9
+
10
+ set(obj){
11
+ this.options = obj;
12
+ this.okayColor = obj.okayColor;
13
+
14
+ let query = window.matchMedia("(max-device-width: 415px)");
15
+
16
+ let wrap = document.createElement("div");
17
+ wrap.style.paddingBottom = "1em";
18
+ wrap.style.display = "flex";
19
+
20
+ let allWrap = document.createElement("div");
21
+
22
+ let nameField = document.createElement("input");
23
+ nameField.setAttribute("type", "text");
24
+ nameField.style.display = "none";
25
+ nameField.style.margin = "0.5em";
26
+
27
+ let card = document.createElement("input");
28
+ card.setAttribute("type", "file");
29
+ card.setAttribute("name", obj.name);
30
+ obj.accept && (card.accept = obj.accept);
31
+ card.setAttribute("id", obj.id);
32
+ card.style.visibility = "hidden";
33
+ card.style.display = "none";
34
+
35
+
36
+ let queryB = window.matchMedia("(max-device-width: 415px)");
37
+ if (queryB.matches) {
38
+ card.style.fontSize = '1rem';
39
+ }
40
+
41
+ let label = document.createElement("label");
42
+ label.setAttribute("for", obj.id);
43
+ label.innerText = obj.title;
44
+ label.style.marginRight = 12;
45
+ label.style.padding = "0.5em";
46
+
47
+ if (obj.color){
48
+ label.style.color = obj.color;
49
+ }
50
+
51
+ if (obj.background){
52
+ label.style.background = obj.background;
53
+ label.style.padding = "10";
54
+ }
55
+
56
+
57
+ card.addEventListener("change", () => {
58
+
59
+
60
+
61
+
62
+ nameField.style.display = "block";
63
+
64
+
65
+ if (obj.hideField){
66
+ nameField.style.display = "none";
67
+ }
68
+
69
+
70
+ label.innerText = "Change";
71
+ this.file = card.files[0];
72
+ this.onLoad(this.file);
73
+ // this.loadCall(this.func);
74
+ // this.getLoaded(this.file);
75
+ data[obj.index] = this.file;
76
+
77
+ nameField.setAttribute("value", this.file.name);
78
+ nameField.setAttribute("readonly", "true");
79
+
80
+
81
+
82
+
83
+
84
+ this.getLoaded();
85
+ this.highlight();
86
+ // obj.cb(data);
87
+ // console.log(this.file);
88
+
89
+ })
90
+
91
+ wrap.appendChild(card);
92
+ wrap.appendChild(label);
93
+ wrap.appendChild(nameField);
94
+
95
+ this.el = wrap;
96
+
97
+
98
+ // this.auto();
99
+
100
+ obj.font && this.font(obj.font);
101
+ obj.radius && this.borderRadius(obj.radius);
102
+ return this;
103
+ }
104
+
105
+
106
+ borderRadius(radius){
107
+ this.el.style.borderRadius = radius;
108
+ // console.warn(this.res);
109
+ return this;
110
+ }
111
+
112
+ // 5:00 (2 min) 4km 3:35 (2 min) 3km (3:25) 2km (3:15), 1km ke (03:00)
113
+
114
+
115
+ addClass(classa){
116
+ this.el.setAttribute("class", classa);
117
+ return this;
118
+ }
119
+
120
+
121
+ font(font){
122
+ this.el.style.fontFamily = font;
123
+ return this;
124
+ }
125
+
126
+ bold(){
127
+
128
+
129
+ this.el.style.fontWeight = "bold";
130
+ return this;
131
+ }
132
+
133
+
134
+ rounded(){
135
+ // this.el.style.borderRadius = `${padding}px`;
136
+ this.el.children[1].style.borderRadius = `8px`;
137
+ return this;
138
+ }
139
+
140
+
141
+
142
+ highlight(){
143
+ if (this.file === null){
144
+ this.hasFile = false;
145
+ this.el.children[1].style.background = "red";
146
+ // alert("A");
147
+ } else {
148
+ this.hasFile = true;
149
+
150
+ if (this.okayColor){
151
+ this.el.children[1].style.background = this.okayColor;
152
+ } else {
153
+ this.el.children[1].style.background = "#1abc9c";
154
+ }
155
+
156
+ }
157
+
158
+
159
+ return this;
160
+ }
161
+
162
+
163
+
164
+
165
+
166
+ auto() {
167
+ const adj = () => {
168
+ let query = window.matchMedia("(max-device-width: 415px)");
169
+ if (query.matches) {
170
+ // this.el.style.fontSize = '3rem';
171
+ } else {
172
+ // this.el.style.fontSize = '1rem';
173
+ }
174
+ }
175
+
176
+ adj();
177
+ window.addEventListener("resize", adj);
178
+ return this;
179
+ }
180
+
181
+ onLoad(file){
182
+
183
+ // console.log(this.file);
184
+ this.returnObject(this.file);
185
+ return this;
186
+ }
187
+
188
+
189
+
190
+
191
+
192
+ getLoaded(){
193
+ return this.file;
194
+ }
195
+
196
+ returnObject(file){
197
+ // console.log("NOW");
198
+ return file;
199
+ }
200
+
201
+ loadCall(func){
202
+ this.func = func;
203
+ this.func(this.file);
204
+ return this;
205
+ }
206
+
207
+ toCode() {
208
+ let objString = JSON.stringify(this.options, null, 4);
209
+ objString = objString.replace(/"(\w+)"(?=\s*:)/g, '$1');
210
+ return [`new FilePickera().set(${objString})`];
211
+ }
212
+
213
+ render(div){
214
+ if (div){
215
+ document.querySelector(div).appendChild(this.el);
216
+ return this;
217
+ } else {
218
+ return this.el;
219
+ }
220
+ }
221
+ }
222
+
223
+
224
+
225
+
226
+ var data = []; // Has to be called data!
227
+ /*
228
+ new FilePickera()
229
+ .setup({
230
+ index: 0,
231
+ id: "A",
232
+ title: "Select picture A"
233
+ }).render("#res");*/
234
+
235
+ /*new FilePicker()
236
+ .setup({
237
+ index: 1,
238
+ id: "B",
239
+ title: "Select picture B"
240
+ }).render("#res");
241
+
242
+ */
243
+
244
+
245
+
246
+ /*
247
+ class Appa extends Base {
248
+ constructor(){
249
+ super();
250
+ }
251
+
252
+ render(){
253
+ return new Text("Q")
254
+ }
255
+ }*/
256
+
257
+
258
+ // new Appa().mount("#res");
259
+
260
+
261
+
262
+
263
+
264
+
265
+ export { FilePickera
266
+ };
@@ -0,0 +1,208 @@
1
+ import {Animator} from "../animator.js";
2
+
3
+
4
+ class Picker extends Animator {
5
+ constructor(){
6
+ super();
7
+ this.el = null;
8
+ this.file = null;
9
+ this.selected = "";
10
+ }
11
+
12
+
13
+
14
+
15
+
16
+
17
+ setup(obj, name){
18
+ let wrap = document.createElement("div");
19
+
20
+ let card = document.createElement("select");
21
+ card.setAttribute("type", "file");
22
+ card.setAttribute("name", name);
23
+
24
+
25
+
26
+ card.addEventListener("change", () => {
27
+
28
+ let picked = card.options[card.selectedIndex].value;
29
+ // console.log(picked);
30
+ });
31
+
32
+
33
+ /*var z = document.createElement("option");
34
+ z.setAttribute("value", "volvocar");
35
+ var t = document.createTextNode("Volvo");
36
+ z.appendChild(t);
37
+ */
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+ for (var i = 0; i < obj.length; i++){
49
+ card.appendChild(this.addNode(obj[i][0], obj[i][1]));
50
+ }
51
+
52
+ /*card.appendChild(this.addNode("audi", "Audi"));
53
+ card.appendChild(this.addNode("audi", "Audi"));
54
+ card.appendChild(this.addNode("audi", "Audi"));
55
+ */
56
+
57
+ this.el = card;
58
+ return this;
59
+ }
60
+
61
+ set(obj){
62
+ this.options = obj;
63
+ obj.items && this.setup(obj.items, obj.name);
64
+ obj.arrayPadding && this.arrayPadding(obj.arrayPadding.sides, obj.arrayPadding.value);
65
+ obj.arrayMargin && this.arrayMargin(obj.arrayMargin.sides, obj.arrayMargin.value);
66
+ obj.pad && this.pad(obj.pad);
67
+ obj.mar && this.mar(obj.mar);
68
+
69
+ obj.radius && (this.el.style.borderRadius = obj.radius);
70
+ obj.background && (this.el.style.background = obj.background);
71
+ return this;
72
+ }
73
+
74
+ arrayPadding(arr, value) {
75
+ //alert("PP")
76
+ //console.log(arr);
77
+ if (arr.includes("left")){
78
+ this.el.style.paddingLeft = value;
79
+ }
80
+
81
+ // console.log("PAD");
82
+ // console.log(this.res.style.paddingLeft);
83
+ // console.log(arr);
84
+ // console.log(value);
85
+
86
+ if (arr.includes("right")){
87
+ this.el.style.paddingRight = value;
88
+ }
89
+
90
+ if (arr.includes("top")){
91
+ this.el.style.paddingTop = value;
92
+ }
93
+
94
+ if (arr.includes("bottom")){
95
+ this.el.style.paddingBottom = value;
96
+ }
97
+
98
+ if (arr.includes("all")){
99
+ this.el.style.padding = value;
100
+ }
101
+
102
+
103
+ return this;
104
+ }
105
+
106
+ arrayMargin(arr, value) {
107
+ //alert("PP")
108
+ // console.log(arr);
109
+ if (arr.includes("left")){
110
+ this.el.style.marginLeft = value;
111
+ }
112
+
113
+ // console.log("PAD");
114
+ // console.log(this.res.style.paddingLeft);
115
+ // console.log(arr);
116
+ // console.log(value);
117
+
118
+ if (arr.includes("right")){
119
+ this.el.style.marginRight = value;
120
+ }
121
+
122
+ if (arr.includes("top")){
123
+ this.el.style.marginTop = value;
124
+ }
125
+
126
+ if (arr.includes("bottom")){
127
+ this.el.style.marginBottom = value;
128
+ }
129
+
130
+ if (arr.includes("all")){
131
+ this.el.style.margin = value;
132
+ }
133
+
134
+
135
+ return this;
136
+ }
137
+
138
+
139
+
140
+ addNode(value, text){
141
+ var z = document.createElement("option");
142
+ z.setAttribute("value", value);
143
+ var t = document.createTextNode(text);
144
+ z.appendChild(t);
145
+ return z;
146
+ }
147
+
148
+ padding(val){
149
+ this.el.style.padding = val;
150
+ return this;
151
+ }
152
+
153
+
154
+ font(font){
155
+ this.el.style.fontFamily = font;
156
+ return this;
157
+ }
158
+
159
+ margin(val){
160
+ this.el.style.margin = val;
161
+ return this;
162
+ }
163
+
164
+ toCode() {
165
+ let objString = JSON.stringify(this.options, null, 4);
166
+ objString = objString.replace(/"(\w+)"(?=\s*:)/g, '$1');
167
+ return [`new Picker().set(${objString})`];
168
+ }
169
+
170
+
171
+ rounded(el){
172
+ this.el.style.borderRadius = "4px";
173
+ return this;
174
+ }
175
+
176
+ auto() {
177
+ const adj = () => {
178
+ let query = window.matchMedia("(max-device-width: 415px)");
179
+ if (query.matches) {
180
+ this.el.style.fontSize = '3rem';
181
+ } else {
182
+ this.el.style.fontSize = '1rem';
183
+ }
184
+ }
185
+
186
+ adj();
187
+ window.addEventListener("resize", adj);
188
+ return this;
189
+ }
190
+
191
+ render(div){
192
+ if (div){
193
+ document.querySelector(div).appendChild(this.el);
194
+
195
+ } else {
196
+ return this.el;
197
+ }
198
+ }
199
+ }
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ window.Picker = Picker;
208
+ export { Picker };
@@ -0,0 +1,231 @@
1
+ import {Animator} from "../animator.js";
2
+
3
+ class RadioGroup /*extends Animator*/ {
4
+ constructor(){
5
+ // super();
6
+ this.el = null;
7
+ this.radioCount = 0;
8
+ // this.setup();
9
+ }
10
+
11
+ set(objects){
12
+
13
+ this.options = objects;
14
+ console.log("ORARA");
15
+ console.log(this.options);
16
+
17
+
18
+ this.radioCount = objects.items.length;
19
+
20
+ let wrap = document.createElement("div");
21
+
22
+
23
+ let obj = objects.items;
24
+
25
+ for (var i = 0; i < obj.length; i++){
26
+
27
+
28
+ let label = document.createElement("label");
29
+
30
+ if (obj.font){
31
+ label.style.font = obj.font;
32
+ }
33
+
34
+ if (obj.color){
35
+ label.style.color = obj.color;
36
+ }
37
+
38
+ if (obj.exact){
39
+ label.style.fontSize = obj.exact;
40
+ }
41
+
42
+
43
+
44
+
45
+ let node = document.createTextNode(obj[i]);
46
+ label.appendChild(node);
47
+ label.setAttribute("for", obj[i]);
48
+
49
+ let card = document.createElement("input");
50
+ card.setAttribute("type", "radio");
51
+ card.setAttribute("id", `S${i}`);
52
+ card.setAttribute("value", obj[i].split(" ").join(""));
53
+
54
+ card.style.appearance = 'none';
55
+ card.style.width = '20px';
56
+ card.style.height = '20px';
57
+ card.style.border = this.options.tint ? `2px solid ${this.options.tint}` : '2px solid #007BFF';
58
+ card.style.borderRadius = '50%';
59
+ card.style.outline = 'none';
60
+ card.style.cursor = 'pointer';
61
+ card.style.transition = '0.3s';
62
+
63
+ // card.addEventListener('change', () => {
64
+ // alert("change");
65
+ /* if (card.checked) {
66
+ card.style.backgroundColor = '#007BFF';
67
+ card.style.boxShadow = '0 0 0 2px #0056b3 inset';
68
+ } else {
69
+ card.style.backgroundColor = 'transparent';
70
+ card.style.boxShadow = 'none';
71
+ }*/
72
+ // });
73
+
74
+ this.options.font && (label.style.fontFamily = this.options.font);
75
+
76
+ if (objects.multiple){
77
+ card.setAttribute("name", obj[i].split(" ").join(""));
78
+ } else {
79
+ card.setAttribute("name", objects.name);
80
+ // card.setAttribute("name", "same");
81
+ }
82
+
83
+
84
+ /* card.addEventListener("change", () => {
85
+ let picked = card.options[card.selectedIndex].value;
86
+ console.log(picked);
87
+ });*/
88
+
89
+
90
+ wrap.appendChild(card);
91
+ wrap.appendChild(label);
92
+ wrap.innerHTML += "</br>";
93
+
94
+ }
95
+
96
+ this.el = wrap;
97
+
98
+ this.responsive();
99
+ return this;
100
+ }
101
+
102
+
103
+
104
+ padding(val){
105
+ this.el.style.padding = val;
106
+ return this;
107
+ }
108
+
109
+ getCheckedValues(){
110
+ console.log("NOW");
111
+
112
+ var values = [];
113
+
114
+ for (var i = 0; i < this.radioCount; i++){
115
+
116
+
117
+ if (document.querySelector(`#S${i}`).checked) {
118
+ let value = document.querySelector(`#S${i}`);
119
+ console.log("VALUE IS " + value.value);
120
+ values.push(value.value);
121
+ }
122
+ }
123
+
124
+
125
+
126
+ return values;
127
+ }
128
+
129
+ toCode() {
130
+ /*let objString = JSON.stringify(
131
+ this.options,
132
+ (key, value) => (typeof key === "string" && key !== "" ? value : value),
133
+ 4
134
+ );*/
135
+
136
+ // 155735 preventing problem, no removal
137
+ let objString = JSON.stringify(this.options, null, 4);
138
+ objString = objString.replace(/"(\w+)"(?=\s*:)/g, '$1');
139
+ return [`new RadioGroup().set(${objString})`];
140
+ }
141
+
142
+
143
+
144
+ responsive(){
145
+ let query = window.matchMedia("(max-device-width: 415px)");
146
+
147
+ // window.matchMedia(query)
148
+ if (query.matches){
149
+ this.el.style.fontSize = "1.7em";
150
+ }
151
+
152
+ return this;
153
+ }
154
+
155
+
156
+
157
+ render(div){
158
+ if (div){
159
+ document.querySelector(div).appendChild(this.el);
160
+
161
+
162
+
163
+
164
+ } else {
165
+
166
+
167
+
168
+
169
+ console.log("MULA");
170
+ // console.log(this.el.children[0]);
171
+
172
+
173
+
174
+ for (var i = 0; i < this.el.children.length; i++){
175
+
176
+ let card = this.el.children[i];
177
+ // console.log(card.toString());
178
+
179
+
180
+
181
+
182
+ if (card.toString() === "[object HTMLInputElement]") {
183
+ card.addEventListener('change', () => {
184
+ if (card.checked) {
185
+ card.style.backgroundColor = this.options.tint ? this.options.tint : '#007BFF';
186
+ card.style.boxShadow = this.options.tint ?`0 0 0 2px ${this.options.tint} inset` : '0 0 0 2px #0056b3 inset';
187
+
188
+ // Reset styles for other radio buttons in the group
189
+ for (let j = 0; j < this.el.children.length; j++) {
190
+ const sibling = this.el.children[j];
191
+ // alert(this.options.multiple);
192
+ // Check if the sibling is an input element
193
+ if (sibling.tagName === 'INPUT' && sibling.type === 'radio') {
194
+ // Avoid resetting the current radio button
195
+ if (this.options.multiple === false && sibling !== card) {
196
+ sibling.style.backgroundColor = 'transparent';
197
+ sibling.style.boxShadow = 'none';
198
+ }
199
+ }
200
+ }
201
+ } else {
202
+ card.style.backgroundColor = 'transparent';
203
+ card.style.boxShadow = 'none';
204
+ }
205
+ });
206
+ }
207
+
208
+
209
+
210
+ }
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ return this.el;
220
+ }
221
+
222
+ }
223
+ }
224
+
225
+
226
+
227
+
228
+
229
+
230
+ window.RadioGroup = RadioGroup;
231
+ export { RadioGroup };