jsuites 6.4.2 → 6.4.3

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 (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +119 -119
  3. package/dist/jsuites.css +3424 -3424
  4. package/dist/jsuites.d.ts +10 -10
  5. package/dist/jsuites.js +22475 -22450
  6. package/dist/jsuites.webcomponents.js +501 -501
  7. package/dist/types/animation.d.ts +23 -23
  8. package/dist/types/calendar.d.ts +87 -87
  9. package/dist/types/color.d.ts +50 -50
  10. package/dist/types/contextmenu.d.ts +43 -43
  11. package/dist/types/dropdown.d.ts +177 -177
  12. package/dist/types/editor.d.ts +96 -96
  13. package/dist/types/floating.d.ts +23 -23
  14. package/dist/types/form.d.ts +57 -57
  15. package/dist/types/index.d.ts +59 -59
  16. package/dist/types/mask.d.ts +50 -50
  17. package/dist/types/modal.d.ts +35 -35
  18. package/dist/types/notification.d.ts +27 -27
  19. package/dist/types/picker.d.ts +45 -45
  20. package/dist/types/rating.d.ts +19 -19
  21. package/dist/types/search.d.ts +23 -23
  22. package/dist/types/slider.d.ts +31 -31
  23. package/dist/types/tabs.d.ts +79 -79
  24. package/dist/types/tags.d.ts +105 -105
  25. package/dist/types/toolbar.d.ts +70 -70
  26. package/dist/types/upload.d.ts +45 -45
  27. package/dist/types/validations.d.ts +39 -39
  28. package/package.json +4 -4
  29. package/react/calendar/index.d.ts +105 -105
  30. package/react/calendar/index.js +28 -28
  31. package/react/color/index.d.ts +84 -84
  32. package/react/color/index.js +28 -28
  33. package/react/contextmenu/index.d.ts +61 -61
  34. package/react/contextmenu/index.js +24 -24
  35. package/react/dropdown/index.d.ts +184 -184
  36. package/react/dropdown/index.js +25 -25
  37. package/react/editor/index.d.ts +114 -114
  38. package/react/editor/index.js +31 -31
  39. package/react/index.js +26 -26
  40. package/react/modal/index.d.ts +53 -53
  41. package/react/modal/index.js +30 -30
  42. package/react/picker/index.d.ts +64 -64
  43. package/react/picker/index.js +28 -28
  44. package/react/rating/index.d.ts +37 -37
  45. package/react/rating/index.js +28 -28
  46. package/react/slider/index.d.ts +49 -49
  47. package/react/slider/index.js +30 -30
  48. package/react/tabs/index.d.ts +97 -97
  49. package/react/tabs/index.js +29 -29
  50. package/react/tags/index.d.ts +121 -121
  51. package/react/tags/index.js +24 -24
  52. package/react/toolbar/index.d.ts +88 -88
  53. package/react/toolbar/index.js +24 -24
  54. package/vue/calendar/index.d.ts +105 -105
  55. package/vue/calendar/index.js +36 -36
  56. package/vue/color/index.d.ts +84 -84
  57. package/vue/color/index.js +36 -36
  58. package/vue/contextmenu/index.d.ts +61 -61
  59. package/vue/contextmenu/index.js +21 -21
  60. package/vue/dropdown/index.d.ts +184 -184
  61. package/vue/dropdown/index.js +25 -25
  62. package/vue/editor/index.d.ts +114 -114
  63. package/vue/editor/index.js +40 -40
  64. package/vue/index.js +40 -40
  65. package/vue/modal/index.d.ts +53 -53
  66. package/vue/modal/index.js +41 -41
  67. package/vue/picker/index.d.ts +64 -64
  68. package/vue/picker/index.js +36 -36
  69. package/vue/rating/index.d.ts +37 -37
  70. package/vue/rating/index.js +36 -36
  71. package/vue/slider/index.d.ts +49 -49
  72. package/vue/slider/index.js +33 -33
  73. package/vue/tabs/index.d.ts +97 -97
  74. package/vue/tabs/index.js +28 -28
  75. package/vue/tags/index.d.ts +121 -121
  76. package/vue/tags/index.js +21 -21
  77. package/vue/toolbar/index.d.ts +88 -88
  78. package/vue/toolbar/index.js +21 -21
@@ -1,501 +1,501 @@
1
-
2
- /**
3
- * (c) jSuites Javascript Web Components
4
- *
5
- * Website: https://jsuites.net
6
- * Description: Create amazing web based applications.
7
- *
8
- * MIT License
9
- *
10
- */
11
-
12
- class JsuitesCalendar extends HTMLElement {
13
- constructor() {
14
- // always call super() first
15
- super();
16
- }
17
-
18
- init(o) {
19
- // Create element
20
- this.input = document.createElement('input');
21
- // Append to the DOM
22
- o.appendChild(this.input);
23
- // Place holder
24
- var placeholder = o.getAttribute('placeholder');
25
- // Place holder
26
- var format = o.getAttribute('format');
27
- // Place holder
28
- var time = o.getAttribute('time');
29
- // Initial value
30
- var value = o.getAttribute('value');
31
- if (value) {
32
- this.input.value = value;
33
- o.value = value;
34
- }
35
- // Component
36
- jSuites.calendar(this.input, {
37
- value: value ? value : null,
38
- placeholder: placeholder ? placeholder : null,
39
- format: format ? format : 'YYYY-MM-DD',
40
- time: time ? true : false,
41
- onchange: function(el, val) {
42
- // Change value of the element
43
- el.setAttribute('value', val);
44
- o.setAttribute('value', val);
45
- o.value = val;
46
- // Basic HTML event
47
- var s = o.getAttribute('onchange');
48
- if (s) {
49
- eval(s);
50
- }
51
- // Trigger event
52
- var e = new CustomEvent("onchange");
53
- el.parentNode.dispatchEvent(e);
54
- },
55
- onclose: function(el) {
56
- // Basic HTML event
57
- var s = o.getAttribute('onclose');
58
- if (s) {
59
- eval(s);
60
- }
61
- // Trigger event
62
- var e = new CustomEvent("onclose");
63
- el.parentNode.dispatchEvent(e);
64
- }
65
- });
66
- }
67
-
68
- connectedCallback() {
69
- if (! this.input) {
70
- this.init(this);
71
- }
72
- }
73
-
74
- disconnectedCallback() {
75
- }
76
-
77
- attributeChangedCallback(name, oldVal, newVal) {
78
- }
79
- }
80
-
81
- window.customElements.define('jsuites-calendar', JsuitesCalendar);
82
-
83
- class JsuitesColor extends HTMLElement {
84
- constructor() {
85
- // always call super() first
86
- super();
87
- }
88
-
89
- init(o) {
90
- // Create element
91
- this.input = document.createElement('input');
92
- // Append to the DOM
93
- o.appendChild(this.input);
94
- // Place holder
95
- var placeholder = o.getAttribute('placeholder');
96
- // Initial value
97
- var value = o.getAttribute('value');
98
- if (value) {
99
- o.value = value;
100
- }
101
- // Component
102
- jSuites.color(this.input, {
103
- value: value ? value : null,
104
- placeholder: placeholder ? placeholder : null,
105
- onchange: function(el, color) {
106
- // Change value of the element
107
- o.setAttribute('value', color);
108
- o.value = color;
109
- // Basic HTML event
110
- var s = o.getAttribute('onchange');
111
- if (s) {
112
- eval(s);
113
- }
114
- // Trigger event
115
- var e = new CustomEvent("onchange");
116
- el.parentNode.dispatchEvent(e);
117
- },
118
- onclose: function(el) {
119
- // Basic HTML event
120
- var s = o.getAttribute('onclose');
121
- if (s) {
122
- eval(s);
123
- }
124
- // Trigger event
125
- var e = new CustomEvent("onclose");
126
- el.parentNode.dispatchEvent(e);
127
- }
128
- });
129
- }
130
-
131
- connectedCallback() {
132
- if (! this.input) {
133
- this.init(this);
134
- }
135
- }
136
-
137
- disconnectedCallback() {
138
- }
139
-
140
- attributeChangedCallback(name, oldVal, newVal) {
141
- }
142
- }
143
-
144
- window.customElements.define('jsuites-color', JsuitesColor);
145
-
146
- class JsuitesContextmenu extends HTMLElement {
147
- constructor() {
148
- // always call super() first
149
- super();
150
- }
151
-
152
- init(o) {
153
- this.el = jSuites.contextmenu(o, {
154
- items: null,
155
- onclick: function(a) {
156
- a.close();
157
- }
158
- });
159
- }
160
-
161
- connectedCallback() {
162
- if (! this.el) {
163
- this.init(this);
164
- }
165
- }
166
-
167
- disconnectedCallback() {
168
- }
169
-
170
- attributeChangedCallback(name, oldVal, newVal) {
171
- }
172
- }
173
-
174
- window.customElements.define('jsuites-contextmenu', JsuitesContextmenu);
175
-
176
- class JsuitesEditor extends HTMLElement {
177
- constructor() {
178
- // always call super() first
179
- super();
180
- }
181
-
182
- init(o) {
183
- this.el = document.createElement('div');
184
-
185
- // Options
186
- var options = {};
187
- // Initial values
188
- var toolbar = o.getAttribute('toolbar');
189
- if (toolbar) {
190
- options.toolbar = toolbar;
191
- }
192
-
193
- // Events
194
- options.onload = function(el, obj) {
195
- // Basic HTML event
196
- var s = o.getAttribute('onload');
197
- if (s) {
198
- eval(s);
199
- }
200
- // Trigger event
201
- var e = new CustomEvent("onload");
202
- el.dispatchEvent(e);
203
- }
204
-
205
- options.onclick = function(el, obj) {
206
- // Basic HTML event
207
- var s = o.getAttribute('onclick');
208
- if (s) {
209
- eval(s);
210
- }
211
- // Trigger event
212
- var e = new CustomEvent("onclick");
213
- el.dispatchEvent(e);
214
- }
215
-
216
- options.onfocus = function(el, obj) {
217
- // Basic HTML event
218
- var s = o.getAttribute('onfocus');
219
- if (s) {
220
- eval(s);
221
- }
222
- // Trigger event
223
- var e = new CustomEvent("onfocus");
224
- el.dispatchEvent(e);
225
- }
226
-
227
- options.onblur = function(el, obj) {
228
- // Basic HTML event
229
- var s = o.getAttribute('onblur');
230
- if (s) {
231
- eval(s);
232
- }
233
- // Trigger event
234
- var e = new CustomEvent("onblur");
235
- el.dispatchEvent(e);
236
- }
237
-
238
- options.onclose = function(el, obj) {
239
- // Basic HTML event
240
- var s = o.getAttribute('onclose');
241
- if (s) {
242
- eval(s);
243
- }
244
- // Trigger event
245
- var e = new CustomEvent("onclose");
246
- el.dispatchEvent(e);
247
- }
248
-
249
- setTimeout(function() {
250
- jSuites.editor(o, options);
251
- }, 0);
252
- }
253
-
254
- connectedCallback() {
255
- if (! this.el) {
256
- this.init(this);
257
- }
258
- }
259
-
260
- disconnectedCallback() {
261
- }
262
-
263
- attributeChangedCallback(name, oldVal, newVal) {
264
- }
265
- }
266
-
267
- window.customElements.define('jsuites-editor', JsuitesEditor);
268
-
269
- class JsuitesModal extends HTMLElement {
270
- constructor() {
271
- // always call super() first
272
- super();
273
- }
274
-
275
- init(o) {
276
- this.el = document.createElement('div');
277
-
278
- // Options
279
- var options = {};
280
- // Initial values
281
- var title = o.getAttribute('title');
282
- if (title) {
283
- options.title = title;
284
- }
285
- var width = o.getAttribute('width');
286
- if (width) {
287
- options.width = parseInt(width) + 'px';
288
- }
289
- var height = o.getAttribute('height');
290
- if (height) {
291
- options.height = parseInt(height) + 'px';
292
- }
293
- var closed = o.getAttribute('closed');
294
- if (closed) {
295
- options.closed = closed;
296
- }
297
-
298
- // Events
299
- options.onopen = function(el, obj) {
300
- // Basic HTML event
301
- var s = o.getAttribute('onopen');
302
- if (s) {
303
- eval(s);
304
- }
305
- // Trigger event
306
- var e = new CustomEvent("onopen");
307
- el.dispatchEvent(e);
308
- }
309
-
310
- options.onclose = function(el, obj) {
311
- // Basic HTML event
312
- var s = o.getAttribute('onclose');
313
- if (s) {
314
- eval(s);
315
- }
316
- // Trigger event
317
- var e = new CustomEvent("onclose");
318
- el.dispatchEvent(e);
319
- }
320
-
321
- setTimeout(function() {
322
- jSuites.modal(o, options);
323
- }, 0);
324
- }
325
-
326
- connectedCallback() {
327
- if (! this.el) {
328
- this.init(this);
329
- }
330
- }
331
-
332
- disconnectedCallback() {
333
- }
334
-
335
- attributeChangedCallback(name, oldVal, newVal) {
336
- }
337
- }
338
-
339
- window.customElements.define('jsuites-modal', JsuitesModal);
340
-
341
- class JsuitesRating extends HTMLElement {
342
- constructor() {
343
- // always call super() first
344
- super();
345
- }
346
-
347
- init(o) {
348
- // Initial values
349
- var value = o.getAttribute('value') ? o.getAttribute('value') : null;
350
- var number = o.getAttribute('number') ? o.getAttribute('number') : 5;
351
- var tooltip = o.getAttribute('tooltip') ? o.getAttribute('tooltip') : null;
352
- if (tooltip) {
353
- tooltip = tooltip.split(',');
354
- } else {
355
- tooltip = [ 'Very bad', 'Bad', 'Average', 'Good', 'Very good' ];
356
- }
357
-
358
- jSuites.rating(o, {
359
- value: value,
360
- number: number,
361
- tooltip: tooltip,
362
- onchange: function(el, v) {
363
- // Change value of the element
364
- o.setAttribute('value', v);
365
- o.value = v;
366
- // Basic HTML event
367
- var s = o.getAttribute('onchange');
368
- if (s) {
369
- eval(s);
370
- }
371
- // Trigger event
372
- var e = new CustomEvent("onchange");
373
- el.dispatchEvent(e);
374
- }
375
- });
376
-
377
- // Initiated
378
- this.initiated = true;
379
- }
380
-
381
- connectedCallback() {
382
- if (! this.initiated) {
383
- this.init(this);
384
- }
385
- }
386
-
387
- disconnectedCallback() {
388
- }
389
-
390
- attributeChangedCallback(name, oldVal, newVal) {
391
- }
392
- }
393
-
394
- window.customElements.define('jsuites-rating', JsuitesRating);
395
-
396
- class JsuitesTags extends HTMLElement {
397
- constructor() {
398
- // always call super() first
399
- super();
400
- }
401
-
402
- init(o) {
403
- // Initial values
404
- var value = o.getAttribute('value') ? o.getAttribute('value') : null;
405
- var limit = o.getAttribute('limit') ? o.getAttribute('limit') : null;
406
- var search = o.getAttribute('search') ? o.getAttribute('search') : null;
407
- var placeholder = o.getAttribute('placeholder') ? o.getAttribute('placeholder') : null;
408
-
409
- jSuites.tags(o, {
410
- value: value,
411
- limit: limit,
412
- search: search,
413
- placeholder: placeholder,
414
- onbeforechange: function(el, obj, v) {
415
- // Basic HTML event
416
- var s = o.getAttribute('onbeforechange');
417
- if (s) {
418
- var newValue = eval(s);
419
- if (newValue != null) {
420
- return newValue;
421
- }
422
- } else {
423
- // Trigger event
424
- var e = new CustomEvent("onbeforechange");
425
- el.dispatchEvent(e);
426
- }
427
- },
428
- onchange: function(el, obj, v) {
429
- var newValue = obj.getValue();
430
- // Change value of the element
431
- o.setAttribute('value', newValue);
432
- o.value = newValue;
433
- // Basic HTML event
434
- var s = o.getAttribute('onchange');
435
- if (s) {
436
- eval(s);
437
- } else {
438
- // Trigger event
439
- var e = new CustomEvent("onchange");
440
- el.dispatchEvent(e);
441
- }
442
- },
443
- onfocus: function(el, obj, v) {
444
- // Basic HTML event
445
- var s = o.getAttribute('onfocus');
446
- if (s) {
447
- eval(s);
448
- } else {
449
- // Trigger event
450
- var e = new CustomEvent("onfocus");
451
- el.dispatchEvent(e);
452
- }
453
- },
454
- onblur: function(el, obj, v) {
455
- var newValue = obj.getValue();
456
- // Change value of the element
457
- o.setAttribute('value', newValue);
458
- o.value = newValue;
459
- // Basic HTML event
460
- var s = o.getAttribute('onblur');
461
- if (s) {
462
- eval(s);
463
- } else {
464
- // Trigger event
465
- var e = new CustomEvent("onblur");
466
- el.dispatchEvent(e);
467
- }
468
- },
469
- onload: function(el, obj) {
470
- // Basic HTML event
471
- var s = o.getAttribute('onload');
472
- if (s) {
473
- eval(s);
474
- } else {
475
- // Trigger event
476
- var e = new CustomEvent("onload");
477
- el.dispatchEvent(e);
478
- }
479
- }
480
- });
481
-
482
- // Initiated
483
- this.initiated = true;
484
- }
485
-
486
- connectedCallback() {
487
- if (! this.initiated) {
488
- this.init(this);
489
- }
490
- }
491
-
492
- disconnectedCallback() {
493
- }
494
-
495
- attributeChangedCallback(name, oldVal, newVal) {
496
- }
497
- }
498
-
499
- window.customElements.define('jsuites-tags', JsuitesTags);
500
-
501
-
1
+
2
+ /**
3
+ * (c) jSuites Javascript Web Components
4
+ *
5
+ * Website: https://jsuites.net
6
+ * Description: Create amazing web based applications.
7
+ *
8
+ * MIT License
9
+ *
10
+ */
11
+
12
+ class JsuitesCalendar extends HTMLElement {
13
+ constructor() {
14
+ // always call super() first
15
+ super();
16
+ }
17
+
18
+ init(o) {
19
+ // Create element
20
+ this.input = document.createElement('input');
21
+ // Append to the DOM
22
+ o.appendChild(this.input);
23
+ // Place holder
24
+ var placeholder = o.getAttribute('placeholder');
25
+ // Place holder
26
+ var format = o.getAttribute('format');
27
+ // Place holder
28
+ var time = o.getAttribute('time');
29
+ // Initial value
30
+ var value = o.getAttribute('value');
31
+ if (value) {
32
+ this.input.value = value;
33
+ o.value = value;
34
+ }
35
+ // Component
36
+ jSuites.calendar(this.input, {
37
+ value: value ? value : null,
38
+ placeholder: placeholder ? placeholder : null,
39
+ format: format ? format : 'YYYY-MM-DD',
40
+ time: time ? true : false,
41
+ onchange: function(el, val) {
42
+ // Change value of the element
43
+ el.setAttribute('value', val);
44
+ o.setAttribute('value', val);
45
+ o.value = val;
46
+ // Basic HTML event
47
+ var s = o.getAttribute('onchange');
48
+ if (s) {
49
+ eval(s);
50
+ }
51
+ // Trigger event
52
+ var e = new CustomEvent("onchange");
53
+ el.parentNode.dispatchEvent(e);
54
+ },
55
+ onclose: function(el) {
56
+ // Basic HTML event
57
+ var s = o.getAttribute('onclose');
58
+ if (s) {
59
+ eval(s);
60
+ }
61
+ // Trigger event
62
+ var e = new CustomEvent("onclose");
63
+ el.parentNode.dispatchEvent(e);
64
+ }
65
+ });
66
+ }
67
+
68
+ connectedCallback() {
69
+ if (! this.input) {
70
+ this.init(this);
71
+ }
72
+ }
73
+
74
+ disconnectedCallback() {
75
+ }
76
+
77
+ attributeChangedCallback(name, oldVal, newVal) {
78
+ }
79
+ }
80
+
81
+ window.customElements.define('jsuites-calendar', JsuitesCalendar);
82
+
83
+ class JsuitesColor extends HTMLElement {
84
+ constructor() {
85
+ // always call super() first
86
+ super();
87
+ }
88
+
89
+ init(o) {
90
+ // Create element
91
+ this.input = document.createElement('input');
92
+ // Append to the DOM
93
+ o.appendChild(this.input);
94
+ // Place holder
95
+ var placeholder = o.getAttribute('placeholder');
96
+ // Initial value
97
+ var value = o.getAttribute('value');
98
+ if (value) {
99
+ o.value = value;
100
+ }
101
+ // Component
102
+ jSuites.color(this.input, {
103
+ value: value ? value : null,
104
+ placeholder: placeholder ? placeholder : null,
105
+ onchange: function(el, color) {
106
+ // Change value of the element
107
+ o.setAttribute('value', color);
108
+ o.value = color;
109
+ // Basic HTML event
110
+ var s = o.getAttribute('onchange');
111
+ if (s) {
112
+ eval(s);
113
+ }
114
+ // Trigger event
115
+ var e = new CustomEvent("onchange");
116
+ el.parentNode.dispatchEvent(e);
117
+ },
118
+ onclose: function(el) {
119
+ // Basic HTML event
120
+ var s = o.getAttribute('onclose');
121
+ if (s) {
122
+ eval(s);
123
+ }
124
+ // Trigger event
125
+ var e = new CustomEvent("onclose");
126
+ el.parentNode.dispatchEvent(e);
127
+ }
128
+ });
129
+ }
130
+
131
+ connectedCallback() {
132
+ if (! this.input) {
133
+ this.init(this);
134
+ }
135
+ }
136
+
137
+ disconnectedCallback() {
138
+ }
139
+
140
+ attributeChangedCallback(name, oldVal, newVal) {
141
+ }
142
+ }
143
+
144
+ window.customElements.define('jsuites-color', JsuitesColor);
145
+
146
+ class JsuitesContextmenu extends HTMLElement {
147
+ constructor() {
148
+ // always call super() first
149
+ super();
150
+ }
151
+
152
+ init(o) {
153
+ this.el = jSuites.contextmenu(o, {
154
+ items: null,
155
+ onclick: function(a) {
156
+ a.close();
157
+ }
158
+ });
159
+ }
160
+
161
+ connectedCallback() {
162
+ if (! this.el) {
163
+ this.init(this);
164
+ }
165
+ }
166
+
167
+ disconnectedCallback() {
168
+ }
169
+
170
+ attributeChangedCallback(name, oldVal, newVal) {
171
+ }
172
+ }
173
+
174
+ window.customElements.define('jsuites-contextmenu', JsuitesContextmenu);
175
+
176
+ class JsuitesEditor extends HTMLElement {
177
+ constructor() {
178
+ // always call super() first
179
+ super();
180
+ }
181
+
182
+ init(o) {
183
+ this.el = document.createElement('div');
184
+
185
+ // Options
186
+ var options = {};
187
+ // Initial values
188
+ var toolbar = o.getAttribute('toolbar');
189
+ if (toolbar) {
190
+ options.toolbar = toolbar;
191
+ }
192
+
193
+ // Events
194
+ options.onload = function(el, obj) {
195
+ // Basic HTML event
196
+ var s = o.getAttribute('onload');
197
+ if (s) {
198
+ eval(s);
199
+ }
200
+ // Trigger event
201
+ var e = new CustomEvent("onload");
202
+ el.dispatchEvent(e);
203
+ }
204
+
205
+ options.onclick = function(el, obj) {
206
+ // Basic HTML event
207
+ var s = o.getAttribute('onclick');
208
+ if (s) {
209
+ eval(s);
210
+ }
211
+ // Trigger event
212
+ var e = new CustomEvent("onclick");
213
+ el.dispatchEvent(e);
214
+ }
215
+
216
+ options.onfocus = function(el, obj) {
217
+ // Basic HTML event
218
+ var s = o.getAttribute('onfocus');
219
+ if (s) {
220
+ eval(s);
221
+ }
222
+ // Trigger event
223
+ var e = new CustomEvent("onfocus");
224
+ el.dispatchEvent(e);
225
+ }
226
+
227
+ options.onblur = function(el, obj) {
228
+ // Basic HTML event
229
+ var s = o.getAttribute('onblur');
230
+ if (s) {
231
+ eval(s);
232
+ }
233
+ // Trigger event
234
+ var e = new CustomEvent("onblur");
235
+ el.dispatchEvent(e);
236
+ }
237
+
238
+ options.onclose = function(el, obj) {
239
+ // Basic HTML event
240
+ var s = o.getAttribute('onclose');
241
+ if (s) {
242
+ eval(s);
243
+ }
244
+ // Trigger event
245
+ var e = new CustomEvent("onclose");
246
+ el.dispatchEvent(e);
247
+ }
248
+
249
+ setTimeout(function() {
250
+ jSuites.editor(o, options);
251
+ }, 0);
252
+ }
253
+
254
+ connectedCallback() {
255
+ if (! this.el) {
256
+ this.init(this);
257
+ }
258
+ }
259
+
260
+ disconnectedCallback() {
261
+ }
262
+
263
+ attributeChangedCallback(name, oldVal, newVal) {
264
+ }
265
+ }
266
+
267
+ window.customElements.define('jsuites-editor', JsuitesEditor);
268
+
269
+ class JsuitesModal extends HTMLElement {
270
+ constructor() {
271
+ // always call super() first
272
+ super();
273
+ }
274
+
275
+ init(o) {
276
+ this.el = document.createElement('div');
277
+
278
+ // Options
279
+ var options = {};
280
+ // Initial values
281
+ var title = o.getAttribute('title');
282
+ if (title) {
283
+ options.title = title;
284
+ }
285
+ var width = o.getAttribute('width');
286
+ if (width) {
287
+ options.width = parseInt(width) + 'px';
288
+ }
289
+ var height = o.getAttribute('height');
290
+ if (height) {
291
+ options.height = parseInt(height) + 'px';
292
+ }
293
+ var closed = o.getAttribute('closed');
294
+ if (closed) {
295
+ options.closed = closed;
296
+ }
297
+
298
+ // Events
299
+ options.onopen = function(el, obj) {
300
+ // Basic HTML event
301
+ var s = o.getAttribute('onopen');
302
+ if (s) {
303
+ eval(s);
304
+ }
305
+ // Trigger event
306
+ var e = new CustomEvent("onopen");
307
+ el.dispatchEvent(e);
308
+ }
309
+
310
+ options.onclose = function(el, obj) {
311
+ // Basic HTML event
312
+ var s = o.getAttribute('onclose');
313
+ if (s) {
314
+ eval(s);
315
+ }
316
+ // Trigger event
317
+ var e = new CustomEvent("onclose");
318
+ el.dispatchEvent(e);
319
+ }
320
+
321
+ setTimeout(function() {
322
+ jSuites.modal(o, options);
323
+ }, 0);
324
+ }
325
+
326
+ connectedCallback() {
327
+ if (! this.el) {
328
+ this.init(this);
329
+ }
330
+ }
331
+
332
+ disconnectedCallback() {
333
+ }
334
+
335
+ attributeChangedCallback(name, oldVal, newVal) {
336
+ }
337
+ }
338
+
339
+ window.customElements.define('jsuites-modal', JsuitesModal);
340
+
341
+ class JsuitesRating extends HTMLElement {
342
+ constructor() {
343
+ // always call super() first
344
+ super();
345
+ }
346
+
347
+ init(o) {
348
+ // Initial values
349
+ var value = o.getAttribute('value') ? o.getAttribute('value') : null;
350
+ var number = o.getAttribute('number') ? o.getAttribute('number') : 5;
351
+ var tooltip = o.getAttribute('tooltip') ? o.getAttribute('tooltip') : null;
352
+ if (tooltip) {
353
+ tooltip = tooltip.split(',');
354
+ } else {
355
+ tooltip = [ 'Very bad', 'Bad', 'Average', 'Good', 'Very good' ];
356
+ }
357
+
358
+ jSuites.rating(o, {
359
+ value: value,
360
+ number: number,
361
+ tooltip: tooltip,
362
+ onchange: function(el, v) {
363
+ // Change value of the element
364
+ o.setAttribute('value', v);
365
+ o.value = v;
366
+ // Basic HTML event
367
+ var s = o.getAttribute('onchange');
368
+ if (s) {
369
+ eval(s);
370
+ }
371
+ // Trigger event
372
+ var e = new CustomEvent("onchange");
373
+ el.dispatchEvent(e);
374
+ }
375
+ });
376
+
377
+ // Initiated
378
+ this.initiated = true;
379
+ }
380
+
381
+ connectedCallback() {
382
+ if (! this.initiated) {
383
+ this.init(this);
384
+ }
385
+ }
386
+
387
+ disconnectedCallback() {
388
+ }
389
+
390
+ attributeChangedCallback(name, oldVal, newVal) {
391
+ }
392
+ }
393
+
394
+ window.customElements.define('jsuites-rating', JsuitesRating);
395
+
396
+ class JsuitesTags extends HTMLElement {
397
+ constructor() {
398
+ // always call super() first
399
+ super();
400
+ }
401
+
402
+ init(o) {
403
+ // Initial values
404
+ var value = o.getAttribute('value') ? o.getAttribute('value') : null;
405
+ var limit = o.getAttribute('limit') ? o.getAttribute('limit') : null;
406
+ var search = o.getAttribute('search') ? o.getAttribute('search') : null;
407
+ var placeholder = o.getAttribute('placeholder') ? o.getAttribute('placeholder') : null;
408
+
409
+ jSuites.tags(o, {
410
+ value: value,
411
+ limit: limit,
412
+ search: search,
413
+ placeholder: placeholder,
414
+ onbeforechange: function(el, obj, v) {
415
+ // Basic HTML event
416
+ var s = o.getAttribute('onbeforechange');
417
+ if (s) {
418
+ var newValue = eval(s);
419
+ if (newValue != null) {
420
+ return newValue;
421
+ }
422
+ } else {
423
+ // Trigger event
424
+ var e = new CustomEvent("onbeforechange");
425
+ el.dispatchEvent(e);
426
+ }
427
+ },
428
+ onchange: function(el, obj, v) {
429
+ var newValue = obj.getValue();
430
+ // Change value of the element
431
+ o.setAttribute('value', newValue);
432
+ o.value = newValue;
433
+ // Basic HTML event
434
+ var s = o.getAttribute('onchange');
435
+ if (s) {
436
+ eval(s);
437
+ } else {
438
+ // Trigger event
439
+ var e = new CustomEvent("onchange");
440
+ el.dispatchEvent(e);
441
+ }
442
+ },
443
+ onfocus: function(el, obj, v) {
444
+ // Basic HTML event
445
+ var s = o.getAttribute('onfocus');
446
+ if (s) {
447
+ eval(s);
448
+ } else {
449
+ // Trigger event
450
+ var e = new CustomEvent("onfocus");
451
+ el.dispatchEvent(e);
452
+ }
453
+ },
454
+ onblur: function(el, obj, v) {
455
+ var newValue = obj.getValue();
456
+ // Change value of the element
457
+ o.setAttribute('value', newValue);
458
+ o.value = newValue;
459
+ // Basic HTML event
460
+ var s = o.getAttribute('onblur');
461
+ if (s) {
462
+ eval(s);
463
+ } else {
464
+ // Trigger event
465
+ var e = new CustomEvent("onblur");
466
+ el.dispatchEvent(e);
467
+ }
468
+ },
469
+ onload: function(el, obj) {
470
+ // Basic HTML event
471
+ var s = o.getAttribute('onload');
472
+ if (s) {
473
+ eval(s);
474
+ } else {
475
+ // Trigger event
476
+ var e = new CustomEvent("onload");
477
+ el.dispatchEvent(e);
478
+ }
479
+ }
480
+ });
481
+
482
+ // Initiated
483
+ this.initiated = true;
484
+ }
485
+
486
+ connectedCallback() {
487
+ if (! this.initiated) {
488
+ this.init(this);
489
+ }
490
+ }
491
+
492
+ disconnectedCallback() {
493
+ }
494
+
495
+ attributeChangedCallback(name, oldVal, newVal) {
496
+ }
497
+ }
498
+
499
+ window.customElements.define('jsuites-tags', JsuitesTags);
500
+
501
+