jsl-ui 9.28.2 → 9.28.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.
- package/lib/components/IntervalComponent.d.ts +17 -17
- package/lib/components/IntervalComponent.js +65 -68
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -22
- package/lib/components/auto-suggest/AutoSuggestComponent.js +47 -49
- package/lib/components/button/ButtonComponent.d.ts +18 -18
- package/lib/components/button/ButtonComponent.js +29 -46
- package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -28
- package/lib/components/checkbox/CheckBoxComponent.js +81 -98
- package/lib/components/date/DateComponent.d.ts +32 -32
- package/lib/components/date/DateComponent.js +89 -106
- package/lib/components/date-range/DateRangeComponent.d.ts +35 -35
- package/lib/components/date-range/DateRangeComponent.js +123 -136
- package/lib/components/date-time/DateTimeComponent.d.ts +15 -15
- package/lib/components/date-time/DateTimeComponent.js +39 -53
- package/lib/components/dialog/DialogComponent.d.ts +67 -67
- package/lib/components/dialog/DialogComponent.js +198 -251
- package/lib/components/drop-down/DropDownComponent.d.ts +27 -27
- package/lib/components/drop-down/DropDownComponent.js +60 -74
- package/lib/components/expander/ExpanderComponent.d.ts +27 -27
- package/lib/components/expander/ExpanderComponent.js +89 -90
- package/lib/components/form-field/FormComponent.d.ts +12 -12
- package/lib/components/form-field/FormComponent.js +23 -26
- package/lib/components/form-field/FormFieldComponent.d.ts +39 -39
- package/lib/components/form-field/FormFieldComponent.js +138 -140
- package/lib/components/grid/GridComponent.d.ts +26 -26
- package/lib/components/grid/GridComponent.js +110 -116
- package/lib/components/input/InputComponent.d.ts +33 -33
- package/lib/components/input/InputComponent.js +126 -147
- package/lib/components/loading/LoadingComponent.d.ts +8 -8
- package/lib/components/loading/LoadingComponent.js +20 -22
- package/lib/components/navigation/NavigationComponent.d.ts +34 -34
- package/lib/components/navigation/NavigationComponent.js +45 -70
- package/lib/components/notification/Notification.d.ts +19 -19
- package/lib/components/notification/Notification.js +65 -69
- package/lib/components/number/NumberComponent.d.ts +26 -26
- package/lib/components/number/NumberComponent.js +80 -98
- package/lib/components/overlay/OverlayComponent.d.ts +27 -27
- package/lib/components/overlay/OverlayComponent.js +137 -149
- package/lib/components/progress/ProgressComponent.d.ts +18 -18
- package/lib/components/progress/ProgressComponent.js +40 -42
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -12
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +23 -34
- package/lib/components/select/SelectComponent.d.ts +79 -79
- package/lib/components/select/SelectComponent.js +356 -369
- package/lib/components/select/SelectDDAreaComponent.d.ts +32 -32
- package/lib/components/select/SelectDDAreaComponent.js +303 -317
- package/lib/components/slider/nouislider.d.ts +44 -44
- package/lib/components/slider/nouislider.js +2158 -2158
- package/lib/components/stack-panel/SplitterComponent.d.ts +21 -21
- package/lib/components/stack-panel/SplitterComponent.js +124 -126
- package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -20
- package/lib/components/stack-panel/StackPanelComponent.js +50 -64
- package/lib/components/tabs/TabsComponent.d.ts +40 -40
- package/lib/components/tabs/TabsComponent.js +200 -204
- package/lib/components/time/TimeComponent.d.ts +29 -29
- package/lib/components/time/TimeComponent.js +104 -113
- package/lib/components/tree-view/TreeViewComponent.d.ts +23 -23
- package/lib/components/tree-view/TreeViewComponent.js +43 -45
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -30
- package/lib/components/virtual-render/VirtualRenderComponent.js +92 -104
- package/lib/core/culture.d.ts +5 -5
- package/lib/core/culture.js +385 -385
- package/lib/core/date.d.ts +14 -14
- package/lib/core/date.js +346 -350
- package/lib/core/helper.d.ts +13 -13
- package/lib/core/helper.js +100 -104
- package/lib/core/jq.d.ts +37 -37
- package/lib/core/jq.js +362 -371
- package/lib/core/lang.d.ts +24 -24
- package/lib/core/lang.js +24 -28
- package/lib/core/numeric.d.ts +7 -7
- package/lib/core/numeric.js +139 -143
- package/lib/core/polyfills.js +22 -22
- package/lib/core.d.ts +6 -6
- package/lib/core.js +6 -6
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -7
- package/lib/grid/filterDialogs/dateRangeFilter.js +106 -156
- package/lib/grid/filterDialogs/excelFilter.d.ts +9 -9
- package/lib/grid/filterDialogs/excelFilter.js +250 -316
- package/lib/grid/plugins/ext.overlay.d.ts +2 -2
- package/lib/grid/plugins/ext.overlay.js +295 -295
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -12
- package/lib/grid/plugins/slick.cellrangedecorator.js +68 -68
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -1
- package/lib/grid/plugins/slick.cellrangeselector.js +144 -144
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -1
- package/lib/grid/plugins/slick.cellselectionmodel.js +194 -194
- package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -55
- package/lib/grid/plugins/slick.headerbuttons.js +156 -156
- package/lib/grid/plugins/slick.headermenu.d.ts +74 -74
- package/lib/grid/plugins/slick.headermenu.js +260 -260
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -18
- package/lib/grid/plugins/slick.rowmovemanager.js +249 -249
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -1
- package/lib/grid/plugins/slick.rowselectionmodel.js +167 -167
- package/lib/grid/slick.core.d.ts +91 -91
- package/lib/grid/slick.core.js +574 -574
- package/lib/grid/slick.creator.d.ts +81 -81
- package/lib/grid/slick.creator.js +726 -726
- package/lib/grid/slick.dataview.d.ts +71 -71
- package/lib/grid/slick.dataview.js +1069 -1080
- package/lib/grid/slick.editors.core.d.ts +4 -4
- package/lib/grid/slick.editors.core.js +235 -235
- package/lib/grid/slick.editors.date.d.ts +2 -2
- package/lib/grid/slick.editors.date.js +125 -125
- package/lib/grid/slick.editors.lookup.d.ts +14 -14
- package/lib/grid/slick.editors.lookup.js +352 -353
- package/lib/grid/slick.editors.nav.d.ts +6 -6
- package/lib/grid/slick.editors.nav.js +22 -22
- package/lib/grid/slick.formatters.d.ts +17 -17
- package/lib/grid/slick.formatters.js +144 -144
- package/lib/grid/slick.grid.d.ts +285 -285
- package/lib/grid/slick.grid.js +5409 -5412
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -39
- package/lib/grid/slick.groupitemmetadataprovider.js +165 -165
- package/lib/grid/slick.tree.d.ts +33 -33
- package/lib/grid/slick.tree.js +208 -220
- package/lib/grid.css +1 -705
- package/lib/grid.d.ts +13 -13
- package/lib/grid.js +13 -13
- package/lib/index.css +8 -2195
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +56 -55
- package/lib/index.js +61 -61
- package/lib/index.js.map +1 -1
- package/lib/interaction/dataconverter.d.ts +4 -4
- package/lib/interaction/dataconverter.js +0 -1
- package/lib/interaction/eventhandler.d.ts +13 -13
- package/lib/interaction/eventhandler.js +39 -42
- package/lib/interaction/moveable.d.ts +39 -39
- package/lib/interaction/moveable.js +160 -174
- package/lib/interaction/resizable.d.ts +37 -37
- package/lib/interaction/resizable.js +109 -123
- package/lib/ui/auto.suggest.d.ts +18 -18
- package/lib/ui/auto.suggest.js +244 -259
- package/lib/ui/date.picker/date-picker-options.d.ts +11 -11
- package/lib/ui/date.picker/date-picker-options.js +76 -76
- package/lib/ui/date.picker/lib/date-manip.d.ts +74 -74
- package/lib/ui/date.picker/lib/date-manip.js +120 -120
- package/lib/ui/date.picker/lib/dom.d.ts +23 -23
- package/lib/ui/date.picker/lib/dom.js +28 -28
- package/lib/ui/date.picker/lib/emitter.d.ts +13 -13
- package/lib/ui/date.picker/lib/emitter.js +49 -49
- package/lib/ui/date.picker/lib/fns.d.ts +23 -23
- package/lib/ui/date.picker/lib/fns.js +39 -43
- package/lib/ui/date.picker/mode/base-mode.d.ts +26 -26
- package/lib/ui/date.picker/mode/base-mode.js +248 -248
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -28
- package/lib/ui/date.picker/mode/dropdown-mode.js +50 -50
- package/lib/ui/date.picker/mode/index.d.ts +28 -28
- package/lib/ui/date.picker/mode/index.js +18 -18
- package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -25
- package/lib/ui/date.picker/mode/modal-mode.js +17 -17
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -29
- package/lib/ui/date.picker/mode/permanent-mode.js +19 -19
- package/lib/ui/date.picker/views/day-picker.d.ts +40 -40
- package/lib/ui/date.picker/views/day-picker.js +155 -155
- package/lib/ui/date.picker/views/month-picker.d.ts +26 -26
- package/lib/ui/date.picker/views/month-picker.js +65 -65
- package/lib/ui/date.picker/views/year-picker.d.ts +20 -20
- package/lib/ui/date.picker/views/year-picker.js +66 -66
- package/lib/ui/date.picker.d.ts +66 -66
- package/lib/ui/date.picker.js +32 -32
- package/lib/ui/dialog.d.ts +22 -22
- package/lib/ui/dialog.js +98 -113
- package/lib/ui/drop.down.d.ts +52 -52
- package/lib/ui/drop.down.js +2112 -2112
- package/lib/ui/number.input.d.ts +13 -13
- package/lib/ui/number.input.js +56 -67
- package/package.json +1 -1
package/lib/core/jq.js
CHANGED
|
@@ -1,371 +1,362 @@
|
|
|
1
|
-
function deepExtend(out) {
|
|
2
|
-
|
|
3
|
-
for (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (el.
|
|
24
|
-
return el;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
for (
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
var
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
function
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
out[key] = arguments[i][key];
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
return out;
|
|
367
|
-
}
|
|
368
|
-
jqueryCreate.deepExtend = deepExtend;
|
|
369
|
-
jqueryCreate.each = each;
|
|
370
|
-
jqueryCreate.shallowExtend = shallowExtend;
|
|
371
|
-
export var jQueryReplacement = jqueryCreate;
|
|
1
|
+
function deepExtend(out, ...a) {
|
|
2
|
+
out = out || {};
|
|
3
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
4
|
+
let obj = arguments[i];
|
|
5
|
+
if (!obj)
|
|
6
|
+
continue;
|
|
7
|
+
for (let key in obj) {
|
|
8
|
+
if (obj.hasOwnProperty(key)) {
|
|
9
|
+
if (obj[key] !== null && typeof obj[key] === 'object')
|
|
10
|
+
out[key] = deepExtend((Array.isArray(obj[key]) && out[key] === undefined) ? [] : out[key], obj[key]);
|
|
11
|
+
else
|
|
12
|
+
out[key] = obj[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
function getParentWithClass(el, c, stopAt) {
|
|
19
|
+
if (el.classList.contains(c))
|
|
20
|
+
return el;
|
|
21
|
+
if (stopAt !== undefined && el.classList.contains(stopAt))
|
|
22
|
+
return undefined;
|
|
23
|
+
if (el.parentElement) {
|
|
24
|
+
return getParentWithClass(el.parentElement, c);
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
function jQWrapper(elements) {
|
|
29
|
+
let _elements = elements;
|
|
30
|
+
_elements.empty = function () {
|
|
31
|
+
for (let x of _elements) {
|
|
32
|
+
x.innerHTML = '';
|
|
33
|
+
}
|
|
34
|
+
return this;
|
|
35
|
+
};
|
|
36
|
+
_elements.appendTo = function (selector) {
|
|
37
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
38
|
+
if (selector instanceof HTMLElement) {
|
|
39
|
+
selector.appendChild(_elements[i]);
|
|
40
|
+
}
|
|
41
|
+
else if (typeof (selector) === "string") {
|
|
42
|
+
const parents = document.querySelectorAll(selector);
|
|
43
|
+
for (let i = 0, len = parents.length; i < len; i++) {
|
|
44
|
+
parents[i].appendChild(_elements[i]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
for (let j = 0; j < selector.length; j++) {
|
|
49
|
+
selector[j].appendChild(_elements[i]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
};
|
|
55
|
+
_elements.append = function (el) {
|
|
56
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
57
|
+
_elements[i].appendChild(el);
|
|
58
|
+
}
|
|
59
|
+
return this;
|
|
60
|
+
};
|
|
61
|
+
_elements.add = function (selector) {
|
|
62
|
+
if (selector !== undefined) {
|
|
63
|
+
if (selector instanceof HTMLElement) {
|
|
64
|
+
_elements.push(selector);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
for (let i = 0; i < selector.length; i++) {
|
|
68
|
+
_elements.push(selector[i]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return this;
|
|
73
|
+
};
|
|
74
|
+
_elements.css = function (key, value) {
|
|
75
|
+
// TODO: support object instead of just simple keys
|
|
76
|
+
if (value === undefined) {
|
|
77
|
+
if (typeof (key) === "string") {
|
|
78
|
+
if (!_elements.length) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const computed = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight",
|
|
82
|
+
"borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"];
|
|
83
|
+
if (computed.indexOf(key) < 0) {
|
|
84
|
+
return _elements[0].style[key];
|
|
85
|
+
}
|
|
86
|
+
return window.getComputedStyle(_elements[0])[key];
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
for (const keyEl in key) {
|
|
90
|
+
if (!key.hasOwnProperty(keyEl)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
94
|
+
if (["height", "width", "top", "left", "bottom", "right"].indexOf(keyEl) >= 0 && typeof key[keyEl] === "number") {
|
|
95
|
+
_elements[i].style[keyEl] = key[keyEl] + "px";
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
_elements[i].style[keyEl] = key[keyEl];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
105
|
+
if (["height", "width", "top", "left", "bottom", "right"].indexOf(key) >= 0 && typeof value === "number") {
|
|
106
|
+
_elements[i].style[key] = value + "px";
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
_elements[i].style[key] = value;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return this;
|
|
113
|
+
};
|
|
114
|
+
_elements.attr = function (key, value) {
|
|
115
|
+
if (value === undefined) {
|
|
116
|
+
return _elements.length ? _elements[0][key] : undefined;
|
|
117
|
+
}
|
|
118
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
119
|
+
_elements[i][key] = value;
|
|
120
|
+
}
|
|
121
|
+
return this;
|
|
122
|
+
};
|
|
123
|
+
_elements.closestClass = function (name, stopAt) {
|
|
124
|
+
let result = jQueryReplacement();
|
|
125
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
126
|
+
let match = getParentWithClass(_elements[i], name, stopAt);
|
|
127
|
+
result.add(match);
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
};
|
|
131
|
+
_elements.remove = function () {
|
|
132
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
133
|
+
let el = _elements[i];
|
|
134
|
+
if (el.parentNode) {
|
|
135
|
+
el.parentNode.removeChild(el);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
_elements.data = function (name, value) {
|
|
140
|
+
if (_elements.length === 0)
|
|
141
|
+
return undefined;
|
|
142
|
+
if (value === undefined) {
|
|
143
|
+
return _elements[0][name];
|
|
144
|
+
}
|
|
145
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
146
|
+
_elements[i][name] = value;
|
|
147
|
+
}
|
|
148
|
+
return this;
|
|
149
|
+
};
|
|
150
|
+
_elements.html = function (value) {
|
|
151
|
+
if (value === undefined) {
|
|
152
|
+
return _elements.length ? _elements[0].innerHTML : undefined;
|
|
153
|
+
}
|
|
154
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
155
|
+
_elements[i].innerHTML = value;
|
|
156
|
+
}
|
|
157
|
+
return this;
|
|
158
|
+
};
|
|
159
|
+
_elements.text = function (value) {
|
|
160
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
161
|
+
_elements[i].innerText = value;
|
|
162
|
+
}
|
|
163
|
+
return this;
|
|
164
|
+
};
|
|
165
|
+
_elements.height = function (value) {
|
|
166
|
+
if (value === undefined) {
|
|
167
|
+
if (!_elements.length) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
let cssHeight = parseInt(_elements[0].style.height);
|
|
171
|
+
if (isNaN(cssHeight)) {
|
|
172
|
+
return _elements[0].offsetHeight;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
return cssHeight;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
179
|
+
if (typeof value === "string") {
|
|
180
|
+
_elements[i].style.height = value;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
//_elements[i].offsetHeight = value;
|
|
184
|
+
_elements[i].style.height = value + "px";
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return this;
|
|
188
|
+
};
|
|
189
|
+
_elements.width = function (value) {
|
|
190
|
+
if (value === undefined) {
|
|
191
|
+
if (!_elements.length) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
// let cssHeight = parseInt(_elements[0].style.width);
|
|
195
|
+
// if (isNaN(cssHeight)) {
|
|
196
|
+
return _elements[0].offsetWidth;
|
|
197
|
+
// } else {
|
|
198
|
+
// return cssHeight;
|
|
199
|
+
// }
|
|
200
|
+
}
|
|
201
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
202
|
+
if (typeof value === "string") {
|
|
203
|
+
_elements[i].style.width = value;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
//_elements[i].offsetWidth = value;
|
|
207
|
+
_elements[i].style.width = value + "px";
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return this;
|
|
211
|
+
};
|
|
212
|
+
_elements.removeClass = function (name) {
|
|
213
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
214
|
+
if (name.indexOf(' ') > 0) {
|
|
215
|
+
let names = name.split(' ');
|
|
216
|
+
for (let nIdx = 0; nIdx < names.length; nIdx++) {
|
|
217
|
+
_elements[i].classList.remove(names[nIdx]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
_elements[i].classList.remove(name);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return this;
|
|
225
|
+
};
|
|
226
|
+
_elements.offset = function () {
|
|
227
|
+
if (_elements.length === 0)
|
|
228
|
+
return undefined;
|
|
229
|
+
let el = _elements[0];
|
|
230
|
+
let rect = el.getBoundingClientRect();
|
|
231
|
+
return {
|
|
232
|
+
top: rect.top + document.body.scrollTop,
|
|
233
|
+
left: rect.left + document.body.scrollLeft
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
_elements.children = function () {
|
|
237
|
+
let result = [];
|
|
238
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
239
|
+
for (let cidx = 0; cidx < _elements[i].children.length; cidx++) {
|
|
240
|
+
result.push(_elements[i].children[cidx]);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return jQWrapper(result);
|
|
244
|
+
};
|
|
245
|
+
_elements.on = function (eventname, fnc) {
|
|
246
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
247
|
+
_elements[i].addEventListener(eventname, fnc);
|
|
248
|
+
}
|
|
249
|
+
return this;
|
|
250
|
+
};
|
|
251
|
+
_elements.toggleClass = function (name, state) {
|
|
252
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
253
|
+
if (state === false || _elements[i].classList.contains(name)) {
|
|
254
|
+
_elements[i].classList.remove(name);
|
|
255
|
+
}
|
|
256
|
+
else if (state === true || !_elements[i].classList.contains(name)) {
|
|
257
|
+
_elements[i].classList.add(name);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return this;
|
|
261
|
+
};
|
|
262
|
+
_elements.find = function (selector) {
|
|
263
|
+
var result = jQueryReplacement();
|
|
264
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
265
|
+
let found = _elements[i].querySelectorAll(selector);
|
|
266
|
+
for (let j = 0; j < found.length; j++) {
|
|
267
|
+
result.add(found[j]);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
};
|
|
272
|
+
_elements.slideDown = function (speed, done) {
|
|
273
|
+
//TODO
|
|
274
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
275
|
+
_elements[i].style.display = '';
|
|
276
|
+
}
|
|
277
|
+
return this;
|
|
278
|
+
};
|
|
279
|
+
_elements.slideUp = function (speed, done) {
|
|
280
|
+
//TODO
|
|
281
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
282
|
+
_elements[i].style.display = 'none';
|
|
283
|
+
}
|
|
284
|
+
return this;
|
|
285
|
+
};
|
|
286
|
+
_elements.addClass = function (name) {
|
|
287
|
+
if (name) {
|
|
288
|
+
{
|
|
289
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
290
|
+
_elements[i].classList.add(name);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return this;
|
|
295
|
+
};
|
|
296
|
+
_elements.hasClass = function (name) {
|
|
297
|
+
for (let i = 0; i < _elements.length; i++) {
|
|
298
|
+
if (_elements[i].classList.contains(name))
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
return false;
|
|
302
|
+
};
|
|
303
|
+
_elements.index = function () {
|
|
304
|
+
var index = 0;
|
|
305
|
+
let node = _elements[0];
|
|
306
|
+
if (!node)
|
|
307
|
+
return -1;
|
|
308
|
+
while ((node = node.previousElementSibling)) {
|
|
309
|
+
index++;
|
|
310
|
+
}
|
|
311
|
+
return index;
|
|
312
|
+
};
|
|
313
|
+
return _elements;
|
|
314
|
+
}
|
|
315
|
+
const jqueryCreate = function (selector) {
|
|
316
|
+
let elements = [];
|
|
317
|
+
if (typeof selector === "string") {
|
|
318
|
+
if (selector[0] === '<') {
|
|
319
|
+
var tmp = document.createElement("div");
|
|
320
|
+
tmp.innerHTML = selector;
|
|
321
|
+
elements.push(tmp.firstElementChild);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
var q = document.querySelectorAll(selector);
|
|
325
|
+
if (q) {
|
|
326
|
+
for (let i = 0; i < q.length; i++) {
|
|
327
|
+
let node = q[i];
|
|
328
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
329
|
+
elements.push(node);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
if (selector !== undefined) {
|
|
337
|
+
elements.push(selector);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return jQWrapper(elements);
|
|
341
|
+
};
|
|
342
|
+
function each(array, fnc) {
|
|
343
|
+
for (let i = 0; i < array.length; i++) {
|
|
344
|
+
fnc(i, array[i]);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function shallowExtend(out, ...rest) {
|
|
348
|
+
out = out || {};
|
|
349
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
350
|
+
if (!arguments[i])
|
|
351
|
+
continue;
|
|
352
|
+
for (var key in arguments[i]) {
|
|
353
|
+
if (arguments[i].hasOwnProperty(key))
|
|
354
|
+
out[key] = arguments[i][key];
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return out;
|
|
358
|
+
}
|
|
359
|
+
jqueryCreate.deepExtend = deepExtend;
|
|
360
|
+
jqueryCreate.each = each;
|
|
361
|
+
jqueryCreate.shallowExtend = shallowExtend;
|
|
362
|
+
export let jQueryReplacement = jqueryCreate;
|