@fintatech/fintachart 3.1.0 → 3.1.2

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 (38) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +10 -8
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/basic-objects.html +2 -6
  5. package/css/FintaChart.min.css +1 -1
  6. package/custom-indicator.html +2 -6
  7. package/d.ts/FintaChart.d.ts +523 -179
  8. package/d.ts/frameworks/bootstrap.v3.datetimepicker.d.ts +3 -3
  9. package/d.ts/frameworks/html2canvas.d.ts +0 -2
  10. package/d.ts/frameworks-modified/autocolumnlist.d.ts +8 -0
  11. package/d.ts/frameworks-modified/spectrum.d.ts +17 -26
  12. package/d.ts/frameworks-modified/toastr.d.ts +9 -10
  13. package/htmldialogs/Toolbar.html +4 -4
  14. package/index-dark.html +2 -6
  15. package/index.html +2 -6
  16. package/multiple-charts.html +2 -6
  17. package/package.json +1 -1
  18. package/scripts/FintaChart.min.js +2 -2
  19. package/scripts/frameworks/bootstrap.v3.datetimepicker.min.js +10 -10
  20. package/scripts/frameworks-modified/autocolumnlist.js +48 -0
  21. package/scripts/frameworks-modified/spectrum.js +187 -6
  22. package/scripts/frameworks-modified/switchery.js +1 -1
  23. package/scripts/frameworks-modified/toastr.js +283 -382
  24. package/scripts/jsdataadapters/fileDataAdapter.js +2 -0
  25. package/d.ts/frameworks/jquery-i18next.d.ts +0 -14
  26. package/d.ts/frameworks/jquery-ui.d.ts +0 -1914
  27. package/d.ts/frameworks/jquery.d.ts +0 -3779
  28. package/d.ts/frameworks/jquery.ui.touch-punch.d.ts +0 -12
  29. package/d.ts/frameworks-modified/bootstrap-select.d.ts +0 -18
  30. package/d.ts/frameworks-modified/jquery.autocolumnlist.d.ts +0 -17
  31. package/d.ts/frameworks-modified/jquery.resizable.d.ts +0 -20
  32. package/scripts/frameworks/jquery-i18next.min.js +0 -1
  33. package/scripts/frameworks/jquery-ui.min.js +0 -8
  34. package/scripts/frameworks/jquery.min.js +0 -3
  35. package/scripts/frameworks/jquery.ui.touch-punch.min.js +0 -1
  36. package/scripts/frameworks-modified/bootstrap-select.js +0 -1024
  37. package/scripts/frameworks-modified/jquery.autocolumnlist.js +0 -48
  38. package/scripts/frameworks-modified/jquery.resizable.js +0 -229
@@ -5,410 +5,311 @@ var FintaChart;
5
5
  var External;
6
6
  (function (External) {
7
7
 
8
- (function (define) {
9
- define(['jquery'], function ($) {
10
- return (function () {
11
- var $container;
12
- var listener;
13
- var toastId = 0;
14
- var toastType = {
15
- error: 'error',
16
- info: 'info',
17
- success: 'success',
18
- warning: 'warning'
19
- };
20
-
21
- var toastr = {
22
- clear: clear,
23
- remove: remove,
24
- error: error,
25
- getContainer: getContainer,
26
- info: info,
27
- options: {},
28
- subscribe: subscribe,
29
- success: success,
30
- version: '2.1.1',
31
- warning: warning
32
- };
33
-
34
- var previousToast;
35
-
36
- return toastr;
37
-
38
- ////////////////
39
-
40
- function error(message, title, optionsOverride) {
41
- return notify({
42
- type: toastType.error,
43
- iconClass: getOptions().iconClasses.error,
44
- message: message,
45
- optionsOverride: optionsOverride,
46
- title: title
47
- });
48
- }
49
-
50
- function getContainer(options, create) {
51
- if (!options) { options = getOptions(); }
52
- $container = $('#' + options.containerId);
53
- if ($container.length) {
54
- return $container;
55
- }
56
- if (create) {
57
- $container = createContainer(options);
58
- }
59
- return $container;
60
- }
61
-
62
- function info(message, title, optionsOverride) {
63
- return notify({
64
- type: toastType.info,
65
- iconClass: getOptions().iconClasses.info,
66
- message: message,
67
- optionsOverride: optionsOverride,
68
- title: title
69
- });
70
- }
8
+ // ---------------------------------------------------------------------------
9
+ // Toastr - native JS rewrite (no external dependency)
10
+ // ---------------------------------------------------------------------------
11
+ (function () {
12
+ var container = null;
13
+ var listener = null;
14
+ var toastId = 0;
15
+ var previousToast;
16
+
17
+ var toastType = {
18
+ error: 'error',
19
+ info: 'info',
20
+ success: 'success',
21
+ warning: 'warning'
22
+ };
23
+
24
+ var toastr = {
25
+ clear: clear,
26
+ remove: remove,
27
+ error: error,
28
+ getContainer: getContainer,
29
+ info: info,
30
+ options: {},
31
+ subscribe: subscribe,
32
+ success: success,
33
+ version: '2.1.1',
34
+ warning: warning
35
+ };
36
+
37
+ window['toastr'] = toastr;
38
+
39
+ // ---- Public API -------------------------------------------------------
40
+
41
+ function error(message, title, optionsOverride) {
42
+ return notify({ type: toastType.error, iconClass: getOptions().iconClasses.error, message: message, optionsOverride: optionsOverride, title: title });
43
+ }
44
+ function info(message, title, optionsOverride) {
45
+ return notify({ type: toastType.info, iconClass: getOptions().iconClasses.info, message: message, optionsOverride: optionsOverride, title: title });
46
+ }
47
+ function success(message, title, optionsOverride) {
48
+ return notify({ type: toastType.success, iconClass: getOptions().iconClasses.success, message: message, optionsOverride: optionsOverride, title: title });
49
+ }
50
+ function warning(message, title, optionsOverride) {
51
+ return notify({ type: toastType.warning, iconClass: getOptions().iconClasses.warning, message: message, optionsOverride: optionsOverride, title: title });
52
+ }
53
+ function subscribe(callback) { listener = callback; }
54
+
55
+ function getContainer(options, create) {
56
+ if (!options) options = getOptions();
57
+ container = document.getElementById(options.containerId);
58
+ if (container) return container;
59
+ if (create) container = createContainer(options);
60
+ return container;
61
+ }
71
62
 
72
- function subscribe(callback) {
73
- listener = callback;
74
- }
63
+ function clear(toastElement, clearOptions) {
64
+ var options = getOptions();
65
+ if (!container) getContainer(options);
66
+ if (!clearToast(toastElement, options, clearOptions)) {
67
+ clearContainer(options);
68
+ }
69
+ }
75
70
 
76
- function success(message, title, optionsOverride) {
77
- return notify({
78
- type: toastType.success,
79
- iconClass: getOptions().iconClasses.success,
80
- message: message,
81
- optionsOverride: optionsOverride,
82
- title: title
83
- });
84
- }
71
+ function remove(toastElement) {
72
+ var options = getOptions();
73
+ if (!container) getContainer(options);
74
+ if (toastElement && toastElement.querySelector(':focus') === null) {
75
+ removeToast(toastElement);
76
+ return;
77
+ }
78
+ if (container && container.children.length) {
79
+ container.remove();
80
+ }
81
+ }
85
82
 
86
- function warning(message, title, optionsOverride) {
87
- return notify({
88
- type: toastType.warning,
89
- iconClass: getOptions().iconClasses.warning,
90
- message: message,
91
- optionsOverride: optionsOverride,
92
- title: title
93
- });
94
- }
83
+ // ---- Internal ---------------------------------------------------------
95
84
 
96
- function clear($toastElement, clearOptions) {
97
- var options = getOptions();
98
- if (!$container) { getContainer(options); }
99
- if (!clearToast($toastElement, options, clearOptions)) {
100
- clearContainer(options);
101
- }
102
- }
85
+ function clearContainer(options) {
86
+ var toasts = Array.from(container.children);
87
+ for (var i = toasts.length - 1; i >= 0; i--) {
88
+ clearToast(toasts[i], options);
89
+ }
90
+ }
103
91
 
104
- function remove($toastElement) {
105
- var options = getOptions();
106
- if (!$container) { getContainer(options); }
107
- if ($toastElement && $(':focus', $toastElement).length === 0) {
108
- removeToast($toastElement);
109
- return;
110
- }
111
- if ($container.children().length) {
112
- $container.remove();
113
- }
114
- }
92
+ function clearToast(toastElement, options, clearOptions) {
93
+ var force = clearOptions && clearOptions.force ? clearOptions.force : false;
94
+ if (toastElement && (force || !toastElement.contains(document.activeElement))) {
95
+ fadeOut(toastElement, options.hideDuration, function () { removeToast(toastElement); });
96
+ return true;
97
+ }
98
+ return false;
99
+ }
115
100
 
116
- // internal functions
101
+ function createContainer(options) {
102
+ var el = document.createElement('div');
103
+ el.id = options.containerId;
104
+ el.className = options.positionClass;
105
+ el.setAttribute('aria-live', 'polite');
106
+ el.setAttribute('role', 'alert');
107
+ var parent = FintaChart.HtmlContainer && FintaChart.HtmlContainer.nativeContainer
108
+ ? FintaChart.HtmlContainer.nativeContainer
109
+ : document.body;
110
+ parent.appendChild(el);
111
+ return el;
112
+ }
117
113
 
118
- function clearContainer (options) {
119
- var toastsToClear = $container.children();
120
- for (var i = toastsToClear.length - 1; i >= 0; i--) {
121
- clearToast($(toastsToClear[i]), options);
122
- }
114
+ function notify(map) {
115
+ var options = getOptions();
116
+ var iconClass = map.iconClass || options.iconClass;
117
+
118
+ if (typeof map.optionsOverride !== 'undefined') {
119
+ options = Object.assign({}, options, map.optionsOverride);
120
+ iconClass = map.optionsOverride.iconClass || iconClass;
121
+ }
122
+
123
+ if (shouldExit(options, map)) return;
124
+
125
+ toastId++;
126
+ container = getContainer(options, true);
127
+
128
+ var intervalId = null;
129
+ var toastElement = document.createElement('div');
130
+ var titleElement = document.createElement('div');
131
+ var messageElement = document.createElement('div');
132
+ var progressElement = document.createElement('div');
133
+ var closeElement = createCloseButton(options.closeHtml);
134
+ var progressBar = { intervalId: null, hideEta: null, maxHideTime: null };
135
+ var response = { toastId: toastId, state: 'visible', startTime: new Date(), options: options, map: map };
136
+
137
+ personalizeToast();
138
+ displayToast();
139
+ handleEvents();
140
+ publish(response);
141
+
142
+ if (options.debug && console) console.log(response);
143
+
144
+ return toastElement;
145
+
146
+ function personalizeToast() {
147
+ setIcon();
148
+ setTitle();
149
+ setMessage();
150
+ setCloseButton();
151
+ setProgressBar();
152
+ setSequence();
153
+ }
154
+
155
+ function handleEvents() {
156
+ toastElement.addEventListener('mouseenter', stickAround);
157
+ toastElement.addEventListener('mouseleave', delayedHideToast);
158
+
159
+ if (!options.onclick && options.tapToDismiss) {
160
+ toastElement.addEventListener('click', function () { hideToast(false); });
123
161
  }
124
-
125
- function clearToast ($toastElement, options, clearOptions) {
126
- var force = clearOptions && clearOptions.force ? clearOptions.force : false;
127
- if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
128
- $toastElement[options.hideMethod]({
129
- duration: options.hideDuration,
130
- easing: options.hideEasing,
131
- complete: function () { removeToast($toastElement); }
132
- });
133
- return true;
134
- }
135
- return false;
162
+ if (options.closeButton && closeElement) {
163
+ closeElement.addEventListener('click', function (event) {
164
+ event.stopPropagation();
165
+ hideToast(true);
166
+ });
136
167
  }
137
-
138
- function createContainer(options) {
139
- $container = $('<div/>')
140
- .attr('id', options.containerId)
141
- .addClass(options.positionClass)
142
- .attr('aria-live', 'polite')
143
- .attr('role', 'alert');
144
-
145
- $container.appendTo(FintaChart.HtmlContainer.container);
146
- return $container;
168
+ if (options.onclick) {
169
+ toastElement.addEventListener('click', function () {
170
+ options.onclick();
171
+ hideToast(false);
172
+ });
147
173
  }
148
-
149
- function getDefaults() {
150
- return {
151
- tapToDismiss: true,
152
- toastClass: 'toast',
153
- containerId: 'toast-container',
154
- debug: false,
155
-
156
- showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
157
- showDuration: 300,
158
- showEasing: 'swing', //swing and linear are built into jQuery
159
- onShown: undefined,
160
- hideMethod: 'fadeOut',
161
- hideDuration: 1000,
162
- hideEasing: 'swing',
163
- onHidden: undefined,
164
-
165
- extendedTimeOut: 1000,
166
- iconClasses: {
167
- error: 'toast-error',
168
- info: 'toast-info',
169
- success: 'toast-success',
170
- warning: 'toast-warning'
171
- },
172
- iconClass: 'toast-info',
173
- positionClass: 'toast-top-right',
174
- timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
175
- titleClass: 'toast-title',
176
- messageClass: 'toast-message',
177
- target: 'body',
178
- closeHtml: '<button type="button">&times;</button>',
179
- newestOnTop: true,
180
- preventDuplicates: false,
181
- progressBar: false
182
- };
174
+ }
175
+
176
+ function displayToast() {
177
+ toastElement.style.display = 'none';
178
+ fadeIn(toastElement, options.showDuration, options.onShown);
179
+
180
+ if (options.timeOut > 0) {
181
+ intervalId = setTimeout(function () { hideToast(false); }, options.timeOut);
182
+ progressBar.maxHideTime = parseFloat(options.timeOut);
183
+ progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
184
+ if (options.progressBar) {
185
+ progressBar.intervalId = setInterval(updateProgress, 10);
186
+ }
183
187
  }
184
-
185
- function publish(args) {
186
- if (!listener) { return; }
187
- listener(args);
188
+ }
189
+
190
+ function setIcon() { if (map.iconClass) { toastElement.classList.add(options.toastClass, iconClass); } }
191
+ function setSequence() { if (options.newestOnTop) { container.prepend(toastElement); } else { container.appendChild(toastElement); } }
192
+ function setTitle() { if (map.title) { titleElement.textContent = map.title; titleElement.classList.add(options.titleClass); toastElement.appendChild(titleElement); } }
193
+ function setMessage() { if (map.message) { messageElement.textContent = map.message; messageElement.classList.add(options.messageClass); toastElement.appendChild(messageElement); } }
194
+ function setCloseButton() { if (options.closeButton && closeElement) { closeElement.classList.add('toast-close-button'); closeElement.setAttribute('role', 'button'); toastElement.prepend(closeElement); } }
195
+ function setProgressBar() { if (options.progressBar) { progressElement.classList.add('toast-progress'); toastElement.prepend(progressElement); } }
196
+
197
+ function shouldExit(opts, m) {
198
+ if (opts.preventDuplicates) {
199
+ if (m.message === previousToast) return true;
200
+ previousToast = m.message;
188
201
  }
189
-
190
- function notify(map) {
191
- var options = getOptions();
192
- var iconClass = map.iconClass || options.iconClass;
193
-
194
- if (typeof (map.optionsOverride) !== 'undefined') {
195
- options = $.extend(options, map.optionsOverride);
196
- iconClass = map.optionsOverride.iconClass || iconClass;
197
- }
198
-
199
- if (shouldExit(options, map)) { return; }
200
-
201
- toastId++;
202
-
203
- $container = getContainer(options, true);
204
-
205
- var intervalId = null;
206
- var $toastElement = $('<div/>');
207
- var $titleElement = $('<div/>');
208
- var $messageElement = $('<div/>');
209
- var $progressElement = $('<div/>');
210
- var $closeElement = $(options.closeHtml);
211
- var progressBar = {
212
- intervalId: null,
213
- hideEta: null,
214
- maxHideTime: null
215
- };
216
- var response = {
217
- toastId: toastId,
218
- state: 'visible',
219
- startTime: new Date(),
220
- options: options,
221
- map: map
222
- };
223
-
224
- personalizeToast();
225
-
226
- displayToast();
227
-
228
- handleEvents();
229
-
202
+ return false;
203
+ }
204
+
205
+ function hideToast(override) {
206
+ if (!override && toastElement.contains(document.activeElement)) return;
207
+ clearTimeout(progressBar.intervalId);
208
+ fadeOut(toastElement, options.hideDuration, function () {
209
+ removeToast(toastElement);
210
+ if (options.onHidden && response.state !== 'hidden') options.onHidden();
211
+ response.state = 'hidden';
212
+ response.endTime = new Date();
230
213
  publish(response);
214
+ });
215
+ }
216
+
217
+ function delayedHideToast() {
218
+ if (options.timeOut > 0 || options.extendedTimeOut > 0) {
219
+ intervalId = setTimeout(function () { hideToast(false); }, options.extendedTimeOut);
220
+ progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
221
+ progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
222
+ }
223
+ }
224
+
225
+ function stickAround() {
226
+ clearTimeout(intervalId);
227
+ progressBar.hideEta = 0;
228
+ fadeIn(toastElement, options.showDuration);
229
+ }
230
+
231
+ function updateProgress() {
232
+ var pct = ((progressBar.hideEta - new Date().getTime()) / progressBar.maxHideTime) * 100;
233
+ progressElement.style.width = pct + '%';
234
+ }
235
+ }
231
236
 
232
- if (options.debug && console) {
233
- console.log(response);
234
- }
235
-
236
- return $toastElement;
237
-
238
- function personalizeToast() {
239
- setIcon();
240
- setTitle();
241
- setMessage();
242
- setCloseButton();
243
- setProgressBar();
244
- setSequence();
245
- }
246
-
247
- function handleEvents() {
248
- $toastElement.hover(stickAround, delayedHideToast);
249
- if (!options.onclick && options.tapToDismiss) {
250
- $toastElement.click(hideToast);
251
- }
252
-
253
- if (options.closeButton && $closeElement) {
254
- $closeElement.click(function (event) {
255
- if (event.stopPropagation) {
256
- event.stopPropagation();
257
- } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
258
- event.cancelBubble = true;
259
- }
260
- hideToast(true);
261
- });
262
- }
263
-
264
- if (options.onclick) {
265
- $toastElement.click(function () {
266
- options.onclick();
267
- hideToast();
268
- });
269
- }
270
- }
271
-
272
- function displayToast() {
273
- $toastElement.hide();
274
-
275
- $toastElement[options.showMethod](
276
- {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
277
- );
278
-
279
- if (options.timeOut > 0) {
280
- intervalId = setTimeout(hideToast, options.timeOut);
281
- progressBar.maxHideTime = parseFloat(options.timeOut);
282
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
283
- if (options.progressBar) {
284
- progressBar.intervalId = setInterval(updateProgress, 10);
285
- }
286
- }
287
- }
288
-
289
- function setIcon() {
290
- if (map.iconClass) {
291
- $toastElement.addClass(options.toastClass).addClass(iconClass);
292
- }
293
- }
294
-
295
- function setSequence() {
296
- if (options.newestOnTop) {
297
- $container.prepend($toastElement);
298
- } else {
299
- $container.append($toastElement);
300
- }
301
- }
302
-
303
- function setTitle() {
304
- if (map.title) {
305
- $titleElement.append(map.title).addClass(options.titleClass);
306
- $toastElement.append($titleElement);
307
- }
308
- }
309
-
310
- function setMessage() {
311
- if (map.message) {
312
- $messageElement.append(map.message).addClass(options.messageClass);
313
- $toastElement.append($messageElement);
314
- }
315
- }
316
-
317
- function setCloseButton() {
318
- if (options.closeButton) {
319
- $closeElement.addClass('toast-close-button').attr('role', 'button');
320
- $toastElement.prepend($closeElement);
321
- }
322
- }
323
-
324
- function setProgressBar() {
325
- if (options.progressBar) {
326
- $progressElement.addClass('toast-progress');
327
- $toastElement.prepend($progressElement);
328
- }
329
- }
330
-
331
- function shouldExit(options, map) {
332
- if (options.preventDuplicates) {
333
- if (map.message === previousToast) {
334
- return true;
335
- } else {
336
- previousToast = map.message;
337
- }
338
- }
339
- return false;
340
- }
341
-
342
- function hideToast(override) {
343
- if ($(':focus', $toastElement).length && !override) {
344
- return;
345
- }
346
- clearTimeout(progressBar.intervalId);
347
- return $toastElement[options.hideMethod]({
348
- duration: options.hideDuration,
349
- easing: options.hideEasing,
350
- complete: function () {
351
- removeToast($toastElement);
352
- if (options.onHidden && response.state !== 'hidden') {
353
- options.onHidden();
354
- }
355
- response.state = 'hidden';
356
- response.endTime = new Date();
357
- publish(response);
358
- }
359
- });
360
- }
237
+ function getDefaults() {
238
+ return {
239
+ tapToDismiss: true,
240
+ toastClass: 'toast',
241
+ containerId: 'toast-container',
242
+ debug: false,
243
+ showDuration: 300,
244
+ onShown: undefined,
245
+ hideDuration: 1000,
246
+ onHidden: undefined,
247
+ extendedTimeOut: 1000,
248
+ iconClasses: { error: 'toast-error', info: 'toast-info', success: 'toast-success', warning: 'toast-warning' },
249
+ iconClass: 'toast-info',
250
+ positionClass: 'toast-top-right',
251
+ timeOut: 5000,
252
+ titleClass: 'toast-title',
253
+ messageClass: 'toast-message',
254
+ target: 'body',
255
+ closeHtml: '<button type="button">&times;</button>',
256
+ newestOnTop: true,
257
+ preventDuplicates: false,
258
+ progressBar: false,
259
+ closeButton: false,
260
+ onclick: null
261
+ };
262
+ }
361
263
 
362
- function delayedHideToast() {
363
- if (options.timeOut > 0 || options.extendedTimeOut > 0) {
364
- intervalId = setTimeout(hideToast, options.extendedTimeOut);
365
- progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
366
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
367
- }
368
- }
264
+ function publish(args) { if (listener) listener(args); }
369
265
 
370
- function stickAround() {
371
- clearTimeout(intervalId);
372
- progressBar.hideEta = 0;
373
- $toastElement.stop(true, true)[options.showMethod](
374
- {duration: options.showDuration, easing: options.showEasing}
375
- );
376
- }
266
+ function getOptions() {
267
+ return Object.assign({}, getDefaults(), toastr.options);
268
+ }
377
269
 
378
- function updateProgress() {
379
- var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
380
- $progressElement.width(percentage + '%');
381
- }
382
- }
270
+ function removeToast(toastElement) {
271
+ if (!container) container = getContainer();
272
+ if (toastElement && toastElement.offsetParent !== null) return; // still visible
273
+ if (toastElement) toastElement.remove();
274
+ if (container && container.children.length === 0) {
275
+ container.remove();
276
+ container = null;
277
+ previousToast = undefined;
278
+ }
279
+ }
383
280
 
384
- function getOptions() {
385
- return $.extend({}, getDefaults(), toastr.options);
386
- }
281
+ function createCloseButton(html) {
282
+ if (!html) return null;
283
+ var tmp = document.createElement('div');
284
+ tmp.innerHTML = html;
285
+ return tmp.firstElementChild;
286
+ }
387
287
 
388
- function removeToast($toastElement) {
389
- if (!$container) { $container = getContainer(); }
390
- if ($toastElement.is(':visible')) {
391
- return;
392
- }
393
- $toastElement.remove();
394
- $toastElement = null;
395
- if ($container.children().length === 0) {
396
- $container.remove();
397
- previousToast = undefined;
288
+ // Simple CSS-transition-based fade helpers
289
+ function fadeIn(el, duration, onComplete) {
290
+ el.style.transition = 'opacity ' + (duration || 300) + 'ms';
291
+ el.style.opacity = '0';
292
+ el.style.display = '';
293
+ requestAnimationFrame(function () {
294
+ requestAnimationFrame(function () {
295
+ el.style.opacity = '1';
296
+ if (onComplete) {
297
+ setTimeout(onComplete, duration || 300);
398
298
  }
399
- }
299
+ });
300
+ });
301
+ }
400
302
 
401
- })();
402
- });
403
- }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
404
- if (typeof module !== 'undefined' && module.exports) { //Node
405
- module.exports = factory(require('jquery'));
406
- } else {
407
- window['toastr'] = factory(window['jQuery']);
303
+ function fadeOut(el, duration, onComplete) {
304
+ el.style.transition = 'opacity ' + (duration || 1000) + 'ms';
305
+ el.style.opacity = '0';
306
+ setTimeout(function () {
307
+ el.style.display = 'none';
308
+ if (onComplete) onComplete();
309
+ }, duration || 1000);
408
310
  }
409
- }));
311
+
312
+ })();
410
313
 
411
314
  })(External = FintaChart.External || (FintaChart.External = {}));
412
315
  })(FintaChart || (FintaChart = {}));
413
-
414
-