inviton-powerduck 0.0.115 → 0.0.117

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 (84) hide show
  1. package/app/vuetsx.ts +3 -1
  2. package/common/ajax-xhr.ts +2 -2
  3. package/common/api-http.ts +6 -4
  4. package/common/css/ladda-themeless-zoomin.min.css +89 -89
  5. package/common/date-wrapper.ts +2 -2
  6. package/common/dialog-utils.ts +3 -3
  7. package/common/external-barcode-scanner.ts +6 -6
  8. package/common/history-extended.ts +17 -13
  9. package/common/keyboard-open-tracker.ts +6 -2
  10. package/common/ladda-lite.ts +44 -36
  11. package/common/local-storage-shim.ts +3 -3
  12. package/common/resource-helper.ts +44 -40
  13. package/common/set-current-url.ts +2 -2
  14. package/common/slot-name-identifier.ts +2 -2
  15. package/common/slot-unwrapper.ts +5 -3
  16. package/common/utils/array-extend.ts +23 -17
  17. package/common/utils/array-sort.ts +6 -6
  18. package/common/utils/capitalize-string.ts +2 -2
  19. package/common/utils/date-localization-utils.ts +5 -5
  20. package/common/utils/format-string.ts +12 -10
  21. package/common/utils/is-null-or-empty.ts +3 -1
  22. package/common/utils/language-utils.ts +21 -13
  23. package/common/utils/latinize-string.ts +2 -2
  24. package/common/utils/utils.ts +4 -4
  25. package/common/validation.ts +5 -5
  26. package/components/button/upload-button.tsx +1 -1
  27. package/components/chart-js/line-chart-flot.tsx +2 -2
  28. package/components/chart-js/plot.tsx +2 -2
  29. package/components/chart-js/thirdparty/flot/jquery.flot-patched.js +227 -170
  30. package/components/chart-js/thirdparty/flot/jquery.flot.categories.js +22 -20
  31. package/components/chart-js/thirdparty/flot/jquery.flot.categories.min.js +93 -93
  32. package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.js +10 -10
  33. package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.min.js +83 -83
  34. package/components/chart-js/thirdparty/flot/jquery.flot.navigate.js +35 -29
  35. package/components/chart-js/thirdparty/flot/jquery.flot.navigate.min.js +270 -270
  36. package/components/chart-js/thirdparty/flot/jquery.flot.pie.js +49 -47
  37. package/components/chart-js/thirdparty/flot/jquery.flot.pie.min.js +507 -507
  38. package/components/chart-js/thirdparty/flot/jquery.flot.resize.js +43 -36
  39. package/components/chart-js/thirdparty/flot/jquery.flot.resize.min.js +147 -147
  40. package/components/chart-js/thirdparty/flot/jquery.flot.stack.js +8 -8
  41. package/components/chart-js/thirdparty/flot/jquery.flot.stack.min.js +104 -104
  42. package/components/chart-js/ts/color-helper.ts +4 -2
  43. package/components/chart-js/ts/utils.ts +2 -2
  44. package/components/chart-js/utils.ts +2 -2
  45. package/components/counter/index.tsx +4 -2
  46. package/components/datatable/datatable.tsx +13 -7
  47. package/components/datatable/ts/reorder.ts +22 -20
  48. package/components/dropdown/country-dropdown.tsx +4 -4
  49. package/components/dropdown/image-dropdown.tsx +1 -1
  50. package/components/dropdown/index.tsx +70 -64
  51. package/components/dropdown/language-dropdown.tsx +8 -4
  52. package/components/dropdown/mobile/legacy_fdd.ts +36 -28
  53. package/components/dropdown/mobile/legacy_lvb.ts +28 -23
  54. package/components/dropdown/ts/select2-multi-checkboxes.ts +14 -12
  55. package/components/dropzone/gallery-dropzone.tsx +6 -4
  56. package/components/file-downloader/index.tsx +2 -2
  57. package/components/fullcalendar/fullcalendar-draggable-event.tsx +1 -1
  58. package/components/google/ts/google-maps-api.ts +3 -3
  59. package/components/html-literal/html-literal.tsx +13 -15
  60. package/components/image-crop/image-cropping-modal.tsx +1 -1
  61. package/components/image-crop/upload-and-crop.tsx +1 -1
  62. package/components/image-crop/vendor/jcrop.js +138 -93
  63. package/components/image-crop/vendor/jquery.Jcrop.min.css +344 -344
  64. package/components/import/import-mapper.tsx +231 -231
  65. package/components/input/daterange-picker.tsx +1 -1
  66. package/components/input/datetime-picker.tsx +1 -1
  67. package/components/input/plugins/currency-editor/utils.ts +12 -4
  68. package/components/input/plugins/daterangepicker/daterangepicker.min.css +400 -400
  69. package/components/input/plugins/daterangepicker/jquery.daterangepicker.min.js +1903 -1903
  70. package/components/input/plugins/daterangepicker/jquery.daterangepicker.ts +160 -137
  71. package/components/input/plugins/trumbowyg/custom-cleanpaste.ts +4 -2
  72. package/components/input/plugins/trumbowyg/custom-colors.ts +8 -6
  73. package/components/input/plugins/trumbowyg/custom-upload.ts +271 -265
  74. package/components/input/plugins/trumbowyg/lang/cs.ts +1 -1
  75. package/components/input/plugins/trumbowyg/lang/de.ts +1 -1
  76. package/components/input/plugins/trumbowyg/lang/sk.ts +1 -1
  77. package/components/input/ts/bootstrapInputSpinner.ts +22 -22
  78. package/components/input/wysiwig.tsx +32 -30
  79. package/components/modal/ts/file-manager-dialog.ts +3 -3
  80. package/components/photos/photo-manager.tsx +7 -5
  81. package/components/rating/rating-picker.tsx +8 -4
  82. package/components/svg/skilift-svg.tsx +6 -6
  83. package/components/ui/notification.ts +9 -9
  84. package/package.json +1 -2
package/app/vuetsx.ts CHANGED
@@ -78,7 +78,9 @@ type ComponentOptions = {
78
78
  validations?: ValidationRuleset<any>;
79
79
  } & ComponentConsOption;
80
80
 
81
- export const Component = (options: ComponentOptions, ctx?: any) => OriginalComponent(options as any, ctx);
81
+ export function Component(options: ComponentOptions, ctx?: any) {
82
+ return OriginalComponent(options as any, ctx);
83
+ }
82
84
 
83
85
  declare global {
84
86
  namespace JSX {
@@ -10,7 +10,7 @@ export class AjaxProviderXhr implements AjaxRequestProvider {
10
10
  args.url,
11
11
  true,
12
12
  );
13
- x.onreadystatechange = () => {
13
+ x.onreadystatechange = function () {
14
14
  if (x.readyState == 4) {
15
15
  let status = x.status;
16
16
  if (status == 0) {
@@ -82,7 +82,7 @@ export class AjaxProviderCordova implements AjaxRequestProvider {
82
82
  }
83
83
  }, timeoutEnsure);
84
84
 
85
- const tryClearTimeoutEnsure = () => {
85
+ const tryClearTimeoutEnsure = function () {
86
86
  cbRaised = true;
87
87
 
88
88
  try {
@@ -244,7 +244,7 @@ export class AppHttpProvider {
244
244
  * @param jsonAdapter
245
245
  */
246
246
  static postProcessJsObject<T>(jsObj: T, jsonAdapter?: any): T {
247
- const recIterate = (obj) => {
247
+ const recIterate = function (obj) {
248
248
  for (const key in obj) {
249
249
  const keyVal = obj[key];
250
250
  if (jsonAdapter != null) {
@@ -284,7 +284,7 @@ export class AppHttpProvider {
284
284
  const mySelf = this;
285
285
 
286
286
  return new (window as any).Promise((resolve, reject) => {
287
- const tryGetJSON = (resp: any): any => {
287
+ function tryGetJSON(resp: any): any {
288
288
  try {
289
289
  return JSON.parse(resp);
290
290
  } catch (e) {
@@ -294,7 +294,7 @@ export class AppHttpProvider {
294
294
  return null;
295
295
  }
296
296
  }
297
- };
297
+ }
298
298
 
299
299
  const method = (args.type || 'GET').toUpperCase();
300
300
  let data = <any>(args.data || {});
@@ -481,7 +481,9 @@ export class AppHttpProvider {
481
481
  }
482
482
 
483
483
  const performRetry = () => {
484
- const getRandomArbitrary = (min, max) => Math.random() * (max - min) + min;
484
+ const getRandomArbitrary = (min, max) => {
485
+ return Math.random() * (max - min) + min;
486
+ };
485
487
 
486
488
  setTimeout(() => {
487
489
  AppHttpProvider.log(
@@ -1,89 +1,89 @@
1
- /*! Ladda http://lab.hakim.se/ladda MIT licensed Copyright (C) 2016 Hakim El Hattab, http://hakim.se ....Lightweight adaptation for Inviton API needs*/
2
- .ladda-button {
3
- position: relative;
4
- }
5
- .ladda-button .ladda-spinner {
6
- position: absolute;
7
- z-index: 2;
8
- display: inline-block;
9
- width: 32px;
10
- height: 32px;
11
- top: 50%;
12
- margin-top: 0;
13
- opacity: 0;
14
- pointer-events: none;
15
- }
16
- .ladda-button .ladda-label {
17
- position: relative;
18
- z-index: 3;
19
- }
20
- .ladda-button .ladda-progress {
21
- position: absolute;
22
- width: 0;
23
- height: 100%;
24
- left: 0;
25
- top: 0;
26
- background: rgba(0, 0, 0, 0.2);
27
- visibility: hidden;
28
- opacity: 0;
29
- -webkit-transition: 0.1s linear all !important;
30
- -moz-transition: 0.1s linear all !important;
31
- -ms-transition: 0.1s linear all !important;
32
- -o-transition: 0.1s linear all !important;
33
- transition: 0.1s linear all !important;
34
- }
35
- .ladda-button[data-loading] .ladda-progress {
36
- opacity: 1;
37
- visibility: visible;
38
- }
39
- .ladda-button,
40
- .ladda-button .ladda-label,
41
- .ladda-button .ladda-spinner {
42
- -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
43
- -moz-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
44
- -ms-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
45
- -o-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
46
- transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
47
- }
48
- .ladda-button[data-style="zoom-in"],
49
- .ladda-button[data-style="zoom-in"] .ladda-label,
50
- .ladda-button[data-style="zoom-in"] .ladda-spinner {
51
- -webkit-transition: 0.3s ease all !important;
52
- -moz-transition: 0.3s ease all !important;
53
- -ms-transition: 0.3s ease all !important;
54
- -o-transition: 0.3s ease all !important;
55
- transition: 0.3s ease all !important;
56
- }
57
- .ladda-button[data-style="zoom-in"] {
58
- overflow: hidden;
59
- }
60
- .ladda-button[data-style="zoom-in"] .ladda-spinner {
61
- left: 50%;
62
- margin-left: -16px;
63
- -webkit-transform: scale(0.2);
64
- -moz-transform: scale(0.2);
65
- -ms-transform: scale(0.2);
66
- -o-transform: scale(0.2);
67
- transform: scale(0.2);
68
- }
69
- .ladda-button[data-style="zoom-in"] .ladda-label {
70
- position: relative;
71
- display: inline-block;
72
- }
73
- .ladda-button[data-style="zoom-in"][data-loading] .ladda-label {
74
- opacity: 0;
75
- -webkit-transform: scale(2.2);
76
- -moz-transform: scale(2.2);
77
- -ms-transform: scale(2.2);
78
- -o-transform: scale(2.2);
79
- transform: scale(2.2);
80
- }
81
- .ladda-button[data-style="zoom-in"][data-loading] .ladda-spinner {
82
- opacity: 1;
83
- margin-left: 0;
84
- -webkit-transform: none;
85
- -moz-transform: none;
86
- -ms-transform: none;
87
- -o-transform: none;
88
- transform: none;
89
- }
1
+ /*! Ladda http://lab.hakim.se/ladda MIT licensed Copyright (C) 2016 Hakim El Hattab, http://hakim.se ....Lightweight adaptation for Inviton API needs*/
2
+ .ladda-button {
3
+ position: relative;
4
+ }
5
+ .ladda-button .ladda-spinner {
6
+ position: absolute;
7
+ z-index: 2;
8
+ display: inline-block;
9
+ width: 32px;
10
+ height: 32px;
11
+ top: 50%;
12
+ margin-top: 0;
13
+ opacity: 0;
14
+ pointer-events: none;
15
+ }
16
+ .ladda-button .ladda-label {
17
+ position: relative;
18
+ z-index: 3;
19
+ }
20
+ .ladda-button .ladda-progress {
21
+ position: absolute;
22
+ width: 0;
23
+ height: 100%;
24
+ left: 0;
25
+ top: 0;
26
+ background: rgba(0, 0, 0, 0.2);
27
+ visibility: hidden;
28
+ opacity: 0;
29
+ -webkit-transition: 0.1s linear all !important;
30
+ -moz-transition: 0.1s linear all !important;
31
+ -ms-transition: 0.1s linear all !important;
32
+ -o-transition: 0.1s linear all !important;
33
+ transition: 0.1s linear all !important;
34
+ }
35
+ .ladda-button[data-loading] .ladda-progress {
36
+ opacity: 1;
37
+ visibility: visible;
38
+ }
39
+ .ladda-button,
40
+ .ladda-button .ladda-label,
41
+ .ladda-button .ladda-spinner {
42
+ -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
43
+ -moz-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
44
+ -ms-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
45
+ -o-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
46
+ transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
47
+ }
48
+ .ladda-button[data-style="zoom-in"],
49
+ .ladda-button[data-style="zoom-in"] .ladda-label,
50
+ .ladda-button[data-style="zoom-in"] .ladda-spinner {
51
+ -webkit-transition: 0.3s ease all !important;
52
+ -moz-transition: 0.3s ease all !important;
53
+ -ms-transition: 0.3s ease all !important;
54
+ -o-transition: 0.3s ease all !important;
55
+ transition: 0.3s ease all !important;
56
+ }
57
+ .ladda-button[data-style="zoom-in"] {
58
+ overflow: hidden;
59
+ }
60
+ .ladda-button[data-style="zoom-in"] .ladda-spinner {
61
+ left: 50%;
62
+ margin-left: -16px;
63
+ -webkit-transform: scale(0.2);
64
+ -moz-transform: scale(0.2);
65
+ -ms-transform: scale(0.2);
66
+ -o-transform: scale(0.2);
67
+ transform: scale(0.2);
68
+ }
69
+ .ladda-button[data-style="zoom-in"] .ladda-label {
70
+ position: relative;
71
+ display: inline-block;
72
+ }
73
+ .ladda-button[data-style="zoom-in"][data-loading] .ladda-label {
74
+ opacity: 0;
75
+ -webkit-transform: scale(2.2);
76
+ -moz-transform: scale(2.2);
77
+ -ms-transform: scale(2.2);
78
+ -o-transform: scale(2.2);
79
+ transform: scale(2.2);
80
+ }
81
+ .ladda-button[data-style="zoom-in"][data-loading] .ladda-spinner {
82
+ opacity: 1;
83
+ margin-left: 0;
84
+ -webkit-transform: none;
85
+ -moz-transform: none;
86
+ -ms-transform: none;
87
+ -o-transform: none;
88
+ transform: none;
89
+ }
@@ -393,13 +393,13 @@ export class DateWrapper {
393
393
  }
394
394
 
395
395
  toWire(includeTime?: boolean, includeMs?: boolean): string {
396
- const formatDatePart = (v: number) => {
396
+ function formatDatePart(v: number) {
397
397
  if (v < 10) {
398
398
  return `0${v.toString()}`;
399
399
  } else {
400
400
  return v.toString();
401
401
  }
402
- };
402
+ }
403
403
 
404
404
  let datePart = `${this.getFullYear()}-${formatDatePart(this.getMonth() + 1)}-${formatDatePart(this.getDate())}`;
405
405
  if (includeTime) {
@@ -249,11 +249,11 @@ export class DialogUtils {
249
249
  }, 50);
250
250
  });
251
251
 
252
- const ensureIconAnimation = (
252
+ const ensureIconAnimation = function (
253
253
  selector: string,
254
254
  icon: DialogIcons,
255
255
  addExtended: boolean,
256
- ) => {
256
+ ) {
257
257
  const stub = modalSelector.find(selector);
258
258
  if (stub.length > 0) {
259
259
  const headerIcon = modalSelector.find('.modal-header-icon');
@@ -598,6 +598,6 @@ export class DialogUtils {
598
598
  }
599
599
  }
600
600
 
601
- ; (() => {
601
+ ; (function () {
602
602
  window.DialogUtils = DialogUtils;
603
603
  })();
@@ -238,7 +238,7 @@ export function externalBarcodeScanner(this: any) {
238
238
  };
239
239
  this._initCharMap();
240
240
 
241
- this._onKeyUp = (e) => {
241
+ this._onKeyUp = function (e) {
242
242
  const value = e.which ? e.which : e.keyCode;
243
243
  console.log(value);
244
244
 
@@ -271,22 +271,22 @@ export function externalBarcodeScanner(this: any) {
271
271
  }
272
272
  };
273
273
 
274
- this.register = () => {
274
+ this.register = function () {
275
275
  self._chars = [];
276
276
  self._pressed = false;
277
277
  window.jQuery(window).on('keyup', self._onKeyUp);
278
278
  };
279
279
 
280
- this.unregister = () => {
280
+ this.unregister = function () {
281
281
  window.jQuery.off('keyup', self._onKeyUp);
282
282
  };
283
283
 
284
- this._pushChar = (which) => {
284
+ this._pushChar = function (which) {
285
285
  self._chars.push(String.fromCharCode(which));
286
286
  // self._verify();
287
287
  };
288
288
 
289
- this._verify = () => {
289
+ this._verify = function () {
290
290
  if (self._chars.length >= self.minChars) {
291
291
  let barcode = self._chars.join('');
292
292
  const firstThree = barcode.substring(0, 3);
@@ -326,7 +326,7 @@ export function externalBarcodeScanner(this: any) {
326
326
  }
327
327
  };
328
328
 
329
- this._cleanUp = () => {
329
+ this._cleanUp = function () {
330
330
  clearTimeout(self._t); // <- CLEAR TIMER IF IS NOT BARCODE
331
331
  self._chars = [];
332
332
  self._pressed = false;
@@ -27,7 +27,7 @@ const history: HistoryOnSteroids = window.history as any;
27
27
  if (!history.__historyExtendedInitialized) {
28
28
  history.__historyExtendedInitialized = true;
29
29
 
30
- (() => {
30
+ (function () {
31
31
  const originalPushState = history.pushState;
32
32
  const originalReplaceState = history.replaceState;
33
33
  const listeners: HistoryChangedListener[] = [];
@@ -44,16 +44,16 @@ if (!history.__historyExtendedInitialized) {
44
44
  let silentMode = false; // Flag to suppress events
45
45
 
46
46
  // Function to log state into history
47
- const logState = (state, index) => {
47
+ function logState(state, index) {
48
48
  stateHistory[index] = { ...state, __heindex: index };
49
- };
49
+ }
50
50
 
51
51
  // Override pushState
52
- history.pushState = (
52
+ history.pushState = function (
53
53
  state,
54
54
  title,
55
55
  url,
56
- ) => {
56
+ ) {
57
57
  previousState = { ...history.state, __heindex: currentIndex };
58
58
  currentIndex++;
59
59
  const enhancedState = { ...state, __heindex: currentIndex, __url: url };
@@ -68,14 +68,16 @@ if (!history.__historyExtendedInitialized) {
68
68
  // dispatchHistoryChangedEvent("forward", previousState, enhancedState);
69
69
  };
70
70
 
71
- history.getCurrentIndex = () => currentIndex;
71
+ history.getCurrentIndex = function () {
72
+ return currentIndex;
73
+ };
72
74
 
73
75
  // Override replaceState
74
- history.replaceState = (
76
+ history.replaceState = function (
75
77
  state,
76
78
  title,
77
79
  url,
78
- ) => {
80
+ ) {
79
81
  const enhancedState = { ...state, __heindex: currentIndex, __url: url };
80
82
  logState(enhancedState, currentIndex); // Replace state in history
81
83
  originalReplaceState.call(
@@ -87,12 +89,12 @@ if (!history.__historyExtendedInitialized) {
87
89
  };
88
90
 
89
91
  // Adds history changed handler
90
- history.addHistoryChangedListener = (listener) => {
92
+ history.addHistoryChangedListener = function (listener) {
91
93
  listeners.push(listener);
92
94
  };
93
95
 
94
96
  // Removes history changed handler
95
- history.removeHistoryChangedListener = (listener) => {
97
+ history.removeHistoryChangedListener = function (listener) {
96
98
  const indexToRemove = listeners.findIndex(item => item === listener);
97
99
  if (indexToRemove !== -1) {
98
100
  listeners.splice(indexToRemove, 1);
@@ -173,7 +175,7 @@ if (!history.__historyExtendedInitialized) {
173
175
  });
174
176
 
175
177
  // Add silent back navigation method
176
- history.silentBack = () => {
178
+ history.silentBack = function () {
177
179
  const targetState = stateHistory[currentIndex - 1];
178
180
  if (targetState != null) {
179
181
  targetState.__silentMode = true;
@@ -186,7 +188,7 @@ if (!history.__historyExtendedInitialized) {
186
188
  };
187
189
 
188
190
  // Add clear forward navigation method
189
- history.clearForward = () => {
191
+ history.clearForward = function () {
190
192
  if (currentIndex > 0) {
191
193
  const prevState = stateHistory[currentIndex];
192
194
  const targetState = stateHistory[currentIndex - 1];
@@ -202,7 +204,9 @@ if (!history.__historyExtendedInitialized) {
202
204
  }
203
205
  };
204
206
 
205
- history.nextBackWillNavigateAway = () => currentIndex < 1;
207
+ history.nextBackWillNavigateAway = function () {
208
+ return currentIndex < 1;
209
+ };
206
210
  })();
207
211
  }
208
212
 
@@ -6,9 +6,13 @@ export default class KeyboardOpenTracker {
6
6
 
7
7
  (window as any)._keyboardOpenTrackerBound = true;
8
8
 
9
- const getOrientation = () => window.matchMedia('(orientation: portrait)').matches ? 'portrait' : 'landscape';
9
+ const getOrientation = () => {
10
+ return window.matchMedia('(orientation: portrait)').matches ? 'portrait' : 'landscape';
11
+ };
10
12
 
11
- const getScreenHeight = () => window.screen.height;
13
+ const getScreenHeight = () => {
14
+ return window.screen.height; // Constant physical screen height
15
+ };
12
16
 
13
17
  let lastOrientation = getOrientation();
14
18
  const handleResize = () => {
@@ -16,13 +16,13 @@ namespace laddaLiteUtils {
16
16
  * Utility function to create elements. If no tag name is given,
17
17
  * a DIV is created. Optionally properties can be passed.
18
18
  */
19
- const createEl = (tag?: any, prop?: any) => {
19
+ function createEl(tag?: any, prop?: any) {
20
20
  const el = document.createElement(tag || 'div');
21
21
  let n;
22
22
 
23
23
  for (n in prop) { el[n] = prop[n]; }
24
24
  return el;
25
- };
25
+ }
26
26
 
27
27
  /**
28
28
  * Appends children and returns the parent.
@@ -36,7 +36,7 @@ namespace laddaLiteUtils {
36
36
  /**
37
37
  * Insert a new stylesheet to hold the @keyframe or VML rules.
38
38
  */
39
- const sheet = (() => {
39
+ const sheet = (function () {
40
40
  const el = createEl('style', { type: 'text/css' });
41
41
  ins(document.getElementsByTagName('head')[0], el);
42
42
  return el.sheet || el.styleSheet;
@@ -47,12 +47,12 @@ namespace laddaLiteUtils {
47
47
  * Since most mobile Webkits have timing issues with animation-delay,
48
48
  * we create separate rules for each line/segment.
49
49
  */
50
- const addAnimation = (
50
+ function addAnimation(
51
51
  alpha: any,
52
52
  trail: any,
53
53
  i: any,
54
54
  lines: any,
55
- ) => {
55
+ ) {
56
56
  const name = [
57
57
  'opacity',
58
58
  trail,
@@ -93,12 +93,12 @@ namespace laddaLiteUtils {
93
93
  }
94
94
 
95
95
  return name;
96
- };
96
+ }
97
97
 
98
98
  /**
99
99
  * Tries various vendor prefixes and returns the first supported property.
100
100
  */
101
- const vendor = (el: any, prop: any) => {
101
+ function vendor(el: any, prop: any) {
102
102
  const s = el.style;
103
103
  let pp;
104
104
  let i;
@@ -109,16 +109,16 @@ namespace laddaLiteUtils {
109
109
  if (s[pp] !== undefined) { return pp; }
110
110
  }
111
111
  if (s[prop] !== undefined) { return prop; }
112
- };
112
+ }
113
113
 
114
114
  /**
115
115
  * Sets multiple style properties at once.
116
116
  */
117
- const css = (el: any, prop: any) => {
117
+ function css(el: any, prop: any) {
118
118
  for (const n in prop) { el.style[vendor(el, n) || n] = prop[n]; }
119
119
 
120
120
  return el;
121
- };
121
+ }
122
122
 
123
123
  /**
124
124
  * Fills in default values.
@@ -136,17 +136,19 @@ namespace laddaLiteUtils {
136
136
  /**
137
137
  * Returns the absolute page-offset of the given element.
138
138
  */
139
- const pos = (el: any) => {
139
+ function pos(el: any) {
140
140
  const o = { x: el.offsetLeft, y: el.offsetTop };
141
141
  while ((el = el.offsetParent)) { (o.x += el.offsetLeft), (o.y += el.offsetTop); }
142
142
 
143
143
  return o;
144
- };
144
+ }
145
145
 
146
146
  /**
147
147
  * Returns the line color from the given string or array.
148
148
  */
149
- const getColor = (color: any, idx: any) => typeof color == 'string' ? color : color[idx % color.length];
149
+ function getColor(color: any, idx: any) {
150
+ return typeof color == 'string' ? color : color[idx % color.length];
151
+ }
150
152
 
151
153
  const mergedOpts = merge(spinnerArgs || {}, {
152
154
  lines: 12, // The number of lines to draw
@@ -214,21 +216,23 @@ namespace laddaLiteUtils {
214
216
  return this;
215
217
  },
216
218
 
217
- lines: (el: any, o: any) => {
219
+ lines(el: any, o: any) {
218
220
  let i = 0;
219
221
  const start = ((o.lines - 1) * (1 - o.direction)) / 2;
220
222
  let seg;
221
223
 
222
- const fill = (color: any, shadow: any) => css(createEl(), {
223
- position: 'absolute',
224
- width: `${o.length + o.width}px`,
225
- height: `${o.width}px`,
226
- background: color,
227
- boxShadow: shadow,
228
- transformOrigin: 'left',
229
- transform: `rotate(${~~((360 / o.lines) * i + o.rotate)}deg) translate(${o.radius}px` + `,0)`,
230
- borderRadius: `${(o.corners * o.width) >> 1}px`,
231
- });
224
+ function fill(color: any, shadow: any) {
225
+ return css(createEl(), {
226
+ position: 'absolute',
227
+ width: `${o.length + o.width}px`,
228
+ height: `${o.width}px`,
229
+ background: color,
230
+ boxShadow: shadow,
231
+ transformOrigin: 'left',
232
+ transform: `rotate(${~~((360 / o.lines) * i + o.rotate)}deg) translate(${o.radius}px` + `,0)`,
233
+ borderRadius: `${(o.corners * o.width) >> 1}px`,
234
+ });
235
+ }
232
236
 
233
237
  for (; i < o.lines; i++) {
234
238
  seg = css(createEl(), {
@@ -255,11 +259,11 @@ namespace laddaLiteUtils {
255
259
  * Internal method that adjusts the opacity of a single line.
256
260
  * Will be overwritten in VML fallback mode below.
257
261
  */
258
- opacity: (
262
+ opacity(
259
263
  el: any,
260
264
  i: any,
261
265
  val: any,
262
- ) => {
266
+ ) {
263
267
  if (i < el.childNodes.length) { el.childNodes[i].style.opacity = val; }
264
268
  },
265
269
  };
@@ -268,7 +272,7 @@ namespace laddaLiteUtils {
268
272
  var ID_ATTRIBUTE = 'data-inv-lid';
269
273
  export var instanceCache: any = {};
270
274
 
271
- export const getTarget = (target: any): any => {
275
+ export function getTarget(target: any): any {
272
276
  let realTarget: HTMLElement;
273
277
  let retTarget: HTMLElement;
274
278
  let navCount = 0;
@@ -303,11 +307,13 @@ namespace laddaLiteUtils {
303
307
  }
304
308
 
305
309
  return retTarget;
306
- };
310
+ }
307
311
 
308
- export const getInstanceId = (target: any) => target.getAttribute(ID_ATTRIBUTE);
312
+ export function getInstanceId(target: any) {
313
+ return target.getAttribute(ID_ATTRIBUTE);
314
+ }
309
315
 
310
- const createSpinner = (button: any) => {
316
+ function createSpinner(button: any) {
311
317
  let height = button.offsetHeight;
312
318
  if (height === 0) {
313
319
  height = parseFloat(<any>window.getComputedStyle(button).height);
@@ -329,23 +335,25 @@ namespace laddaLiteUtils {
329
335
  left: 'auto',
330
336
  className: '',
331
337
  });
332
- };
338
+ }
333
339
 
334
- const getButtonSpinner = (button: any) => button._spinner;
340
+ function getButtonSpinner(button: any) {
341
+ return button._spinner;
342
+ }
335
343
 
336
- const wrapContent = (node: any, wrapper: any) => {
344
+ function wrapContent(node: any, wrapper: any) {
337
345
  const r = document.createRange();
338
346
  r.selectNodeContents(node);
339
347
  r.surroundContents(wrapper);
340
348
  node.appendChild(wrapper);
341
- };
349
+ }
342
350
 
343
351
  interface LaddaInstance {
344
352
  timer: number;
345
353
  spinner: any;
346
354
  }
347
355
 
348
- export const createLaddaInstance = (button: any) => {
356
+ export function createLaddaInstance(button: any) {
349
357
  const laddaLabel = document.createElement('span');
350
358
  laddaLabel.setAttribute('class', 'ladda-label');
351
359
 
@@ -372,7 +380,7 @@ namespace laddaLiteUtils {
372
380
 
373
381
  instanceCache[newId] = laddaInstance;
374
382
  return laddaInstance;
375
- };
383
+ }
376
384
  }
377
385
 
378
386
  export class LaddaLite {
@@ -31,18 +31,18 @@ export class LocalStorageImpl {
31
31
  let newStorage = new LocalStorageImpl();
32
32
  if (window.Proxy && window.Reflect) {
33
33
  newStorage = new window.Proxy(newStorage, {
34
- get: (target, prop: any) => {
34
+ get(target, prop: any) {
35
35
  if ((storage as any)[prop] != null) {
36
36
  return window.Reflect.get(target, prop);
37
37
  } else {
38
38
  return storage.getItem(`public.${prop}`);
39
39
  }
40
40
  },
41
- set: (
41
+ set(
42
42
  target,
43
43
  prop,
44
44
  value,
45
- ) => {
45
+ ) {
46
46
  storage.setItem(`public.${prop as any}`, value);
47
47
  return true;
48
48
  },